/* GroundHopper — graffiti design system */
/* Google Fonts linked in application.html.erb */

:root {
  --neon-yellow: hsl(50, 100%, 52%);
  --flare-red: hsl(4, 90%, 58%);
  --chalk: hsl(45, 30%, 90%);
  --pitch-green: hsl(145, 55%, 38%);
  --concrete: hsl(225, 10%, 28%);
  --spraypaint: hsl(280, 60%, 55%);
  --sticker-blue: hsl(210, 80%, 55%);
  --tape-white: hsl(40, 15%, 85%);
  --bg: hsl(225, 30%, 8%);
  --card-bg: hsl(225, 25%, 11%);
  --secondary-bg: hsl(225, 20%, 15%);
  --muted-fg: hsl(220, 12%, 50%);
  --border-color: hsl(225, 20%, 18%);
  --radius: 0.25rem;
}

/* Reset + base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--chalk);
  font-family: 'Barlow', sans-serif;
}
body.fullscreen {
  overflow: hidden;
}
h1, h2, h3, h4, h5, h6 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

/* ===== HEADER ===== */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 800; /* above Leaflet's popup pane (700) */
  pointer-events: none;
}
/* On desktop, offset header past the fixtures sidebar */
@media (min-width: 768px) {
  .site-header {
    left: 280px;
  }
}
.site-header .header-bg {
  position: relative;
  overflow: hidden;
}
.site-header .header-grit {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-size: cover;
  background-position: center top;
}
.site-header .header-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,12,22,0.8) 0%, rgba(10,12,22,0.6) 50%, transparent 100%);
}
.site-header .header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.site-header .logo-block {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-header .logo-pin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--neon-yellow);
  transform: skewX(-6deg);
  flex-shrink: 0;
}
.site-header .logo-pin svg {
  width: 24px;
  height: 24px;
  color: var(--bg);
}
.site-header .logo-drip-1 {
  position: absolute;
  bottom: -8px;
  left: 8px;
  width: 6px;
  height: 12px;
  background: var(--neon-yellow);
  border-radius: 0 0 9999px 9999px;
}
.site-header .logo-drip-2 {
  position: absolute;
  bottom: -12px;
  right: 12px;
  width: 4px;
  height: 16px;
  background: var(--neon-yellow);
  border-radius: 0 0 9999px 9999px;
  opacity: 0.7;
}
.site-header .logo-text h1 {
  font-family: 'Permanent Marker', cursive;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--neon-yellow);
  text-shadow: 0 0 20px hsl(50 100% 52% / 0.5), 0 0 40px hsl(50 100% 52% / 0.2);
  letter-spacing: 0.05em;
  text-transform: none;
}
.site-header .logo-text .tagline {
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--muted-fg);
  margin-top: 2px;
  display: block;
}
.site-header .header-nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Auth nav on non-map pages */
.site-header-plain {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  margin-bottom: 20px;
}
.site-header-plain .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-header-plain h1 {
  font-size: 1.5rem;
}
.site-header-plain h1 a {
  text-decoration: none;
  color: var(--neon-yellow);
}
.site-header-plain nav {
  display: flex;
  gap: 12px;
  align-items: center;
}
.site-header-plain nav a {
  color: var(--chalk);
}

/* ===== STICKER COMPONENTS ===== */
.sticker {
  display: inline-block;
  padding: 4px 12px;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: var(--neon-yellow);
  color: var(--bg);
  transform: rotate(-2deg);
  box-shadow: 2px 2px 0px var(--bg), 3px 3px 0px var(--flare-red);
  border: 2px solid var(--bg);
  cursor: default;
}
.sticker-red {
  display: inline-block;
  padding: 4px 12px;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: var(--flare-red);
  color: var(--chalk);
  transform: rotate(1deg);
  box-shadow: 2px 2px 0px var(--bg), 3px 3px 0px var(--neon-yellow);
  border: 2px solid var(--bg);
}
.sticker-blue {
  display: inline-block;
  padding: 4px 12px;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: var(--sticker-blue);
  color: var(--chalk);
  transform: rotate(-1.5deg);
  box-shadow: 2px 2px 0px var(--bg);
  border: 2px solid var(--bg);
}
.tape-strip {
  display: inline-block;
  position: relative;
  padding: 4px 12px;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: rgba(212, 200, 170, 0.9);
  color: var(--bg);
  transform: rotate(-1deg);
  clip-path: polygon(2% 0%, 98% 2%, 100% 95%, 1% 100%);
}

