/* /theme.css */
:root {
  --bg-0: #0b111d;
  --bg-1: #111a2b;
  --bg-2: #172238;
  --bg-3: #1f2c47;
  --bg-4: #2a3a5c;
  --line: #243351;
  --line-strong: #34466d;
  --text: #eef2fa;
  --text-2: #a3afc7;
  --text-3: #6c7a97;
  --accent: #ffc53d;
  --accent-strong: #ffb300;
  --accent-ink: #1d1400;
  --win: #22e08f;
  --win-ink: #03140c;
  --loss: #ff4d63;
  --info: #5aa9ff;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
  --font-display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --font-ui: "Geist", "Segoe UI", system-ui, sans-serif;
}

/* /css/base.css */
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Unbounded";
  src: url("/fonts/unbounded.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --shadow-1: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 1px 2px rgb(0 0 0 / 0.35);
  --shadow-2: 0 1px 0 rgb(255 255 255 / 0.05) inset, 0 8px 24px rgb(0 0 0 / 0.35);
  --shadow-3: 0 24px 64px rgb(0 0 0 / 0.55);
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --gutter: 24px;
  /* How wide a page grows, and the smallest a game's cover gets: both step up on big screens, so a
     2560 pixel monitor gets a wider casino with bigger covers, not a narrow column in an empty room. */
  /* The covers' minimum is picked so that a full-width page holds six columns: the Originals'
     featured tile (two by two) and the other eight then fill two rows exactly. */
  --page-max: 1320px;
  --cover-min: 196px;
}
@media (min-width: 1800px) {
  :root { --page-max: 1560px; --cover-min: 224px; }
}
@media (min-width: 2300px) {
  :root { --page-max: 1840px; --cover-min: 262px; }
}

*, *::before, *::after { box-sizing: border-box; }

/* Touch: nothing that takes a tap waits for a possible double-tap zoom (a quick second tap on Play
   stops the reels, it must not zoom the page), and no grey flash: every control has its own pressed state. */
a, button, input, select, textarea, label, summary, [role="button"], [tabindex] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-0);
  /* No bounce or pull-to-refresh: a drag on a game must never reload the site. (What sticks out
     sideways is clipped by the page's column, .main in shell.css: on html itself, Chrome stops the
     sidebar, the top bar and the chat from staying in place while the page scrolls.) */
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-0);
  color: var(--text);
  font: 500 14px/1.45 var(--font-ui);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg, canvas { display: block; }
[hidden] { display: none !important; }

::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Scrollbars that belong to a dark UI. */
* { scrollbar-width: thin; scrollbar-color: var(--bg-4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 10px; border: 3px solid var(--bg-0); }
::-webkit-scrollbar-track { background: transparent; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--s { width: 16px; height: 16px; }
.icon--l { width: 24px; height: 24px; }

#app.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
#app.boot::after {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--bg-3);
  border-top-color: var(--accent);
  animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* The readable page the server sends with each address (server/site-meta.mjs): what search engines and
   visitors without JavaScript see. The app replaces it as it starts, so it only fades in if it does not. */
.prerender {
  max-width: 680px;
  padding: 32px var(--gutter);
  color: var(--text-2);
  line-height: 1.6;
  animation: fade-in 300ms 1.5s both;
}
.prerender__brand { color: var(--accent); font: 800 20px/1 var(--font-display); letter-spacing: 0.08em; }
.prerender h1 { margin: 16px 0 12px; color: var(--text); font: 800 30px/1.2 var(--font-display); }
.prerender p { margin: 10px 0; }
.prerender nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 20px; }
.prerender a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* /css/components.css */
/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--bg-3);
  --btn-bg-hover: var(--bg-4);
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  transition: background-color 140ms var(--ease-out), transform 120ms var(--ease-out),
    box-shadow 140ms var(--ease-out), opacity 140ms;
  box-shadow: var(--shadow-1);
}
.btn:hover:not(:disabled) { background: var(--btn-bg-hover); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn--primary {
  --btn-bg: var(--accent);
  --btn-bg-hover: color-mix(in srgb, var(--accent) 88%, white);
  --btn-fg: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.35) inset, 0 -2px 0 rgb(0 0 0 / 0.18) inset,
    0 6px 20px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn--primary:hover:not(:disabled) {
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.4) inset, 0 -2px 0 rgb(0 0 0 / 0.18) inset,
    0 8px 28px color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn--primary.is-stop {
  --btn-bg: var(--loss);
  --btn-bg-hover: color-mix(in srgb, var(--loss) 88%, white);
  --btn-fg: #fff;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 6px 20px color-mix(in srgb, var(--loss) 30%, transparent);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-bg-hover: var(--bg-3);
  --btn-fg: var(--text-2);
  box-shadow: none;
}
.btn--ghost:hover:not(:disabled) { color: var(--text); }
.btn--block { width: 100%; }
.btn--xl { height: 52px; font-size: 16px; border-radius: var(--radius-m); }
.btn--s { height: 32px; padding: 0 10px; font-size: 13px; border-radius: var(--radius-s); }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--s { width: 32px; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--btn-fg) 30%, transparent);
  border-top-color: var(--btn-fg);
  animation: spin 600ms linear infinite;
}

/* ---------- Form fields ---------- */

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.field__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}
.field__label .num { color: var(--text-3); font-weight: 500; }
.field__hint { color: var(--text-3); font-size: 12px; }
.field__error {
  color: var(--loss);
  font-size: 12.5px;
  font-weight: 600;
  animation: rise-in 180ms var(--ease-out);
}

.input {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  padding: 0 4px 0 12px;
  border-radius: var(--radius-m);
  background: var(--bg-0);
  border: 2px solid var(--line);
  transition: border-color 140ms, background-color 140ms;
}
.input:hover { border-color: var(--line-strong); }
.input:focus-within { border-color: var(--info); }
.input.is-invalid { border-color: var(--loss); }
.input.is-readonly { background: color-mix(in srgb, var(--bg-0) 60%, var(--bg-2)); }
.input > .icon { color: var(--text-3); margin-right: 6px; }
.input input {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.input input::placeholder { color: var(--text-3); font-weight: 500; }
.input input:read-only { cursor: default; }
.input__suffix { color: var(--text-3); font-weight: 600; padding-right: 8px; }
.input .btn--s { background: var(--bg-3); box-shadow: none; }
.input .btn--s:hover { background: var(--bg-4); }
.input__divider { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }

/* ---------- Segmented control with a sliding thumb ---------- */

.seg {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-0);
}
.seg__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 999px;
  background: var(--bg-3);
  box-shadow: var(--shadow-1);
  transition: transform 260ms var(--ease-out), width 260ms var(--ease-out);
}
.seg button {
  position: relative;
  z-index: 1;
  height: 36px;
  padding: 0 14px;
  border: 0;
  background: none;
  border-radius: 999px;
  color: var(--text-3);
  font-weight: 650;
  transition: color 160ms;
}
.seg button:hover { color: var(--text-2); }
.seg button[aria-selected="true"] { color: var(--text); }

/* ---------- Switch ---------- */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 20px;
  background: var(--bg-4);
  transition: background-color 180ms;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 220ms var(--ease-spring);
}
.switch input:checked + .switch__track { background: var(--win); }
.switch input:checked + .switch__track::after { transform: translateX(16px); background: var(--win-ink); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--info); outline-offset: 2px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}
.check input {
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  border-radius: 5px;
  border: 2px solid var(--line-strong);
  background: var(--bg-0);
  display: grid;
  place-items: center;
  transition: background-color 140ms, border-color 140ms;
  cursor: pointer;
}
.check input::after {
  content: "";
  width: 8px;
  height: 4px;
  border: solid var(--accent-ink);
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform 180ms var(--ease-spring);
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }

/* ---------- Surfaces ---------- */

.panel {
  background: var(--bg-1);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-1);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge--live { background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win); }
.badge--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.pill-mult {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--text-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pill-mult.is-win { background: var(--win); color: var(--win-ink); }

/* ---------- Tables ---------- */

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  font-variant-numeric: tabular-nums;
}
.table th {
  padding: 4px 14px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.table td {
  padding: 11px 14px;
  background: var(--bg-2);
  font-weight: 600;
}
.table td:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.table td:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.table .is-right { text-align: right; }
.table tbody tr { cursor: pointer; transition: transform 140ms var(--ease-out); }
.table tbody tr:hover td { background: var(--bg-3); }
.table .is-win { color: var(--win); }
.table .is-muted { color: var(--text-3); }
/* A new row slides in lit up and settles. The light is a brightness filter rather than a lighter
   background: the browser can then move and fade the row as it is, where a background animation
   repainted the page on every frame, and a busy live feed adds rows all the time. */
.table tr.is-new td { animation: row-in 420ms var(--ease-out); }
@keyframes row-in { from { opacity: 0; transform: translateY(-8px); filter: brightness(1.7); } }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  /* A plain dim, without blurring the page behind: a full-screen blur is recomputed on every frame
     anything behind moves (the live feed, a game), the heaviest thing a phone's graphics chip did
     for any dialog. Under this much dim the blur hardly showed. */
  background: rgb(4 8 16 / 0.78);
  animation: fade-in 180ms var(--ease-out);
}
.modal-backdrop.is-closing { pointer-events: none; animation: fade-out 160ms var(--ease-in-out) forwards; }
.modal {
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: var(--shadow-3), 0 0 0 1px var(--line);
  animation: modal-in 260ms var(--ease-out);
}
.modal:focus { outline: none; }
.modal-backdrop.is-closing .modal { animation: modal-out 160ms var(--ease-in-out) forwards; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 0 22px;
}
.modal__head h2 { flex: 1; font-size: 17px; }
.modal__head .icon { color: var(--text-2); }
.modal__body { padding: 18px 22px 22px; display: grid; gap: 16px; }

/* ---------- Toasts ---------- */

#toasts {
  position: fixed;
  z-index: 90;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 14px 12px 12px;
  border-radius: var(--radius-m);
  background: var(--bg-3);
  box-shadow: var(--shadow-3), 0 0 0 1px var(--line-strong);
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in 320ms var(--ease-spring);
}
.toast.is-leaving { animation: toast-out 220ms var(--ease-in-out) forwards; }
.toast__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-4);
}
.toast--error .toast__icon { background: color-mix(in srgb, var(--loss) 20%, transparent); color: var(--loss); }
.toast--success .toast__icon { background: color-mix(in srgb, var(--win) 18%, transparent); color: var(--win); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ---------- Tooltip ---------- */

[data-tip] { position: relative; }
/* The tip exists only while hovered, and only where a pointer can hover: a hidden one would still be
   a box sticking out past the screen's edge (a button at the right of a phone's screen), and the page
   would widen to hold it. */
@media (hover: hover) {
  [data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    translate: -50% 0;
    padding: 6px 9px;
    border-radius: 6px;
    background: var(--text);
    color: var(--bg-0);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    pointer-events: none;
    z-index: 20;
    animation: tip-in 160ms var(--ease-out) 350ms backwards;
  }
}
@keyframes tip-in { from { opacity: 0; translate: -50% 4px; } }

/* ---------- Skeleton ---------- */

.skeleton {
  border-radius: var(--radius-s);
  background: linear-gradient(90deg, var(--bg-2) 0 40%, var(--bg-3) 50%, var(--bg-2) 60% 100%) 0 0 / 300% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -150% 0; } }
/* A page whose code is still on its way (app.mjs, page()): one quiet block where it will be. */
.page-loading__block { height: min(62vh, 560px); border-radius: var(--radius-l); }

/* /css/shell.css */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  grid-template-areas: "side top" "side main";
  min-height: 100dvh;
  transition: grid-template-columns 280ms var(--ease-out);
  animation: fade-in 300ms var(--ease-out);
}
.shell.is-collapsed { --sidebar-w: 76px; }

/* ---------- Sidebar ---------- */

.sidebar {
  grid-area: side;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  box-shadow: 1px 0 0 var(--line);
  overflow: hidden;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 20px;
  flex: none;
  color: var(--accent);
}
.brand__mark svg { width: 34px; height: 34px; }
.brand__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px 16px;
  display: grid;
  align-content: start;
  gap: 2px;
}
.nav__section {
  padding: 18px 12px 8px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-m);
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 140ms, color 140ms;
}
.nav__link:hover { background: var(--bg-2); color: var(--text); }
.nav__link.is-active { background: var(--bg-3); color: var(--text); }
.nav__link.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav__icon { display: grid; place-items: center; width: 24px; }
.nav__link.is-active .nav__icon { color: var(--accent); }
.nav__soon {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.sidebar__foot {
  margin: 0 12px 16px;
  padding: 12px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.5;
}

.shell.is-collapsed .brand__name,
.shell.is-collapsed .nav__label,
.shell.is-collapsed .nav__soon,
.shell.is-collapsed .sidebar__foot { display: none; }
.shell.is-collapsed .brand { padding: 0; justify-content: center; }
.shell.is-collapsed .nav__section { height: 1px; padding: 0; margin: 12px 8px; background: var(--line); font-size: 0; }
.shell.is-collapsed .nav__link { justify-content: center; padding: 0; }

/* The Slots group: a button that opens the list of machines under it. */
.nav__group { width: 100%; border: 0; background: none; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.nav__group.is-active { background: none; color: var(--text); }
.nav__group.is-active::before { display: none; }
.nav__group.is-active .nav__icon { color: var(--accent); }
.nav__chevron { display: grid; margin-left: auto; color: var(--text-3); transition: transform 220ms var(--ease-out); }
.nav__group[aria-expanded="true"] .nav__chevron { transform: rotate(180deg); }
.nav__sub { display: grid; gap: 2px; margin: 2px 0 4px 23px; padding-left: 9px; box-shadow: inset 1px 0 0 var(--line); }
.nav__sub[hidden] { display: none; }
.nav__sub > .nav__link { height: 38px; }
.nav__sub > .nav__link.is-active::before { left: -10px; }
.nav__sub:not([hidden]) > .nav__link { animation: nav-in 220ms var(--ease-out) both; }
.nav__sub > .nav__link:nth-child(2) { animation-delay: 30ms; }
.nav__sub > .nav__link:nth-child(3) { animation-delay: 60ms; }
@keyframes nav-in { from { opacity: 0; transform: translateY(-4px); } }
.shell.is-collapsed .nav__chevron, .shell.is-collapsed .nav__sub { display: none; }

/* ---------- Top bar ---------- */

.topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 var(--gutter) 0 12px;
  background: color-mix(in srgb, var(--bg-1) 92%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line), 0 10px 30px rgb(0 0 0 / 0.2);
}
.topbar__brand { display: none; color: var(--accent); }
.topbar__brand svg { width: 32px; height: 32px; }
.topbar__right { grid-column: -2; display: flex; align-items: center; gap: 6px; justify-self: end; }

/* A visitor's way in, where a player has the account menu */
.topbar__guest { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.topbar__register-short { display: none; }

.wallet-bar {
  grid-column: 3;
  justify-self: center;
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-m);
  background: var(--bg-0);
  box-shadow: var(--shadow-1);
}
.wallet-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
  padding: 0 16px 0 12px;
  height: 44px;
  font-size: 15px;
  font-weight: 700;
}
.wallet-pill__chip { display: grid; color: var(--accent); }
.wallet-pill__amount { transition: color 300ms; }
.wallet-pill.is-changed.is-up .wallet-pill__amount { animation: balance-up 900ms var(--ease-out); }
.wallet-pill.is-changed.is-down .wallet-pill__amount { animation: balance-down 500ms var(--ease-out); }
@keyframes balance-up { 0%, 40% { color: var(--win); } }
@keyframes balance-down { 0%, 30% { color: var(--text-2); } }
/* Winnings flying in: the coin takes a small knock as each one lands, and once the last is in the
   whole pill gives a springy pulse while its coin turns over once. */
.wallet-pill.is-catching .wallet-pill__coin { animation: wallet-catch 200ms var(--ease-out); }
.wallet-pill.is-caught { animation: wallet-caught 460ms var(--ease-spring); }
.wallet-pill.is-caught .wallet-pill__coin { animation: wallet-coin-turn 620ms var(--ease-out); }
@keyframes wallet-catch { 40% { transform: scale(1.24); } }
@keyframes wallet-caught { 35% { transform: scale(1.06); } }
@keyframes wallet-coin-turn { from { transform: perspective(80px) rotateY(0deg) scale(1.2); } to { transform: perspective(80px) rotateY(360deg) scale(1); } }

.wallet-pill__refill {
  height: 44px;
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  padding: 0 14px;
  background: var(--bg-3);
  box-shadow: none;
}
.wallet-pill__dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--win);
  box-shadow: 0 0 0 3px var(--bg-3);
  animation: pulse 1.4s ease-in-out infinite;
}

.account { position: relative; }
.account__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px 0 6px;
  border: 0;
  border-radius: var(--radius-m);
  background: transparent;
  font-weight: 650;
  transition: background-color 140ms;
}
.account__trigger:hover, .account__trigger[aria-expanded="true"] { background: var(--bg-3); }
.account__chevron { display: grid; color: var(--text-3); transition: transform 200ms var(--ease-out); }
.account__trigger[aria-expanded="true"] .account__chevron { transform: rotate(180deg); }

.avatar {
  display: grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: color-mix(in srgb, var(--avatar) 22%, var(--bg-2));
  color: var(--avatar);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--avatar) 45%, transparent);
  font-family: var(--font-display);
  font-size: calc(var(--size) * 0.42);
  font-weight: 800;
  flex: none;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 240px;
  padding: 6px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  box-shadow: var(--shadow-3), 0 0 0 1px var(--line-strong);
  transform-origin: top right;
  animation: menu-in 180ms var(--ease-out);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
.menu__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
}
.menu__head strong { display: block; }
.menu__head span:not(.avatar) { color: var(--text-3); font-size: 12px; }
.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  text-align: left;
}
.menu__item span { display: grid; }
.menu__item:hover { background: var(--bg-3); color: var(--text); }
.menu__sep { height: 1px; margin: 6px 4px; background: var(--line); }

.main {
  grid-area: main;
  min-width: 0;
  /* The page never moves sideways: whatever might stick out past the screen's edge is cut off here
     rather than letting a phone zoom out or pan away from the game. Clip, not hidden: it makes no
     scroll container, so sticky things inside keep working; and on this column, not on html, so the
     sidebar, the top bar and the chat beside it stay put while the page scrolls. */
  overflow-x: clip;
  outline: none;
}

.scrim { display: none; }

.wallet { display: grid; gap: 16px; }
.wallet__balance {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px;
  border-radius: var(--radius-m);
  background: var(--bg-0);
  color: var(--text-2);
  font-weight: 600;
}
.wallet__balance strong { font-size: 22px; color: var(--text); }
.wallet__text, .wallet__status { color: var(--text-2); font-size: 13.5px; }
.wallet__status { text-align: center; color: var(--text-3); }
.wallet__daily {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.wallet__daily-head { display: flex; gap: 12px; align-items: center; }
.wallet__daily-head > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.wallet__daily-head p { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.wallet__more { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wallet__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  transition: background-color 140ms;
}
.wallet__link:hover { background: var(--bg-3); }
button.wallet__link { width: 100%; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wallet__link--wide { grid-column: 1 / -1; }
.wallet__link > span:first-child { display: grid; color: var(--text-2); }
.wallet__link strong { display: block; font-size: 13.5px; }
.wallet__link small { color: var(--text-3); font-size: 12px; }
@media (max-width: 480px) { .wallet__more { grid-template-columns: 1fr; } }

/* ---------- Narrow screens: the sidebar becomes a drawer ---------- */

@media (max-width: 900px) {
  :root { --gutter: 16px; --topbar-h: 60px; }
  .shell, .shell.is-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "main";
  }
  .sidebar {
    position: fixed;
    left: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 300ms var(--ease-out);
    z-index: 60;
  }
  .shell.is-collapsed .brand__name, .shell.is-collapsed .nav__label,
  .shell.is-collapsed .nav__soon, .shell.is-collapsed .sidebar__foot { display: revert; }
  .shell.is-collapsed .nav__chevron { display: grid; }
  .shell.is-collapsed .nav__sub:not([hidden]) { display: grid; }
  .shell.is-collapsed .nav__link { justify-content: flex-start; padding: 0 12px; }
  .shell.is-collapsed .brand { justify-content: flex-start; padding: 0 20px; }
  .shell.is-collapsed .nav__section { height: auto; padding: 18px 12px 8px; margin: 0; background: none; font-size: 11px; }
  .shell.is-drawer-open .sidebar { transform: none; box-shadow: var(--shadow-3); }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgb(3 6 12 / 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms;
  }
  .shell.is-drawer-open .scrim { opacity: 1; pointer-events: auto; }
  /* The balance takes what is left, never more: minmax(0, …) keeps a long figure from pushing the
     account button off the screen. */
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; padding-right: 12px; gap: 8px; }
  .wallet-bar { min-width: 0; }
  .topbar__brand { display: none; }
  .wallet-bar { grid-column: 2; }
  .wallet-pill { min-width: 0; padding: 0 12px 0 10px; font-size: 14px; }
  .wallet-pill__refill-label, .account__name, .account__chevron { display: none; }
  .wallet-pill__refill { padding: 0 12px; }
  .shell.is-guest .topbar__brand { display: block; }
}
/* The smallest phones (360 pixels and under): every button keeps its tap size, only the padding
   around it and the gaps between give way, and the balance's figure follows the screen's width. */
@media (max-width: 360px) {
  .topbar { gap: 6px; padding: 0 8px; }
  .wallet-pill { gap: 6px; padding: 0 8px; font-size: min(14px, 3.9vw); }
  .wallet-pill__refill { padding: 0 10px; }
  .topbar__right { gap: 2px; }
  .account__trigger { padding: 0 2px; }
}
@media (max-width: 420px) {
  /* The sound toggle makes room on small phones; the chat button stays (it is the only way to the chat). */
  .topbar__right > .btn:not(.chat-toggle) { display: none; }
  .topbar__guest { gap: 6px; margin-left: 0; }
  .topbar__guest .btn { padding: 0 12px; }
  .topbar__register-long { display: none; }
  .topbar__register-short { display: inline; }
}

/* ---------- Footer (under every page) ---------- */

.main__page { outline: none; }
.footer {
  content-visibility: auto; /* not drawn until it scrolls near the screen */
  contain-intrinsic-size: auto 420px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  color: var(--text-3);
}
.footer__top, .footer__bottom { width: min(var(--page-max), 100%); margin: 0 auto; padding-inline: var(--gutter); }
.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 48px;
  padding-block: 44px 36px;
}
.footer__about { display: grid; align-content: start; gap: 14px; max-width: 560px; font-size: 13px; line-height: 1.6; }
.footer__about p { color: var(--text-3); }
.footer__brand { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 4px; }
.footer__logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.footer__logo span:last-child { font: 800 18px/1 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; }
.footer__mail { display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--text-2); font-weight: 600; }
.footer__mail:hover { color: var(--text); }
.footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer__col { display: grid; align-content: start; gap: 10px; }
.footer__col h3 { margin-bottom: 4px; color: var(--text); font-size: 14px; font-weight: 700; }
.footer__col a { width: fit-content; color: var(--text-3); font-size: 13.5px; font-weight: 600; transition: color 140ms; }
.footer__col a:hover { color: var(--text); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 18px 22px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

/* Social buttons: dark tiles tinted with each brand's colour. */
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials__link {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--brand) 16%, var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 32%, transparent);
  color: var(--brand);
  transition: transform 160ms var(--ease-out), background 160ms, box-shadow 160ms;
}
.socials__link .social-icon { width: 19px; height: 19px; }
.socials__link:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--brand) 28%, var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 55%, transparent), 0 8px 20px color-mix(in srgb, var(--brand) 22%, transparent);
}

@media (max-width: 900px) {
  .footer__top { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 520px) {
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__bottom { flex-direction: column; }
}

/* /css/login.css */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  min-height: 100dvh;
  animation: fade-in 400ms var(--ease-out);
}

/* ---------- Left: showcase ---------- */

.auth__hero {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 8px 56px 56px;
  overflow: hidden;
  background:
    radial-gradient(900px 600px at 30% 40%, rgb(123 77 255 / 0.16), transparent 60%),
    radial-gradient(700px 500px at 80% 90%, rgb(255 197 61 / 0.08), transparent 60%),
    var(--bg-0);
}
.auth__hero::before {
  /* A faint felt-like grid so the backdrop is not a flat gradient. */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 40% 45%, black, transparent 75%);
  pointer-events: none;
}
.auth__hero .brand { padding: 0; }

.fan {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(250px, 42vh);
  aspect-ratio: 3 / 4;
  margin: 24px 0;
  perspective: 1400px;
}
.fan__card {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.06);
  transition: transform 900ms var(--ease-out), opacity 700ms var(--ease-out), filter 700ms;
  will-change: transform;
}
.fan__card .art { width: 100%; height: 100%; }
.fan__name {
  position: absolute;
  left: 18px;
  bottom: 16px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.6);
}
.fan__card[data-slot="0"] { transform: translateX(0) rotate(0) translateZ(0); z-index: 5; }
.fan__card[data-slot="1"] { transform: translateX(62%) rotate(9deg) translateZ(-120px) scale(0.86); z-index: 4; filter: brightness(0.6); }
.fan__card[data-slot="2"] { transform: translateX(110%) rotate(16deg) translateZ(-240px) scale(0.74); z-index: 3; filter: brightness(0.4); }
.fan__card[data-slot="3"] { transform: translateX(-110%) rotate(-16deg) translateZ(-240px) scale(0.74); z-index: 2; filter: brightness(0.4); }
.fan__card[data-slot="4"] { transform: translateX(-62%) rotate(-9deg) translateZ(-120px) scale(0.86); z-index: 1; filter: brightness(0.6); }
.fan__card[data-slot="0"] .a-bob { animation: bob 3.2s var(--ease-in-out) infinite; }

.auth__pitch { position: relative; max-width: 560px; }
.auth__pitch h2 {
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.auth__facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 28px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.auth__facts li { display: grid; gap: 2px; }
.auth__facts strong { font-family: var(--font-display); font-size: 20px; color: var(--accent); }
.auth__facts span { color: var(--text-2); font-size: 13px; max-width: 150px; }

/* ---------- Right: form ---------- */

.auth__panel {
  display: grid;
  place-items: center;
  padding: 40px 32px;
  background: var(--bg-1);
  box-shadow: -1px 0 0 var(--line);
}
.auth__card {
  width: min(400px, 100%);
  display: grid;
  gap: 8px;
  animation: rise-in 500ms var(--ease-out) 100ms both;
}
.auth__card.is-leaving { animation: auth-out 420ms var(--ease-in-out) forwards; }
@keyframes auth-out { to { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.auth__brand-mobile { display: none; }
.auth__tabs { margin-bottom: 20px; }
.auth__title { font-size: 26px; font-weight: 800; }
.auth__subtitle { color: var(--text-2); margin-bottom: 18px; min-height: 2.9em; }

.auth__form { display: grid; gap: 16px; }
.auth__extra {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: -16px;
  transition: grid-template-rows 320ms var(--ease-out), opacity 240ms, margin-top 320ms var(--ease-out);
}
.auth__extra-inner { display: grid; gap: 16px; min-height: 0; overflow: hidden; }
.auth__extra.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }

.meter { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.meter__bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.meter__bars span {
  height: 4px;
  border-radius: 4px;
  background: var(--bg-3);
  transition: background-color 200ms;
}
.meter__bars .is-on.is-1 { background: var(--loss); }
.meter__bars .is-on.is-2 { background: #ff9f1a; }
.meter__bars .is-on.is-3 { background: #b8e03c; }
.meter__bars .is-on.is-4 { background: var(--win); }
.meter__label { width: 58px; color: var(--text-3); font-size: 12px; font-weight: 600; text-align: right; }

.form-alert {
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--loss) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--loss) 35%, transparent);
  color: #ffc2cb;
  font-weight: 600;
  font-size: 13.5px;
  animation: fx-shake 380ms var(--ease-out);
  --shake: 4px;
}

.auth__form .btn--xl { margin-top: 4px; }

/* The code step of a sign-in on a new browser (ui/auth.mjs). */
.auth__code { animation: rise-in 300ms var(--ease-out); }
.auth__code input { font-size: 20px; font-weight: 700; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }
.auth__code-actions { display: flex; justify-content: space-between; gap: 8px; }
.btn.is-success { --btn-bg: var(--win); --btn-fg: var(--win-ink); }
.auth__fine { margin-top: 20px; color: var(--text-3); font-size: 12px; text-align: center; }

@keyframes bob { 50% { transform: translateY(-8px); } }

@media (max-width: 1100px) {
  .auth__facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__hero { display: none; }
  .auth__panel { align-items: start; padding: 24px 16px 40px; }
  .auth__brand-mobile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    color: var(--accent);
  }
  .auth__brand-mobile svg { width: 34px; height: 34px; }
}

/* ---------- Sign-in dialog over the casino (ui/auth.mjs) ---------- */

.modal--auth { position: relative; width: min(900px, 100%); }
.modal--auth .modal__head { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 0; }
.modal--auth .modal__head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.modal--auth .modal__body { display: block; padding: 0; }
.auth-modal { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); min-height: 580px; }

/* The form can be taller than the screen (Create account); the showcase stays in view as it scrolls. */
.auth-modal__art {
  position: sticky;
  top: 0;
  align-self: start;
  height: min(100%, calc(100dvh - 32px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 26px 28px 30px;
  overflow: hidden;
  background:
    radial-gradient(520px 420px at 30% 38%, rgb(123 77 255 / 0.2), transparent 62%),
    radial-gradient(420px 320px at 85% 95%, rgb(255 197 61 / 0.1), transparent 60%),
    var(--bg-0);
  box-shadow: 1px 0 0 var(--line);
}
.auth-modal__art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at 40% 42%, black, transparent 75%);
  pointer-events: none;
}
.auth-modal__brand { position: relative; display: flex; align-items: center; gap: 10px; color: var(--accent); }
.auth-modal__brand svg { width: 30px; height: 30px; }
.auth-modal__brand .brand__name { color: var(--text); }
.auth-modal .fan { width: min(180px, 28vh); margin: 22px 0 18px; }
.auth-modal .fan__name { left: 14px; bottom: 12px; font-size: 17px; }
.auth-modal__pitch { position: relative; }
.auth-modal__claim { font: 800 21px/1.18 var(--font-display); letter-spacing: -0.01em; }
.auth-modal__facts { display: grid; gap: 9px; margin: 16px 0 0; padding: 0; list-style: none; }
.auth-modal__facts li { display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: baseline; gap: 10px; }
.auth-modal__facts strong { font-family: var(--font-display); font-size: 16px; color: var(--accent); }
.auth-modal__facts span { color: var(--text-2); font-size: 13px; }

.auth-modal__form.auth__card { width: auto; align-content: start; padding: 30px 32px 22px; animation: none; }
.modal--auth .auth__tabs { margin-right: 44px; }
.modal--auth .auth__title { font-size: 24px; }
.modal--auth .auth__subtitle { margin-bottom: 12px; }
.auth__reason {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -8px 0 8px;
  padding: 9px 12px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  animation: rise-in 300ms var(--ease-out);
}
.auth__reason span { display: grid; }
.auth-modal__fine { margin-top: 14px; color: var(--text-3); font-size: 11.5px; line-height: 1.5; text-align: center; }

