/* ============================================================
   Cappit front page v2 — layered on style.css, scoped to .lobbyV2 and
   the outer frame while the lobby is showing. Design tokens:
     ground  = the field grey (the game's own floor), not navy
     accents = team red / team blue ONLY
     display = Oxanium (the HUD/academy face), body = Inter
   No glass borders, no gradients-as-decoration, no pills, no emoji.
   ============================================================ */
:root {
  /* dark ground (owner preference; on ultrawide the light grey read as a
     grey band beside the hero) — near-black with a hint of the navy the
     game's own field void uses; team red/blue remain the only accents */
  --v2-ground: #0d1016;
  --v2-panel: #161b24;
  --v2-ink: #f2f4f8;
  --v2-ink-2: #c3c9d4;
  --v2-muted: #8891a0;
  --v2-line: #262d3a;
  --v2-blue: #2f7bff;
  --v2-blue-deep: #1c5fb8;
  --v2-red: #ef4444;
  --v2-red-deep: #c22f2f;
}

/* --- page frame: flat, light, no drop-shadow card --- */
body:has(.lobbyV2:not([hidden])) {
  background: var(--v2-ground);
  place-items: start center; /* top-anchored, not vertically centered — a landing page starts at the top */
  padding: 0 0 40px;
}
body:has(.lobbyV2:not([hidden])) .frame {
  width: 100%;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: var(--v2-ground);
}
/* content sections center at a comfortable measure; the hero (below) is
   full-bleed regardless of viewport width — object-fit: cover crops the
   video to fill, it never stretches/warps it */
.lobbyV2 .v2section, .lobbyV2 .v2footer { max-width: 1120px; margin-left: auto; margin-right: auto; }
body:has(.lobbyV2:not([hidden])) .topbar { max-width: none; flex-wrap: wrap; } /* never push nav buttons off-screen on a narrow window */
body:has(.lobbyV2:not([hidden])) .topbar > * { }
body:has(.lobbyV2:not([hidden])) .topbar {
  background: rgba(13,16,22,0.92);
  border-bottom: 1px solid var(--v2-line);
  padding: 10px 22px;
}
.v2brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.v2brandText { font-family: Oxanium, Inter, sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: 0.06em; }
body:has(.lobbyV2:not([hidden])) .accountBar .secondary { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.18); }

.lobbyV2 { padding: 0 0 28px; }

/* --- HERO: full-bleed video, wordmark + PLAY centered over it (the
   whole hero IS the game — nothing else competes with it) --- */
.v2hero {
  position: relative; overflow: hidden;
  height: min(72vh, 640px); min-height: 440px;
  background: #0d1016;
  color: #fff;
  display: grid; place-items: center;
}
.v2heroVideos { position: absolute; inset: 0; }
.v2heroVideo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 900ms ease;
}
.v2heroVideo.is-active { opacity: 1; }
.v2heroVideos.noFade .v2heroVideo { transition: none; } /* reduced-motion: hard cuts, no crossfade */
.v2heroShade {
  position: absolute; inset: 0;
  /* vignette + a soft center dim so white type reads over any clip */
  background:
    radial-gradient(ellipse at center, rgba(13,16,22,0.55) 0%, rgba(13,16,22,0.25) 45%, rgba(13,16,22,0.55) 100%),
    linear-gradient(180deg, rgba(13,16,22,0.55) 0%, rgba(13,16,22,0) 25%, rgba(13,16,22,0) 75%, rgba(13,16,22,0.6) 100%);
}
.v2heroInner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 24px; gap: 10px;
}
.v2wordmark { display: flex; align-items: center; gap: 16px; }
.v2mark { width: 64px; height: 64px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6)); }
.v2wordText {
  font-family: Oxanium, Inter, sans-serif; font-weight: 800; font-size: 4.6rem; line-height: 1;
  letter-spacing: 0.05em; text-shadow: 0 3px 0 rgba(0,0,0,0.55), 0 8px 28px rgba(0,0,0,0.6);
}
.v2tag { margin: 0 0 8px; font-size: 1.05rem; color: rgba(255,255,255,0.9); text-shadow: 0 2px 8px rgba(0,0,0,0.7); letter-spacing: 0.02em; }
/* PLAY NOW + TUTORIAL: one pair, the game's two team colors — the tutorial
   is a first-class button (owner: people really should learn the ball
   controls first, so it must not get overlooked as a text link). Side by
   side on desktop, stacked full-width on phones. */
