/* SnackScout competition hub: event tabs, all-matches table, alliance selection, scout-a-match window, player. */

/* ---------- pop-up window (scout a match / watch) */
body.modal-open { overflow: hidden; }
.modal-bg { position: fixed; inset: 0; z-index: 200; background: color-mix(in srgb, #000 55%, transparent); backdrop-filter: blur(3px);
  display: grid; place-items: start center; overflow-y: auto; animation: fadeIn .18s ease;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
@keyframes fadeIn { from { opacity: 0; } }
.modal { position: relative; width: min(760px, 100%); margin-top: 40px; background: var(--panel); border: 1px solid var(--line);
  border-radius: calc(var(--r) + 4px); padding: 20px 22px; box-shadow: var(--shadow-lg); animation: modalIn .25s var(--ease); }
.modal.wide { width: min(1180px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.modal-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; padding: 0 !important; justify-content: center; border-radius: 50% !important; }
.modal h2 { padding-right: 40px; }
.modal-loading { padding: 40px; text-align: center; color: var(--muted); display: flex; gap: 10px; justify-content: center; align-items: center; }
.match-score { text-align: right; font-size: 20px; }
.player { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; display: block; }
.player-cap { margin-top: 6px; }
.vid-empty { aspect-ratio: 16 / 9; border-radius: 12px; background: var(--panel2); border: 1px dashed var(--line2); display: grid; place-items: center;
  color: var(--muted); text-align: center; padding: 16px; gap: 8px; }
.tabs-row { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.tabs-row .tab { background: var(--panel2) !important; color: var(--ink) !important; border: 1.5px solid var(--line) !important; padding: 6px 11px !important; font-size: 13.5px; }
.tabs-row .tab.red { border-left: 4px solid var(--red) !important; } .tabs-row .tab.blue { border-left: 4px solid var(--blue) !important; }
.tabs-row .tab.on { border-color: var(--brand) !important; background: var(--brand-soft) !important; }
.notes-label { display: block; margin: 10px 0 8px; font-weight: 600; }
.notes-label textarea { width: 100%; min-height: 70px; margin-top: 4px; }

/* ---------- event page */
.progress { height: 6px; background: var(--chip); border-radius: 999px; overflow: hidden; margin-top: 12px; max-width: 360px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand2), var(--brand)); border-radius: 999px; transition: width .6s var(--ease); }
.cards.highs { margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tnum { font-weight: 700; font-variant-numeric: tabular-nums; }
.tnum.me { background: var(--accent); color: #2b2118 !important; border-radius: 5px; padding: 0 4px; }
.tabsec { margin-top: 6px; }
.all-matches td { vertical-align: middle; }
.red-cell { box-shadow: inset 3px 0 0 var(--red); } .blue-cell { box-shadow: inset 3px 0 0 var(--blue); }
.red-cell.win, .blue-cell.win { font-weight: 700; }
.sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.sc.red { color: var(--red); } .sc.blue { color: var(--blue); } .sc.w { font-size: 1.12em; }
.split { height: 5px; border-radius: 999px; background: var(--blue); overflow: hidden; margin: 4px auto 0; width: 80px; opacity: .8; }
.split i { display: block; height: 100%; background: var(--red); }
.insight { max-width: 340px; white-space: normal !important; color: var(--muted); }
tr.mine > td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.mnote-preview { background: var(--panel2); border-radius: var(--r-sm); padding: 6px 10px; color: var(--muted); }
.warnchip { background: var(--warn-soft); color: var(--warn); }

/* ---------- alliance selection */
.alliance-grid { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 860px) { .alliance-grid { grid-template-columns: 1fr; } }
.picklist { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.pick { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel2); flex-wrap: wrap; }
.pick .grow { flex: 1; }
.pick select { padding: 3px 6px; font-size: 12.5px; }
.pick .pnum { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.pick.picked, .pick.declined { opacity: .5; text-decoration: line-through; }
.pick.dnp { border-color: var(--bad); }
.tier { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tier.t0 { background: var(--good-soft); color: var(--good); } .tier.t1, .tier.t2 { background: var(--chip); } .tier.t3 { color: var(--muted); }

/* ---------- quick actions (Ctrl+K) */
.modal.palette { width: min(620px, 100%); margin-top: 12vh; padding: 12px; }
.palette input { width: 100%; font-size: 17px; padding: 12px 14px; border-radius: var(--r-sm); }
.pal-list { list-style: none; margin: 8px 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.pal-list li { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer; font-weight: 500; }
.pal-list li.on, .pal-list li:hover { background: var(--brand-soft); }
.pal-list .pic { width: 24px; text-align: center; }
.quick-btn { background: var(--panel) !important; color: var(--ink) !important; border: 1px solid var(--line2) !important; padding: 7px 11px !important; white-space: nowrap; }
.quick-btn kbd { margin-left: 4px; }
@media (max-width: 760px) { .quick-btn .lbl, .quick-btn kbd { display: none; } }
.quick-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.qtile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  color: var(--ink) !important; text-decoration: none !important; box-shadow: var(--shadow); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.qtile:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow-lg); }
.qtile .qi { font-size: 24px; } .qtile b { font-size: 14.5px; } .qtile span.small { color: var(--muted); }

/* ---------- help page */
.help-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 6px; }
.help-toc a { padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.help-toc a:hover { border-color: var(--brand); }
section.help { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 20px 16px; margin-top: 14px; box-shadow: var(--shadow); }
section.help h2 { margin-top: 14px; }
section.help li { margin: 6px 0; max-width: 78ch; }
.steps-help li::marker { color: var(--brand); font-weight: 800; }
@media (max-width: 1180px) { .quick-btn .lbl, .quick-btn kbd { display: none; } nav.main a { white-space: nowrap; } }
@media (max-width: 1000px) { nav.main a span.lbl { display: none; } }
.modal > .ev-head { padding-right: 46px; }
.player-cap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
