/* Sors Duo: table, machines and panels, Art Deco base look | games/Sors_Duo/css/table.css | v.0.12 */

@font-face { font-family: 'Cinzel'; src: url('../fonts/Cinzel-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('../fonts/Cinzel-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --black: #0a0b0b;
  --lacquer: #121313;
  --felt: #0f2419;
  --felt-deep: #08150e;
  --gold: #c9a44c;
  --gold-hi: #f0d68a;
  --gold-lo: #7a5f23;
  --ivory: #efe6cf;
  --ivory-dim: #b9b09a;
  --red: #a3262a;
  --green: #4f9a6a;
  --row: 58px;
  --reel-w: 76px;
  --font-deco: 'Cinzel', Georgia, serif;
  --font-ui: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --sym-9: #9aa3a8;
  --sym-10: #4f9a6a;
  --sym-J: #4a78c2;
  --sym-Q: #9b5fc0;
  --sym-K: #c0392b;
  --sym-A: #c9a44c;
  /* The SORS name and the pot: each skin sets its own colours. */
  --sors-lo: var(--gold);
  --sors-hi: var(--gold-hi);
  --sors-glow: rgba(240, 214, 138, .55);
  --sors-font: var(--font-deco);
  --pot-glow: rgba(240, 214, 138, .45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  color: var(--ivory);
  font-family: var(--font-ui);
  font-size: 15px;
}

/* The casino room lives on html, so the floor decor (css/floors.css) can sit between it
   and the table; the guest skins paint their own on body. */
html {
  background:
    radial-gradient(ellipse at 50% 40%, var(--floor-tint, rgba(30, 70, 45, .55)) 0%, transparent 65%),
    repeating-linear-gradient(90deg, rgba(201, 164, 76, .04) 0 2px, transparent 2px 46px),
    var(--felt-deep);
}
body { background: transparent; }

button { font-family: inherit; }
[hidden] { display: none !important; }

.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
}

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  /* The bar spans the whole window; its content lines up with the 1280px table. */
  padding: 10px max(18px, calc((100% - 1280px) / 2 + 18px));
  border-bottom: 1px solid var(--gold-lo);
  background: linear-gradient(180deg, #151515, #0b0b0b);
}

.brand {
  font-family: var(--font-deco);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 6px;
  color: var(--gold);
}
.brand span { color: var(--ivory); }

.stakes { display: flex; gap: 18px; }
.stat b, .jackpot b, .dial b, .pot b {
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ivory-dim);
}
.stat em, .jackpot em, .dial em { font-style: normal; font-weight: 600; color: var(--ivory); margin-left: 4px; }
.stat small { color: var(--gold); margin-left: 6px; font-size: 11px; }

.jackpot {
  margin-left: auto;
  padding: 4px 14px;
  border: 1px solid var(--gold);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(201, 164, 76, .18), rgba(201, 164, 76, .04));
}
.jackpot em { color: var(--gold-hi); font-family: var(--font-deco); font-size: 18px; }

.dial { display: flex; align-items: center; gap: 8px; }
.dial-face {
  position: relative;
  width: 40px;
  height: 22px;
  border: 1px solid var(--gold);
  border-bottom: none;
  border-radius: 40px 40px 0 0;
  overflow: hidden;
}
.dial-needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2px;
  height: 19px;
  margin-left: -1px;
  background: var(--gold-hi);
  transform-origin: 50% 100%;
  transform: rotate(-90deg);
  transition: transform .8s cubic-bezier(.3, 1.6, .5, 1);
}
.dial.hot em { color: var(--gold-hi); }

.lang {
  border: 1px solid var(--gold-lo);
  background: transparent;
  color: var(--gold);
  padding: 4px 9px;
  cursor: pointer;
  letter-spacing: 1px;
}

/* ---------------------------------------------------------------- table */
.table {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(270px, 1fr) minmax(280px, 1.05fr) minmax(270px, 1fr);
  gap: 18px;
  padding: 14px 18px;
  align-items: center;
  min-height: 0;
  overflow: hidden;
}

.seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.seat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  max-width: 300px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--gold-lo);
}
.seat-name { font-family: var(--font-deco); font-size: 17px; letter-spacing: 2px; color: var(--gold); }
.seat-stack { font-weight: 600; font-size: 18px; }
.seat.acting .seat-name::after { content: ' \25C6'; color: var(--gold-hi); }

/* ---------------------------------------------------------------- machine */
.machine { display: flex; align-items: flex-end; gap: 6px; }

.cabinet {
  position: relative;
  padding: 30px 16px 12px;
  border: 2px solid var(--gold);
  border-radius: 46px 46px 8px 8px;
  background:
    linear-gradient(180deg, rgba(201, 164, 76, .10), transparent 40%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 9px),
    var(--lacquer);
  box-shadow: 0 0 0 5px var(--black), 0 0 0 6px var(--gold-lo), 0 16px 34px rgba(0, 0, 0, .6);
}
.machine-rival .cabinet { border-color: #a0843e; }

/* Marquee bulbs inside the crown, above the reel window; they chase while the reels spin. */
.bulbs {
  position: absolute;
  top: 12px;
  left: 40px;
  right: 40px;
  height: 8px;
  background: radial-gradient(circle, #6b5421 0 3px, transparent 3.5px) 0 0 / 16px 8px repeat-x;
}
.machine.spinning .bulbs {
  background-image: radial-gradient(circle, var(--gold-hi) 0 3px, transparent 3.5px);
  animation: chase .35s steps(2) infinite;
  filter: drop-shadow(0 0 4px var(--gold-hi));
}
.machine.win .bulbs {
  background-image: radial-gradient(circle, var(--gold-hi) 0 3px, transparent 3.5px);
  animation: blink .3s steps(2) 6;
  filter: drop-shadow(0 0 6px var(--gold-hi));
}
@keyframes chase { to { background-position: 16px 0; } }
@keyframes blink { 50% { opacity: .2; } }

.window {
  position: relative;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: #050505;
  border: 1px solid var(--gold-lo);
}
/* Payline: only the middle row counts. */
.window::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: calc(6px + var(--row) * 1.5);
  height: 2px;
  margin-top: -1px;
  background: linear-gradient(90deg, transparent, rgba(240, 214, 138, .8), transparent);
  opacity: .28;   /* soft over the dark reels, in every skin (Daniel) */
  pointer-events: none;
}

.reel {
  position: relative;
  width: var(--reel-w);
  height: calc(var(--row) * 3);
  overflow: hidden;
  /* Dark reels, near black in the casino, so the painted neon symbols glow (Daniel). */
  background: linear-gradient(180deg, #000 0%, #0f0d0a 30%, #0f0d0a 70%, #000 100%);
  cursor: default;
}
.reel.clickable { cursor: pointer; }
.reel.clickable:hover { outline: 1px solid var(--gold-hi); }
.reel.held { outline: 2px solid var(--gold-hi); box-shadow: 0 0 12px rgba(240, 214, 138, .5); }
.reel.moved { animation: moved 1.2s ease-out; }
@keyframes moved { 0%, 40% { box-shadow: 0 0 18px 4px var(--red); } }

.strip {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--row);
  margin-top: calc(var(--row) / -2);
  perspective: calc(var(--row) * 8);
}
/* The drum: js/machine.js turns each face around the axle (Syndicate lays them flat). */
.strip .sym { position: absolute; inset: 0; backface-visibility: hidden; will-change: transform; }
/* The curve of the drum: darker where the faces turn away from the glass. */
.reel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .12) 22%, transparent 38%, transparent 62%, rgba(0, 0, 0, .12) 78%, rgba(0, 0, 0, .55) 100%);
  pointer-events: none;
}

