/* Keys for the Community 2026 - post-event results + gallery (community theme: fairway green, gold, mint) */
:root {
  color-scheme: dark;
  --field: #0d2b1e; --field-2: #1c5a40; --deep: #0a2218; --panel: #0f3122;
  --card: rgba(255,255,255,.055); --card-2: rgba(255,255,255,.09); --rule: rgba(234,243,237,.12);
  --ink: #ffffff; --text: #eaf3ed; --muted: #a4bbad; --gold: #d9b34a; --mint: #bfe3c8;
  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --body: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --pad: 28px;
}
* { box-sizing: border-box; }
html { background: var(--field); }
body { margin: 0; background: var(--field); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; }
button { font: inherit; color: inherit; }
a { color: var(--mint); }
.mc { text-transform: none; }

.kicker { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 12px; letter-spacing: .16em;
          text-transform: uppercase; color: var(--mint); }
.kicker .kt { color: var(--mint); }
.kicker .kt span { color: var(--ink); }
.kicker .rule { display: block; width: 28px; height: 3px; border-radius: 2px; background: var(--gold); flex: 0 0 28px; }

/* ------------------------------------------------------------------ layout: desktop = one viewport, 33 / 67 */
.app { min-height: 100dvh; }
.side { padding: 24px var(--pad) 18px; display: flex; flex-direction: column; gap: 16px;
        background: radial-gradient(120% 60% at 0% 0%, rgba(28,90,64,.95) 0%, rgba(13,43,30,0) 70%), var(--panel); }
.gal { background: var(--deep); }

@media (min-width: 1024px) {
  html, body { height: 100%; overflow: hidden; }
  .app { display: grid; grid-template-columns: minmax(0, 33fr) minmax(0, 67fr); height: 100dvh; }
  .side { height: 100dvh; overflow-y: auto; overflow-x: hidden; border-right: 1px solid var(--rule); scrollbar-width: thin; }
  .board { flex: 1 1 auto; min-height: 240px; display: flex; flex-direction: column; }
  .board .rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  .gal { height: 100dvh; display: flex; flex-direction: column; min-width: 0; }
  .win.first .van { display: none; }       /* one viewport: the leaderboard needs the room; phones keep the van */
  .grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
}

/* ------------------------------------------------------------------ brand */
.brand .lockup { display: flex; flex-direction: column; gap: 10px; }
.brand .bt { display: flex; flex-direction: column; gap: 10px; }
.brand .tl { width: 170px; height: auto; margin-bottom: 2px; }
.brand h1 { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(38px, 3.2vw, 54px);
            line-height: .92; color: var(--ink); letter-spacing: .005em; }