/* ===== DRIP BORDER ===== */
.drip-border-bottom {
  border-bottom: 3px solid var(--neon-yellow);
  border-image: repeating-linear-gradient(
    90deg,
    var(--neon-yellow) 0px,
    var(--neon-yellow) 12px,
    var(--flare-red) 12px,
    var(--flare-red) 20px,
    transparent 20px,
    transparent 24px
  ) 3;
}

/* ===== FIXTURE CARD ===== */
.fixture-card {
  position: relative;
  padding: 16px;
  background: var(--secondary-bg);
  border-left: 4px solid var(--neon-yellow);
  clip-path: polygon(0% 0%, 100% 0%, 100% calc(100% - 4px), calc(100% - 8px) 100%, 0% 100%);
  margin-bottom: 12px;
}
.fixture-card:nth-child(even) {
  border-left-color: var(--flare-red);
}
.fixture-card .fixture-competition {
  font-size: 9px;
  margin-bottom: 8px;
}
.fixture-card .fixture-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fixture-card .fixture-team {
  font-family: 'Oswald', sans-serif;
  font-size: 0.875rem;
  text-transform: uppercase;
  color: var(--chalk);
  font-weight: 700;
}
.fixture-card .fixture-team.away {
  text-align: right;
}
.fixture-card .fixture-vs {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.125rem;
  color: var(--flare-red);
}
.fixture-card .fixture-time {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted-fg);
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== PANEL CONCRETE ===== */
.panel-concrete {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--secondary-bg) 100%);
}