@media (max-width: 760px) {
  .auth-modal { grid-template-columns: 1fr; min-height: 0; }
  .auth-modal__art { display: none; }
  .auth-modal__form.auth__card { padding: 20px 18px 18px; }
  .modal--auth .auth__tabs { margin-right: 0; margin-top: 30px; }
}

/* /css/lobby.css */
.page {
  width: min(var(--page-max), 100%);
  margin: 0 auto;
  padding: 28px var(--gutter) 64px;
  animation: rise-in 420ms var(--ease-out);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: center;
  min-height: 320px;
  padding: 40px 44px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(600px 380px at 85% 50%, rgb(255 197 61 / 0.14), transparent 65%),
    radial-gradient(500px 400px at 10% 0%, rgb(90 169 255 / 0.1), transparent 60%),
    linear-gradient(135deg, var(--bg-2), var(--bg-1));
  box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
}
.hero__copy { position: relative; z-index: 1; }
.hero__eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.hero__title {
  margin: 10px 0 12px;
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.03em;
}
.hero__text { max-width: 520px; color: var(--text-2); font-size: 15.5px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero__actions .btn--xl { padding: 0 22px; }

.hero__stack { position: relative; height: 260px; }
.hero__card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 50px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.07);
  transition: transform 600ms var(--ease-out);
}
.hero__card .art { width: 100%; height: 100%; }
.hero__card--0 { transform: translate(-100%, -48%) rotate(-10deg) scale(0.86); filter: brightness(0.55); }
.hero__card--1 { transform: translate(0%, -52%) rotate(10deg) scale(0.86); filter: brightness(0.55); }
.hero__card--2 { transform: translate(-50%, -50%); z-index: 2; width: 176px; }
.hero:hover .hero__card--0 { transform: translate(-110%, -50%) rotate(-14deg) scale(0.86); }
.hero:hover .hero__card--1 { transform: translate(10%, -54%) rotate(14deg) scale(0.86); }
.hero:hover .hero__card--2 { transform: translate(-50%, -54%) rotate(-2deg); }

/* ---------- Sections ---------- */

.section { margin-top: 40px; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section__head h2 { font-size: 20px; font-weight: 800; }
.section__count { color: var(--text-3); font-weight: 600; font-size: 13px; }
.section__link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--text-2);
  font-weight: 650;
  font-size: 13px;
}
.section__link:hover { color: var(--text); }

/* ---------- Game tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cover-min), 1fr));
  grid-auto-flow: dense;
  gap: 16px;
}
.tile {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-2);
  box-shadow: var(--shadow-2);
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}
.tile--featured { grid-column: span 2; grid-row: span 2; }
.tile__art { position: absolute; inset: 0; transition: transform 700ms var(--ease-out); }
.tile__art .art { width: 100%; height: 100%; }
.tile__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgb(3 6 12 / 0.85));
}
.tile__meta {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  justify-items: start;
  gap: 4px;
}
.tile__name { font-size: 18px; font-weight: 800; text-shadow: 0 2px 10px rgb(0 0 0 / 0.5); }
.tile__fact { color: rgb(255 255 255 / 0.7); font-size: 12px; font-weight: 600; }
.tile__tagline { max-width: 340px; color: rgb(255 255 255 / 0.82); font-size: 14px; margin-bottom: 2px; }
.tile--featured .tile__meta { left: 24px; bottom: 24px; gap: 8px; }
.tile--featured .tile__name { font-size: clamp(28px, 3vw, 40px); font-weight: 900; }
.tile--featured .tile__fact { font-size: 13px; }
.tile__cta { position: absolute; right: 24px; bottom: 24px; }
.tile > .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  backdrop-filter: blur(6px);
  background: rgb(8 12 22 / 0.55);
}
.tile > .badge--live { background: rgb(4 30 18 / 0.7); }

.tile.is-soon .tile__art { filter: saturate(0.35) brightness(0.62); }

@media (hover: hover) {
  a.tile:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgb(0 0 0 / 0.45), 0 0 0 1px rgb(255 255 255 / 0.1); }
  a.tile:hover .tile__art { transform: scale(1.05); }
}
a.tile:active { transform: translateY(-2px) scale(0.99); }
.tile.is-soon:hover .tile__art { filter: saturate(0.6) brightness(0.75); }

/* Art micro-animations, triggered by hovering the tile. */
/* Only elements without a transform attribute are animated with `transform`; the rest use `translate`. */
.a-pop, .a-flame, .a-card-l, .a-card-r, .a-bob, .a-shake { transform-box: fill-box; transform-origin: center; }
.tile:hover .a-bob, .hero__card--2 .a-bob { animation: bob 2.4s var(--ease-in-out) infinite; }
.tile:hover .a-bob--late { animation-delay: -1.2s; }
.tile:hover .a-drift { animation: drift 4s var(--ease-in-out) infinite alternate; }
.a-spin { transform-box: fill-box; transform-origin: center; }
.tile:hover .a-spin, .hero__card--2 .a-spin { animation: art-spin 9s linear infinite; }
@keyframes art-spin { to { rotate: 360deg; } }
/* Groups that carry a transform attribute only get `translate`: touching transform-origin would move them. */
.tile:hover .a-rocket { animation: rocket 1.6s var(--ease-in-out) infinite; }
.tile:hover .a-flame { animation: flame 120ms linear infinite alternate; transform-origin: top; }
.tile:hover .a-pop { animation: gem-pop 1.4s var(--ease-spring) infinite; }
.tile:hover .a-shake { animation: fx-shake 600ms infinite; --shake: 1.5px; }
.tile:hover .a-bulb { animation: pulse 500ms steps(2) infinite; }
.tile:hover .a-bulb--alt { animation-delay: -250ms; }
.tile:hover .a-line { animation: pulse 700ms ease-in-out infinite; }
.tile:hover .a-card-l { animation: card-l 1.8s var(--ease-in-out) infinite; }
.tile:hover .a-card-r { animation: card-r 1.8s var(--ease-in-out) infinite; }
.tile:hover .a-glow { animation: pulse 1.6s ease-in-out infinite; }
.tile:hover .a-car { animation: car 1.4s linear infinite; }
.tile:hover .a-hop { animation: hop 700ms var(--ease-out) infinite; }

@keyframes drift { to { transform: translateY(14px); } }
@keyframes rocket { 50% { translate: 5px -7px; } }
@keyframes flame { to { transform: scaleY(1.25); } }
@keyframes gem-pop { 0%, 60%, 100% { transform: scale(1); } 30% { transform: scale(1.12) rotate(-4deg); } }
@keyframes card-l { 50% { transform: rotate(-4deg) translateX(-4px); } }
@keyframes card-r { 50% { transform: rotate(4deg) translateX(4px); } }
@keyframes car { from { translate: 0 -140px; } to { translate: 0 420px; } }
@keyframes hop { 40% { translate: 0 -12px; } }

/* ---------- Recent bets + explainer ---------- */

.section--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.recent__skeleton { height: 44px; margin-bottom: 6px; }
/* The live feed changes several times a second: until it scrolls near the screen it is not drawn
   at all (the browser keeps its last height meanwhile). */
.lobby__feed { content-visibility: auto; contain-intrinsic-size: auto 640px; }
.cell-game { display: inline-flex; align-items: center; gap: 8px; }
.cell-game span { display: grid; color: var(--text-3); }

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 36px 16px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  color: var(--text-3);
  text-align: center;
  font-weight: 600;
}

.explainer {
  display: grid;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, color-mix(in srgb, var(--win) 10%, var(--bg-1)), var(--bg-1) 55%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.explainer__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--win) 14%, transparent);
  color: var(--win);
}
.explainer h3 { font-size: 17px; }
.explainer p { color: var(--text-2); font-size: 13.5px; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: minmax(0, 1fr) 300px; }
  .hero__card--2 { width: 150px; }
  .hero__card { width: 130px; }
}
@media (max-width: 1000px) {
  .section--split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 28px 22px; }
  .hero__stack { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tile__cta { display: none; }
}

/* ---------- A visitor's lobby ---------- */

.hero--guest .hero__title { max-width: 15ch; font-size: clamp(30px, 3.6vw, 48px); }
.hero--guest .hero__actions .btn span { display: grid; }

.perks { display: grid; gap: 14px; align-content: start; }
.perks__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.perk {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 200ms, transform 200ms var(--ease-out);
}
@media (hover: hover) {
  .perk:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, var(--line)); transform: translateY(-2px); }
}
.perk__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); color: var(--accent); }
.perk strong { display: block; font-weight: 750; }
.perk p { margin-top: 3px; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.perks > .btn { width: auto; justify-self: start; }
@media (max-width: 600px) {
  .perks__list { grid-template-columns: 1fr; }
  .perks > .btn { justify-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .perk:hover { transform: none; }
}

/* ---------- Discord invitation ---------- */

.discord-cta {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
  padding: 22px 24px;
  overflow: hidden;
  border-radius: var(--radius-l);
  background:
    radial-gradient(420px 220px at 0% 50%, rgb(88 101 242 / 0.35), transparent 70%),
    linear-gradient(120deg, #1b2050, #141a33 55%, var(--bg-1));
  box-shadow: inset 0 0 0 1px rgb(88 101 242 / 0.35);
}
.discord-cta__ghost {
  /* The mark again, large and faint, bleeding off the right edge. */
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%) rotate(-12deg);
  color: rgb(88 101 242 / 0.1);
  pointer-events: none;
}
.discord-cta__ghost .social-icon { width: 200px; height: 200px; }
.discord-cta__mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: #5865f2;
  color: #fff;
  box-shadow: 0 10px 30px rgb(88 101 242 / 0.45);
}
.discord-cta__mark .social-icon { width: 32px; height: 32px; }
.discord-cta__copy h2 { font: 800 20px/1.2 var(--font-display); }
.discord-cta__copy p { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.discord-cta__join { position: relative; z-index: 1; background: #5865f2; color: #fff; box-shadow: 0 8px 24px rgb(88 101 242 / 0.35); }
.discord-cta__join:hover { background: #6d78f6; }

@media (max-width: 720px) {
  .discord-cta { grid-template-columns: auto minmax(0, 1fr); }
  .discord-cta__join { grid-column: 1 / -1; justify-content: center; }
}

/* The Discord button beside the hero's actions: square, in Discord's colour. */
.hero__actions .hero__discord {
  width: 52px;
  aspect-ratio: 1;
  padding: 0;
  background: rgb(88 101 242 / 0.16);
  box-shadow: inset 0 0 0 1px rgb(88 101 242 / 0.45);
  color: #aab2ff;
}
.hero__actions .hero__discord:hover { background: #5865f2; color: #fff; }
.hero__discord .social-icon { width: 22px; height: 22px; }

/* /css/game.css */
/* ---------- Game frame ---------- */

.game-page { padding-top: 24px; }

.game {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  grid-template-rows: minmax(520px, auto) auto;
  grid-template-areas: "panel board" "foot foot";
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-1);
  box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
}
/* Big screens: a roomier bet panel, and a board that grows with the screen's height (the bars and
   the footer strip keep about 260 pixels of it). */
@media (min-width: 1800px) {
  .game {
    grid-template-columns: 380px minmax(0, 1fr);
    grid-template-rows: minmax(clamp(520px, calc(100dvh - 260px), 760px), auto) auto;
  }
}
.game__panel {
  grid-area: panel;
  padding: 16px;
  background: var(--bg-1);
  box-shadow: 1px 0 0 var(--line);
}
.game__board {
  grid-area: board;
  position: relative;
  min-width: 0;
  background: var(--bg-0);
  overflow: hidden;
}
.game__foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  padding: 0 12px 0 20px;
  background: var(--bg-1);
  box-shadow: 0 -1px 0 var(--line);
}
.game__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}
.game__title span { display: grid; color: var(--accent); }
.game__edge { margin-right: auto; color: var(--text-3); font-weight: 600; font-size: 12.5px; }

/* ---------- Bet panel ---------- */

.bet-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.bet-panel .seg { margin-bottom: 2px; }
.bet-button { margin-top: 4px; }
.bet-button.is-cashout {
  --btn-bg: var(--win);
  --btn-bg-hover: color-mix(in srgb, var(--win) 86%, white);
  --btn-fg: var(--win-ink);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.35) inset, 0 -2px 0 rgb(0 0 0 / 0.18) inset,
    0 6px 20px color-mix(in srgb, var(--win) 30%, transparent);
}
.bet-panel__after { display: grid; gap: 10px; }
.bet-panel__next { display: grid; gap: 14px; }
.round-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: var(--bg-0);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}
.round-stat strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.round-stat strong.is-win { color: var(--win); }
.select-field select { appearance: none; }
.select-field .input { padding-right: 10px; }
.select-field .input::after {
  content: "";
  width: 8px;
  height: 8px;
  margin: -4px 4px 0 0;
  border: solid var(--text-3);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.auto-fields { display: grid; gap: 14px; animation: rise-in 240ms var(--ease-out); }
.rule { display: grid; grid-template-columns: 1fr 96px; gap: 8px; }
.rule .seg { padding: 3px; }
.rule .seg button { height: 32px; padding: 0 8px; font-size: 12.5px; }
.rule .seg__thumb { top: 3px; bottom: 3px; }
.rule__percent { height: 38px; }
.rule__percent input:disabled { color: var(--text-3); }
.auto-left { color: var(--accent) !important; }

.bet-panel__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  color: var(--text-3);
  font-size: 12px;
}
.bet-panel__foot .switch span:not(.switch__track) { display: inline-grid; }
.bet-panel__keys { display: inline-flex; align-items: center; gap: 6px; }
kbd {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-3);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.3);
  color: var(--text-2);
  font: 600 11px var(--font-ui);
}

@media (max-width: 1000px) {
  .game {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas: "board" "panel" "foot";
  }
  .game__panel { box-shadow: 0 -1px 0 var(--line); }
  .bet-panel__keys { display: none; }
  /* The bet button comes first, right under the game, so a bet and its result are on screen together;
     what goes with it (a cash-out, the round's stats) follows, then the settings. */
  .bet-panel > .bet-button { order: -2; margin-top: 0; }
  .bet-panel > .bet-panel__next { order: -1; }
}
@media (max-width: 600px) {
  .game-page { padding: 12px 0 48px; }
  .game { border-radius: 0; }
  .game-page > .section { padding: 0 var(--gutter); }
}

/* ---------- Round result card ---------- */

.round-result {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 8;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 170px;
  padding: 18px 26px;
  border-radius: 16px;
  background: rgb(11 17 29 / 0.92);
  box-shadow: 0 0 0 3px var(--win), 0 20px 50px rgb(0 0 0 / 0.5), 0 0 40px rgb(34 224 143 / 0.3);
  translate: -50% -50%;
  pointer-events: none;
  animation: result-in 520ms var(--ease-spring);
}
.round-result strong { font-family: var(--font-display); font-size: 30px; font-weight: 900; color: var(--win); }
.round-result span { color: var(--text); font-weight: 700; font-size: 15px; }
@keyframes result-in { from { opacity: 0; scale: 0.6; } }

/* /css/dice.css */
.dice-board {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  min-height: 520px;
  padding: 20px 32px 28px;
  background:
    radial-gradient(700px 300px at 50% 55%, rgb(34 224 143 / 0.06), transparent 70%),
    var(--bg-0);
}

/* ---------- Recent results ---------- */

.dice-history {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  height: 32px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 30%);
}
.dice-pill {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 62px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  animation: pill-in 360ms var(--ease-spring);
}
.dice-pill.is-win { background: var(--win); color: var(--win-ink); }
.dice-pill:first-child { box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 3px currentColor; }
@keyframes pill-in { from { opacity: 0; transform: translateX(-16px) scale(0.8); } }

/* ---------- Slider ---------- */

.dice-stage { display: grid; align-items: center; }
.dice-slider {
  padding: 22px 26px 16px;
  border-radius: 999px;
  background: var(--bg-2);
  box-shadow: inset 0 2px 0 rgb(0 0 0 / 0.25), 0 0 0 1px var(--line);
}
.dice-track {
  --pos: 0.5;
  --win-color: var(--win);
  --lose-color: var(--loss);
  position: relative;
  height: 12px;
  border-radius: 12px;
  background: var(--bg-0);
}
.dice-track__lose, .dice-track__win {
  position: absolute;
  top: 0;
  bottom: 0;
  transition: left 120ms var(--ease-out), right 120ms var(--ease-out), background-color 200ms;
}
/* "Under": win on the left of the handle. "Over": win on the right. */
.dice-track__win { left: 0; right: calc((1 - var(--pos)) * 100%); background: var(--win-color); border-radius: 12px 0 0 12px; }
.dice-track__lose { left: calc(var(--pos) * 100%); right: 0; background: var(--lose-color); border-radius: 0 12px 12px 0; }
.dice-track.is-over .dice-track__win { left: calc(var(--pos) * 100%); right: 0; border-radius: 0 12px 12px 0; }
.dice-track.is-over .dice-track__lose { left: 0; right: calc((1 - var(--pos)) * 100%); border-radius: 12px 0 0 12px; }
.dice-track.is-swapping .dice-track__win,
.dice-track.is-swapping .dice-track__lose { animation: track-swap 360ms var(--ease-out); }
@keyframes track-swap { from { opacity: 0.2; } }
.dice-track.flash-win { animation: track-glow-win 700ms var(--ease-out); }
.dice-track.flash-loss { animation: track-glow-loss 500ms var(--ease-out); }
@keyframes track-glow-win { from { box-shadow: 0 0 28px 4px rgb(34 224 143 / 0.55); } }
@keyframes track-glow-loss { from { box-shadow: 0 0 22px 2px rgb(255 77 99 / 0.45); } }

.dice-thumb {
  position: absolute;
  top: 50%;
  left: calc(var(--pos) * 100%);
  width: 34px;
  height: 34px;
  translate: -50% -50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 9px;
  background: linear-gradient(180deg, #7fb6ff, #3d86f0);
  box-shadow: 0 2px 0 #1f5cbf, 0 6px 16px rgb(0 0 0 / 0.45);
  pointer-events: none;
  transition: left 120ms var(--ease-out), transform 160ms var(--ease-spring);
  z-index: 2;
}
.dice-thumb span { width: 2px; height: 14px; border-radius: 2px; background: rgb(255 255 255 / 0.7); }
.dice-range:active ~ .dice-thumb, .dice-track:has(.dice-range:active) .dice-thumb { transform: scale(1.1); }

/* The native range sits on top, invisible, so keyboard and screen readers work as usual. */
.dice-range {
  position: absolute;
  inset: -14px -17px;
  width: calc(100% + 34px);
  height: 40px;
  margin: 0;
  opacity: 0;
  cursor: grab;
  z-index: 3;
}
.dice-range:active { cursor: grabbing; }
.dice-track:has(.dice-range:focus-visible) .dice-thumb { outline: 2px solid var(--info); outline-offset: 3px; }

.dice-scale {
  display: flex;
  justify-content: space-between;
  margin: 20px -6px 0;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
}
.dice-scale span { width: 24px; text-align: center; }

/* ---------- Result marker ---------- */

.dice-marker {
  --x: 0.5;
  --dur: 500ms;
  position: absolute;
  bottom: calc(100% + 18px);
  left: calc(var(--x) * 100%);
  translate: -50% 0;
  transition: left var(--dur) cubic-bezier(0.2, 0.9, 0.25, 1.08);
  z-index: 4;
  pointer-events: none;
}
.dice-marker__hex {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 78px;
  height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg-0);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.45);
  transition: background-color 160ms, color 160ms;
}
.dice-marker__hex::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  translate: -50% -1px;
  border: 8px solid transparent;
  border-top-color: var(--marker-tip, var(--text));
}
.dice-marker.is-win .dice-marker__hex { background: var(--win); color: var(--win-ink); --marker-tip: var(--win); }
.dice-marker.is-loss .dice-marker__hex { background: var(--loss); color: #fff; --marker-tip: var(--loss); }
.dice-marker.is-landed .dice-marker__hex { animation: fx-pop 380ms var(--ease-spring); }

.dice-float-layer { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.dice-float {
  position: absolute;
  bottom: calc(100% + 72px);
  left: calc(var(--x) * 100%);
  translate: -50% 0;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  animation: float-up 1100ms var(--ease-out) forwards;
}
.dice-float.is-win { color: var(--win); }
.dice-float.is-loss { color: var(--text-3); }
@keyframes float-up {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  20% { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-26px); }
}

/* ---------- Stats row ---------- */

.dice-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
}
.dice-stats .input { background: var(--bg-0); }
.dice-target input { font-weight: 700; }

@media (max-width: 1000px) {
  .dice-board { min-height: 420px; padding: 16px 18px 18px; }
}
@media (max-width: 600px) {
  /* Compact on a phone: the slider and the roll's result stay in view above the bet button. */
  .dice-board { min-height: 340px; gap: 12px; padding: 12px 14px 16px; }
  .dice-stats { grid-template-columns: 1fr 1fr; }
  .dice-stats > .field:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .dice-slider { padding: 18px 20px 14px; }
}

/* /css/mines.css */
.mines-board {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 520px;
  padding: 28px;
  background:
    radial-gradient(520px 420px at 50% 50%, rgb(61 123 255 / 0.12), transparent 70%),
    var(--bg-0);
  transition: background-color 400ms;
}
.mines-board.is-lost { background: radial-gradient(520px 420px at 50% 50%, rgb(255 77 99 / 0.12), transparent 70%), var(--bg-0); }
.mines-board.is-won { background: radial-gradient(520px 420px at 50% 50%, rgb(34 224 143 / 0.12), transparent 70%), var(--bg-0); }

.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 1.4vw, 14px);
  width: min(100%, 540px);
}
.mines-grid.is-dealing .mine-tile { animation: tile-deal 420ms var(--ease-spring) backwards; }
.mines-grid.is-dealing .mine-tile:nth-child(5n+2) { animation-delay: 30ms; }
.mines-grid.is-dealing .mine-tile:nth-child(5n+3) { animation-delay: 60ms; }
.mines-grid.is-dealing .mine-tile:nth-child(5n+4) { animation-delay: 90ms; }
.mines-grid.is-dealing .mine-tile:nth-child(5n) { animation-delay: 120ms; }
@keyframes tile-deal { from { transform: scale(0.6) translateY(10px); opacity: 0; } }

