/* =====================================================================
   padeltournaments.asia - Stylesheet
   Dark + gradient aesthetic, evolved from V1
   ===================================================================== */

:root {
  /* Render UA-drawn surfaces (scrollbars, form-control chrome, focus rings) in
     dark mode — without this, on a light-mode OS the browser themes those parts
     light, making controls like the filter dropdown's scrollbar look out of
     place against the dark theme. (Added 2026-06-30.) */
  color-scheme: dark;

  --bg:        #07090d;
  --bg-2:      #0b0f16;
  --panel:     #101620;
  --panel-2:   #151d2a;
  --line:      rgba(255, 255, 255, .13);
  --line-2:    rgba(255, 255, 255, .07);
  --text:      #f5f7fb;
  --text-soft: #c7d0de;
  --muted:     #9aa6b7;

  --c-appt:    #2f80ed;
  --c-pps:     #d14cff;
  --c-tps:     #ff9f1c;
  --c-fip:     #34d399;
  --c-fed:     #ff5a5f;
  --c-other:   #9aa6b7;

  --c-live:    #34d399;
  --c-warn:    #ff9f1c;

  --radius-lg: 22px;
  --radius:    16px;
  --radius-sm: 10px;

  --shadow-card: 0 15px 30px rgba(0, 0, 0, .24);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-hi:   0 30px 80px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 85% 5%,  rgba(209, 76, 255, .15), transparent 35%),
    radial-gradient(circle at 12% 8%,  rgba(47, 128, 237, .15), transparent 35%),
    radial-gradient(circle at 50% 90%, rgba(255, 159, 28, .08), transparent 40%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 45%, var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}
@media (max-width: 760px) {
  .wrap { padding: 14px; }
}

/* ---------- Header / Nav ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 999px;
  margin-bottom: 24px;
  position: sticky;
  top: 14px;
  z-index: 50;
  /* Heavier glass: more blur + saturation so the pill reads as frosted glass
     over the hero photo/background glow rather than flat dark. */
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  /* Animated brand-gradient ring: classic double-background border trick —
     an inner glass fill clipped to padding-box, and the brand gradient
     clipped to border-box showing only through the border's own thickness.
     Same pill radius applies to both layers, so the pill shape is preserved.
     background-position on the border-box layer is animated below for a
     slow, continuous colour shift around the ring (not a true rotation, but
     reads the same at this scale and has far broader browser support than a
     rotating conic-gradient + @property angle).
     2026-08-02 FIX: the inner (padding-box) layer must be dark and mostly
     OPAQUE, not a faint translucent white — the border-box gradient layer
     sitting behind it is fully opaque itself, so a near-transparent inner
     layer let it bleed through across the WHOLE pill instead of just the
     border strip (confirmed live: the interior showed the full-saturation
     gradient with nav text stamped on it, not frosted glass — a real bug,
     not a styling choice). This dark ~80%-opaque fill hides the gradient in
     the interior while backdrop-filter's blur still reads through it. */
  border: 1.5px solid transparent;
  /* 2026-08-02: original padel-themed texture (ball + court-line motifs, no
     stock imagery/licensing) added as a THIRD background layer, sitting
     behind the dark glass fill and in front of the gradient ring — same
     stacking order as CSS background layers always use (first-listed =
     frontmost). Deliberately NOT scoped to "empty space only": the glass
     fill above it is ~74-84% opaque everywhere across the pill, so the
     texture is already dimmed by roughly that same amount wherever nav
     text sits too — carving out a text-safe zone would just be a fragile
     no-op given the glass already does that dimming uniformly. The colour
     alpha baked into the SVG itself (0.3) is deliberately much higher than
     the target 5-10% FINAL visible opacity — it's calibrated to still read
     that faint AFTER ~80% of it gets absorbed by the glass layer sitting
     on top, confirmed by screenshot, not just assumed from the arithmetic. */
  background:
    linear-gradient(135deg, rgba(16, 22, 34, .84), rgba(21, 29, 42, .74)) padding-box,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='rgba(209,76,255,0.85)' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='18' cy='18' r='9'/%3E%3Cpath d='M11 13 Q18 22 25 13'/%3E%3Cpath d='M11 23 Q18 14 25 23'/%3E%3Ccircle cx='78' cy='80' r='7'/%3E%3Cpath d='M73 76 Q78 83 83 76'/%3E%3Cpath d='M73 84 Q78 77 83 84'/%3E%3Cpath d='M50 60 L72 60 L72 38'/%3E%3C/g%3E%3C/svg%3E") repeat padding-box,
    linear-gradient(90deg, var(--c-appt), var(--c-pps), var(--c-tps), var(--c-appt)) border-box;
  background-size: 100% 100%, 90px 90px, 300% 100%;
  animation: headerBorderShift 12s linear infinite;
}
@keyframes headerBorderShift {
  0%   { background-position: 0 0, 0 0, 0% 0; }
  100% { background-position: 0 0, 0 0, 300% 0; }
}
.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 0;
}
/* 2026-08-02: a static drop-shadow glow read as too subtle next to the rest
   of the bolder treatment (nothing behind the mark was actually MOVING) —
   added a slow-spinning blurred conic-gradient halo behind the logo, on top
   of the existing pulse, so it has real presence instead of just a soft
   edge. z-index:-1 relies on .brand's own stacking context (position:
   relative, z-index:0 above) to paint behind the <img> without affecting
   anything else in the header. */