.v2heroBtns { display: flex; align-items: stretch; gap: 14px; margin-top: 4px; }
.v2heroBtns .v2play { flex: 1 1 0; }
.v2play {
  --btn: var(--v2-blue); --btn-deep: var(--v2-blue-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 290px; min-height: 76px;
  padding: 14px 40px; border: 0; border-radius: 8px;
  background: var(--btn); color: #fff;
  cursor: pointer; box-shadow: 0 6px 0 var(--btn-deep), 0 14px 40px rgba(0,0,0,0.5);
  transition: transform 80ms, box-shadow 80ms;
}
.v2play:hover { transform: translateY(-1px); box-shadow: 0 7px 0 var(--btn-deep), 0 16px 44px rgba(0,0,0,0.5); }
.v2play:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--btn-deep), 0 8px 24px rgba(0,0,0,0.5); }
.v2play--tutorial { --btn: var(--v2-red); --btn-deep: var(--v2-red-deep); }
.v2playMain { font-family: Oxanium, Inter, sans-serif; font-weight: 800; font-size: 1.7rem; letter-spacing: 0.1em; }
.v2playSub { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; opacity: 0.95; }
.v2playSub .liveDot { background: #9cf0b8; }
/* Leaderboard teaser — same "live status" language as v2playSub's own
   dot (no emoji, matches this whole redesign's own rule), kept as a
   separate element below the buttons rather than crammed into
   onlineIndicator: different live stat, different on/off state (no rows
   on a fresh DB). Rotates between headline categories, see client.js. */
.v2lbTeaser {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.85);
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}
.v2lbTeaser .liveDot { background: #9cf0b8; }
/* Community CTA, under the PLAY NOW/TUTORIAL pair (owner request
   2026-09-03 — see index.html's own comment for the "why here"). Same
   row language as v2lbTeaser just above (quiet label text + text-shadow
   for legibility over the video), .discordBtn itself supplies the only
   real color/weight in the row so it reads as the one thing to act on. */
.v2discordCta {
  margin-top: 14px; display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.85);
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}
.v2textBtn {
  background: none; border: 0; padding: 4px 0 0; color: rgba(255,255,255,0.85);
  font: inherit; font-size: 0.95rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}