.mine-tile {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  perspective: 600px;
}
.mine-tile:disabled { cursor: default; }
.mine-tile__face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #34558f, #2b4a8f);
  box-shadow: 0 5px 0 #152a5c, inset 0 1px 0 rgb(255 255 255 / 0.12);
  transition: transform 160ms var(--ease-out), background-color 160ms, box-shadow 160ms, opacity 200ms;
}
.mine-tile:not(:disabled):hover .mine-tile__face {
  transform: translateY(-3px);
  background: linear-gradient(180deg, #4166a8, #34579c);
  box-shadow: 0 8px 0 #152a5c, 0 12px 24px rgb(0 0 0 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.16);
}
.mine-tile:not(:disabled):active .mine-tile__face { transform: translateY(2px); box-shadow: 0 2px 0 #152a5c; }
.mine-tile:disabled:not(.is-gem):not(.is-mine) .mine-tile__face { opacity: 0.72; }
.mine-tile.is-pending .mine-tile__face { animation: tile-pending 500ms ease-in-out infinite alternate; }
@keyframes tile-pending { to { background: #5b7fc4; transform: translateY(-2px); } }

.mine-tile.is-gem .mine-tile__face,
.mine-tile.is-mine .mine-tile__face {
  background: #0a1633;
  box-shadow: inset 0 0 0 2px #1d3570;
  transform: none;
}
.mine-tile.is-gem:not(.is-dim) .mine-tile__face {
  background: radial-gradient(circle, rgb(47 227 140 / 0.28), #0a1633 70%);
  box-shadow: inset 0 0 0 2px rgb(47 227 140 / 0.55), 0 0 22px rgb(47 227 140 / 0.25);
}
.mine-tile.is-mine:not(.is-dim) .mine-tile__face {
  background: radial-gradient(circle, rgb(255 77 99 / 0.4), #2a0a12 70%);
  box-shadow: inset 0 0 0 2px rgb(255 77 99 / 0.7), 0 0 28px rgb(255 77 99 / 0.4);
}
.mine-tile__content {
  position: absolute;
  inset: 14%;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.mine-tile__content .sprite { width: 100%; height: 100%; }
.mine-tile.is-flipped .mine-tile__content { animation: sprite-pop 460ms var(--ease-spring); }
.mine-tile.is-flipped .mine-tile__face { animation: tile-flip 360ms var(--ease-out); }
.mine-tile.is-dim .mine-tile__content { opacity: 0.4; transform: scale(0.78); }
.mine-tile.is-dim .mine-tile__face { opacity: 0.55; }
@keyframes sprite-pop { from { transform: scale(0.2) rotate(-25deg); opacity: 0; } }
@keyframes tile-flip { from { transform: rotateY(90deg); } }

/* Next multiplier hint on hover. */
.mine-tile:not(:disabled)[data-next]:hover::after {
  content: attr(data-next);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  translate: -50% 0;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg-0);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
  animation: fade-in 150ms;
}

@media (max-width: 600px) {
  .mines-board { min-height: 380px; padding: 16px; }
}

/* Big screens: the field grows with the board, as far as the screen's height allows. */
@media (min-width: 1800px) {
  .mines-grid { width: min(100%, 700px, calc(100dvh - 330px)); }
}

/* /css/tower.css */
.tower-board {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 560px;
  padding: 24px;
  background:
    radial-gradient(500px 500px at 50% 0%, rgb(211 77 255 / 0.18), transparent 70%),
    linear-gradient(180deg, #1a0a26, var(--bg-0) 70%);
}
.tower-board.is-won { background: radial-gradient(500px 500px at 50% 0%, rgb(255 197 61 / 0.2), transparent 70%), linear-gradient(180deg, #1f1406, var(--bg-0) 70%); }

.tower {
  display: grid;
  gap: 8px;
  width: min(100%, 480px);
}
.tower.is-rising .tower-row { animation: row-rise 480ms var(--ease-out) backwards; }
.tower.is-rising .tower-row:nth-last-child(2) { animation-delay: 30ms; }
.tower.is-rising .tower-row:nth-last-child(3) { animation-delay: 60ms; }
.tower.is-rising .tower-row:nth-last-child(4) { animation-delay: 90ms; }
.tower.is-rising .tower-row:nth-last-child(5) { animation-delay: 120ms; }
.tower.is-rising .tower-row:nth-last-child(6) { animation-delay: 150ms; }
.tower.is-rising .tower-row:nth-last-child(7) { animation-delay: 180ms; }
.tower.is-rising .tower-row:nth-last-child(8) { animation-delay: 210ms; }
.tower.is-rising .tower-row:nth-last-child(9) { animation-delay: 240ms; }
@keyframes row-rise { from { opacity: 0; transform: translateY(18px); } }

.tower-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: 12px;
  transition: background-color 240ms, box-shadow 240ms;
}
.tower-row__mult {
  color: var(--text-3);
  font-weight: 800;
  font-size: 12.5px;
  text-align: right;
  transition: color 200ms;
}
.tower-row__tiles {
  display: grid;
  grid-template-columns: repeat(var(--tiles), 1fr);
  gap: 8px;
}
.tower-row.is-current {
  background: rgb(211 77 255 / 0.12);
  box-shadow: inset 0 0 0 2px rgb(224 107 255 / 0.55), 0 0 30px rgb(211 77 255 / 0.2);
}
.tower-row.is-current .tower-row__mult { color: #f5d0ff; }
.tower-row.is-cleared .tower-row__mult { color: var(--accent); }
.tower-row.is-broken { animation: fx-shake 420ms; --shake: 4px; }

.tower-tile {
  position: relative;
  height: 44px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #5a2378, #4a1a63);
  box-shadow: 0 4px 0 #240a33, inset 0 1px 0 rgb(255 255 255 / 0.1);
  cursor: pointer;
  transition: transform 150ms var(--ease-out), background-color 150ms, box-shadow 150ms, opacity 200ms;
}
.tower-tile:disabled { cursor: default; }
.tower-row:not(.is-current) .tower-tile:not(.is-egg):not(.is-skull) { opacity: 0.55; }
.tower-tile:not(:disabled):hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #7a33a0, #642587);
  box-shadow: 0 6px 0 #240a33, 0 10px 20px rgb(0 0 0 / 0.35);
}
.tower-tile:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 #240a33; }
.tower-tile.is-pending { animation: tile-pending-tower 450ms ease-in-out infinite alternate; }
@keyframes tile-pending-tower { to { background: #8a3fb3; } }
.tower-tile.is-egg, .tower-tile.is-skull { box-shadow: none; transform: none; }
.tower-tile.is-egg { background: linear-gradient(180deg, #6b1f7a, #4a1263); box-shadow: inset 0 0 0 2px rgb(255 210 87 / 0.6), 0 0 18px rgb(255 197 61 / 0.25); }
.tower-tile.is-skull { background: #2a0d18; box-shadow: inset 0 0 0 2px rgb(255 77 99 / 0.7), 0 0 20px rgb(255 77 99 / 0.35); }
.tower-tile.is-dim { opacity: 0.45; box-shadow: none; }
.tower-tile__content { position: absolute; inset: 4px; display: grid; place-items: center; pointer-events: none; }
.tower-tile__content .sprite { height: 100%; width: auto; }
.tower-tile.is-flipped .tower-tile__content { animation: sprite-pop 460ms var(--ease-spring); }

@media (max-width: 600px) {
  .tower-board { padding: 14px; min-height: 0; }
  .tower-row { grid-template-columns: 52px 1fr; gap: 6px; }
  .tower-tile { height: 38px; }
}

/* Big screens: a wider tower, its floors a little taller. */
@media (min-width: 1800px) {
  .tower { width: min(100%, 600px); }
  .tower-tile { height: 52px; }
}

/* /css/chicken.css */
.chicken-board {
  position: relative;
  height: 100%;
  min-height: 520px;
  overflow: hidden;
  background: #2b2f3a;
}
.chicken-board::after {
  /* Vignette so the road fades at the edges of the frame. */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(11 17 29 / 0.55), transparent 12%, transparent 88%, rgb(11 17 29 / 0.55));
  pointer-events: none;
  z-index: 6;
}

.road {
  --offset: 0px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--road-w);
  display: flex;
  transform: translateX(var(--offset));
  transition: transform 520ms var(--ease-out);
}
.road.no-transition, .chicken.no-transition { transition: none; }

.sidewalk {
  position: relative;
  flex: none;
  width: 132px;
  background:
    repeating-linear-gradient(0deg, transparent 0 46px, rgb(0 0 0 / 0.18) 46px 48px),
    linear-gradient(90deg, #6b7086, #7c8198);
}
.sidewalk--start { box-shadow: inset -6px 0 0 #b8bccb; }
.sidewalk--finish {
  box-shadow: inset 6px 0 0 #b8bccb;
  background:
    repeating-conic-gradient(#f1f3fb 0 25%, #15171f 0 50%) 0 0 / 22px 22px;
}
.sidewalk__label {
  position: absolute;
  top: 18px;
  left: 50%;
  translate: -50% 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(11 17 29 / 0.7);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.lane {
  position: relative;
  flex: none;
  width: 104px;
  /* Its size comes from the road, never from what is inside: cars can then move in cqh. */
  container-type: size;
  background: #353a4a;
  overflow: hidden;
}
.lane:nth-child(odd) { background: #2f3442; }
.lane::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: -2px;
  width: 4px;
  background: repeating-linear-gradient(180deg, #e8e2c8 0 26px, transparent 26px 50px);
  opacity: 0.45;
}
.lane.is-crossed { background: #3a3f50; }

.lane__cover {
  position: absolute;
  top: 58%;
  left: 50%;
  width: 76px;
  height: 76px;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  z-index: 1;
}
.lane__cover > span { position: absolute; inset: 0; }
.lane__cover .sprite { width: 100%; height: 100%; }
.lane__cover strong {
  position: relative;
  color: #e8e2c8;
  font-size: 12.5px;
  font-weight: 800;
  text-shadow: 0 1px 0 rgb(0 0 0 / 0.5);
  transition: color 200ms;
}
.lane.is-next .lane__cover strong { color: #fff; }
/* The next cover glows: a soft halo behind it fading in and out (opacity runs off the main thread). */
.lane__cover::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 197 61 / 0.55), rgb(255 197 61 / 0.2) 70%, transparent);
  opacity: 0;
}
.lane.is-next .lane__cover::before { animation: cover-glow 1.2s ease-in-out infinite alternate; }
@keyframes cover-glow { to { opacity: 1; } }
.lane.is-crossed .sprite--cover circle:nth-of-type(1), .lane.is-current .sprite--cover circle:nth-of-type(1) { fill: #8a5d00; }
.lane.is-crossed .sprite--cover circle:nth-of-type(2), .lane.is-current .sprite--cover circle:nth-of-type(2) { fill: #ffc53d; }
.lane.is-crossed .sprite--cover circle:nth-of-type(3), .lane.is-current .sprite--cover circle:nth-of-type(3) { stroke: #e0a100; }
.lane.is-crossed .sprite--cover circle:nth-of-type(4), .lane.is-current .sprite--cover circle:nth-of-type(4) { stroke: #fff1c1; opacity: 0.6; }
.lane.is-crossed .lane__cover strong, .lane.is-current .lane__cover strong { color: #3a2600; text-shadow: 0 1px 0 rgb(255 255 255 / 0.35); }
.lane__cover.is-claimed { animation: cover-claim 460ms var(--ease-spring); }
@keyframes cover-claim { 0% { scale: 0.8; } 45% { scale: 1.14; } }

.lane__barrier {
  position: absolute;
  top: 30%;
  left: 50%;
  width: 92px;
  translate: -50% -60px;
  opacity: 0;
  z-index: 3;
  transition: translate 320ms var(--ease-spring), opacity 200ms;
}
.lane__barrier .sprite { width: 100%; height: auto; }
.lane.is-crossed .lane__barrier { translate: -50% 0; opacity: 1; }

/* Cars ride on transform (cqh = 1% of the lane's height), so a moving car never costs a layout. */
.car {
  --dur: 1600ms;
  position: absolute;
  top: 0;
  left: 50%;
  width: 52px;
  translate: -50% -50%;
  z-index: 2;
  animation: drive var(--dur) linear forwards;
}
.car .sprite { width: 100%; height: auto; }
.car--truck { width: 56px; }
/* Near miss: brakes hard, nose dips, then waits where it stopped. */
.car.is-brake { animation: brake 620ms cubic-bezier(0.15, 0.75, 0.3, 1) forwards; }
.car.is-brake .sprite { animation: nose-dip 620ms ease-out forwards; transform-origin: 50% 100%; }
@keyframes brake { from { transform: translateY(-25cqh); } to { transform: translateY(24cqh); } }
@keyframes nose-dip { 0%, 55% { transform: none; } 75% { transform: scaleY(0.95) translateY(3px); } 100% { transform: none; } }

.skid {
  position: absolute;
  top: 4%;
  left: 50%;
  width: 34px;
  height: 22%;
  translate: -50% 0;
  background:
    linear-gradient(90deg, transparent 0 8%, rgb(12 13 18 / 0.55) 8% 26%, transparent 26% 74%, rgb(12 13 18 / 0.55) 74% 92%, transparent 92%);
  mask-image: linear-gradient(180deg, transparent, black 40%, black 80%, transparent);
  opacity: 0.6;
  z-index: 1;
  animation: fade-in 300ms ease-out backwards;
  pointer-events: none;
}
.lane.is-hit .skid { top: 30%; height: 30%; }
@keyframes drive { from { transform: translateY(-20cqh); } to { transform: translateY(120cqh); } }
/* The car that hits the chicken reaches it halfway through its run. */
.car.is-hit { z-index: 5; animation-name: drive-hit; }
@keyframes drive-hit { 0% { transform: translateY(-20cqh); } 50% { transform: translateY(50cqh); } 100% { transform: translateY(125cqh); } }

.chicken {
  --x: 66px;
  position: absolute;
  top: 58%;
  left: 0;
  width: 78px;
  translate: calc(var(--x) - 50%) -62%;
  z-index: 4;
  transition: translate 420ms var(--ease-out);
  pointer-events: none;
}
.chicken .sprite { width: 100%; height: auto; overflow: visible; }
.chicken.is-hopping .chicken__body { animation: chicken-hop 420ms var(--ease-out); }
.chicken.is-hopping .chicken__wing { animation: wing-flap 140ms ease-in-out 3; }
.chicken__wing { transform-box: fill-box; transform-origin: 100% 20%; }
@keyframes wing-flap { 50% { transform: rotate(38deg); } }
.chicken.is-startled .chicken__body { animation: chicken-startle 420ms var(--ease-out); }
@keyframes chicken-startle {
  0% { transform: none; }
  30% { transform: translateY(-12px) scale(1.08, 0.94); }
  60% { transform: translateY(0) scale(0.96, 1.04); }
}

/* Idle life: a blink every few seconds and a slow head bob while waiting. */
.chicken__eye { transform-box: fill-box; transform-origin: center; animation: chicken-blink 4.2s infinite; }
@keyframes chicken-blink { 0%, 94%, 100% { transform: none; } 97% { transform: scaleY(0.1); } }
.chicken__head { transform-box: fill-box; transform-origin: 30% 100%; }
.chicken:not(.is-hit):not(.is-hopping):not(.is-happy) .chicken__head { animation: chicken-idle 2.6s ease-in-out infinite; }
@keyframes chicken-idle { 0%, 60%, 100% { transform: none; } 75% { transform: rotate(9deg) translateY(1px); } 85% { transform: rotate(-3deg); } }

.chicken-ghost {
  --x: 66px;
  position: absolute;
  top: 58%;
  left: 0;
  width: 70px;
  translate: calc(var(--x) - 50%) -62%;
  z-index: 5;
  opacity: 0;
  filter: grayscale(1) brightness(1.7) drop-shadow(0 0 10px rgb(255 255 255 / 0.5));
  pointer-events: none;
  animation: ghost-rise 1.9s ease-out 150ms forwards;
}
.chicken-ghost .sprite { width: 100%; height: auto; overflow: visible; }
.chicken-ghost .chicken__shadow { display: none; }
@keyframes ghost-rise {
  0% { opacity: 0; transform: translateY(0); }
  18% { opacity: 0.75; }
  40% { transform: translate(-8px, -70px); }
  70% { transform: translate(8px, -130px); opacity: 0.45; }
  100% { transform: translate(0, -190px); opacity: 0; }
}
.chicken.is-hopping .chicken__shadow { animation: chicken-shadow 420ms var(--ease-out); }
@keyframes chicken-hop {
  0% { transform: translateY(0) scaleY(0.9); }
  45% { transform: translateY(-26px) scaleY(1.06); }
  85% { transform: translateY(0) scaleY(0.92); }
  100% { transform: translateY(0) scaleY(1); }
}
@keyframes chicken-shadow { 45% { transform: scale(0.6); opacity: 0.15; } }
.chicken__body, .chicken__shadow { transform-box: fill-box; transform-origin: 50% 100%; }
.chicken.is-hit .chicken__body { animation: chicken-flat 380ms var(--ease-out) forwards; }
@keyframes chicken-flat {
  0% { transform: none; }
  30% { transform: translateY(-10px) rotate(-18deg) scale(1.08); }
  100% { transform: rotate(-8deg) scaleY(0.42) scaleX(1.3); }
}
.chicken.is-hit .chicken__shadow { opacity: 0.5; transform: scaleX(1.4); }
.lane.is-hit .sprite--cover circle:nth-of-type(2) { fill: #7a2433; }
.lane.is-hit .lane__cover strong { color: #ffc2cb; }
.lane.is-hit { background: #3d2a33; }
.chicken.is-happy .chicken__body { animation: chicken-happy 600ms var(--ease-in-out) 3; }
@keyframes chicken-happy { 50% { transform: translateY(-14px) rotate(-6deg); } }


@media (max-width: 600px) {
  .chicken-board { min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .chicken__eye, .chicken__head, .chicken.is-hopping .chicken__wing, .chicken-ghost, .car.is-brake .sprite { animation: none !important; }
}

/* /css/slots.css */
.slots-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* the page's width, whatever the plaques would like */
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  height: 100%;
  min-height: 560px;
  padding: 18px 24px 20px;
  background:
    radial-gradient(700px 420px at 50% 40%, rgb(255 59 87 / 0.14), transparent 70%),
    linear-gradient(180deg, #1c0a12, var(--bg-0) 75%);
  transition: background 400ms;
}
.slots-board[data-machine="classic"] {
  background: radial-gradient(700px 420px at 50% 40%, rgb(255 197 61 / 0.12), transparent 70%), linear-gradient(180deg, #1b1406, var(--bg-0) 75%);
}
.slots-board[data-machine="tumble"] {
  background: radial-gradient(700px 420px at 50% 40%, rgb(183 125 255 / 0.16), transparent 70%), linear-gradient(180deg, #150a26, var(--bg-0) 75%);
}

.slots-board__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.slot-tabs { width: min(360px, 100%); }
.slot-tabs button:disabled { cursor: not-allowed; }

.slot-stage { display: grid; place-items: center; min-height: 0; }

/* ---------- Cabinet ---------- */

.slot-cabinet {
  --cell: clamp(64px, 9vw, 104px);
  position: relative;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, #3a0716, #200410);
  box-shadow:
    inset 0 0 0 3px #ffc53d,
    inset 0 0 0 6px #7a4a00,
    0 24px 60px rgb(0 0 0 / 0.5),
    0 0 60px rgb(255 59 87 / 0.18);
}
.slot-cabinet--classic { --cell: clamp(80px, 11vw, 124px); background: linear-gradient(180deg, #2a2206, #140f02); }
.slot-cabinet--tumble {
  --cell: clamp(48px, 6.4vw, 78px);
  background: linear-gradient(180deg, #24103d, #120822);
  box-shadow: inset 0 0 0 3px #b77dff, inset 0 0 0 6px #3d0f80, 0 24px 60px rgb(0 0 0 / 0.5), 0 0 60px rgb(183 125 255 / 0.2);
}

.reels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--reels), var(--cell));
  gap: 8px;
}
.reel {
  position: relative;
  height: calc(var(--cell) * var(--rows));
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(180deg, #d9d3dd, #fff 18%, #fff 82%, #d9d3dd);
  box-shadow: inset 0 8px 14px rgb(0 0 0 / 0.25), inset 0 -8px 14px rgb(0 0 0 / 0.25);
}
.slot-cabinet--video .reel, .slot-cabinet--classic .reel {
  background: linear-gradient(180deg, #1a1d2b, #262a3d 18%, #262a3d 82%, #1a1d2b);
}
.reel__strip { will-change: transform; }
.reel__strip.is-spinning { filter: blur(1.6px) brightness(1.08); }
.reel.is-landed { animation: reel-bump 260ms var(--ease-out); }
@keyframes reel-bump { 40% { transform: translateY(3px); } }
/* A reel that could complete a feature: a gold rim, and a brighter one breathing over it (opacity,
   so nothing repaints while it pulses). */
.reel.is-anticipating { box-shadow: inset 0 0 0 3px #ffc53d, 0 0 30px rgb(255 197 61 / 0.6); }
.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px #fff4cf, inset 0 0 26px rgb(255 197 61 / 0.75);
  opacity: 0;
  pointer-events: none;
}
.reel.is-anticipating::after { animation: anticipate 300ms ease-in-out infinite alternate; }
@keyframes anticipate { to { opacity: 1; } }

.slot-cell {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--cell);
  height: var(--cell);
  transition: filter 200ms, opacity 200ms;
}
.slot-cell__art { display: grid; width: 78%; height: 78%; transition: filter 200ms; }
.slot-cell__art .symbol { width: 100%; height: 100%; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 0.35)); }
/* What did not pay dims while the wins show; a Jackpot coin over it stays bright. */
.slot-cabinet.has-wins .slot-cell:not(.is-win) .slot-cell__art { filter: brightness(0.45) saturate(0.6); }
.slot-cell.is-win .slot-cell__art { animation: symbol-win 700ms var(--ease-in-out) infinite alternate; }
.slot-cell.is-win::before {
  content: "";
  position: absolute;
  inset: 5%;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgb(255 197 61 / 0.8), 0 0 20px rgb(255 197 61 / 0.45);
  animation: fade-in 200ms;
}
.slot-cell.is-scatter::before { box-shadow: inset 0 0 0 2px #ff6fb1, 0 0 24px rgb(255 111 177 / 0.6); }
@keyframes symbol-win { to { transform: scale(1.12); } }

.paylines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.payline {
  filter: drop-shadow(0 0 5px rgb(0 0 0 / 0.6));
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: draw-line 520ms var(--ease-out) forwards;
  opacity: 0.9;
}
@keyframes draw-line { to { stroke-dashoffset: 0; } }

/* ---------- Tumble ---------- */

.tumble-field {
  position: relative;
  width: calc(var(--cell) * var(--cols));
  height: calc(var(--cell) * var(--rows));
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(rgb(255 255 255 / 0.03) 1px, transparent 1px) 0 0 / 100% var(--cell),
    linear-gradient(90deg, rgb(255 255 255 / 0.03) 1px, transparent 1px) 0 0 / var(--cell) 100%,
    #1a0d2e;
}
.tumble-cell {
  position: absolute;
  left: calc(var(--c) * var(--cell));
  top: calc(var(--r) * var(--cell));
  transition: top 0ms;
}
.tumble-cell.is-win .slot-cell__art { animation: symbol-win 260ms var(--ease-in-out) infinite alternate; }
.tumble-cell.is-win::before { box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.8), 0 0 18px rgb(183 125 255 / 0.7); }
.tumble-cell.is-popping { animation: pop-out 240ms var(--ease-out) forwards; }
@keyframes pop-out { to { transform: scale(1.5); opacity: 0; } }
.slot-cell__orb {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: calc(var(--cell) * 0.24);
  text-shadow: 0 2px 0 #3d0f80, 0 0 10px rgb(224 184 255 / 0.8);
}
.slot-cell.is-orb-fire .slot-cell__art { animation: orb-fire 400ms ease-in-out infinite alternate; }
@keyframes orb-fire { to { transform: scale(1.2); filter: drop-shadow(0 0 16px #e0b8ff); } }

/* ---------- Jackpot coins ---------- */

/* A coin drops onto the corner of a symbol: the symbol underneath still pays as it is. */
.slot-coin {
  position: absolute;
  right: 2%;
  bottom: 2%;
  z-index: 2;
  width: 54%;
  height: 54%;
  pointer-events: none;
  animation: slot-coin-in 460ms var(--ease-spring) both;
}
.slot-coin .slot-coin__mark, .slot-coin .slot-coin__mark svg { display: block; width: 100%; height: 100%; }
.slot-coin__mark { filter: drop-shadow(0 3px 6px rgb(0 0 0 / 0.55)) drop-shadow(0 0 8px rgb(255 197 61 / 0.55)); }
.slot-coin::after {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(255 223 133 / 0.9);
  opacity: 0;
  animation: slot-coin-ring 620ms var(--ease-out) 120ms;
}
@keyframes slot-coin-in { from { opacity: 0; transform: translateY(-80%) scale(1.6); } }
@keyframes slot-coin-ring { from { opacity: 1; transform: scale(0.6); } to { opacity: 0; transform: scale(1.5); } }

/* ---------- Banner and win bar ---------- */

.slot-banner {
  position: absolute;
  top: 42%;
  left: 50%;
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 28px;
  border-radius: 16px;
  background: rgb(11 17 29 / 0.92);
  box-shadow: 0 0 0 2px var(--accent), 0 20px 40px rgb(0 0 0 / 0.5), 0 0 40px rgb(255 197 61 / 0.3);
  translate: -50% -50%;
  pointer-events: none;
  white-space: nowrap;
}
.slot-banner strong { font-family: var(--font-display); font-size: 22px; font-weight: 900; color: var(--accent); }
.slot-banner span { color: var(--text-2); font-weight: 650; font-size: 13px; }
.slot-banner.is-in { animation: result-in 420ms var(--ease-spring); }

.slot-winbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-radius: var(--radius-l);
  background: rgb(11 17 29 / 0.7);
  box-shadow: inset 0 0 0 1px var(--line);
}
.slot-winbar__label { color: var(--text-2); font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-winbar__amount { display: flex; align-items: baseline; gap: 10px; color: var(--text-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.slot-winbar__amount strong { font-family: var(--font-display); font-size: 22px; color: var(--text); letter-spacing: 0; transition: color 200ms; }
.slot-winbar.is-win .slot-winbar__amount strong { color: var(--win); }
.slot-winbar.is-win { box-shadow: inset 0 0 0 1px rgb(34 224 143 / 0.5), 0 0 24px rgb(34 224 143 / 0.12); }

/* ---------- Paytable ---------- */

.paytable { display: grid; gap: 14px; }
.paytable__table td:first-child { display: flex; align-items: center; gap: 10px; }
.paytable__symbol { display: grid; width: 30px; height: 30px; }
.paytable__symbol .symbol { width: 100%; height: 100%; }
.paytable__rules { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 13px; }

@media (max-width: 1000px) {
  .slots-board { min-height: 0; padding: 14px; }
  .slot-cabinet { --cell: min(15vw, 84px); padding: 10px; }
  .slot-cabinet--classic { --cell: min(24vw, 110px); }
  .slot-cabinet--tumble { --cell: min(13vw, 64px); }
}
@media (max-width: 480px) {
  .reels { gap: 4px; }
  .slot-cabinet { --cell: 15.5vw; padding: 8px; }
  .slot-cabinet--tumble { --cell: 13.6vw; }
  .slot-banner strong { font-size: 18px; }
}

/* /css/studio.css */
/* The Slots section: its covers (lobby and /slots) and its game screen (games/studio.mjs). */

/* ---------- Covers ---------- */

/* The same columns as the Originals' tiles above (lobby.css, .tiles), so both shelves line up. */
.covers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cover-min), 1fr));
  gap: 16px;
}
.cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg-2);
  box-shadow: var(--shadow-2);
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}
.cover__art { position: absolute; inset: 0; transition: transform 700ms var(--ease-out); }
.cover__art .art { width: 100%; height: 100%; }
.cover__shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgb(3 6 12 / 0.9)); }
.cover__meta {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  justify-items: start;
  gap: 3px;
}
.cover__name {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.05;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.6);
}
.cover__fact { color: rgb(255 255 255 / 0.72); font-size: 12px; font-weight: 650; }
.cover > .badge { position: absolute; top: 12px; left: 12px; background: rgb(8 12 22 / 0.72); }
.cover__jackpot { gap: 5px; color: #ffdf85; box-shadow: inset 0 0 0 1px rgb(255 197 61 / 0.45); }
.cover__jackpot > span { display: grid; }
.cover__jackpot > span:nth-child(2) { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.cover__jackpot strong { color: #fff4cf; font-family: var(--font-display); font-size: 12px; font-weight: 800; }
.cover__play {
  position: absolute;
  top: 44%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.45), 0 0 0 6px rgb(255 197 61 / 0.18);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
  transition: opacity 220ms var(--ease-out), transform 320ms var(--ease-spring);
}
.cover__play .icon { width: 26px; height: 26px; margin-left: 3px; }
.cover.is-soon .cover__art { filter: saturate(0.35) brightness(0.6); }

@media (hover: hover) {
  a.cover:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgb(0 0 0 / 0.45), 0 0 0 1px rgb(255 255 255 / 0.12); }
  a.cover:hover .cover__art { transform: scale(1.05); }
  a.cover:hover .cover__play, a.cover:focus-visible .cover__play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
a.cover:active { transform: translateY(-2px) scale(0.99); }

/* The artwork's own little motions (art/thumbs.mjs), only while a cover is hovered. */
.cover:hover .a-bob { animation: bob 2.4s var(--ease-in-out) infinite; }
.cover:hover .a-bob--late { animation-delay: -1.2s; }
.cover:hover .a-drift { animation: drift 4s var(--ease-in-out) infinite alternate; }
.cover:hover .a-pop { animation: gem-pop 1.4s var(--ease-spring) infinite; }
.cover:hover .a-glow, .cover:hover .a-line { animation: pulse 900ms ease-in-out infinite; }
.cover:hover .a-bulb { animation: pulse 500ms steps(2) infinite; }
.cover:hover .a-bulb--alt { animation-delay: -250ms; }

@media (max-width: 760px) {
  /* Two to a row, like the tiles; a finger has no hover, so no play button. */
  .covers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cover__play { display: none; }
}

/* ---------- The section's page ---------- */

.slots-page__head { display: grid; justify-items: start; margin-bottom: 24px; }
.slots-page__head h1 { margin: 6px 0 8px; font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 44px); font-weight: 900; }
.slots-page__head p { max-width: 56ch; color: var(--text-2); }
/* On its own page the shelf has no tiles to line up with: bigger covers, the whole row filled, each
   name on one line. Phones keep two to a row (above). */
@media (min-width: 761px) {
  .slots-page .covers { grid-template-columns: repeat(auto-fill, minmax(calc(var(--cover-min) + 32px), 1fr)); gap: 18px; }
}

/* ---------- Game screen ---------- */

.studio-page { padding-top: 20px; }
.studio {
  position: relative;
  display: grid;
  /* One column as wide as the page, never wider: without it the column takes the width the
     jackpot plaques would like, and on a phone the whole screen spills past the edge. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  border-radius: 20px;
  background: var(--bg-1);
  box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
}

.studio__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 8px 0 10px;
  border-radius: 20px 20px 0 0;
  background: var(--bg-1);
  box-shadow: 0 1px 0 var(--line);
}
.studio__back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 34px;
  padding: 0 10px 0 4px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
  transition: background-color 140ms, color 140ms;
}
.studio__back:hover { background: var(--bg-3); color: var(--text); }
.studio__back span { display: grid; }
.studio__title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.studio__title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 15px; font-weight: 800; }
.studio__title-icon { display: grid; color: var(--accent); }
.studio__rtp { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--bg-3); color: var(--text-3); font-size: 11.5px; font-weight: 700; }
.studio__tools { display: flex; gap: 2px; margin-left: auto; }
.studio__tool {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-2);
  transition: background-color 140ms, color 140ms;
}
.studio__tool:hover { background: var(--bg-3); color: var(--text); }
.studio__tool[hidden] { display: none; }

/* As wide as the cabinet: a stage with an aspect ratio would otherwise shrink to its height. */
.studio__stage { position: relative; width: 100%; min-width: 0; overflow: clip; background: #050a16; }

/* ---------- Control bar ---------- */

/* Three columns: what you have (left), what you bet (centred under the machine), what you do (right). */
.studio__controls {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  box-shadow: 0 -1px 0 var(--line);
}
.studio__readouts { display: flex; gap: 24px; justify-self: start; }
.studio__readout { display: grid; gap: 3px; min-width: 88px; }
.studio__readout span, .studio__amount span { color: var(--text-3); font-size: 10.5px; font-weight: 750; letter-spacing: 0.07em; line-height: 1; text-transform: uppercase; }
.studio__readout strong { font-family: var(--font-display); font-size: 17px; font-weight: 800; line-height: 1.15; transition: color 200ms; }
.studio__readout--win.is-win strong { color: var(--win); }

.studio__bet {
  display: flex;
  align-items: stretch;
  justify-self: center;
  height: 52px;
  padding: 4px;
  border-radius: var(--radius-m);
  background: var(--bg-0);
  box-shadow: inset 0 0 0 2px var(--line);
  transition: box-shadow 140ms;
}
.studio__bet:focus-within { box-shadow: inset 0 0 0 2px var(--info); }
.studio__bet.is-invalid { box-shadow: inset 0 0 0 2px var(--loss); }
.studio__step {
  display: grid;
  place-items: center;
  width: 38px;
  height: 100%;
  border: 0;
  border-radius: calc(var(--radius-m) - 3px);
  background: var(--bg-3);
  color: var(--text);
  transition: background-color 120ms, transform 120ms var(--ease-out);
}
.studio__step:hover:not(:disabled) { background: var(--bg-4); }
.studio__step:active:not(:disabled) { transform: scale(0.94); }
.studio__step:disabled { opacity: 0.4; cursor: not-allowed; }
.studio__amount { display: grid; align-content: center; justify-items: center; gap: 3px; padding: 0 6px; cursor: text; }
.studio__amount input {
  width: 9ch;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  outline: none;
}
.studio__amount input:disabled { color: var(--text-2); }

.studio__actions { display: flex; align-items: center; gap: 12px; justify-self: end; }
.studio__side {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 54px;
  padding: 6px 0;
  border: 0;
  border-radius: 12px;
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background-color 140ms, color 140ms, box-shadow 140ms;
}
.studio__side span { display: grid; }
.studio__side:hover { background: var(--bg-4); color: var(--text); }
.studio__side[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-3));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
}

.studio__play {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a6, var(--accent) 55%, #d98a00);
  color: var(--accent-ink);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.5) inset, 0 -3px 0 rgb(0 0 0 / 0.18) inset,
    0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
  transition: transform 160ms var(--ease-out), box-shadow 200ms, filter 200ms;
}
@media (hover: hover) {
  .studio__play:hover { transform: scale(1.04); }
}
.studio__play:active { transform: scale(0.95); }
.studio__play-icon { display: grid; }
.studio__play-icon .icon { width: 30px; height: 30px; margin-left: 3px; }
.studio__play.is-stop .studio__play-icon .icon { width: 22px; height: 22px; margin-left: 0; }
/* While a round plays: a ring turns round the button (a transform, so it costs nothing). */
.studio__play::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #fff4cf;
  opacity: 0;
  transition: opacity 200ms;
}
/* Busy, it keeps its colour: a tap still works (it stops the reels). */
.studio__play.is-busy::after, .studio__play.is-stop::after { opacity: 1; animation: art-spin 900ms linear infinite; }
.studio__play.is-stop { background: radial-gradient(circle at 35% 30%, #ffb0bb, var(--loss) 60%, #b3122c); color: #fff; }
.studio__play.is-stopping { opacity: 0.7; }
.studio__play-count {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-0);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 22px;
}

/* ---------- Autoplay ---------- */

.studio-auto {
  position: absolute;
  right: 18px;
  bottom: calc(100% + 10px);
  z-index: 20;
  display: grid;
  gap: 12px;
  width: min(340px, calc(100% - 24px));
  padding: 16px;
  border-radius: var(--radius-l);
  background: var(--bg-2);
  box-shadow: var(--shadow-3), inset 0 0 0 1px var(--line);
  transform-origin: 90% 100%;
  animation: studio-pop 200ms var(--ease-out);
}
.studio-auto[hidden] { display: none; }
@keyframes studio-pop { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
.studio-auto__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.studio-auto__head strong { font-family: var(--font-display); font-size: 15px; }
.studio-auto__head span { color: var(--text-3); font-size: 12px; }
.studio-auto__rounds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.studio-auto__rounds .chip-filter { justify-content: center; height: 36px; padding: 0; }
.studio-auto__field { display: grid; gap: 5px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.studio-auto__field .input { height: 40px; }
.studio-auto__field .input > span { display: grid; color: var(--text-3); margin-right: 6px; }

/* ---------- Full screen ---------- */

.studio:fullscreen {
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: var(--bg-0);
}
.studio:fullscreen .studio__bar, .studio:fullscreen .studio__controls { border-radius: 0; }
.studio:fullscreen .studio__stage { height: 100%; max-height: none; aspect-ratio: auto; }
.studio:fullscreen .slots-board { height: 100%; }
.studio:fullscreen .slot-cabinet { --cell: min(11vw, 15vh); }
.studio:fullscreen .slot-cabinet--classic { --cell: min(15vw, 20vh); }
.studio:fullscreen .slot-cabinet--tumble { --cell: min(8vw, 11vh); }

/* ---------- The slot machines on this screen ---------- */

.studio .slots-board { grid-template-rows: auto minmax(0, 1fr); min-height: 0; border-radius: 0; }
/* The machine's jackpot pools, and under them the meter its coins fill. */
.slots-board__jackpot { display: grid; gap: 10px; justify-items: center; }
.slots-board__jackpot .jp-bar { margin-bottom: 0; }
/* The machine and the strip under it share one column, as wide as the machine. */
.slot-column { display: grid; gap: 12px; width: max-content; max-width: 100%; }
/* The win itself is in the control bar: the strip under the reels keeps only what paid. */
.studio .slot-winbar { justify-content: center; padding: 10px 16px; }
.studio .slot-winbar__amount { display: none; }
/* On a computer the reels grow with the screen's height too, so the machine fills the stage
   without the page having to scroll (what is left: the bars, the jackpot and the win strip). */
@media (min-width: 1001px) {
  .studio .slot-cabinet { --cell: clamp(64px, min(9vw, (100dvh - 480px) / 3), 116px); }
  .studio .slot-cabinet--classic { --cell: clamp(80px, min(11vw, (100dvh - 480px) / 3), 132px); }
  .studio .slot-cabinet--tumble { --cell: clamp(48px, min(6.4vw, (100dvh - 470px) / 5), 88px); }
}
/* Big screens: the machine may grow further, still within the screen's height. */
@media (min-width: 1800px) {
  .studio .slot-cabinet { --cell: clamp(64px, min(7vw, (100dvh - 480px) / 3), 150px); }
  .studio .slot-cabinet--classic { --cell: clamp(80px, min(9vw, (100dvh - 480px) / 3), 172px); }
  .studio .slot-cabinet--tumble { --cell: clamp(48px, min(5vw, (100dvh - 470px) / 5), 112px); }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 760px) {
  .studio-page { padding: 10px 0 48px; }
  .studio-page > .section { padding: 0 var(--gutter); }
  .studio { border-radius: 0; }
  .studio__bar { gap: 6px; padding: 0 4px 0 2px; border-radius: 0; height: 48px; }
  .studio__rtp, .studio__back .studio__back-text { display: none; }
  .studio__tool { width: 36px; height: 36px; }
  /* The readouts on a line of their own; the bet and the buttons share the next one. */
  .studio__controls {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "readouts readouts" "bet actions";
    gap: 10px 12px;
    padding: 10px 12px 14px;
    border-radius: 0;
  }
  .studio__readouts { grid-area: readouts; justify-self: stretch; }
  .studio__readout { min-width: 0; }
  .studio__readout--win { margin-left: auto; text-align: right; }
  .studio__bet { grid-area: bet; justify-self: stretch; min-width: 0; }
  .studio__amount { flex: 1 1 auto; min-width: 0; }
  .studio__amount input { width: 100%; }
  .studio__actions { grid-area: actions; gap: 8px; }
  .studio__side { width: 46px; }
  .studio__play { width: 60px; height: 60px; }
  .studio-auto { right: 12px; left: 12px; width: auto; }
}
/* The smallest phones: the machine's name keeps its room (the icon beside it goes, the tools
   tighten), and the control bar's side buttons narrow so the bet keeps a readable width. */
@media (max-width: 360px) {
  .studio__title-icon { display: none; }
  .studio__title strong { font-size: 14px; }
  .studio__tool { width: 32px; }
  .studio__controls { padding-inline: 8px; gap: 10px 8px; }
  .studio__actions { gap: 6px; }
  .studio__side { width: 42px; }
  .studio__play { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .studio__play.is-busy::after, .studio__play.is-stop::after { animation: none; }
  .studio-auto { animation: none; }
}

/* /css/vault.css */
/* Crown Vault (games/vault.mjs): the cabinet, the gold coins, the vault's lock-and-win grid, the
   respin counter, the Bonus Buy. Every motion is a transform or an opacity, and none loops forever. */

.slots-board[data-machine="vault"] {
  background:
    radial-gradient(700px 420px at 50% 42%, rgb(255 197 61 / 0.12), transparent 70%),
    linear-gradient(180deg, #0c241b, var(--bg-0) 78%);
}
.slot-cabinet--vault {
  background: linear-gradient(180deg, #123528, #071a12);
  box-shadow: inset 0 0 0 3px #ffc53d, inset 0 0 0 6px #6b4a00, 0 24px 60px rgb(0 0 0 / 0.5), 0 0 60px rgb(255 197 61 / 0.16);
}
.slot-cabinet--vault .reel { background: linear-gradient(180deg, #0f1f19, #18302a 18%, #18302a 82%, #0f1f19); }

/* A coin on the reels: its value on a ribbon across it. */
.vault-cell__value {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  min-width: 58%;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgb(42 26 0 / 0.82);
  box-shadow: inset 0 0 0 1px rgb(255 223 133 / 0.6);
  color: #fff4cf;
  font-family: var(--font-display);
  font-size: calc(var(--cell) * 0.17);
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  translate: -50% -50%;
  pointer-events: none;
}
[data-value="mini"] > .vault-cell__value { background: rgb(4 60 40 / 0.9); color: #9ff5c8; box-shadow: inset 0 0 0 1px #22e08f; }
[data-value="major"] > .vault-cell__value { background: rgb(50 16 100 / 0.9); color: #e0c8ff; box-shadow: inset 0 0 0 1px #b77dff; }
.slot-cell.is-vault-coin .vault-cell__value { animation: vault-label 340ms var(--ease-spring); }
@keyframes vault-label { from { opacity: 0; transform: scale(0.6); } }

/* ---------- The vault ---------- */

/* Over the reels, cell for cell: the reels stay below, dimmed. */
.vault-hold {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(var(--reels), var(--cell));
  grid-template-rows: repeat(var(--rows), var(--cell));
  column-gap: inherit; /* the reels' own gap, narrower on a phone */
}
.slot-cabinet.is-vault .reel { opacity: 0.18; transition: opacity 300ms; }
.slot-cabinet.is-vault .paylines { display: none; }
.vault-cell {
  position: relative;
  grid-column: calc(var(--c) + 1);
  grid-row: calc(var(--r) + 1);
  display: grid;
  place-items: center;
  margin: 4px;
  border-radius: 12px;
  background: rgb(4 14 10 / 0.75);
  box-shadow: inset 0 0 0 1px rgb(255 197 61 / 0.18), inset 0 6px 16px rgb(0 0 0 / 0.5);
}
.vault-cell.is-spinning::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent, rgb(255 223 133 / 0.22), transparent);
  animation: vault-shimmer 560ms linear;
}
@keyframes vault-shimmer { from { transform: translateY(-60%); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(60%); opacity: 0; } }
.vault-cell.is-coin { background: radial-gradient(circle at 50% 45%, rgb(255 197 61 / 0.22), rgb(20 14 2 / 0.85) 70%); box-shadow: inset 0 0 0 2px rgb(255 197 61 / 0.55); }
.vault-cell__coin { display: grid; width: 76%; height: 76%; }
.vault-cell__coin .symbol { width: 100%; height: 100%; filter: drop-shadow(0 3px 5px rgb(0 0 0 / 0.5)); }
.vault-cell.is-new .vault-cell__coin { animation: vault-drop 420ms var(--ease-spring); }
.vault-cell.is-new { animation: vault-lock 520ms var(--ease-out); }
@keyframes vault-drop { from { transform: translateY(-70%) scale(1.3); opacity: 0; } }
@keyframes vault-lock { 40% { box-shadow: inset 0 0 0 3px #fff4cf, 0 0 24px rgb(255 197 61 / 0.7); } }
.vault-cell.is-counted { box-shadow: inset 0 0 0 2px #fff4cf, 0 0 18px rgb(255 197 61 / 0.45); }
.vault-cell.is-counted .vault-cell__coin { animation: vault-count 300ms var(--ease-out); }
@keyframes vault-count { 50% { transform: scale(1.14); } }
.vault-hold.is-near .vault-cell:not(.is-coin) { animation: vault-near 520ms ease-in-out 3 alternate; }
@keyframes vault-near { to { box-shadow: inset 0 0 0 2px rgb(255 197 61 / 0.75), inset 0 6px 16px rgb(0 0 0 / 0.5); } }
.slot-cabinet--vault.is-full { animation: vault-full 600ms ease-in-out 4 alternate; }
@keyframes vault-full { to { box-shadow: inset 0 0 0 3px #fff4cf, inset 0 0 0 6px #ffc53d, 0 0 70px rgb(255 197 61 / 0.6); } }

/* ---------- Above the cabinet: Bonus Buy, respins, the vault's running total ---------- */

.vault-strip { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 40px; }
.vault-buy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 16px 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffdf85, #e0a100);
  color: #3a2200;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.5) inset, 0 -2px 0 rgb(0 0 0 / 0.18) inset, 0 6px 18px rgb(255 197 61 / 0.25);
  transition: transform 160ms var(--ease-out), box-shadow 200ms;
}
@media (hover: hover) {
  .vault-buy:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgb(255 255 255 / 0.5) inset, 0 -2px 0 rgb(0 0 0 / 0.18) inset, 0 10px 24px rgb(255 197 61 / 0.35); }
}
.vault-buy:active { transform: translateY(1px); }
.vault-buy[hidden] { display: none; }
.vault-buy__label { font: 900 11px / 1 var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; }
.vault-buy strong { font-family: var(--font-display); font-size: 14px; font-weight: 900; }

.vault-respins, .vault-total {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgb(8 12 22 / 0.65);
  box-shadow: inset 0 0 0 1px rgb(255 197 61 / 0.3);
}
.vault-respins[hidden], .vault-total[hidden] { display: none; }
.vault-respins__label, .vault-total > span { color: #ffdf85; font: 800 10.5px / 1 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; }
.vault-respins__pips { display: inline-flex; gap: 6px; }
.vault-respins__pip { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgb(255 197 61 / 0.45); transition: background-color 160ms; }
.vault-respins__pip.is-on { background: #ffc53d; box-shadow: 0 0 10px rgb(255 197 61 / 0.6); }
.vault-respins.is-reset { animation: vault-reset 480ms var(--ease-spring); }
@keyframes vault-reset { 35% { transform: scale(1.12); } }
.vault-total strong { color: #fff4cf; font-family: var(--font-display); font-size: 16px; font-weight: 900; }

.slot-banner--vault { box-shadow: 0 0 0 2px #ffc53d, 0 20px 40px rgb(0 0 0 / 0.5), 0 0 50px rgb(255 197 61 / 0.35); }
.slot-banner--grand { box-shadow: 0 0 0 3px #fff4cf, 0 20px 40px rgb(0 0 0 / 0.5), 0 0 70px rgb(255 197 61 / 0.6); }
.slot-banner--grand strong { font-size: 28px; }

/* ---------- Bonus Buy confirmation and the rules ---------- */

.vault-buyconfirm { display: grid; justify-items: center; gap: 14px; text-align: center; }
.vault-buyconfirm__art { width: 84px; height: 84px; }
.vault-buyconfirm__art .symbol { width: 100%; height: 100%; }
.vault-buyconfirm .kv { width: 100%; text-align: left; }
.vault-rules__title { margin-top: 6px; font-size: 14px; }
.vault-rules__coins { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.vault-rules__coin { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--bg-2); }
.vault-rules__coin small { color: var(--text-3); }

@media (max-width: 760px) {
  .vault-strip { gap: 8px; }
  .vault-respins, .vault-total, .vault-buy { height: 34px; padding: 0 12px; }
  .vault-respins__label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .vault-cell.is-new, .vault-cell.is-new .vault-cell__coin, .vault-cell.is-spinning::after, .vault-hold.is-near .vault-cell,
  .slot-cabinet--vault.is-full, .vault-respins.is-reset, .slot-cell.is-vault-coin .vault-cell__value, .vault-cell.is-counted .vault-cell__coin { animation: none; }
}

/* /css/tide.css */
/* Golden Tide (games/tide.mjs): the lake cabinet, the fish's value tags, the bobbers, the angler's
   cast and catch, and the free spins' counters. Transforms and opacity only; nothing loops forever. */

.slots-board[data-machine="tide"] {
  background:
    radial-gradient(700px 420px at 50% 42%, rgb(51 214 255 / 0.12), transparent 70%),
    linear-gradient(180deg, #0a2433, var(--bg-0) 78%);
  transition: background 600ms;
}
.slots-board[data-machine="tide"].is-free {
  background:
    radial-gradient(760px 460px at 50% 42%, rgb(255 197 61 / 0.16), transparent 70%),
    linear-gradient(180deg, #082a3a, #04121a 80%);
}
.slot-cabinet--tide {
  background: linear-gradient(180deg, #0f3a4a, #06202b);
  box-shadow: inset 0 0 0 3px #33d6ff, inset 0 0 0 6px #0b4f5c, 0 24px 60px rgb(0 0 0 / 0.5), 0 0 60px rgb(51 214 255 / 0.16);
  transition: box-shadow 500ms;
}
.is-free .slot-cabinet--tide { box-shadow: inset 0 0 0 3px #ffc53d, inset 0 0 0 6px #0b4f5c, 0 24px 60px rgb(0 0 0 / 0.5), 0 0 70px rgb(255 197 61 / 0.22); }
.slot-cabinet--tide .reel { background: linear-gradient(180deg, #0a2a36, #12404f 18%, #12404f 82%, #0a2a36); }

/* A fish's value: a tag across its belly. */
.tide-tag {
  position: absolute;
  left: 50%;
  bottom: 12%;
  z-index: 2;
  min-width: 52%;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgb(10 30 40 / 0.86);
  box-shadow: inset 0 0 0 1px rgb(255 223 133 / 0.6);
  color: #fff4cf;
  font-family: var(--font-display);
  font-size: calc(var(--cell) * 0.15);
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  translate: -50% 0;
  pointer-events: none;
  animation: vault-label 320ms var(--ease-spring);
}
.tide-tag.is-mini { background: rgb(4 60 40 / 0.92); color: #9ff5c8; box-shadow: inset 0 0 0 1px #22e08f; }
.tide-tag.is-major { background: rgb(50 16 100 / 0.92); color: #e0c8ff; box-shadow: inset 0 0 0 1px #b77dff; }
.tide-tag.is-grand { background: rgb(80 50 0 / 0.95); color: #fff4cf; box-shadow: inset 0 0 0 2px #ffc53d, 0 0 12px rgb(255 197 61 / 0.6); }

.slot-cell.is-bobber .slot-cell__art { animation: tide-bob 700ms var(--ease-in-out) 2; }
@keyframes tide-bob { 50% { transform: translateY(-8%) scale(1.08); } }

/* The angler's cast: lines that draw out to every fish, then the catch. */
.tide-casts { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tide-cast {
  fill: none;
  stroke: #e8f7ff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  opacity: 0.85;
  filter: drop-shadow(0 0 3px rgb(158 231 255 / 0.8));
  animation: draw-line 420ms var(--ease-out) forwards;
}
.slot-cell.is-reeled .slot-cell__art { animation: tide-reel 360ms var(--ease-out); }
@keyframes tide-reel { 40% { transform: scale(1.18) rotate(-6deg); } }
.slot-cell.is-catch .slot-cell__art { animation: tide-catch 520ms var(--ease-spring); }
@keyframes tide-catch { 35% { transform: scale(1.22); } }

/* The free spins' counters. */
.tide-free strong { color: #fff4cf; font-family: var(--font-display); font-size: 16px; font-weight: 900; }
.tide-anglers__icon { display: grid; width: 24px; height: 24px; }
.tide-anglers__icon .symbol { width: 100%; height: 100%; }
.tide-level { min-width: 34px; padding: 2px 8px; border-radius: 999px; background: rgb(255 197 61 / 0.16); color: #ffdf85; font-family: var(--font-display); font-size: 13px; font-weight: 900; text-align: center; }

@media (max-width: 760px) {
  /* Three counters on one line: the spins keep their name, the anglers' counter loses its picture. */
  .tide-free .vault-respins__label { display: inline; font-size: 9.5px; }
  .tide-anglers__icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tide-tag, .slot-cell.is-bobber .slot-cell__art, .tide-cast, .slot-cell.is-reeled .slot-cell__art, .slot-cell.is-catch .slot-cell__art { animation: none; }
  .tide-cast { stroke-dashoffset: 0; }
}

/* /css/crash.css */
.crash-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  min-height: 540px;
  background: var(--bg-0);
}
.crash-main {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-width: 0;
  padding: 16px;
}

.crash-history {
  display: flex;
  gap: 6px;
  height: 30px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, black 75%, transparent);
}
.crash-pill {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-2);
  font-weight: 750;
  font-size: 12.5px;
}
.crash-pill.is-low { color: #ff8a99; }
.crash-pill.is-mid { color: #9ec5ff; }
.crash-pill.is-high { color: var(--win); }
.crash-pill.is-gold { color: var(--accent-ink); background: var(--accent); }
.crash-pill.is-new { animation: pill-in 380ms var(--ease-spring); }

.crash-stage {
  position: relative;
  min-height: 420px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}
.crash-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash-hud {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  pointer-events: none;
}
.crash-multiplier {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 6px 30px rgb(0 0 0 / 0.5);
  transition: color 250ms, text-shadow 250ms;
}
/* The number warms up as it climbs. */
.crash-multiplier[data-level="1"] { color: #ffe7a3; }
.crash-multiplier[data-level="2"] { color: #ffd36b; text-shadow: 0 6px 30px rgb(0 0 0 / 0.5), 0 0 26px rgb(255 179 0 / 0.35); }
.crash-multiplier[data-level="3"] { color: var(--accent); text-shadow: 0 6px 30px rgb(0 0 0 / 0.5), 0 0 40px rgb(255 179 0 / 0.55); }
.crash-multiplier.is-cashed { color: var(--win); text-shadow: 0 6px 30px rgb(0 0 0 / 0.5), 0 0 30px rgb(34 224 143 / 0.4); }
.crash-multiplier.is-crashed { color: var(--loss); text-shadow: 0 6px 30px rgb(0 0 0 / 0.5), 0 0 30px rgb(255 77 99 / 0.4); animation: fx-shake 420ms; --shake: 5px; }
.crash-status {
  min-height: 1.4em;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgb(11 17 29 / 0.6);
  color: var(--text-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.crash-status:empty { visibility: hidden; }
.crash-board.is-crashed .crash-status { color: #ffc2cb; background: rgb(60 10 20 / 0.7); }

/* ---------- Players ---------- */

/* In the bet panel, under "Space to bet". */
.crash-players {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  margin: 2px -16px -16px;
  padding-top: 4px;
  box-shadow: 0 -1px 0 var(--line);
}
.crash-players__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 16px 10px;
  color: var(--text-3);
  font-weight: 650;
  font-size: 12.5px;
}
.crash-players__head strong { color: var(--text); font-size: 14px; }
.crash-players__list {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 0 8px 12px;
  overflow-y: auto;
  max-height: 420px;
}
.crash-players__empty { padding: 12px 8px; color: var(--text-3); font-size: 12.5px; }
.crash-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 650;
  animation: rise-in 240ms var(--ease-out);
  transition: background-color 200ms;
}
.crash-player__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crash-player__mult { color: var(--text-3); min-width: 44px; text-align: right; }
.crash-player__amount { min-width: 64px; text-align: right; }
.crash-player.is-cashed { background: rgb(34 224 143 / 0.08); }
.crash-player.is-cashed .crash-player__mult, .crash-player.is-cashed .crash-player__amount { color: var(--win); }
.crash-player.is-me { box-shadow: inset 2px 0 0 var(--accent); }
.crash-player.is-lost { opacity: 0.5; }
.crash-player.is-lost .crash-player__amount { color: var(--loss); text-decoration: line-through; }

.crash-mine strong.is-win { color: var(--win); }

@media (max-width: 1000px) {
  /* Only as tall as the flight needs, so the bet button sits right under it. */
  .crash-board { min-height: 0; }
  .crash-players__list { max-height: 280px; }
}
@media (max-width: 600px) {
  .crash-stage { min-height: 300px; }
  .crash-main { padding: 10px; }
}

/* /css/blackjack.css */
.bj-board {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  min-height: 560px;
  background: #06251a;
}

.bj-felt {
  --card-w: clamp(64px, 6.4vw, 88px);
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 18px;
  padding: 26px 24px 20px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, #178353 0%, #0f5a38 45%, #073521 100%);
  box-shadow: inset 0 0 90px rgb(0 0 0 / 0.45);
}
.bj-felt::before {
  /* Faint cloth texture. */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgb(255 255 255 / 0.018) 0 2px, transparent 2px 6px);
  pointer-events: none;
}
.bj-arc {
  position: absolute;
  left: 50%;
  top: 56%;
  width: min(620px, 92%);
  translate: -50% -50%;
  pointer-events: none;
}
.bj-arc svg { width: 100%; height: auto; }

.bj-shoe {
  position: absolute;
  top: 18px;
  right: 22px;
  width: calc(var(--card-w) * 0.8);
  aspect-ratio: 60 / 84;
  transform: rotate(8deg);
  filter: drop-shadow(-4px 6px 0 #0b1b3d) drop-shadow(-8px 12px 0 #0b1b3d);
}
.bj-shoe .card-svg { width: 100%; height: 100%; }

.bj-zone { position: relative; display: grid; justify-items: center; gap: 10px; z-index: 1; }
.bj-zone__label {
  color: #e8d9a6;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
}

.bj-hands {
  position: relative;
  z-index: 1;
  align-self: end;
  display: flex;
  justify-content: center;
  gap: clamp(20px, 5vw, 64px);
}
.bj-hand {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  transition: box-shadow 200ms, background-color 200ms;
}
.bj-hand.is-active { background: rgb(255 255 255 / 0.06); box-shadow: inset 0 0 0 2px rgb(255 197 61 / 0.7); }
.bj-hand__meta { display: flex; align-items: center; gap: 8px; }
.bj-bet {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.35);
  color: #fff4cf;
  font-size: 12px;
  font-weight: 700;
}

.bj-cards {
  display: flex;
  min-height: calc(var(--card-w) * 1.4);
  padding-right: calc(var(--card-w) * 0.62);
}
.bj-card {
  width: var(--card-w);
  aspect-ratio: 60 / 84;
  margin-right: calc(var(--card-w) * -0.62);
  perspective: 800px;
  filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.35));
}
.bj-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 420ms var(--ease-out);
}
.bj-card.is-down .bj-card__inner { transform: rotateY(180deg); }
.bj-card__face { position: absolute; inset: 0; backface-visibility: hidden; }
.bj-card__back { transform: rotateY(180deg); }
.bj-card__face .card-svg { width: 100%; height: 100%; }

.bj-total {
  min-width: 42px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(11 17 29 / 0.8);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  animation: fade-in 200ms;
}
.bj-total.is-bust { background: var(--loss); }
.bj-total.is-21 { background: var(--accent); color: var(--accent-ink); }

.bj-outcome {
  position: absolute;
  top: 34%;
  left: 50%;
  translate: -50% -50%;
  padding: 7px 14px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.4);
  animation: result-in 460ms var(--ease-spring);
  z-index: 3;
}
.bj-outcome.is-gold { background: var(--accent); color: var(--accent-ink); }
.bj-outcome.is-win { background: var(--win); color: var(--win-ink); }
.bj-outcome.is-push { background: var(--bg-3); color: var(--text); }
.bj-outcome.is-loss { background: var(--loss); color: #fff; }

.bj-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  background: var(--bg-1);
  box-shadow: 0 -1px 0 var(--line);
}
.bj-action { min-width: 120px; height: 46px; gap: 10px; }
.bj-action kbd { background: var(--bg-4); }
.bj-action[data-action="double"]:not(:disabled) { box-shadow: inset 0 0 0 2px rgb(255 197 61 / 0.35); }
.bj-insurance { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 650; }
.bj-insurance .btn--s { min-width: 64px; }

@media (max-width: 700px) {
  .bj-arc { display: none; }
}
@media (max-width: 600px) {
  .bj-board { min-height: 0; }
  .bj-felt { --card-w: 54px; padding: 16px 10px 14px; }
  .bj-action { min-width: 0; flex: 1 1 40%; }
  .bj-action kbd { display: none; }
}

/* /css/keno.css */
.keno-board {
  --pick: #8f6bff;
  --pick-deep: #6a45e0;
  --pick-edge: #36217f;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  height: 100%;
  min-height: 560px;
  padding: 22px clamp(14px, 3vw, 32px) 24px;
  background:
    radial-gradient(640px 380px at 50% 46%, rgb(143 107 255 / 0.09), transparent 70%),
    var(--bg-0);
}

/* ---------- Drawn balls tray ---------- */

.keno-tray {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(4px, 0.8vw, 8px);
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 7px;
  border-radius: 999px;
  background: var(--bg-2);
  box-shadow: inset 0 2px 0 rgb(0 0 0 / 0.28), 0 0 0 1px var(--line);
}
.keno-slot {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-height: 44px;
  justify-self: center;
  width: 100%;
  max-width: 44px;
  border-radius: 50%;
  background: var(--bg-0);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.45);
  font-family: var(--font-display);
  font-size: clamp(10px, 1.3vw, 14px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.keno-slot.is-filled {
  color: #1a1f2b;
  background: radial-gradient(circle at 34% 30%, #ffffff, #d9deea 48%, #9aa3b8);
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.4), inset 0 -3px 5px rgb(0 0 0 / 0.18);
  animation: ball-drop 420ms var(--ease-spring);
}
.keno-slot.is-hit {
  color: var(--win-ink);
  background: radial-gradient(circle at 34% 30%, #d9ffee, #45eea4 45%, #0f9b5f);
  box-shadow: 0 3px 10px rgb(34 224 143 / 0.45), inset 0 -3px 5px rgb(0 0 0 / 0.2);
}
@keyframes ball-drop {
  0% { transform: translateY(-26px) scale(0.6); opacity: 0; }
  60% { transform: translateY(3px) scale(1.06); opacity: 1; }
}

/* ---------- Number grid ---------- */

.keno-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: clamp(5px, 1vw, 10px);
  width: min(100%, 640px);
  margin: 0 auto;
  align-self: center;
  user-select: none;
  -webkit-user-select: none;
}

.keno-tile {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.keno-tile:disabled { cursor: default; }
.keno-tile__face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #2c3d63, #253554);
  box-shadow: 0 4px 0 #131d33, inset 0 1px 0 rgb(255 255 255 / 0.09);
  transition: transform 140ms var(--ease-out), background 140ms, box-shadow 140ms, opacity 200ms;
}
.keno-tile__num {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  font-family: var(--font-display);
  font-size: clamp(11px, 1.55vw, 17px);
  font-weight: 800;
  transition: transform 140ms var(--ease-out), color 140ms;
  pointer-events: none;
}
@media (hover: hover) {
  .keno-tile:not(:disabled):hover .keno-tile__face {
    transform: translateY(-3px);
    background: linear-gradient(180deg, #37507f, #2f446d);
    box-shadow: 0 7px 0 #131d33, 0 10px 20px rgb(0 0 0 / 0.3), inset 0 1px 0 rgb(255 255 255 / 0.13);
  }
  .keno-tile:not(:disabled):hover .keno-tile__num { transform: translateY(-3px); }
}
.keno-tile:not(:disabled):active .keno-tile__face { transform: translateY(2px); box-shadow: 0 2px 0 #131d33; }
.keno-tile:not(:disabled):active .keno-tile__num { transform: translateY(2px); }

/* Picked */
.keno-tile.is-picked .keno-tile__face,
.keno-tile.is-picked:not(:disabled):hover .keno-tile__face {
  background: linear-gradient(180deg, var(--pick), var(--pick-deep));
  box-shadow: 0 4px 0 var(--pick-edge), 0 0 18px rgb(143 107 255 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.28);
}
.keno-tile.is-picked .keno-tile__num { color: #fff; }
.keno-tile.is-popping .keno-tile__face { animation: keno-pop 380ms var(--ease-spring) var(--pop-delay, 0ms) backwards; }
.keno-tile.is-popping .keno-tile__num { animation: keno-pop 380ms var(--ease-spring) var(--pop-delay, 0ms) backwards; }
@keyframes keno-pop { 0% { transform: scale(0.72); } }
.keno-tile.is-refused { animation: fx-shake 320ms; --shake: 3px; }

/* After the draw: tiles that were neither picked nor drawn step back. */
.keno-grid.is-drawn .keno-tile:not(.is-picked):not(.is-miss) .keno-tile__face { opacity: 0.55; }
.keno-grid.is-drawn .keno-tile:not(.is-picked):not(.is-miss) .keno-tile__num { color: var(--text-3); }
.keno-grid.is-drawn .keno-tile.is-picked:not(.is-hit) .keno-tile__face { opacity: 0.7; }

/* Drawn but not picked */
.keno-tile.is-miss .keno-tile__face {
  background: #0d1424;
  box-shadow: inset 0 0 0 2px #2a1a2a;
  transform: none;
}
.keno-tile.is-miss .keno-tile__num { color: var(--loss); transform: none; }

/* Drawn and picked: a hit */
.keno-tile.is-hit .keno-tile__face {
  background: radial-gradient(circle at 50% 40%, rgb(34 224 143 / 0.5), #0c3a29 78%);
  box-shadow: inset 0 0 0 2px var(--win), 0 0 24px rgb(34 224 143 / 0.45);
  transform: none;
}
.keno-tile.is-hit .keno-tile__num { color: #eafff5; transform: none; text-shadow: 0 0 12px rgb(34 224 143 / 0.8); }
.keno-tile.is-hit::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 13px;
  border: 2px solid var(--win);
  opacity: 0;
  pointer-events: none;
}
.keno-tile.is-hit.is-landed::after { animation: keno-ring 520ms var(--ease-out); }
.keno-tile.is-landed .keno-tile__face { animation: keno-land 300ms var(--ease-spring); }
.keno-tile.is-landed .keno-tile__num { animation: keno-land 300ms var(--ease-spring); }
@keyframes keno-land { 0% { transform: scale(0.8); } }
@keyframes keno-ring { 0% { opacity: 1; transform: scale(0.9); } 100% { opacity: 0; transform: scale(1.35); } }

/* ---------- Paytable ---------- */

.keno-pays-wrap { width: min(100%, 640px); margin: 0 auto; }
.keno-pays {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line);
}
.keno-pay {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 2px 7px;
  border-radius: 8px;
  background: var(--bg-1);
  transition: background 160ms, box-shadow 160ms, transform 200ms var(--ease-spring);
}
.keno-pay strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-3);
  font-size: clamp(10px, 1.2vw, 13px);
  font-weight: 800;
  white-space: nowrap;
}
.keno-pay.is-paying strong { color: var(--text); }
.keno-pay > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.keno-pay__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--win);
  box-shadow: 0 0 6px rgb(34 224 143 / 0.6);
}
.keno-pay.is-current {
  background: var(--bg-4);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transform: translateY(-2px);
}
.keno-pay.is-current strong { color: var(--text); }
.keno-pay.is-final.is-paid {
  background: var(--win);
  box-shadow: 0 0 18px rgb(34 224 143 / 0.45);
  animation: keno-paid 480ms var(--ease-spring);
}
.keno-pay.is-final.is-paid strong,
.keno-pay.is-final.is-paid > span { color: var(--win-ink); }
.keno-pay.is-final.is-paid .keno-pay__dot { background: var(--win-ink); box-shadow: none; }
.keno-pay.is-final.is-unpaid { background: color-mix(in srgb, var(--loss) 16%, var(--bg-1)); }
@keyframes keno-paid { 0% { transform: scale(0.9); } }

.keno-hint {
  display: grid;
  place-items: center;
  height: 52px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 600;
}

@media (max-width: 600px) {
  .keno-board { min-height: 0; gap: 12px; padding: 14px 10px 16px; }
  .keno-tray { padding: 5px; }
  .keno-tile { border-radius: 8px; }
  .keno-pay { padding: 6px 1px 5px; }
  .keno-pay > span { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .keno-slot.is-filled, .keno-tile.is-landed .keno-tile__face, .keno-tile.is-landed .keno-tile__num,
  .keno-tile.is-popping .keno-tile__face, .keno-tile.is-popping .keno-tile__num,
  .keno-tile.is-hit.is-landed::after, .keno-pay.is-final.is-paid { animation: none; }
}

/* Big screens: the numbers and the tray grow with the board. */
@media (min-width: 1800px) {
  .keno-tray, .keno-grid, .keno-pays-wrap { width: min(100%, 800px); }
}

/* /css/plinko.css */
/* Plinko: a night-blue board, pegs in white, the ball in gold, slots coloured by what they pay.
   The canvas draws pegs and balls; the slots are elements so their numbers stay crisp. */

.plinko-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  height: 100%;
  min-height: 560px;
  padding: 18px clamp(12px, 2.5vw, 28px) 20px;
  background:
    radial-gradient(560px 420px at 50% 30%, rgb(90 169 255 / 0.1), transparent 70%),
    radial-gradient(420px 220px at 50% 100%, rgb(255 197 61 / 0.07), transparent 70%),
    var(--bg-0);
}

.plinko-stage { position: relative; min-width: 0; min-height: 0; }
.plinko-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Slots ---------- */

.plinko-slots { position: absolute; inset: 0; pointer-events: none; }
.plinko-slot {
  position: absolute;
  top: var(--slot-y);
  left: var(--x);
  display: grid;
  place-items: center;
  width: var(--slot-w);
  height: var(--slot-h);
  border-radius: 7px;
  background: var(--tone);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.28), 0 4px 10px rgb(0 0 0 / 0.35);
  color: var(--ink);
  font: 800 clamp(8px, calc(var(--slot-w) * 0.3), 13px) / 1 var(--font-ui);
  letter-spacing: -0.02em;
}
.plinko-slot span::after { content: "×"; margin-left: 1px; opacity: 0.7; }
.plinko-slots.is-narrow .plinko-slot { border-radius: 5px; letter-spacing: -0.04em; }
.plinko-slots.is-narrow .plinko-slot span::after { content: none; }
/* A ball landed: the slot dips and flashes. Transform and filter on one small element only. */
.plinko-slot.is-hit { animation: plinko-hit 420ms var(--ease-spring); }
@keyframes plinko-hit {
  0% { transform: translateY(0); }
  30% { transform: translateY(5px); filter: brightness(1.45); }
  100% { transform: translateY(0); }
}

/* ---------- Last results ---------- */

.plinko-history {
  display: grid;
  align-content: center;
  gap: 6px;
  width: 64px;
}
.plinko-pill {
  display: grid;
  place-items: center;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--tone) 20%, var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 45%, transparent);
  color: var(--tone);
  font-size: 12px;
  font-weight: 800;
  animation: plinko-pill-in 360ms var(--ease-spring);
}
.plinko-pill:nth-child(n + 6) { opacity: 0.55; }
@keyframes plinko-pill-in { from { opacity: 0; transform: translateY(-10px) scale(0.7); } }

@media (max-width: 1000px) {
  .plinko-board { min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .plinko-stage { order: 2; aspect-ratio: 1 / 0.92; }
  .plinko-history { order: 1; grid-auto-flow: column; grid-auto-columns: 54px; justify-content: end; width: auto; height: 28px; overflow: hidden; }
  .plinko-pill { height: 28px; }
}
@media (max-width: 600px) {
  .plinko-board { gap: 8px; padding: 10px 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .plinko-slot.is-hit, .plinko-pill { animation: none; }
}

/* /css/roulette.css */
/* Roulette: the wheel over a felt table. Its own palette, like every game: casino green and gold. */

.rt-board {
  --felt: #0c4632;
  --felt-deep: #062a1d;
  --felt-line: rgb(255 255 255 / 0.2);
  --red: #c4172f;
  --black: #151b27;
  --green: #0f8a4f;
  --gold: #ffe08a;
  container: rtboard / inline-size;
  display: grid;
  gap: 20px;
  min-height: 560px;
  padding: 22px clamp(12px, 2.5vw, 28px) 24px;
  background:
    radial-gradient(620px 360px at 50% 18%, rgb(34 224 143 / 0.08), transparent 70%),
    var(--bg-0);
}

/* ---------- Wheel and last results ---------- */

.rt-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}
.rt-wheel {
  grid-column: 2;
  position: relative;
  width: clamp(220px, 42cqw, 340px);
  aspect-ratio: 1;
}
.rt-wheel::before {
  /* The table's light pooling under the wheel. */
  content: "";
  position: absolute;
  inset: 8% -6% -10%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 197 61 / 0.12), transparent);
  filter: blur(8px);
}
.rt-wheel__canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 28px 60px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(255 255 255 / 0.04);
}
.rt-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 25%;
  aspect-ratio: 1;
  border-radius: 50%;
  translate: -50% -50%;
  color: #fff;
  font: 900 clamp(20px, 5cqw, 30px) / 1 var(--font-display);
  text-shadow: 0 2px 6px rgb(0 0 0 / 0.45);
  box-shadow: 0 0 0 3px rgb(255 241 193 / 0.95), 0 0 0 6px rgb(0 0 0 / 0.35), 0 12px 30px rgb(0 0 0 / 0.55);
  pointer-events: none;
}
.rt-badge[hidden] { display: none; }
.rt-badge.is-red { background: radial-gradient(circle at 35% 30%, #ff6072, var(--red) 58%, #7a0b1c); }
.rt-badge.is-black { background: radial-gradient(circle at 35% 30%, #3b465c, var(--black) 58%, #07090e); }
.rt-badge.is-green { background: radial-gradient(circle at 35% 30%, #3fe39a, var(--green) 58%, #05472b); }
.rt-badge.is-in { animation: rt-badge-in 560ms var(--ease-spring); }
@keyframes rt-badge-in { from { opacity: 0; scale: 0.3; rotate: -40deg; } }

.rt-side { grid-column: 3; justify-self: start; display: grid; gap: 8px; }
.rt-side__label { color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.rt-history {
  display: grid;
  grid-template-columns: repeat(2, 32px);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rt-history:empty::before { content: "—"; color: var(--text-3); }
.rt-history__item {
  display: grid;
  place-items: center;
  height: 30px;
  border-radius: 8px;
  color: #fff;
  font: 800 12px / 1 var(--font-display);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.28), inset 0 1px 0 rgb(255 255 255 / 0.12);
}
.rt-history__item.is-red { background: var(--red); }
.rt-history__item.is-black { background: #222a39; }
.rt-history__item.is-green { background: var(--green); }
.rt-history__item:first-child { outline: 2px solid rgb(255 224 138 / 0.85); outline-offset: 1px; }
.rt-history__item.is-new { animation: rt-history-in 460ms var(--ease-spring); }
@keyframes rt-history-in { from { opacity: 0; scale: 0.4; } }

@container rtboard (max-width: 640px) {
  .rt-stage { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; }
  .rt-wheel { grid-column: 1; width: min(68cqw, 270px); }
  .rt-side { grid-column: 1; justify-self: stretch; justify-items: center; }
  .rt-history { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 26px; }
  .rt-history__item { height: 26px; font-size: 11px; }
}

/* ---------- Round status ---------- */

.rt-status {
  display: grid;
  gap: 8px;
  width: min(100%, 560px);
  justify-self: center;
  padding: 10px 14px 12px;
  border-radius: 14px;
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 300ms, background-color 300ms;
}
.rt-status__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rt-status__text { font: 800 15px / 1.2 var(--font-display); letter-spacing: -0.01em; }
.rt-status__time { color: var(--text-2); font-size: 13px; font-weight: 700; }
.rt-status__bar { display: block; height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.rt-status__bar span {
  display: block;
  height: 100%;
  /* Scaled rather than resized: the countdown ticks all through the round, and a scale costs no layout. */
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  border-radius: inherit;
  background: linear-gradient(90deg, #22e08f, #ffe08a);
  transition: transform 220ms linear;
}
.rt-status[data-phase="betting"] .rt-status__text { color: #3ff0a2; }
.rt-status[data-phase="spinning"] { box-shadow: inset 0 0 0 1px rgb(255 224 138 / 0.5), 0 0 24px rgb(255 197 61 / 0.12); }
.rt-status[data-phase="spinning"] .rt-status__text { color: var(--gold); }
.rt-status[data-phase="result"] .rt-status__text { color: var(--text); }

/* ---------- The table ---------- */

.rt-table-wrap { container: rt / inline-size; }
.rt-felt {
  position: relative;
  padding: 14px;
  border-radius: 18px;
  background: radial-gradient(120% 90% at 50% 0%, #136045, var(--felt) 45%, var(--felt-deep));
  box-shadow:
    inset 0 0 0 2px rgb(255 214 120 / 0.38),
    inset 0 0 0 7px rgb(0 0 0 / 0.22),
    inset 0 0 60px rgb(0 0 0 / 0.45),
    0 20px 40px rgb(0 0 0 / 0.35);
}
.rt-felt::before {
  /* A woven texture so the felt is not a flat colour. */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: repeating-linear-gradient(45deg, rgb(255 255 255 / 0.018) 0 2px, transparent 2px 5px);
  pointer-events: none;
}
.rt-table {
  --cell-h: clamp(38px, 7.2cqw, 58px);
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr repeat(12, minmax(0, 1fr)) 1.15fr;
  grid-template-rows: repeat(3, var(--cell-h)) repeat(2, calc(var(--cell-h) * 0.82));
  gap: 3px;
}
.rt-cell {
  grid-column: var(--hc) / span var(--hcs, 1);
  grid-row: var(--hr) / span var(--hrs, 1);
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font: 800 clamp(12px, 2.3cqw, 16px) / 1 var(--font-display);
  cursor: pointer;
  transition: filter 140ms, box-shadow 160ms, scale 160ms var(--ease-out);
}
.rt-cell--number { box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.25), inset 0 1px 0 rgb(255 255 255 / 0.12); }
.rt-cell--number.is-red { background: linear-gradient(180deg, #dc2a43, var(--red)); }
.rt-cell--number.is-black { background: linear-gradient(180deg, #273042, var(--black)); }
.rt-cell--number.is-green { background: linear-gradient(180deg, #19b86d, var(--green)); border-radius: 14px 7px 7px 14px; font-size: clamp(14px, 2.8cqw, 20px); }
.rt-cell--outside {
  background: rgb(255 255 255 / 0.035);
  box-shadow: inset 0 0 0 1px var(--felt-line);
  color: rgb(255 255 255 / 0.92);
  font: 750 clamp(11px, 1.9cqw, 13.5px) / 1 var(--font-ui);
  letter-spacing: 0.02em;
}
.rt-cell__diamond {
  width: clamp(20px, 4cqw, 30px);
  height: clamp(13px, 2.5cqw, 18px);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.rt-cell--color.is-red .rt-cell__diamond { background: linear-gradient(180deg, #ff4a60, var(--red)); }
.rt-cell--color.is-black .rt-cell__diamond { position: relative; background: rgb(255 255 255 / 0.55); }
.rt-cell--color.is-black .rt-cell__diamond::after {
  content: "";
  position: absolute;
  inset: 1.5px 2.5px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: linear-gradient(180deg, #3a4458, #07090e);
}
.rt-cell:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
@media (hover: hover) {
  .rt-cell:hover { filter: brightness(1.15); }
}
.rt-cell.is-covered { filter: brightness(1.2); box-shadow: 0 0 0 2px rgb(255 224 138 / 0.85), inset 0 -3px 0 rgb(0 0 0 / 0.2); }
.rt-cell--outside.is-covered { background: rgb(255 224 138 / 0.12); }
.rt-cell.is-hit {
  z-index: 1;
  box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgb(255 214 120 / 0.85);
  animation: rt-hit 1.2s var(--ease-in-out) infinite alternate;
}
@keyframes rt-hit { to { box-shadow: 0 0 0 3px #fff6d8, 0 0 36px rgb(255 214 120 / 1); scale: 1.05; } }
.rt-board.is-locked .rt-cell, .rt-board.is-locked .rt-spot { cursor: default; }
.rt-board.is-locked .rt-cell:hover { filter: none; }

/* Down the screen on narrow boards: outside bets and dozens to the left, numbers in three columns. */
@container rt (max-width: 560px) {
  .rt-table {
    --row: clamp(30px, 9cqw, 42px);
    grid-template-columns: 0.85fr 0.85fr repeat(3, 1.25fr);
    grid-template-rows: calc(var(--row) * 1.15) repeat(12, var(--row)) var(--row);
  }
  .rt-cell {
    grid-column: var(--vc) / span var(--vcs, 1);
    grid-row: var(--vr) / span var(--vrs, 1);
  }
  .rt-cell--number.is-green { border-radius: 14px 14px 7px 7px; }
  .rt-cell--tall .rt-cell__text { writing-mode: vertical-rl; rotate: 180deg; }
  .rt-cell--tall .rt-cell__diamond { rotate: 90deg; }
}

/* ---------- Hit areas on lines and crossings ---------- */

.rt-spots, .rt-chips { position: absolute; inset: 14px; pointer-events: none; }
.rt-spot {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: 2;
  width: var(--spot, 18px);
  height: var(--spot, 18px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  translate: -50% -50%;
  pointer-events: auto;
  cursor: pointer;
}
.rt-spot::after {
  content: "";
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  background: rgb(255 241 193 / 0);
  transition: background-color 120ms, box-shadow 120ms, scale 160ms var(--ease-spring);
}
@media (hover: hover) {
  .rt-board:not(.is-locked) .rt-spot:hover::after {
    background: rgb(255 241 193 / 0.95);
    box-shadow: 0 0 12px rgb(255 214 120 / 0.9);
    scale: 1.2;
  }
}

/* ---------- Chips ---------- */

.rt-chip, .rt-rack__chip {
  --chip-bg: #5b6b86;
  --chip-edge: #e6ecf6;
  --chip-ink: #fff;
  background:
    radial-gradient(circle, var(--chip-bg) 0 55%, transparent 56%),
    repeating-conic-gradient(var(--chip-edge) 0 18deg, var(--chip-bg) 18deg 45deg);
}
[data-tone="slate"] { --chip-bg: #56657f; --chip-edge: #e6ecf6; --chip-ink: #fff; }
[data-tone="ivory"] { --chip-bg: #efe6cf; --chip-edge: #b3222f; --chip-ink: #3b2a10; }
[data-tone="ruby"] { --chip-bg: #c4172f; --chip-edge: #fff4f0; --chip-ink: #fff; }
[data-tone="jade"] { --chip-bg: #0f8a55; --chip-edge: #f1fff7; --chip-ink: #fff; }
[data-tone="onyx"] { --chip-bg: #131925; --chip-edge: #f2c14e; --chip-ink: #f7d57a; }
[data-tone="violet"] { --chip-bg: #6a3fd0; --chip-edge: #f7f1ff; --chip-ink: #fff; }

.rt-chip {
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: 3;
  display: grid;
  place-items: center;
  width: var(--chip, 28px);
  height: var(--chip, 28px);
  border-radius: 50%;
  translate: -50% -50%;
  color: var(--chip-ink);
  box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / 0.25), 0 3px 6px rgb(0 0 0 / 0.5);
  transition: opacity 260ms, scale 260ms var(--ease-out), box-shadow 260ms;
}
.rt-chip::before {
  content: "";
  position: absolute;
  inset: 21%;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--chip-ink) 55%, transparent);
}
.rt-chip.is-stack {
  box-shadow:
    inset 0 0 0 1.5px rgb(0 0 0 / 0.25),
    0 2px 0 -1px color-mix(in srgb, var(--chip-bg) 65%, black),
    0 4px 0 -2px color-mix(in srgb, var(--chip-edge) 60%, black),
    0 6px 0 -3px color-mix(in srgb, var(--chip-bg) 55%, black),
    0 8px 10px rgb(0 0 0 / 0.45);
}
.rt-chip__value {
  position: relative;
  font: 800 calc(var(--chip, 28px) * 0.33) / 1 var(--font-ui);
  letter-spacing: -0.02em;
}
.rt-chip.is-dropped { animation: rt-chip-drop 380ms var(--ease-spring); }
@keyframes rt-chip-drop {
  from { transform: translateY(-14px) scale(1.5); opacity: 0; }
  60% { transform: translateY(1px) scale(0.96); opacity: 1; }
}
.rt-chip.is-leaving { animation: rt-chip-out 280ms var(--ease-in-out) forwards; }
@keyframes rt-chip-out { to { transform: translateY(-10px) scale(0.5); opacity: 0; } }
.rt-chip.is-lost { opacity: 0.35; scale: 0.86; }
.rt-chip.is-win {
  z-index: 4;
  box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgb(255 214 120 / 0.9), 0 3px 6px rgb(0 0 0 / 0.5);
  animation: rt-chip-win 900ms var(--ease-spring);
}
@keyframes rt-chip-win { 30% { transform: translateY(-8px) scale(1.25); } }
.rt-chip__gain {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  translate: -50% 0;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgb(4 30 20 / 0.85);
  color: #3ff0a2;
  font: 900 12px / 1.2 var(--font-ui);
  white-space: nowrap;
  animation: rt-gain 2.4s var(--ease-out) forwards;
}
@keyframes rt-gain {
  from { opacity: 0; transform: translateY(8px) scale(0.8); }
  15% { opacity: 1; transform: translateY(0) scale(1.05); }
  25% { transform: scale(1); }
  80% { opacity: 1; }
  to { opacity: 0; transform: translateY(-10px); }
}

/* Chips of a bet already placed this round: set, with a gold rim. */
.rt-chips.is-confirmed .rt-chip { box-shadow: 0 0 0 2px rgb(255 224 138 / 0.9), 0 3px 6px rgb(0 0 0 / 0.5); }
.rt-chip.is-confirming { animation: rt-chip-confirm 520ms var(--ease-spring); }
@keyframes rt-chip-confirm { 40% { transform: scale(1.22); } }

/* ---------- This round's players ---------- */

/* In the bet panel, under "Space to bet". */
.rt-players { display: grid; gap: 10px; margin: 2px -16px -16px; padding: 14px 16px 16px; box-shadow: 0 -1px 0 var(--line); }
.rt-players__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--text-3); font-size: 12.5px; font-weight: 650; }
.rt-players__head strong { color: var(--text); font-size: 14px; }
.rt-players__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 420px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.rt-players__empty { color: var(--text-3); font-size: 13px; }
.rt-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 13px;
  animation: rise-in 260ms var(--ease-out);
  transition: background-color 300ms, box-shadow 300ms, opacity 300ms;
}
.rt-player__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.rt-player__amount { color: var(--text-2); font-weight: 700; }
.rt-player.is-me { box-shadow: inset 0 0 0 1px rgb(255 197 61 / 0.45); }
.rt-player.is-won { background: color-mix(in srgb, var(--win) 14%, var(--bg-2)); }
.rt-player.is-won .rt-player__amount { color: var(--win); }
.rt-player.is-lost { opacity: 0.55; }

/* ---------- Panel ---------- */

.rt-rack { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 6px 2px 2px; }
.rt-rack__chip {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 46px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--chip-ink);
  font: 800 12px / 1 var(--font-ui);
  box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / 0.25), 0 3px 6px rgb(0 0 0 / 0.45);
  cursor: pointer;
  transition: transform 180ms var(--ease-spring), box-shadow 180ms;
}
.rt-rack__chip::before {
  content: "";
  position: absolute;
  inset: 21%;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--chip-ink) 55%, transparent);
}
.rt-rack__chip span { position: relative; }
@media (hover: hover) {
  .rt-rack__chip:hover:not(:disabled) { transform: translateY(-2px); }
}
.rt-rack__chip[aria-checked="true"] {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--accent), 0 10px 18px rgb(0 0 0 / 0.5);
}
.rt-rack__chip.is-picked { animation: rt-pick 320ms var(--ease-spring); }
@keyframes rt-pick { 40% { transform: translateY(-7px) scale(1.14); } }
.rt-rack__chip:disabled { opacity: 0.55; cursor: default; }
.rt-rack.is-nudged { animation: fx-shake 380ms var(--ease-out); --shake: 5px; }
.bet-button.is-placed:disabled { opacity: 1; background: color-mix(in srgb, var(--win) 18%, var(--bg-3)); color: var(--win); box-shadow: none; }
.rt-actions .btn span { display: grid; }
.rt-help { color: var(--text-3); font-size: 12px; line-height: 1.45; }

/* ---------- Phone dock: chips and the button along the bottom of the table ---------- */

.rt-dock { display: none; }
@media (max-width: 700px) {
  .rt-panel.is-docked .rt-chip-field { display: none; }
  .rt-dock {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: -6px calc(-1 * clamp(12px, 2.5vw, 28px)) -24px;
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--bg-1);
    box-shadow: 0 -1px 0 var(--line), 0 -12px 24px rgb(0 0 0 / 0.4);
  }
  .rt-dock .rt-rack { gap: 4px; padding: 6px 0 2px; }
  .rt-dock .rt-rack__chip { max-width: 40px; font-size: 10.5px; }
  .rt-dock .bet-button { width: auto; min-width: 112px; height: 48px; margin: 0; padding: 0 16px; font-size: 15px; }
}

/* ---------- Verifier and bet detail ---------- */

.roulette-pocket { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: #fff !important; }
.roulette-pocket.is-red { background: #c4172f; }
.roulette-pocket.is-black { background: #1c2331; }
.roulette-pocket.is-green { background: #0f8a4f; }

@media (max-width: 600px) {
  .rt-board { min-height: 0; padding: 16px 10px 18px; gap: 16px; }
  .rt-felt { padding: 10px; border-radius: 14px; }
  .rt-spots, .rt-chips { inset: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .rt-badge.is-in, .rt-history__item.is-new, .rt-cell.is-hit, .rt-chip.is-dropped, .rt-chip.is-leaving,
  .rt-chip.is-win, .rt-chip__gain, .rt-rack__chip.is-picked, .rt-rack.is-nudged, .rt-chip.is-confirming, .rt-player { animation: none; }
  .rt-status__bar span { transition: none; }
}

/* /css/jackpot.css */
/* The slots' progressive jackpot: the pools above the reels, the Jackpot Wheel, the win screen, the notice. */

:root {
  --jp-mini: #22e08f;
  --jp-major: #b77dff;
  --jp-grand: #ffc53d;
}

/* ---------- The three pools ---------- */

.jp-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  width: min(100%, 620px);
  margin: 0 auto 4px;
}
.jp-bar[hidden] { display: none; }
.jp-plaque {
  --tone: var(--jp-mini);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 8px 10px 9px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 16%, var(--bg-2)), var(--bg-1));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 45%, transparent), 0 6px 16px rgb(0 0 0 / 0.3);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms var(--ease-out), box-shadow 200ms;
}
.jp-plaque[data-tier="major"] { --tone: var(--jp-major); }
.jp-plaque[data-tier="grand"] {
  --tone: var(--jp-grand);
  padding: 11px 12px 12px;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tone) 70%, transparent), 0 0 24px rgb(255 197 61 / 0.18), 0 8px 20px rgb(0 0 0 / 0.35);
}
.jp-plaque::after {
  /* A sheen that sweeps across now and then. */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgb(255 255 255 / 0.14) 50%, transparent 65%);
  translate: -120% 0;
  animation: jp-sheen 5s var(--ease-in-out) infinite;
}
.jp-plaque[data-tier="major"]::after { animation-delay: 1.6s; }
.jp-plaque[data-tier="grand"]::after { animation-delay: 0.8s; }
@keyframes jp-sheen { 0%, 70% { translate: -120% 0; } 100% { translate: 120% 0; } }
@media (hover: hover) {
  .jp-plaque:hover { transform: translateY(-2px); }
}
.jp-plaque__tier { color: var(--tone); font: 800 10.5px / 1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; }
.jp-plaque__amount { display: inline-flex; align-items: center; gap: 6px; }
.jp-plaque__coin, .jp-plaque__coin svg { width: 15px; height: 15px; }
.jp-plaque__value { font: 800 14px / 1 var(--font-display); letter-spacing: -0.01em; }
.jp-plaque[data-tier="grand"] .jp-plaque__value { font-size: clamp(16px, 2.4vw, 21px); color: #fff4cf; text-shadow: 0 0 14px rgb(255 197 61 / 0.45); }
.jp-plaque[data-tier="grand"] .jp-plaque__coin, .jp-plaque[data-tier="grand"] .jp-plaque__coin svg { width: 19px; height: 19px; }
.jp-plaque.is-tick .jp-plaque__value { animation: jp-tick 480ms var(--ease-out); }
@keyframes jp-tick { 30% { color: #fff; text-shadow: 0 0 16px var(--tone); } }
.jp-plaque.is-reset { animation: jp-reset 900ms var(--ease-spring); }
@keyframes jp-reset { 20% { transform: scale(1.08); box-shadow: 0 0 0 2px var(--tone), 0 0 30px var(--tone); } }
/* The meter the Jackpot coins fill: three sockets under the pools. */
.jp-meter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: center;
  padding: 5px 12px 5px 14px;
  border: 0;
  border-radius: 999px;
  background: rgb(8 12 22 / 0.6);
  box-shadow: inset 0 0 0 1px rgb(255 197 61 / 0.25);
  color: var(--text-3);
  cursor: pointer;
  transition: box-shadow 200ms;
}
.jp-meter:hover { box-shadow: inset 0 0 0 1px rgb(255 197 61 / 0.5); }
.jp-meter__label { color: #ffdf85; font: 800 10.5px / 1 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; }
.jp-meter__sockets { display: inline-flex; gap: 6px; }
.jp-meter__socket {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgb(255 197 61 / 0.35);
  background: rgb(0 0 0 / 0.25);
}
.jp-meter__coin, .jp-meter__coin svg { width: 22px; height: 22px; }
.jp-meter__socket.is-in .jp-meter__coin { animation: jp-socket 420ms var(--ease-spring); }
@keyframes jp-socket { from { transform: scale(1.9) translateY(-6px); opacity: 0; } }
.jp-meter__hint { font-size: 11.5px; font-weight: 650; }
/* Two coins in: the meter holds its breath. Three: it lights up. A few beats each, never a loop
   that keeps running in between spins. */
.jp-meter.is-near { animation: jp-near 600ms ease-in-out 4 alternate; }
@keyframes jp-near { to { box-shadow: inset 0 0 0 2px rgb(255 197 61 / 0.85), 0 0 18px rgb(255 197 61 / 0.35); } }
.jp-meter.is-full { box-shadow: inset 0 0 0 2px #ffc53d, 0 0 26px rgb(255 197 61 / 0.5); animation: jp-full 380ms ease-in-out 6 alternate; }
@keyframes jp-full { to { transform: scale(1.06); } }

/* On a phone the three pools share 350 pixels: smaller figures, no coin, so none is cut. */
@media (max-width: 480px) {
  .jp-plaque { padding: 7px 6px 8px; }
  .jp-plaque .jp-plaque__coin { display: none; }
  /* The figures shrink with the screen, so a high bet's Grand still fits on a 320 pixel phone. */
  .jp-plaque__value { font-size: min(12.5px, 3.5vw); }
  .jp-plaque[data-tier="grand"] .jp-plaque__value { font-size: min(15px, 4.2vw); }
  .jp-meter__hint { display: none; }
}

/* ---------- The Jackpot Wheel ---------- */

.jp-overlay {
  --tone: var(--jp-grand);
  position: fixed;
  inset: 0;
  z-index: 91;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgb(40 26 0 / 0.82), rgb(3 6 12 / 0.96) 70%);
  animation: fade-in 280ms var(--ease-out);
}
.jp-overlay[data-tier="mini"] { --tone: var(--jp-mini); }
.jp-overlay[data-tier="major"] { --tone: var(--jp-major); }
.jp-overlay.is-leaving { pointer-events: none; animation: jp-out 420ms var(--ease-in-out) forwards; }
@keyframes jp-out { to { opacity: 0; transform: scale(1.05); } }
.jp-overlay__rays {
  position: absolute;
  inset: -50%;
  background: repeating-conic-gradient(from 0deg, rgb(255 197 61 / 0.1) 0deg 8deg, transparent 8deg 20deg);
  mask-image: radial-gradient(circle, black 18%, transparent 62%);
  animation: spin 22s linear infinite;
}
.jp-overlay.is-won .jp-overlay__rays {
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tone) 22%, transparent) 0deg 8deg, transparent 8deg 20deg);
  animation-duration: 9s;
}

.jp-stage { position: relative; display: grid; justify-items: center; gap: 10px; padding: 16px; text-align: center; }
.jp-title {
  font: 900 clamp(38px, 8vw, 78px) / 1 var(--font-display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff 8%, #ffdf85 45%, #ff9f1a 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #8a5200) drop-shadow(0 18px 40px rgb(255 159 26 / 0.55));
  animation: jp-slam 700ms var(--ease-spring);
}
@keyframes jp-slam { from { opacity: 0; transform: scale(2.4); filter: blur(6px); } }
.jp-sub { color: #f3dca0; font-weight: 700; letter-spacing: 0.04em; animation: rise-in 500ms var(--ease-out) 300ms both; }

.jp-wheel {
  position: relative;
  width: min(78vw, 360px);
  aspect-ratio: 1;
  margin-top: 10px;
  opacity: 0;
  transform: scale(0.6) rotate(-25deg);
  transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-spring);
}
.jp-wheel.is-live { opacity: 1; transform: none; }
.jp-wheel__svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 24px 40px rgb(0 0 0 / 0.6)); }
.jp-rim { fill: #3a2408; stroke: #ffdf85; stroke-width: 4; }
.jp-slice { stroke: rgb(0 0 0 / 0.35); stroke-width: 1.2; }
.jp-slice--mini { fill: #11845a; }
.jp-slice--major { fill: #6c3fd1; }
.jp-slice--grand { fill: #d38b00; }
.jp-slice__label { fill: #fff; font: 800 13px var(--font-display); letter-spacing: 0.08em; }
.jp-stud { fill: #fff4cf; }
.jp-hub { fill: #ffcf5a; stroke: #7a5211; stroke-width: 3; }
.jp-hub__inner { fill: #2b1a05; }
.jp-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 34px;
  height: 44px;
  translate: -50% 0;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background: linear-gradient(180deg, #fff4cf, #ffb300);
  filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.5));
  transform-origin: 50% 0;
}
.jp-pointer.is-flick { animation: jp-flick 160ms var(--ease-out); }
@keyframes jp-flick { 40% { transform: rotate(-12deg); } }
.jp-wheel.is-landed { animation: jp-landed 900ms var(--ease-spring); }
@keyframes jp-landed { 30% { transform: scale(1.06); } }

/* ---------- The win screen ---------- */

.jp-win { display: grid; justify-items: center; gap: 6px; animation: jp-win-in 800ms var(--ease-spring); }
@keyframes jp-win-in { from { opacity: 0; transform: scale(0.35) rotate(-6deg); } }
.jp-win__crown { display: grid; color: var(--tone); filter: drop-shadow(0 0 18px var(--tone)); }
.jp-win__crown .icon { width: 64px; height: 64px; stroke-width: 1.4; }
.jp-win__tier {
  color: var(--tone);
  font: 900 clamp(26px, 6vw, 44px) / 1 var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 30px color-mix(in srgb, var(--tone) 60%, transparent);
}
.jp-win__label {
  font: 900 clamp(44px, 10vw, 96px) / 0.95 var(--font-display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff 10%, #ffdf85 45%, #ff9f1a 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 5px 0 #8a5200) drop-shadow(0 20px 44px rgb(255 159 26 / 0.6));
  animation: jp-pulse 1.4s var(--ease-in-out) infinite alternate;
}
@keyframes jp-pulse { to { transform: scale(1.05); } }
.jp-win__amount {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.4);
  box-shadow: inset 0 0 0 1.5px rgb(255 223 133 / 0.5);
  color: #fff4cf;
  font: 900 clamp(26px, 6vw, 46px) / 1 var(--font-display);
}
.jp-win__coin, .jp-win__coin svg { width: 1em; height: 1em; }
.jp-collect { min-width: 220px; margin-top: 18px; animation: rise-in 500ms var(--ease-out) 1.2s both; }

/* ---------- Someone else's jackpot ---------- */

.jp-notice {
  --tone: var(--jp-grand);
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: 50%;
  z-index: 89;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 10px 16px 10px 12px;
  border-radius: 14px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tone) 22%, #121826), #121826 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 55%, transparent), 0 14px 40px rgb(0 0 0 / 0.5), 0 0 30px color-mix(in srgb, var(--tone) 25%, transparent);
  color: var(--text-2);
  font-size: 13.5px;
  translate: -50% 0;
  animation: jp-notice-in 600ms var(--ease-spring);
}
.jp-notice[data-tier="mini"] { --tone: var(--jp-mini); }
.jp-notice[data-tier="major"] { --tone: var(--jp-major); }
.jp-notice strong { color: var(--text); }
.jp-notice__tier { color: var(--tone) !important; }
.jp-notice__icon { display: grid; color: var(--tone); }
.jp-notice__amount { margin-left: 4px; color: #fff4cf; font-weight: 800; white-space: nowrap; }
.jp-notice.is-leaving { animation: jp-notice-out 480ms var(--ease-in-out) forwards; }
@keyframes jp-notice-in { from { opacity: 0; transform: translateY(-24px) scale(0.9); } }
@keyframes jp-notice-out { to { opacity: 0; transform: translateY(-16px); } }

/* ---------- How it works ---------- */

.modal--jackpot { width: min(480px, 100%); }
.jp-rules { display: grid; gap: 12px; color: var(--text-2); line-height: 1.55; }
.jp-rules ul { display: grid; gap: 4px; margin: 0; padding-left: 20px; }
.jp-rules__tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jp-rules__tier { --tone: var(--jp-mini); display: grid; justify-items: center; gap: 2px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--tone) 12%, var(--bg-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 40%, transparent); }
.jp-rules__tier[data-tier="major"] { --tone: var(--jp-major); }
.jp-rules__tier[data-tier="grand"] { --tone: var(--jp-grand); }
.jp-rules__tier strong { color: var(--tone); font-family: var(--font-display); }
.jp-rules__pays { color: var(--text); font-weight: 750; }
.jp-rules__pays + .num { color: var(--text-3); font-size: 12px; }

/* The chat's card for a jackpot. */
.chat-win--jackpot { background: linear-gradient(140deg, rgb(255 197 61 / 0.22), var(--bg-2) 72%); box-shadow: inset 0 0 0 1px rgb(255 197 61 / 0.55); }
.chat-win--jackpot .chat-win__head { color: var(--accent); }
.chat-win--jackpot .chat-win__amount strong { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .jp-plaque::after, .jp-overlay__rays, .jp-title, .jp-sub, .jp-win, .jp-win__label, .jp-collect,
  .jp-notice, .jp-plaque.is-tick .jp-plaque__value, .jp-plaque.is-reset, .jp-wheel.is-landed,
  .jp-meter.is-near, .jp-meter.is-full, .jp-meter__socket.is-in .jp-meter__coin { animation: none; }
  .jp-wheel { transition: none; }
}

/* /css/rewards.css */
/* ---------- Level ring, XP bar, sidebar badges ---------- */

.level-ring {
  --p: 0;
  --rank: #d08a4c;
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(var(--rank) calc(var(--p) * 360deg), var(--bg-3) 0);
  transition: --p 600ms;
}
.level-ring > .avatar { box-shadow: 0 0 0 3px var(--bg-1); }
.level-ring__badge {
  position: absolute;
  right: -6px;
  bottom: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--rank);
  color: #0b111d;
  font-size: 10px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-1);
}
.level-ring.is-levelup { animation: ring-pop 700ms var(--ease-spring); }
@keyframes ring-pop { 40% { transform: scale(1.25); box-shadow: 0 0 20px var(--rank); } }

.xp-bar {
  display: block;
  height: 6px;
  border-radius: 6px;
  background: var(--bg-0);
  overflow: hidden;
}
.xp-bar__fill {
  --p: 0;
  display: block;
  height: 100%;
  width: calc(var(--p) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  transition: width 600ms var(--ease-out);
}
.xp-bar--big { height: 10px; }
.menu__xp { display: grid; gap: 6px; padding: 0 10px 10px; }
.menu__xp-text { color: var(--text-3); font-size: 11.5px; font-weight: 600; }

.nav__dot {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--win);
  animation: pulse 1.4s ease-in-out infinite;
}
.nav__count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.shell.is-collapsed .nav__dot, .shell.is-collapsed .nav__count {
  position: absolute;
  top: 6px;
  right: 10px;
  margin: 0;
}

/* ---------- Level-up overlay ---------- */

.levelup {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  background: rgb(3 6 12 / 0.7);
  cursor: pointer;
  animation: fade-in 240ms var(--ease-out);
}
.levelup.is-leaving { pointer-events: none; animation: fade-out 300ms forwards; }
.levelup__card {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 32px 48px;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--rank) 30%, var(--bg-2)), var(--bg-1) 70%);
  box-shadow: 0 0 0 2px var(--rank), 0 30px 80px rgb(0 0 0 / 0.6), 0 0 80px color-mix(in srgb, var(--rank) 40%, transparent);
  animation: bigwin-in 700ms var(--ease-spring);
}
.levelup__eyebrow { color: var(--text-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; }
.levelup__level { font-family: var(--font-display); font-size: 96px; font-weight: 900; line-height: 1; color: var(--rank); }
.levelup__rank { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.levelup__reward { margin-top: 8px; padding: 6px 14px; border-radius: 999px; background: var(--win); color: var(--win-ink); font-weight: 800; }

/* ---------- Wheel ---------- */

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 32px;
  border-radius: 24px;
  background: radial-gradient(500px 400px at 30% 50%, rgb(255 197 61 / 0.1), transparent 70%), var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.wheel { position: relative; }
.wheel svg { width: 100%; height: auto; filter: drop-shadow(0 20px 40px rgb(0 0 0 / 0.5)); }
.wheel__disc { transform-box: fill-box; transform-origin: center; }
.wheel__bulb { animation: pulse 900ms steps(2) infinite; }
.wheel__bulb:nth-of-type(even) { animation-delay: -450ms; }
.wheel__pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 34px;
  height: 42px;
  translate: -50% 0;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.5));
}
.wheel__side { display: grid; gap: 16px; align-content: center; }
.wheel__status { color: var(--text-2); font-weight: 650; }
.wheel__prize {
  display: grid;
  gap: 2px;
  padding: 16px 20px;
  border-radius: var(--radius-l);
  background: color-mix(in srgb, var(--win) 14%, var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--win) 40%, transparent);
  animation: result-in 500ms var(--ease-spring);
}
.wheel__prize span { color: var(--text-2); font-weight: 650; }
.wheel__prize strong { font-family: var(--font-display); font-size: 30px; color: var(--win); }
.wheel__odds { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.wheel__odds li { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: var(--bg-2); color: var(--text-2); font-weight: 600; }

/* ---------- Missions and achievements ---------- */

.missions__reset { color: var(--text-3); font-weight: 650; font-size: 13px; }
.missions { display: grid; gap: 10px; }
.mission {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  animation: rise-in 360ms var(--ease-out) backwards;
}
.mission:nth-child(2) { animation-delay: 60ms; }
.mission:nth-child(3) { animation-delay: 120ms; }
.mission.is-complete { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 24px rgb(255 197 61 / 0.12); }
.mission.is-claimed { opacity: 0.6; }
.mission__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-3);
  color: var(--text-2);
}
.mission.is-complete .mission__icon { background: var(--accent); color: var(--accent-ink); }
.mission.is-claimed .mission__icon { background: var(--win); color: var(--win-ink); }
.mission__body { display: grid; gap: 6px; }
.mission__bar { height: 8px; border-radius: 8px; background: var(--bg-0); overflow: hidden; }
.mission__bar span {
  --p: 0;
  display: block;
  height: 100%;
  width: calc(var(--p) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--info), var(--win));
  transition: width 600ms var(--ease-out);
}
.mission__progress { color: var(--text-3); font-size: 12px; font-weight: 650; }

.achievements__count { color: var(--text-2); margin-bottom: 12px; font-weight: 600; }
.achievements__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.achievement {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-3);
  font-size: 12.5px;
}
.achievement strong { color: var(--text-2); font-size: 14px; }
.achievement__icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 6px; border-radius: 50%; background: var(--bg-2); }
.achievement.is-unlocked { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--bg-1)), var(--bg-1) 60%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text-2); }
.achievement.is-unlocked strong { color: var(--text); }
.achievement.is-unlocked .achievement__icon { background: var(--accent); color: var(--accent-ink); }
.achievement__date { color: var(--text-3); font-size: 11.5px; }

/* ---------- Leaderboard ---------- */

.leaderboard { display: grid; gap: 6px; }
.leaderboard__skeleton { height: 320px; }
.leader {
  display: grid;
  grid-template-columns: 36px auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-m);
  background: var(--bg-1);
  font-weight: 650;
  animation: rise-in 300ms var(--ease-out) backwards;
}
.leader__rank { color: var(--text-3); font-family: var(--font-display); font-weight: 800; text-align: center; }
.leader__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader__bets { color: var(--text-3); font-size: 12.5px; }
.leader__value { min-width: 120px; text-align: right; font-weight: 800; }
.leader.is-top { background: linear-gradient(90deg, color-mix(in srgb, var(--medal) 16%, var(--bg-1)), var(--bg-1) 60%); box-shadow: inset 3px 0 0 var(--medal); }
.leader.is-top .leader__rank { color: var(--medal); font-size: 18px; }
.leader.is-top-1 { --medal: #ffc53d; }
.leader.is-top-2 { --medal: #c3cbdc; }
.leader.is-top-3 { --medal: #d08a4c; }
.leader.is-me { box-shadow: inset 0 0 0 2px var(--info); }

/* ---------- Profile ---------- */

.profile-card {
  --rank: var(--accent);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 28px;
  border-radius: 24px;
  background: radial-gradient(500px 300px at 0% 0%, color-mix(in srgb, var(--rank) 20%, transparent), transparent 70%), var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.profile-card__main { display: grid; gap: 8px; }
.profile-card__main h2 { font-size: 28px; }
.profile-card__rank { color: var(--rank); font-weight: 800; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.profile-card__xp { color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.profile-card__facts { display: grid; gap: 12px; margin: 0; }
.profile-card__facts div { padding: 10px 16px; border-radius: var(--radius-m); background: var(--bg-2); }
.profile-card__facts dt { color: var(--text-3); font-size: 12px; font-weight: 600; }
.profile-card__facts dd { margin: 0; font-size: 18px; font-weight: 800; }
.profile-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.profile-totals div { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius-m); background: var(--bg-1); }
.profile-totals span { color: var(--text-3); font-size: 12px; font-weight: 600; }
.profile-totals strong { font-size: 18px; }
.profile-totals .is-win { color: var(--win); }
.profile-totals .is-loss { color: var(--loss); }

/* ---------- Live feed ---------- */

.feed .cell-user { display: inline-flex; align-items: center; gap: 8px; }
.section__head h2 .badge { vertical-align: middle; margin-right: 6px; }

@media (max-width: 900px) {
  .wheel-layout { grid-template-columns: 1fr; padding: 20px; }
  .profile-card { grid-template-columns: 1fr; justify-items: start; }
  .leader { grid-template-columns: 30px auto minmax(0, 1fr) auto; }
  .leader__bets { display: none; }
  .feed th:nth-child(3), .feed td:nth-child(3) { display: none; }
}
@media (max-width: 600px) {
  .mission { grid-template-columns: minmax(0, 1fr); }
  .mission__icon { display: none; }
  .feed th:nth-child(4), .feed td:nth-child(4) { display: none; }
}
/* The narrowest phones: the result in Crowns says enough, the multiplier column makes way. */
@media (max-width: 400px) {
  .feed th:nth-child(5), .feed td:nth-child(5) { display: none; }
  .feed th, .feed td { padding-inline: 10px; }
}

/* ---------- Crown coin, VIP club, rakeback ---------- */

.coin-mark { display: inline-grid; width: 22px; height: 22px; flex: none; }
.coin-mark svg { width: 100%; height: 100%; }
.wallet-pill__coin { width: 24px; height: 24px; filter: drop-shadow(0 2px 4px rgb(255 179 0 / 0.35)); }

.rakeback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
  padding: 24px 28px;
  border-radius: 20px;
  background: radial-gradient(420px 220px at 0% 50%, rgb(255 197 61 / 0.14), transparent 70%), var(--bg-1);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.rakeback__main { display: grid; gap: 6px; }
.rakeback__label { color: var(--text-2); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.rakeback__amount { display: flex; align-items: center; gap: 12px; }
.rakeback__amount strong { font-family: var(--font-display); font-size: 36px; font-weight: 900; }
.rakeback__coin { width: 38px; height: 38px; }
.rakeback__note { max-width: 560px; color: var(--text-3); font-size: 13px; }

.vip-explainer { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.vip-explainer > div { display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--radius-l); background: var(--bg-1); }
.vip-explainer p { color: var(--text-2); font-size: 13.5px; }

.vip-ladder { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.vip-tier {
  --rank: var(--accent);
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  opacity: 0.7;
  transition: opacity 200ms, box-shadow 200ms;
}
.vip-tier.is-reached { opacity: 1; }
.vip-tier.is-current {
  opacity: 1;
  background: linear-gradient(160deg, color-mix(in srgb, var(--rank) 16%, var(--bg-1)), var(--bg-1) 60%);
  box-shadow: inset 0 0 0 2px var(--rank), 0 0 30px color-mix(in srgb, var(--rank) 20%, transparent);
}
.vip-tier__head { display: flex; align-items: center; gap: 10px; }
.vip-tier__head strong { font-family: var(--font-display); font-size: 17px; color: var(--rank); }
.vip-tier__gem { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--rank) 20%, var(--bg-2)); color: var(--rank); }
.vip-tier__rate { margin-left: auto; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); font-size: 12px; font-weight: 700; }
.vip-tier__levels { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.vip-tier__levels li { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: var(--bg-2); color: var(--text-2); font-weight: 600; }

.profile-links { display: flex; gap: 10px; margin-top: 14px; }

@media (max-width: 700px) {
  .rakeback { flex-direction: column; align-items: stretch; padding: 20px; }
}

/* /css/pages.css */
.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.not-found { display: grid; justify-items: center; gap: 14px; max-width: 460px; margin: 10vh auto 0; text-align: center; }
.not-found__code {
  font-family: var(--font-display);
  font-size: clamp(72px, 16vw, 112px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff1c1, var(--accent) 55%, #c98a00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.not-found h1 { font-size: 26px; font-weight: 800; }
.not-found p:not(.not-found__code) { color: var(--text-2); margin-bottom: 10px; }
.note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 13px;
}
.note span { display: grid; flex: none; }
.note.is-bad { color: #ffc2cb; background: color-mix(in srgb, var(--loss) 12%, var(--bg-2)); }

.input--select { padding-right: 8px; }
.input select {
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}
.input select option { background: var(--bg-2); }

.modal--wide { width: min(600px, 100%); }

/* ---------- Bet detail ---------- */

.bet-detail { display: grid; gap: 14px; }
.bet-detail__time { color: var(--text-3); font-size: 12.5px; margin-top: -8px; }
.bet-detail__summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--line);
}
.bet-detail__summary > div { display: grid; gap: 2px; padding: 12px 14px; background: var(--bg-2); }
.bet-detail__summary span { color: var(--text-3); font-size: 12px; font-weight: 600; }
.bet-detail__summary strong { font-size: 16px; }
.bet-detail__summary .is-win, .kv .is-win { color: var(--win); }
.bet-detail__title { font-size: 14px; margin-top: 6px; }

.verify-result {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 16px;
  border-radius: var(--radius-m);
  background: var(--bg-0);
}
.verify-result__big {
  display: grid;
  place-items: center;
  min-width: 110px;
  height: 64px;
  padding: 0 16px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.verify-result__big.is-win { background: var(--win); color: var(--win-ink); }
.verify-result__big.is-loss { background: var(--loss); color: #fff; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--text-3); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.verdict {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  font-weight: 650;
  font-size: 13.5px;
  animation: rise-in 260ms var(--ease-out);
}
.verdict span { display: grid; flex: none; }
.verdict.is-ok { background: color-mix(in srgb, var(--win) 14%, transparent); color: #b6ffd9; }
.verdict.is-bad { background: color-mix(in srgb, var(--loss) 14%, transparent); color: #ffc2cb; }

.verify-result--grid { grid-template-columns: auto 1fr; align-items: start; }
.mini-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 26px);
  gap: 4px;
}
.mini-cell {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-2);
}
.mini-cell .sprite { width: 18px; height: 18px; }
.mini-cell.is-good { opacity: 0.45; }
.mini-cell.is-bad { background: color-mix(in srgb, var(--loss) 18%, var(--bg-2)); }
.mini-cell.is-picked { opacity: 1; box-shadow: inset 0 0 0 2px var(--accent); }
.mini-cell--num { font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-3); }
.mini-cell--num.is-picked { color: var(--text); box-shadow: inset 0 0 0 2px #8f6bff; }
.mini-cell--num.is-drawn { background: color-mix(in srgb, var(--loss) 18%, var(--bg-2)); color: var(--loss); }
.mini-cell--num.is-hit { background: var(--win); color: var(--win-ink); box-shadow: none; }

.verify-result--stack { grid-template-columns: 1fr; }
.mini-cards { display: inline-flex; gap: 3px; vertical-align: middle; }
.mini-card { display: inline-block; width: 26px; }
.mini-card .card-svg { width: 100%; height: auto; display: block; }

/* ---------- Fairness modal ---------- */

.fairness { display: grid; gap: 14px; }
.fairness__skeleton { height: 240px; }
.fairness__intro { color: var(--text-2); font-size: 13.5px; }
/* The owner's test switch: set apart, so it never reads as part of what players see. */
.fairness__owner { display: grid; gap: 10px; padding: 12px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.fairness__owner-seed { display: grid; gap: 8px; }
.fairness__owner-seed:empty { display: none; }
.seed-list { display: grid; gap: 8px; }
.seed {
  border-radius: var(--radius-m);
  background: var(--bg-2);
}
.seed summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.seed summary::-webkit-details-marker { display: none; }
.seed[open] { padding-bottom: 12px; }
.seed[open] > .field { padding: 0 14px; margin-top: 8px; }
.seed__meta { color: var(--text-3); font-size: 12px; font-weight: 600; }

/* ---------- Page header ---------- */

.page__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.page__head h1 { font-size: 28px; font-weight: 800; }
.page__head p { color: var(--text-2); margin-top: 4px; }
.page__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--bg-2);
  color: var(--accent);
  flex: none;
}

/* ---------- Verifier ---------- */

.verify__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.verify__panel { padding: 22px; }
.verify-form { display: grid; gap: 14px; }
.verify__title { font-size: 16px; margin-bottom: 14px; }
.verify-output { display: grid; gap: 14px; }
.floats summary { cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13px; }
.floats ol { margin: 10px 0 0; padding-left: 26px; color: var(--text-2); }
.verify__steps {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 24px;
  border-radius: var(--radius-l);
  box-shadow: inset 0 0 0 1px var(--line);
}
.verify__steps h2 { font-size: 17px; }
.verify__steps ol {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.verify__steps li {
  position: relative;
  padding-top: 40px;
  color: var(--text-2);
  font-size: 13.5px;
  counter-increment: step;
}
.verify__steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
}
.verify__steps strong { color: var(--text); }

/* ---------- History ---------- */

.history__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text-2);
  font-weight: 650;
  transition: background-color 140ms, color 140ms;
}
.chip-filter span { display: grid; }
.chip-filter:hover { background: var(--bg-3); color: var(--text); }
.chip-filter[aria-pressed="true"] { background: var(--text); color: var(--bg-0); }
.history__more { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- Coming soon ---------- */

.soon {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 40px;
  border-radius: 24px;
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.soon__art { border-radius: 20px; overflow: hidden; aspect-ratio: 3 / 4; box-shadow: var(--shadow-3); }
.soon__art .art { width: 100%; height: 100%; }
.soon h1 { font-size: 36px; font-weight: 900; margin: 12px 0 10px; }
.soon p { color: var(--text-2); max-width: 460px; margin-bottom: 24px; }

@media (max-width: 900px) {
  .verify__grid { grid-template-columns: 1fr; }
  .verify__steps ol { grid-template-columns: 1fr 1fr; }
  .soon { grid-template-columns: 1fr; padding: 24px; }
  .soon__art { max-width: 220px; }
}
@media (max-width: 520px) {
  .grid-2, .verify__steps ol { grid-template-columns: 1fr; }
  .bet-detail__summary { grid-template-columns: 1fr; }
}

/* ---------- A members page seen by a visitor (app.mjs → renderGate) ---------- */

.gate {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(520px, 100%);
  margin: 8vh auto 0;
  padding: 40px 32px 36px;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: center;
  animation: rise-in 400ms var(--ease-out);
}
.gate__icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 20px; background: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); color: var(--accent); }
.gate h1 { font-size: 28px; font-weight: 800; }
.gate p { max-width: 40ch; color: var(--text-2); }
.gate__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }

/* /css/account.css */
/* Account pages: sign-in extras, recovery states, settings, legal documents. */

/* ---------- Danger buttons ---------- */

.btn--danger {
  --btn-bg: var(--loss);
  --btn-bg-hover: color-mix(in srgb, var(--loss) 86%, white);
  --btn-fg: #fff;
  font-weight: 700;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 6px 20px color-mix(in srgb, var(--loss) 26%, transparent);
}
.btn--danger-ghost {
  --btn-bg: transparent;
  --btn-bg-hover: color-mix(in srgb, var(--loss) 14%, transparent);
  --btn-fg: #ff8a99;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--loss) 45%, transparent);
}
.badge--ok { background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win); }

/* ---------- Sign-in extras ---------- */

.auth__forgot {
  justify-self: end;
  margin-top: 2px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}
.auth__forgot:hover { color: var(--accent); }
.auth__forgot[hidden] { display: none; }
.auth__privacy { margin-top: 4px; }
.auth__privacy a, .check a, .auth__legal a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.auth__privacy a:hover, .check a:hover, .auth__legal a:hover { color: var(--accent); text-decoration-color: currentColor; }
.auth__fine { display: grid; gap: 8px; }
.auth__legal { display: flex; justify-content: center; gap: 8px; }
.auth__aside { margin-top: 14px; text-align: center; }

/* ---------- Recovery states ---------- */

.auth-state { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 8px 0; }
.auth-state__icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 6px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--win) 14%, var(--bg-2));
  color: var(--win);
  animation: state-pop 520ms var(--ease-spring);
}
.auth-state__icon .icon { width: 30px; height: 30px; }
.auth-state.is-bad .auth-state__icon { background: color-mix(in srgb, var(--loss) 14%, var(--bg-2)); color: var(--loss); }
.auth-state.is-wait .auth-state__icon { background: var(--bg-2); color: var(--text-2); animation: state-wait 1.2s ease-in-out infinite alternate; }
.auth-state__text { color: var(--text-2); max-width: 36ch; }
.auth-state__actions { display: grid; gap: 10px; width: 100%; margin-top: 14px; }
@keyframes state-pop { from { transform: scale(0.5) rotate(-12deg); opacity: 0; } }
@keyframes state-wait { to { transform: translateY(-4px); opacity: 0.7; } }

.recovery-page { display: grid; place-items: center; min-height: 60vh; }
.suspended__reason {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--loss) 10%, var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--loss) 30%, transparent);
  text-align: left;
}
.suspended__reason span { color: var(--text-3); font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.suspended__reason p { margin-top: 4px; color: var(--text); }
.auth-state a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.recovery-page__card { width: min(460px, 100%); padding: 32px 28px; }

/* ---------- Settings ---------- */

.settings__grid { display: grid; gap: 16px; max-width: 760px; }
.settings__card { display: grid; gap: 18px; padding: 22px 24px; }
.settings__card.is-danger { box-shadow: var(--shadow-1), inset 0 0 0 1px color-mix(in srgb, var(--loss) 30%, transparent); }
.settings__head { display: flex; gap: 14px; align-items: flex-start; }
.settings__head h2 { font-size: 17px; font-weight: 800; }
.settings__head p { margin-top: 3px; color: var(--text-2); font-size: 13.5px; max-width: 60ch; }
.settings__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--text-2);
}
.settings__card.is-danger .settings__icon { background: color-mix(in srgb, var(--loss) 14%, var(--bg-2)); color: var(--loss); }

.settings__who { grid-template-columns: auto 1fr; align-items: center; gap: 16px; }
.settings__who h2 { font-size: 20px; font-weight: 800; }
.settings__who span { color: var(--text-3); font-size: 13px; }

.settings__body { display: grid; gap: 14px; }
.settings__skeleton { height: 44px; }
.settings__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.settings__value { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.settings__value strong { overflow-wrap: anywhere; }
.settings__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.settings__actions.is-start { justify-content: flex-start; }
.settings__pending {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--info) 10%, var(--bg-2));
  color: var(--text-2);
  font-size: 13.5px;
}
.settings__pending > span { color: var(--info); margin-top: 2px; }
.settings__pending strong { color: var(--text); overflow-wrap: anywhere; }
.settings__pending .settings__actions { grid-column: 1 / -1; }
.settings__form { display: grid; gap: 14px; }
/* The code step: its field takes the six digits spaced out, and "Send a new code" sits under it. */
.settings__form input[autocomplete="one-time-code"] { font-variant-numeric: tabular-nums; letter-spacing: 0.25em; }
.settings__again { justify-self: start; margin-top: 6px; }
.settings__pair { align-items: start; }
.settings__foot { padding-top: 14px; border-top: 1px solid var(--line); }

.settings__danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.settings__danger + .settings__danger { border-top: 1px solid var(--line); }
.settings__danger:first-of-type { padding-top: 0; }
.settings__danger:last-child { padding-bottom: 0; }
.settings__danger p { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.settings__danger .btn { flex: none; }

/* ---------- Danger confirmation ---------- */

.modal--danger .modal__head > span:first-child .icon { color: var(--loss); }
.danger-confirm { display: grid; gap: 14px; }
.danger-confirm__lead { color: var(--text); font-weight: 600; }
.danger-confirm__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--text-2); }
.danger-confirm__list li { display: flex; gap: 8px; align-items: flex-start; }
.danger-confirm__list span { display: grid; flex: none; margin-top: 2px; color: var(--loss); }
.danger-confirm__list.is-kept span { color: var(--win); }

/* ---------- Legal documents ---------- */

.legal { display: grid; gap: 22px; max-width: 72ch; color: var(--text-2); font-size: 14.5px; line-height: 1.65; }
.legal__meta { color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.legal__section { display: grid; gap: 10px; }
.legal__section h2 { color: var(--text); font-size: 16px; font-weight: 800; }
.legal__section h3 { margin-top: 6px; color: var(--text); font-size: 14.5px; font-weight: 750; }
.legal__section ul { display: grid; gap: 8px; margin: 0; padding-left: 20px; }
.legal__section li::marker { color: var(--accent); }
.legal strong { color: var(--text); }
.legal a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.legal__missing { color: #ffb4bf; font-weight: 700; }

.modal--legal { width: min(720px, 100%); }
.legal-page__body { padding: 28px 32px; }

.sidebar__legal { display: flex; gap: 6px; margin-top: 8px; }
.sidebar__legal a { color: var(--text-2); }
.sidebar__legal a:hover { color: var(--text); }

/* ---------- Updated terms gate ---------- */

.terms-update { display: grid; gap: 16px; }
.terms-update > p { color: var(--text-2); }
.terms-update__doc {
  max-height: min(46vh, 420px);
  overflow: auto;
  padding: 18px 20px;
  border-radius: var(--radius-m);
  background: var(--bg-0);
  box-shadow: inset 0 0 0 1px var(--line);
}
.terms-update__doc .legal { font-size: 13.5px; }
.terms-update__actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 600px) {
  .settings__card { padding: 18px; }
  .settings__pair { grid-template-columns: minmax(0, 1fr); }
  .settings__danger { flex-direction: column; align-items: stretch; }
  .legal-page__body { padding: 20px 18px; }
  .terms-update__actions { flex-direction: column-reverse; }
  .terms-update__actions .btn { width: 100%; }
}

/* ---------- Link Discord (#/discord) ---------- */

.discord-link { display: grid; place-items: start center; padding-top: 32px; }
.discord-link__card { width: min(520px, 100%); padding: 32px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.discord-link__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: rgb(88 101 242 / 0.16); color: #8b95ff; }
.discord-link__card h1 { font: 800 26px/1.1 var(--font-display); }
.discord-link__body { display: grid; justify-items: center; gap: 16px; width: 100%; }
.discord-link__text { color: var(--text-2); }
.discord-link__text strong { color: var(--text); }
.discord-link__status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.discord-link__status.is-ok { color: var(--win); }
.discord-link__status.is-bad { color: var(--loss); }
.discord-link__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* /css/shop.css */
/* Crown shop and invite pages. */

/* ---------- Shop ---------- */

.shop__notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--info) 10%, var(--bg-1));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 28%, transparent);
}
.shop__notice-icon { display: grid; color: var(--info); margin-top: 1px; }
.shop__notice p { color: var(--text-2); margin-top: 2px; }
.shop__notice a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.shop__notice a:hover { color: var(--accent); }

.shop__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 16px;
}
/* The card's one column never grows past the card: a long amount shrinks (.pack__amount) instead
   of pushing the buy button out of it. */
.pack {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 6px;
  padding: 18px 18px 20px;
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  text-align: center;
  transition: transform 260ms var(--ease-out);
}
/* The hover shadow lives on its own layer and fades in: a box-shadow that changes size repaints
   the whole card on every frame of the transition. */
.pack::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 20px 40px rgb(0 0 0 / 0.42), inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease-out);
}
.pack--loading { height: 320px; }
.pack.is-tagged { box-shadow: var(--shadow-1), inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
@media (hover: hover) {
  .pack:hover { transform: translateY(-6px); }
}
.pack:hover::after { opacity: 1; }
.pack__tag {
  z-index: 1;
  position: absolute;
  top: -10px;
  left: 50%;
  translate: -50% 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* The art reaches up to the card's top edge and clips there, so dropped coins appear from that edge. */
.pack__visual { width: 100%; margin-top: -18px; padding-top: 18px; overflow: clip; }

/* ---------- The hoard (hoardArt) ----------
   A 300 × 160 box. Every stack spans it from the top down to the coins' common floor (139), and a
   coin is 44 × 19; hoardArt places them in percentages of these. The coins fall in from above the
   card's top edge when the page opens (dropCoins), each squashing around its bottom edge. */
.pack__art { position: relative; display: block; width: 100%; aspect-ratio: 300 / 160; }
.pack__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 50% at 50% 72%,
    rgb(255 197 61 / var(--glow)), rgb(255 197 61 / calc(var(--glow) * 0.35)) 55%, rgb(255 197 61 / 0));
  opacity: 0.75;
  transition: opacity 300ms var(--ease-out);
}
.pack__ground {
  position: absolute;
  top: 81.25%; /* 130 / 160 */
  height: 12.5%; /* 20 / 160 */
  border-radius: 50%;
  background: #000;
  opacity: 0.35;
}
.pack__stack { position: absolute; top: 0; width: 14.667%; height: 86.875%; transform-origin: 50% 100%; } /* 44 / 300, 139 / 160 */
.pack__stack-coin {
  position: absolute;
  left: 0;
  width: 100%;
  height: 13.669%; /* 19 / 139 */
  transform-origin: 50% 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-22 -8 44 19'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff1c1'/%3E%3Cstop offset='0.5' stop-color='%23ffc53d'/%3E%3Cstop offset='1' stop-color='%23d99400'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cellipse cy='3' rx='22' ry='8' fill='%238a5d00'/%3E%3Cellipse rx='22' ry='8' fill='url(%23g)'/%3E%3Cellipse rx='14' ry='4.6' fill='none' stroke='%23b37a00' stroke-width='1.4' opacity='0.7'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* Last coin down: the figure pops and the glow flares once. */
.pack.is-full .pack__amount strong { animation: amount-pop 460ms var(--ease-spring); }
.pack.is-full .pack__glow { animation: glow-flare 800ms var(--ease-out); }
@keyframes amount-pop { 40% { transform: scale(1.14); color: var(--accent); } }
@keyframes glow-flare { 30% { opacity: 1; } }

/* ---------- Hover: the card lifts, the glow brightens and a wave runs across the stacks ---------- */
.pack:hover .pack__glow { opacity: 1; }
.pack:hover .pack__stack { animation: stack-hop 560ms var(--ease-out) calc(var(--s, 0) * 60ms); }
@keyframes stack-hop {
  35% { transform: translateY(-6.475%) scale(1, 1.03); } /* 9 art units up */
  70% { transform: translateY(0.719%) scale(1.02, 0.98); }
}
.pack__name { font-size: 15px; font-weight: 800; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
/* As wide as the card's content and a size container of its own: the figure is 26px, smaller only
   when the card is too narrow for it (five packages side by side on a laptop). */
.pack__amount { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; container-type: inline-size; }
.pack__amount strong { display: inline-block; font-family: var(--font-display); font-size: min(26px, 14cqi); font-weight: 900; text-align: left; }
/* While it counts up, a step per coin, the figure is drawn on its own layer: each step redraws the
   figure alone instead of the whole page around it. */
.pack.is-counting .pack__amount strong { will-change: transform; }
.pack__coin .icon, .pack__coin svg { width: 24px; height: 24px; }
.pack__bonus {
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--win) 16%, transparent);
  color: var(--win);
  font-size: 12px;
  font-weight: 800;
}
.pack__bonus.is-empty { background: var(--bg-3); color: var(--text-3); }
.pack__buy { margin-top: 10px; }
.shop__fine { margin-top: 18px; color: var(--text-3); font-size: 12.5px; text-align: center; }

/* ---------- Invite ---------- */

.invite__body { display: grid; gap: 16px; max-width: 820px; }
.invite__skeleton { height: 220px; }
.invite__hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 24px;
  background:
    radial-gradient(420px 200px at 0% 50%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--bg-1);
}
.invite__reward { display: grid; justify-items: center; padding: 8px 16px; }
.invite__reward strong { font-family: var(--font-display); font-size: 40px; font-weight: 900; color: var(--accent); line-height: 1; }
.invite__reward span { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.invite__link { display: grid; gap: 8px; min-width: 0; }
.invite__link input { width: 100%; }
.invite__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.invite__earned { grid-column: 1 / -1; color: var(--text-2); font-size: 13.5px; padding-top: 14px; border-top: 1px solid var(--line); }
.invite__earned strong { color: var(--text); }

.invite__steps, .invite__list { padding: 22px 24px; display: grid; gap: 16px; }
.invite__steps h2, .invite__list h2 { font-size: 17px; font-weight: 800; }
.invite__steps ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.invite__steps li { display: flex; gap: 12px; align-items: flex-start; }
.invite__steps p { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.invite__step {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--accent);
  font-weight: 800;
}

.invite__friends { display: grid; gap: 2px; }
.invite__friend {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border-radius: var(--radius-m);
}
.invite__friend:hover { background: var(--bg-2); }
.invite__friend strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite__friend div > span { color: var(--text-3); font-size: 12px; }
.invite__checks { display: flex; gap: 10px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.invite__checks > span { display: inline-flex; align-items: center; gap: 4px; }
.invite__checks .is-done { color: var(--win); }
.invite__status { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.invite__status.is-ok { background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win); }
.invite__status.is-wait { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.invite__status.is-off { background: var(--bg-3); color: var(--text-3); }

.auth__invited {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--text-2);
  font-size: 13.5px;
  animation: rise-in 300ms var(--ease-out);
}
.auth__invited > span:first-child { display: grid; color: var(--accent); }
.auth__invited strong { color: var(--text); }

@media (max-width: 700px) {
  .invite__hero { grid-template-columns: minmax(0, 1fr); }
  .invite__friend { grid-template-columns: auto minmax(0, 1fr) auto; }
  .invite__checks { grid-column: 2 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .pack:hover .pack__stack, .pack.is-full .pack__amount strong, .pack.is-full .pack__glow { animation: none; }
}

/* ---------- Buying ---------- */

.modal--buy { width: min(480px, 100%); }
.buy { display: grid; gap: 14px; }
.buy__summary {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 14px 10px 6px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
}
.buy__summary strong { display: block; font-size: 15px; }
.buy__summary span { color: var(--text-2); font-size: 13px; }
.buy__secure { display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; }
.buy .check a, .shop__fine a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Purchases and limits (settings) ---------- */

.spend { display: grid; gap: 6px; }
.spend__head { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; }
.spend__head strong { color: var(--text); }
.spend__bar { height: 6px; border-radius: 99px; background: var(--bg-3); overflow: hidden; }
.spend__bar span { display: block; height: 100%; width: calc(var(--p) * 100%); border-radius: inherit; background: var(--accent); transition: width 400ms var(--ease-out); }
.purchases { display: grid; gap: 2px; }
.purchase { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-m); }
.purchase:hover { background: var(--bg-2); }
.purchase div > span { display: block; color: var(--text-3); font-size: 12px; }
.invite__status.is-bad { background: color-mix(in srgb, var(--loss) 16%, transparent); color: var(--loss); }

/* ---------- Currency switch ---------- */

.shop__head { flex-wrap: wrap; }
.shop__head > div:not(.shop__currency) { flex: 1 1 240px; min-width: 0; }
.shop__currency { margin-left: auto; flex: none; }
.shop__currency button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; font-size: 13px; }
.shop__currency-symbol { color: var(--accent); font-weight: 800; }
.shop__currency button:not([aria-selected="true"]) .shop__currency-symbol { color: inherit; }
@media (max-width: 640px) {
  .shop__currency { margin-left: 0; width: 100%; }
}

/* /css/owner.css */
/* The owner: the gold name and badge everyone sees, the report dialog, and the owner panel. */

/* ---------- The owner's name, wherever it appears ---------- */

.pname { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; }
.pname__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname.is-owner .pname__text {
  background: linear-gradient(90deg, #ffe39a, #ffc53d 38%, #fff4d6 50%, #ffc53d 62%, #e3a52c);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* The shimmer cannot move without the text being drawn again, so it is kept cheap: the name sits
     on a layer of its own (only it is redrawn, not the page around it), and the light moves 20
     times a second, a pixel or two per step, too slow a drift to see the steps. The owner's name
     is on screen wherever they play, often many times at once. */
  animation: owner-name 7s steps(140) infinite;
  will-change: transform;
}
@keyframes owner-name { from { background-position: 110% 0; } to { background-position: -110% 0; } }

.owner-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: 20px;
  padding: 0 8px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff1c1, #ffc53d 45%, #d99400);
  color: #2a1a00;
  font: 800 10px/1 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgb(255 214 107 / 0.35), 0 4px 12px -4px rgb(255 179 0 / 0.6);
  -webkit-text-fill-color: currentColor;
}
.owner-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.8) 50%, transparent 65%);
  translate: -130% 0;
  animation: owner-shine 4.2s var(--ease-in-out) infinite;
}
@keyframes owner-shine { 0%, 60% { translate: -130% 0; } 90%, 100% { translate: 130% 0; } }
.owner-badge.is-compact { width: 20px; padding: 0; justify-content: center; }
.owner-badge__crown { display: grid; }
.owner-badge .icon { width: 12px; height: 12px; stroke-width: 2.2; }

/* Staff: a quiet blue chip with a shield, no animation and nothing on the avatar. */
.staff-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: 20px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--info) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 45%, transparent);
  color: #9fcbff;
  font: 800 10px/1 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  -webkit-text-fill-color: currentColor;
}
.staff-badge.is-compact { width: 20px; padding: 0; justify-content: center; }
.staff-badge__icon { display: grid; }
.staff-badge .icon { width: 12px; height: 12px; stroke-width: 2.2; }

/* In the account menu, whose own rules would make the name a small grey block and the badge
   inherit menu text styles: keep name and badge on one line at their proper sizes. */
.menu__head > div { min-width: 0; }
.menu__head .pname { display: flex; }
.menu__head .pname .pname__text { font-size: 14px; }
.menu__head .pname:not(.is-owner) .pname__text { color: var(--text); }
.menu__head .pname .owner-badge { color: #2a1a00; font-size: 10px; }
.menu__head .pname .staff-badge { color: #9fcbff; font-size: 10px; }
.menu__head .pname .owner-badge span, .menu__head .pname .staff-badge span { color: inherit; font-size: inherit; }

/* A gold ring that turns slowly around the owner's avatar, and a small crown on top. */
.avatar.is-owner {
  position: relative;
  color: #ffd76b;
  background: color-mix(in srgb, #ffc53d 16%, var(--bg-2));
  box-shadow: none;
}
.avatar.is-owner::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(#ffc53d, #fff1c1 25%, #d99400 50%, #fff1c1 75%, #ffc53d);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  animation: owner-ring 6s linear infinite;
}
.avatar.is-owner::after {
  content: "";
  position: absolute;
  top: -22%;
  right: -16%;
  width: 46%;
  aspect-ratio: 1;
  rotate: 22deg;
  background: linear-gradient(135deg, #fff1c1, #ffc53d 55%, #d99400);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 18 1.6 6.5l6 4.6L12 3l4.4 8.1 6-4.6L21 18z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 18 1.6 6.5l6 4.6L12 3l4.4 8.1 6-4.6L21 18z'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.5));
}
@keyframes owner-ring { to { rotate: 360deg; } }

/* The staff's view of the owner's account: what stays private. */
.ow-private { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-radius: var(--radius-m); background: var(--bg-1); box-shadow: inset 0 0 0 1px var(--line); }
.ow-private > span { display: grid; }

/* Leaderboard: a quiet report flag per row, and the owner's row in gold. */
.leader { grid-template-columns: 36px auto minmax(0, 1fr) auto auto 32px; animation-delay: calc(var(--i, 0) * 28ms); }
.leader.is-owner:not(.is-top) { background: linear-gradient(90deg, color-mix(in srgb, #ffc53d 10%, var(--bg-1)), var(--bg-1) 55%); box-shadow: inset 3px 0 0 #ffc53d; }
.leader__report { opacity: 0; transition: opacity 160ms; }
.leader:hover .leader__report, .leader__report:focus-visible { opacity: 1; }
@media (hover: none) { .leader__report { opacity: 0.6; } }
/* rewards.css hides the bet count below 900 px: keep the report flag in its own column there. */
@media (max-width: 900px) { .leader { grid-template-columns: 30px auto minmax(0, 1fr) auto 32px; } }
/* On a phone the figure goes under the name: side by side, the name had room for two letters. */
@media (max-width: 600px) {
  .leader {
    grid-template-columns: 26px auto minmax(0, 1fr) 32px;
    grid-template-areas: "rank avatar name report" "rank avatar value report";
    column-gap: 12px;
    row-gap: 1px;
    padding: 10px 12px;
  }
  .leader__rank { grid-area: rank; }
  .leader > :nth-child(2) { grid-area: avatar; }
  .leader > .pname { grid-area: name; }
  .leader__value { grid-area: value; min-width: 0; text-align: left; color: var(--text-2); font-size: 13px; }
  .leader__report { grid-area: report; }
}

.nav__link--owner { color: #ffd76b; background: linear-gradient(90deg, color-mix(in srgb, #ffc53d 12%, transparent), transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffc53d 22%, transparent); margin-bottom: 6px; }
.nav__link--owner:hover, .nav__link--owner.is-active { color: #fff1c1; background: color-mix(in srgb, #ffc53d 16%, var(--bg-2)); }

.sidebar__report {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: -4px 0 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--bg-3);
  color: var(--text-2);
  font: 650 12.5px var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms, color 140ms;
}
.sidebar__report span { display: grid; }
.sidebar__report:hover { background: var(--bg-4); color: var(--text); }

/* ---------- Report dialog ---------- */

.modal--report { width: min(540px, 100%); }
.report { display: grid; gap: 16px; }
.report__kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.report__kind {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms, box-shadow 180ms, transform 180ms var(--ease-out);
}
.report__kind:hover { background: var(--bg-3); }
.report__kind:active { transform: scale(0.98); }
.report__kind strong { display: block; color: var(--text); font-size: 15px; }
.report__kind small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12.5px; line-height: 1.4; }
.report__kind-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--bg-3); color: var(--text-2); transition: background-color 180ms, color 180ms; }
.report__kind.is-on { background: color-mix(in srgb, var(--accent) 8%, var(--bg-2)); box-shadow: inset 0 0 0 2px var(--accent); }
.report__kind.is-on .report__kind-icon { background: var(--accent); color: var(--accent-ink); }
.report__part { display: grid; gap: 10px; animation: rise-in 260ms var(--ease-out); }
.report__part[hidden] { display: none; }
.report__pills { display: flex; flex-wrap: wrap; gap: 6px; }
.report__pills .chip-filter { height: 32px; padding: 0 12px; font-size: 13px; }
.report__message {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-0);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  transition: border-color 140ms;
}
.report__message:hover { border-color: var(--line-strong); }
.report__message:focus { outline: 0; border-color: var(--info); }
.report__message.is-invalid { border-color: var(--loss); }
.report__message::placeholder { color: var(--text-3); }
.report__meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-top: 6px; }
.report__counter { margin-left: auto; color: var(--text-3); font-size: 12px; }
.report__hint { margin-top: -6px; }
.report__done { display: grid; justify-items: center; gap: 8px; padding: 28px 8px 16px; text-align: center; animation: rise-in 320ms var(--ease-out); }
.report__done strong { font-size: 18px; }
.report__done p { max-width: 36ch; color: var(--text-2); }
.report__done-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win); animation: ow-pop 520ms var(--ease-spring); }
.report__done-icon .icon { width: 28px; height: 28px; stroke-width: 2.4; }

/* ---------- Owner panel ---------- */

.ow {
  --ow-in: #bd851c;   /* Crowns into the treasury. Checked against --ow-out for colour-blind separation. */
  --ow-out: #3f8ae0;  /* Crowns out of the treasury. */
  display: grid;
  gap: 18px;
}

@keyframes ow-rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes ow-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes ow-pop { from { opacity: 0; scale: 0.4; } }
@keyframes ow-draw { to { stroke-dashoffset: 0; } }
@keyframes ow-wash { to { opacity: 0.1; } }
@keyframes ow-grow { from { transform: scaleY(0); } }
@keyframes ow-fill { from { transform: scaleX(0); } }
@keyframes ow-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--win) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

.ow-rise { animation: ow-rise 620ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
.is-refreshing { opacity: 0.55; transition: opacity 200ms; }
.ow-view { display: grid; gap: 16px; min-width: 0; transition: opacity 200ms; }
.ow-view.is-switching > * { animation: ow-in 320ms var(--ease-out); }
.ow-skeleton { height: 420px; border-radius: var(--radius-l); }

/* Head: the one glow on this page sits behind the crest. */
.ow-head { display: flex; align-items: center; gap: 18px; }
.ow-head__crest {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(145deg, #3a2a08, #1c1404);
  color: #ffd76b;
  box-shadow: inset 0 0 0 1px rgb(255 214 107 / 0.3), 0 10px 40px -8px rgb(255 179 0 / 0.45);
}
.ow-head__crest .icon { width: 32px; height: 32px; }
.ow-head__eyebrow { color: #ffd76b; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.ow-head h1 { margin-top: 2px; font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
.ow-head__lead { margin-top: 4px; color: var(--text-2); }

/* Tabs with a sliding underline */
.ow-tabs { position: relative; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.ow-tabs::-webkit-scrollbar { display: none; }
.ow-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--text-2);
  font: 650 14px var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms;
}
.ow-tab span:first-child { display: grid; }
.ow-tab:hover, .ow-tab.is-on { color: var(--text); }
.ow-tab__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; animation: ow-pop 360ms var(--ease-spring); }
.ow-tabs__ink {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: var(--w, 0);
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  translate: var(--x, 0) 0;
  transition: translate 380ms var(--ease-out), width 380ms var(--ease-out);
}

/* Filters: one row above everything they scope */
.ow-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ow-toolbar[hidden] { display: none; }
.ow-range { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-2); }
.ow-range__option { height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--text-2); font: 650 13px var(--font-ui); cursor: pointer; transition: background-color 160ms, color 160ms; }
.ow-range__option:hover { color: var(--text); }
.ow-range__option[aria-pressed="true"] { background: var(--text); color: var(--bg-0); }
.ow-live { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--text-3); font-size: 12.5px; }
.ow-live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--win); animation: ow-pulse 2s ease-out infinite; }

/* Cards */
.ow-card { display: grid; gap: 14px; min-width: 0; padding: 20px; border-radius: var(--radius-l); background: var(--bg-1); box-shadow: inset 0 0 0 1px var(--line); }
.ow-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px; }
.ow-card__head > div:first-child { flex: 1 1 260px; }
.ow-card__head h3 { font-size: 16px; font-weight: 800; }
.ow-card__head p { margin-top: 2px; color: var(--text-3); font-size: 13px; }
.ow-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ow-empty { color: var(--text-3); font-size: 13.5px; }
.ow-empty-state { display: grid; justify-items: center; gap: 10px; padding: 48px 16px; color: var(--text-3); text-align: center; }
.ow-muted { color: var(--text-3); }
.is-gain { color: var(--win); }
.is-drain { color: var(--loss); }

/* Hero: the treasury */
.ow-hero { grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.6fr); align-items: center; gap: 24px; padding: 24px; }
.ow-hero__label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 700; }
.ow-hero__label span { display: grid; color: #ffd76b; }
.ow-hero__line { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.ow-hero__value { font: 700 clamp(40px, 5vw, 56px)/1 var(--font-ui); letter-spacing: -0.02em; }
.ow-hero__unit { color: var(--text-3); font-weight: 650; }
.ow-hero__note { margin-top: 12px; color: var(--text-3); font-size: 12.5px; line-height: 1.5; max-width: 42ch; }
.ow-hero__chart { min-width: 0; }
.ow-delta { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 10px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); font-size: 13px; font-weight: 700; }
.ow-delta__arrow { display: grid; transition: rotate 300ms; }
.ow-delta.is-up { background: color-mix(in srgb, var(--win) 14%, transparent); color: var(--win); }
.ow-delta.is-up .ow-delta__arrow { rotate: -45deg; }
.ow-delta.is-down { background: color-mix(in srgb, var(--loss) 14%, transparent); color: var(--loss); }
.ow-delta.is-down .ow-delta__arrow { rotate: 45deg; }

/* KPI row */
.ow-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ow-kpi { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--radius-l); background: var(--bg-1); box-shadow: inset 0 0 0 1px var(--line); }
.ow-kpi__label { color: var(--text-2); font-size: 12.5px; font-weight: 650; }
.ow-kpi__value { font: 700 26px/1.1 var(--font-ui); }
.ow-kpi__sub { color: var(--text-3); font-size: 12px; }

/* Charts */
.ow-chart { position: relative; height: var(--h); }
.ow-chart svg { display: block; overflow: visible; }
.ow-gridline { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.ow-zero { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.ow-axis { fill: var(--text-3); font: 500 11px var(--font-ui); font-variant-numeric: tabular-nums; }
.ow-line { fill: none; stroke: var(--ow-in); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: ow-draw 1300ms var(--ease-out) 250ms forwards; }
.ow-area { fill: var(--ow-in); opacity: 0; animation: ow-wash 900ms ease-out 800ms forwards; }
.ow-end { fill: var(--ow-in); stroke: var(--bg-1); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ow-pop 420ms var(--ease-spring) 1300ms both; }
.ow-cross { stroke: var(--text-3); stroke-width: 1; shape-rendering: crispEdges; }
.ow-dot { fill: var(--ow-in); stroke: var(--bg-1); stroke-width: 2; }
.ow-hit { fill: transparent; cursor: crosshair; outline: none; }
.ow-bar { transform-box: fill-box; animation: ow-grow 700ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 16ms + 150ms); transition: filter 140ms; }
.ow-bar.is-in { fill: var(--ow-in); transform-origin: 50% 100%; }
.ow-bar.is-out { fill: var(--ow-out); transform-origin: 50% 0; }
.ow-col { outline: none; }
.ow-col__hit { fill: transparent; }
.ow-col:hover .ow-bar, .ow-col:focus .ow-bar { filter: brightness(1.3); }
.ow-col:focus-visible .ow-col__hit { fill: rgb(255 255 255 / 0.05); }
/* Redraws (resize, refresh) show the final state at once. */
.is-static .ow-line { animation: none; stroke-dashoffset: 0; }
.is-static .ow-area { animation: none; opacity: 0.1; }
.is-static .ow-end, .is-static .ow-bar, .is-static .ow-bars__fill, .is-static .ow-rtp__mark { animation: none; }

.ow-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-3);
  box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line-strong);
  color: var(--text-2);
  font-size: 12px;
  pointer-events: none;
  translate: var(--x, 0) var(--y, 0);
}
.ow-tip strong { color: var(--text); font-size: 15px; font-weight: 700; }
.ow-tip__row { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--text); font-weight: 600; }
.ow-tip__sub { padding-left: 18px; color: var(--text-3); }
.ow-key { flex: none; width: 12px; height: 2px; border-radius: 1px; }
.ow-key.is-in { background: var(--ow-in); }
.ow-key.is-out { background: var(--ow-out); }
.ow-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); font-size: 12.5px; }
.ow-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ow-swatch { width: 10px; height: 10px; border-radius: 2px; }
.ow-swatch.is-in { background: var(--ow-in); }
.ow-swatch.is-out { background: var(--ow-out); }
.ow-toggle { margin-left: auto; }
.ow-toggle span { display: grid; }
.ow-chart-body { min-width: 0; }

/* Tables */
.ow-table-wrap { overflow-x: auto; margin: 0 -4px; }
.ow-table { min-width: 560px; }
.ow-table td.num, .ow-table .num { font-variant-numeric: tabular-nums; }
.ow-rtp { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.ow-rtp__meter { position: relative; width: 70px; height: 6px; border-radius: 3px; background: var(--bg-3); }
.ow-rtp__target { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.ow-rtp__mark { position: absolute; top: -2px; left: calc(50% + var(--o, 0) * 50%); width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 2px var(--bg-1); animation: ow-pop 420ms var(--ease-spring) 400ms both; }
.ow-rtp__goal { color: var(--text-3); font-size: 12px; }

/* Horizontal bars (given out) */
.ow-bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ow-bars li { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 1.4fr) auto; align-items: center; gap: 12px; font-size: 13px; }
.ow-bars__label { color: var(--text-2); }
.ow-bars__track { height: 8px; }
.ow-bars__fill { display: block; height: 100%; width: calc(var(--w, 0) * 100%); min-width: 2px; border-radius: 0 4px 4px 0; transform-origin: left; animation: ow-fill 800ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms + 200ms); }
.ow-bars__fill.is-out { background: var(--ow-out); }
.ow-bars__fill.is-in { background: var(--ow-in); }
.ow-bars__value { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.ow-verdict { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-m); background: var(--bg-2); font-size: 13px; line-height: 1.5; }
.ow-verdict span { display: grid; margin-top: 2px; }

/* Books */
.ow-books { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; }
.ow-books__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; }
.ow-books.is-ok .ow-books__icon { background: color-mix(in srgb, var(--win) 14%, transparent); color: var(--win); }
.ow-books.is-bad { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--loss) 50%, transparent); }
.ow-books.is-bad .ow-books__icon { background: color-mix(in srgb, var(--loss) 14%, transparent); color: var(--loss); }
.ow-books h3 { font-size: 16px; font-weight: 800; }
.ow-books p { margin-top: 4px; color: var(--text-2); font-size: 13px; line-height: 1.55; }

/* Timeline of actions */
.ow-timeline { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ow-timeline li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; font-size: 13px; }
.ow-timeline__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--bg-3); color: var(--text-2); }
.ow-timeline__icon.is-credit, .ow-timeline__icon.is-unban { color: var(--win); }
.ow-timeline__icon.is-debit, .ow-timeline__icon.is-ban { color: var(--loss); }
.ow-timeline__icon.is-grant, .ow-timeline__icon.is-revoke { color: #ffd76b; }
.ow-timeline__detail { color: var(--text-2); word-break: break-word; }
.ow-timeline__meta { color: var(--text-3); font-size: 12px; }

/* Reports */
.ow-filter-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.ow-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ow-count { min-width: 18px; padding: 0 5px; border-radius: 999px; background: rgb(255 255 255 / 0.12); font-size: 11px; line-height: 18px; text-align: center; }
.chip-filter[aria-pressed="true"] .ow-count { background: rgb(0 0 0 / 0.14); }
.ow-reports { display: grid; gap: 8px; transition: opacity 200ms; }
.ow-report {
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px var(--line);
  animation: ow-rise 460ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition: box-shadow 200ms, opacity 260ms, translate 260ms var(--ease-out), height 360ms var(--ease-out) 120ms;
}
.ow-report.is-open { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-2); }
.ow-report.is-leaving { opacity: 0; translate: 24px 0; }
.ow-report__summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ow-report__summary:hover { background: rgb(255 255 255 / 0.02); }
.ow-report__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; }
.ow-report__icon.is-player { background: color-mix(in srgb, var(--loss) 14%, transparent); color: #ff8a9a; }
.ow-report__icon.is-bug { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.ow-report__heading { min-width: 0; }
.ow-report__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ow-report__title span { color: var(--text-2); }
.ow-report__meta { margin-top: 2px; color: var(--text-3); font-size: 12.5px; }
.ow-report__chevron { display: grid; color: var(--text-3); transition: rotate 300ms var(--ease-out); }
.ow-report.is-open .ow-report__chevron { rotate: 180deg; }
.ow-report__details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 380ms var(--ease-out); }
.ow-report.is-open .ow-report__details { grid-template-rows: 1fr; }
.ow-report__inner { display: grid; gap: 14px; min-height: 0; overflow: hidden; padding: 0 16px 0 68px; }
.ow-report__message { padding: 12px 14px; border-radius: var(--radius-m); background: var(--bg-2); color: var(--text); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ow-report__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 16px; margin: 0; font-size: 12.5px; }
.ow-report__facts dt { color: var(--text-3); }
.ow-report__facts dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.ow-report__client { font-size: 11.5px; }
.ow-report__people { display: flex; flex-wrap: wrap; gap: 8px; }
.ow-report__note { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.ow-report__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; }
.ow-note, .ow-input {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-0);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
  transition: border-color 140ms;
}
.ow-note:focus, .ow-input:focus { outline: 0; border-color: var(--info); }
.ow-note::placeholder, .ow-input::placeholder { color: var(--text-3); }
.ow-link { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--bg-2); color: var(--text-2); font: 650 12.5px var(--font-ui); cursor: pointer; transition: background-color 140ms, color 140ms; }
.ow-link span { display: grid; }
.ow-link:hover { background: var(--bg-3); color: var(--text); }
.ow-status { flex: none; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap; transition: background-color 200ms, color 200ms; }
.ow-status.is-open { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.ow-status.is-reviewing { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
.ow-status.is-resolved { background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win); }
.ow-status.is-dismissed { background: var(--bg-3); color: var(--text-3); }

/* Players */
.ow-players { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ow-players__list { position: sticky; top: calc(var(--topbar-h) + 16px); display: grid; gap: 10px; padding: 14px; border-radius: var(--radius-l); background: var(--bg-1); box-shadow: inset 0 0 0 1px var(--line); }
.ow-search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 2px solid var(--line); border-radius: var(--radius-m); background: var(--bg-0); color: var(--text-3); transition: border-color 140ms; }
.ow-search:focus-within { border-color: var(--info); }
.ow-search span { display: grid; }
.ow-search__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 600 14px var(--font-ui); }
.ow-results { display: grid; gap: 2px; max-height: 60vh; margin: 0; padding: 0; overflow-y: auto; list-style: none; transition: opacity 200ms; }
.ow-results li { animation: ow-in 300ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 25ms); }
.ow-result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: var(--radius-m); background: none; color: inherit; text-align: left; cursor: pointer; transition: background-color 140ms; }
.ow-result:hover { background: var(--bg-2); }
.ow-result.is-on { background: var(--bg-3); box-shadow: inset 2px 0 0 var(--accent); }
.ow-result__main { display: grid; min-width: 0; font-weight: 650; }
.ow-result__sub { color: var(--text-3); font-size: 12px; font-weight: 500; }
.ow-result__balance { color: var(--text-2); font-size: 12.5px; }
.ow-player { display: grid; gap: 14px; min-width: 0; transition: opacity 200ms; }
.ow-player > .ow-empty-state { border-radius: var(--radius-l); background: var(--bg-1); box-shadow: inset 0 0 0 1px var(--line); }
.ow-player__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 20px; border-radius: var(--radius-l); background: var(--bg-1); box-shadow: inset 0 0 0 1px var(--line); }
.ow-player__who { min-width: 0; }
.ow-player__who h3 { font-size: 20px; font-weight: 800; }
.ow-player__who p { margin-top: 4px; font-size: 13px; overflow-wrap: anywhere; }
.ow-player__money { text-align: right; }
.ow-player__money .ow-hero__line { justify-content: flex-end; margin-top: 2px; }
.ow-player__balance { font: 700 30px/1 var(--font-ui); }
.ow-suspended { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px !important; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--loss) 14%, transparent); color: #ff8a9a; font-weight: 650; }
.ow-suspended span { display: grid; }
.ow-suspended.is-muted { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }
.ow-player__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ow-player__actions .btn span { display: grid; }
.ow .btn--danger, .modal .btn--danger { background: color-mix(in srgb, var(--loss) 18%, var(--bg-3)); color: #ffc2cb; }
.ow .btn--danger:hover { background: color-mix(in srgb, var(--loss) 28%, var(--bg-3)); }
.ow-player__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.ow-player__stats div { padding: 12px 14px; border-radius: var(--radius-m); background: var(--bg-1); box-shadow: inset 0 0 0 1px var(--line); }
.ow-player__stats dt { color: var(--text-3); font-size: 12px; }
.ow-player__stats dd { margin: 4px 0 0; font-weight: 700; }
.ow-ledger td { white-space: nowrap; }

/* Command sheet */
.modal--command { width: min(460px, 100%); }
.ow-command { display: grid; gap: 14px; }
.ow-command__who { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-m); background: var(--bg-2); }
.ow-command__who div { display: grid; min-width: 0; }
.ow-command__who .num { color: var(--text-2); font-size: 13px; }
.ow-field { display: grid; gap: 6px; }
.ow-field > span { color: var(--text-2); font-size: 13px; font-weight: 650; }
.ow-amount { display: flex; gap: 8px; }
.ow-amount .ow-input { flex: 1; font-size: 16px; font-weight: 700; }
.ow-amount .ow-input:disabled { opacity: 0.5; }
.ow-preview { min-height: 20px; color: var(--text-2); font-size: 13px; }
.ow-preview.is-bad { color: var(--loss); }
.ow-command__fine { color: var(--text-3); font-size: 12px; text-align: center; }

/* Hold to confirm: the fill runs for as long as the button must be held. */
.hold { position: relative; overflow: hidden; isolation: isolate; user-select: none; touch-action: none; }
.hold__fill { position: absolute; inset: 0; z-index: -1; background: rgb(255 255 255 / 0.3); transform-origin: left; scale: 0 1; transition: scale 200ms var(--ease-out); }
.hold.is-holding .hold__fill { scale: 1 1; transition: scale 900ms linear; }
.hold__label { position: relative; }
.hold--danger { background: var(--loss); color: #fff; }
.hold--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--loss) 88%, #fff); }

/* Log */
.ow-action { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.ow-action span { display: grid; color: var(--text-3); }
.ow-action.is-credit span, .ow-action.is-unban span { color: var(--win); }
.ow-action.is-debit span, .ow-action.is-ban span { color: var(--loss); }
.ow-action.is-grant span, .ow-action.is-revoke span { color: #ffd76b; }
.ow-log__detail { min-width: 220px; max-width: 420px; color: var(--text-2); white-space: normal; overflow-wrap: anywhere; }
.ow-table td:first-child, .ow-table td:last-child { white-space: nowrap; }
.ow-source { padding: 3px 9px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ow-source.is-panel { background: color-mix(in srgb, #ffc53d 14%, transparent); color: #ffd76b; }

@media (max-width: 1100px) {
  .ow-grid { grid-template-columns: minmax(0, 1fr); }
  .ow-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .ow-players { grid-template-columns: minmax(0, 1fr); }
  .ow-players__list { position: static; }
  .ow-results { max-height: 280px; }
}
@media (max-width: 600px) {
  .ow-head__crest { width: 52px; height: 52px; border-radius: 16px; }
  .ow-live { margin-left: 0; }
  .ow-card, .ow-hero { padding: 16px; }
  .ow-report__inner { padding-left: 16px; }
  .ow-report__summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ow-report__chevron { display: none; }
  .ow-player__head { grid-template-columns: auto minmax(0, 1fr); }
  .ow-player__money { grid-column: 1 / -1; text-align: left; }
  .ow-player__money .ow-hero__line { justify-content: flex-start; }
  .report__kinds { grid-template-columns: minmax(0, 1fr); }
  .ow-bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .ow-bars__track { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .pname.is-owner .pname__text, .owner-badge::after, .avatar.is-owner::before, .ow-live__dot { animation: none; }
  .ow-rise, .ow-view.is-switching > *, .ow-report, .ow-results li, .ow-bar, .ow-bars__fill, .ow-end, .ow-rtp__mark, .report__part, .report__done, .report__done-icon, .ow-tab__count { animation: none; }
  .ow-line { animation: none; stroke-dashoffset: 0; }
  .ow-area { animation: none; opacity: 0.1; }
  .ow-tabs__ink, .ow-report__details, .ow-report { transition: none; }
}

/* /css/chat.css */
/* Live chat. Wide screens: a third column that opens beside the page. Laptops: a panel that slides
   over the page. Phones: a full-screen sheet. The top-bar button always shows who is online. */

:root { --chat-w: 340px; }

/* ---------- Top-bar button ---------- */

.chat-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 12px;
  font-weight: 700;
}
.chat-toggle__icon { display: grid; }
.chat-toggle__dot, .chat__live {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--win);
}
.chat-toggle__dot::after, .chat__live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--win) 55%, transparent);
  animation: chat-pulse 2.4s ease-out infinite;
}
.chat-toggle__count { color: var(--text-2); font-size: 13px; }
.chat-toggle[aria-expanded="true"] { background: var(--bg-3); }
.chat-toggle__unread {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-1);
  animation: chat-pop 320ms var(--ease-spring);
}
.chat-toggle.has-mention .chat-toggle__unread { background: var(--info); color: #fff; }
/* The ring grows from the dot to 6px around it (7px → 19px) while it fades. */
@keyframes chat-pulse { 0% { transform: scale(1); opacity: 1; } 70%, 100% { transform: scale(2.7); opacity: 0; } }
@keyframes chat-pop { from { scale: 0.3; opacity: 0; } }

/* ---------- Placement ---------- */

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-1);
  box-shadow: -1px 0 0 var(--line);
}
/* Children keep the panel's full width while its column opens, so nothing reflows mid-animation.
   The rain card has side margins, so its own minimum is narrower by them. */