.brand::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 40px;
  height: 40px;
  background: conic-gradient(from 0deg, var(--c-appt), var(--c-pps), var(--c-tps), var(--c-appt));
  filter: blur(10px);
  opacity: .6;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  animation: logoHaloSpin 6s linear infinite;
}
@keyframes logoHaloSpin {
  from { transform: translateY(-50%) rotate(0deg); }
  to   { transform: translateY(-50%) rotate(360deg); }
}
.brand-logo {
  height: 32px;
  width: auto;
  display: block;
  /* Subtle brand-colour glow so the mark doesn't look flat next to the
     bolder nav treatment — filter: drop-shadow respects the logo PNG's own
     alpha channel (glows around the mark's actual shape, not a rectangle). */
  filter: drop-shadow(0 0 6px rgba(209, 76, 255, .45)) drop-shadow(0 0 14px rgba(47, 128, 237, .3));
  animation: logoGlowPulse 4s ease-in-out infinite;
}
@keyframes logoGlowPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(209, 76, 255, .45)) drop-shadow(0 0 14px rgba(47, 128, 237, .3)); }
  50%      { filter: drop-shadow(0 0 10px rgba(209, 76, 255, .65)) drop-shadow(0 0 20px rgba(255, 159, 28, .35)); }
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-appt), var(--c-pps));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(47, 128, 237, .35);
}
.brand-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-left: 4px;
}
nav.primary {
  display: flex;
  gap: 8px;
  align-items: center;
}
nav.primary a {
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-soft);
  transition: all .18s;
  position: relative;
}
/* Underline-glow hover feedback — was previously just a flat bg tint with no
   real visual cue. The gradient bar reuses the same brand stops as the
   header ring/hero text rather than introducing a new colour combination. */
nav.primary a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-appt), var(--c-pps), var(--c-tps));
  opacity: 0;
  transform: scaleX(.6);
  transform-origin: center;
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
nav.primary a:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
nav.primary a:hover::after { opacity: .9; transform: scaleX(1); }
nav.primary a.active {
  background: linear-gradient(135deg, var(--c-appt), var(--c-pps) 60%, var(--c-tps));
  color: #fff;
  box-shadow: 0 6px 20px rgba(209, 76, 255, .35), inset 0 0 0 1px rgba(255, 255, 255, .18);
}
/* The active pill already carries the full gradient fill — the underline
   would be redundant (and low-contrast) on top of it. */
nav.primary a.active::after { content: none; }
/* .nav-cta already had its own gradient/glow treatment before this pass —
   kept as-is (same 2-stop gradient, same shadow) so /submit's "active +
   nav-cta" combination (see _header.php) still looks exactly like the
   established Submit-event button, unaffected by the new .active styling
   above (source order still gives .nav-cta's own rules precedence on any
   shared property, same as before this edit). Only addition: suppress the
   new underline-glow pseudo-element, redundant on a button that's already
   fully gradient-filled. */
.nav-cta::after { content: none; }
.nav-cta {
  background: linear-gradient(135deg, var(--c-appt), var(--c-pps));
  color: white !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 24px rgba(209, 76, 255, .25);
}

@media (max-width: 760px) {
  .site-header {
    flex-direction: column;
    border-radius: 22px;
    padding: 14px;
    gap: 12px;
    position: static;
  }
  nav.primary { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  nav.primary a { padding: 7px 11px; font-size: 13px; }
}

/* ---------- Hero ---------- */
.hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  /* Padel photo with a DIRECTIONAL tint: dark on the left where the headline +
     sub-text sit (stays crisp), lightening toward the right so the photo shows
     through. The brand purple/blue glow is layered on top via .hero::before. */
  background:
    linear-gradient(105deg, rgba(12, 14, 22, 0.85) 0%, rgba(12, 14, 22, 0.45) 60%, rgba(12, 14, 22, 0.30) 100%),
    url('/assets/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-hi);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 90% 10%, rgba(209, 76, 255, .18), transparent 40%),
    radial-gradient(circle at 5% 90%, rgba(47, 128, 237, .15), transparent 40%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.hero h1 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(34px, 5vw, 64px);
  letter-spacing: -0.025em;
  line-height: .95;
  font-weight: 700;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--c-appt), var(--c-pps) 60%, var(--c-tps));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 15px;
  max-width: 640px;
  line-height: 1.5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  /* Darker translucent fill + blur so cards read as distinct panels on top
     of the hero photo instead of getting lost in it. */
  background: rgba(13, 16, 26, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-top: 6px;
  font-weight: 600;
}
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  /* Bias the (portrait) photo toward the top on narrow screens so the player
     isn't cropped awkwardly through the middle. */
  .hero { padding: 22px; background-position: center top; }
}

