:root {
  --bg: #0a0a0a;
  --bg-2: #141414;
  --ink: #ffffff;
  --muted: #9a9a9a;
  --line: #262626;
  --accent: #d4ff00;        /* adidas energy — electric lime */
  --accent-ink: #0a0a0a;
  --panel: #111111;
  --radius: 16px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.stripes-bg {
  position: fixed;
  inset: -20% -10%;
  z-index: 0;
  background: repeating-linear-gradient(
    115deg, transparent 0, transparent 64px,
    rgba(255,255,255,.018) 64px, rgba(255,255,255,.018) 96px);
  pointer-events: none;
}
.stripes-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% -10%, rgba(212,255,0,.06), transparent 60%);
}

/* ---------- Topbar ---------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { fill: var(--ink); display: block; }
.brand-text { font-weight: 900; font-size: 26px; letter-spacing: .14em; }
.tagline { margin: 0; color: var(--muted); font-weight: 600; font-style: italic; font-size: 14px; }

/* ---------- Layout ---------- */
.layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 400px);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: clamp(24px, 4vw, 56px);
  max-width: 1320px; margin: 0 auto;
  min-height: calc(100vh - 86px);
}

/* ---------- Stage ---------- */
.stage { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.status {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 8px 8px 18px;
  min-height: 44px;
}
.status-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.status-role {
  font-weight: 900; font-size: 16px; letter-spacing: .02em;
  background: var(--accent); color: var(--accent-ink);
  padding: 5px 14px; border-radius: 999px;
}
.status.done .status-role { background: var(--ink); }
.status-prog { color: var(--muted); font-weight: 700; font-size: 13px; padding-right: 8px; }

.wheel-wrap { position: relative; width: min(74vw, 540px); aspect-ratio: 1; }
#wheel { width: 100%; height: 100%; border-radius: 50%; display: block; filter: drop-shadow(0 30px 60px rgba(0,0,0,.55)); }

/* Center hub */
.hub {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 26%; aspect-ratio: 1;
  border: none; padding: 0; border-radius: 50%;
  background: transparent; cursor: pointer;
  transition: transform .14s ease;
}
.hub:hover { transform: translate(-50%, -50%) scale(1.05); }
.hub:active { transform: translate(-50%, -50%) scale(.97); }
.hub:disabled { cursor: default; }
.hub-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), #aef000, var(--accent));
  box-shadow: 0 8px 26px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06);
}
.hub-face {
  position: absolute; inset: 9%;
  border-radius: 50%;
  background: #0a0a0a;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: inset 0 2px 6px rgba(255,255,255,.06), inset 0 -4px 10px rgba(0,0,0,.6);
}
.hub-label { font-weight: 900; font-size: clamp(15px, 2.6vw, 22px); letter-spacing: .14em; color: var(--accent); }

.pointer {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 18px solid transparent; border-right: 18px solid transparent;
  border-top: 30px solid var(--accent);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.5));
  z-index: 3;
}

/* ---------- Panel ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 22px;
  max-height: min(82vh, 760px); overflow-y: auto;
}
.block { display: flex; flex-direction: column; gap: 12px; }
.block-head { display: flex; align-items: center; justify-content: space-between; }
.block-head h2 { margin: 0; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.count {
  font-weight: 800; font-size: 13px; color: var(--accent-ink);
  background: var(--accent); padding: 2px 10px; border-radius: 999px;
}
#names {
  width: 100%; min-height: 180px; resize: vertical;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; font-family: var(--font); font-size: 15px; font-weight: 600; line-height: 1.7;
  outline: none;
}
#names:focus { border-color: var(--accent); }
.toolbar { display: flex; gap: 8px; }

/* Roles */
.roles { display: flex; flex-direction: column; gap: 8px; }
.role-row { display: flex; align-items: center; gap: 8px; }
.role-dot { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.role-name {
  flex: 1; min-width: 0;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; font-family: var(--font); font-weight: 700; font-size: 14px; outline: none;
}
.role-name:focus { border-color: var(--accent); }
.role-count {
  width: 56px; text-align: center;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 6px; font-family: var(--font); font-weight: 800; font-size: 14px; outline: none;
}
.role-count:focus { border-color: var(--accent); }
.role-del {
  flex: none; width: 32px; height: 32px; border-radius: 8px;
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.role-del:hover { color: #ff3b6b; border-color: #ff3b6b; }

/* Results */
.results { display: flex; flex-direction: column; gap: 6px; }
.results-empty { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.result-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px;
}
.result-role {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent);
  padding: 3px 9px; border-radius: 999px; flex: none;
}
.result-name { font-weight: 800; font-size: 15px; }

.link-btn {
  background: none; border: none; color: var(--muted);
  font-family: var(--font); font-weight: 700; font-size: 12px; cursor: pointer;
  text-transform: uppercase; letter-spacing: .06em;
}
.link-btn:hover { color: var(--accent); }

.opt { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.opt input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font); font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  border-radius: 10px; padding: 10px 14px; cursor: pointer;
  border: 1px solid var(--line); transition: all .14s ease;
}
.btn.ghost { background: transparent; color: var(--ink); flex: 1; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.full { width: 100%; flex: none; }
.btn.solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.solid:hover { filter: brightness(1.08); }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  animation: fade .2s ease;
}
.modal[hidden] { display: none; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.modal-card {
  position: relative;
  background: var(--bg-2); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: 20px; padding: 40px clamp(28px, 6vw, 64px);
  text-align: center; max-width: 90vw;
  box-shadow: 0 40px 80px rgba(0,0,0,.6);
  animation: pop .3s cubic-bezier(.2,.9,.3,1.3);
}
.modal-kicker { margin: 16px 0 0; color: var(--muted); font-weight: 800; letter-spacing: .24em; text-transform: uppercase; font-size: 13px; }
.modal-name { margin: 0; font-weight: 900; font-size: clamp(34px, 7vw, 64px); line-height: 1.05; word-break: break-word; }
.modal-role {
  margin: 12px 0 0; font-weight: 800; font-size: 15px; letter-spacing: .04em;
  color: var(--accent-ink); background: var(--accent); display: inline-block;
  padding: 6px 16px; border-radius: 999px;
}
.modal-role[hidden] { display: none; }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; min-height: 0; gap: 28px; }
  .wheel-wrap { width: min(86vw, 440px); }
  .tagline { display: none; }
  .panel { max-height: none; }
}