.chat > * { min-width: min(var(--chat-w), 100vw); }
.chat > .rain { min-width: calc(min(var(--chat-w), 100vw) - 20px); }
/* A closed chat is not rendered at all: out of sight, its live dot and its messages still cost the
   browser work on every frame of every page. It goes once the closing animation has played and
   comes back the moment it opens. */
.shell:not(.is-chat-open) .chat { content-visibility: hidden; }

@media (min-width: 1600px) {
  .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 0px;
    grid-template-areas: "side top chat" "side main chat";
  }
  .shell.is-chat-open { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--chat-w); }
  .chat {
    grid-area: chat;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow: hidden;
    z-index: 25;
    transition: content-visibility 0s linear 280ms allow-discrete;
  }
  .shell.is-chat-open .chat { transition: content-visibility 0s allow-discrete; }
}
@media (max-width: 1599px) {
  .chat {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    width: min(var(--chat-w), 100vw);
    z-index: 25;
    translate: 100% 0;
    visibility: hidden;
    transition: translate 340ms var(--ease-out), visibility 0s linear 340ms, box-shadow 340ms,
      content-visibility 0s linear 340ms allow-discrete;
  }
  .shell.is-chat-open .chat {
    translate: 0 0;
    visibility: visible;
    box-shadow: -1px 0 0 var(--line), var(--shadow-3);
    transition: translate 340ms var(--ease-out), visibility 0s, box-shadow 340ms, content-visibility 0s allow-discrete;
  }
}
@media (max-width: 900px) {
  /* Pinned to both edges: 100vw would include the scrollbar and push the sheet off to the left. */
  .chat { top: 0; left: 0; right: 0; width: auto; z-index: 70; }
  .chat > *, .chat > .rain { min-width: 0; }
  .chat-toggle { padding: 0 10px; }
}
@media (max-width: 420px) {
  .chat-toggle__count { display: none; }
}
/* The smallest phones: the live dot sits on the icon's corner, and the button is just the icon. */
@media (max-width: 360px) {
  .chat-toggle { width: 40px; padding: 0; justify-content: center; }
  .chat-toggle__dot { position: absolute; top: 9px; right: 8px; }
}

