@font-face { font-family: 'Nunito Rara'; src: url('/vendor/nunito-wght.ttf') format('truetype'); font-weight: 200 1000; font-display: swap; }
@view-transition { navigation: auto; }
:root {
  --ink: #f6f3ff; --night: #07071a; --gold-a: #ffe68a; --gold-b: #ffbf3f;
  --common: #d5dcec; --rare: #4fa8ff; --epic: #b872ff; --legendary: #ffc23d;
  --glass: rgba(255, 255, 255, .07); --line: rgba(255, 255, 255, .14);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--ink); font-family: 'Nunito Rara', system-ui, sans-serif; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; font-family: inherit; line-height: 1.1; text-transform: uppercase; font-size: 19px; font-weight: 1000; letter-spacing: .12em; color: #17122e; text-decoration: none;
  background: linear-gradient(var(--gold-a), var(--gold-b)); border: 0; border-radius: 999px; padding: 14px 38px; cursor: pointer;
  box-shadow: 0 0 30px rgba(255, 196, 70, .4), 0 6px 0 #c27f12; transition: transform .08s, box-shadow .08s, filter .2s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 30px rgba(255, 196, 70, .4), 0 2px 0 #c27f12; }
.btn.ghost { color: var(--ink); background: var(--glass); box-shadow: inset 0 0 0 1.5px var(--line), 0 6px 0 rgba(0, 0, 0, .35); }
.btn.small { min-height: 40px; font-size: 13px; padding: 9px 18px; letter-spacing: .14em; }

.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--glass); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 900; letter-spacing: .1em;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background .2s; text-decoration: none; }
.chip:hover { background: rgba(255, 255, 255, .13); }
.chip svg { width: 18px; height: 18px; flex: none; }

/* top bar shared by games */
.topbar { position: fixed; z-index: 5; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + 14px) 0 calc(var(--safe-l) + 14px); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { font-weight: 1000; letter-spacing: .3em; font-size: 15px; }

/* intro and end panels in games */
.panel { position: fixed; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 14px; overflow-y: auto; text-align: center;
  padding: calc(var(--safe-t) + 70px) calc(var(--safe-r) + 18px) calc(var(--safe-b) + 28px) calc(var(--safe-l) + 18px);
  background: linear-gradient(rgba(7, 7, 26, 0) 35%, rgba(7, 7, 26, .55) 60%, rgba(7, 7, 26, .92)); }
.panel > * { flex-shrink: 0; max-width: 100%; }
.panel > :first-child { margin-top: auto; }
.panel h1 { margin: 0; font-size: clamp(38px, 13vw, 92px); line-height: 1.08; font-weight: 1000; letter-spacing: .06em; text-transform: uppercase;
  background: linear-gradient(#fff 30%, var(--accent, #9fb4ff)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent, #9fb4ff) 60%, transparent)); }
.panel p { margin: 0; max-width: 30em; font-size: 17px; font-weight: 700; line-height: 1.45; opacity: .82; }
.panel small { font-size: 12px; font-weight: 800; letter-spacing: .14em; opacity: .55; overflow-wrap: anywhere; }
.today { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 800; }
.today i { width: 12px; height: 12px; border-radius: 50%; background: var(--r, #888); box-shadow: 0 0 12px var(--r, #888); flex: none; }
.big-score { font-size: 84px; font-weight: 1000; line-height: 1; }

/* in-game HUD */
.hud { position: fixed; z-index: 2; left: 0; right: 0; top: calc(var(--safe-t) + 62px); text-align: center; pointer-events: none; }
.hud .label { font-size: 13px; font-weight: 900; letter-spacing: .2em; opacity: .7; }
.hud .value { font-size: 56px; font-weight: 1000; line-height: 1.05; text-shadow: 0 0 24px rgba(140, 170, 255, .55); }
.callout { position: fixed; z-index: 2; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
  font-size: clamp(34px, 11vw, 72px); font-weight: 1000; letter-spacing: .08em; white-space: nowrap; text-shadow: 0 0 30px currentColor; transition: none; }
.callout.show { animation: callout 1.1s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes callout { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -64%) scale(.96); } }
.hint { position: fixed; z-index: 2; left: 0; right: 0; bottom: calc(var(--safe-b) + 28px); text-align: center; font-size: 15px; font-weight: 900; letter-spacing: .14em; opacity: .85; pointer-events: none; text-transform: uppercase; }

/* gauges */
.meters { position: fixed; z-index: 2; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 70px); width: min(78vw, 360px); display: grid; gap: 10px; pointer-events: none; }
.meter { position: relative; height: 16px; border-radius: 999px; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: #6dffb0; box-shadow: 0 0 16px currentColor; transition: background .15s; }
.meter > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 1000; letter-spacing: .2em; color: rgba(255, 255, 255, .85); text-transform: uppercase; mix-blend-mode: difference; }
.meter.danger::after { content: ''; position: absolute; top: 0; bottom: 0; left: 80%; right: 0; background: rgba(255, 80, 80, .22); }

/* reveal */
.reveal { position: fixed; inset: 0; z-index: 20; background: #05050c; animation: fadein .25s ease-out; }
.reveal-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.reveal-card { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 24px calc(var(--safe-r) + 18px) calc(var(--safe-b) + 26px) calc(var(--safe-l) + 18px); pointer-events: none;
  background: linear-gradient(transparent, rgba(5, 5, 12, .85) 45%); animation: rise .5s cubic-bezier(.2, 1.3, .4, 1); }
.reveal-card > * { pointer-events: auto; }
.reveal-rarity { font-size: 14px; font-weight: 1000; letter-spacing: .4em; text-transform: uppercase; color: var(--rc); text-shadow: 0 0 18px var(--rc); }
.reveal-name { margin: 0; font-size: clamp(30px, 9vw, 54px); font-weight: 1000; line-height: 1.05; }
.reveal-meta { font-size: 15px; font-weight: 800; letter-spacing: .08em; opacity: .75; white-space: pre; }
.reveal-tags { display: flex; gap: 8px; min-height: 26px; }
.tag { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 1000; letter-spacing: .18em; background: var(--rc); color: #120d24; }
.tag.up { background: #fff; } .tag.pity { background: var(--legendary); }
.reveal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }
.rarity-common { --rc: var(--common); } .rarity-rare { --rc: var(--rare); } .rarity-epic { --rc: var(--epic); } .rarity-legendary { --rc: var(--legendary); }
.reveal.flat { background: radial-gradient(circle, color-mix(in srgb, var(--rc) 35%, #05050c), #05050c 70%); }
@keyframes fadein { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }

@media (max-height: 480px) {
  .panel { gap: 8px; padding-top: calc(var(--safe-t) + 56px); }
  .panel h1 { font-size: 40px; }
  .panel p { font-size: 14px; }
  .big-score { font-size: 48px; }
  .btn { min-height: 44px; padding: 10px 30px; font-size: 16px; }
  .hud { top: calc(var(--safe-t) + 50px); }
  .hud .value { font-size: 38px; }
  .reveal-name { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; }
}
