/* Otto — art deco theme, shared by the game (index.html) and admin (admin.html). */
@font-face { font-family: 'Limelight'; src: url('/fonts/limelight-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Poiret One'; src: url('/fonts/poiret-one-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Marcellus'; src: url('/fonts/marcellus-latin-400-normal.woff2') format('woff2'); font-display: swap; }

:root {
  --ink: #06090c;
  --panel: #0d1319;
  --panel-2: #131b23;
  --line: #2a2418;
  --gold-1: #fff3bf;
  --gold-2: #f2c552;
  --gold-3: #b9852b;
  --gold-4: #6b4910;
  --teal: #1a8794;
  --ruby: #b21f45;
  --text: #efe6cf;
  --muted: #9a927e;
  --gold-grad: linear-gradient(180deg, #fff6cc 0%, #f2c552 42%, #b9852b 68%, #f6d878 100%);
  --gold-grad-h: linear-gradient(90deg, #6b4910, #f2c552 30%, #fff3bf 50%, #f2c552 70%, #6b4910);
  --display: 'Limelight', 'Poiret One', Georgia, serif;
  --serif: 'Marcellus', Georgia, serif;
  --thin: 'Poiret One', 'Marcellus', Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--serif);
  background:
    radial-gradient(ellipse 90% 60% at 50% -8%, #1d4a5c 0%, transparent 60%),
    repeating-conic-gradient(from 0deg at 50% 118%, rgba(242,197,82,.055) 0deg 3deg, transparent 3deg 9deg),
    linear-gradient(#0b1a22, #05090c 70%);
  background-attachment: fixed;
  overflow-x: hidden;
}
.gold-text {
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
button { font-family: inherit; }

/* ============================================================ cabinet */
.cabinet {
  position: relative; width: min(1080px, calc(100vw - 20px), max(640px, calc((100vh - 290px) * 1.78))); margin: 10px auto 24px; padding: clamp(10px, 2vw, 22px);
  background: linear-gradient(180deg, #0f1a22, #070b0f);
  box-shadow: 0 0 0 3px #05080a, 0 0 0 5px var(--gold-3), 0 0 0 9px #05080a, 0 0 0 10px var(--gold-4),
    0 40px 90px rgba(0,0,0,.75), 0 0 140px rgba(242,197,82,.10);
}
.corner { position: absolute; width: clamp(34px, 6vw, 64px); aspect-ratio: 1; pointer-events: none; z-index: 5; }
.corner.tl { left: -8px; top: -8px; } .corner.tr { right: -8px; top: -8px; transform: scaleX(-1); }
.corner.bl { left: -8px; bottom: -8px; transform: scaleY(-1); } .corner.br { right: -8px; bottom: -8px; transform: scale(-1); }

/* ============================================================ marquee */
.marquee { text-align: center; padding: 0 0 10px; position: relative; }
.marquee h1 {
  margin: 0; font: 400 clamp(38px, 6.4vw, 66px)/1 var(--display); letter-spacing: .16em; padding-left: .16em;
  filter: drop-shadow(0 3px 0 #4a3208) drop-shadow(0 0 22px rgba(242,197,82,.35));
}
.marquee .sub {
  font: 400 clamp(11px, 1.7vw, 15px) var(--thin); letter-spacing: .5em; text-transform: uppercase; color: var(--gold-2);
  display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 4px;
}
.marquee .sub::before, .marquee .sub::after {
  content: ''; height: 10px; width: clamp(40px, 12vw, 150px);
  background:
    linear-gradient(var(--gold-2), var(--gold-2)) 0 50% / 100% 1px no-repeat,
    linear-gradient(var(--gold-2), var(--gold-2)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--gold-2), var(--gold-2)) 0 100% / 100% 1px no-repeat;
  opacity: .8;
}

/* ============================================================ stage */
.stage-frame {
  position: relative; padding: clamp(8px, 1.6vw, 16px);
  background: linear-gradient(135deg, #3a2a0c, #b9852b 20%, #fff3bf 35%, #b9852b 50%, #6b4910 75%, #d9a83c);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.55), 0 10px 30px rgba(0,0,0,.6);
}
.stage-frame::before {   /* marquee bulbs */
  content: ''; position: absolute; inset: 3px; pointer-events: none; z-index: 3;
  background:
    radial-gradient(circle, #fff9dc 0 26%, rgba(255,228,140,.55) 40%, transparent 55%) 0 0 / 26px 100% repeat-x,
    radial-gradient(circle, #fff9dc 0 26%, rgba(255,228,140,.55) 40%, transparent 55%) 0 100% / 26px 100% repeat-x,
    radial-gradient(circle, #fff9dc 0 26%, rgba(255,228,140,.55) 40%, transparent 55%) 0 0 / 100% 26px repeat-y,
    radial-gradient(circle, #fff9dc 0 26%, rgba(255,228,140,.55) 40%, transparent 55%) 100% 0 / 100% 26px repeat-y;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% 9px no-repeat, linear-gradient(#000 0 0) bottom / 100% 9px no-repeat,
    linear-gradient(#000 0 0) left / 9px 100% no-repeat, linear-gradient(#000 0 0) right / 9px 100% no-repeat;
  mask: linear-gradient(#000 0 0) top / 100% 9px no-repeat, linear-gradient(#000 0 0) bottom / 100% 9px no-repeat,
    linear-gradient(#000 0 0) left / 9px 100% no-repeat, linear-gradient(#000 0 0) right / 9px 100% no-repeat;
  animation: bulbs 1.2s steps(2, jump-none) infinite;
}
@keyframes bulbs { 0% { opacity: 1; } 50% { opacity: .55; } 100% { opacity: 1; } }
.stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 0 auto; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 55% at 50% 50%, #234c5e 0%, #0e2029 55%, #05090c 100%);
  box-shadow: inset 0 0 60px rgba(0,0,0,.9), inset 0 0 0 2px #000;
}
.stage::before {   /* deco sunburst behind the wheels */
  content: ''; position: absolute; inset: 0;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(242,197,82,.10) 0deg 4deg, transparent 4deg 12deg);
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 0%, transparent 72%); mask: radial-gradient(circle at 50% 50%, #000 0%, transparent 72%);
  animation: sunspin 240s linear infinite;
}
@keyframes sunspin { to { transform: rotate(360deg); } }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#fx { pointer-events: none; }
.win-band { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 2; }
.win-band.top { top: 0; height: var(--band-top, 20%); background: linear-gradient(to bottom, rgba(3,6,9,.78), rgba(3,6,9,.56) 70%, rgba(3,6,9,.42)); }
.win-band.bot { top: var(--band-bot, 80%); bottom: 0; background: linear-gradient(to top, rgba(3,6,9,.78), rgba(3,6,9,.56) 70%, rgba(3,6,9,.42)); }
.win-rail {   /* the two gold rules that frame the live 3-row window */
  position: absolute; left: 0; right: 0; height: 3px; z-index: 2; pointer-events: none;
  background: var(--gold-grad-h); box-shadow: 0 0 14px rgba(242,197,82,.7);
}
.win-rail.top { top: var(--band-top, 20%); } .win-rail.bot { top: var(--band-bot, 80%); }
.line-tabs { position: absolute; top: var(--band-top, 20%); bottom: calc(100% - var(--band-bot, 80%)); z-index: 3; width: clamp(18px, 3vw, 28px); display: flex; flex-direction: column; justify-content: space-evenly; pointer-events: none; }
.line-tabs.l { left: 0; } .line-tabs.r { right: 0; }
.line-tabs span {
  font: 400 clamp(9px, 1.4vw, 13px) var(--display); text-align: center; padding: 2px 0; color: #2b1c02;
  background: var(--gold-grad); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); opacity: .85; transition: opacity .2s, filter .2s;
}
.line-tabs.l span { clip-path: polygon(0 0, 78% 0, 100% 50%, 78% 100%, 0 100%); }
.line-tabs.r span { clip-path: polygon(22% 0, 100% 0, 100% 100%, 22% 100%, 0 50%); }
.line-tabs span.on { opacity: 1; filter: drop-shadow(0 0 6px #fff3bf) brightness(1.25); }

/* free-spin ribbon + win banner */
.free-ribbon {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 4; padding: 5px 22px 6px;
  font: 400 clamp(11px, 2vw, 17px) var(--display); letter-spacing: .14em; color: #2b1c02; background: var(--gold-grad);
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%, 14px 50%); box-shadow: 0 0 20px rgba(242,197,82,.7);
  white-space: nowrap;
}
.free-ribbon[hidden], .banner[hidden] { display: none; }
.banner {
  position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; text-align: center; cursor: pointer;
  background: radial-gradient(ellipse at center, rgba(4,8,12,.72), rgba(4,8,12,.9)); animation: bannerIn .4s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes bannerIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.banner .b-rays { position: absolute; inset: -50%; background: repeating-conic-gradient(rgba(242,197,82,.16) 0deg 5deg, transparent 5deg 15deg); animation: sunspin 40s linear infinite; -webkit-mask: radial-gradient(circle, #000, transparent 60%); mask: radial-gradient(circle, #000, transparent 60%); }
.banner .b-title { position: relative; font: 400 clamp(30px, 8vw, 78px)/1.05 var(--display); letter-spacing: .06em; filter: drop-shadow(0 3px 0 #4a3208) drop-shadow(0 0 24px rgba(242,197,82,.6)); }
.banner .b-amount { position: relative; font: 400 clamp(34px, 9vw, 92px)/1.1 var(--display); color: #fff6d0; text-shadow: 0 0 30px rgba(242,197,82,.9), 0 3px 0 #6b4910; font-variant-numeric: tabular-nums; }
.banner .b-sub { position: relative; margin-top: 8px; font: 400 clamp(12px, 2.4vw, 20px) var(--thin); letter-spacing: .3em; color: var(--gold-2); text-transform: uppercase; }
.banner .b-hint { position: relative; margin-top: 14px; font: 400 11px var(--thin); letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }

.loading { position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; gap: 14px; text-align: center; background: #05090c; font: 400 14px var(--thin); letter-spacing: .4em; color: var(--gold-2); text-transform: uppercase; transition: opacity .5s; }
.loading.done { opacity: 0; pointer-events: none; }
.loading i { display: block; width: 46px; height: 46px; margin: 0 auto; border: 3px solid var(--gold-4); border-top-color: var(--gold-2); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { color: #ff9c9c; letter-spacing: .1em; text-transform: none; font-size: 13px; }

/* ============================================================ HUD */
.hud {
  margin-top: clamp(8px, 1.2vw, 14px); display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(8px, 1.6vw, 20px); align-items: center;
}
.hud-side { display: grid; gap: 10px; }
.plaques { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plaque {
  position: relative; padding: 6px 12px 7px; text-align: center; background: linear-gradient(#05080a, #0c1218);
  border: 1px solid var(--gold-3); box-shadow: inset 0 0 0 3px #05080a, inset 0 0 0 4px var(--gold-4), inset 0 6px 14px rgba(0,0,0,.7);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
}
.plaque .lbl { display: block; font: 400 clamp(9px, 1.3vw, 12px) var(--thin); letter-spacing: .32em; text-transform: uppercase; color: var(--gold-2); opacity: .9; }
.plaque .val { display: block; margin-top: 1px; font: 400 clamp(19px, 2.9vw, 28px)/1.1 var(--display); color: #fff1bd; text-shadow: 0 0 14px rgba(242,197,82,.55); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plaque.win .val.pulse { animation: winpulse .5s ease-in-out infinite alternate; }
@keyframes winpulse { to { color: #fff; text-shadow: 0 0 28px #ffd75e, 0 0 6px #fff; } }
.plaque.wide { grid-column: 1 / -1; }

.spin-cell { display: grid; justify-items: center; gap: 6px; }
.spin-btn {
  position: relative; width: clamp(92px, 13vw, 132px); aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; color: #2b1c02;
  font: 400 clamp(20px, 3.2vw, 30px) var(--display); letter-spacing: .08em; padding: 0;
  background: radial-gradient(circle at 35% 28%, #fff9d6 0%, #f6cf5f 28%, #c18a26 62%, #7a5212 100%);
  box-shadow: 0 0 0 4px #05080a, 0 0 0 6px var(--gold-3), 0 0 0 10px #05080a, 0 0 0 11px var(--gold-4), 0 10px 26px rgba(0,0,0,.7), 0 0 40px rgba(242,197,82,.25), inset 0 -8px 16px rgba(80,40,0,.45), inset 0 6px 12px rgba(255,255,220,.6);
  transition: transform .08s, filter .2s, box-shadow .2s; text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.spin-btn::before { content: ''; position: absolute; inset: 10%; border-radius: 50%; border: 2px solid rgba(90,55,5,.55); }
.spin-btn::after { content: ''; position: absolute; inset: 16%; border-radius: 50%; border: 1px dashed rgba(90,55,5,.45); }
.spin-btn:hover { filter: brightness(1.08); }
.spin-btn:active { transform: scale(.95); }
.spin-btn:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
.spin-btn.busy { filter: saturate(.7) brightness(.85); }
.spin-btn.free { animation: freeglow 1s ease-in-out infinite alternate; }
@keyframes freeglow { to { box-shadow: 0 0 0 4px #05080a, 0 0 0 6px #fff3bf, 0 0 0 10px #05080a, 0 0 0 11px var(--gold-2), 0 10px 26px rgba(0,0,0,.7), 0 0 70px rgba(255,220,120,.7), inset 0 -8px 16px rgba(80,40,0,.45), inset 0 6px 12px rgba(255,255,220,.6); } }
.spin-hint { font: 400 10px var(--thin); letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }
@media (hover: none) { .spin-hint { display: none; } }

.ctrl-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.gbtn {
  min-width: 42px; height: 40px; padding: 0 14px; cursor: pointer; color: var(--gold-1); background: linear-gradient(#1a232c, #0b1116);
  border: 1px solid var(--gold-3); font: 400 13px var(--thin); letter-spacing: .2em; text-transform: uppercase; user-select: none;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  transition: background .15s, color .15s, filter .15s;
}
.gbtn:hover:not(:disabled) { background: linear-gradient(#2b3a46, #121b23); color: #fff; }
.gbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gbtn:disabled { opacity: .4; cursor: not-allowed; }
.gbtn.on { background: var(--gold-grad); color: #2b1c02; border-color: #fff3bf; }
.gbtn.sm { height: 34px; padding: 0 10px; font-size: 12px; }
.bet-box { display: flex; align-items: center; justify-content: center; gap: 6px; }
.bet-box .plaque { min-width: 112px; }
.plaque .sub { display: block; font: 400 clamp(10px, 1.3vw, 12px) var(--thin); letter-spacing: .2em; color: var(--muted); text-transform: uppercase; margin-top: 1px; }
.plaque .sub b { color: var(--gold-1); font-weight: 400; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ============================================================ modals */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 14px; background: rgba(2,5,8,.82); backdrop-filter: blur(4px); overflow-y: auto; }
.modal[hidden] { display: none; }
.sheet {
  position: relative; width: min(880px, 100%); max-height: calc(100vh - 28px); overflow: auto; padding: clamp(16px, 3vw, 28px);
  background: linear-gradient(#111a22, #080c10); box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--gold-3), 0 0 0 8px #05080a, 0 0 0 9px var(--gold-4), 0 30px 80px #000;
}
.sheet h2 { margin: 0 0 4px; font: 400 clamp(24px, 4vw, 36px) var(--display); letter-spacing: .1em; text-align: center; }
.sheet .lede { text-align: center; color: var(--muted); font: 400 13px var(--thin); letter-spacing: .25em; text-transform: uppercase; margin: 0 0 18px; }
.sheet .x { position: absolute; top: 10px; right: 12px; }
.sheet h3 { font: 400 16px var(--display); letter-spacing: .14em; color: var(--gold-2); margin: 22px 0 10px; text-transform: uppercase; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.pay-card { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; padding: 8px; background: #0a1016; border: 1px solid #2c3540; }
.pay-card img { width: 64px; height: 64px; display: block; border: 1px solid var(--gold-3); }
.pay-card b { display: block; font: 400 14px var(--serif); color: var(--gold-1); letter-spacing: .06em; }
.pay-card small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pay-card .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-card .row span:first-child { color: var(--muted); }
.rules { color: #cfc6ad; font-size: 14px; line-height: 1.7; }
.rules li { margin: 4px 0; }
.rules b { color: var(--gold-1); font-weight: 400; }
.lines-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.lines-grid figure { margin: 0; text-align: center; font: 400 11px var(--thin); color: var(--muted); letter-spacing: .2em; }
.lines-grid svg { width: 100%; height: auto; display: block; background: #0a1016; border: 1px solid #2c3540; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.stat-grid .plaque .val { font-size: 22px; }

/* ============================================================ toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; padding: 10px 20px; background: #10171e; color: var(--gold-1); border: 1px solid var(--gold-3); font: 400 14px var(--serif); letter-spacing: .06em; box-shadow: 0 10px 40px #000; animation: toastIn .25s ease-out; max-width: calc(100vw - 30px); text-align: center; }
.toast.bad { border-color: #d24b4b; color: #ffb3b3; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

.foot { text-align: center; margin-top: 14px; font: 400 11px var(--thin); letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }
.foot a { color: var(--gold-3); text-decoration: none; }
.foot a:hover { color: var(--gold-2); }

/* ============================================================ responsive */
@media (max-width: 820px) {
  .hud { grid-template-columns: 1fr 1fr; }
  .spin-cell { grid-column: 1 / -1; grid-row: 1; }
  .hud-side.left { grid-row: 2; grid-column: 1 / -1; }
  .hud-side.right { grid-row: 3; grid-column: 1 / -1; }
  .stage { aspect-ratio: 4 / 3; }
  .foot { letter-spacing: .15em; }
}
@media (max-width: 480px) {
  .plaque .lbl { letter-spacing: .18em; }
  .gbtn { padding: 0 10px; letter-spacing: .1em; }
  .marquee .sub { letter-spacing: .25em; }
  .cabinet { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage::before, .banner .b-rays, .stage-frame::before, .spin-btn.free { animation: none; }
}

/* ============================================================ crop + picker (shared with admin) */
.crop-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(2,5,8,.88); padding: 12px; }
.crop-modal { background: linear-gradient(#111a22, #080c10); padding: 18px; max-width: 96vw; box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--gold-3), 0 20px 60px #000; }
.crop-modal h3 { margin: 0 0 4px; font: 400 18px var(--display); letter-spacing: .1em; color: var(--gold-2); }
.crop-modal .hint { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.crop-viewport { position: relative; overflow: hidden; background: #000; cursor: grab; touch-action: none; outline: 2px solid var(--gold-3); }
.crop-viewport:active { cursor: grabbing; }
.crop-img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; -webkit-user-drag: none; }
.crop-zoom { display: block; margin-top: 12px; accent-color: var(--gold-2); }
.crop-actions { margin-top: 14px; display: flex; gap: 10px; }