/* ---------- Head ---------- */

.chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
  height: var(--topbar-h);
  padding: 0 10px 0 16px;
  box-shadow: 0 1px 0 var(--line);
}
.chat__title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.chat__title strong { font-size: 15px; font-weight: 800; }
.chat__online { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.chat__status { color: var(--text-3); font-size: 12px; }

/* ---------- Messages ---------- */

.chat__body { position: relative; flex: 1; min-height: 0; display: flex; }
.chat__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 24px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  animation: chat-in 320ms var(--ease-out);
}
.chat__empty[hidden] { display: none; }
.chat__empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 14px; background: var(--bg-2); color: var(--text-2); }
.chat__empty strong { color: var(--text-2); font-size: 14px; }
.chat__empty p { max-width: 26ch; line-height: 1.45; }
.chat__list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 8px 8px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: thin;
}
.chat-msg {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-m);
  transition: background-color 160ms, opacity 200ms;
}
.chat-msg:hover, .chat-msg.is-selected { background: var(--bg-2); }
.chat-msg.is-new { animation: chat-in 260ms var(--ease-out); }
.chat-msg.is-own.is-new { animation: chat-in-own 300ms var(--ease-spring); }
.chat-msg.is-mention { background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.chat-msg.is-pending { opacity: 0.45; }
.chat-msg.is-removed, .chat-win.is-removed {
  overflow: hidden;
  opacity: 0;
  translate: 16px 0;
  margin-block: 0;
  padding-block: 0;
  transition: height 320ms var(--ease-out) 60ms, opacity 200ms, translate 220ms, padding 320ms 60ms, margin 320ms 60ms;
}
@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes chat-in-own { from { opacity: 0; transform: translateY(10px) scale(0.97); } }

.chat-msg__main { min-width: 0; }
.chat-msg__meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-msg__name { min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font: 700 13px var(--font-ui); cursor: pointer; }
.chat-msg__name:hover .pname__text { text-decoration: underline; text-underline-offset: 2px; }
.chat-msg__time { margin-left: auto; flex: none; color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chat-tier {
  flex: none;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--tier) 16%, transparent);
  color: var(--tier);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chat-msg__quote {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  padding-left: 8px;
  overflow: hidden;
  border-left: 2px solid var(--line-strong);
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chat-msg__quote span { display: grid; flex: none; }
.chat-msg__quote strong { color: var(--text-2); }
.chat-msg__body { margin-top: 2px; color: var(--text); font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.chat-mention { color: var(--info); font-weight: 700; }
.chat-mention.is-me { color: var(--accent); }

.chat-msg__actions {
  position: absolute;
  top: 3px;
  right: 6px;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: var(--bg-3);
  box-shadow: var(--shadow-1);
  opacity: 0;
  translate: 0 -3px;
  pointer-events: none;
  transition: opacity 140ms, translate 140ms;
}
.chat-msg:hover .chat-msg__actions, .chat-msg:focus-within .chat-msg__actions, .chat-msg.is-selected .chat-msg__actions {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
}
.chat-msg__actions .btn { width: 28px; height: 28px; }
.chat-msg__delete:hover { color: var(--loss); }

/* A big win, posted by the house */
.chat-win {
  position: relative;
  display: grid;
  gap: 8px;
  margin: 8px 2px;
  padding: 10px 12px 12px;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: linear-gradient(140deg, color-mix(in srgb, var(--win) 16%, var(--bg-2)), var(--bg-2) 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--win) 40%, transparent);
}
.chat-win.is-new { animation: chat-win-in 520ms var(--ease-spring); }
.chat-win.is-new::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.14) 50%, transparent 65%);
  translate: -120% 0;
  animation: chat-win-shine 1100ms var(--ease-out) 250ms;
  pointer-events: none;
}
@keyframes chat-win-in { from { opacity: 0; scale: 0.94; } }
@keyframes chat-win-shine { to { translate: 120% 0; } }
.chat-win__head { display: flex; align-items: center; gap: 6px; color: var(--win); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.chat-win__head span { display: grid; }
.chat-win__head time { margin-left: auto; color: var(--text-3); font-weight: 600; letter-spacing: 0; }
.chat-win__body { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); }
.chat-win__amount { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.chat-win__amount strong { color: var(--win); font-size: 17px; font-weight: 800; }
.chat-win__mult { padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--win) 18%, transparent); color: var(--win); font-size: 12px; font-weight: 800; }

