/* Five Pillar League — mobile-first, dark, competitive, quiet. */
:root {
  --bg: #0c0e11; --panel: #15191f; --panel2: #1c2129; --line: #2a313b; --text: #e9ecf0; --muted: #8e98a6;
  --accent: #c6f24e; --accent-ink: #11140a; --warn: #f2b84b; --bad: #ff6b6b; --ok: #5bd68e;
  --PHY: #ff7a59; --ART: #5ab0ff; --CAM: #f2c14e; --INT: #b18cff; --MAS: #4fd1a5; --LEAGUE: #c6f24e;
  --r: 14px; --gap: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI",
  Inter, Roboto, sans-serif; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--text); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; font-weight: 600; }
p { margin: 6px 0; }
.num, .score { font-variant-numeric: tabular-nums; }
.tbl td.num { white-space: nowrap; }
.wrap { max-width: 760px; margin: 0 auto; padding: 12px 16px; }
.admin .wrap { max-width: 1180px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; } .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid5 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--gap); }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: rgba(12,14,17,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 800; letter-spacing: .04em; font-size: 14px; text-transform: uppercase; }
.brand b { color: var(--accent); }
.fake { background: var(--warn); color: #000; text-align: center; font-size: 12px; padding: 3px; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 12px 0; }
.card.tight { padding: 10px 12px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.hero { background: linear-gradient(160deg, #1a2010 0%, var(--panel) 55%); border-color: #33401c; }
.match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.match .who { font-weight: 700; font-size: 17px; }
.match .lp { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.match .vs { color: var(--muted); font-weight: 700; }
.kpi { display: flex; gap: 16px; justify-content: center; color: var(--muted); font-size: 13px; margin-top: 6px; }

/* pillar tiles */
.pillar { border-left: 4px solid var(--c, var(--accent)); display: block; text-decoration: none; }
.pillar .name { font-weight: 700; }
.pillar .big { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--panel2); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--c, var(--accent)); }
.c-PHY { --c: var(--PHY); } .c-ART { --c: var(--ART); } .c-CAM { --c: var(--CAM); } .c-INT { --c: var(--INT); }
.c-MAS { --c: var(--MAS); } .c-LEAGUE { --c: var(--LEAGUE); }

/* badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok, .badge.done { color: var(--ok); border-color: #1f5a37; background: #0f2418; }
.badge.warn, .badge.late, .badge.todo { color: var(--warn); border-color: #5a4418; background: #231b0b; }
.badge.bad, .badge.open { color: var(--bad); border-color: #5a2323; background: #240f0f; }
.badge.accent { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.badge.na, .badge.optional { color: var(--muted); }

/* task list */
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { border-top: 1px solid var(--line); }
.tasks li:first-child { border-top: 0; }
.tasks a, .tasks .t { display: flex; align-items: center; gap: 10px; padding: 12px 2px; text-decoration: none; min-height: 52px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.tasks .lbl { flex: 1; }
.tasks .due { color: var(--muted); font-size: 13px; }

/* forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; min-height: 46px; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: 9px; }
textarea { min-height: 90px; }
.check { display: flex; align-items: flex-start; gap: 10px; color: var(--text); font-size: 15px; margin: 10px 0; }
.check input { flex: none; margin-top: 1px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700;
  border: 0; border-radius: 12px; padding: 12px 16px; min-height: 48px; cursor: pointer; background: var(--panel2);
  color: var(--text); text-decoration: none; border: 1px solid var(--line); }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger, button.danger { background: #3a1414; color: #ffb3b3; border-color: #5a2323; }
.btn.block, button.block { width: 100%; }
.btn.small, button.small { min-height: 36px; padding: 6px 10px; font-size: 13px; border-radius: 9px; }
button:disabled { opacity: .45; cursor: not-allowed; }
form.inline { display: inline; }
details { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin: 10px 0; }
details > summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style: none; }
details > summary::after { content: "＋"; float: right; color: var(--muted); }
details[open] > summary::after { content: "－"; }
details[open] { padding-bottom: 12px; }

/* flash */
.flash { border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 14px; border: 1px solid var(--line); }
.flash.error { background: #2a1111; border-color: #5a2323; color: #ffc2c2; }
.flash.ok { background: #0f2418; border-color: #1f5a37; color: #b8f5cf; }
.flash.warn { background: #231b0b; border-color: #5a4418; color: #ffe0a3; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-variant-numeric: tabular-nums; }
pre.trace { white-space: pre-wrap; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: #b9c2cf;
  background: #0f1217; border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-x: auto; }

/* timers / recorder / quiz */
.timer { font-size: 56px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer.low { color: var(--warn); } .timer.out { color: var(--bad); }
.phase { text-align: center; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; }
.prompt { font-size: 20px; font-weight: 700; line-height: 1.35; padding: 14px; background: var(--panel2); border-radius: 12px;
  border: 1px solid var(--line); }
.recdot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.opt { display: block; width: 100%; text-align: left; margin: 8px 0; min-height: 56px; font-weight: 600; }
.opt.sel { border-color: var(--accent); background: #222a14; }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: rgba(15,18,22,.97); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(6, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; font-size: 11px;
  text-decoration: none; color: var(--muted); font-weight: 600; min-height: 58px; }
.nav a.on { color: var(--accent); }
.nav svg { width: 22px; height: 22px; }
.adminbar { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.adminbar a { white-space: nowrap; text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 8px; background: var(--panel2); }
.admin body { padding-bottom: 20px; }
.split { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.loginbox { max-width: 380px; margin: 12vh auto 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