/* ---------- Filters ---------- */
.filters {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(255, 255, 255, .035);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  margin-right: 4px;
  min-width: 70px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.chip.active {
  background: rgba(255, 255, 255, .12);
  color: var(--text);
  border-color: rgba(255, 255, 255, .25);
}
.chip-dot {
  width: 9px; height: 9px;
  border-radius: 3px;
  display: inline-block;
}
.search-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--c-appt); }
.search-input::placeholder { color: var(--muted); }

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, .25);
}
.view-toggle a {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: all .15s;
}
.view-toggle a:hover { color: var(--text); }
.view-toggle a.active {
  background: rgba(255, 255, 255, .12);
  color: var(--text);
}

/* ---------- Calendar view ---------- */
.calendar { display: grid; gap: 14px; }
.month {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .03);
  overflow: hidden;
}
.month-name {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.month-name .mn-month {
  font-size: 18px;
  font-weight: 800;
}
.month-name .mn-year {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}
.month-name .mn-count {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.events {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.event {
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), var(--shadow-card);
  transition: transform .2s, box-shadow .2s;
  background: linear-gradient(135deg, var(--card-from, #2f80ed), var(--card-to, #0c3262));
  cursor: pointer;
}
.event:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 20px 40px rgba(0, 0, 0, .4);
}
.event-circuit-APPT  { --card-from: rgba(47, 128, 237, .95);  --card-to: rgba(12, 50, 98, .9); }
.event-circuit-PPS   { --card-from: rgba(209, 76, 255, .95);  --card-to: rgba(83, 20, 105, .9); }
.event-circuit-TPS   { --card-from: rgba(255, 159, 28, .95);  --card-to: rgba(123, 63, 8, .9); }
.event-circuit-SPT   { --card-from: rgba(6, 182, 212, .95);   --card-to: rgba(4, 78, 93, .9); }
.event-circuit-FIP   { --card-from: rgba(52, 211, 153, .95);  --card-to: rgba(15, 90, 67, .9); }
.event-circuit-AC    { --card-from: rgba(245, 183, 0, .95);   --card-to: rgba(123, 90, 0, .9); }
.event-circuit-FED   { --card-from: rgba(255, 90, 95, .95);   --card-to: rgba(105, 25, 30, .9); }
.event-circuit-OTHER { --card-from: rgba(154, 166, 183, .85); --card-to: rgba(50, 60, 75, .9); }

/* Multi-circuit cards: split gradient */
.event-multi {
  background: linear-gradient(135deg,
    var(--card-from, #2f80ed) 0%,
    var(--card-from, #2f80ed) 45%,
    var(--card-to-2, #d14cff) 55%,
    var(--card-to-2, #d14cff) 100%);
}

.event-date {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.event-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: 15px;
}
.event-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, .85);
  line-height: 1.4;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Country flag on calendar/list cards: bumped up from the base 18px and given a
   subtle ring so it reads clearly at a glance, including next to the colored
   "This week"/"Live" status badges. Card-scoped (two-class selector) so it only
   affects card flags, not the filter dropdown/chip flags. (Added 2026-06-30.)
   .plan-meta added 2026-07-24 — same class, same rule, for the /plan.php
   timeline cards' flag icons (reusing this exactly rather than a new size). */
.event-meta .flag-img,
.list-meta .flag-img,
.plan-meta .flag-img {
  width: 23px;
  border-radius: 3px;
  vertical-align: -5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
}

.event-tags {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.event-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.event-status-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}
.status-live {
  background: var(--c-live);
  color: #052e1f;
  animation: pulse 2s infinite;
}
.status-upcoming-soon {
  background: rgba(255, 255, 255, .2);
  color: white;
}
.status-provisional {
  background: rgba(255, 159, 28, .9);
  color: #3a1d00;
}
.status-past {
  background: rgba(0, 0, 0, .35);
  color: rgba(255, 255, 255, .55);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

.empty-month {
  color: var(--muted);
  font-size: 13px;
  padding: 20px;
  text-align: center;
  font-style: italic;
}

@media (max-width: 760px) {
  .month { grid-template-columns: 1fr; }
  .month-name {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }
  .month-name .mn-count { margin-top: 0; }
  .events { grid-template-columns: 1fr; }
}

/* ---------- List view ---------- */
.list-view {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
  overflow: hidden;
}
.list-row {
  position: relative;
  display: grid;
  /* Action column widened 100px -> 150px (2026-07-24) so the labeled
     bookmark button ("+ Add to list") + the Register/Info pill can each sit
     on their own line (see .list-action below) without crowding — a plain
     100px column only ever fit the old icon-only circle. */
  grid-template-columns: 110px 1fr 220px 140px 150px;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  align-items: center;
  transition: background .15s;
}
.list-row:hover { background: rgba(255, 255, 255, .04); }
.list-row:last-child { border-bottom: 0; }
.list-row.list-header {
  background: rgba(255, 255, 255, .04);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 700;
}
.list-date {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
}
.list-name {
  font-weight: 700;
  font-size: 15px;
}
.list-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.list-circuits { display: flex; gap: 4px; flex-wrap: wrap; }
.list-mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
}
.list-mini-pill .chip-dot { width: 7px; height: 7px; border-radius: 2px; }
.list-action {
  text-align: right;
}
.btn-mini {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  transition: all .15s;
}
.btn-mini:hover { background: rgba(255, 255, 255, .15); }

@media (max-width: 900px) {
  .list-row { grid-template-columns: 1fr; gap: 6px; }
  .list-row.list-header { display: none; }
  .list-action { text-align: left; }
}

/* ---------- Empty state ---------- */
.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state .es-emoji { font-size: 36px; margin-bottom: 8px; }
.empty-state strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 16px; }

/* ---------- Form (submit page) ---------- */
.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .035);
  padding: 32px;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: var(--shadow-hi);
}
.form-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.form-card .subtitle { margin-bottom: 24px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}
.field .req { color: var(--c-fed); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .3);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa6b7' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field select option {
  background: #151d2a;
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--c-appt); }
.field textarea { min-height: 100px; resize: vertical; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c-appt), var(--c-pps));
  color: white;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  border: 0;
  transition: transform .12s, box-shadow .15s;
  box-shadow: 0 12px 30px rgba(47, 128, 237, .35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 40px rgba(209, 76, 255, .4); }

.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid;
}
.alert-success { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .35); color: #b6f4dc; }
.alert-error { background: rgba(255, 90, 95, .12); border-color: rgba(255, 90, 95, .35); color: #ffc8ca; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--text); }

/* ---------- Circuits page ---------- */
.circuit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 4px;
}
.circuit-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--cc, var(--c-other));   /* circuit colour accent */
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
  padding: 18px 20px;
}
.circuit-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.circuit-badge {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: 7px;
  color: #fff;
  /* same gradient treatment as the event cards (.event-circuit-XXX vars) */
  background: linear-gradient(135deg, var(--card-from, #2f80ed), var(--card-to, #0c3262));
}
.circuit-desc {
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 14px;
  margin: 10px 0 14px;
}
.circuit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  font-size: 13px;
}
.circuit-meta a { font-weight: 700; }
.circuit-count { color: var(--muted); }
@media (max-width: 760px) {
  .circuit-grid { grid-template-columns: 1fr; }
}

/* ---------- My Plan: bookmark button + click-overlay pattern ----------
   Cards/rows that link out (registration URL) use an absolutely-positioned
   overlay <a> instead of wrapping the whole card in <a>, so the bookmark
   button (a tabindex-bearing control) can sit alongside it without nesting
   interactive content inside an <a> (invalid HTML). The overlay is fully
   transparent and z-index:1; the bookmark button sits above it at z-index:2
   so its own small area intercepts clicks first, everywhere else falls
   through to the overlay link. */
.event-click-overlay,
.row-click-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.bookmark-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  /* Solid-ish neutral dark fill (NOT translucent) so it reads the same
     regardless of the card behind it — a green FIP card and a blue APPT card
     both sit under the same near-opaque navy circle. Default state is
     deliberately muted (soft ring, dimmed icon); the accent-gradient fill
     only appears once the tournament is actually saved (.in-plan), so the
     two states are unmistakable at a glance. */
  background: rgba(13, 16, 24, .92);
  border: 1.5px solid rgba(255, 255, 255, .3);
  color: rgba(255, 255, 255, .75);
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
  transition: background .15s, transform .12s, box-shadow .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.bookmark-btn:hover {
  background: rgba(28, 33, 46, .96);
  border-color: rgba(255, 255, 255, .6);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .55);
}
.bookmark-btn:active { transform: scale(.9); }
.bookmark-btn:focus-visible { outline: 2px solid var(--c-appt); outline-offset: 2px; }
.bookmark-btn.in-plan {
  background: linear-gradient(135deg, var(--c-appt), var(--c-pps));
  border-color: #fff;
  color: #fff;
  box-shadow: 0 4px 16px rgba(209, 76, 255, .6);
}
.bookmark-btn.in-plan:hover {
  box-shadow: 0 6px 22px rgba(209, 76, 255, .75);
}
/* Brief confirmation pop on the exact click that adds/removes a tournament —
   the colour/fill change alone is easy to miss, this makes the toggle land. */