.sym {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--row);
  font-family: var(--font-deco);
  font-weight: 700;
  font-size: 33px;
  color: #333;
}
.sym-9 { color: var(--sym-9); }
.sym-10 { color: var(--sym-10); }
.sym-J { color: var(--sym-J); }
.sym-Q { color: var(--sym-Q); }
.sym-K { color: var(--sym-K); }
.sym-A { color: var(--sym-A); text-shadow: 0 0 1px #6b5421; }
.sym-hidden { color: #3a3a3a; font-size: 26px; }
/* Daniel's painted symbols, one set per skin (html.art is set by js/machine.js once all
   of them have loaded). The casino set here, the guest skins in their own files. */
html.art .sym-9 { background-image: url('../img/sym/casino/9.png'); }
html.art .sym-10 { background-image: url('../img/sym/casino/10.png'); }
html.art .sym-J { background-image: url('../img/sym/casino/J.png'); }
html.art .sym-Q { background-image: url('../img/sym/casino/Q.png'); }
html.art .sym-K { background-image: url('../img/sym/casino/K.png'); }
html.art .sym-A { background-image: url('../img/sym/casino/A.png'); }
html.art .sym-9, html.art .sym-10, html.art .sym-J, html.art .sym-Q, html.art .sym-K, html.art .sym-A {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-origin: content-box;
  padding: 4px;
  color: transparent;
  text-shadow: none;
}
/* Before the first spin of a hand the reels are dark: nothing on them counts yet. */
.machine.idle .reel { filter: brightness(.35) saturate(.3); }
.reel.hidden-reel { background: linear-gradient(180deg, #111 0%, #2a2a2a 30%, #2a2a2a 70%, #111 100%); }
.reel.hidden-reel .sym-hidden { color: var(--gold-lo); }
/* Light enough that the symbols stay readable while they pass; each skin sets its own. */
.reel.blur .strip { filter: blur(var(--reel-blur, .5px)); }

.lamps { display: flex; gap: 6px; padding: 8px 6px 0; }
.lamp {
  width: var(--reel-w);
  padding: 2px 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: 2px;
  color: #4a3d1c;
  border: 1px solid #3a2f16;
  background: #0d0c09;
}
.lamps-count { justify-content: center; }
.lamp.count { width: auto; min-width: 150px; padding: 2px 10px; }
.lamp.count i { font-style: normal; letter-spacing: 3px; margin-left: 6px; }
.lamp.on { color: var(--black); background: var(--gold-hi); border-color: var(--gold-hi); box-shadow: 0 0 10px rgba(240, 214, 138, .6); }

/* Lever: the knob is dragged or clicked down; it springs back. */
.lever {
  position: relative;
  width: 26px;
  height: 220px;
  margin-bottom: 20px;
}
.lever-rod {
  position: absolute;
  left: 11px;
  bottom: 0;
  width: 5px;
  height: 178px;
  background: linear-gradient(90deg, #8a8a8a, #e8e8e8, #7a7a7a);
  transform-origin: 50% 100%;
  transition: transform .45s cubic-bezier(.3, 1.8, .5, 1);
}
.lever-knob {
  position: absolute;
  left: -9px;
  top: -18px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a80, var(--red) 55%, #4a0a0a);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .6);
}
.lever::after {
  content: '';
  position: absolute;
  left: 4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold), var(--gold-lo));
}
.lever.ready { cursor: grab; }
.lever.ready .lever-knob { animation: glow 1.4s ease-in-out infinite; }
.lever.pulled .lever-rod { transform: scaleY(-.35); transition: transform .18s ease-in; }
@keyframes glow { 50% { box-shadow: 0 0 14px 4px rgba(255, 120, 100, .7); } }

/* ---------------------------------------------------------------- cards */
.cards { display: flex; gap: 8px; margin-top: 10px; }
.card {
  width: 76px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #0f0d0a;   /* dark like the reels, so the neon symbols glow */
  border: 1px solid var(--gold-lo);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
  font-family: var(--font-deco);
  font-weight: 700;
  font-size: 38px;
}
.card.back {
  background:
    repeating-linear-gradient(45deg, var(--gold-lo) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, var(--gold-lo) 0 2px, transparent 2px 9px),
    #1a1a1a;
  border-color: var(--gold);
}
.card.flip { animation: flip .5s ease-out; }
@keyframes flip { from { transform: rotateY(90deg); } }

.hand-label { min-height: 22px; font-size: 16px; letter-spacing: 1px; color: var(--gold-hi); }

/* Speech of the seat: the last action as a short shout. */
.bubble {
  position: absolute;
  top: 34px;
  padding: 5px 12px;
  border: 1px solid var(--gold);
  background: rgba(10, 11, 11, .92);
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 3;
}
.bubble.show { opacity: 1; transform: none; }
.seat-you .bubble { right: 0; }
.seat-rival .bubble { left: 0; }

/* ---------------------------------------------------------------- centre */
.centre { display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; min-height: 0; }

.rival-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.portrait {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: radial-gradient(circle at 50% 38%, #2b2b2b 0 22%, transparent 23%),
              radial-gradient(ellipse at 50% 105%, #2b2b2b 0 48%, transparent 49%),
              radial-gradient(circle, #1a1a1a, #0a0a0a);
  box-shadow: 0 0 0 4px var(--black), 0 0 0 5px var(--gold-lo);
}
.rival-name { font-family: var(--font-deco); font-size: 18px; color: var(--gold); letter-spacing: 1px; }
.rival-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.rival-meta .dossier-btn { margin-top: 0; }
.rival-species { font-size: 12px; letter-spacing: 1px; color: var(--gold); opacity: .8; }
.rival-trait { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--ivory-dim); }

.pot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 190px;
  padding: 8px 24px;
  border-top: 1px solid var(--gold-lo);
  border-bottom: 1px solid var(--gold-lo);
}
.pot b { font-size: 13px; letter-spacing: 5px; color: var(--gold); }
.pot em {
  font-style: normal;
  font-family: var(--font-deco);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: 1px;
  color: var(--gold-hi);
  background: linear-gradient(180deg, #fff6d8 0%, var(--gold-hi) 40%, var(--gold) 75%, var(--gold-lo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px var(--pot-glow));
}

/* SORS, the hand the game is named after: never plain text (Daniel, 2026-09-27). */
.sors-word {
  display: inline-block;
  font-family: var(--sors-font);
  font-weight: 700;
  font-size: 1.7em;
  line-height: 1;
  letter-spacing: .22em;
  text-transform: uppercase;
  background: linear-gradient(100deg, var(--sors-lo) 20%, var(--sors-hi) 44%, #fff 50%, var(--sors-hi) 56%, var(--sors-lo) 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px var(--sors-glow));
  animation: sors-shine 2.6s linear infinite;
}
@keyframes sors-shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .sors-word { animation: none; } }
.pot em.bump { animation: bump .35s ease-out; }
@keyframes bump { 40% { transform: scale(1.18); } }

.phase { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--ivory-dim); }

.result {
  height: 72px;
  min-width: 260px;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s;
  padding: 10px 18px;
  border: 1px solid var(--gold);
  background: rgba(10, 11, 11, .9);
  text-align: center;
  font-family: var(--font-deco);
  font-size: 20px;
  color: var(--gold-hi);
}
.result.show { visibility: visible; opacity: 1; }
.result small { display: block; font-family: var(--font-ui); font-size: 12px; color: var(--ivory-dim); margin-top: 4px; }

.log-wrap { position: relative; width: 100%; max-width: 380px; flex: 1; min-height: 90px; display: flex; }
.log {
  list-style: none;
  width: 100%;
  max-width: 380px;
  flex: 1;
  min-height: 90px;
  height: auto;
  scrollbar-color: var(--gold-lo) transparent;
  scrollbar-width: thin;
  margin: 0;
  padding: 8px 10px;
  overflow-y: auto;
  border: 1px solid #2a2a22;
  background: rgba(0, 0, 0, .35);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ivory-dim);
}
.log li.you { color: #cfe3c6; }
.log li.rival { color: #e9c1b8; }
.log li.gold { color: var(--gold-hi); }
.log li.sep { margin-top: 6px; padding-top: 4px; border-top: 1px solid #2a2a22; color: var(--gold); }

/* ---------------------------------------------------------------- action bar */
.actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 104px;
  padding: 10px 18px 12px;
  border-top: 1px solid var(--gold-lo);
  background: linear-gradient(0deg, #0b0b0b, #141414);
}
/* Credit line in the right corner of the bottom bar, level with the hint, clear of the
   buttons; the guest skins name their game. Hidden where the bar is too narrow. */
.actions::after {
  content: 'Sors Duo by Laren X (2026)';
  position: absolute;
  right: max(12px, calc((100% - 1280px) / 2 + 12px));
  top: 12px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--gold-lo);
  pointer-events: none;
}
@media (max-width: 900px) { .actions::after { display: none; } }
.hint { height: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; font-size: 13px; color: var(--ivory-dim); letter-spacing: .5px; text-align: center; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; min-height: 52px; }

.btn {
  min-width: 96px;
  padding: 10px 16px;
  border: 1px solid var(--gold-lo);
  background: linear-gradient(180deg, #232320, #151513);
  color: var(--ivory);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--gold-hi); color: var(--gold-hi); }
.btn:disabled { opacity: .35; cursor: default; }
.btn-gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: var(--black); border-color: var(--gold-hi); }
.btn-gold:hover:not(:disabled) { color: var(--black); filter: brightness(1.08); }
.btn-red { border-color: #5a1a1a; }
.btn small { display: block; font-size: 10px; font-weight: 400; opacity: .7; letter-spacing: 1px; }

.sizes { display: flex; gap: 4px; }
.chip {
  padding: 8px 10px;
  border: 1px solid #3a3420;
  border-radius: 20px;
  background: #121210;
  color: var(--ivory-dim);
  font-size: 12px;
  cursor: pointer;
}
.chip.on { border-color: var(--gold-hi); color: var(--gold-hi); }
.slider { width: 160px; accent-color: var(--gold); }

/* ---------------------------------------------------------------- overlay */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 4, .88);
  z-index: 10;
}
.panel {
  padding: 36px 48px;
  border: 2px solid var(--gold);
  background: var(--lacquer);
  text-align: center;
  box-shadow: 0 0 0 6px var(--black), 0 0 0 7px var(--gold-lo);
}
.panel h1 { margin: 0; font-family: var(--font-deco); font-size: 48px; letter-spacing: 12px; color: var(--gold); }
.panel h1 span { color: var(--ivory); }
.tagline { font-family: var(--font-deco); letter-spacing: 3px; color: var(--ivory-dim); }
.nick { display: block; margin-top: 22px; font-size: 13px; letter-spacing: 1px; color: var(--ivory-dim); }
.nick input {
  display: block;
  width: 240px;
  margin: 6px auto 0;
  padding: 8px 10px;
  border: 1px solid var(--gold-lo);
  background: #0b0b0b;
  color: var(--gold-hi);
  font-family: var(--font-deco);
  font-size: 18px;
  text-align: center;
}
.nick input:focus { outline: none; border-color: var(--gold-hi); }
.option { display: block; margin: 20px 0; font-size: 14px; color: var(--ivory-dim); cursor: pointer; }
.option input { accent-color: var(--gold); }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 900px) {
  :root { --row: 46px; --reel-w: 58px; }
  .sym { font-size: 26px; }
  .card { width: 56px; height: 78px; font-size: 28px; }
  .table { grid-template-columns: 1fr; }
  .seat-rival { order: 1; }
  .centre { order: 2; }
  .seat-you { order: 3; }
  .app { height: auto; min-height: 100vh; }
  .table { overflow: visible; }
  .centre { height: auto; }
  .log { flex: none; height: 110px; }
  .actions { height: auto; min-height: 104px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .jackpot { margin-left: 0; }
  .lever { height: 170px; }
  .lever-rod { height: 135px; }
}

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

/* ---------------------------------------------------------------- effects (stage 4) */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.fx-chip {
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ivory) 0 3px, var(--red) 3.5px 6px, var(--ivory) 6.5px 7px, var(--red) 7.5px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .6);
}
.fx-coin {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold-hi) 40%, var(--gold) 70%, var(--gold-lo));
  box-shadow: 0 0 6px rgba(240, 214, 138, .7);
}
.fx-banner {
  position: absolute;
  left: 50%;
  top: 42%;
  padding: 18px 90px;
  border-top: 2px solid var(--gold-hi);
  border-bottom: 2px solid var(--gold-hi);
  background: linear-gradient(90deg, rgba(10, 11, 11, 0), var(--black) 12%, var(--black) 88%, rgba(10, 11, 11, 0));
  box-shadow: 0 0 60px 30px rgba(0, 0, 0, .55);
  font-family: var(--font-deco);
  font-weight: 700;
  font-size: 54px;
  color: var(--gold-hi);
  text-shadow: 0 0 22px rgba(240, 214, 138, .6);
  white-space: nowrap;
}
.fx-banner.red { color: #ff9a8a; border-color: #ff9a8a; text-shadow: 0 0 22px rgba(255, 110, 90, .6); }

/* A reel lands with a short mechanical thud. */
.reel.thud { animation: thud .22s ease-out; }
/* The whole cabinet takes the knock when a pawl drops. */
.machine.jolt { animation: jolt .16s ease-out; }
@keyframes jolt { 30% { translate: 0 1.5px; } 65% { translate: 0 -.5px; } }
@keyframes thud { 35% { transform: translateY(4px); } 70% { transform: translateY(-1px); } }

/* The payline glows while the hand on it is strong. */
.window.hot::after { height: 3px; opacity: .45; background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); box-shadow: 0 0 6px var(--gold-hi); }

