:root {
  color-scheme: dark;
  --ink: #f7f4ff;
  --muted: #aaa2c2;
  --purple: #8d5cff;
  --purple-bright: #bd9cff;
  --gold: #f8c96a;
  --gold-bright: #fff1b5;
  --panel: rgba(23, 13, 53, 0.72);
  --panel-border: rgba(255, 255, 255, 0.1);
  --danger: #ff5c8a;
  --success: #54e6b4;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 50% -10%, rgba(125, 73, 255, 0.33), transparent 38%),
    linear-gradient(145deg, #070312 0%, #110828 48%, #080414 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button, input { font: inherit; }
button { color: inherit; }

.hidden { display: none !important; }
.glass { border: 1px solid var(--panel-border); background: var(--panel); backdrop-filter: blur(24px); box-shadow: 0 24px 80px rgba(0,0,0,.28); }

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  opacity: .24;
  animation: drift 12s ease-in-out infinite alternate;
}
.ambient-one { width: 36vw; height: 36vw; left: -16vw; top: 30vh; background: #7248ff; }
.ambient-two { width: 28vw; height: 28vw; right: -10vw; top: 4vh; background: #df9e3e; animation-delay: -4s; }

.welcome-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: clamp(32px, 7vw, 120px);
  width: min(1180px, calc(100% - 48px));
  margin: auto;
  padding: 64px 0;
}

.show-mark { text-align: center; animation: rise .7s ease both; }
.show-mark::before {
  content: "";
  display: block;
  width: min(380px, 80%);
  aspect-ratio: 1;
  position: absolute;
  z-index: -1;
  left: 15%;
  top: 50%;
  translate: 0 -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(144, 86, 255, .22), transparent 68%);
  border: 1px solid rgba(255,255,255,.04);
  box-shadow: 0 0 0 38px rgba(255,255,255,.012), 0 0 0 86px rgba(255,255,255,.009);
}
.eyebrow, .modal-kicker, .card-kicker { color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; }
.show-mark h1 { margin: 12px 0 8px; font-size: clamp(58px, 7.3vw, 104px); line-height: .94; letter-spacing: -.08em; text-shadow: 0 6px 35px rgba(141, 92, 255, .44); }
.show-mark h1 span { color: transparent; -webkit-text-stroke: 1.5px var(--purple-bright); }
.show-mark p { margin: 24px 0 0; color: var(--muted); letter-spacing: .28em; font-size: 13px; }

.welcome-card { border-radius: 28px; padding: clamp(30px, 4.5vw, 54px); animation: rise .7s .12s ease both; }
.welcome-card h2 { margin: 16px 0 34px; font-size: clamp(26px, 3vw, 40px); line-height: 1.35; letter-spacing: -.035em; }
.auth-card h2 { margin-bottom: 28px; }
.auth-tabs { display: flex; gap: 6px; padding: 4px; margin: -25px -25px 30px; border-radius: 14px; background: rgba(255,255,255,.045); }
.auth-tab { flex: 1; border: 0; border-radius: 10px; padding: 10px; color: var(--muted); background: transparent; cursor: pointer; transition: color .2s, background .2s; }
.auth-tab.active { color: white; background: rgba(141,92,255,.26); box-shadow: inset 0 0 0 1px rgba(189,156,255,.15); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.economy-note { display: flex; justify-content: center; gap: 22px; margin: 22px 0 -12px; color: #776f8d; font-size: 10px; }
.economy-note i { color: var(--gold); font-style: normal; font-weight: 800; }
.lobby-user { display: flex; align-items: center; gap: 11px; margin: -26px -20px 31px; padding: 0 0 17px; border-bottom: 1px solid rgba(255,255,255,.08); }
.lobby-user > div:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.lobby-user small { color: var(--muted); font-size: 9px; }
.lobby-user strong { font-size: 14px; }
.user-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--gold-bright); background: linear-gradient(135deg, rgba(141,92,255,.6), rgba(92,43,187,.45)); font-weight: 900; }
.text-button { margin-left: auto; border: 0; color: #837b95; background: none; font-size: 10px; cursor: pointer; }
.text-button:hover { color: white; }
.wallet-card { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; margin: -14px 0 22px; border: 1px solid rgba(248,201,106,.13); border-radius: 14px; background: linear-gradient(135deg, rgba(248,201,106,.075), rgba(141,92,255,.065)); }
.wallet-card > div { display: flex; flex-direction: column; gap: 3px; }
.wallet-card small { color: var(--muted); font-size: 9px; }
.wallet-card strong { font: 900 23px ui-monospace, monospace; color: var(--gold-bright); }
.wallet-card strong i, .game-wallet i { margin-right: 6px; color: var(--gold); font-style: normal; }
.wallet-card button { border: 1px solid rgba(84,230,180,.2); border-radius: 10px; padding: 8px 13px; color: var(--success); background: rgba(84,230,180,.08); cursor: pointer; }
.wallet-card button span, .wallet-card button small { display: block; }
.wallet-card button span { font-size: 11px; font-weight: 800; }
.wallet-card button small { margin-top: 2px; color: rgba(84,230,180,.6); font-size: 8px; }
.wallet-card button.checked { color: #827b91; border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.03); cursor: default; }
.resume-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 13px; margin: -10px 0 20px; border: 1px solid rgba(189,156,255,.25); border-radius: 13px; background: linear-gradient(135deg, rgba(141,92,255,.13), rgba(248,201,106,.045)); }
.resume-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--purple-bright); background: rgba(141,92,255,.16); font-size: 19px; }
.resume-card > div:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.resume-card small { color: var(--purple-bright); font-size: 8px; letter-spacing: .08em; }
.resume-card strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
.resume-card button { border: 0; border-radius: 9px; padding: 9px 11px; color: #1b0d2e; background: linear-gradient(135deg, #d8c5ff, #a87bf5); font-size: 9px; font-weight: 800; cursor: pointer; }
.lobby-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.lobby-links button { border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 10px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 10px; cursor: pointer; }
.lobby-links button:hover { color: white; background: rgba(255,255,255,.065); }
label { display: block; margin-bottom: 20px; }
label > span { display: block; color: var(--muted); font-size: 13px; margin: 0 0 9px 3px; }
input {
  width: 100%;
  color: white;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 13px;
  padding: 15px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: #756d8e; }
input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(141,92,255,.12); background: rgba(255,255,255,.075); }

.primary-button {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  color: #15082c;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, #fff4c8, #f3bd55);
  box-shadow: 0 12px 32px rgba(248,201,106,.2);
  transition: transform .2s, filter .2s;
}
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.06); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.primary-button i { font-size: 22px; font-style: normal; }
.primary-button.compact { width: auto; min-width: 180px; justify-content: center; margin: 22px auto 0; }
.rule-note { color: #776f8d; font-size: 11px; text-align: center; margin: 18px 0 0; }

.game-screen { position: relative; z-index: 1; min-height: 100vh; }
.topbar {
  height: 82px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(20px, 3vw, 48px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(8,4,20,.54);
  backdrop-filter: blur(18px);
}
.mini-logo { justify-self: start; border: 0; background: none; font-size: 21px; font-weight: 900; letter-spacing: -.06em; cursor: pointer; }
.mini-logo span { color: var(--gold); }
.player-dream { text-align: center; max-width: 48vw; }
.player-dream small { display: block; color: var(--purple-bright); font-size: 10px; letter-spacing: .16em; }
.player-dream strong { display: block; margin-top: 5px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghost-button { justify-self: end; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 8px 14px; background: rgba(255,255,255,.04); color: var(--muted); font-size: 12px; cursor: pointer; }
.ghost-button:hover { color: white; background: rgba(255,255,255,.08); }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.game-wallet { border: 1px solid rgba(248,201,106,.14); border-radius: 999px; padding: 7px 11px; color: var(--gold-bright); background: rgba(248,201,106,.06); font: 800 11px ui-monospace, monospace; cursor: pointer; }

.game-layout { display: grid; grid-template-columns: 178px minmax(0, 1fr) 218px; gap: 24px; max-width: 1450px; margin: auto; padding: 30px 34px 36px; min-height: calc(100vh - 82px); }
.prize-panel, .host-panel { border-radius: 20px; align-self: center; }
.prize-panel { padding: 17px 14px; }
.panel-title { display: flex; justify-content: space-between; align-items: end; border-bottom: 1px solid rgba(255,255,255,.08); padding: 0 3px 13px; margin-bottom: 12px; }
.panel-title span { font-size: 13px; font-weight: 700; }
.panel-title small { color: #736c87; font-size: 7px; letter-spacing: .12em; }
.prize-board { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.prize-item {
  position: relative;
  text-align: right;
  padding: 5px 7px;
  border-radius: 5px;
  color: var(--gold-bright);
  background: linear-gradient(90deg, rgba(248,201,106,.04), rgba(248,201,106,.13));
  font: 700 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  transition: opacity .35s, color .35s;
}
.prize-item.high { color: white; background: linear-gradient(90deg, rgba(141,92,255,.05), rgba(141,92,255,.2)); }
.prize-item.eliminated { opacity: .25; color: #827b91; }
.prize-item.eliminated::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 1px; background: var(--danger); transform: rotate(-8deg); }

.stage { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.stage-header { text-align: center; min-height: 126px; }
.round-pill { display: inline-flex; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: 7px 13px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 10px; }
.round-pill i { width: 3px; height: 3px; background: var(--gold); border-radius: 50%; }
.stage-header h2 { font-size: clamp(20px, 2.2vw, 32px); margin: 16px 0 6px; letter-spacing: -.03em; }
.stage-header p { color: var(--muted); font-size: 12px; margin: 0; }
.case-grid { display: grid; grid-template-columns: repeat(7, minmax(64px, 112px)); justify-content: center; gap: clamp(12px, 1.5vw, 22px) clamp(9px, 1.5vw, 20px); padding: 8px 0 20px; perspective: 1200px; }
.case {
  position: relative;
  aspect-ratio: 1.38;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 9px 9px 12px 12px;
  cursor: pointer;
  overflow: visible;
  color: #160b29;
  background: linear-gradient(145deg, #fff0b2 0%, #bd7d22 44%, #f9cf70 63%, #9f6215 100%);
  box-shadow: inset 0 1px rgba(255,255,255,.64), inset 0 -5px 12px rgba(74,36,4,.4), 0 9px 18px rgba(0,0,0,.28);
  transition: transform .2s, filter .2s, opacity .3s;
  animation: caseIn .45s calc(var(--case-index) * 22ms) ease both;
}
.case::before { content: ""; position: absolute; width: 35%; height: 14%; left: 32.5%; top: -13%; border: 3px solid #c78d31; border-bottom: 0; border-radius: 7px 7px 0 0; box-shadow: inset 0 1px rgba(255,255,255,.4); }
.case::after { content: ""; position: absolute; inset: 8% 7%; border: 1px solid rgba(89,47,9,.28); border-radius: 5px; box-shadow: inset 0 0 14px rgba(255,244,187,.25); }
.case:hover:not(.opened):not(.selected) { transform: translateY(-6px) rotateX(3deg); filter: brightness(1.12); }
.case-number { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; font: 900 clamp(17px, 2.1vw, 28px)/1 ui-monospace, monospace; text-shadow: 0 1px rgba(255,255,255,.42); }
.case.selected { color: white; background: linear-gradient(145deg, #be9bff, #6536d3 50%, #a579fa); box-shadow: 0 0 0 2px rgba(189,156,255,.33), 0 0 30px rgba(141,92,255,.38); cursor: default; }
.case.selected::before { border-color: #8e62df; }
.case.selected::after { border-color: rgba(255,255,255,.25); }
.case-tag { position: absolute; z-index: 3; bottom: -16px; left: 50%; translate: -50% 0; background: #8d5cff; color: white; white-space: nowrap; border-radius: 999px; padding: 3px 7px; font-size: 7px; letter-spacing: .1em; }
.case.opened { background: #1b1430; color: #6b637c; box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); border-color: rgba(255,255,255,.045); opacity: .52; cursor: default; transform: scale(.93); }
.case.opened::before { display: none; }
.case.opened::after { border-color: rgba(255,255,255,.04); }
.case.opened .case-number { font-size: 10px; top: -43%; }
.case-amount { position: absolute; z-index: 2; inset: 31% 2% auto; font: 700 clamp(8px, .9vw, 11px)/1 ui-monospace, monospace; color: #aaa2b5; }
.case:disabled { pointer-events: none; }

.stage-footer { min-height: 42px; display: flex; justify-content: center; align-items: center; }
.legend { display: flex; align-items: center; gap: 7px; color: #777086; font-size: 9px; }
.legend i { width: 9px; height: 9px; display: inline-block; border-radius: 2px; margin-left: 8px; }
.legend-selected { background: var(--purple); }
.legend-opened { border: 1px solid #575064; }
.offer-history { color: var(--muted); font-size: 10px; }

.host-panel { padding: 24px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.host-orb { position: relative; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; color: var(--purple-bright); background: radial-gradient(circle, #2a165a, #100825); border: 1px solid rgba(189,156,255,.25); box-shadow: 0 0 30px rgba(141,92,255,.2); }
.host-orb span { font-size: 14px; font-weight: 900; letter-spacing: .08em; }
.host-orb i { position: absolute; inset: -7px; border: 1px dashed rgba(189,156,255,.25); border-radius: 50%; animation: spin 12s linear infinite; }
.host-panel small { color: var(--gold); font-size: 9px; letter-spacing: .15em; }
.host-panel p { color: #c0b9d0; font-size: 12px; line-height: 1.75; margin: 8px 0 0; }
.round-progress { width: 100%; height: 3px; border-radius: 9px; background: rgba(255,255,255,.06); overflow: hidden; }
.round-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--purple), var(--gold)); transition: width .5s ease; }

.modal { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 22px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4,2,12,.84); backdrop-filter: blur(15px); animation: fadeIn .25s ease both; }
.modal-card { position: relative; z-index: 1; width: min(520px, 100%); border: 1px solid rgba(255,255,255,.13); border-radius: 28px; padding: 38px; text-align: center; background: linear-gradient(160deg, rgba(38,21,79,.98), rgba(13,7,31,.98)); box-shadow: 0 35px 120px rgba(0,0,0,.55), 0 0 80px rgba(121,75,233,.12); animation: modalIn .38s cubic-bezier(.2,.85,.25,1.15) both; }
.modal-card h3 { margin: 12px 0; font-size: 28px; }
.modal-card > p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.opened-case { position: relative; width: 130px; height: 84px; margin: 30px auto 24px; display: grid; place-items: center; color: #321800; border-radius: 10px; background: linear-gradient(145deg, #ffe79b, #ba741c 50%, #f7c75d); box-shadow: 0 18px 40px rgba(0,0,0,.35), 0 0 60px rgba(248,201,106,.18); }
.opened-case i { position: absolute; width: 46px; height: 17px; border: 5px solid #c18428; border-bottom: 0; border-radius: 8px 8px 0 0; top: -17px; }
.opened-case strong { font-size: 35px; }
.reveal-amount, .offer-amount, .result-amount { font: 900 clamp(40px, 8vw, 68px)/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.08em; color: var(--gold-bright); text-shadow: 0 0 30px rgba(248,201,106,.28); }
.offer-card { width: min(590px, 100%); }
.offer-card::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(248,201,106,.13); border-radius: 20px; pointer-events: none; }
.phone-rings { height: 44px; position: relative; }
.phone-rings::after { content: "☎"; position: absolute; left: 50%; translate: -50%; font-size: 32px; color: var(--gold); animation: ring .7s ease-in-out infinite; }
.phone-rings i { position: absolute; left: 50%; top: 17px; width: 36px; height: 36px; translate: -50% -50%; border: 1px solid rgba(248,201,106,.3); border-radius: 50%; animation: phoneWave 1.8s ease-out infinite; }
.phone-rings i:nth-child(2) { animation-delay: .6s; }
.phone-rings i:nth-child(3) { animation-delay: 1.2s; }
.offer-amount { margin: 24px 0 19px; }
.decision-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.decision-buttons button { border-radius: 13px; min-height: 60px; cursor: pointer; font-weight: 800; transition: transform .2s, filter .2s; }
.decision-buttons button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.decision-buttons button:disabled { opacity: .5; cursor: wait; }
.decision-buttons small { display: block; font-size: 8px; margin-top: 3px; letter-spacing: .18em; opacity: .65; }
.deal-button { border: 0; color: #231304; background: linear-gradient(135deg, #ffeebb, #e9ad43); }
.no-deal-button { border: 1px solid rgba(189,156,255,.5); color: #d7c5ff; background: rgba(141,92,255,.12); }
.offer-comparison, .result-detail { margin-top: 17px; color: #776f8b; font-size: 10px; }
.final-card { width: min(620px, 100%); }
.final-cases { display: flex; justify-content: center; gap: 80px; margin: 36px 0 28px; }
.final-case { width: 122px; height: 78px; display: grid; place-items: center; position: relative; border-radius: 9px; background: linear-gradient(145deg, #fff0b2, #b8751d 45%, #f6c968); color: #231101; font: 900 29px ui-monospace, monospace; box-shadow: 0 16px 30px rgba(0,0,0,.32); }
.final-case::before { content: ""; width: 38px; height: 13px; position: absolute; top: -13px; border: 4px solid #c18428; border-bottom: 0; border-radius: 7px 7px 0 0; }
.final-case.mine { background: linear-gradient(145deg, #c2a5ff, #6635d1 50%, #a678fa); color: white; }
.final-case.mine::after { content: "我的守护箱"; position: absolute; bottom: -25px; color: var(--purple-bright); white-space: nowrap; font: 9px system-ui; }
.result-card { overflow: hidden; }
.result-card h3 { font-size: clamp(27px, 5vw, 38px); margin: 14px 0 22px; }
.result-card > p { margin-bottom: 10px; }
.result-amount { margin: 8px 0 22px; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; background: var(--confetti-color); left: var(--confetti-left); rotate: var(--confetti-rotate); animation: confettiFall var(--confetti-speed) linear infinite; animation-delay: var(--confetti-delay); }
.modal-x { position: absolute; right: 17px; top: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: rgba(255,255,255,.05); font-size: 21px; cursor: pointer; }
.modal-x:hover { color: white; background: rgba(255,255,255,.09); }
.leaderboard-card { width: min(680px, 100%); padding-left: 28px; padding-right: 28px; }
.leaderboard-card > p { margin: 0 0 22px; }
.leaderboard-head { display: grid; grid-template-columns: 1fr auto; padding: 9px 15px; color: #746d86; font-size: 9px; text-align: left; }
.leaderboard-list { max-height: min(52vh, 440px); display: flex; flex-direction: column; gap: 7px; overflow-y: auto; padding-right: 4px; }
.leaderboard-row { display: grid; grid-template-columns: 45px minmax(100px, 1fr) auto; align-items: center; min-height: 53px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; padding: 7px 14px; text-align: left; background: rgba(255,255,255,.032); }
.leaderboard-row.me { border-color: rgba(141,92,255,.42); background: rgba(141,92,255,.12); }
.rank-number { color: #8b839b; font: 900 15px ui-monospace, monospace; }
.leaderboard-row.top-1 .rank-number { color: var(--gold); font-size: 21px; }
.leaderboard-row.top-2 .rank-number, .leaderboard-row.top-3 .rank-number { color: #d8ccec; font-size: 18px; }
.rank-player { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rank-player strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.rank-player small { color: #766e88; font-size: 8px; }
.rank-prize { color: var(--gold-bright); font: 800 12px ui-monospace, monospace; }
.empty-ranking { padding: 50px 10px; color: var(--muted); font-size: 12px; }
.history-card { width: min(820px, 100%); padding-left: 28px; padding-right: 28px; }
.history-card > p { margin: 0 0 20px; }
.history-list { max-height: min(58vh, 520px); display: flex; flex-direction: column; gap: 9px; overflow-y: auto; padding: 2px 4px 2px 0; }
.history-row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 70px; border: 1px solid rgba(255,255,255,.075); border-radius: 14px; padding: 11px 14px; color: white; text-align: left; background: rgba(255,255,255,.032); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.history-row:hover { transform: translateY(-1px); border-color: rgba(189,156,255,.32); background: rgba(141,92,255,.09); }
.history-status { min-width: 55px; border-radius: 999px; padding: 6px 8px; color: var(--muted); background: rgba(255,255,255,.06); font-size: 8px; font-weight: 800; text-align: center; }
.history-status.active { color: var(--purple-bright); background: rgba(141,92,255,.16); }
.history-status.finished { color: var(--success); background: rgba(84,230,180,.1); }
.history-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.history-main strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.history-main small { color: #7f7791; font-size: 9px; line-height: 1.5; }
.history-result { display: flex; flex-direction: column; align-items: end; gap: 4px; color: var(--gold-bright); white-space: nowrap; font: 800 12px ui-monospace, monospace; }
.history-result small { color: #746d85; font: 8px system-ui; }
.history-detail-view { max-height: min(64vh, 620px); overflow-y: auto; padding: 0 4px 4px 0; text-align: left; }
.history-back { border: 0; padding: 5px 0 14px; color: var(--purple-bright); background: none; font-size: 10px; cursor: pointer; }
.history-detail-header { padding: 15px 17px; border: 1px solid rgba(189,156,255,.18); border-radius: 14px; background: linear-gradient(135deg, rgba(141,92,255,.1), rgba(248,201,106,.045)); }
.history-detail-header small, .history-detail-header strong { display: block; }
.history-detail-header small { color: var(--gold); font-size: 9px; letter-spacing: .1em; }
.history-detail-header strong { margin-top: 7px; font-size: 18px; }
.history-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 11px 0; }
.history-meta > div { min-width: 0; padding: 10px 11px; border: 1px solid rgba(255,255,255,.065); border-radius: 10px; background: rgba(255,255,255,.025); }
.history-meta small, .history-meta strong { display: block; }
.history-meta small { margin-bottom: 5px; color: #766f87; font-size: 8px; }
.history-meta strong { overflow: hidden; color: #ddd7e8; font-size: 10px; text-overflow: ellipsis; }
.history-outcome { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; margin: 12px 0; padding: 14px 16px; border: 1px solid rgba(248,201,106,.16); border-radius: 12px; background: rgba(248,201,106,.055); }
.history-outcome span { color: #b9b1c9; font-size: 10px; line-height: 1.6; }
.history-outcome strong { color: var(--gold-bright); white-space: nowrap; font: 900 17px ui-monospace, monospace; }
.history-section { margin-top: 16px; }
.history-section-title { display: flex; justify-content: space-between; margin-bottom: 8px; color: #a69db8; font-size: 9px; }
.history-offers { display: flex; flex-wrap: wrap; gap: 6px; }
.history-offers span { border: 1px solid rgba(189,156,255,.13); border-radius: 999px; padding: 6px 9px; color: #c6b5e9; background: rgba(141,92,255,.07); font: 700 9px ui-monospace, monospace; }
.history-case-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 6px; }
.history-case-item { min-width: 0; padding: 8px 7px; border: 1px solid rgba(255,255,255,.06); border-radius: 9px; color: #777083; background: rgba(255,255,255,.025); text-align: center; }
.history-case-item.opened { color: #bcb4c8; background: rgba(255,255,255,.045); }
.history-case-item.selected { border-color: rgba(189,156,255,.38); color: var(--purple-bright); background: rgba(141,92,255,.1); }
.history-case-item.final { border-color: rgba(248,201,106,.4); color: var(--gold-bright); background: rgba(248,201,106,.08); }
.history-case-item strong, .history-case-item span, .history-case-item small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.history-case-item strong { font: 900 11px ui-monospace, monospace; }
.history-case-item span { margin-top: 4px; font: 700 9px ui-monospace, monospace; }
.history-case-item small { margin-top: 3px; color: #6e677e; font-size: 7px; }
.history-continue { width: 100%; margin-top: 15px; border: 0; border-radius: 11px; padding: 12px; color: #1b0d2e; background: linear-gradient(135deg, #d8c5ff, #a87bf5); font-size: 10px; font-weight: 800; cursor: pointer; }
.account-card { width: min(520px, 100%); text-align: left; }
.account-card > h3, .account-card > .modal-kicker { display: block; text-align: center; }
.account-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 25px 0; }
.account-summary > div { padding: 12px; border: 1px solid rgba(255,255,255,.07); border-radius: 10px; background: rgba(255,255,255,.03); }
.account-summary small, .account-summary strong { display: block; }
.account-summary small { color: var(--muted); font-size: 9px; margin-bottom: 5px; }
.account-summary strong { font-size: 13px; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; translate: -50%; padding: 11px 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(18,10,40,.94); box-shadow: 0 12px 35px rgba(0,0,0,.35); color: #ddd6eb; font-size: 12px; animation: toastIn .25s ease both; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes caseIn { from { opacity: 0; transform: translateY(12px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { to { transform: translate(6vw, -4vh) scale(1.12); } }
@keyframes ring { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes phoneWave { from { opacity: .6; transform: scale(.7); } to { opacity: 0; transform: scale(2.2); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes confettiFall { to { transform: translateY(620px) rotate(540deg); } }

@media (max-width: 1120px) {
  .game-layout { grid-template-columns: 148px minmax(0, 1fr); }
  .host-panel { grid-column: 1 / -1; align-self: auto; flex-direction: row; text-align: left; padding: 14px 18px; }
  .host-orb { width: 44px; height: 44px; flex: 0 0 auto; }
  .host-panel p { margin: 2px 0 0; }
  .round-progress { width: 130px; margin-left: auto; }
  .case-grid { grid-template-columns: repeat(6, minmax(58px, 100px)); }
}

@media (max-width: 760px) {
  .welcome-screen { grid-template-columns: 1fr; width: min(520px, calc(100% - 30px)); gap: 45px; padding: 55px 0 30px; }
  .show-mark::before { left: 10%; top: 25%; }
  .show-mark h1 { font-size: 64px; }
  .welcome-card { padding: 28px 23px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .topbar { height: 68px; grid-template-columns: auto 1fr auto; padding: 0 14px; gap: 12px; }
  .mini-logo { font-size: 16px; }
  .ghost-button { padding: 7px 10px; font-size: 10px; }
  .game-wallet { padding: 7px 8px; }
  .player-dream { max-width: none; min-width: 0; }
  .game-layout { display: flex; flex-direction: column; padding: 18px 12px 28px; min-height: calc(100vh - 68px); }
  .prize-panel { order: 2; width: 100%; }
  .stage { order: 1; }
  .host-panel { order: 3; }
  .prize-board { grid-template-columns: repeat(4, 1fr); }
  .case-grid { grid-template-columns: repeat(5, minmax(52px, 86px)); gap: 17px 10px; }
  .stage-header { min-height: 116px; }
  .stage-header h2 { font-size: 21px; }
  .case-number { font-size: 18px; }
  .host-panel { align-items: center; }
  .round-progress { display: none; }
  .modal-card { padding: 32px 20px; border-radius: 22px; }
  .leaderboard-card { padding-left: 14px; padding-right: 14px; }
  .leaderboard-row { grid-template-columns: 35px minmax(80px, 1fr) auto; padding: 7px 10px; }
  .history-card { padding-left: 14px; padding-right: 14px; }
  .history-row { grid-template-columns: auto minmax(0, 1fr); }
  .history-result { grid-column: 2; align-items: start; }
  .history-meta { grid-template-columns: 1fr 1fr; }
  .decision-buttons { grid-template-columns: 1fr; }
  .final-cases { gap: 36px; }
  .final-case { width: 105px; height: 69px; }
}

@media (max-width: 390px) {
  .case-grid { grid-template-columns: repeat(4, minmax(52px, 74px)); }
  .prize-board { grid-template-columns: repeat(3, 1fr); }
  .show-mark h1 { font-size: 54px; }
}

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