.brand h1 span { color: var(--gold); }
.brand .meta { margin: 0; font-weight: 700; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.brand .kicker .kt .sep { color: inherit; }
.brand .lk { display: none; }            /* line breaks used only by the side-by-side lockup below */

/* Desktop lockup (Kylen 10/12): the logo and the title block share one row, the logo exactly as tall as the
   block. Sizes are in cqw (1% of the header's width, which excludes the side column's scrollbar) so the lockup
   scales as one piece: the block is 2 kicker lines + the title + 2 subtitle lines + 2 gaps, and the logo's height
   is that same sum. Narrower headers (small laptops, tablets, phones) keep the stacked brand above, because
   side by side the text would get too small. */
@media (min-width: 1024px) {
  .brand { container: brand / inline-size; }
}
@container brand (min-width: 380px) {     /* 1366px-wide screens and up */
  .brand .lockup { --k: 2.4cqw; --h: 6.6cqw; --m: 2.4cqw; --g: .9cqw;
                   flex-direction: row; align-items: center; gap: 3cqw; }
  .brand .tl { flex: 0 0 auto; width: auto; margin: 0;
               height: calc(2 * 1.18 * var(--k) + var(--g) + .92 * var(--h) + var(--g) + 2 * 1.22 * var(--m)); }
  .brand .bt { gap: var(--g); min-width: 0; }
  .brand .kicker { display: block; font-size: var(--k); line-height: 1.18; letter-spacing: .1em; white-space: nowrap; }
  .brand .kicker .rule { display: inline-block; vertical-align: .32em; width: 1.7em; height: .28em; margin-right: .6em; }
  .brand h1 { font-size: var(--h); white-space: nowrap; }
  .brand .meta { font-size: var(--m); line-height: 1.22; white-space: nowrap; }
  .brand .sep { display: none; }
  .brand .lk { display: inline; }
}

/* ------------------------------------------------------------------ the three winning families */
.winners { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.win.first { grid-column: 1 / -1; }
.win:not(.first) { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 13px; }
.win:not(.first) .place { font-size: 26px; text-align: left; padding: 0; }
.win:not(.first) .fam { font-size: 17px; padding-right: 0; }
.win:not(.first) .team { font-size: 11.5px; padding-right: 0; display: block; }
.win:not(.first) .prize { font-size: 13px; padding-right: 0; }
.win { position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 4px 14px; align-items: start;
       padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--rule); }
.win .place { grid-row: span 3; font-family: var(--display); font-size: 40px; line-height: .9; color: var(--gold); text-align: center; padding-top: 2px; }
.win .place sup { font-size: .4em; vertical-align: top; position: relative; top: .3em; margin-left: 1px; }
.win .fam { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 22px; line-height: 1.02; color: var(--ink); }
.win .team { font-weight: 700; font-size: 12.5px; line-height: 1.35; color: var(--mint); }
.win .team .sc { color: var(--ink); font-weight: 800; }
.win .prize { font-weight: 800; font-size: 12.5px; line-height: 1.4; color: var(--gold); }
.win.first { padding: 16px 16px 16px; border-color: rgba(217,179,74,.75);
             background: linear-gradient(135deg, rgba(217,179,74,.2), rgba(255,255,255,.05) 55%); }
.win.first .place { font-size: 54px; }
.win.first .fam { font-size: clamp(26px, 2.2vw, 34px); }
.win.first .prize { font-size: 13px; }
.win.first .van { grid-column: 1 / -1; width: 100%; max-width: 360px; height: auto; margin: 4px auto -4px; filter: drop-shadow(0 12px 14px rgba(0,0,0,.4)); }
.win .tlogo { position: absolute; right: 14px; top: 12px; height: 30px; width: auto; max-width: 92px; object-fit: contain; opacity: .95; }
.win.first .tlogo { height: 38px; max-width: 110px; }
.glow { filter: drop-shadow(0 0 1px rgba(255,255,255,.75)) drop-shadow(0 0 3px rgba(255,255,255,.18)); }
.win .fam, .win .team, .win .prize { padding-right: 96px; }
.win.first .fam, .win.first .team { padding-right: 118px; }
.win.first .prize { padding-right: 0; }
.win .tlogo.plate { opacity: 1; }      /* a logo on its own white rectangle stays pure white (Vogel, Kylen 10/12) */
/* 2nd + 3rd (Kylen 10/12): the logo sits in the top row, right of the place, so it never crowds the names below */
.win:not(.first) .tlogo { top: 11px; right: 14px; height: 26px; max-width: min(84px, calc(100% - 70px)); }
.win:not(.first) .place { margin-bottom: 5px; }

/* ------------------------------------------------------------------ leaderboard */
.board { border-radius: 14px; background: var(--card); border: 1px solid var(--rule); overflow: hidden; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--rule); }
.board-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; text-transform: uppercase; color: var(--ink); letter-spacing: .01em; }
.board-head .basis { font-weight: 800; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); }
.rows { list-style: none; margin: 0; padding: 4px 0; }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 64px 48px; align-items: center; gap: 10px; padding: 7px 16px; min-height: 46px; }
.row + .row { border-top: 1px solid rgba(234,243,237,.06); }
.row .pos { font-family: var(--display); font-size: 20px; color: var(--muted); text-align: center; }
.row .lg { height: 30px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.row .lg img { max-height: 30px; max-width: 64px; width: auto; height: auto; object-fit: contain; }
.row .lg img + img { max-width: 30px; }
.row .nm { font-weight: 700; font-size: 13.5px; line-height: 1.25; color: var(--text); min-width: 0; }
.row .nm small { display: block; font-weight: 600; font-size: 11.5px; color: var(--mint); margin-top: 1px; }
.row .sc { font-family: var(--display); font-size: 22px; color: var(--ink); text-align: right; }
.row.top .pos { color: var(--gold); }
.row.top { background: rgba(217,179,74,.07); }
.row.r1 { background: rgba(217,179,74,.14); }
.row.pending .sc { color: var(--text); }
.more { margin: 2px 16px 12px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--rule); background: transparent; font-weight: 800;
        font-size: 13px; color: var(--mint); cursor: pointer; }
.rows .note { list-style: none; margin: 4px 0 0; padding: 10px 16px 12px; font-size: 11.5px; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--rule); }
.host { display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.host a { font-weight: 700; text-decoration: none; }
.host a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ gallery */
.gal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; padding: 26px 32px 16px; }
.gal-title h2 { margin: 8px 0 0; font-family: var(--display); font-weight: 400; font-size: 40px; line-height: .95; text-transform: uppercase; color: var(--ink); }
.gal-title .count { font-family: var(--body); font-weight: 700; font-size: 14px; color: var(--muted); letter-spacing: .02em; text-transform: none; margin-left: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(234,243,237,.2);
        background: transparent; font-weight: 700; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; }