/* ===== PANEL CONCRETE (shared) ===== */
.panel-section-label {
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--muted-fg);
  margin-bottom: 12px;
}
.panel-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== LEAFLET POPUP (gh-popup) ===== */
.leaflet-popup.gh-popup .leaflet-popup-content-wrapper {
  background: var(--card-bg);
  color: var(--chalk);
  border-radius: var(--radius);
  box-shadow: 0 0 0 2px var(--flare-red), 4px 4px 0 var(--bg);
  padding: 0;
}
.leaflet-popup.gh-popup .leaflet-popup-tip-container {
  display: none;
}
.leaflet-popup.gh-popup .leaflet-popup-close-button {
  color: var(--muted-fg);
  font-size: 1rem;
  top: 6px;
  right: 8px;
}
.leaflet-popup.gh-popup .leaflet-popup-close-button:hover {
  color: var(--chalk);
}
.gh-popup-inner {
  padding: 14px 16px;
  min-width: 200px;
}
.gh-popup-name {
  display: block;
  font-family: 'Permanent Marker', cursive;
  font-size: 1.1rem;
  color: var(--neon-yellow);
  text-shadow: 0 0 12px hsl(50 100% 52% / 0.4);
  text-decoration: none;
  margin-bottom: 10px;
  text-transform: none;
  line-height: 1.2;
}
.gh-popup-name:hover {
  text-decoration: underline;
}
.gh-popup-fixture {
  display: block;
  text-decoration: none;
  padding: 8px 0;
  border-top: 1px solid var(--border-color);
}
.gh-popup-fixture:hover .gh-popup-fixture-teams {
  color: var(--neon-yellow);
}
.gh-popup-fixture-teams {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--chalk);
  transition: color 0.15s;
}
.gh-popup-vs {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--flare-red);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.gh-popup-fixture-time {
  font-size: 10px;
  color: var(--muted-fg);
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.gh-popup-no-fixtures {
  font-family: 'Permanent Marker', cursive;
  font-style: italic;
  color: var(--muted-fg);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* ===== SEARCH BAR ===== */
.map-search-form {
  position: absolute;
  z-index: 810;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(13, 15, 26, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-color);
  /* Mobile: full width below header */
  top: 64px;
  left: 0;
  right: 0;
}
@media (min-width: 768px) {
  .map-search-form {
    /* Desktop: offset past sidebar */
    left: 280px;
    top: 64px;
    right: auto;
    border-radius: 0 0 var(--radius) 0;
    border-right: 1px solid var(--border-color);
  }
}
.map-search-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  color: var(--chalk);
  font-family: 'Barlow', sans-serif;
  font-size: 0.85rem;
  border-radius: var(--radius);
  outline: none;
}
.map-search-input:focus {
  border-color: var(--neon-yellow);
}
.map-search-radius {
  padding: 6px 4px;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  color: var(--chalk);
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  outline: none;
}
.map-search-btn {
  padding: 6px 14px;
  background: var(--neon-yellow);
  color: var(--bg);
  border: none;
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: var(--radius);
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.map-search-btn:hover { opacity: 0.85; }
.map-search-clear {
  padding: 6px 10px;
  background: var(--flare-red);
  color: var(--chalk);
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.map-search-clear:hover { opacity: 0.85; }

/* ===== GROUND SHOW PAGE ===== */
.ground-show {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.ground-show-hero {
  margin-bottom: 32px;
}
.ground-show-name {
  font-family: 'Permanent Marker', cursive;
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--neon-yellow);
  text-shadow: 0 0 20px hsl(50 100% 52% / 0.5), 0 0 40px hsl(50 100% 52% / 0.2);
  text-transform: none;
  line-height: 1.1;
  margin-bottom: 12px;
}
.ground-show-section {
  margin-bottom: 32px;
}
.fixture-card-link {
  display: block;
  text-decoration: none;
  margin-bottom: 12px;
}
.fixture-card-link .fixture-card {
  margin-bottom: 0;
  transition: border-left-color 0.15s;
}
.fixture-card-link:hover .fixture-card {
  border-left-color: var(--neon-yellow);
}

/* ===== FIXTURE SHOW PAGE ===== */
.fixture-show {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.fixture-show-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 24px;
  background: var(--card-bg);
  border-left: 4px solid var(--neon-yellow);
}
.fixture-show-team {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.1rem, 4vw, 1.75rem);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--chalk);
  flex: 1;
  line-height: 1.1;
}
.fixture-show-team.away {
  text-align: right;
}
.fixture-show-vs {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--flare-red);
  flex-shrink: 0;
}
.fixture-show-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.fixture-show-time {
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  width: 100%;
  margin-top: 4px;
}
.fixture-show-section {
  margin-bottom: 24px;
}
.fixture-ground-link {
  text-decoration: none;
}
.fixture-ground-name {
  font-family: 'Permanent Marker', cursive;
  font-size: 1.5rem;
  color: var(--neon-yellow);
  text-shadow: 0 0 16px hsl(50 100% 52% / 0.4);
  text-transform: none;
  transition: text-shadow 0.15s;
}
.fixture-ground-link:hover .fixture-ground-name {
  text-shadow: 0 0 24px hsl(50 100% 52% / 0.7);
}

/* ===== BACK LINK ===== */
.back-link {
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-fg);
  text-decoration: none;
  transition: color 0.15s;
}
.back-link:hover { color: var(--chalk); }

/* ===== CLICKABLE AREA FIXTURE CARDS ===== */
a.area-fixture-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
a.area-fixture-card:hover {
  border-left-color: var(--neon-yellow);
  background: var(--card-bg);
}

/* No fixtures message */
.no-fixtures {
  font-family: 'Permanent Marker', cursive;
  font-style: italic;
  color: var(--muted-fg);
  font-size: 0.875rem;
}

/* ===== MAP CONTAINER ===== */
#map-container {
  position: fixed;
  inset: 0;
}

/* ===== AREA FIXTURES PANEL ===== */
.area-fixtures-panel {
  position: fixed;
  z-index: 15;
  overflow-y: auto;
  background: rgba(13, 15, 26, 0.93);
  backdrop-filter: blur(6px);
}

