/* Regal Spinners — Royal Emerald & Brushed Platinum */
:root {
  --em-950: #03170f;
  --em-900: #062619;
  --em-800: #0a3a28;
  --em-700: #0e5238;
  --em-600: #14704c;
  --em-400: #35b885;
  --em-200: #9be8c6;
  --plat-50: #f6f8f9;
  --plat-200: #dfe4e8;
  --plat-400: #b4bcc3;
  --plat-600: #7d868e;
  --plat-800: #444b51;
  --gold: #dcb75c;
  --ink: #08110d;
  --red: #e0685e;
  --serif: "Didot", "Bodoni MT", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --brushed: linear-gradient(135deg, #fdfefe 0%, #c9d0d6 28%, #eef1f3 50%, #a9b1b8 74%, #e4e8eb 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--plat-50);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.018) 0 2px, transparent 2px 16px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.018) 0 2px, transparent 2px 16px),
    radial-gradient(1200px 700px at 50% -10%, var(--em-700), var(--em-900) 55%, var(--em-950));
  background-attachment: fixed;
}
body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; margin: 0; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--plat-50); color: var(--ink); padding: 8px 14px; z-index: 50; }
.skip-link:focus { left: 8px; top: 8px; }
.noscript { position: fixed; inset: auto 0 0 0; background: var(--plat-50); color: var(--ink); padding: 14px; text-align: center; z-index: 99; }

#app { max-width: 1040px; margin: 0 auto; padding: 0 14px 24px; }
body.gate-locked #app { filter: blur(14px) brightness(.5); pointer-events: none; user-select: none; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent; border-radius: 999px; padding: 8px 16px;
  font-weight: 600; font-size: .9rem; letter-spacing: .02em; line-height: 1.2;
  transition: transform .12s ease, filter .12s ease, background-color .12s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-plat { background: var(--brushed); color: var(--ink); border-color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.4); }