/* Near miss: after a lost showdown, the neighbour that would have won lights up. */
.sym.near { background: rgba(163, 38, 42, .18); box-shadow: inset 0 0 0 2px rgba(163, 38, 42, .7); }

/* All-in and big raises: the table shivers once. */
.table.shake { animation: shake .4s ease-out; }
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(1px); } }

/* Jackpot: the whole machine strobes. */
.machine.jackpot-win .cabinet { animation: strobe .18s steps(2) 14; }
@keyframes strobe { 50% { box-shadow: 0 0 0 5px var(--black), 0 0 0 6px var(--gold-hi), 0 0 40px 10px rgba(240, 214, 138, .7); } }

.dial.strike .dial-face { animation: strobe .15s steps(2) 8; }

/* The lever follows the hand while it is dragged. */
.lever.dragging .lever-rod { transition: none; }

/* ---------------------------------------------------------------- dossier (stage 5) */
.dossier-btn {
  margin-top: 4px;
  padding: 3px 10px;
  border: 1px solid var(--gold-lo);
  background: transparent;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
}
.dossier-btn small { opacity: .6; }
.dossier-btn.new { border-color: var(--gold-hi); box-shadow: 0 0 10px rgba(240, 214, 138, .4); }
.dossier {
  position: absolute;
  inset: 0;
  display: none;
  padding: 10px 12px;
  overflow-y: auto;
  border: 1px solid var(--gold);
  background: rgba(12, 12, 10, .97);
  font-size: 12.5px;
  color: var(--ivory-dim);
}
.dossier.open { display: block; }
.dossier h3 { margin: 0 0 8px; font-family: var(--font-deco); font-size: 15px; color: var(--gold); letter-spacing: 2px; }
.dossier .entry { margin-bottom: 8px; }
.dossier .entry b { color: var(--ivory); font-weight: 600; }
.dossier .entry span { display: block; font-size: 11.5px; }
.portrait.tell-flash { box-shadow: 0 0 0 4px var(--black), 0 0 0 5px var(--gold-hi); }