@keyframes bookmarkPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.bookmark-btn.pop { animation: bookmarkPop .35s ease; }
/* Hidden by default so plan.php's timeline button (icon-only, unlabeled)
   stays exactly as it was; .event/.list-row below opt back in. */
.bookmark-label { display: none; }

/* Moved from an absolutely-positioned bottom-left circle to a normal-flow
   pill on its own line at the bottom-right (2026-07-24). .event is a column
   flex container with justify-content:space-between, so appending this as
   the LAST child (after .event-tags — see index.php) plus align-self puts
   it on its own row below the circuit tags, right-aligned, with zero risk
   of overlapping them regardless of how many tags a card has — the old
   absolute-position approach needed a hand-tuned .event-tags padding-left
   to dodge exactly that overlap; this doesn't need it at all (removed
   below). Still position:relative + z-index:2 so it stays clickable above
   .event-click-overlay's z-index:1, same stacking pattern as before, just
   no longer requiring absolute positioning to achieve it. */
.event .bookmark-btn {
  position: relative;
  z-index: 2;
  align-self: flex-end;
  margin-top: 10px;
  width: auto;
  height: auto;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  gap: 5px;
  white-space: nowrap;
}
.event .bookmark-label { display: inline-block; }

.list-row .bookmark-btn {
  position: relative;
  z-index: 2;
  width: auto;
  height: auto;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  gap: 4px;
  white-space: nowrap;
}
.list-row .bookmark-label { display: inline-block; }
.list-action {
  /* Column stack (not a row) so the now-labeled bookmark button and the
     Register/Info pill each get their own line instead of needing to share
     one crowded 150px-wide row. */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
@media (max-width: 900px) {
  .list-action { align-items: flex-start; }
}

.myplan-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  /* Was a flat var(--c-pps) — now the same 2-stop gradient as .nav-cta/
     .brand-mark, so it reads as part of the same brand-gradient family
     instead of a standalone accent colour. */
  background: linear-gradient(135deg, var(--c-appt), var(--c-pps));
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  vertical-align: 2px;
}

