
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 5px;
  border: 0;
  border-radius: 999px;
  color: var(--cream);
  font: 800 13px/1 var(--font);
  letter-spacing: .02em;
  background: rgba(30, 10, 12, .6);
  box-shadow: 0 0 0 1px rgba(199, 202, 206, .28) inset;
  cursor: pointer;
  transition: background .2s;
}
.account-btn:hover { background: rgba(60, 16, 20, .8); }
.account-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ab-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}
.ab-avatar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.account-btn.is-in .ab-avatar svg { display: none; }
@media (max-width: 420px) {
  .account-btn .ab-label { max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.sheet { position: fixed; inset: 0; z-index: 66; display: grid; place-items: center; padding: 16px; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 2, 3, .86); animation: fade-in .3s both; }
.sheet-card {
  position: relative;
  width: min(100%, 440px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 30px 26px 24px;
  border-radius: 26px;
  background: radial-gradient(120% 70% at 50% 0%, rgba(228, 0, 43, .32), transparent 60%), linear-gradient(180deg, #2a0a0d, #140507);
  box-shadow: 0 0 0 1px rgba(199, 202, 206, .3) inset, 0 40px 80px rgba(0, 0, 0, .7);
  animation: pop-in .5s var(--ease-spring) both;
}
.sheet-wide { width: min(100%, 620px); }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 3; }
.sheet-card h2 { margin: 0 34px 8px 0; font-size: 26px; line-height: 1.05; font-weight: 900; text-transform: uppercase; }
@media (max-width: 759px) {
  .sheet { place-items: end stretch; padding: 0; }
  .sheet-card, .sheet-wide {
    width: 100%;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    padding: 26px 18px calc(20px + env(safe-area-inset-bottom));
    animation: sheet-up .45s var(--ease-out) both;
  }
  @keyframes sheet-up { from { transform: translateY(100%); } }
}
html.kb-open .sheet { top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%); }
html.kb-open .sheet-card { max-height: calc(var(--vv-h, 100dvh) - 12px); }
html.kb-open .sheet-backdrop { position: fixed; }

.auth-view { display: flex; flex-direction: column; gap: 12px; }
.auth-view[hidden] { display: none; }
.auth-sub { margin: -2px 0 6px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.auth-sub b { color: var(--cream); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { position: relative; display: flex; flex-direction: column; gap: 5px; text-align: left; }
.field > span { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-hi); }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: var(--cream);
  font: 500 16px/1 var(--font);
  background: rgba(255, 244, 226, .07);
  box-shadow: 0 0 0 1px rgba(199, 202, 206, .25) inset;
  transition: box-shadow .15s, background .15s;
}
.field input::placeholder { color: rgba(255, 244, 226, .35); }
.field input:focus { outline: none; background: rgba(255, 244, 226, .1); box-shadow: 0 0 0 2px var(--red) inset, 0 0 0 4px rgba(228, 0, 43, .25); }
.field.has-error input { box-shadow: 0 0 0 2px #ff4d6a inset; }
.field-err, .check .field-err { min-height: 0; font-style: normal; font-size: 13px; color: #ff8a98; }
.field-err:empty { display: none; }
.field-hint { font-size: 12px; color: var(--muted); }
.field-pass input { padding-right: 48px; }
.pass-toggle {
  position: absolute;
  right: 6px;
  top: 25px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff4e2' stroke-width='1.8'%3E%3Cpath d='M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / 20px no-repeat;
  opacity: .7;
  cursor: pointer;
}
.pass-toggle[aria-pressed="true"] { opacity: 1; }
.field-code input { font-size: 26px; font-weight: 800; letter-spacing: .5em; text-align: center; padding-left: .5em; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; text-align: left; font-size: 14px; line-height: 1.35; color: rgba(255, 244, 226, .85); cursor: pointer; }
.check input { appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 6px; background: rgba(255, 244, 226, .07); box-shadow: 0 0 0 1px rgba(199, 202, 206, .35) inset; cursor: pointer; display: grid; place-items: center; }
.check input:checked { background: var(--red); box-shadow: none; }
.check input:checked::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; rotate: -45deg; translate: 0 -1px; }
.check input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.check .field-err { grid-column: 2; }
.check.has-error input { box-shadow: 0 0 0 2px #ff4d6a inset; }
.checks { display: flex; flex-direction: column; gap: 10px; }
.checks .check { row-gap: 3px; }
.check a, .auth-sub a { color: var(--cream); }
.form-err { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: #ffd2d8; background: rgba(255, 77, 106, .14); box-shadow: 0 0 0 1px rgba(255, 77, 106, .4) inset; }
.form-err:empty { display: none; }
.auth-view .btn { width: 100%; margin-top: 4px; }
.auth-view .btn.is-busy { opacity: .7; pointer-events: none; }
.auth-view .link.is-busy { opacity: .55; pointer-events: none; cursor: progress; }
.auth-switch { margin: 2px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.link { padding: 0; border: 0; background: none; color: var(--cream); font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:disabled { opacity: .45; cursor: default; text-decoration: none; }
.resend-wait { margin-left: 4px; font-variant-numeric: tabular-nums; }
.dev-note { margin: 0; font-size: 13px; color: #9be7a5; }
.footer-captcha { font-size: 11.5px; line-height: 1.4; }
.footer-captcha a { color: inherit; }
.grecaptcha-badge { visibility: hidden; }

.acc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.acc-head h2 { margin-bottom: 2px; }
.acc-avatar { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--red); font-weight: 900; font-size: 20px; box-shadow: 0 0 24px rgba(228, 0, 43, .5); }
.acc-meta { margin: 0; color: var(--muted); font-size: 14px; }
.acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; }
.acc-stats div { padding: 10px 8px; border-radius: 14px; text-align: center; background: rgba(255, 244, 226, .05); box-shadow: 0 0 0 1px rgba(199, 202, 206, .15) inset; }
.acc-stats dt { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.acc-stats dd { margin: 2px 0 0; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, .35); }
.tabs button {
  position: relative;
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  font: 800 14px/1 var(--font);
  background: transparent;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.tabs button[aria-selected="true"] { color: #fff; background: var(--red); }
.tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tab-dot { position: absolute; top: 8px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; }
.tab-panels { min-height: 180px; margin-top: 14px; }
.tab-panel { display: flex; flex-direction: column; gap: 10px; }
.tab-panel[hidden] { display: none; }
.empty-note { margin: 24px 0; text-align: center; color: var(--muted); font-size: 15px; }
.acc-foot { margin-top: 18px; display: flex; justify-content: center; }

.bk { border-radius: 16px; background: rgba(255, 244, 226, .05); box-shadow: 0 0 0 1px rgba(199, 202, 206, .14) inset; }
.bk summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.bk summary::-webkit-details-marker { display: none; }
.bk-head { display: grid; gap: 2px; }
.bk-title { font-size: 16px; font-weight: 900; }
.bk-when { font-size: 12px; color: var(--muted); }
.bk-badge { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; background: rgba(255, 244, 226, .1); }
.bk-badge.is-won { background: var(--red); color: #fff; }
.bk-badge.is-open { background: #fff; color: var(--red); }
.bk-body { display: grid; gap: 12px; padding: 2px 14px 14px; }
.bk-row { display: grid; gap: 6px; }
.bk-label { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bk-note { font-size: 12px; color: var(--muted); }
.bk-tries { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0; padding: 0; list-style: none; }
.bk-tries li { display: flex; align-items: center; gap: 8px; }
.bk-win { font-size: 12px; font-weight: 900; color: var(--gold-hi); }
.dials { display: inline-flex; gap: 3px; }
.dials b { display: grid; place-items: center; width: 20px; height: 26px; border-radius: 5px; font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums;
  color: var(--cream); background: rgba(0, 0, 0, .45); box-shadow: 0 0 0 1px rgba(255, 244, 226, .12) inset; }
.dials b.hit { color: #0e3b22; background: #4dd68c; box-shadow: none; }
.dials.is-answer b { color: #1b080d; background: linear-gradient(180deg, #9e6a6e 0%, #f1c4ce 38%, #fbf5f4 50%, #ce989b 66%, #9e6a6e 100%); box-shadow: 0 0 0 1px #1c0a10, 0 2px 4px rgba(0, 0, 0, .45); }
.bk-tries li.is-correct .dials b { color: #fff; background: var(--red); }

.rw { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 14px; border-radius: 16px; background: rgba(255, 244, 226, .05); box-shadow: 0 0 0 1px rgba(199, 202, 206, .14) inset; }
.rw.is-bucket { background: radial-gradient(120% 120% at 0% 0%, rgba(228, 0, 43, .35), transparent 60%), rgba(255, 244, 226, .05); }
.rw-badge { grid-row: span 2; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; font-weight: 900; font-size: 17px; color: #fff; background: var(--red); }
.rw-badge.has-img { background: radial-gradient(70% 70% at 50% 40%, #ff3b55, var(--red) 70%); overflow: hidden; }
.rw-badge.has-img img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
#rewardBadge img { display: block; width: 70%; margin: 0 auto; object-fit: contain; }
.rw-title { font-weight: 900; font-size: 16px; text-transform: uppercase; }
.rw-sub { font-size: 13px; color: var(--muted); }
.rw-code { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, .35); }
.rw-code strong { font-size: 17px; letter-spacing: .08em; word-break: break-all; }

.rc { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255, 244, 226, .05); }
.rc-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 244, 226, .1); }
.rc-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rc.is-accepted .rc-icon { background: var(--red); color: #fff; }
.rc-title { font-weight: 800; font-size: 15px; }
.rc-sub { font-size: 12px; color: var(--muted); }
.rc-total { font-weight: 900; font-variant-numeric: tabular-nums; }

.reward-badge {
  width: 92px;
  height: 92px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #ff5a72, var(--red) 55%, #8f0019);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 0 50px rgba(228, 0, 43, .8);
  animation: badge-in .8s var(--ease-spring) both .15s;
}
@keyframes badge-in { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }
.reward-kicker { margin: 0 0 4px !important; font-size: 12px !important; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-hi) !important; }
.reward-code { margin: 0 0 18px; text-align: left; }
.reward-code[hidden] { display: none; }
.reward-steps { margin-bottom: 18px; text-align: left; font-size: 14px; line-height: 1.4; }
.reward-pop .popup-card { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }

.game .sheet-card { width: min(100%, 520px); padding-bottom: 18px; }
.game-mount { margin-top: 10px; }
#gameTitle[hidden] + .game-mount { margin-top: 34px; }
.cg { position: relative; width: 100%; height: min(66dvh, 600px); min-height: 380px; border-radius: 18px; overflow: hidden; background: #100406; box-shadow: 0 0 0 1px rgba(199, 202, 206, .2) inset; }
.cg-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: none; outline: none; }
.cg-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px;
  text-align: center;
  background: rgba(16, 4, 6, .74);
}
.cg-screen[hidden] { display: none; }
.cg-title { margin: 0; font-size: 30px; font-weight: 900; text-transform: uppercase; }
.cg-rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; max-width: 380px; text-align: left; font-size: 14px; line-height: 1.4; color: rgba(255, 244, 226, .85); }
.cg-rules li { padding-left: 22px; position: relative; }
.cg-rules li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.cg-rules b { color: #fff; }
.cg-hint { margin: 0; font-size: 12px; color: var(--muted); }
.cg-score { margin: 0; font-size: 40px; font-weight: 900; }
.cg-best { margin: 0; font-size: 14px; font-weight: 800; color: #ffd34d; }
.cg-screen .btn { min-width: 200px; margin-top: 6px; }
@media (max-width: 759px) {
  .game .sheet-card {
    display: flex; flex-direction: column;
    height: 100dvh; max-height: 100dvh; border-radius: 0; overflow: hidden;
    padding: calc(10px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
  }
  .game .sheet-close { top: calc(6px + env(safe-area-inset-top)); right: 6px; }
  .game .sheet-card h2 { margin: 6px 52px 10px 6px; font-size: 20px; }
  .game-mount { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 0; }
  #gameTitle[hidden] + .game-mount { margin-top: 48px; }
  .game .cg { flex: 1; height: auto; min-height: 0; border-radius: 16px; }
}

.live-notice {
  position: fixed;
  z-index: 64;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 76px);
  width: min(calc(100% - 24px), 520px);
  translate: -50% 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 12px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #2c0b0e, #170609);
  box-shadow: 0 0 0 1px rgba(255, 90, 110, .45) inset, 0 20px 50px rgba(0, 0, 0, .6), 0 0 40px rgba(228, 0, 43, .35);
  animation: notice-in .6s var(--ease-spring) both;
}
@keyframes notice-in { from { opacity: 0; transform: translateY(-24px) scale(.96); } }
.live-notice[hidden] { display: none; }
.ln-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; }
.ln-icon svg { width: 20px; height: 20px; fill: currentColor; }
.live-notice p { margin: 0; font-size: 14px; line-height: 1.35; }
.live-notice p b { color: #fff; }
.ln-close { width: 34px; height: 34px; }

.winners { width: min(100% - 32px, 760px); margin: 0 auto; padding: 36px 0 10px; }
.winners-title { margin: 0 0 14px; text-align: center; font-size: clamp(22px, 4.6vw, 30px); font-weight: 900; text-transform: uppercase; }
.winners-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.wn-card { display: grid; justify-items: center; gap: 6px; padding: 12px 10px; border-radius: 16px; background: rgba(255, 244, 226, .05); box-shadow: 0 0 0 1px rgba(199, 202, 206, .16) inset; }
.wn-hour { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--muted); }
.wn-code { display: flex; gap: 3px; }
.wn-code b { display: grid; place-items: center; width: 19px; height: 26px; border-radius: 5px; font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; color: #1b080d;
  background: linear-gradient(180deg, #9e6a6e 0%, #f1c4ce 38%, #fbf5f4 50%, #ce989b 66%, #9e6a6e 100%); box-shadow: 0 0 0 1px #1c0a10, 0 2px 4px rgba(0, 0, 0, .45); }
.wn-time { font-size: 12px; color: var(--gold-hi); white-space: nowrap; }

.stub-digits { display: flex; }
.stub-digits .stub-digit + .stub-digit { margin-left: 4px; }
.btn-play svg { width: 22px; height: 22px; }
.btn-play svg circle { fill: currentColor; }
.btn-crack .cool { margin-left: 8px; font-variant-numeric: tabular-nums; opacity: .8; }
.win-pending { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: rgba(255, 244, 226, .08); }
.popup-winner { margin: -4px 0 14px !important; color: var(--cream) !important; }
.popup-winner b { color: #fff; }
.scan-error { padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
.scan-error p { margin: 0 0 16px; font-size: 17px; color: #ffd2d8; }
.scan-error[hidden] { display: none; }
.scan.is-error .scan-laser { display: none; }
.hero.is-closed .mini-pulse, .hero.is-closed .case-tip { display: none; }

.scan-photo { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0d0607; }
.scan.has-photo .scan-photo { display: block; animation: fade-in .4s both; }
.scan.has-photo .receipt { display: none; }
.scan.is-waiting .scan-laser { opacity: 1; animation: laser 1.3s ease-in-out infinite alternate; }
.scan.is-waiting .scan-status { color: #fff; }
.scan-status { max-width: 340px; text-align: center; line-height: 1.35; min-height: 2.7em; }
.scan.is-error .scan-photo { filter: grayscale(.6) brightness(.7); }
.scan-error-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scan-error-actions .btn { width: min(100%, 340px); }
.scan-error-actions .btn[hidden] { display: none; }

.rc.is-queued .rc-icon, .rc.is-processing .rc-icon { background: rgba(255, 255, 255, .12); color: #fff; }
.rc.is-queued .rc-icon svg, .rc.is-processing .rc-icon svg { animation: rc-spin 1.4s linear infinite; }
@keyframes rc-spin { to { rotate: 360deg; } }

.field > span, .acc-stats dt, .bk-badge, .bk-label, .reward-kicker { letter-spacing: .02em; }
