:root {
  --bg: #10131f;
  --surface: #1a1e2e;
  --surface-2: #232839;
  --line: #2f354a;
  --text: #f5f1e8;
  --muted: #a3a8bc;
  --gold: #f2c14e;
  --gold-ink: #2a1f00;
  --red: #e5636b;
  --green: #5cbf8f;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

h1, h2 { line-height: 1.15; margin: 0; }
[hidden] { display: none !important; }

.eyebrow {
  margin: 0 0 .35em;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: .7em 1.1em;
  border-radius: 10px;
  cursor: pointer;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.danger { border-color: color-mix(in srgb, var(--red) 60%, transparent); color: var(--red); background: transparent; }
.btn.big { width: 100%; padding: 1em; font-size: 1.1rem; }
.btn:focus-visible, .chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- phone ---------- */

.phone main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1.1rem calc(7rem + env(safe-area-inset-bottom));
}
.phone header { margin-bottom: 1.25rem; }
.phone h1 { font-size: 1.75rem; }
.phone h2 {
  font-size: .85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 1.5rem 0 .6rem;
}
.hint { color: var(--muted); margin: 0; }

.ranked, .pool { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }

.ranked li {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: .55rem .55rem .55rem .7rem;
  animation: pop .18s ease-out;
}
.ranked .num {
  flex: none;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 800;
}
.ranked .name { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.icon-btn {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.chip {
  width: 100%;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: .95rem 1rem;
  cursor: pointer;
}
.chip:active { background: var(--surface-2); }

.submit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: .9rem 1.1rem calc(.9rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.submit-bar > * { max-width: 34rem; margin-left: auto; margin-right: auto; }
.msg { min-height: 1.4em; margin: .5rem auto 0; text-align: center; color: var(--muted); font-size: .92rem; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }

.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.notice p { margin: .3rem 0; }
.notice ol { margin: .6rem 0 0; padding-left: 1.4rem; }

@keyframes pop { from { transform: scale(.97); opacity: .4; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
