:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface2: #ffffff;
  --border: #e3e8f0;
  --text: #0f172a;
  --muted: #5b6878;
  --accent: #2563eb;
  --success: #059669;
  --danger: #dc2626;
  --radius: 8px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; min-height: 100vh; }

nav { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 20px; }
.nav-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 52px; }
.logo { font-weight: 700; font-size: 1.1rem; }
.nav-badge { font-size: .75rem; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 20px; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }
.main-grid { display: grid; grid-template-columns: 240px 1fr 240px; gap: 16px; align-items: start; }

/* PANEL */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.panel-title { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.name-count { font-size: .78rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); padding: 2px 8px; border-radius: 10px; }

/* ADD */
.add-row { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--border); }
.name-input-field { flex: 1; background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 7px 10px; border-radius: 5px; outline: none; font-size: .875rem; }
.name-input-field:focus { border-color: var(--accent); }
.btn-add { background: var(--accent); border: none; color: #fff; padding: 7px 14px; border-radius: 5px; cursor: pointer; font-weight: 600; font-size: .875rem; transition: opacity .15s; }
.btn-add:hover { opacity: .85; }
.bulk-row { padding: 8px 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.bulk-area { width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 8px; border-radius: 5px; font-size: .82rem; resize: none; outline: none; font-family: inherit; }
.bulk-area:focus { border-color: var(--accent); }

/* NAMES LIST */
.names-list { max-height: 280px; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.name-tag { display: flex; align-items: center; justify-content: space-between; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 6px 8px; font-size: .85rem; }
.name-tag.picked-out { opacity: .4; text-decoration: line-through; }
.name-tag button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .75rem; padding: 1px 4px; border-radius: 3px; }
.name-tag button:hover { color: var(--danger); }
.list-actions { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.btn-sm { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 5px 10px; border-radius: 5px; cursor: pointer; font-size: .78rem; transition: background .15s; }
.btn-sm:hover { background: var(--border); }
.btn-sm.danger { border-color: var(--danger); color: var(--danger); }
.btn-sm.danger:hover { background: #3a1010; }

/* WHEEL */
.wheel-col { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.wheel-wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.wheel-pointer { font-size: 1.6rem; color: #fff; line-height: 1; margin-bottom: -8px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); z-index: 10; }
#wheel-canvas { border-radius: 50%; box-shadow: 0 0 0 4px var(--border), 0 8px 32px rgba(0,0,0,.5); }
.spin-btn-wrap { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); margin-top: 12px; }
.spin-btn { background: radial-gradient(circle, #fff 0%, #0f172a 100%); border: 4px solid var(--bg); color: #f7f9fc; width: 72px; height: 72px; border-radius: 50%; cursor: pointer; font-size: .85rem; font-weight: 900; letter-spacing: .05em; box-shadow: 0 2px 12px rgba(0,0,0,.4); transition: transform .1s; }
.spin-btn:hover { transform: scale(1.05); }
.spin-btn:disabled { opacity: .5; cursor: not-allowed; }
.options-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center; }
.checkbox-label { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: .82rem; color: var(--muted); }
.checkbox-label input { accent-color: var(--accent); }
.opt-label { font-size: .78rem; color: var(--muted); }
.tiny-input { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 4px 8px; border-radius: 5px; width: 46px; font-size: .875rem; outline: none; text-align: center; }

/* WINNERS */
.winners-list { padding: 10px; max-height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.winner-item { background: var(--surface2); border: 1px solid var(--border); border-left: 3px solid var(--success); border-radius: 5px; padding: 8px 10px; }
.winner-num { font-size: .7rem; color: var(--muted); }
.winner-name { font-size: .95rem; font-weight: 600; }
.empty-msg { color: var(--muted); font-size: .85rem; text-align: center; padding: 20px; }

/* MODAL */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 36px 40px; text-align: center; max-width: 340px; width: 90%; animation: popIn .3s ease; }
@keyframes popIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-emoji { font-size: 3rem; margin-bottom: 12px; }
.modal-name { font-size: 1.8rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.modal-sub { font-size: .9rem; color: var(--muted); margin-bottom: 20px; }
.btn-primary { background: var(--accent); border: none; color: #fff; padding: 10px 28px; border-radius: var(--radius); cursor: pointer; font-size: .95rem; font-weight: 600; transition: opacity .15s; }
.btn-primary:hover { opacity: .85; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 800px) {
  .main-grid { grid-template-columns: 1fr; }
  #wheel-canvas { width: 300px; height: 300px; }
}
