:root {
  color-scheme: dark;
  --bg: #070b14;
  --ink: #f4f7fb;
  --muted: #93a4b8;
  --line: #243044;
  --blue: #5ec8f5;
  --blue-ink: #073044;
  --panel: #121a27;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 16px/1.5 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
#sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 28% 72%, rgba(255,255,255,.55), transparent),
    radial-gradient(1.4px 1.4px at 70% 22%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 84% 64%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.2px 1.2px at 46% 40%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 18% 88%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.3px 1.3px at 90% 12%, rgba(255,255,255,.65), transparent),
    radial-gradient(1px 1px at 60% 80%, rgba(255,255,255,.35), transparent),
    var(--bg);
}
#gear {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
main {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 28px 20px 48px;
  min-height: 100dvh;
}
h1 { font-size: 28px; line-height: 1.25; margin: 8px 0 12px; font-weight: 750; }
h2 { margin: 0 0 12px; }
p { margin: 0 0 12px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
.primary, .secondary, .ghost {
  border: 0;
  border-radius: 999px;
  padding: 14px 16px;
  font-weight: 700;
}
.primary { width: 100%; background: var(--blue); color: var(--blue-ink); }
.secondary { width: 100%; background: #243044; color: #d5dde6; }
.ghost { width: 100%; margin-top: 8px; background: #243044; color: white; border-radius: 12px; }
.danger { color: #ffb4b4; }
.tabs { display: flex; gap: 18px; margin: 18px 0; }
.tab { background: none; border: 0; color: var(--muted); padding: 6px 0; font-size: 18px; }
.tab.on { color: white; box-shadow: inset 0 -2px 0 var(--blue); }
label { display: block; margin: 14px 0 6px; font-weight: 650; }
input {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: #243044;
  color: white;
  padding: 14px 16px;
  font-size: 16px;
}
.code-input { text-transform: uppercase; letter-spacing: .18em; }
.hint, .muted, .eyebrow { color: var(--muted); }
.center, .center-title { text-align: center; }
.example {
  background: #1a2433;
  border-radius: 12px;
  padding: 12px 14px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.timer, .progress {
  border: 1px solid #3d5168;
  border-radius: 999px;
  padding: 4px 10px;
  font-variant-numeric: tabular-nums;
}
.count {
  width: 92px;
  height: 92px;
  margin: 28px auto;
  border: 3px solid #3ec1c4;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 40px;
  font-weight: 750;
}
.dial { width: min(100%, 420px); margin: 6px auto 0; touch-action: none; }
.dial svg {
  width: 100%;
  height: auto;
  aspect-ratio: 200 / 132;
  display: block;
  touch-action: none;
  overflow: hidden;
}
.poles { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0 16px; font-weight: 700; }
.row-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.back {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 0;
  margin-bottom: 8px;
}
.pack-card {
  width: 180px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--blue);
  background: #1c2838;
}
.pack-art {
  height: 96px;
  background:
    linear-gradient(#f3b7c8 1px, transparent 1px),
    linear-gradient(90deg, #f3b7c8 1px, transparent 1px),
    #f7c9d6;
  background-size: 18px 18px;
}
.pack-name { display: flex; justify-content: space-between; padding: 8px 10px; font-weight: 700; }
.hero { display: grid; justify-items: center; gap: 8px; margin-top: 8px; }
.avatar-row { display: flex; align-items: center; gap: 14px; }
.arrow {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: #1c2838; color: white; font-size: 18px;
}
.hero-face, .face {
  display: grid; place-items: center; border-radius: 50%;
}
.hero-face { width: 132px; height: 132px; font-size: 68px; background: #243044; }
.badge {
  background: var(--blue); color: var(--blue-ink); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 750;
}
.code { font-size: 28px; letter-spacing: .16em; font-weight: 800; margin: 0; }
.copy { border: 0; background: transparent; color: var(--blue); font-weight: 700; }
.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 18px 0; }
.slot {
  aspect-ratio: 1; border-radius: 50%; background: #1a2433;
  display: grid; place-items: center; border: 0; color: #9fb3c8; font-size: 22px;
}
.slot.empty { background: transparent; border: 1px dashed #314056; }
.slot.dim { opacity: .4; }
.face { width: 100%; height: 100%; font-size: 22px; }
.setting-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 0 16px; }
.switch {
  width: 48px; height: 28px; border: 0; border-radius: 999px; background: #314056; position: relative; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: white;
  transition: transform .15s linear;
}
.switch.on { background: var(--blue); }
.switch.on::after { transform: translateX(20px); }
.clue { text-align: center; font-size: 34px; margin: 4px 0 8px; }
.guess-bar { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.ready-pill { border: 1px solid #8aa0b4; border-radius: 999px; padding: 12px 14px; min-width: 64px; text-align: center; }
.score-pop { text-align: center; font-size: 42px; font-weight: 800; margin: 4px 0 8px; animation: pop .35s ease; }
.score-list, .final-list { list-style: none; padding: 0; margin: 0 0 14px; }
.score-list li, .final-list li {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.final-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; }
.verdict-emoji { margin: 0; text-align: center; font-size: 44px; line-height: 1.2; }
.verdict-name { margin: 0; text-align: center; font-size: 34px; }
.verdict-line, .score-quiet { text-align: center; color: var(--muted); }
.score-quiet { margin-bottom: 4px; }
.final-actions { margin: 16px 0 8px; }
.recap-head { font-size: 16px; margin: 18px 0 8px; }
.recap { margin: 0 0 14px; }
.recap-title { margin: 0 0 6px; font-size: 14px; }
.strip-scale { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.strip-box { position: relative; height: 18px; }
.strip {
  position: absolute; left: 0; right: 0; top: 2px; height: 14px;
  border-radius: 999px; background: #efe6d4; overflow: hidden;
}
.seg { position: absolute; top: 0; bottom: 0; }
.notch { position: absolute; top: 0; bottom: 0; width: 2px; background: #1b2430; transform: translateX(-50%); }
.ticks { position: absolute; inset: 0; }
.tick {
  position: absolute; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  transform: translateX(-50%); box-shadow: 0 0 0 2px #070b14;
}
.people { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; color: #d5dde6; font-size: 13px; }
.people span { display: inline-flex; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.notch-dot { background: #efe6d4; box-shadow: inset 0 0 0 2px #1b2430; }
.emotes { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0 14px; }
.emote {
  width: 64px; height: 48px; border: 0; border-radius: 14px; background: transparent; font-size: 28px;
}
.floats { position: relative; height: 72px; pointer-events: none; }
.float { position: absolute; bottom: 0; font-size: 28px; animation: rise 1.15s ease forwards; }
.panel { padding-top: 24px; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
dialog {
  width: min(420px, calc(100% - 32px));
  border: 0;
  border-radius: 16px;
  background: var(--panel);
  color: white;
  padding: 20px;
}
dialog::backdrop { background: rgba(0, 0, 0, .55); }
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1c2838;
  color: white;
  border-radius: 999px;
  padding: 10px 16px;
  z-index: 6;
  max-width: min(420px, calc(100% - 32px));
}
@keyframes pop { from { transform: scale(.86); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { to { transform: translateY(-110px); opacity: 0; } }