/* Desktop: always-visible left sidebar */
@media (min-width: 768px) {
  .area-fixtures-panel {
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    padding-top: 72px; /* clear the floating header */
    border-right: 1px solid var(--border-color);
    z-index: 810; /* above Leaflet panes (max 700) and below ground panel */
  }
}

/* Mobile: hidden by default, full-screen when Games tab active */
@media (max-width: 767px) {
  .area-fixtures-panel {
    inset: 0;
    bottom: 56px; /* above tab bar */
    z-index: 810;
    display: none;
  }
  .area-fixtures-panel.is-visible {
    display: block;
  }
}

.area-fixtures-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: rgba(13, 15, 26, 0.97);
  z-index: 1;
}
.area-fixtures-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  color: var(--neon-yellow);
  letter-spacing: 0.05em;
}
.area-fixtures-subtitle {
  font-size: 10px;
  color: var(--muted-fg);
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 2px;
}
.area-fixtures-body {
  padding: 12px 12px 24px;
}
.area-fixtures-date {
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted-fg);
  margin: 14px 0 6px;
  padding-left: 2px;
}
.area-fixtures-date:first-child {
  margin-top: 4px;
}

/* Compact fixture row for the area panel */
.area-fixture-card {
  position: relative;
  padding: 10px 10px 8px;
  background: var(--secondary-bg);
  border-left: 3px solid var(--neon-yellow);
  margin-bottom: 8px;
  clip-path: polygon(0% 0%, 100% 0%, 100% calc(100% - 3px), calc(100% - 6px) 100%, 0% 100%);
}
.area-fixture-card:nth-child(even) {
  border-left-color: var(--flare-red);
}
.area-fixture-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
}
.area-fixture-team {
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--chalk);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.area-fixture-team.away {
  text-align: right;
}
.area-fixture-vs {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.9rem;
  color: var(--flare-red);
  flex-shrink: 0;
  padding: 0 3px;
}
.area-fixture-meta {
  font-size: 10px;
  color: var(--muted-fg);
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.05em;
}
.area-fixture-ground {
  cursor: pointer;
  color: var(--neon-yellow);
  opacity: 0.8;
}
.area-fixture-ground:hover {
  opacity: 1;
}
.area-no-fixtures {
  font-family: 'Permanent Marker', cursive;
  font-style: italic;
  color: var(--muted-fg);
  font-size: 0.85rem;
  padding: 16px 4px;
  text-align: center;
}

/* Push Leaflet bottom controls above mobile tab bar */
@media (max-width: 767px) {
  .leaflet-bottom {
    bottom: 56px;
  }
}

/* ===== MOBILE TAB BAR ===== */
.mobile-tabs {
  display: none;
}
@media (max-width: 767px) {
  .mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 830; /* topmost */
    background: var(--card-bg);
    border-top: 2px solid var(--neon-yellow);
  }
}
.tab-btn {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--muted-fg);
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tab-btn .tab-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.tab-btn.is-active {
  color: var(--neon-yellow);
  background: rgba(255, 213, 0, 0.07);
}

/* Leaflet zoom control — dark themed */
.leaflet-control-zoom a {
  background: var(--card-bg) !important;
  color: var(--chalk) !important;
  border-color: var(--border-color) !important;
  font-family: 'Oswald', sans-serif !important;
}
.leaflet-control-zoom a:hover {
  background: var(--secondary-bg) !important;
  color: var(--neon-yellow) !important;
}

/* Sticker marker */
.ground-marker-icon {
  background: none !important;
  border: none !important;
  width: auto !important;
  height: auto !important;
}
.ground-marker-icon img {
  height: auto !important;
}

/* ===== UTILITY ===== */
.font-marker { font-family: 'Permanent Marker', cursive; }
.font-bebas  { font-family: 'Bebas Neue', sans-serif; }
.text-glow   { text-shadow: 0 0 20px hsl(50 100% 52% / 0.5), 0 0 40px hsl(50 100% 52% / 0.2); }
.skew-tag    { transform: skewX(-6deg); }

/* ===== CONTAINER (auth pages) ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--neon-yellow);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