.chat__new {
  position: absolute;
  left: 50%;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 800 12px var(--font-ui);
  translate: -50% 0;
  box-shadow: var(--shadow-2);
  cursor: pointer;
  animation: chat-pill 260ms var(--ease-spring);
}
.chat__new span { display: grid; }
@keyframes chat-pill { from { opacity: 0; translate: -50% 8px; } }

/* ---------- Composer ---------- */

.chat__composer { position: relative; display: grid; gap: 8px; flex: none; padding: 10px; box-shadow: 0 -1px 0 var(--line); }
.chat__composer--guest { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; }
.chat__composer--guest p { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-2); font-size: 13px; font-weight: 650; }
.chat__composer--guest p span { display: grid; color: var(--info); }
.chat__guest-actions { display: flex; flex: none; gap: 6px; }
.chat__reply, .chat__notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 12.5px;
  animation: chat-in 200ms var(--ease-out);
}
.chat__reply span:first-child, .chat__notice span:first-child { display: grid; flex: none; }
.chat__reply-text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat__reply-text strong { color: var(--text); }
.chat__reply[hidden], .chat__notice[hidden] { display: none; }
.chat__notice { padding: 10px 12px; line-height: 1.45; }
.chat__notice.is-muted { background: color-mix(in srgb, var(--loss) 12%, var(--bg-2)); color: #ffc2cb; }
.chat__field {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 4px 0 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-0);
  transition: border-color 140ms;
}
.chat__field:focus-within { border-color: var(--info); }
.chat__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 500 14px var(--font-ui); }
.chat__input::placeholder { color: var(--text-3); }
.chat__input:disabled { cursor: not-allowed; }
.chat__counter { color: var(--text-3); font-size: 11.5px; }
.chat__counter.is-low { color: var(--loss); font-weight: 700; }
.chat__send { width: 34px; height: 34px; border-radius: 9px; }
.chat__error { color: var(--loss); font-size: 12.5px; animation: chat-in 200ms var(--ease-out); }
.chat__emoji {
  position: absolute;
  right: 10px;
  bottom: 64px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(8, 34px);
  gap: 2px;
  padding: 8px;
  border-radius: var(--radius-l);
  background: var(--bg-3);
  box-shadow: var(--shadow-3), inset 0 0 0 1px var(--line-strong);
  animation: menu-in 180ms var(--ease-out);
}
.chat__emoji[hidden] { display: none; }
.chat__emoji button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms, scale 120ms;
}
@media (hover: hover) {
  .chat__emoji button:hover { background: var(--bg-4); scale: 1.12; }
}