/* The rival's words, beside the portrait; absolute, so nothing moves. */
.speech {
  position: absolute;
  top: 6px;
  left: calc(50% + 84px);
  width: max-content;
  max-width: 180px;
  padding: 8px 11px;
  border: 1px solid var(--gold);
  border-radius: 10px 10px 10px 2px;
  background: rgba(239, 230, 207, .96);
  color: #1a1612;
  font-family: var(--font-deco);
  font-size: 13px;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(6px) scale(.96);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  z-index: 4;
}
.speech.show { opacity: 1; transform: none; }
@media (max-width: 900px) { .speech { left: auto; right: 0; top: -6px; } }

/* ---------------------------------------------------------------- title and album (stage 6) */
.title-panel { min-width: 420px; }
.floors { list-style: none; margin: 18px 0 6px; padding: 0; display: flex; flex-direction: column-reverse; gap: 3px; }
.floors li {
  padding: 5px 14px;
  border: 1px solid #2a2a22;
  font-family: var(--font-deco);
  font-size: 14px;
  letter-spacing: 2px;
  color: #6a6452;
}
.floors li.reached { color: var(--ivory-dim); }
.floors li.here { border-color: var(--gold-hi); color: var(--gold-hi); background: rgba(201, 164, 76, .12); }
.floors li.here::before { content: '\25B6  '; }
.floor-rules { min-height: 18px; margin: 4px 0 16px; font-size: 12px; color: var(--gold); letter-spacing: 1px; }
.title-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.record { margin: 14px 0 0; font-size: 12px; color: var(--ivory-dim); }

