/* Base, header, buttons, panels, chips, toast and background are shared with the other DurpeeSquid sites (same tokens from themes.css). */
:root {
  --bg: #0a0a0b;
  --card: #111113;
  --tile: #1d1d21;
  --border: #232327;
  --text: #f4f4f5;
  --muted: #8b8b94;
  --accent: #5eead4;
  --danger: #f87171;
  --card-hover: #151518;
  --border-strong: #34343a;
  --on-accent: #04201c;
  --glow-a: #5eead4;
  --glow-b: #818cf8;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
main { width: 100%; min-height: 100vh; padding: clamp(16px, 3vw, 48px) clamp(16px, 3vw, 48px) 64px; }
[hidden] { display: none !important; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 0.9rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

input, select, textarea, button {
  font: inherit; color: var(--text);
  background: var(--tile); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px;
}
input[type=search], input[type=number] { min-width: 0; }
button { cursor: pointer; background: var(--accent); color: var(--on-accent); font-weight: 600; border-color: transparent; }
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: default; }
button.ghost { background: transparent; color: var(--muted); border-color: var(--border); font-weight: 400; }
button.ghost:hover { color: var(--text); filter: none; }
button.danger { background: transparent; color: var(--danger); border-color: var(--border); font-weight: 400; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 24px; }
.panel .muted { margin: 8px 0 0; }
/* header bar, buttons, page heading and stat panel */
.i { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px;
  padding-bottom: 20px; margin-bottom: 36px; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.badge {
  flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  font-weight: 600; letter-spacing: 0.02em; color: inherit; text-decoration: none;
}
.badge:hover { border-color: var(--accent); }
.wordmark { font: 700 0.8rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.sep { flex: none; width: 1px; height: 18px; background: var(--border); }
.handle { font: 0.85rem var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  font: inherit; font-size: 0.9rem; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--card-hover); border-color: var(--border-strong); filter: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: var(--accent); filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: default; }
.seg button { display: inline-flex; align-items: center; gap: 8px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px 24px; margin-bottom: 32px; }
.eyebrow {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font: 0.75rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: -0.03em; line-height: 1.1; }
.statpanel { display: flex; background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.stat-cell { padding: 12px 22px; border-left: 1px solid var(--border); min-width: 0; }
.stat-cell:first-child { border-left: 0; }
.stat-label { display: block; margin-bottom: 4px; font: 0.68rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.stat-value { font: 0.95rem var(--mono); }
@media (max-width: 640px) { .statpanel { width: 100%; } .stat-cell { flex: 1; padding: 12px 14px; } }
footer.foot { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); font: 0.72rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* light and dark themes: text laid over posters stays light */
.tile .cap, .tile .ctl button, .library[data-layout=grid] .rank { color: #fff; }
.drag-ghost { color: var(--text); }

/* animated background */
body { transition: background 0.3s, color 0.3s; }
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: 0.18; animation: drift 26s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { top: -18vmax; left: -12vmax; background: var(--glow-a); }
.aurora i:nth-child(2) { top: 12vmax; right: -16vmax; background: var(--glow-b); animation-duration: 32s; animation-delay: -9s; }
.aurora i:nth-child(3) { bottom: -24vmax; left: 24vw; background: var(--accent); opacity: 0.1; animation-duration: 38s; animation-delay: -15s; }
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(6vmax, 4vmax, 0) scale(1.15); } }
.dot { animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* feedback toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 14px; background: var(--card); color: var(--text);
  border: 1px solid var(--border-strong); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5); transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--danger); color: var(--danger); }
/* people and public profile pages */
.avatar { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font-weight: 700; background: linear-gradient(135deg, var(--glow-a), var(--glow-b)); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.avatar.big { width: 72px; height: 72px; font-size: 1.8rem; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.person-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--tile); border: 1px solid var(--border); border-radius: 14px; color: inherit; text-decoration: none; transition: transform 0.2s, border-color 0.2s; }
.person-link:hover { transform: translateY(-3px); border-color: var(--accent); }
.who { display: flex; align-items: center; gap: 18px; }
.block { margin-bottom: 36px; }
.block-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.block-head h2 { margin: 0; font-size: 1.25rem; }
.tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--border-strong); font: 0.72rem var(--mono); color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar input[type=search] { flex: 1; min-width: 180px; max-width: 320px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-weight: 400; }
.chip:hover { color: var(--text); border-color: var(--border-strong); filter: none; }
.chip[aria-pressed=true] { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 600; }

/* ---- picks ---- */
:root { --good: var(--s-completed, #4ade80); --bad: var(--danger); --warn: var(--s-on_hold, #fbbf24); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.mono { font-family: var(--mono); }
select { max-width: 100%; }
.field { display: grid; gap: 2px; font-size: 0.75rem; color: var(--muted); }
.filters { align-items: end; margin-bottom: 20px; }
.notice { display: flex; align-items: center; gap: 10px; }
.notice .i { color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile-stat { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px; min-width: 0; }
.tile-stat .stat-value { display: block; font: 600 1.4rem var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-stat .stat-value.small { font-size: 0.95rem; }

.games { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.game {
  display: grid; gap: 10px; padding: 14px 16px; background: var(--card);
  border: 1px solid var(--border); border-left: 4px solid var(--c, var(--border)); border-radius: 14px;
}
.game[data-state=right] { --c: var(--good); background: color-mix(in srgb, var(--good) 6%, var(--card)); }
.game[data-state=wrong] { --c: var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--card)); }
.game[data-state=open] { --c: var(--accent); }
.team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team + .team { margin-top: 6px; }
.logo { flex: none; width: 30px; height: 30px; object-fit: contain; }
.team .abbr { font-weight: 700; }
.team .tname { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.team .real { margin-left: auto; font: 700 1.1rem var(--mono); min-width: 4.5rem; text-align: center; }
.team.win .real { color: var(--good); }
.score-in { width: 4.5rem; text-align: center; font: 600 1.05rem var(--mono); }
.pickread { min-width: 4.5rem; padding: 8px 12px; text-align: center; font: 600 1.05rem var(--mono); background: var(--tile); border-radius: 10px; }
.game .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: var(--muted); }
.pill { padding: 1px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 45%, transparent); }
.savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 16px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5); }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 24px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
th { font: 0.68rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.num, td.num { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--card-hover); }
td .team { gap: 8px; }
td .logo { width: 22px; height: 22px; }
h2.section { margin: 32px 0 12px; font-size: 1.25rem; }
.empty { color: var(--muted); padding: 24px 0; }
.back { display: inline-flex; margin-bottom: 16px; }
.nav-active { border-color: var(--accent); color: var(--accent); }
@media (max-width: 520px) { .team .tname { display: none; } .games { grid-template-columns: 1fr; } }

/* live games */
.game[data-state=live] { --c: var(--bad); background: color-mix(in srgb, var(--bad) 5%, var(--card)); }
.cols { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 2px; font: 0.65rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cols span { width: 4.5rem; text-align: center; }
.sit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 0.85rem; }
.sit b { font-family: var(--mono); }
.pill.live { --c: var(--bad); display: inline-flex; align-items: center; gap: 6px; }
.livedot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s ease-out infinite; }
.ball { font-size: 0.95rem; line-height: 1; }