.chat-quote { padding: 10px 12px; border-radius: var(--radius-m); background: var(--bg-2); color: var(--text-2); font-size: 13.5px; overflow-wrap: anywhere; }
.chat-quote strong { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .chat-toggle__dot, .chat__live, .chat-toggle__unread, .chat-msg.is-new, .chat-win.is-new, .chat-win.is-new::after,
  .chat__new, .chat__reply, .chat__notice, .chat__error, .chat__empty { animation: none; }
  .chat-toggle__dot::after, .chat__live::after { display: none; }
  .chat { transition: none !important; }
}

/* ---------- Rain ---------- */

.rain {
  flex: none;
  margin: 10px 10px 0;
  padding: 10px 12px 12px;
  border-radius: var(--radius-l);
  background: linear-gradient(135deg, color-mix(in srgb, var(--info) 16%, var(--bg-2)), var(--bg-2) 68%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 32%, transparent);
  transition: box-shadow 300ms;
}
.rain[hidden] { display: none; }
.rain__head { display: flex; align-items: center; gap: 8px; }
.rain__title { display: inline-flex; align-items: center; gap: 6px; color: var(--info); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.rain__title span, .rain__clock span:first-child { display: grid; }
.rain__action { height: 24px; padding: 0 8px; gap: 4px; font-size: 12px; }
.rain__action span { display: grid; }
.rain__tip { color: var(--accent); }
.rain__tip:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.rain__tip:disabled { color: var(--text-3); }
.rain__clock { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--text-2); font-size: 13px; font-weight: 700; }
.rain__time { display: inline-block; min-width: 5ch; text-align: right; transition: color 200ms; }
.rain.is-closing .rain__time { color: var(--accent); }
.rain.is-final .rain__time { color: var(--loss); }
.rain__time.is-tick { animation: rain-tick 420ms var(--ease-spring); }
@keyframes rain-tick { 40% { scale: 1.22; } }

