:root {
  color-scheme: dark;
  --ink: #08070c;
  --surface: #101018;
  --surface-2: #18141a;
  --bone: #eee2c7;
  --muted: #9a9297;
  --gold: #d5a95f;
  --gold-hot: #f1d394;
  --blood: #8e2637;
  --blood-hot: #d6515c;
  --ice: #91bac8;
  --line: rgba(219, 177, 105, 0.25);
  --line-hot: rgba(241, 211, 148, 0.68);
  --shadow: rgba(0, 0, 0, 0.78);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  overscroll-behavior: none;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 22%, rgba(64, 71, 92, 0.26), transparent 32%),
    radial-gradient(circle at 50% 76%, rgba(91, 21, 38, 0.14), transparent 40%),
    #07070b;
}

button { font: inherit; }

button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-hot);
  outline-offset: 3px;
}

.hall,
.hall > * {
  position: fixed;
  pointer-events: none;
}

.hall {
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.stone-wall {
  inset: 0;
  opacity: 0.55;
  background:
    linear-gradient(rgba(5, 6, 10, 0.5), rgba(5, 6, 10, 0.74)),
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,0.025) 50%, transparent 51%),
    repeating-linear-gradient(0deg, #11111a 0 42px, #08090f 43px 46px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 112px, transparent 113px 118px);
  background-size: auto, 116px 46px, auto, 236px 46px;
}

.window {
  top: 9vh;
  width: min(18vw, 280px);
  height: 53vh;
  min-height: 390px;
  border: 13px solid rgba(26, 26, 34, 0.96);
  border-radius: 140px 140px 16px 16px;
  background:
    linear-gradient(rgba(8,11,20,0.13), rgba(4,7,14,0.34)),
    repeating-linear-gradient(112deg, transparent 0 22px, rgba(233,244,255,0.43) 23px 25px, transparent 26px 58px),
    linear-gradient(180deg, #345168 0%, #162a3b 58%, #0a111d 100%);
  box-shadow:
    inset 0 0 60px rgba(154, 202, 226, 0.16),
    0 0 0 3px rgba(92, 85, 86, 0.68),
    0 20px 80px rgba(0,0,0,0.75);
  overflow: hidden;
  opacity: 0.68;
}

.window::before,
.window::after {
  content: "";
  position: absolute;
  background: rgba(11, 12, 18, 0.86);
}

.window::before { width: 9px; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); }
.window::after { height: 9px; left: 0; right: 0; top: 39%; }
.window-left { left: 18vw; transform: rotate(-0.8deg); }
.window-right { right: 18vw; transform: rotate(0.8deg); }