.v2textBtn:hover { color: #fff; }
.v2heroCtl {
  position: absolute; right: 16px; bottom: 14px; z-index: 2;
  display: flex; gap: 4px; padding: 4px; border-radius: 8px;
  background: rgba(13,16,22,0.7); border: 1px solid rgba(255,255,255,0.15);
}
.v2heroCtl button {
  width: 34px; height: 30px; border: 0; border-radius: 6px; background: transparent;
  color: rgba(255,255,255,0.85); font-size: 0.75rem; cursor: pointer;
}
.v2heroCtl button:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* --- sections --- */
.v2section { padding: 26px 40px 0; }
.v2sectionHead { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.v2sectionHead h2 {
  margin: 0; font-family: Oxanium, Inter, sans-serif; font-weight: 800; font-size: 1.35rem; letter-spacing: 0.03em;
  color: var(--v2-ink); display: inline-flex; align-items: center; gap: 8px;
}
.v2muted { color: var(--v2-muted); font-size: 0.9rem; }
.v2sectionHead .liveDot::before { display: none; }
.v2sectionHead .liveDot { background: var(--v2-red); }

/* --- live list: dense flat rows on the panel color --- */
.v2roomList { gap: 0; border: 1px solid var(--v2-line); border-radius: 6px; overflow: hidden; background: var(--v2-panel); }
.v2roomList .roomRow { border: 0; border-bottom: 1px solid var(--v2-line); border-radius: 0; background: transparent; color: var(--v2-ink); padding: 10px 14px; }
.v2roomList .roomRow:last-child { border-bottom: 0; }
.v2roomList .roomRow:hover { background: #1c2230; }
.v2roomList .roomRow.live:hover { background: transparent; }
.v2roomList .roomMeta { color: var(--v2-muted); }
.v2roomList .roomListEmpty { color: var(--v2-muted); padding: 14px; }
.v2roomList .liveBadge { background: var(--v2-red); border-color: var(--v2-red); color: #fff; }
.v2roomList .roomBtn { background: #232a38; border-color: #313a4a; color: var(--v2-ink); }
.v2roomList .roomBtn.primaryish { background: var(--v2-blue); border-color: var(--v2-blue); color: #fff; }

/* --- modes: a list --- */
.v2modes { display: flex; flex-direction: column; border-top: 1px solid var(--v2-line); }
.v2mode { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--v2-line); align-items: start; }
.v2modeMain { padding: 22px 0; }
.v2modeIcon { width: 36px; height: 36px; color: var(--v2-ink); margin-top: 2px; }
.v2modeMain .v2modeIcon { color: var(--v2-blue); }
.v2modeBody h3 { margin: 0 0 4px; font-family: Oxanium, Inter, sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--v2-ink); }
.v2modeMain .v2modeBody h3 { font-size: 1.6rem; }
.v2modeBody p { margin: 0 0 10px; color: var(--v2-ink-2); max-width: 60ch; }
.v2actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.v2act {
  padding: 8px 14px; border-radius: 6px; border: 1px solid #313a4a;
  background: #1a202b; color: var(--v2-ink); font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer;
}
.v2act:hover { border-color: #4a5568; background: #202836; }
.v2actPrimary { background: #f2f4f8; border-color: #f2f4f8; color: #0d1016; }
.v2actPrimary:hover { background: #fff; }
.v2modeMain .v2actPrimary { background: var(--v2-blue); border-color: var(--v2-blue); }
.v2modeMain .v2actPrimary:hover { background: var(--v2-blue-deep); }
.v2soon { color: var(--v2-muted); font-size: 0.9rem; margin-left: 4px; }
.v2act .badge { margin-left: 4px; }
.v2custom { margin-top: 12px; padding: 16px; background: var(--v2-panel); border: 1px solid #313a4a; border-radius: 6px; }
.v2forms { color: var(--v2-ink); }
.v2forms form { border-color: #313a4a; background: #1a202b; }
.v2forms h3 { color: var(--v2-ink); }
.v2forms input, .v2forms select { color: var(--v2-ink); background: #0d1016; border-color: #313a4a; }
.v2forms label { color: var(--v2-ink-2); }

/* --- leaderboards preview: same panel treatment as the live room list --- */
.v2lbPreview { display: flex; flex-wrap: wrap; gap: 16px; }
.v2lbPreviewCol {
  flex: 1 1 260px; min-width: 240px;
  border: 1px solid var(--v2-line); border-radius: 6px; background: var(--v2-panel); padding: 14px 16px;
}
.v2lbPreviewCol h4 {
  margin: 0 0 10px; font-family: Oxanium, Inter, sans-serif; font-weight: 700; font-size: 0.95rem;
  color: var(--v2-ink-2); letter-spacing: 0.02em;
}
.v2lbPreviewList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.v2lbPreviewList li { display: flex; align-items: center; gap: 10px; color: var(--v2-ink); }
.v2lbRank { color: var(--v2-muted); font-variant-numeric: tabular-nums; min-width: 1.6em; }
.v2lbName { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2lbValue { color: var(--v2-blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.v2lbPreviewList .ladderAvatar { width: 20px; height: 20px; border-radius: 50%; }
.v2lbViewAll {
  margin-top: 14px; background: none; border: 0; padding: 0; color: var(--v2-ink-2);
  font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.v2lbViewAll:hover { color: var(--v2-ink); }

.v2footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 26px 40px 0; padding-top: 14px; border-top: 1px solid var(--v2-line);
  color: var(--v2-muted); font-size: 0.88rem;
}
.v2footer a { color: var(--v2-ink-2); }

/* --- mobile --- */
@media (max-width: 760px) {
  .v2hero { height: 78vh; min-height: 420px; }
  .v2wordText { font-size: 2.8rem; }
  .v2mark { width: 44px; height: 44px; }
  .v2heroBtns { flex-direction: column; width: 100%; max-width: 340px; gap: 12px; }
  .v2play { padding: 12px 24px; min-width: 0; min-height: 64px; width: 100%; }
  .v2playMain { font-size: 1.4rem; }
  .v2discordCta { flex-direction: column; gap: 8px; }
  .v2rankedSoon { text-align: center; }
  .v2section { padding: 20px 16px 0; }
  .v2mode { grid-template-columns: 32px 1fr; gap: 12px; }
  .v2modeIcon { width: 28px; height: 28px; }
  .v2footer { margin: 20px 16px 0; }
  .v2sectionHead { flex-direction: column; gap: 2px; align-items: flex-start; }
  .v2sectionHead h2 { white-space: nowrap; }
}

/* Mini-games hero button (2026-09-09). Its own centred row UNDER the two
   main buttons rather than a third item beside them: PLAY NOW has to stay
   the biggest, most obvious thing on the page, and squeezing a third
   full-width button into that flex row makes all three smaller and the
   real choice less clear.

   Deliberately narrower and shorter than the two above it, and in a third
   colour, so it reads as a side door rather than competing with them. It
   only ever renders for someone who can actually reach the games (see
   client.js), so it never advertises a dead end. */
.v2heroBtnsAlt { display: flex; justify-content: center; margin-top: 12px; }
.v2play--minigames {
  --btn: var(--v2-violet, #7c5cff);
  --btn-deep: var(--v2-violet-deep, #4c33b8);
  min-width: 240px;
  min-height: 62px;
  padding: 10px 30px;
}
.v2play--minigames .v2playMain { font-size: 1.25rem; }
.v2play--minigames .v2playSub { font-size: 0.78rem; opacity: 0.9; }
@media (max-width: 720px) {
  .v2play--minigames { min-width: 0; width: 100%; }
}

/* Ranked seasons notice (index.html .v2rankedSoon) — the hero's Discord row,
   dressed as an announcement: a gold-edged card so it reads as news, not
   just a link. */
.v2rankedSoon {
  padding: 8px 10px 8px 14px; border-radius: 12px;
  border: 1px solid rgba(255, 211, 77, 0.65);
  background: rgba(22, 17, 4, 0.6);
  max-width: min(640px, calc(100vw - 32px));
}
.v2rankedSoon strong { color: #ffd34d; }
.v2rankedSoon .discordBtn { white-space: nowrap; flex-shrink: 0; }
.v2rankedText { line-height: 1.35; }
/* The same card in the room waiting room: on a plain panel, not over the
   hero video, so no text-shadow and it sits at its content width. */
.waitingRanked { margin-top: 16px; width: fit-content; text-shadow: none; }

/* --- futsal.gg portal (client.js applyFutsalSkin) -------------------------
   Brand: pitch green #16c172 + Brazil-sun yellow #ffd23f on the site's navy.
   Until there are soccer clips, the hero is a drawn pitch (mown stripes,
   halfway line, centre circle and spot, the two D-shaped penalty areas),
   dimmed by the usual .v2heroShade. The other sports' sections are hidden:
   this is the soccer-only front door. */
body.portalFutsal {
  --futsal-green: #16c172;
  --futsal-green-deep: #0e8a51;
  --futsal-yellow: #ffd23f;
  --futsal-yellow-deep: #c99a00;
}
body.portalFutsal .v2hero {
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.7) 0 5px, transparent 6px),
    radial-gradient(circle at 50% 50%, transparent 0 116px, rgba(255,255,255,0.55) 117px 121px, transparent 122px),
    linear-gradient(90deg, transparent calc(50% - 2px), rgba(255,255,255,0.55) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
    radial-gradient(ellipse 150px 190px at 0% 50%, transparent 0 146px, rgba(255,255,255,0.5) 147px 151px, transparent 152px),
    radial-gradient(ellipse 150px 190px at 100% 50%, transparent 0 146px, rgba(255,255,255,0.5) 147px 151px, transparent 152px),
    repeating-linear-gradient(90deg, #13914f 0 90px, #17a55b 90px 180px);
}
body.portalFutsal .v2heroCtl,
body.portalFutsal .v2live:not(#adminLiveSection),
body.portalFutsal .v2leaderboards,
body.portalFutsal #leaderboardTeaser,
body.portalFutsal #minigamesHeroRow,
body.portalFutsal #onlineIndicator,
body.portalFutsal .v2section:has(.v2modes) { display: none !important; }
body.portalFutsal .futsalTld { color: var(--futsal-yellow); font-size: 0.55em; letter-spacing: 0.02em; margin-left: 0.04em; }
body.portalFutsal .v2play { --btn: var(--futsal-yellow); --btn-deep: var(--futsal-yellow-deep); color: #10141c; }
body.portalFutsal.futsalLocked #quickMatchBtn { cursor: default; filter: saturate(0.85); }
body.portalFutsal.futsalLocked #quickMatchBtn:hover { transform: none; }
@media (max-width: 640px) {
  /* narrow screens: just the halfway line, centre circle and spot — the
     fixed-size penalty arcs crowd the centre circle there */
  body.portalFutsal .v2hero {
    background:
      radial-gradient(circle at 50% 50%, rgba(255,255,255,0.7) 0 5px, transparent 6px),
      radial-gradient(circle at 50% 50%, transparent 0 116px, rgba(255,255,255,0.55) 117px 121px, transparent 122px),
      linear-gradient(90deg, transparent calc(50% - 2px), rgba(255,255,255,0.55) calc(50% - 2px) calc(50% + 2px), transparent calc(50% + 2px)),
      repeating-linear-gradient(90deg, #13914f 0 60px, #17a55b 60px 120px);
  }
}
body.portalFutsal .v2play--tutorial { --btn: var(--futsal-green); --btn-deep: var(--futsal-green-deep); color: #fff; }