/* ---------- Plan page: vertical timeline ---------- */
.plan-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: rgba(255, 255, 255, .15); }
/* Deliberately quieter than .btn-primary/.btn-secondary — this is a
   destructive action (wipes the saved plan), so it shouldn't visually
   compete with Export/Share/Print for attention. Muted at rest; only warns
   toward red on hover, as a "you're about to do something" cue right before
   the confirm() dialog actually fires. */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-ghost:hover {
  background: rgba(255, 90, 95, .08);
  border-color: rgba(255, 90, 95, .35);
  color: #FF9BA0;
}
.btn-ghost:focus-visible { outline: 2px solid var(--c-appt); outline-offset: 2px; }

.alert-info {
  background: rgba(47, 128, 237, .12);
  border-color: rgba(47, 128, 237, .35);
  color: #cfe1ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.alert-info .btn-mini { flex-shrink: 0; }

/* ---------- Plan page: summary (stat cards + route list) ----------
   Stat cards reuse the homepage hero's existing .stat/.stat-num/.stat-lbl
   (same 4-across/2x2-mobile card look, already dark-theme-correct) rather
   than inventing near-duplicate classes — only the grid container here is
   new, since .stats itself carries a hero-specific margin-top. */
.plan-summary-wrap {
  max-width: 820px;
  margin: 0 auto 20px;
}
.plan-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.plan-stat-num-span { font-size: 20px; } /* "Aug – Oct" needs to be smaller than a numeric stat to fit the card */
@media (max-width: 600px) {
  .plan-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.plan-route {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
  padding: 14px;
  box-shadow: var(--shadow-card);
}
.plan-route-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.plan-route-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plan-route-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.plan-route-row:hover, .plan-route-row:focus-visible {
  background: rgba(255, 255, 255, .06);
  outline: none;
}
.plan-route-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.plan-route-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.plan-route-name {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-route-loc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-route-dates {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  text-align: right;
  white-space: nowrap;
}
/* Distinct row inserted at the point in the chronological list where two
   tournaments' ranges actually overlap (rangesOverlap() — same primitive
   the timeline's connectorHtml() and the calendar's bar lane-packing use). */
.plan-route-conflict {
  margin: 0 8px 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 90, 95, .12);
  border: 1px solid rgba(255, 90, 95, .35);
  color: #FF9BA0;
  font-size: 11px;
  font-weight: 700;
}

/* ---------- Plan page: compact month calendar (mobile-first) ----------
   Cells are real <button> elements (disabled for out-of-month/no-event days)
   so tap targets are native and keyboard-accessible with zero extra ARIA —
   a disabled button is already inert. */
.plan-calendar-wrap {
  max-width: 820px;
  margin: 0 auto 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
  padding: 14px;
  box-shadow: var(--shadow-card);
}
.plan-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.plan-cal-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.plan-cal-nav:hover { background: rgba(255, 255, 255, .16); }
.plan-cal-nav:focus-visible { outline: 2px solid var(--c-appt); outline-offset: 2px; }
.plan-cal-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .02em;
}
.plan-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
/* Each week is its OWN small grid (7 cols x [1 daynum row + N bar-lane
   rows]), stacked vertically — NOT one giant 42-cell grid. This is what
   lets a week with an overlap grow taller (more grid-template-rows) while
   every other week stays at the compact baseline; mixing auto- and
   explicitly-placed items in a single shared grid would make the
   auto-placement algorithm dodge around the explicitly-placed bars and
   scramble the day-number layout, so every item below (day numbers AND
   bars) gets an explicit inline grid-column/grid-row instead. */
.plan-cal-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.plan-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 3px;
}
.plan-cal-daynum {
  justify-self: start;
  width: 20px;
  height: 18px;
  margin: 1px 0 0 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  cursor: default;
}
.plan-cal-daynum-out { color: rgba(255, 255, 255, .16); }
.plan-cal-daynum[data-date] { cursor: pointer; color: var(--text); }
.plan-cal-daynum[data-date]:hover { background: rgba(255, 255, 255, .12); }
.plan-cal-daynum:focus-visible { outline: 2px solid var(--c-appt); outline-offset: 1px; }
.plan-cal-daynum-today { background: var(--c-appt); color: #fff; }

/* Google Calendar-style spanning bar: one continuous pill per tournament
   per week it touches (split into separate segments at week boundaries —
   see computeWeekBars() in plan.js). Small border-radius by default reads
   as "continues off this edge"; the -cap- classes add a full pill-cap only
   on the segment's true start/end, so a bar that's clipped by the week
   boundary visually looks cut off rather than falsely capped. */
.plan-cal-bar {
  display: flex;
  align-items: center;
  height: 15px;
  border: none;
  border-radius: 3px;
  padding: 0 4px;
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.plan-cal-bar-cap-start { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.plan-cal-bar-cap-end { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.plan-cal-bar:hover, .plan-cal-bar:focus-visible {
  filter: brightness(1.15);
  outline: 1px solid rgba(255, 255, 255, .6);
  outline-offset: -1px;
}
.plan-cal-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tightened for narrow phones (iPhone SE-class, ~375px) so cells stay close
   to the ~44px touch-target guideline: less wrapper/gap padding leaves more
   width for the day columns themselves. */
@media (max-width: 420px) {
  .plan-calendar-wrap { padding: 10px; }
  .plan-cal-weekdays { gap: 3px; }
  .plan-cal-daynum { width: 18px; height: 16px; font-size: 10px; }
  .plan-cal-bar { font-size: 8px; height: 14px; }
}

/* ---------- Plan page: day bottom sheet (tap a calendar day) ---------- */
.plan-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  /* Leaflet's default panes run z-index 200 (tilePane) up to 700 (popupPane)
     — 200 collided exactly with tilePane, so the map painted on top of the
     backdrop/sheet. .plan-map has no explicit z-indexed stacking context of
     its own (Leaflet's .leaflet-container is position:relative with no
     z-index), so its panes' values compete directly against ours in the
     same stacking context. Bumped well clear of Leaflet's whole range.
     (2026-07-24.) */
  z-index: 2000;
}
.plan-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 520px;
  margin: 0 auto;
  background: #151d2a;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
  z-index: 2001;
  max-height: 70vh;
  overflow-y: auto;
  padding: 10px 18px 22px;
}
.plan-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .25);
  margin: 4px auto 12px;
}
.plan-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.plan-sheet-date {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
}
.plan-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.plan-sheet-close:hover { background: rgba(255, 255, 255, .16); }
.plan-sheet-close:focus-visible { outline: 2px solid var(--c-appt); outline-offset: 2px; }
.plan-sheet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.plan-sheet-item:hover, .plan-sheet-item:focus-visible {
  background: rgba(255, 255, 255, .06);
  outline: none;
}
.plan-sheet-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.plan-sheet-item-text { display: flex; flex-direction: column; }
.plan-sheet-item-name { font-weight: 700; font-size: 14px; }
.plan-sheet-item-dates { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Plan page: map ----------
   Leaflet tiles are inherently a light-mode surface (OSM doesn't offer a
   built-in dark tile set worth relying on here), so rather than fight that,
   the map sits in its own light card that intentionally breaks from the
   page's dark theme — a light "window" is less jarring than dark-styled
   chrome around light tiles would be. */
.plan-map-wrap {
  max-width: 820px;
  margin: 0 auto 20px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #eef1f4;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.plan-map {
  height: 320px;
  width: 100%;
}
.plan-map-empty {
  padding: 28px 20px;
  text-align: center;
  color: #4a5568;
  font-size: 13px;
}
/* Leaflet's default marker icon is a positioned <img>; only add a filter
   (never transform — that would fight the translate3d Leaflet uses to place
   the icon, and quietly break its position). */
.plan-marker-highlight {
  filter: drop-shadow(0 0 6px #2f80ed) drop-shadow(0 0 10px #2f80ed);
}

/* Optional home pin: one-time consent banner + persistent status/reset strip.
   Both live inside .plan-map-wrap's light surface, so they use dark text on
   the same light background rather than the page's dark-theme variables. */
.plan-home-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: #dbe6f5;
  border-bottom: 1px solid #c3d3e8;
  color: #1a2b47;
  font-size: 13px;
  font-weight: 600;
}
.plan-home-banner .btn-mini {
  background: rgba(255, 255, 255, .7);
  border-color: #b7c8e0;
  color: #1a2b47;
}
.plan-home-banner .btn-mini:hover { background: #fff; }

.plan-map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  background: #e4e9ee;
  color: #4a5568;
  font-size: 11px;
}
.plan-map-link {
  color: #2f5fc4;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.plan-map-link:hover { color: #1c3f8f; }

.plan-home-marker-inner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: linear-gradient(135deg, var(--c-tps), #a15c00);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4), 0 0 0 3px #fff;
}

.plan-card-highlight {
  animation: planCardHighlight 1.6s ease;
}
@keyframes planCardHighlight {
  0%   { box-shadow: 0 0 0 3px var(--c-appt), var(--shadow-card); }
  70%  { box-shadow: 0 0 0 3px var(--c-appt), var(--shadow-card); }
  100% { box-shadow: var(--shadow-card); }
}

@media (max-width: 600px) {
  .plan-map { height: 240px; }
}

.plan-timeline {
  max-width: 820px;
  margin: 0 auto;
}
.plan-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 16px;
}
.plan-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.plan-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-appt), var(--c-pps));
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .08);
  margin-top: 6px;
  flex-shrink: 0;
}
.plan-line {
  width: 2px;
  flex: 1;
  background: var(--line);
  margin-top: 4px;
}
.plan-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.plan-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.plan-date {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.plan-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.plan-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.reg-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  border: 1px solid;
}
.reg-open   { background: rgba(52, 211, 153, .15); color: #8DF0C6; border-color: rgba(52, 211, 153, .4); }
.reg-soon   { background: rgba(255, 159, 28, .18);  color: #FFC46B; border-color: rgba(255, 159, 28, .45); }
.reg-closed { background: rgba(255, 90, 95, .15);   color: #FF9BA0; border-color: rgba(255, 90, 95, .4); }

/* Explicit per-card removal, distinct from the page-level "Clear plan"
   button (which wipes the whole plan). Deliberately its own small text
   control rather than reusing .bookmark-btn's markup/label — that button's
   label always reads "In your plan"/"Add to list" (shared, context-unaware
   wording, see myplan.js), which would read as a status indicator here, not
   an unambiguous removal action. margin-left:auto pushes it to the end of
   the (flex-wrap) badges row. */
.plan-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  user-select: none;
  transition: color .15s, background .15s, border-color .15s;
  border: 1px solid transparent;
}
.plan-remove:hover,
.plan-remove:focus-visible {
  color: #FF9BA0;
  background: rgba(255, 90, 95, .12);
  border-color: rgba(255, 90, 95, .35);
}
.plan-remove:focus-visible { outline: 2px solid #FF9BA0; outline-offset: 1px; }

.plan-connector {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: -6px 0 18px;
  font-size: 12px;
  font-weight: 600;
}
.plan-connector-spacer { width: 26px; flex-shrink: 0; }
.plan-connector-text { display: flex; align-items: center; gap: 6px; }
.plan-connector.overlap .plan-connector-text { color: #FF9BA0; }
.plan-connector.gap .plan-connector-text { color: var(--muted); }

@media (max-width: 600px) {
  .plan-item { grid-template-columns: 18px 1fr; gap: 10px; }
  .plan-dot { width: 10px; height: 10px; }
  .plan-connector { gap: 10px; }
  .plan-connector-spacer { width: 18px; }
}

/* ---------- Plan page: per-tournament personal notes (device-local) ---------- */
.plan-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-2);
}
.plan-note-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: color .15s;
}
.plan-note-toggle:hover { color: var(--text-soft); }
.plan-note-toggle:focus-visible { outline: 2px solid var(--c-appt); outline-offset: 2px; border-radius: 4px; }
.plan-note-icon { font-size: 12px; flex-shrink: 0; }
.plan-note-label { font-style: italic; }
.plan-note-preview {
  color: var(--text-soft);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-note-toggle.has-note .plan-note-icon { color: var(--c-tps); }
.plan-note-textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 64px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .3);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
}
.plan-note-textarea:focus { border-color: var(--c-appt); }