.window i {
  position: absolute;
  width: 3px;
  height: 55px;
  background: linear-gradient(#f8ebc7, #efb85d 46%, transparent 47%);
  filter: drop-shadow(0 0 8px #e6a44f);
  animation: candle-flicker 1.9s ease-in-out infinite alternate;
}

.window i:nth-child(1) { left: 20%; top: 26%; }
.window i:nth-child(2) { left: 72%; top: 46%; animation-delay: -0.7s; }
.window i:nth-child(3) { left: 48%; top: 72%; animation-delay: -1.1s; }

.curtain {
  top: -4vh;
  bottom: 24vh;
  width: min(18vw, 320px);
  opacity: 0.82;
  filter: drop-shadow(0 24px 34px rgba(0,0,0,0.68));
  background:
    linear-gradient(90deg, rgba(0,0,0,0.5), transparent 16%, rgba(186,42,63,0.18) 35%, rgba(0,0,0,0.42) 52%, transparent 72%, rgba(0,0,0,0.55)),
    #4c0d1d;
}

.curtain-left {
  left: 7vw;
  clip-path: polygon(0 0,100% 0,88% 22%,97% 49%,77% 72%,89% 100%,0 100%);
}

.curtain-right {
  right: 7vw;
  clip-path: polygon(0 0,100% 0,100% 100%,11% 100%,23% 72%,3% 49%,12% 22%);
}

.snow {
  inset: -10%;
  background-image:
    radial-gradient(circle, rgba(240,248,255,0.8) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(240,248,255,0.42) 0 1px, transparent 1.4px);
  background-size: 47px 47px, 83px 83px;
  background-position: 0 0, 31px 20px;
  opacity: 0.18;
  transform: rotate(12deg);
  animation: snow-drift 12s linear infinite;
}

.snow-b {
  opacity: 0.1;
  filter: blur(1px);
  transform: rotate(16deg) scale(1.2);
  animation-duration: 21s;
  animation-direction: reverse;
}

.candle-row {
  top: 20vh;
  width: 10px;
  height: 62vh;
  opacity: 0.6;
  background:
    radial-gradient(circle at 50% 2%, #fff2ca 0 3px, #f3a74a 4px 7px, transparent 8px),
    linear-gradient(#dec79f 0 38px, transparent 39px);
  background-size: 10px 120px;
  filter: drop-shadow(0 0 12px rgba(235, 146, 58, 0.78));
}

.candle-row-left { left: 14.7vw; }
.candle-row-right { right: 14.7vw; }

.app {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.topbar {
  min-height: 54px;
  padding: 9px clamp(12px, 2vw, 30px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(220, 178, 106, 0.14);
  background: linear-gradient(180deg, rgba(7,7,11,0.94), rgba(7,7,11,0.64));
  backdrop-filter: blur(12px);
}

.studio-lockup { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.studio-mark {
  color: var(--gold-hot);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  letter-spacing: 0.26em;
  font-weight: 700;
}
.build-label {
  color: #7d767c;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.top-actions { display: flex; align-items: center; gap: 8px; }
.mode-badge,
.small-button {
  min-height: 33px;
  padding: 0 11px;
  border: 1px solid rgba(219,177,105,0.22);
  border-radius: 5px;
  background: rgba(18,16,22,0.86);
  color: #a9a2a5;
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  font-weight: 750;
}
.small-button { cursor: pointer; transition: 120ms ease; }
.small-button:hover { color: var(--bone); border-color: rgba(219,177,105,0.48); background: rgba(30,23,28,0.94); }
.small-button[aria-pressed="true"] { color: var(--gold-hot); border-color: rgba(219,177,105,0.62); }
.mode-badge.forced { color: #f17b83; border-color: rgba(214,81,92,0.5); }
.mode-badge.live { color: #a6d8d2; border-color: rgba(118,188,181,0.46); }

.scene {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.48fr) minmax(520px, 980px) minmax(0, 0.48fr);
  align-items: end;
  justify-content: center;
  gap: clamp(0px, 1vw, 18px);
  padding: 6px clamp(4px, 1vw, 18px) 10px;
  overflow: hidden;
}

.character {
  align-self: stretch;
  position: relative;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0.84;
  filter: saturate(0.88) contrast(1.08) brightness(0.8);
}
.character::after {
  content: "";
  position: absolute;
  inset: 28% 2% 0;
  background: radial-gradient(ellipse at 50% 70%, rgba(0,0,0,0.1), rgba(0,0,0,0.8) 72%);
  z-index: -1;
}
.character img {
  width: min(100%, 410px);
  max-height: 78vh;
  object-fit: contain;
  object-position: bottom center;
  display: block;
}
.character-huntress img { transform: translateX(3%) scale(1.05); }
.character-bride img { transform: translateX(-3%) scale(1.05); }
.character-caption {
  position: absolute;
  bottom: 12px;
  max-width: 250px;
  padding: 9px 12px;
  border-left: 2px solid rgba(213,169,95,0.52);
  background: linear-gradient(90deg, rgba(7,7,11,0.88), transparent);
  text-shadow: 0 2px 8px #000;
}
.character-caption strong { display: block; color: #d7c49f; font-family: Georgia, serif; font-size: 0.72rem; letter-spacing: 0.13em; }
.character-caption span { color: #928b90; font-size: 0.64rem; line-height: 1.35; }
.character-huntress .character-caption { left: 16%; }
.character-bride .character-caption { right: 16%; border-left: 0; border-right: 2px solid rgba(213,169,95,0.52); text-align: right; background: linear-gradient(270deg, rgba(7,7,11,0.88), transparent); }

.machine {
  width: min(100%, 980px);
  min-width: 0;
  align-self: center;
  display: grid;
  gap: 7px;
}

.title-lockup { text-align: center; position: relative; padding: 2px 10px 0; }
.title-lockup h1 {
  margin: 0;
  color: #f2ead6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 3.7vw, 4rem);
  line-height: 0.9;
  letter-spacing: 0.055em;
  text-shadow: 0 3px 0 #27171b, 0 0 24px rgba(178, 107, 82, 0.24), 0 8px 28px #000;
}
.title-lockup h1 small { font-size: 0.39em; letter-spacing: 0.22em; vertical-align: 0.34em; margin-right: 0.25em; color: #bcae99; }
.title-lockup p { margin: 7px 0 0; color: #b09c8e; font-family: Georgia, serif; font-size: clamp(0.58rem, 1vw, 0.74rem); letter-spacing: 0.34em; }
.title-lockup::before,
.title-lockup::after {
  content: "";
  position: absolute;
  top: 55%;
  width: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(213,169,95,0.5));
}
.title-lockup::before { left: 2%; }
.title-lockup::after { right: 2%; transform: scaleX(-1); }

.round-hud {
  min-height: 37px;
  display: grid;
  grid-template-columns: 1fr minmax(210px, 1.5fr) 1fr;
  gap: 12px;
  align-items: end;
  padding: 0 7px;
}
.hud-block { display: grid; gap: 2px; }
.hud-block span,
.eyes-panel > span { color: #877f84; font-size: 0.56rem; letter-spacing: 0.15em; font-weight: 700; }
.hud-block strong { color: #d5cbb9; font-size: 0.84rem; letter-spacing: 0.07em; }
.hud-right { text-align: right; }
.eyes-panel { display: grid; justify-items: center; gap: 5px; }
.eye-track { display: flex; gap: 16px; }
.eye-track i {
  width: 25px;
  height: 13px;
  position: relative;
  display: block;
  border: 1px solid rgba(144,139,144,0.42);
  border-radius: 50% 10% 50% 10%;
  transform: rotate(45deg);
  transition: 280ms ease;
}
.eye-track i::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: 50%; top: 50%;
  border-radius: 50%;
  background: #423c42;
  transform: translate(-50%,-50%);
  transition: 280ms ease;
}
.eye-track i.lit {
  border-color: rgba(226,84,93,0.92);
  box-shadow: 0 0 13px rgba(210,49,61,0.62);
}
.eye-track i.lit::after { background: #ff6870; box-shadow: 0 0 9px #d62f41; }

.board-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 1.56 / 1;
  min-height: 410px;
  max-height: calc(100svh - 245px);
  overflow: visible;
  border: 4px solid #3e281f;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(20,18,24,0.4), rgba(3,4,8,0.9)),
    radial-gradient(circle at 50% -10%, rgba(139,42,49,0.18), transparent 50%),
    #090a0f;
  box-shadow:
    0 0 0 2px rgba(181,132,74,0.26),
    0 0 0 12px rgba(18,10,10,0.82),
    0 18px 65px rgba(0,0,0,0.78),
    inset 0 0 50px rgba(0,0,0,0.68);
}

.board-shell::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 19px;
  background:
    linear-gradient(90deg, transparent, rgba(223,179,106,0.27) 50%, transparent) top / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, #2d1715 0 18px, #1b0f10 18px 36px);
}

.banquet-rail {
  position: absolute;
  left: 2%; right: 2%;
  z-index: 20;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cdb783;
  text-shadow: 0 2px 5px #000;
}
.banquet-rail-top {
  top: -28px;
  height: 28px;
  gap: 13px;
  font-family: Georgia, serif;
  font-size: 0.63rem;
  letter-spacing: 0.13em;
  background: linear-gradient(180deg, #4e2b1d, #1c1010);
  border: 1px solid rgba(213,169,95,0.47);
  border-radius: 11px 11px 2px 2px;
}
.banquet-rail-top i { width: 20%; height: 1px; background: linear-gradient(90deg, transparent, rgba(213,169,95,0.46)); }
.banquet-rail-top i:last-child { transform: scaleX(-1); }
.banquet-rail-bottom {
  bottom: -28px;
  height: 32px;
  gap: 12px;
  justify-content: space-around;
  background: linear-gradient(180deg, #3c2118, #170d0d);
  border: 1px solid rgba(213,169,95,0.33);
  border-radius: 2px 2px 10px 10px;
}
.banquet-rail-bottom i { flex: 1; max-width: 55%; height: 1px; background: rgba(213,169,95,0.19); }
.plate { width: 32px; height: 10px; border-radius: 50%; background: #59575b; border: 1px solid #a19a8e; }
.goblet { width: 13px; height: 22px; border-radius: 50% 50% 35% 35%; border: 1px solid #d0a767; position: relative; }
.goblet::after { content:""; position:absolute; width:1px; height:10px; background:#d0a767; left:50%; top:100%; }

.board {
  position: absolute;
  inset: 4%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  grid-template-rows: repeat(5, minmax(0,1fr));
  gap: clamp(3px, 0.5vw, 8px);
  z-index: 10;
}

.cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(150,121,88,0.62);
  border-radius: clamp(5px, 0.65vw, 10px);
  background:
    radial-gradient(circle at 50% 35%, rgba(84,71,75,0.2), transparent 55%),
    linear-gradient(155deg, rgba(38,35,43,0.98), rgba(10,10,15,0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.025),
    inset 0 -18px 24px rgba(0,0,0,0.38),
    0 4px 8px rgba(0,0,0,0.34);
  transform: translateZ(0);
  transition: transform 180ms ease, opacity 180ms ease, border-color 160ms ease, filter 160ms ease;
}
.cell::before,
.cell::after {
  content: "";
  position: absolute;
  width: 11px; height: 11px;
  opacity: 0.45;
}
.cell::before { left: 4px; top: 4px; border-left: 1px solid var(--gold); border-top: 1px solid var(--gold); }
.cell::after { right: 4px; bottom: 4px; border-right: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.cell .symbol-svg { width: 82%; height: 82%; filter: drop-shadow(0 5px 6px rgba(0,0,0,0.65)); }
.cell .symbol-name {
  position: absolute;
  left: 5px; right: 5px; bottom: 3px;
  overflow: hidden;
  color: rgba(226,218,204,0.57);
  font-size: clamp(0.37rem, 0.65vw, 0.58rem);
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.08em;
}
.cell .position-mult {
  position: absolute;
  right: 5px; top: 4px;
  min-width: 26px;
  min-height: 22px;
  display: grid;
  place-items: center;
  padding: 1px 5px;
  border-radius: 50%;
  border: 1px solid rgba(140,210,220,0.8);
  background: rgba(19,79,91,0.85);
  color: #d8fbff;
  font-family: Georgia, serif;
  font-size: clamp(0.58rem,1vw,0.85rem);
  box-shadow: 0 0 12px rgba(56,175,188,0.38);
}
.cell.is-winning {
  border-color: var(--gold-hot);
  box-shadow:
    inset 0 0 24px rgba(219,151,65,0.28),
    0 0 19px rgba(218,151,66,0.42);
  animation: winning-pulse 0.52s ease-in-out infinite alternate;
}
.cell.is-cracking { animation: crack-shake 0.42s ease-in-out both; }
.cell.is-removing { opacity: 0; transform: scale(0.58) rotate(3deg); filter: brightness(1.9); }
.cell.is-dropping { animation: drop-in 0.45s cubic-bezier(.2,.72,.18,1) both; animation-delay: var(--delay, 0ms); }
.cell.is-reveal { border-color: rgba(223,205,169,0.92); background: radial-gradient(circle, rgba(220,206,175,0.14), rgba(9,9,14,0.98)); }
.cell.is-eye { border-color: rgba(216,66,76,0.85); box-shadow: inset 0 0 28px rgba(116,19,29,0.35), 0 0 18px rgba(216,66,76,0.3); }
.cell.is-wild { border-color: rgba(228,188,105,0.9); box-shadow: inset 0 0 30px rgba(210,151,50,0.27), 0 0 15px rgba(222,177,87,0.25); }
.cell.is-hidden-by-guest { filter: brightness(0.24) saturate(0.35); }

.cell.shard::after { animation: shard-flash 0.45s ease both; }

.guest-shadow {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -3%;
  width: 47%;
  height: 73%;
  transform: translateX(-50%) translateY(-18%) scale(0.84);
  opacity: 0;
  filter: blur(1px);
  transition: 700ms cubic-bezier(.2,.7,.2,1);
  pointer-events: none;
}
.guest-shadow.visible { opacity: 0.66; transform: translateX(-50%) translateY(-2%) scale(1); }
.guest-shadow .guest-head {
  position: absolute;
  left: 50%; top: 4%;
  width: 26%; aspect-ratio: 0.82;
  transform: translateX(-50%);
  clip-path: polygon(20% 0,80% 0,100% 38%,84% 86%,50% 100%,16% 86%,0 38%);
  background: linear-gradient(145deg, #c5baa8, #615861 60%, #17151b);
  box-shadow: 0 0 35px #000;
}
.guest-shadow .guest-head::before,
.guest-shadow .guest-head::after {
  content:"";
  position:absolute;
  width:30%; height:13%;
  top:38%;
  background:#09070b;
  transform:skewX(-17deg);
}
.guest-shadow .guest-head::before { left:12%; }
.guest-shadow .guest-head::after { right:12%; transform:skewX(17deg); }
.guest-shadow .guest-head i {
  position:absolute;
  width:6px;height:6px;
  top:42%;
  border-radius:50%;
  background:#f04c59;
  box-shadow:0 0 11px #d12f3e;
  z-index:2;
}
.guest-shadow .guest-head i:first-child { left:26%; }
.guest-shadow .guest-head i:last-child { right:26%; }
.guest-shadow .guest-body {
  position:absolute;
  left:18%; right:18%; top:25%; bottom:0;
  clip-path: polygon(24% 0,76% 0,100% 100%,0 100%);
  background: linear-gradient(90deg, transparent, rgba(4,4,8,.95) 26% 74%, transparent);
}
.guest-shadow .guest-hand { position:absolute; top:39%; width:8%; height:55%; background:#050509; border-radius:40%; transform-origin:top; }
.guest-shadow .hand-left { left:14%; transform:rotate(23deg); }
.guest-shadow .hand-right { right:14%; transform:rotate(-23deg); }
.guest-crown {
  position:absolute; left:39%; top:-5%; width:22%; height:14%;
  clip-path: polygon(0 100%,8% 12%,28% 72%,50% 0,72% 72%,92% 12%,100% 100%);
  background:rgba(10,9,13,0.94);
}

.guest-mega {
  position: absolute;
  z-index: 35;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  border: 3px solid rgba(212,81,92,0.88);
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 40%, rgba(105,25,38,0.22), transparent 55%),
    rgba(5,5,9,0.62);
  box-shadow: inset 0 0 33px rgba(0,0,0,0.78), 0 0 25px rgba(184,42,55,0.52);
  transform: scale(0.75);
  transition: left 360ms cubic-bezier(.2,.8,.2,1), top 360ms cubic-bezier(.2,.8,.2,1), opacity 260ms ease, transform 360ms ease;
}
.guest-mega.visible { opacity: 1; transform: scale(1); }
.guest-mega.roaming { animation: guest-roam 0.48s ease both; }
.guest-mega .mega-mask {
  position:relative;
  width:54%; aspect-ratio:0.95;
  clip-path:polygon(16% 0,84% 0,100% 38%,84% 86%,50% 100%,16% 86%,0 38%);
  background:linear-gradient(145deg,#ded3bd,#84757a 55%,#271e25);
  box-shadow:0 0 25px #000;
}
.mega-eye { position:absolute; top:40%; width:26%; height:12%; background:#0c090d; }
.mega-eye::after { content:""; position:absolute; width:6px;height:6px; top:50%; left:50%; transform:translate(-50%,-50%); border-radius:50%; background:#f65863; box-shadow:0 0 11px #d52e3f; }
.mega-eye.left { left:12%; transform:skewX(-14deg); }
.mega-eye.right { right:12%; transform:skewX(14deg); }
.mega-crack { position:absolute; width:2px; background:#31252b; transform-origin:top; }
.mega-crack.c1 { left:50%; top:0; height:52%; transform:rotate(7deg); }
.mega-crack.c2 { left:46%; top:45%; height:43%; transform:rotate(-18deg); }
.mega-crack.c3 { left:65%; top:25%; height:30%; transform:rotate(35deg); }
.guest-mega strong { font-family:Georgia,serif; font-size:clamp(.76rem,1.4vw,1.13rem); letter-spacing:.12em; color:#f0dfbf; text-shadow:0 2px 8px #000; }
.guest-mega > span { font-size:clamp(.48rem,.8vw,.68rem); letter-spacing:.2em; color:#d95562; font-weight:800; }

.reveal-banner,
.win-overlay,
.error-overlay {
  position: absolute;
  z-index: 60;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}
.reveal-banner { background: radial-gradient(circle, rgba(68,13,22,0.2), transparent 52%); text-shadow:0 3px 16px #000; }
.reveal-banner.visible { opacity:1; animation: banner-hit .9s ease both; }
.reveal-banner span { color:#d5b88d; font-size:clamp(.55rem,1vw,.72rem); letter-spacing:.3em; font-weight:800; }
.reveal-banner strong { margin-top:5px; font-family:Georgia,serif; color:#fff0d3; font-size:clamp(1.6rem,4vw,4rem); letter-spacing:.08em; }

.win-overlay { background:radial-gradient(circle, rgba(17,14,16,0.84), rgba(5,5,8,0.1) 54%, transparent 65%); }
.win-overlay.visible { opacity:1; }
.win-overlay span { color:#c6b391; font-size:.65rem; letter-spacing:.28em; font-weight:800; }
.win-overlay strong { color:#f4d88f; font-family:Georgia,serif; font-size:clamp(3rem,8vw,7rem); line-height:.9; text-shadow:0 0 35px rgba(238,177,74,.48),0 5px 10px #000; }

.error-overlay { pointer-events:auto; background:rgba(5,5,8,.91); gap:9px; padding:30px; }
.error-overlay[aria-hidden="false"] { opacity:1; }
.error-overlay strong { color:#f16b75; font-family:Georgia,serif; font-size:1.8rem; }
.error-overlay span { max-width:420px; color:#b8b0b3; line-height:1.5; }
.error-overlay button { padding:10px 16px; border:1px solid #c48d57; border-radius:5px; background:#241216; color:#f0dcc2; cursor:pointer; }

.round-message {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 8px;
  color: #a49ca0;
  font-size: clamp(0.63rem, 1.2vw, 0.78rem);
}
.round-message strong { flex:0 0 auto; color:#e4c888; font-family:Georgia,serif; font-size:1.08rem; }

.controls {
  position: relative;
  z-index: 100;
  min-height: 106px;
  padding: 10px clamp(10px, 2vw, 30px) calc(10px + var(--safe-bottom));
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.1fr) 132px minmax(150px, 1fr) minmax(180px, 1.1fr);
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 18px);
  border-top: 1px solid rgba(213,169,95,0.24);
  background: linear-gradient(180deg, rgba(7,7,11,0.9), #06070b 45%);
  box-shadow: 0 -18px 40px rgba(0,0,0,0.28);
  backdrop-filter: blur(14px);
}
.money-box,
.bet-box,
.compliance-note {
  min-height: 72px;
  padding: 9px 16px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(137,117,97,0.36);
  border-radius: 8px;
  background: rgba(18,17,23,0.8);
}
.money-box span,
.bet-box > span,
.compliance-note strong { color:#827b80; font-size:.58rem; letter-spacing:.14em; font-weight:800; }
.money-box strong,
.bet-box strong { color:#eee7d8; font-family:Georgia,serif; font-size:1.28rem; letter-spacing:.03em; }
.win-box strong { color:#e0c17f; }
.stepper { display:grid; grid-template-columns:38px 1fr 38px; align-items:center; gap:8px; text-align:center; }
.stepper button {
  width:36px;height:36px;border-radius:50%;border:1px solid rgba(157,137,111,.45);background:#14141a;color:#e4d9c6;cursor:pointer;font-size:1.2rem;
}
.stepper button:disabled { opacity:.35; cursor:not-allowed; }

.spin-button {
  position: relative;
  width: 116px;
  height: 92px;
  justify-self: center;
  border: 0;
  background: transparent;
  color: #f7e7c6;
  cursor: pointer;
  display: grid;
  place-content: center;
  gap: 2px;
  text-align: center;
  isolation: isolate;
}
.spin-button::before,
.spin-button::after,
.spin-ring {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
}
.spin-button::before {
  inset: 3px 15px;
  background: radial-gradient(circle at 44% 35%, #7b2635, #3e121c 64%, #190a0f);
  border: 3px solid #d9b26a;
  box-shadow: 0 0 0 4px #381f19, 0 0 25px rgba(181,54,70,.31), inset 0 0 18px rgba(0,0,0,.72);
}
.spin-button::after { inset:14px 26px; border:1px solid rgba(247,225,182,.34); }
.spin-ring { inset:7px 19px; border:1px dashed rgba(245,211,148,.44); transition:transform 900ms cubic-bezier(.2,.8,.2,1); }
.spin-button:hover .spin-ring { transform:rotate(90deg); }
.spin-button strong { font-family:Georgia,serif; font-size:1rem; letter-spacing:.08em; }
.spin-button small { color:#caad7e; font-size:.48rem; letter-spacing:.13em; }
.spin-button:disabled { cursor:not-allowed; filter:grayscale(.5); opacity:.54; }
.spin-button.spinning .spin-ring { animation:spin-ring .9s linear infinite; }

.compliance-note { border-color:rgba(117,110,118,.22); }
.compliance-note strong { color:#b6a27d; }
.compliance-note span { color:#817a7f; font-size:.67rem; line-height:1.35; }

.info-dialog {
  width:min(720px,calc(100vw - 24px));
  max-height:min(86svh,820px);
  padding:0;
  border:1px solid rgba(213,169,95,.42);
  border-radius:12px;
  color:var(--bone);
  background:#0d0c12;
  box-shadow:0 28px 100px #000;
}
.info-dialog::backdrop { background:rgba(2,2,5,.82); backdrop-filter:blur(8px); }
.info-card { display:grid; max-height:inherit; }
.info-card > header { padding:18px 20px; display:flex; align-items:center; justify-content:space-between; gap:18px; border-bottom:1px solid rgba(213,169,95,.22); background:linear-gradient(90deg,rgba(95,22,38,.18),transparent); }
.info-card header span { color:#9f9290; font-size:.58rem; letter-spacing:.15em; }
.info-card h2 { margin:3px 0 0; font-family:Georgia,serif; font-size:1.5rem; letter-spacing:.05em; }
.info-card header button { min-height:34px; padding:0 13px; border:1px solid rgba(213,169,95,.36); border-radius:5px; background:#19141a; color:#d7c7aa; cursor:pointer; }
.info-content { overflow:auto; padding:20px; display:grid; gap:18px; }
.info-content section { padding-bottom:18px; border-bottom:1px solid rgba(255,255,255,.06); }
.info-content h3 { margin:0 0 8px; color:#d7bd86; font-family:Georgia,serif; font-size:.88rem; letter-spacing:.12em; }
.info-content p { margin:7px 0; color:#b2aaad; font-size:.85rem; line-height:1.62; }
.info-content code { color:#f2d399; background:#17141a; padding:2px 5px; border-radius:4px; }
.facts-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.facts-grid div { min-height:74px; padding:10px; display:grid; align-content:center; gap:4px; border:1px solid rgba(213,169,95,.18); background:#111017; }
.facts-grid span { color:#817b80; font-size:.55rem; letter-spacing:.12em; }
.facts-grid strong { color:#e5d9c4; font-size:.78rem; }
.prototype-warning { border:1px solid rgba(183,61,73,.3)!important; padding:14px!important; background:rgba(94,19,30,.12); }

@keyframes candle-flicker { from { opacity:.68; transform:scaleY(.94); } to { opacity:1; transform:scaleY(1.07); } }
@keyframes snow-drift { to { background-position: 240px 260px, -150px 310px; } }
@keyframes winning-pulse { from { transform:scale(.985); filter:brightness(1); } to { transform:scale(1.025); filter:brightness(1.22); } }
@keyframes crack-shake { 0%{transform:translate(0) rotate(0)} 20%{transform:translate(-3px,1px) rotate(-1deg)} 40%{transform:translate(4px,-1px) rotate(1deg)} 60%{transform:translate(-2px,-2px)} 80%{transform:translate(2px,1px)} 100%{transform:translate(0)} }
@keyframes drop-in { from { opacity:0; transform:translateY(-55%) scale(.92); filter:brightness(1.6); } to { opacity:1; transform:translateY(0) scale(1); filter:brightness(1); } }
@keyframes shard-flash { 0%{box-shadow:0 0 0 rgba(255,255,255,0)} 50%{box-shadow:0 0 25px rgba(255,241,216,.55)} 100%{box-shadow:0 0 0 rgba(255,255,255,0)} }
@keyframes guest-roam { 0%{filter:blur(0);transform:scale(1)} 40%{filter:blur(5px);transform:scale(.88)} 100%{filter:blur(0);transform:scale(1)} }
@keyframes banner-hit { 0%{transform:scale(1.25);filter:blur(8px)} 18%{transform:scale(1);filter:blur(0)} 70%{opacity:1} 100%{opacity:0} }
@keyframes spin-ring { to { transform:rotate(360deg); } }

@media (max-width: 1260px) {
  .scene { grid-template-columns: minmax(0, .25fr) minmax(500px, 920px) minmax(0,.25fr); }
  .character-caption { display:none; }
  .character img { width:480px; max-width:none; opacity:.68; }
  .character-huntress img { transform:translateX(25%) scale(1.03); }
  .character-bride img { transform:translateX(-25%) scale(1.03); }
  .controls { grid-template-columns:minmax(130px,1fr) minmax(170px,1.1fr) 122px minmax(130px,1fr); }
  .compliance-note { display:none; }
}

@media (max-width: 900px) {
  .topbar { min-height:48px; }
  .build-label,.mode-badge { display:none; }
  .scene { display:block; padding:6px 10px 12px; overflow:visible; }
  .character { display:none; }
  .machine { margin:0 auto; width:min(100%,760px); }
  .board-shell { max-height:none; min-height:0; aspect-ratio:1.35/1; }
  .title-lockup h1 { font-size:clamp(1.65rem,6vw,3rem); }
  .controls { min-height:98px; grid-template-columns:1fr 1.05fr 104px 1fr; gap:7px; padding:8px 8px calc(8px + var(--safe-bottom)); }
  .money-box,.bet-box { padding:7px 9px; min-height:67px; }
  .spin-button { width:100px;height:80px; }
  .spin-button::before { inset:2px 14px; }
  .spin-button::after { inset:12px 24px; }
  .spin-ring { inset:6px 18px; }
  .round-hud { grid-template-columns:.8fr 1.4fr .8fr; }
  .hall .window { opacity:.34; }
  .curtain { opacity:.48; }
}

@media (max-width: 620px) {
  body { overflow-y:auto; }
  .app { min-height:100svh; grid-template-rows:auto auto auto; }
  .topbar { padding:7px 9px; position:relative; z-index:110; }
  .studio-mark { font-size:.78rem; }
  .top-actions { gap:5px; }
  .small-button { min-height:30px; padding:0 8px; font-size:.56rem; }
  .scene { padding:4px 5px 8px; }
  .title-lockup { padding-top:5px; }
  .title-lockup h1 { font-size:clamp(1.35rem,7.2vw,2rem); letter-spacing:.025em; }
  .title-lockup p { margin-top:5px; font-size:.52rem; letter-spacing:.22em; }
  .round-hud { min-height:32px; grid-template-columns:1fr 1.4fr 1fr; gap:5px; padding:0 2px; }
  .hud-block span,.eyes-panel>span { font-size:.45rem; letter-spacing:.08em; }
  .hud-block strong { font-size:.66rem; }
  .eye-track { gap:9px; }
  .eye-track i { width:18px;height:9px; }
  .board-shell { aspect-ratio:1.22/1; border-width:3px; border-radius:8px; }
  .board { inset:3%; gap:3px; }
  .cell { border-radius:5px; }
  .cell::before,.cell::after { display:none; }
  .cell .symbol-svg { width:91%; height:91%; }
  .cell .symbol-name { display:none; }
  .cell .position-mult { min-width:20px;min-height:17px;font-size:.54rem;right:2px;top:2px;padding:0 3px; }
  .banquet-rail-top { top:-21px;height:21px;font-size:.48rem; }
  .banquet-rail-bottom { bottom:-21px;height:22px; }
  .plate { width:18px;height:6px; }
  .goblet { width:8px;height:14px; }
  .round-message { margin-top:17px; padding:0 3px; min-height:26px; font-size:.56rem; }
  .round-message strong { font-size:.9rem; }
  .controls {
    position:sticky;
    bottom:0;
    grid-template-columns:1fr 1.15fr 88px;
    min-height:90px;
    padding:6px 6px calc(6px + var(--safe-bottom));
    box-shadow:0 -12px 30px rgba(0,0,0,.7);
  }
  .money-box,.bet-box { min-height:61px; padding:5px 7px; }
  .money-box span,.bet-box>span { font-size:.46rem; }
  .money-box strong,.bet-box strong { font-size:.94rem; }
  .win-box { display:none; }
  .stepper { grid-template-columns:27px 1fr 27px; gap:2px; }
  .stepper button { width:27px;height:27px;font-size:.88rem; }
  .spin-button { width:84px;height:72px; }
  .spin-button::before { inset:2px 8px; }
  .spin-button::after { inset:11px 17px; }
  .spin-ring { inset:6px 12px; }
  .spin-button strong { font-size:.76rem; }
  .spin-button small { font-size:.38rem; }
  .facts-grid { grid-template-columns:1fr 1fr; }
}

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

/* Layout clearance for the carved rails outside the mathematical grid. */
@media (min-width: 621px) {
  .board-shell { margin-top: 23px; }
  .round-message { margin-top: 25px; }
}
