/* Gold Rush Outlaws — Old-West UI: leather, brass, cream paper, ember orange. Fonts: Rye (display) + Oswald (UI). */
@font-face { font-family: 'Rye'; src: url('../assets/fonts/Rye.ttf') format('truetype'); font-display: block; }
@font-face { font-family: 'Oswald'; src: url('../assets/fonts/Oswald.ttf') format('truetype'); font-weight: 200 700; font-display: block; }
:root { --gold: #f2b632; --gold2: #ffdf8e; --ember: #e8571f; --cream: #f3e2bf; --leather: #24150b; --leather2: #3a2412; --tq: #2ec4b6; --bar: clamp(64px, 10.5vh, 104px); --k: 1; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #100905; color: var(--cream); font-family: 'Oswald', sans-serif; font-weight: 500; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: 0; color: inherit; background: none; padding: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shine { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes glowb { 0%, 100% { box-shadow: 0 0 10px rgba(242, 182, 50, .35), inset 0 1px 0 rgba(255, 240, 200, .5); } 50% { box-shadow: 0 0 24px rgba(242, 182, 50, .7), inset 0 1px 0 rgba(255, 240, 200, .5); } }

/* loader */
#loader { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 45%, #4a2a12 0%, #140b06 72%); transition: opacity .5s; }
.loaderInner { text-align: center; width: min(560px, 88vw); }
#loaderTitle { font-family: 'Rye'; font-size: clamp(30px, 6.2vw, 58px); line-height: 1.05; letter-spacing: .04em; color: var(--gold2); text-shadow: 0 3px 0 #5a2c08, 0 0 24px rgba(232, 87, 31, .55); margin-bottom: 12px; }
.bar { height: 6px; border-radius: 3px; background: rgba(243, 226, 191, .14); overflow: hidden; margin: 18px auto 10px; width: 80%; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a5541a, var(--gold), #fff2c4); transition: width .2s; }
#loadTxt { letter-spacing: .3em; font-size: 13px; color: var(--gold); }
.disclaimer { margin-top: 18px; font-size: 12px; opacity: .5; letter-spacing: .2em; }
.brassBtn { font-family: 'Rye'; letter-spacing: .1em; color: #2a1404; padding: 12px 54px; font-size: 22px; border-radius: 8px; background: linear-gradient(180deg, #ffe7a0 0%, #f2b632 45%, #b9741a 100%); box-shadow: inset 0 1px 0 #fff6d8, inset 0 -3px 0 rgba(90, 44, 8, .45), 0 4px 0 #5a2c08, 0 8px 18px rgba(0, 0, 0, .5); animation: glowb 2.4s infinite; text-shadow: 0 1px 0 rgba(255, 240, 200, .6); }
.brassBtn:active { transform: translateY(3px); box-shadow: inset 0 1px 0 #fff6d8, 0 1px 0 #5a2c08; }
#btnStart { margin-top: 16px; font-size: 26px; }
.ghost { font-family: 'Oswald'; font-weight: 600; letter-spacing: .15em; color: var(--cream); border: 1.5px solid rgba(243, 226, 191, .4); border-radius: 8px; background: rgba(243, 226, 191, .06); }

/* bottom bar: frameless leather strip, three zones */
#ui { position: fixed; left: 0; right: 0; bottom: 0; height: var(--bar); z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(8px, 2vw, 32px); padding: 0 clamp(10px, 2.6vw, 44px) env(safe-area-inset-bottom);
  background: linear-gradient(180deg, rgba(16, 9, 4, 0) 0%, rgba(16, 9, 4, .7) 26%, rgba(12, 7, 3, .92) 100%); }
#ui::before { content: ''; position: absolute; left: 4%; right: 4%; top: 14%; height: 2px; background: linear-gradient(90deg, transparent, rgba(242, 182, 50, .7) 25%, #ffe9a8 50%, rgba(242, 182, 50, .7) 75%, transparent); background-size: 200% 100%; animation: shine 7s linear infinite; opacity: .7; }
.zone { display: flex; align-items: center; min-width: 0; }
.zl { justify-content: flex-start; gap: clamp(10px, 2vw, 30px); } .zr { justify-content: flex-end; gap: clamp(10px, 2vw, 30px); } .zc { justify-content: center; gap: clamp(6px, 1.2vw, 18px); }
.tools { display: flex; gap: clamp(2px, .6vw, 8px); }
.icon { width: clamp(26px, 4vh, 38px); height: clamp(26px, 4vh, 38px); color: rgba(243, 226, 191, .72); transition: color .2s, filter .2s; }
.icon:hover { color: var(--gold2); filter: drop-shadow(0 0 6px var(--gold)); }
.icon svg { width: 100%; height: 100%; }
#btnMute .x { display: none; } body.muted #btnMute .x { display: block; } body.muted #btnMute .waves { display: none; }
.stat { display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.stat label { font-size: clamp(11px, 1.9vh, 16px); letter-spacing: .22em; color: var(--gold); font-weight: 600; }
.stat span { font-size: clamp(18px, 3.6vh, 34px); font-weight: 700; color: #fff8e6; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); font-variant-numeric: tabular-nums; }
.stat.win { align-items: flex-end; text-align: right; } .stat.win label { color: var(--ember); }
.stat.win span { color: var(--gold2); text-shadow: 0 0 14px rgba(242, 182, 50, .5), 0 2px 0 rgba(0, 0, 0, .6); }
.msg { display: none; }
.betBox { display: flex; flex-direction: column; align-items: center; min-width: clamp(72px, 9vw, 130px); line-height: 1.05; }
.betBox label { font-size: clamp(10px, 1.7vh, 15px); letter-spacing: .3em; color: var(--gold); font-weight: 600; }
.betBox span { font-size: clamp(18px, 3.4vh, 32px); font-weight: 700; color: #fff8e6; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); font-variant-numeric: tabular-nums; }
.pm { width: clamp(32px, 5.2vh, 48px); height: clamp(32px, 5.2vh, 48px); border-radius: 50%; font-size: clamp(20px, 3.4vh, 30px); line-height: 1; font-weight: 600; color: #2a1404; background: linear-gradient(180deg, #ffe7a0, #f2b632 55%, #b9741a); box-shadow: inset 0 1px 0 #fff6d8, 0 3px 0 #5a2c08, 0 5px 10px rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; }
.pm:active { transform: translateY(2px); } .pm:disabled { opacity: .35; }
.spinWrap { position: relative; margin: 0 clamp(2px, .8vw, 12px); }
#btnSpin { position: relative; width: clamp(64px, 11vh, 96px); height: clamp(64px, 11vh, 96px); border-radius: 50%; color: #2a1404; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #fff0bd 0%, #f2b632 48%, #a8611a 100%); box-shadow: inset 0 2px 0 #fff8dc, inset 0 -5px 0 rgba(90, 44, 8, .45), 0 5px 0 #5a2c08, 0 10px 22px rgba(0, 0, 0, .55), 0 0 26px rgba(242, 182, 50, .35); transition: transform .1s; }
#btnSpin .ring { position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 60%, rgba(255, 233, 168, .25) 70%, #fff0c0 92%, transparent 93% 100%); -webkit-mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px)); mask: radial-gradient(circle, transparent calc(50% - 3px), #000 calc(50% - 2px)); animation: spin 3s linear infinite; }
#btnSpin svg { width: 54%; height: 54%; transition: transform .5s; }
#btnSpin.busy svg { animation: spin .6s linear infinite; } #btnSpin.busy .ring { animation-duration: .8s; }
#btnSpin:active { transform: translateY(3px) scale(.97); }
#autoCount { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: clamp(18px, 3.4vh, 30px); font-weight: 700; color: #2a1404; pointer-events: none; }
#btnSpin:has(#autoCount:not(:empty)) svg { opacity: .15; }
.pills { display: flex; flex-direction: column; gap: 6px; }
.pill { height: clamp(22px, 3.6vh, 30px); padding: 0 12px; border-radius: 15px; font-weight: 600; font-size: clamp(10px, 1.6vh, 13px); letter-spacing: .16em; color: var(--cream); background: rgba(58, 36, 18, .8); box-shadow: inset 0 0 0 1.5px rgba(242, 182, 50, .55); display: flex; align-items: center; gap: 5px; justify-content: center; }
.pill svg { width: 12px; height: 12px; }
.pill.on { color: #2a1404; background: var(--gold); box-shadow: 0 0 12px rgba(242, 182, 50, .7); }

/* Buy poster (wanted-poster paper) */
#sideTiles { position: fixed; z-index: 9; left: 20px; top: 120px; width: 170px; font-size: calc(15px * var(--k)); transition: opacity .3s; }
.poster { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; padding: .8em .6em .9em; text-align: center; color: #2a1404; background: linear-gradient(170deg, #f7e6bd 0%, #e6c98a 60%, #cfa460 100%); border-radius: 4px;
  box-shadow: inset 0 0 0 3px rgba(122, 68, 20, .55), inset 0 0 26px rgba(122, 68, 20, .35), 0 8px 18px rgba(0, 0, 0, .55); transform: rotate(-1.6deg); transition: transform .15s; }
.poster::before, .poster::after { content: ''; position: absolute; top: .45em; width: .55em; height: .55em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #8a6a3a 60%, #3a2412); }
.poster::before { left: .5em; } .poster::after { right: .5em; }
.poster:hover { transform: rotate(0deg) scale(1.03); } .poster:active { transform: scale(.97); }
.poster .pTop { font-weight: 700; font-size: .72em; letter-spacing: .5em; color: #9c3d12; margin-top: .3em; }
.poster .pTitle { font-family: 'Rye'; font-size: 1.15em; line-height: 1.05; margin: .25em 0 .2em; color: #3a1c07; }
.poster .pPrice { display: flex; flex-direction: column; align-items: center; padding: .3em .9em .35em; margin: .2em 0; border-top: 2px solid rgba(90, 44, 8, .6); border-bottom: 2px solid rgba(90, 44, 8, .6); }
.poster .pPrice small { font-size: .7em; letter-spacing: .4em; font-weight: 600; color: #7a3a10; }
.poster .pPrice b { font-size: 1.7em; font-weight: 700; line-height: 1.05; white-space: nowrap; color: #2a1404; }
.poster .pSub { font-size: .78em; font-weight: 600; letter-spacing: .06em; color: #5a2c0a; }
.poster.disabled { filter: grayscale(.85) brightness(.6); pointer-events: none; }
@media (orientation: portrait) { .poster { flex-direction: row; gap: .5em; flex-wrap: wrap; justify-content: center; padding: .5em .8em; } .poster .pTop, .poster .pSub { display: none; } .poster .pTitle { margin: 0; font-size: 1em; } .poster .pPrice { border: 0; margin: 0; padding: 0; } .poster .pPrice small { display: none; } .poster .pPrice b { font-size: 1.35em; } }

/* popups & modals */
.pop { position: fixed; z-index: 30; right: 12px; bottom: calc(var(--bar) + 12px); padding: 14px; border-radius: 10px; background: rgba(28, 16, 8, .96); box-shadow: inset 0 0 0 1.5px rgba(242, 182, 50, .6), 0 10px 30px rgba(0, 0, 0, .5); }
.popTitle { font-family: 'Rye'; font-size: 15px; letter-spacing: .1em; color: var(--gold2); margin-bottom: 10px; text-align: center; }
.autoBtns { display: flex; gap: 8px; }
.autoBtns button { width: 54px; height: 40px; border-radius: 6px; background: rgba(242, 182, 50, .1); box-shadow: inset 0 0 0 1.5px rgba(242, 182, 50, .55); color: #fff; font-weight: 700; font-size: 16px; }
.autoBtns button:hover { background: rgba(242, 182, 50, .28); }
.chk { display: block; margin-top: 10px; font-size: 14px; color: var(--cream); }
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(8, 4, 2, .78); }
.card { position: relative; width: min(460px, 92vw); max-height: 90vh; overflow: auto; padding: 26px 24px; text-align: center; background: linear-gradient(170deg, #f5e3ba, #e1c084); color: #2a1404; border-radius: 6px; box-shadow: inset 0 0 0 4px rgba(122, 68, 20, .55), inset 0 0 40px rgba(122, 68, 20, .3), 0 20px 50px rgba(0, 0, 0, .6); }
.card.wide { width: min(900px, 95vw); text-align: left; }
.card h2 { margin: 0 0 8px; font-family: 'Rye'; font-weight: 400; font-size: 27px; letter-spacing: .05em; text-align: center; color: #3a1c07; }
.card h2.h2b { margin-top: 26px; }
.card h3 { margin: 16px 0 4px; font-size: 14px; font-weight: 700; letter-spacing: .2em; color: #9c3d12; }
.card p { margin: 4px 0; color: #3a2210; line-height: 1.42; font-weight: 500; font-size: 16px; }
.card p b { color: #7a2a08; }
.card .sub { text-align: center; }
.card .row { display: flex; gap: 14px; justify-content: center; margin-top: 18px; }
.card .row button { padding: 12px 30px; font-size: 18px; }
.card .ghost { color: #3a1c07; border-color: rgba(58, 28, 7, .5); background: rgba(58, 28, 7, .06); padding: 12px 26px; }
.buyPrice { margin: 18px 0 4px; display: flex; flex-direction: column; align-items: center; }
.buyPrice span { font-size: 42px; font-weight: 700; color: #2a1404; }
.buyPrice small { opacity: .7; letter-spacing: .2em; }
.close { position: absolute; top: 8px; right: 16px; font-size: 36px; color: #7a2a08; line-height: 1; }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 12px 0 4px; }
.how .step { padding: 12px; border-radius: 6px; background: rgba(90, 44, 8, .1); box-shadow: inset 0 0 0 1.5px rgba(122, 68, 20, .4); }
.how .step i { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; font-style: normal; font-family: 'Rye'; background: #7a2a08; color: var(--gold2); margin-bottom: 6px; }
.how .step b { display: block; font-size: 15px; letter-spacing: .08em; color: #7a2a08; margin-bottom: 3px; }
.how .step span { font-size: 15px; line-height: 1.35; }
.payGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 16px 0; }
.payItem { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; background: rgba(35, 18, 6, .88); color: var(--cream); box-shadow: inset 0 0 0 1.5px rgba(242, 182, 50, .35); }
.payItem img { width: 64px; height: 64px; object-fit: contain; }
.payItem table { font-size: 15px; border-collapse: collapse; }
.payItem td { padding: 1px 5px; } .payItem td:first-child { color: var(--gold); } .payItem td:last-child { color: #fff; font-weight: 700; font-size: 14px; }
.payItem tr.hd td { font-size: 11px; letter-spacing: .12em; color: rgba(243, 226, 191, .6) !important; font-weight: 600; }
.payItem td.fsv { color: var(--gold2) !important; }
.payItem .desc { font-size: 14px; color: var(--cream); }
.copy { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; padding-top: 12px; border-top: 1px solid rgba(90, 44, 8, .4); font-size: 13px; color: #5a2c0a; margin-bottom: 8px; letter-spacing: .04em; }
.copy img { height: 34px; }

/* portrait bar: two rows */
@media (orientation: portrait) {
  :root { --bar: clamp(120px, 17vh, 150px); }
  #ui { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; align-content: end; row-gap: 4px; padding: 0 12px calc(8px + env(safe-area-inset-bottom)); }
  #ui::before { top: 5%; }
  .zl { grid-column: 1; grid-row: 1; flex-direction: row; } .zr { grid-column: 2; grid-row: 1; } .zc { grid-column: 1 / 3; grid-row: 2; }
  .zl .tools { display: none; }
  .stat span { font-size: clamp(17px, 2.8vh, 24px); }
  #btnSpin { width: clamp(62px, 9vh, 82px); height: clamp(62px, 9vh, 82px); }
  .zc { gap: 10px; }
  .pills { flex-direction: column; }
  .toolsP { display: flex; }
}
@media (max-height: 470px) and (orientation: landscape) {
  :root { --bar: 62px; }
  .pill span { display: none; } .pills { flex-direction: row; }
  #btnSpin { width: 54px; height: 54px; } .stat span { font-size: 17px; } .betBox span { font-size: 17px; }
}
body.cine #ui, body.cine #sideTiles, body.ovl #sideTiles, body.fsOn #sideTiles { opacity: 0; pointer-events: none; }
#ui { transition: opacity .5s; }

/* intro + cards */
#cineSkip { position: fixed; z-index: 45; right: 18px; top: 16px; font-weight: 700; font-size: 14px; letter-spacing: .25em; color: var(--cream); padding: 9px 18px; border-radius: 4px; background: rgba(28, 16, 8, .7); box-shadow: inset 0 0 0 1.5px rgba(242, 182, 50, .7); }
#cineCards { position: fixed; inset: 0; z-index: 44; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: radial-gradient(ellipse at 50% 45%, rgba(20, 10, 4, .55), rgba(8, 4, 2, .9)); opacity: 0; transition: opacity .35s; padding: 16px; }
#cineCards.on { opacity: 1; }
.cardsRow { display: flex; gap: clamp(10px, 2vw, 28px); justify-content: center; flex-wrap: wrap; }
.fcard { width: clamp(150px, 22vw, 280px); padding: 14px 14px 18px; text-align: center; background: linear-gradient(170deg, #f5e3ba, #dcb878); color: #2a1404; border-radius: 4px; box-shadow: inset 0 0 0 3px rgba(122, 68, 20, .55), 0 12px 26px rgba(0, 0, 0, .55); transform: translateY(24px) rotate(-1deg); opacity: 0; animation: cardIn .5s forwards; }
.fcard:nth-child(2) { animation-delay: .12s; } .fcard:nth-child(3) { animation-delay: .24s; }
@keyframes cardIn { to { transform: none; opacity: 1; } }
.fimg { position: relative; height: clamp(70px, 14vh, 130px); display: flex; align-items: center; justify-content: center; }
.fimg img { height: 100%; margin: 0 -6%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5)); animation: bob 2.4s ease-in-out infinite; }
.fimg img:nth-child(2) { animation-delay: .3s; } .fimg img:nth-child(3) { animation-delay: .6s; }
@keyframes bob { 50% { transform: translateY(-6px) scale(1.04); } }
.fimg .x100 { position: absolute; bottom: 2%; right: 8%; font-family: 'Rye'; font-size: clamp(18px, 3vh, 30px); color: #fff3c8; text-shadow: 0 2px 0 #5a2c08, 0 0 10px #e8571f; }
.fcard h3 { margin: 10px 0 6px; font-family: 'Rye'; font-weight: 400; font-size: clamp(13px, 2vh, 18px); color: #7a2a08; }
.fcard p { margin: 0; font-size: clamp(13px, 1.9vh, 16px); line-height: 1.3; color: #3a2210; }
#cineGo { font-size: clamp(17px, 2.6vh, 24px); padding: 12px 52px; }
#cineCards .chk { margin: 0; }
@media (orientation: portrait) { .fcard { width: 86vw; display: grid; grid-template-columns: 34% 1fr; text-align: left; align-items: center; column-gap: 10px; padding: 10px; } .fcard .fimg { grid-row: span 2; height: 70px; } .fcard h3 { margin: 0; } }

/* studio signature */
#studioBadge { position: fixed; z-index: 8; left: 12px; top: 10px; height: clamp(22px, 4.2vh, 40px); opacity: .92; pointer-events: none; filter: drop-shadow(0 0 6px rgba(160, 80, 255, .35)); }
@media (orientation: portrait) { #studioBadge { height: clamp(22px, 3.4vh, 30px); } }
body.cine #studioBadge { opacity: 0; }
#studio { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity .35s; }
#studio img { width: min(460px, 66vw); opacity: 0; animation: neonOn 1.6s steps(1, end) forwards, neonGlow 1.6s ease-out forwards; }
@keyframes neonOn { 0% { opacity: 0; } 8% { opacity: .8; } 11% { opacity: .05; } 17% { opacity: .9; } 21% { opacity: .2; } 26% { opacity: 1; } 31% { opacity: .5; } 34% { opacity: 1; } 100% { opacity: 1; } }
@keyframes neonGlow { 0% { filter: brightness(.6) drop-shadow(0 0 0 rgba(170, 80, 255, 0)); } 40% { filter: brightness(1.5) drop-shadow(0 0 28px rgba(170, 80, 255, .9)); } 100% { filter: brightness(1.05) drop-shadow(0 0 14px rgba(170, 80, 255, .45)); } }
#studio.out { opacity: 0; }

/* how-to-play step icons: fixed-size, never overflow the step card */
.how .step { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; overflow: hidden; }
.how .stImg { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; height: clamp(64px, 11vh, 96px); margin: 2px 0 8px; }
.how .stImg img { height: 100%; width: auto; max-width: 48%; flex: 0 1 auto; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .45)); }
.how .stImg img:only-child { max-width: 80%; }
.how .step span { display: block; }