/* ---------- Utility ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Print-only elements (hidden on screen; shown in @media print below) ---------- */
.print-header { display: none; }
.plan-note-print { display: none; white-space: pre-wrap; }

/* ---------- Print stylesheet (plan.php "Print plan" -> window.print()) ----------
   Single @media block in the shared stylesheet rather than a separate print.css:
   this is a no-build-step, single-CSS-file project (see assets/style.css header),
   so a second stylesheet would just be one more thing to remember to link on
   every page. Re-pointing the theme's CSS custom properties (--bg/--text/--muted/
   etc.) to light-mode values here is what makes most components (cards, dates,
   badges, connector text) go print-friendly for free, since they're already
   written in terms of those variables — only the handful of RULES using
   hardcoded rgba()/hex colours instead of the variables need explicit overrides
   below. */
@media print {
  :root {
    --bg: #fff;
    --bg-2: #fff;
    --panel: #fff;
    --panel-2: #fff;
    --line: #999;
    --line-2: #ccc;
    --text: #111;
    --text-soft: #333;
    --muted: #555;
    --shadow-card: none;
    --shadow-soft: none;
    --shadow-hi: none;
  }

  html, body {
    background: #fff !important;
    color: #111 !important;
  }

  /* UI chrome that means nothing on paper: nav, hero/subtitle, the shared-plan
     banner, bookmark toggles, the note-editing affordance, the toolbar that
     holds Export/Share/Print themselves, the Leaflet map (tiles print poorly
     and waste ink), the month calendar (same text is already in the
     timeline), the day bottom-sheet (an interactive overlay — should never
     be mid-open in a print snapshot regardless), and the summary section
     (stat cards reuse .stat's hardcoded dark background rather than a CSS
     variable, so it wouldn't flip to the print-safe light theme automatically
     like most of this page does — and the route list just repeats what the
     printed timeline cards already show, so there's nothing lost by hiding
     it here rather than making that background print-safe too). */
  .site-header,
  .site-footer,
  .hero,
  #plan-banner,
  .plan-toolbar,
  .plan-summary-wrap,
  .plan-calendar-wrap,
  .plan-sheet-backdrop,
  .plan-sheet,
  .plan-map-wrap,
  .bookmark-btn,
  .plan-note-toggle,
  .plan-remove,
  .empty-state {
    display: none !important;
  }

  .print-header {
    display: block !important;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #111;
  }
  .print-header-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    font-size: 18px;
  }
  .print-header-title { font-size: 14px; margin-top: 2px; }
  .print-header-date { font-size: 11px; color: #444; margin-top: 4px; }

  .wrap { max-width: 100%; padding: 0; }
  .plan-timeline { max-width: 100%; margin: 0; }

  /* Flatten the decorative rail (dot + connecting line) — it carries no
     information on paper — and let the card fill the row it freed up. */
  .plan-item { grid-template-columns: 1fr !important; gap: 0 !important; }
  .plan-rail { display: none !important; }
  .plan-connector { gap: 0 !important; }
  .plan-connector-spacer { display: none !important; }

  .plan-card {
    background: #fff !important;
    border: 1px solid #999 !important;
    box-shadow: none !important;
    color: #111 !important;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 12px !important;
  }
  .plan-connector {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Hardcoded (non-variable) colours that the --bg/--text swap above can't
     reach: badge fills and circuit-tag chips. Text content already conveys
     the open/soon/closed distinction, so a flat white-with-border treatment
     for all of them is enough — no need to fight for print-safe accent hues.
     !important here also overrides the inline style="..." on the
     Register/Info link variant of .reg-badge in assets/plan.js. */
  .reg-badge,
  .event-tag {
    background: #fff !important;
    border: 1px solid #999 !important;
    color: #111 !important;
  }

  .plan-connector.overlap .plan-connector-text { color: #900 !important; font-weight: 700; }

  .plan-note-print { display: block !important; color: #111 !important; font-size: 12px; margin-top: 10px; }
  .plan-note-print:empty { display: none !important; }
  .plan-note-print-label { font-weight: 700; }
  /* No note -> hide the whole separator section, not just the empty text
     block, so cards without a note don't print a stray blank divider line.
     Progressive enhancement: browsers without :has() support just keep the
     (harmless) empty-bordered strip instead of failing anything. */
  .plan-note:has(.plan-note-print:empty) { display: none !important; }
}
/* 2026-08-02 header redesign: respect reduced-motion for the continuous
   decorative animations (gradient border shift, logo glow pulse, logo halo
   spin) — freezing them on the first frame loses nothing functionally for
   users who've asked the OS to minimise motion. */
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .brand-logo,
  .brand::before {
    animation: none;
  }
}