.album-panel { width: min(980px, 94vw); max-height: 92vh; overflow-y: auto; scrollbar-color: var(--gold-lo) transparent; scrollbar-width: thin; }
.album-panel h2 { margin: 0; font-family: var(--font-deco); color: var(--gold); letter-spacing: 4px; }
.album-panel h3 { margin: 22px 0 10px; font-family: var(--font-deco); color: var(--gold); letter-spacing: 3px; font-size: 16px; }
.album-stats { color: var(--ivory-dim); font-size: 13px; }
.album-grid, .album-guests { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin-bottom: 8px; }
.album-card { text-align: center; font-size: 11px; color: var(--ivory-dim); }
.album-card .pic { width: 96px; height: 96px; margin: 0 auto 4px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold-lo); background: #000; }
.album-card .pic svg, .album-card .pic canvas { width: 100%; height: 100%; display: block; }
.album-card .pic canvas { image-rendering: pixelated; }
.album-card.locked .pic { border-color: #2a2a22; background: radial-gradient(circle at 50% 38%, #1a1a1a 0 22%, transparent 23%), radial-gradient(ellipse at 50% 105%, #1a1a1a 0 48%, transparent 49%), #0a0a0a; }
.album-card b { display: block; color: var(--ivory); font-weight: 600; }
.album-card.legendary b { color: var(--gold-hi); }
.album-empty { color: var(--ivory-dim); font-size: 13px; }

.lang.sound.off { opacity: .35; text-decoration: line-through; }

/* ---------------------------------------------------------------- achievements (stage 8) */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; text-align: left; }
.ach { padding: 8px 12px; border: 1px solid #2a2a22; color: #6a6452; font-size: 12px; }
.ach b { display: block; font-family: var(--font-deco); font-size: 14px; letter-spacing: 1px; }
.ach.got { border-color: var(--gold-lo); color: var(--ivory-dim); }
.ach.got b { color: var(--gold-hi); }
.stats { display: grid; grid-template-columns: auto auto; gap: 4px 18px; justify-content: center; margin: 0 0 18px; font-size: 13px; }
.stats dt { color: var(--ivory-dim); text-align: right; }
.stats dd { margin: 0; color: var(--ivory); font-weight: 600; text-align: left; }
.toast {
  position: fixed;
  top: 70px;
  right: 18px;
  z-index: 40;
  min-width: 240px;
  padding: 10px 16px;
  border: 1px solid var(--gold-hi);
  background: rgba(10, 11, 11, .96);
  box-shadow: 0 0 20px rgba(240, 214, 138, .35);
  transform: translateX(120%);
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
}
.toast.show { transform: none; }
.toast small { display: block; font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
.toast b { display: block; font-family: var(--font-deco); font-size: 17px; color: var(--gold-hi); }
.toast span { font-size: 12px; color: var(--ivory-dim); }

/* Hold advisor: the suggested reels get a dashed frame. */
.reel.suggest { outline: 2px dashed rgba(240, 214, 138, .75); outline-offset: 2px; }
.reel.suggest.held { outline-style: solid; }
.advice { color: var(--gold-hi); }
.option { margin: 0 0 14px; }

a.btn { display: inline-block; text-decoration: none; }

/* ---------------------------------------------------------------- phones (stage 9) */
/* The rival shrinks to a strip at the top, the player's own machine stays big above the
   buttons, so the reels you hold are always on screen. */
@media (max-width: 700px) {
  html, body { font-size: 14px; }
  .app { height: auto; min-height: 100vh; }
  .topbar { flex-wrap: wrap; gap: 6px 12px; padding: 6px 10px; }
  .brand { font-size: 16px; letter-spacing: 3px; }
  .stakes { gap: 10px; }
  .stat b, .jackpot b, .dial b { font-size: 9px; letter-spacing: 1px; }
  .jackpot { margin-left: auto; padding: 2px 8px; }
  .jackpot em { font-size: 14px; }
  .lang { padding: 2px 7px; }
  .table { grid-template-columns: 1fr; gap: 6px; padding: 6px 10px; overflow: visible; }
  .seat-rival { order: 1; }
  .centre { order: 2; height: auto; gap: 4px; }
  .seat-you { order: 3; }
  .seat { gap: 5px; }
  .seat-head { max-width: none; }
  .seat-name { font-size: 14px; }
  .seat-stack { font-size: 15px; }
  /* The rival: a small machine with the cards beside it. */
  .seat-rival { --row: 24px; --reel-w: 32px; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .seat-rival .seat-head { flex-basis: 100%; }
  .seat-rival .sym { font-size: 15px; }
  .seat-rival .cabinet { padding: 16px 8px 6px; border-radius: 22px 22px 6px 6px; }
  .seat-rival .bulbs { top: 5px; left: 24px; right: 24px; height: 5px; background-size: 10px 5px; }
  .seat-rival .lamp { font-size: 8px; }
  .seat-rival .lamp.count { min-width: 90px; }
  .seat-rival .lever { display: none; }
  .seat-rival .card { width: 34px; height: 48px; font-size: 18px; }
  .seat-rival .cards { margin-top: 0; }
  .seat-rival .hand-label { font-size: 12px; min-height: 0; }
  /* The centre: portrait beside the name, the log folded away. */
  .rival-card { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
  .portrait { width: 64px; height: 64px; }
  .rival-name { font-size: 15px; }
  .rival-meta { flex-basis: 100%; gap: 6px; }
  .pot { padding: 2px 16px; flex-direction: row; gap: 10px; align-items: baseline; }
  .pot em { font-size: 30px; }
  .phase { font-size: 10px; }
  .result { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 6; height: auto; min-height: 60px; }
  .log-wrap { display: none; }
  /* Above the card, right of the rival machine and cards: the one free corner, so it hides
     neither the portrait nor the name. */
  .speech { left: auto; right: 0; top: auto; bottom: calc(100% + 8px); max-width: 132px; font-size: 11px; padding: 6px 8px; }
  /* The player's own machine, full size. */
  .seat-you { --row: 40px; --reel-w: 58px; }
  .seat-you .sym { font-size: 26px; }
  .seat-you .lever { height: 150px; }
  .seat-you .lever-rod { height: 118px; }
  .seat-you .card { width: 52px; height: 72px; font-size: 26px; }
  .actions { height: auto; min-height: 96px; padding: 6px 8px 10px; }
  .hint { white-space: normal; height: auto; min-height: 16px; font-size: 11px; }
  .buttons { gap: 5px; min-height: 44px; }
  .btn { min-width: 70px; padding: 9px 10px; font-size: 13px; }
  .slider { width: 110px; }
  .title-panel { min-width: 0; width: 94vw; padding: 20px 16px; }
  .panel h1 { font-size: 34px; letter-spacing: 6px; }
  .fx-banner { font-size: 28px; padding: 12px 30px; }
  .amiga-face { width: 192px; height: 192px; }
  .amiga-title { font-size: 26px; }
  .amiga-bar { font-size: 15px; }
}
