@charset "UTF-8";

:root {
  color-scheme: dark;
  --ink: #fff0cf;
  --muted: #c6acbd;
  --gold: #ffd17c;
  --mint: #93f6c9;
  --pink: #ff789d;
  --night: #120e1b;
  --frame: #4c324e;
  --digits: "Cascadia Mono", Consolas, monospace;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  min-width: 280px;
  min-height: 100dvh;
  display: flow-root;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 0, #382139 0%, transparent 65%),
    repeating-linear-gradient(135deg, #15101e 0 5px, #171121 5px 10px);
}
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid #fff2be; outline-offset: 4px; }
button:disabled { cursor: default; }
h1, h2, ol { margin: 0; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.cabinet {
  width: min(100% - 56px, 1296px);
  margin: 26px auto 32px;
}
.top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 18px;
  background: #1c1428;
  border: 1px solid var(--frame);
  border-top: 3px solid #986180;
  box-shadow: 0 5px #0d0a13, inset 0 0 0 3px #261b32;
}
.brand, .controls { display: flex; align-items: center; }
.brand { grid-column: 2; justify-self: center; gap: 16px; }
.controls { grid-column: 3; justify-self: end; gap: 9px; }
.brand h1 {
  font-size: clamp(26px, 4.2vw, 52px);
  font-weight: 1000;
  letter-spacing: .085em;
  line-height: 1.14;
  color: #ffe3a0;
  text-shadow: 2px 2px #924c58, 4px 4px #4a263f, 0 0 24px #ffac5340;
  white-space: nowrap;
}
:lang(en) .brand h1 { letter-spacing: .025em; }
.brand-mark {
  display: grid;
  width: 45px;
  aspect-ratio: 1;
  place-items: center;
  flex: none;
  color: var(--gold);
  background: #34213b;
  border: 1px solid #c3758d;
  box-shadow: inset 0 0 0 3px #20162d;
}
.brand-mark i {
  width: 21px;
  height: 15px;
  background: #d68a50;
  border: 2px solid #ffe9a4;
  box-shadow: 0 2px #7d3b44;
  position: relative;
}
.brand-mark i::before {
  content: "";
  position: absolute;
  inset: -6px 4px auto;
  height: 4px;
  border: 2px solid #ffe9a4;
  border-bottom: 0;
}
.brand-mark i::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  left: calc(50% - 2px);
  top: 2px;
  background: #422139;
}
.tool {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #6c4965;
  background: #32233c;
  color: var(--ink);
  box-shadow: 0 3px #100c19;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.tool:hover:not(:disabled) { background: #4a3050; }
.tool:disabled { opacity: .48; }
.tool[aria-pressed="true"] { color: #ff99b5; }

.arena {
  display: grid;
  grid-template-columns: minmax(119px, 1fr) minmax(0, 5.55fr) minmax(119px, 1fr);
  gap: 16px;
  align-items: start;
}
.prizes {
  --tile-edge: #4c857c;
  --tile-shine: #6eab91;
  --tile-base: #192e37;
  --tile-ink: #c5ffe3;
  border: 1px solid var(--frame);
  padding: 9px;
  background: #1a1425;
  box-shadow: 0 5px #0d0a13;
}
.prizes.high {
  --tile-edge: #a96853;
  --tile-shine: #d49a64;
  --tile-base: #4a2838;
  --tile-ink: #ffe1a6;
}
.prizes ol { display: grid; gap: 5px; padding: 0; list-style: none; }
.prizes li {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 2px;
  font-family: var(--digits);
  font-weight: 800;
  font-size: clamp(12px, 1.35vw, 19px);
  letter-spacing: -.05em;
  color: var(--tile-ink);
  background: linear-gradient(90deg, var(--tile-base), color-mix(in srgb, var(--tile-base), #0d0b16 23%));
  border: 1px solid var(--tile-edge);
  border-left: 4px solid var(--tile-shine);
  box-shadow: inset 0 1px #ffffff16, 0 2px #0e0b16;
  transition: filter .35s, opacity .35s;
}
.prizes li.eliminated {
  opacity: .42;
  filter: grayscale(1);
  text-decoration: line-through 2px;
}

.stage {
  --neon: #ff789d;
  --tint: #5c294f;
  --floor: #1c142a;
  position: relative;
  isolation: isolate;
  min-width: 0;
  overflow: hidden;
  background: #1a1426;
  border: 1px solid #825673;
  border-top: 3px solid var(--neon);
  box-shadow: 0 6px #0d0a13, 0 0 24px #f366a624;
}
.stage[data-set="live"] {
  --neon: #86ebcf;
  --tint: #275458;
  --floor: #101e2a;
  border-color: #669b91;
  box-shadow: 0 6px #0d0a13, 0 0 26px #6ceac323;
}
.stage[data-phase="transition"]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #e8ffe3 46% 54%, transparent);
  animation: change-set 680ms ease-in-out both;
}
.stage-head {
  padding: 20px 12px 16px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0, var(--tint), #23182e 72%);
  border-bottom: 1px solid var(--frame);
}
.round {
  display: inline-block;
  color: var(--neon);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .14em;
}
.stage-head h2 {
  margin-top: 6px;
  color: #fff0cf;
  font-size: clamp(24px, 3.65vw, 46px);
  line-height: 1.2;
  letter-spacing: .07em;
  font-weight: 1000;
  text-shadow: 2px 3px #110c21, 0 0 22px color-mix(in srgb, var(--neon) 40%, transparent);
}
.stage-meta { margin: 7px 0 13px; color: #dec4d4; font-size: 13px; }
.progress {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
  width: min(42%, 270px);
  margin: auto;
}
.progress i { height: 4px; background: #52425a; }
.progress .done { background: #75a598; }
.progress .current { background: var(--neon); box-shadow: 0 0 10px var(--neon); }

.floor {
  --spot: color-mix(in srgb, var(--neon) 24%, transparent);
  padding: 18px clamp(12px, 2.2vw, 28px) 24px;
  background:
    radial-gradient(ellipse at 50% -35%, var(--spot), transparent 75%),
    repeating-linear-gradient(90deg, transparent 0 43px, #d6a4e00a 43px 44px),
    repeating-linear-gradient(0deg, transparent 0 27px, #d6a4e00d 27px 28px),
    var(--floor);
}
.board {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  column-gap: clamp(6px, 1vw, 14px);
  row-gap: 14px;
  position: relative;
}
.seat {
  --sprite-width: clamp(40px, 5.55vw, 74px);
  min-height: 105px;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  padding: 0 0 9px;
  border: 0;
  border-bottom: 1px solid #9b7d9f44;
  color: #361e32;
  background: linear-gradient(0deg, #20172b78, transparent 57%);
}
.seat::before {
  content: "";
  position: absolute;
  inset: -5px -5px 4px;
  background: radial-gradient(ellipse at 50% 65%, var(--spot), transparent 67%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
}
.seat:focus-visible { outline-offset: 1px; }
.seat:not(:disabled):is(:hover, :focus-visible)::before, .seat.mine::before { opacity: 1; }
.portrait {
  display: block;
  flex: none;
  width: var(--sprite-width);
  max-width: 100%;
  aspect-ratio: 40 / 48;
  background: url("assets/hostesses.png") var(--sprite-x) var(--sprite-y) / 1300% 200% no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(2px 4px 0 #100b1c9e);
  transform-origin: bottom center;
}
.seat .portrait, .seat .case-art { transition: transform .20s ease-out, filter .20s ease-out; }
.seat:not(:disabled):is(:hover, :focus-visible) .portrait { transform: translateY(-5px) rotate(-5deg); filter: drop-shadow(0 0 6px var(--spot)); }
.seat:not(:disabled):is(:hover, :focus-visible) .case-art { transform: translateY(-3px) rotate(4deg); filter: brightness(1.18); }
.seat .case-art {
  margin-top: -25%;
  width: min(100%, 72px);
  height: clamp(33px, 3.8vw, 48px);
}
.case-art {
  display: block;
  position: relative;
  isolation: isolate;
  --case-light: #ffe9a4;
  --case-metal: #f9c66d;
  --case-shade: #ad5f48;
  --case-deep: #633947;
}
.case-front, .case-lid, .handle { position: absolute; }
.handle {
  inset: 0 34% auto;
  height: 21%;
  border: 2px solid var(--case-light);
  border-bottom: 0;
  background: #362338;
}
.case-lid {
  inset: 16% 0 auto;
  height: 24%;
  z-index: 1;
  border: 1px solid var(--case-light);
  background: linear-gradient(var(--case-light), var(--case-metal));
  box-shadow: inset 3px 0 var(--case-shade), inset -3px 0 var(--case-shade);
  transform-origin: bottom center;
}
.case-front {
  inset: 36% 0 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--case-light);
  background: linear-gradient(180deg, var(--case-metal), var(--case-shade));
  box-shadow: inset 3px 0 var(--case-deep), inset -3px 0 var(--case-deep), 0 3px var(--case-deep), 0 5px #100d19;
}
.case-front::before, .case-front::after {
  content: "";
  width: 3px;
  height: 4px;
  top: -1px;
  position: absolute;
  z-index: 2;
  background: #fff0b8;
  box-shadow: 0 2px #765045;
}
.case-front::before { left: 13%; }
.case-front::after { right: 13%; }
.case-front span {
  padding: 0 .15em;
  line-height: 1;
  color: #321e30;
  font: 900 clamp(16px, 2vw, 25px) / 1 var(--digits);
  text-shadow: 1px 1px #ffe6a980;
}
.mine .case-art {
  --case-light: #cbffdc;
  --case-metal: #81e8b9;
  --case-shade: #388b81;
  --case-deep: #255863;
}
.seat.mine .case-front span { font: 900 12px / 1 system-ui, sans-serif; }
.seat.opened .case-front span { font: 800 clamp(11px, 1.35vw, 15px) / 1 var(--digits); }
.stage[data-phase="transition"] .mine .portrait { animation: selected .68s cubic-bezier(.18,.75,.36,1.3) both; }
.seat.opened .case-art {
  --case-light: #6f6074;
  --case-metal: #56475a;
  --case-shade: #382d44;
  --case-deep: #251f30;
  opacity: .56;
}
.seat.opened .case-lid { transform: translateY(-15%) rotateX(44deg); }
.seat.opened .case-front span { color: #ebdbe9; text-shadow: none; }
.seat.opened .portrait { visibility: hidden; }
.seat.spotlit .portrait { animation: selected .40s ease-out both; }
.seat.opened.spotlit .portrait { visibility: visible; animation: exit .44s ease-in both; }
.stage-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  color: var(--muted);
  border-top: 1px solid #76546f;
  background: #251a32;
  font-size: 13px;
  font-weight: 700;
}
.stage-stat {
  min-width: 0;
  padding: 8px 6px 10px;
  display: grid;
  gap: 4px;
  text-align: center;
}
.stage-stat > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.stage-stat strong {
  font: 800 clamp(13px, 1.7vw, 22px) / 1.15 var(--digits);
  letter-spacing: -.06em;
  color: var(--gold);
}
#mine { color: var(--mint); font: 800 16px / 1.2 var(--digits); }
#peek { min-height: 36px; margin-inline-start: 6px; }
#peek[aria-pressed="true"] { border-color: #cbb0ff; color: #eadbff; }
.stage.peeking .seat:not(:disabled) { border-bottom-color: #cbb0ff; }
.stage.peeking .seat:not(:disabled)::before { opacity: 1; }

dialog {
  width: min(512px, 100% - 26px);
  max-width: none;
  max-height: calc(100dvh - 26px);
  padding: 0;
  margin: auto;
  color: var(--ink);
  border: 1px solid #ac6c86;
  border-top: 4px solid var(--pink);
  background: #23182f;
  box-shadow: inset 0 0 0 4px #39253e, 0 8px #0d0a13, 0 0 38px #ff789d40;
}
dialog::backdrop { background: #100b1bdb; }
.scene-inner {
  text-align: center;
  padding: 22px clamp(13px, 5vw, 35px) 23px;
  background: radial-gradient(ellipse at 50% -20%, #69384f, transparent 70%);
  animation: scene-in .24s ease-out both;
}
.scene-inner h2 { font-size: clamp(26px, 6.5vw, 39px); font-weight: 1000; text-shadow: 2px 3px #150d22; }
.scene-inner h2:focus, .stage-head h2:focus { outline: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px auto 3px; }
.action {
  flex: 1 0 105px;
  min-height: 45px;
  padding: 7px 10px;
  color: #36182b;
  background: #ffd17c;
  border: 1px solid #fff1b3;
  box-shadow: 0 4px #a56254, inset 0 -3px #dc9763;
  font-weight: 950;
}
.action.green { background: #8aefc3; border-color: #ceffdf; box-shadow: 0 4px #397a78, inset 0 -3px #55b39c; }
.action.secondary { color: var(--ink); background: #3b2947; border-color: #7e5782; box-shadow: 0 4px #1a1025; }
[data-action="counter"] { flex-basis: 100%; }
.action:hover:not(:disabled) { filter: brightness(1.14); }
.action:active:not(:disabled) { transform: translateY(2px); }
.action:disabled { opacity: .49; }

.reveal-figure {
  --sprite-width: 126px;
  width: 132px;
  margin: 11px auto 8px;
  display: grid;
  justify-items: center;
  background: radial-gradient(ellipse, #ffd99352, transparent 71%);
  position: relative;
}
.reveal-figure .portrait { animation: selected .42s ease-out both; }
.reveal-figure .case-art { height: 67px; width: 95px; margin-top: -46px; animation: rattle .48s ease-in-out both; }
.revealed .reveal-figure .case-lid { animation: lid .28s cubic-bezier(.22,.73,.22,1.25) both; }
.revealed .reveal-figure .handle { transform: translateY(-90%); }
.revealed .reveal-figure .portrait { animation: exit .50s .16s ease-in both; }
.spark {
  position: absolute;
  bottom: 43px;
  left: calc(50% - 3px);
  width: 6px;
  height: 6px;
  color: #ffcc7a;
  background: #fff1b7;
  opacity: 0;
  pointer-events: none;
}
.revealed .spark { animation: burst .44s ease-out both; }
.reveal-text {
  position: relative;
  width: fit-content;
  margin-inline: auto;
  color: var(--mint);
  animation: stamp .33s ease-out both;
}
.reveal-text.danger { color: #ff9da6; }
.reveal-text.reveal-complete {
  color: #a6a6aa;
  text-shadow: 2px 3px #1c1130;
}
.reveal-text::after {
  content: "";
  position: absolute;
  top: 52%;
  inset-inline: -4px;
  height: clamp(3px, .09em, 6px);
  background: #ffebbd;
  box-shadow: 0 1px 3px #211426;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .26s ease-out;
}
.reveal-text.crossed-out::after { transform: scaleX(1); }
.amount {
  display: block;
  font: 900 clamp(29px, 8.6vw, 63px) / 1.05 var(--digits);
  letter-spacing: -.06em;
  white-space: nowrap;
  text-shadow: 2px 3px #1c1130, 0 0 18px currentColor;
}
.phone {
  width: fit-content;
  margin: 3px auto;
  font-size: 34px;
  line-height: 1.1;
  color: var(--pink);
  animation: rattle .33s ease-in-out 3;
}
.offer-screen {
  padding: 10px 4px;
  background: repeating-linear-gradient(#1a1422 0 3px, #1e1526 3px 4px);
  border: 1px solid #8a644f;
  box-shadow: inset 0 0 0 3px #13101e;
  color: var(--gold);
}
.offer-screen .digit { display: inline-block; width: .62em; }
.rolling .digit { text-shadow: 0 -2px #ffc65a74, 0 2px #ffc65a74; }
#counter-form { display: grid; gap: 7px; margin-top: 16px; text-align: left; }
#counter-form label { color: var(--ink); font-size: 14px; font-weight: 800; }
#counter-amount {
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  color: var(--gold);
  background: #160f24;
  border: 1px solid #a18178;
  border-radius: 0;
  font: 800 18px var(--digits);
}
#counter-amount:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.counter-status { margin: 10px 0 0; color: var(--ink); font-size: 14px; }
#counter-error { margin: 0; color: #ffb5c5; }
#counter-error:empty { display: none; }
[data-kind="counter"] .offer-screen { margin-top: 12px; }
.compare { margin-top: 12px; display: flex; background: #33223a; border: 1px solid #5e4057; }
.compare > div { flex: 1; }
.final-pair { display: flex; justify-content: center; gap: 20px; margin: 20px 0; }
.final-pair > div { flex: 0 1 115px; min-width: 0; display: grid; gap: 9px; color: var(--muted); font-size: 13px; }
.final-pair .case-art { height: 69px; }
.final-pair .case-front span { font-size: 27px; }
.result-display { display: grid; gap: 8px; margin-top: 18px; padding: 13px 0; color: var(--gold); background: #140f23; border-block: 1px solid #b28461; }
.result-display > span { font-size: 13px; color: var(--muted); }
.result-display .amount { animation: stamp .42s ease-out both; }

@keyframes change-set {
  from { transform: translateX(-110%); opacity: .15; }
  46% { opacity: .43; }
  to { transform: translateX(110%); opacity: .10; }
}
@keyframes selected {
  from { transform: translateY(5px) scale(.93); }
  42% { transform: translateY(-12px) scale(1.13) rotate(-7deg); }
  to { transform: none; }
}
@keyframes exit {
  35% { transform: translateY(-8px) rotate(-8deg); opacity: 1; }
  to { transform: translate(22px, 5px) scale(.8) rotate(13deg); opacity: 0; }
}
@keyframes rattle {
  20%, 60% { transform: rotate(-9deg); }
  40%, 80% { transform: rotate(8deg); }
}
@keyframes lid {
  from { transform: none; }
  to { transform: translateY(-36%) rotateX(58deg) skewX(-8deg); }
}
@keyframes scene-in {
  from { opacity: .25; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes stamp {
  from { opacity: 0; transform: scale(1.22) rotate(-3deg); }
  to { opacity: 1; transform: none; }
}
@keyframes burst {
  from { opacity: 1; box-shadow: 0 0 currentColor; }
  60% { opacity: .8; }
  to {
    opacity: 0;
    box-shadow: -72px -29px currentColor, 65px -36px #ffd9a9,
      -45px -68px #ff789d, 36px -77px #a5f5c9, -78px 14px #ff789d,
      72px 12px currentColor, -12px -94px #a5f5c9;
  }
}

@media (max-width: 1080px) {
  .arena { gap: 10px; }
  .cabinet { width: min(100% - 30px, 1296px); }
  .seat { min-height: 87px; }
  .prizes li { min-height: 30px; }
}
@media (max-width: 820px) {
  .arena { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage { grid-column: 1 / -1; grid-row: 1; }
  .prizes ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prizes li { font-size: clamp(12px, 2.2vw, 15px); }
  .seat { --sprite-width: clamp(46px, 8vw, 66px); }
}
@media (max-width: 740px) {
  :lang(en) .top { grid-template-columns: 1fr; gap: 8px; }
  :lang(en) :is(.brand, .controls) { grid-column: 1; justify-self: center; }
}
@media (max-width: 560px) {
  .cabinet { width: calc(100% - 20px); margin-top: 13px; }
  .top { padding: 9px; margin-bottom: 12px; }
  .brand { gap: 7px; }
  .brand h1 { letter-spacing: 0; }
  .brand-mark { width: 29px; }
  .brand-mark i { scale: .75; }
  .controls { gap: 5px; }
  .tool { padding-inline: 8px; font-size: 12px; }
  .stage-head { padding: 14px 8px 12px; }
  .stage-head h2 { letter-spacing: .02em; }
  .floor { padding: 10px 9px 13px; }
  .board { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 5px; }
  .seat { --sprite-width: clamp(40px, 13vw, 62px); min-height: 75px; padding-bottom: 6px; }
  .seat .case-art { height: 32px; }
  .stage-stat { padding-inline: 2px; }
  .stage-stat > span { font-size: 10px; }
  .prizes { padding: 6px; }
  .prizes ol { gap: 4px; }
}
@media (max-width: 460px) {
  .top { grid-template-columns: 1fr; gap: 8px; }
  .brand, .controls { grid-column: 1; justify-self: center; }
}
@media (max-width: 340px) {
  .brand h1 { font-size: 21px; }
  .brand-mark { display: none; }
  .stage-stat strong { font-size: 11px; }
  .prizes ol { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .seat.opened.spotlit .portrait, .revealed .reveal-figure .portrait { visibility: hidden; }
}