.rain__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; margin-top: 8px; }
.rain__amount { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; }
.rain__coin, .rain__coin svg { width: 24px; height: 24px; }
.rain__pool { font: 800 20px/1 var(--font-ui); white-space: nowrap; }
.rain__players { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 13px; font-weight: 700; }
.rain__players span:first-child { display: grid; }
.rain__join { height: 34px; padding: 0 16px; }
.rain__join span { display: grid; }
.rain__join.is-joined, .rain__join.is-joined:disabled { background: color-mix(in srgb, var(--win) 18%, transparent); color: var(--win); opacity: 1; gap: 5px; }
.rain.is-joined-pop .rain__join { animation: chat-pop 380ms var(--ease-spring); }
.rain__hint { margin-top: 8px; color: var(--text-3); font-size: 12px; line-height: 1.45; }
.rain__progress { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--bg-3); overflow: hidden; }
.rain__progress span { display: block; height: 100%; transform: scaleX(var(--p, 0)); transform-origin: left; border-radius: inherit; background: var(--info); transition: transform 500ms var(--ease-out); }
.rain.is-bumped { animation: rain-bump 700ms var(--ease-out); }
.rain.is-bumped .rain__coin { animation: rain-coin-catch 520ms var(--ease-spring); }
@keyframes rain-coin-catch { 35% { scale: 1.25; rotate: -12deg; } }
/* What was just added, rising off the pool */
.rain__gain {
  position: absolute;
  left: 32px;
  bottom: 100%;
  color: var(--win);
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  animation: rain-gain 1300ms var(--ease-out) forwards;
}
@keyframes rain-gain {
  0% { opacity: 0; translate: 0 8px; scale: 0.8; }
  18% { opacity: 1; translate: 0 0; scale: 1.08; }
  30% { scale: 1; }
  100% { opacity: 0; translate: 0 -16px; }
}
.rain__split { display: flex; flex-wrap: wrap; align-items: baseline; margin-top: 6px; color: var(--text-3); font-size: 12px; }
.rain__split[hidden] { display: none; }
.rain__split strong { color: var(--accent); font-weight: 800; }
.rain__split-note { white-space: pre; }
.rain__split-need { color: var(--text-2); font-weight: 650; }

@keyframes rain-bump { 30% { box-shadow: inset 0 0 0 1px var(--info), 0 0 0 4px color-mix(in srgb, var(--info) 25%, transparent); } }
.rain.is-paid { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--win) 55%, transparent); }
.rain__done {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--win) 12%, transparent);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
  animation: chat-in 280ms var(--ease-out);
}
.rain__done[hidden] { display: none; }
.rain__done span:first-child { display: grid; color: var(--win); margin-top: 1px; }
.rain__done strong { color: var(--win); }
.rain.is-rolled .rain__done { background: color-mix(in srgb, var(--info) 12%, transparent); }
.rain.is-rolled .rain__done span:first-child, .rain.is-rolled .rain__done strong { color: var(--info); }

/* Coins falling over the chat when it pays */
.rain-fall { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.rain-fall__coin {
  position: absolute;
  top: -32px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  opacity: 0;
  animation: rain-drop var(--dur) cubic-bezier(0.45, 0, 0.9, 0.6) var(--delay) forwards;
}
.rain-fall__coin svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.4)); }
@keyframes rain-drop {
  0% { opacity: 1; top: -32px; rotate: 0deg; }
  85% { opacity: 1; }
  100% { opacity: 0; top: 100%; rotate: var(--spin); }
}

/* The rain's summary in the chat history */
.chat-rain {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 8px 2px;
  padding: 10px 12px;
  border-radius: var(--radius-l);
  background: color-mix(in srgb, var(--info) 10%, var(--bg-2));
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}
.chat-rain.is-new { animation: chat-win-in 520ms var(--ease-spring); }
.chat-rain__icon { display: grid; color: var(--info); }
.chat-rain strong { color: var(--text); }
.chat-rain time { color: var(--text-3); font-size: 11px; }

/* A player's tip, one quiet line in the conversation */
.chat-tip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 4px 2px;
  padding: 6px 10px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.4;
}
.chat-tip p { min-width: 0; overflow-wrap: anywhere; }
.chat-tip__amount { color: var(--accent); font-weight: 800; }
.chat-tip__icon { display: grid; color: var(--info); }
.chat-tip.is-new { animation: chat-in 320ms var(--ease-out); }

/* Tip sheet */
.modal--tip { width: min(440px, 100%); }
.rain-tip { display: grid; gap: 16px; }
.rain-tip__lead { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.rain-tip__coin, .rain-tip__coin svg { flex: none; width: 20px; height: 20px; margin-right: 8px; }
.rain-tip .input input { font-size: 16px; font-weight: 700; }
.rain-tip__quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.rain-tip__quick:empty { display: none; }
.rain-tip__quick .btn { background: var(--bg-3); font-variant-numeric: tabular-nums; transition: background-color 140ms, color 140ms, box-shadow 140ms; }
.rain-tip__quick .btn:hover:not(:disabled) { background: var(--bg-4); }
.rain-tip__quick .btn.is-on { background: color-mix(in srgb, var(--accent) 18%, var(--bg-3)); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.rain-tip__rules { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.rain-tip__rules li { position: relative; padding-left: 14px; }
.rain-tip__rules li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: var(--info); }

@media (prefers-reduced-motion: reduce) {
  .rain__time.is-tick, .rain.is-bumped, .rain.is-bumped .rain__coin, .rain.is-joined-pop .rain__join, .rain__done, .chat-rain.is-new, .chat-tip.is-new { animation: none; }
}

.chat__head-actions { display: flex; align-items: center; gap: 6px; }
.chat__discord {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgb(88 101 242 / 0.16);
  box-shadow: inset 0 0 0 1px rgb(88 101 242 / 0.4);
  color: #aab2ff;
  font-size: 12.5px;
  font-weight: 700;
  transition: background 140ms, color 140ms;
}
.chat__discord:hover { background: #5865f2; color: #fff; }
.chat__discord .social-icon { width: 15px; height: 15px; }

/* /css/gifts.css */
/* Gifts between players (ui/gift.mjs): the send sheet, its review, and the notice that a gift arrived. */

.modal--gift { width: min(460px, 100%); }
.gift, .gift__step { display: grid; gap: 16px; }
.gift__step[hidden] { display: none; }

.gift__locked {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--info) 10%, var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 28%, transparent);
  color: var(--text-2);
  font-size: 13.5px;
}
.gift__locked > span { display: grid; color: var(--info); }

/* The receiver field and its list of players (a combobox). */
.gift__picker { position: relative; }
.gift__options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 5;
  display: grid;
  gap: 2px;
  max-height: min(288px, 46dvh);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border-radius: var(--radius-m);
  background: var(--bg-2);
  box-shadow: var(--shadow-3), inset 0 0 0 1px var(--line);
  transform-origin: 50% 0;
  animation: gift-options-in 160ms var(--ease-out);
}
.gift__options[hidden] { display: none; }
@keyframes gift-options-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.gift__option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-s);
  font-weight: 650;
  cursor: pointer;
  transition: background-color 100ms;
}
.gift__option:hover, .gift__option[aria-selected="true"] { background: var(--bg-3); }
.gift__option[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--accent); }
.gift__option-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift__option-name mark { background: none; color: var(--accent); font-weight: 800; }
.gift__option-tag { padding: 2px 8px; border-radius: 999px; background: var(--bg-4); color: var(--text-3); font-size: 11px; font-weight: 700; white-space: nowrap; }
.gift__options-empty { padding: 10px 8px; color: var(--text-3); font-size: 13px; }

.gift__face { display: grid; place-items: center; flex: none; width: 24px; height: 24px; margin-right: 10px; color: var(--text-3); }
.gift__to input, .gift .input input { font-size: 16px; font-weight: 700; }
.gift__coin, .gift__coin svg { flex: none; width: 20px; height: 20px; margin-right: 8px; }

.gift__quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.gift__quick .btn { background: var(--bg-3); font-variant-numeric: tabular-nums; transition: background-color 140ms, color 140ms, box-shadow 140ms; }
.gift__quick .btn:hover:not(:disabled) { background: var(--bg-4); }
.gift__quick .btn.is-on { background: color-mix(in srgb, var(--accent) 18%, var(--bg-3)); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }

.gift__rules { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.gift__rules li { position: relative; padding-left: 14px; }
.gift__rules li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.gift__rules strong, .gift__rules .num { color: var(--text-2); }

.gift__recent { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.gift__recent h3 { color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.gift__recent ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.gift__recent li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-size: 13px;
}
.gift__recent li:hover { background: var(--bg-2); }
.gift__recent li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift__recent strong { color: var(--text); }
.gift__dir { display: grid; color: var(--text-3); }
.gift__recent .is-received .gift__dir, .gift__recent .is-received .gift__amount { color: var(--win); }
.gift__when { color: var(--text-3); font-size: 12px; }
.gift__loading { padding: 7px 8px; color: var(--text-3); font-size: 13px; }
/* On a phone the name matters more than the date. */
@media (max-width: 480px) {
  .gift__recent li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .gift__when { display: none; }
}

/* ---------- The review: the Crowns travel from you to them ---------- */

.gift__flight { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 4px 0; }
.gift__party { display: grid; justify-items: center; gap: 8px; max-width: 120px; }
.gift__party > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 13px; font-weight: 700; }
/* The ends fade into the sheet with two gradients over the coins rather than a mask: a mask makes
   the graphics card recompose the trail on every frame. */
.gift__trail { position: relative; height: 26px; overflow: hidden; }
.gift__trail::before, .gift__trail::after { content: ""; position: absolute; top: 0; bottom: 0; z-index: 1; width: 22%; pointer-events: none; }
.gift__trail::before { left: 0; background: linear-gradient(90deg, var(--bg-1), transparent); }
.gift__trail::after { right: 0; background: linear-gradient(270deg, var(--bg-1), transparent); }
/* Each coin rides its own lane as wide as the trail, so a plain percentage carries it across
   whatever the width (and the move stays on the graphics card). */
.gift__trail-coin {
  position: absolute;
  inset: 3px 0 auto;
  height: 20px;
  animation: gift-travel 1.6s linear calc(var(--i) * -0.32s) infinite;
}
.gift__trail-coin svg { display: block; width: 20px; height: 20px; animation: gift-spin 1.6s linear infinite; }
@keyframes gift-travel { from { transform: translateX(-12%); } to { transform: translateX(100%); } }
@keyframes gift-spin { to { transform: rotate(360deg); } }

.gift__sum { display: flex; align-items: center; justify-content: center; gap: 10px; }
.gift__sum-coin, .gift__sum-coin svg { width: 30px; height: 30px; }
.gift__big { font-family: var(--font-display); font-size: 34px; font-weight: 900; letter-spacing: -0.01em; }
.gift__note { color: var(--text-3); font-size: 12.5px; text-align: center; }
.gift__actions { display: flex; gap: 10px; }
.gift__send { flex: 1; }

/* Sent: the coins rush across and the receiver catches them. */
.gift__review.is-sent .gift__trail-coin { animation-duration: 0.5s; }
.gift__review.is-sent .gift__party:last-child .avatar { animation: gift-catch 520ms var(--ease-spring) 180ms; }
@keyframes gift-catch { 40% { transform: scale(1.18); } }

/* ---------- A gift arrived ---------- */

.gift-notice {
  position: fixed;
  top: calc(var(--topbar-h, 64px) + 12px);
  left: 50%;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px 12px 12px;
  border-radius: var(--radius-l);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-1));
  box-shadow: var(--shadow-3), inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
  translate: -50% 0;
  cursor: pointer;
  animation: gift-drop 520ms var(--ease-spring);
}
.gift-notice p { color: var(--text-2); font-size: 13.5px; }
.gift-notice p strong { color: var(--text); }
.gift-notice__amount { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.gift-notice__amount strong { color: var(--accent) !important; font-family: var(--font-display); font-size: 18px; font-weight: 900; }
.gift-notice__coin, .gift-notice__coin svg { width: 20px; height: 20px; }
.gift-notice.is-leaving { animation: gift-rise 320ms var(--ease-in-out) forwards; }
@keyframes gift-drop { from { opacity: 0; transform: translateY(-24px) scale(0.92); } }
@keyframes gift-rise { to { opacity: 0; transform: translateY(-16px); } }

@media (prefers-reduced-motion: reduce) {
  .gift__trail-coin, .gift__trail-coin svg { animation: none; }
  .gift__trail-coin:not(:first-child) { display: none; }
  .gift__trail-coin:first-child svg { margin-inline: auto; }
}

/* /css/fx.css */
#fx-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 95;
  pointer-events: none;
}

.fx-flash {
  position: fixed;
  inset: 0;
  z-index: 94;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--flash) 30%, transparent), transparent 65%);
  animation: fx-flash 700ms var(--ease-out) forwards;
}
@keyframes fx-flash {
  from { opacity: 1; }
  to { opacity: 0; }
}

.fx-shake { animation: fx-shake 420ms var(--ease-out); }
@keyframes fx-shake {
  15% { transform: translate(calc(var(--shake) * -1), calc(var(--shake) * 0.5)); }
  30% { transform: translate(var(--shake), calc(var(--shake) * -0.6)); }
  45% { transform: translate(calc(var(--shake) * -0.6), calc(var(--shake) * 0.3)); }
  60% { transform: translate(calc(var(--shake) * 0.4), 0); }
  80% { transform: translate(calc(var(--shake) * -0.15), 0); }
}

.fx-pop { animation: fx-pop 420ms var(--ease-spring); }
@keyframes fx-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ---------- Big win overlay ---------- */

.bigwin-overlay {
  position: fixed;
  inset: 0;
  z-index: 93;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, rgb(20 14 0 / 0.55), rgb(3 6 12 / 0.82) 70%);
  cursor: pointer;
  animation: fade-in 240ms var(--ease-out);
}
.bigwin-overlay.is-leaving { pointer-events: none; animation: bigwin-out 320ms var(--ease-in-out) forwards; }
@keyframes bigwin-out { to { opacity: 0; transform: scale(1.04); } }

.bigwin {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 56px;
  text-align: center;
  animation: bigwin-in 700ms var(--ease-spring);
}
@keyframes bigwin-in {
  from { opacity: 0; transform: scale(0.4) rotate(-4deg); }
}

.bigwin__rays {
  position: absolute;
  inset: -45%;
  z-index: -1;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgb(255 197 61 / 0.16) 0deg 9deg, transparent 9deg 22.5deg);
  mask-image: radial-gradient(circle, black 20%, transparent 68%);
  animation: spin 14s linear infinite;
}

.bigwin__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 64px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #fff4cf;
  text-shadow: 0 3px 0 #b87a00, 0 6px 0 #6d4700, 0 16px 40px rgb(255 179 0 / 0.55);
  animation: bigwin-title 1.4s var(--ease-in-out) infinite alternate;
}
@keyframes bigwin-title { to { transform: scale(1.04); } }

.bigwin__amount {
  font-family: var(--font-display);
  font-size: clamp(26px, 4.4vw, 46px);
  font-weight: 800;
  color: var(--accent);
}
.bigwin__mult {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--win);
  color: var(--win-ink);
  font-weight: 800;
  font-size: 18px;
}
.bigwin--epic .bigwin__title {
  background: linear-gradient(180deg, #fff 10%, #ffdf85 45%, #ff9f1a 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 4px 0 #8a5200) drop-shadow(0 18px 40px rgb(255 159 26 / 0.6));
}
