* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --bg:#0f1226; --card:#1b1f3b; --acc:#6c5ce7; --acc2:#00cec9; --ok:#00b894; --warn:#fdcb6e; --bad:#ff6b6b; --txt:#eef; --mut:#9aa; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--txt); padding-bottom: 80px; -webkit-tap-highlight-color: transparent; }
#topbar { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; background:linear-gradient(90deg,var(--acc),var(--acc2)); position:sticky; top:0; z-index:10; }
.brand { font-weight:700; }
#who { font-size:.8rem; opacity:.95; text-align:right; }
#who a { color:#fff; text-decoration:underline; cursor:pointer; }
#phasebar { text-align:center; font-size:.78rem; padding:6px; background:#000a; color:var(--warn); letter-spacing:.4px; }
#tabs { display:flex; overflow-x:auto; gap:6px; padding:8px; position:sticky; top:48px; background:var(--bg); z-index:9; }
#tabs button { flex:0 0 auto; background:var(--card); color:var(--txt); border:none; padding:8px 14px; border-radius:20px; font-size:.85rem; }
#tabs button.active { background:var(--acc); font-weight:600; }
main { padding:16px; max-width:760px; margin:0 auto; }
.card { background:var(--card); border-radius:14px; padding:16px; margin-bottom:14px; }
h2 { font-size:1.1rem; margin-bottom:10px; }
h3 { font-size:.95rem; margin-bottom:6px; }
label { display:block; font-size:.8rem; color:var(--mut); margin:10px 0 4px; }
input, select, textarea { width:100%; padding:11px; border-radius:10px; border:1px solid #333a; background:#0d1030; color:var(--txt); font-size:1rem; }
button.btn { background:var(--acc); color:#fff; border:none; padding:11px 16px; border-radius:10px; font-size:.95rem; font-weight:600; cursor:pointer; margin-top:10px; }
button.btn.sec { background:#2a2f55; }
button.btn.bad { background:var(--bad); }
button.btn.ok { background:var(--ok); }
button.btn:disabled { opacity:.45; }
.row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.muted { color:var(--mut); font-size:.82rem; }
.pill { font-size:.7rem; padding:2px 8px; border-radius:10px; background:#2a2f55; }
.pill.full { background:var(--bad); }
.pill.ok { background:var(--ok); }
.q { display:flex; gap:12px; align-items:center; }
.thumb { width:64px; height:64px; border-radius:10px; object-fit:cover; background:#0d1030; flex:0 0 64px; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; }
.gcard { background:#0d1030; border-radius:10px; overflow:hidden; }
.gcard img { width:100%; aspect-ratio:1; object-fit:cover; display:block; }
.gcard .meta { padding:8px; display:flex; justify-content:space-between; align-items:center; font-size:.8rem; }
.lbrow { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid #2a2f55; }
.lbrow .rank { font-weight:700; width:30px; text-align:center; font-size:1.05rem; }
.lbrow .sc { margin-left:auto; font-weight:700; color:var(--acc2); }
table { width:100%; border-collapse:collapse; font-size:.82rem; }
th,td { text-align:left; padding:6px; border-bottom:1px solid #2a2f55; }
#toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:#000d; padding:12px 18px; border-radius:12px; font-size:.9rem; opacity:0; transition:.3s; pointer-events:none; max-width:90%; text-align:center; }
#toast.show { opacity:1; }
#toast.err { background:var(--bad); }
.center { text-align:center; }
.voted { outline:3px solid var(--ok); }
.gcard img, .thumb { cursor: zoom-in; }
.na { width:100%; aspect-ratio:1; display:flex; align-items:center; justify-content:center; color:var(--mut); background:repeating-linear-gradient(45deg,#0d1030,#0d1030 8px,#11143a 8px,#11143a 16px); font-size:.8rem; }

/* navigable lightbox */
.lb { position:fixed; inset:0; background:#000ee; display:flex; align-items:center; justify-content:center; z-index:100; }
.lb img { max-width:96vw; max-height:78vh; border-radius:8px; }
.lb .lbx { position:fixed; top:12px; right:16px; font-size:1.8rem; color:#fff; cursor:pointer; padding:6px; }
.lb .lbnav { position:fixed; top:50%; transform:translateY(-50%); background:#fff2; color:#fff; border:none; font-size:2.4rem; width:54px; height:72px; border-radius:12px; cursor:pointer; }
.lb .lbnav.prev { left:8px; } .lb .lbnav.next { right:8px; }
.lb .lbbar { position:fixed; bottom:0; left:0; right:0; display:flex; justify-content:space-between; align-items:center; gap:10px; padding:14px 16px; background:#000c; font-size:.9rem; }
.lb .lbright { display:flex; align-items:center; gap:10px; }
.lb .lbbar .btn { margin:0; padding:9px 18px; }

/* progress + summary */
.summary h2 { margin-bottom:8px; }
.bar { height:10px; border-radius:6px; background:#0d1030; overflow:hidden; margin:4px 0 8px; }
.bar > div { height:100%; background:linear-gradient(90deg,var(--acc),var(--acc2)); transition:width .3s; }

/* file-pick button (hides ugly native input) */
label.file { display:inline-flex; align-items:center; justify-content:center; margin-top:10px; }
label.file input { display:none; }

/* team list */
.teambox { padding:10px 0; border-bottom:1px solid #2a2f55; }
.teambox:last-child { border-bottom:none; }
.mem { font-size:.9rem; padding:2px 0 2px 6px; color:#dde; }
.thumb.ph { display:flex; align-items:center; justify-content:center; color:var(--mut); font-size:1.4rem; }
.up { margin-top:4px; }
.vc { display:flex; align-items:center; gap:6px; }

/* duplicate warning */
.warn { background:#3a2f1a; border:1px solid var(--warn); border-radius:10px; padding:12px; margin-top:12px; }
.warn p { font-size:.85rem; margin-bottom:4px; }
.pl { padding:10px 0; border-bottom:1px solid #2a2f55; display:flex; flex-direction:column; gap:6px; }
.pl:last-child { border-bottom:none; }

/* bigger tap targets on phones */
button.btn.big { width:100%; padding:14px; font-size:1.05rem; }
@media (max-width:480px){ .grid { grid-template-columns:repeat(2,1fr); } #tabs button { padding:10px 14px; } }