/* DMGC 2026 / DGG brand (Pixel Nomad files, 18 Nov): black splash background, lime #E3FC03, orange #FF5E03, white. One dark theme on purpose. */
:root {
  --bg: #0b0c08; --panel: #16180f; --line: #2a2d20; --fg: #f1f3e6; --muted: #a2a78f;
  --lime: #e3fc03; --on-lime: #0b0c08; --aqua: #29edfa; --orange: #ff5e03;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); overflow-x: clip; }
body { background: var(--bg) url(img/bg.webp) center top / cover fixed; }
a { color: var(--lime); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left)) 96px max(16px, env(safe-area-inset-right)); }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; font-size: 14px; }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { display: block; height: 44px; width: auto; }
.brand .x { color: var(--muted); font-weight: 400; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hero { display: flex; justify-content: center; padding: 4px 0; }
.hero img { width: 140px; height: auto; }
.hero-card { text-align: center; gap: 10px; }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sub { color: var(--muted); font-size: 13px; }
h1 { font-size: 24px; line-height: 1.2; margin: 8px 0 4px; }
h2 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 6px; }
.card.hot { border-color: var(--lime); }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.big { font-size: 22px; font-weight: 800; }
.muted { color: var(--muted); }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.live { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.pill.delayed { color: var(--orange); border-color: var(--orange); }
.pill.done { color: var(--aqua); border-color: var(--aqua); }
.pill.ok { color: var(--aqua); border-color: var(--aqua); }
.btn { background: var(--lime); color: var(--on-lime); border: 0; border-radius: 8px; padding: 10px 16px; min-height: 40px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn.small { padding: 8px 12px; font-size: 13px; min-height: 40px; }
.btn.danger { background: transparent; color: var(--orange); border: 1px solid var(--orange); }
#me-btn[aria-current=page] { border-color: var(--lime); color: var(--lime); }
input[type=text], input[type=search], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0;
}
textarea { min-height: 140px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.banner { background: var(--lime); color: var(--on-lime); border-radius: 8px; padding: 10px 12px; font-weight: 600; margin: 12px 0; }
.sample { border: 1px dashed var(--orange); color: var(--orange); border-radius: 8px; padding: 6px 10px; font-size: 12px; margin-top: 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 12px; min-height: 40px; white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: inherit; }
.chip[aria-pressed=true], .chip[aria-current=page] { background: var(--lime); color: var(--on-lime); border-color: var(--lime); font-weight: 700; }
.match { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.match:last-child { border-bottom: 0; }
.item-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: 0; }
.item-main { min-width: 0; flex: 1; display: grid; gap: 3px; }
.item-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.star-btn { background: transparent; border: 1px solid var(--line); border-radius: 8px; min-width: 40px; min-height: 40px; font-size: 18px; color: var(--muted); cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.star-btn[aria-pressed=true] { color: var(--lime); border-color: var(--lime); }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.link-card { text-decoration: none; color: inherit; }
.link-card:hover { border-color: var(--lime); }
.time { font-variant-numeric: tabular-nums; font-weight: 700; }
.win { color: var(--lime); font-weight: 700; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav.tabs a { text-align: center; padding: 12px 2px; min-height: 44px; display: flex; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 12px; }
nav.tabs a[aria-current=page] { color: var(--lime); box-shadow: inset 0 3px 0 var(--lime); }
.map { padding: 0; overflow: auto; }
.mapinner { position: relative; width: 100%; }
.map.zoom .mapinner { width: 220%; }
.mapinner img { display: block; width: 100%; height: auto; border-radius: 10px; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 40px; height: 40px; border: 0;
  background: transparent; color: transparent; font-size: 0; cursor: pointer; padding: 12px; }
.pin::before { content: ""; display: block; width: 16px; height: 16px; border: 2px solid var(--bg);
  border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 2px var(--fg); }
.pin.on { background: transparent; box-shadow: none; }
.pin.on::before { background: var(--lime); box-shadow: 0 0 0 4px var(--lime); }
@media (prefers-reduced-motion: no-preference) { .pin.on::before { animation: pulse 1.2s ease-in-out infinite; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(227, 252, 3, .25); } }
.places { display: flex; flex-wrap: wrap; gap: 6px; }
.bracket-scroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
.b-col { flex: 0 0 256px; scroll-snap-align: start; display: grid; gap: 8px; align-content: start; }
.b-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.b-col-sub { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 8px; }
.b-col-list { display: grid; gap: 8px; }
.b-match { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 13px; }
.b-match.live { border-color: var(--lime); }
.b-match.quiet { opacity: .6; }
.b-head { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.b-time { margin-left: auto; }
.b-row { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.b-row:last-child { border-bottom: 0; }
.b-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-score { font-variant-numeric: tabular-nums; font-weight: 700; }
.b-win { color: var(--lime); font-weight: 700; }
.b-lose { opacity: .55; }
.table-wrap { overflow-x: auto; }
tr.advance td:first-child { box-shadow: inset 3px 0 0 var(--lime); }
.roster { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.roster-item { display: inline-flex; align-items: center; gap: 6px; }
.note { font-size: 12px; color: var(--muted); }
.err { color: var(--orange); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose, .prose-card { max-width: 70ch; }
#team-search { max-width: 420px; }
.home-grid, .sched-layout, .cards-grid, .groups-grid, .partners-grid, .info-grid, .me-grid, .about-grid, .game-hub-top { display: grid; gap: 10px; }
.game-nav { display: grid; gap: 8px; margin-bottom: 12px; }
.game-hub-top { margin-bottom: 14px; }
.game-hub-head { border-top: 3px solid var(--lime); }
.game-badge { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--lime); }
.follow-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.follow-select { width: auto; min-height: 40px; padding: 8px 12px; flex: 1 1 160px; max-width: 260px; }
.follow-pinned { margin-bottom: 14px; }
.sched-grid { display: none; }
.map-layout { display: flex; flex-direction: column; gap: 12px; }
.map-side { display: contents; }
.map-selected { order: 1; }
.map-main { order: 2; }
.places { order: 3; }
.map-empty-hint { display: none; }

@media (min-width: 640px) {
  .wrap { max-width: 740px; }
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .home-right { grid-column: 1 / -1; }
  .home-col > section:first-child h2 { margin-top: 0; }
  .cards-grid, .groups-grid, .info-grid, .partners-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .info-section h2 { margin-top: 0; }
}

@media (min-width: 1024px) {
  .wrap { max-width: 1200px; padding: 20px 24px 48px; }
  nav.tabs { position: static; background: transparent; border-top: 0; border-bottom: 1px solid var(--line);
    display: flex; justify-content: flex-end; gap: 4px; padding: 0; margin: 10px 0 16px; }
  nav.tabs a { padding: 10px 16px; font-size: 14px; min-height: 44px; flex: 0 0 auto; }
  nav.tabs a:hover { color: var(--fg); }
  nav.tabs a[aria-current=page] { box-shadow: inset 0 -3px 0 var(--lime); }

  .home-grid { grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.35fr) minmax(260px, 1fr); gap: 20px; }
  .home-right { grid-column: auto; }

  .sched-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
  .sched-filters { flex-direction: column; overflow: visible; padding: 0; position: sticky; top: 16px; }
  .sched-filters .chip { width: 100%; justify-content: flex-start; border-radius: 8px; }
  .sched-main.has-grid .sched-list { display: none; }
  .sched-grid { display: grid; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
  .sched-grid-head, .sched-grid-row { display: grid; grid-template-columns: 88px repeat(3, minmax(0, 1fr)); }
  .sched-grid-head { background: rgba(255, 255, 255, .03); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
  .sched-grid-head > div, .sched-time, .sched-cell { padding: 10px 12px; border-right: 1px solid var(--line); min-width: 0; }
  .sched-grid-head > div:last-child, .sched-cell:last-child { border-right: 0; }
  .sched-grid-row { border-bottom: 1px solid var(--line); }
  .sched-grid-row:last-child { border-bottom: 0; }
  .sched-cell .item-row { padding: 8px 0; flex-direction: column; }
  .sched-cell .item-actions { flex-wrap: wrap; }
  .sched-cell .item-main { width: 100%; overflow-wrap: anywhere; }
  .sched-cell .item-row:first-child { padding-top: 0; }
  .sched-cell .item-row:last-child { padding-bottom: 0; }

  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .game-switcher { flex-wrap: wrap; overflow: visible; }
  .game-hub-top { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .bracket-scroll { scroll-snap-type: none; }
  .b-col { flex: 1 1 180px; min-width: 180px; max-width: 320px; scroll-snap-align: none; }
  .about-grid { grid-template-columns: minmax(0, 70ch) minmax(240px, 1fr); gap: 20px; align-items: start; }
  .about-grid h2 { margin-top: 0; }

  .map-layout { display: grid; grid-template-columns: minmax(0, 65fr) minmax(0, 35fr); gap: 20px; align-items: start; }
  .map-main, .map-selected, .places { order: 0; }
  .map-side { display: grid; gap: 12px; align-content: start; position: sticky; top: 16px; }
  .map-empty-hint { display: block; }

  .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .partners-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }

  .me-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
  .me-col > section:first-child h2 { margin-top: 0; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