.chip i { font-style: normal; font-weight: 800; font-size: 11px; color: var(--muted); }
.chip:hover { border-color: var(--mint); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #14231a; }
.chip[aria-pressed="true"] i { color: rgba(20,35,26,.7); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; align-content: start; align-items: start; grid-auto-rows: max-content; padding: 0 32px 40px; }
/* max-content rows: in a fixed-height scrolling grid, overflow:hidden tiles contribute 0 to auto rows and the rows collapse to ~7px */
.sec { grid-column: 1 / -1; position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 14px 2px 8px;
       background: linear-gradient(180deg, var(--deep) 75%, rgba(10,34,24,0)); font-weight: 800; font-size: 12px; letter-spacing: .16em;
       text-transform: uppercase; color: var(--mint); }
.sec::after { content: ""; flex: 1; height: 2px; border-radius: 1px; background: rgba(217,179,74,.55); }
.sec b { color: var(--muted); font-weight: 700; letter-spacing: .04em; }
/* tiles are div role=button (keyboard: Enter/Space in app.js) */
.tile { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #123526; cursor: zoom-in; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,20,13,.7) 0%, rgba(5,20,13,0) 45%); opacity: 0; transition: opacity .2s ease; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.045); }
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tile .play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; z-index: 1;
              background: rgba(13,43,30,.72); border: 2px solid rgba(255,255,255,.85); display: grid; place-items: center; }
.tile .play svg { width: 20px; height: 20px; margin-left: 3px; fill: #fff; }
.tile .dur { position: absolute; right: 8px; bottom: 8px; z-index: 1; padding: 3px 7px; border-radius: 6px; background: rgba(5,20,13,.78);
             font-weight: 800; font-size: 11px; color: #fff; letter-spacing: .04em; }
.tile .tcap { position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 1; font-weight: 700; font-size: 12px; line-height: 1.3; color: #fff;
              text-align: left; opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile.v .tcap { right: 60px; }
.tile:hover .tcap, .tile:focus-visible .tcap { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ lightbox */
.lb { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; grid-template-rows: 60px minmax(0, 1fr) auto;
      background: rgba(4,14,9,.96); }
.lb[hidden] { display: none; }
.lb-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 22px; }
.lb-count { font-weight: 800; font-size: 13px; letter-spacing: .1em; color: var(--muted); }
.lb-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
          background: rgba(255,255,255,.06); cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.14); }
.lb-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.lb-btn svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lb-nav { align-self: center; justify-self: center; }
.lb-stage { grid-column: 2; grid-row: 2; margin: 0; display: grid; place-items: center; min-height: 0; min-width: 0; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100dvh - 170px); width: auto; height: auto; object-fit: contain; border-radius: 8px;
                                 box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #000; }
.lb-cap { grid-column: 1 / -1; padding: 14px 24px 22px; text-align: center; font-size: 14px; line-height: 1.45; color: var(--text); }
.lb-cap b { display: block; margin-bottom: 3px; font-weight: 800; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--mint); }
.lb-cap .cr { display: block; margin-top: 4px; font-weight: 600; font-size: 11.5px; letter-spacing: .03em; color: var(--muted); }

/* ------------------------------------------------------------------ phones + tablets: one scrolling column */
@media (max-width: 1023px) {
  :root { --pad: 18px; }
  .side { padding-top: 22px; }
  .brand .lockup { align-items: flex-start; }
  .brand .tl { width: 170px; }
  .win.first .van { max-width: 300px; }
  .win.first { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 14px; }
  .win.first .place { grid-row: auto; text-align: left; font-size: 46px; padding: 0; }
  .win.first .fam, .win.first .team { padding-right: 0; }
  .win.first .tlogo { top: 16px; right: 16px; height: 44px; max-width: 120px; }
  .rows.clip .row:nth-child(n+9), .rows.clip .note { display: none; }
  .gal-head { padding: 26px var(--pad) 12px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; margin: 0 calc(var(--pad) * -1); padding-left: var(--pad); padding-right: var(--pad);
           scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 var(--pad) 48px; }
  .sec { top: 0; }
  .tile { border-radius: 9px; }
  .tile .tcap { display: none; }
  .tile .play { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
  .lb { grid-template-columns: 0 minmax(0, 1fr) 0; grid-template-rows: 56px minmax(0, 1fr) auto; }
  .lb-nav { position: fixed; bottom: 18px; width: 52px; height: 52px; z-index: 2; }
  .lb-prev { left: 18px; } .lb-next { right: 18px; }
  .lb-stage { padding: 0 8px; }
  .lb-stage img, .lb-stage video { max-height: calc(100dvh - 190px); }
  .lb-cap { padding: 12px 84px 26px; font-size: 13px; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .row { grid-template-columns: 40px minmax(0, 1fr) 50px 42px; gap: 8px; padding: 7px 12px; }
  .row .pos { font-size: 18px; }
  .row .lg img { max-width: 50px; }
  .row .lg img + img { max-width: 24px; }
  .win .fam, .win .team, .win .prize { padding-right: 76px; }
  .win .tlogo { height: 26px; max-width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile img, .tile::after, .tile .tcap { transition: none; }
}