.btn-ghost { background: rgba(255,255,255,.05); border-color: rgba(223,228,232,.45); color: var(--plat-50); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.btn-primary { background: linear-gradient(180deg, #45c893, #14704c); border-color: var(--em-200); color: #fff; padding: 12px 20px; font-size: 1rem; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn-danger { background: #8f2a22; border-color: #f0a59e; color: #fff; }
.btn-small { padding: 4px 12px; font-size: .75rem; }
.btn-icon { width: 38px; height: 38px; padding: 7px; background: rgba(255,255,255,.05); border-color: rgba(223,228,232,.45); display: inline-grid; place-items: center; }
.btn-icon svg { width: 22px; height: 22px; }
.btn-icon .snd-off { display: none; }
.btn-icon[aria-pressed="false"] .snd-wave { display: none; }
.btn-icon[aria-pressed="false"] .snd-off { display: inline; }

.badge-18 {
  display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 6px;
  border: 2px solid var(--red); border-radius: 50%; color: #fff; font-weight: 800; font-size: .85rem;
  background: rgba(224,104,94,.18);
}

/* ---------- Header ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--serif); font-size: 1.45rem; line-height: 1.1; letter-spacing: .04em; background: var(--brushed); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.brand-name em { font-style: italic; color: var(--em-200); -webkit-text-fill-color: var(--em-200); }
.brand-tag { font-size: .72rem; color: var(--plat-400); letter-spacing: .08em; text-transform: uppercase; }
.header-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.timer { display: flex; flex-direction: column; align-items: center; padding: 3px 14px; border: 1px solid rgba(223,228,232,.45); border-radius: 10px; background: rgba(0,0,0,.3); line-height: 1.15; }
.timer-label { font-size: .6rem; text-transform: uppercase; letter-spacing: .14em; color: var(--plat-400); }
.timer-value { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; }

/* ---------- Disclaimer banner ---------- */
.disclaimer {
  background: var(--plat-50); color: var(--ink);
  border-left: 8px solid var(--em-600); border-right: 8px solid var(--em-600);
  border-radius: 8px; padding: 9px 16px; box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.disclaimer p { margin: 0; font-size: .82rem; line-height: 1.4; text-align: center; }
.disclaimer strong { color: #0a4a33; letter-spacing: .02em; }

/* ---------- Cabinet ---------- */
.stage { padding-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cabinet {
  position: relative;
  width: min(100%, 780px, max(320px, calc((100vh - 395px) * 1.75)));
  padding: 12px; border-radius: 22px;
  background: var(--brushed);
  box-shadow: 0 0 0 1px #fff inset, 0 18px 50px rgba(0,0,0,.55);
}
.cabinet::before { content: ""; position: absolute; inset: 7px; border-radius: 16px; background: linear-gradient(180deg, var(--em-800), var(--em-950)); box-shadow: 0 0 0 1px var(--plat-800), inset 0 0 40px rgba(0,0,0,.6); }
.cabinet > * { position: relative; }
.cabinet-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 10px; }
.cabinet-title { font-size: 1.15rem; font-style: italic; color: var(--plat-200); text-align: center; }
.plaque { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; padding: 3px 10px; border-radius: 4px; color: var(--ink); background: var(--brushed); white-space: nowrap; }
.machine { padding: 0 8px 8px; }

.reels-frame { position: relative; padding: 8px; border-radius: 12px; background: #02100a; box-shadow: inset 0 0 0 2px var(--plat-600), inset 0 0 0 3px #000; }
.reels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.reel { position: relative; aspect-ratio: 1 / 3; overflow: hidden; border-radius: 8px; background: linear-gradient(180deg, #0c261b, #154a34 50%, #0c261b); box-shadow: inset 0 0 0 1px rgba(223,228,232,.25); }
.reel::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.55), transparent 16%, transparent 84%, rgba(0,0,0,.55)); }
.strip { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; flex-direction: column; will-change: transform; }
.cell { flex: 1 1 0; min-height: 0; display: grid; place-items: center; padding: 9%; transition: opacity .2s ease; }
.sym { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }
.reel.is-blur .strip { filter: blur(2px); }
.reels.has-win .cell { opacity: .38; }
.reels.has-win .cell.is-win { opacity: 1; animation: va-pulse .9s ease-in-out infinite; background: radial-gradient(circle, rgba(220,183,92,.35), transparent 70%); }
@keyframes va-pulse { 50% { transform: scale(1.09); } }
.line-layer { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); pointer-events: none; }
.line-layer polyline { fill: none; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px rgba(0,0,0,.9)); }

.status { margin: 10px 0; min-height: 2.9em; display: grid; place-items: center; text-align: center; font-family: var(--serif); font-size: 1rem; color: var(--plat-200); padding: 4px 10px; border-radius: 8px; background: rgba(0,0,0,.35); border: 1px solid rgba(223,228,232,.2); }
.status.is-win { color: #ffe9a6; border-color: var(--gold); }
.status.is-warn { color: #ffc9c3; border-color: var(--red); }

.deck { display: grid; grid-template-columns: 1fr 1.15fr auto 1fr; gap: 10px; align-items: stretch; }
.meter, .bet { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px; border-radius: 10px; background: rgba(0,0,0,.4); border: 1px solid rgba(223,228,232,.28); min-width: 0; }
.meter-label { font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--plat-400); }
.meter-value { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; line-height: 1.2; }
.meter-win .meter-value { color: var(--gold); }
.bet-row { display: flex; align-items: center; gap: 8px; }
.bet-row .meter-value { min-width: 3.2em; text-align: center; }
.btn-step { width: 34px; height: 34px; padding: 0; font-size: 1.3rem; line-height: 1; background: var(--brushed); color: var(--ink); border-color: #fff; }
.btn-step:disabled, .btn:disabled { opacity: .45; }
.bet-note { font-size: .68rem; color: var(--plat-400); }
.btn-refill { margin-top: 4px; background: linear-gradient(180deg, #ffe9a6, #d9a93a); color: #2b1d00; border-color: #fff3c9; font-size: .78rem; padding: 6px 12px; animation: va-nudge 1.4s ease-in-out infinite; }
@keyframes va-nudge { 50% { box-shadow: 0 0 0 5px rgba(220,183,92,.3); } }

.spin {
  width: 104px; height: 104px; align-self: center; border-radius: 50%; border: 4px solid #fff;
  background: radial-gradient(circle at 35% 28%, #7be3b5, #14704c 55%, #06301f);
  box-shadow: 0 0 0 4px var(--plat-600), 0 8px 18px rgba(0,0,0,.55), inset 0 -6px 12px rgba(0,0,0,.35);
  color: #fff; font-family: var(--serif); font-size: 1.35rem; font-weight: 700; letter-spacing: .1em;
  text-shadow: 0 2px 2px rgba(0,0,0,.5); transition: transform .12s ease, filter .12s ease;
}
.spin:hover:not(:disabled) { filter: brightness(1.12); }
.spin:active:not(:disabled) { transform: scale(.95); }
.spin:disabled { filter: grayscale(.7) brightness(.75); }
.cabinet.big-win { animation: va-flash .5s ease-in-out 4; }
@keyframes va-flash { 50% { box-shadow: 0 0 0 1px #fff inset, 0 0 60px 10px rgba(220,183,92,.7); } }

.break-panel { margin: 0 8px 8px; padding: 28px 18px; text-align: center; border-radius: 12px; background: rgba(0,0,0,.5); border: 1px solid var(--plat-400); }
.break-panel h2 { font-size: 1.4rem; margin-bottom: 10px; }
.break-count { font-family: var(--serif); font-size: 1.6rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.break-note { font-size: .85rem; color: var(--plat-400); margin: 0; }
.machine[inert] { display: none; }

.quick-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(223,228,232,.3); font-size: .85rem; color: var(--plat-200); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1.2fr 1fr; gap: 24px; }
.site-footer h2 { font-size: 1rem; color: #fff; margin-bottom: 8px; }
.footer-18 { display: flex; align-items: center; gap: 10px; }
.imprint { font-style: normal; }
.imprint dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.imprint dt { color: var(--plat-400); white-space: nowrap; }
.imprint dd { margin: 0; overflow-wrap: anywhere; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-links button { background: none; border: 0; padding: 2px 0; color: var(--em-200); text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.footer-links button:hover { color: #fff; }
.footer-fine { margin-top: 18px; font-size: .78rem; color: var(--plat-400); }
.footer-copy { font-size: .78rem; color: var(--plat-400); margin: 0; }

/* ---------- Dialogs ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--plat-50); width: min(760px, calc(100vw - 20px)); max-width: none; max-height: none; overflow: visible; }
dialog::backdrop { background: rgba(2, 12, 8, .84); }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, var(--em-800), var(--em-900)); border: 2px solid var(--plat-400); box-shadow: 0 24px 70px rgba(0,0,0,.7); }
.dlg-narrow { max-width: 520px; margin: 0 auto; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: var(--brushed); color: var(--ink); }
.dlg-head h2 { font-size: 1.25rem; }
.dlg-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--plat-800); background: transparent; color: var(--ink); font-size: 1.5rem; line-height: 1; }
.dlg-x:hover { background: rgba(0,0,0,.12); }
.dlg-content { padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.dlg-content h3 { font-size: 1.05rem; color: var(--em-200); margin: 1.2em 0 .45em; }
.dlg-content ul, .dlg-content ol { margin: 0 0 .8em; padding-left: 1.3em; }
.dlg-content li { margin-bottom: .35em; }
.lead { color: var(--plat-200); }
.legal { font-size: .92rem; }
code { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: .85em; color: var(--em-200); overflow-wrap: anywhere; }

.gate::backdrop { background: radial-gradient(circle at 50% 30%, rgba(14,82,56,.97), rgba(3,23,15,.99)); }
.gate-box { max-width: 520px; margin: 0 auto; padding: 30px 24px 22px; text-align: center; align-items: center; overflow-y: auto; }
.gate-box h2 { font-size: 1.7rem; margin-bottom: 12px; }
.gate-box p { font-size: 1.02rem; }
.gate-badge { display: inline-grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; border: 4px solid var(--red); font-weight: 800; font-size: 1.5rem; margin-bottom: 14px; background: rgba(224,104,94,.15); }
.gate-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin: 14px 0; }
.gate-fine { font-size: .78rem !important; color: var(--plat-400); margin: 0; }

.table-wrap { overflow-x: auto; margin-bottom: 1em; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid rgba(223,228,232,.18); vertical-align: middle; }
thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--plat-400); }
.paytable td:not(:first-child), .paytable th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.paytable td:last-child { color: var(--gold); font-weight: 700; }
.pay-sym { display: flex; align-items: center; gap: 10px; }
.pay-sym svg { width: 44px; height: 44px; flex: none; }
.pay-sym small { display: block; color: var(--plat-400); font-size: .72rem; }

.pl-list { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pl-list li { display: flex; align-items: center; gap: 8px; margin: 0; }
.pl-num { width: 1.6em; text-align: right; font-size: .8rem; color: var(--plat-400); }
.pl-grid { display: grid; grid-template-columns: repeat(5, 11px); grid-auto-rows: 11px; gap: 2px; }
.pl-grid i { background: rgba(223,228,232,.16); border-radius: 2px; }
.pl-grid i.on { background: var(--gold); }

.tool { padding: 14px; margin-bottom: 12px; border-radius: 12px; background: rgba(0,0,0,.28); border: 1px solid rgba(223,228,232,.2); }
.tool h3 { margin-top: 0; }
.tool p { font-size: .9rem; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stats dt { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: var(--plat-400); }
.stats dd { margin: 0; font-family: var(--serif); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row label { position: relative; cursor: pointer; }
.choice-row input { position: absolute; opacity: 0; inset: 0; }
.choice-row label span { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(223,228,232,.45); background: rgba(255,255,255,.05); font-weight: 600; font-size: .9rem; }
.choice-row input:checked + span { background: var(--brushed); color: var(--ink); border-color: #fff; }
.choice-row input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.limit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.limit-row label { font-size: .85rem; color: var(--plat-200); }
.limit-row input { width: 9em; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--plat-400); background: #02100a; color: #fff; font: inherit; }
.tool-status { margin: 10px 0 0; font-size: .85rem !important; color: var(--em-200); min-height: 1.2em; }
.tool-status.is-error { color: #ffb4ac; }
.confirm { margin-top: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--red); background: rgba(143,42,34,.25); }
.helplines { list-style: none; padding: 0 !important; display: grid; gap: 6px; font-size: .9rem; }
.helplines span { display: inline-block; min-width: 9.5em; color: var(--plat-400); }
.helplines strong { white-space: nowrap; color: #fff; }

.exit-screen { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
  .brand-tag { display: none; }
  .brand-name { font-size: 1.15rem; }
  .cabinet-top .plaque { display: none; }
  .cabinet-top { justify-content: center; padding-bottom: 6px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  #app { padding: 0 8px 20px; }
  .site-header { padding: 6px 0; gap: 6px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 1rem; letter-spacing: 0; }
  .header-tools { gap: 5px; }
  .header-tools .badge-18 { display: none; }
  .header-tools .btn-plat { padding: 7px 10px; font-size: .78rem; }
  .btn-icon { width: 34px; height: 34px; }
  .timer { padding: 2px 8px; }
  .disclaimer { padding: 6px 8px; border-left-width: 5px; border-right-width: 5px; }
  .disclaimer p { font-size: .68rem; line-height: 1.3; }
  .stage { padding-top: 8px; }
  .cabinet { padding: 9px; border-radius: 16px; }
  .cabinet::before { inset: 5px; border-radius: 12px; }
  .cabinet-title { font-size: .95rem; }
  .machine { padding: 0 4px 4px; }
  .reels-frame { padding: 5px; }
  .reels { gap: 3px; }
  .line-layer { inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); }
  .status { font-size: .88rem; margin: 7px 0; min-height: 2.6em; }
  .deck { grid-template-columns: 1fr 1fr; gap: 7px; }
  .spin { grid-column: 1 / -1; grid-row: 1; width: 100%; height: 58px; border-radius: 999px; }
  .bet { grid-column: 1 / -1; grid-row: 2; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
  .meter-value { font-size: 1.25rem; }
  .gate-box { padding: 22px 16px 16px; }
  .gate-box h2 { font-size: 1.4rem; }
  .dlg-content { padding: 14px; }
  th, td { padding: 6px; }
  .pay-sym svg { width: 34px; height: 34px; }
  .helplines span { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
