* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --gold: #F5A623; --silver: #B0BEC5; --bronze: #CD7F32;
  --bg: #0A0E1A; --surface: #111827; --surface2: #1E2537;
  --accent: #00E5FF; --accent2: #FF4081; --green: #00E676;
  --text: #F0F4FF; --muted: #7B8DB0; --border: rgba(255,255,255,0.08);
}
body {
  background: var(--bg); color: var(--text);
  font-family: 'DM Sans', sans-serif; min-height: 100vh;
  display: flex; flex-direction: column;
}
h1, h2, .score-num, .rank-num { font-family: 'Bebas Neue', cursive; letter-spacing: 2px; }

/* ── TOP BAR ── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.topbar-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.topbar-title { font-family: 'Bebas Neue', cursive; font-size: 22px; letter-spacing: 3px; color: var(--accent); flex: 1; }
.topbar-sub { font-size: 12px; color: var(--muted); }

/* ── LAUNCH BAR ── */
.launch-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; background: rgba(0,229,255,0.05);
  border-bottom: 1px solid rgba(0,229,255,0.15); flex-shrink: 0;
}
.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0; transition: .3s;
}
.live-dot.on {
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.live-label { flex: 1; font-size: 13px; color: var(--muted); }
.live-label strong { color: var(--text); font-weight: 600; }

/* ── TABS ── */
.tabs {
  display: flex; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.tab {
  flex: 1; padding: 13px 8px; font-size: 13px; font-weight: 600;
  text-align: center; cursor: pointer; color: var(--muted);
  border: none; background: none; transition: .2s;
  text-transform: uppercase; letter-spacing: 1px;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover:not(.active) { color: var(--text); background: rgba(255,255,255,0.03); }

/* ── VIEWS ── */
.view { display: none; padding: 18px 20px; overflow-y: auto; flex: 1; }
.view.active { display: block; }

/* ── SECTION LABEL ── */
.section-label {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 8px; margin-top: 18px;
}
.section-label:first-child { margin-top: 0; }

/* ── INPUTS ── */
input[type=text], input[type=number], select {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 13px; border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  outline: none; transition: .2s; flex: 1; width: 100%;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,229,255,0.1);
}
input::placeholder { color: var(--muted); }
.input-row { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }

/* ── BUTTONS ── */
.btn {
  padding: 10px 18px; border-radius: 8px; border: none;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: .15s; white-space: nowrap; display: inline-flex;
  align-items: center; gap: 6px;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: #000; }
.btn-accent:hover { background: #26EEFF; }
.btn-accent-outline {
  background: rgba(0,229,255,0.1); color: var(--accent);
  border: 1px solid rgba(0,229,255,0.3);
}
.btn-accent-outline:hover { background: rgba(0,229,255,0.18); }
.btn-danger { background: rgba(255,64,129,0.12); color: var(--accent2); border: 1px solid rgba(255,64,129,0.3); }
.btn-danger:hover { background: rgba(255,64,129,0.22); }
.btn-ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.06); }
.btn-success { background: rgba(0,230,118,0.12); color: var(--green); border: 1px solid rgba(0,230,118,0.3); }

/* ── COLOR PICKER ── */
.color-picker-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; margin-bottom: 4px; }
.color-circle {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border); cursor: pointer; transition: .1s;
}
.color-circle.selected {
  border-color: white; box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
  transform: scale(1.1);
}

/* ── TEAM MANAGE ── */
.team-manage-list { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.manage-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px; background: var(--surface);
  border-radius: 10px; border: 1px solid var(--border);
}
.manage-color { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.manage-name { flex: 1; font-weight: 600; font-size: 14px; min-width: 0; }
.manage-sub { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.manage-score { font-family: 'Bebas Neue', cursive; font-size: 24px; color: var(--accent); min-width: 54px; text-align: center; }
.score-controls { display: flex; gap: 5px; align-items: center; }
.score-btn {
  width: 32px; height: 32px; border-radius: 7px; border: none;
  cursor: pointer; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.score-btn:active { transform: scale(0.88); }
.score-btn.minus { background: rgba(255,64,129,0.15); color: var(--accent2); }
.score-btn.minus:hover { background: rgba(255,64,129,0.28); }
.score-btn.plus { background: rgba(0,229,255,0.15); color: var(--accent); }
.score-btn.plus:hover { background: rgba(0,229,255,0.28); }

/* ── QUESTIONS ── */
.question-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 15px; margin-bottom: 9px;
}
.question-card.done { border-color: rgba(0,230,118,0.25); opacity: .8; }
.q-num { font-family: 'Bebas Neue', cursive; font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.q-text { font-size: 15px; font-weight: 500; margin-top: 4px; line-height: 1.4; }
.q-pts { font-size: 12px; color: var(--accent); margin-top: 4px; font-weight: 600; }
.award-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.award-btn {
  font-size: 12px; padding: 6px 11px; border-radius: 7px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); cursor: pointer; font-weight: 600;
  transition: .15s; display: inline-flex; align-items: center; gap: 5px;
}
.award-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.award-btn.awarded { background: rgba(0,230,118,0.1); border-color: var(--green); color: var(--green); }
.award-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── SETTINGS ── */
.setting-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.setting-label { flex: 1; font-size: 14px; font-weight: 500; }
.setting-desc { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 400; }

.toggle-wrap { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-wrap input { opacity: 0; width: 0; height: 0; }
.toggle-ui { position: absolute; inset: 0; background: var(--surface2); border-radius: 26px; cursor: pointer; transition: .2s; border: 1px solid var(--border); }
.toggle-ui:before { content:''; position:absolute; width:20px; height:20px; left:2px; top:2px; background:var(--muted); border-radius:50%; transition:.2s; }
.toggle-wrap input:checked + .toggle-ui { background: rgba(0,229,255,0.15); border-color: var(--accent); }
.toggle-wrap input:checked + .toggle-ui:before { transform: translateX(20px); background: var(--accent); }

/* ── QUICK SCORE ── */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.quick-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; display: flex;
  align-items: center; gap: 10px;
}
.quick-color { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.quick-name { flex: 1; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-score { font-family: 'Bebas Neue', cursive; font-size: 26px; color: var(--accent); }
.quick-btns { display: flex; gap: 4px; }
.qbtn {
  width: 28px; height: 28px; border-radius: 6px; border: none;
  cursor: pointer; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; transition: .1s;
}
.qbtn:active { transform: scale(0.88); }
.qbtn.m { background: rgba(255,64,129,0.15); color: var(--accent2); }
.qbtn.p { background: rgba(0,229,255,0.15); color: var(--accent); }

.btn-end {
  background: linear-gradient(135deg, #F5A623, #FF4081);
  color: #fff; font-weight: 700; letter-spacing: 0.5px;
  box-shadow: 0 0 14px rgba(245,166,35,0.35);
}
.btn-end:hover { filter: brightness(1.12); box-shadow: 0 0 22px rgba(245,166,35,0.55); }

#toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: var(--surface2); color: var(--text); padding: 10px 22px;
  border-radius: 8px; border: 1px solid var(--border); font-size: 13px;
  font-weight: 600; opacity: 0; transition: .3s; pointer-events: none;
  z-index: 9999; white-space: nowrap; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
#toast.show { opacity: 1; }

/* ── EMPTY ── */
.empty-state { text-align: center; padding: 30px 16px; color: var(--muted); font-size: 14px; }
.empty-icon { font-size: 36px; margin-bottom: 8px; opacity: .5; display: block; }

/* scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 2px; }
