:root {
  --pine: #123a27; --pine-2: #1f5d3a; --red: #b3202a; --gold: #d9a62e;
  --paper: #fbf8f2; --ink: #1b1b1b; --muted: #5d6660; --line: #e4ddd0;
}
* { box-sizing: border-box; min-width: 0; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 16px/1.55 Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.08) 0 2px, transparent 3px) 0 0/90px 90px,
    radial-gradient(circle at 60% 40%, rgba(255,255,255,.06) 0 1.5px, transparent 2.5px) 0 0/70px 70px,
    var(--pine);
}
.wrap { max-width: 760px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) 16px 64px; }
.top { color: #fff; margin-bottom: 24px; }
h1 { font: 400 clamp(36px, 7vw, 52px)/1.05 'Young Serif', Georgia, serif; margin: 0 0 10px; }
h2 { font: 400 24px/1.2 'Young Serif', Georgia, serif; margin: 0 0 14px; }
.lead { margin: 0; opacity: .85; max-width: 52ch; }
.card { background: var(--paper); border-radius: 18px; padding: clamp(20px, 4vw, 32px); margin-bottom: 18px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.narrow { max-width: 420px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.err { color: var(--red); font-weight: 600; }

.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.name {
  min-height: 56px; border: 2px solid var(--line); background: #fff; border-radius: 12px;
  font: 600 17px Inter, sans-serif; color: var(--ink); cursor: pointer; display: grid; place-items: center;
  transition: border-color .15s, transform .15s;
}
.name:hover:not(:disabled) { border-color: var(--red); transform: translateY(-2px); }
.name:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.name.taken { background: #efeae1; color: #9a9a92; cursor: not-allowed; }
.name small { font-weight: 400; font-size: 13px; }
.mine { background: #fff4d6; border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.wheel-box { position: relative; width: min(100%, 420px); aspect-ratio: 1; margin: 8px auto 20px; }
#wheel { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 18px rgba(0,0,0,.25)); }
#wheel text { font-family: Inter, sans-serif; font-weight: 600; }
.pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid var(--gold);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 2px solid var(--pine-2); background: #fff;
  color: var(--pine-2); font: 600 16px Inter, sans-serif; cursor: pointer;
}
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; text-decoration: underline; padding: 0 8px; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }

.result { text-align: center; padding-block: 48px; }
.who { font: 400 clamp(44px, 11vw, 76px)/1.05 'Young Serif', Georgia, serif; color: var(--red); margin: 6px 0 18px; }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=password], textarea { width: 100%; font: 16px Inter, sans-serif; padding: 12px; border: 2px solid var(--line); border-radius: 10px; margin-bottom: 12px; background: #fff; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; margin: 0; }
.check input { width: 20px; height: 20px; }
.head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pill { background: var(--pine-2); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 10px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 14px; color: var(--muted); font-weight: 600; }
.confirm { background: #fde8e8; border-radius: 12px; padding: 14px; margin-top: 14px; }
.confirm p { margin: 0 0 10px; }

@media (max-width: 600px) {
  .stack thead { display: none; }
  .stack tr { display: grid; padding-block: 8px; border-bottom: 1px solid var(--line); }
  .stack td { border: 0; padding: 2px 0; }
}
@media (prefers-reduced-motion: reduce) { .name { transition: none; } }
