/* ========================================
   Platzbelegung – Styles
   ======================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:    #006633;
  --primary-d:  #004d26;
  --primary-l:  #e8f5e9;
  --accent:     #ff8800;
  --accent-d:   #e07000;
  --danger:     #c0392b;
  --text:       #222;
  --text-light: #555;
  --border:     #d0d0d0;
  --bg:         #f0f4f0;
  --white:      #ffffff;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,0,0,.12);
  --shadow-md:  0 4px 16px rgba(0,0,0,.16);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Section step heading ---- */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-l);
  padding-bottom: 0.6rem;
  padding-left: 0.6rem;
  margin-bottom: 1.2rem;
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 800;
  flex-shrink: 0;
  line-height: 1;
}

/* ---- Tooltip ---- */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
  flex-shrink: 0;
}
.tooltip-btn {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.tooltip-btn:hover,
.tooltip-wrap:hover .tooltip-btn,
.tooltip-wrap.tooltip-open .tooltip-btn {
  background: var(--primary);
  color: var(--white);
}
.tooltip-content {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  min-width: 200px;
  max-width: 280px;
  white-space: normal;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
}
.tooltip-wrap:hover .tooltip-content,
.tooltip-wrap.tooltip-open .tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* ---- Venue checkboxes ---- */
.venues-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.venues-map-links {
  display: none;
}
.venue-map-link {
  display: none;
}
.venue-map-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  font-size: 1rem;
  color: var(--primary-d);
  text-decoration: none;
  padding: 0.1rem 0.2rem;
  border-radius: 4px;
  transition: background 0.12s;
  flex-shrink: 0;
  line-height: 1;
}
.venue-map-icon:hover { background: var(--primary-l); }
.venue-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  background: var(--bg);
  cursor: pointer;
  transition: background 0.12s;
}
.venue-checkbox-item:hover { background: var(--primary-l); }
.venue-checkbox-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

/* ---- Inline date picker ---- */
.date-picker-input {
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  min-width: 0;
  max-width: 140px;
}
.date-picker-input:focus { border-color: var(--primary); }

/* ---- Month view ---- */
.month-week-header {
  background: #e8f5e9;
  color: var(--primary-d);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 0.3rem;
  margin-top: 0.8rem;
  border-left: 3px solid var(--primary);
}
.month-week-header:first-child { margin-top: 0; }

/* Header */
header {
  background: linear-gradient(160deg, #005229 0%, #004020 60%, #003018 100%);
  /* subtle repeating grass stripes */
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.03) 0px,
      rgba(255,255,255,0.03) 40px,
      transparent 40px,
      transparent 80px
    ),
    linear-gradient(160deg, #005229 0%, #004020 60%, #003018 100%);
  color: var(--white);
  padding: 1.4rem 1.5rem 1.3rem;
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid var(--accent);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.header-title {
  flex: 1 1 auto;
  min-width: 0;
}
.header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.32rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-left: auto;
}
.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.version-badge:hover {
  color: #fff;
  background: rgba(255,255,255,0.18);
}
.header-meta-separator {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  font-weight: 700;
}
.header-github-link {
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0;
  white-space: nowrap;
}
.header-github-link:hover {
  color: #fff;
  text-decoration: underline;
}
header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.header-sub {
  font-size: 0.88rem;
  opacity: 0.8;
  margin-top: 0.15rem;
}

/* Main */
main {
  flex: 0 0 auto;
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1rem 1.5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Panel */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.panel h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-l);
  padding-bottom: 0.6rem;
  padding-left: 0.6rem;
  margin-bottom: 1.2rem;
  border-left: 4px solid var(--primary);
}
.panel h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.search-section, .manual-section, .club-section {
  margin-bottom: 1.2rem;
}

/* Input Row */
.input-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.input-row input {
  flex: 1 1 200px;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.input-row input:focus { border-color: var(--primary); }

/* Date row – always side by side */
.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.date-row input[type="date"] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}
.date-row input[type="date"]:focus { border-color: var(--primary); }

/* Action row below dates */
.action-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

/* Hint */
.hint {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  line-height: 1.5;
}
.hint.current-club {
  color: var(--primary);
  font-weight: 600;
}
.hint code {
  background: var(--bg);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.8rem;
}
.hint-inline { font-size: 0.82rem; color: var(--text-light); }

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #007a3d 0%, var(--primary) 100%);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(0,102,51,0.3);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-d) 100%);
  box-shadow: 0 3px 8px rgba(0,102,51,0.4);
  transform: translateY(-1px);
}
.btn-secondary { background: #607d8b; color: var(--white); }
.btn-secondary:hover:not(:disabled) { background: #455a64; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: #922b21; transform: translateY(-1px); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.btn-active { background: var(--primary-d) !important; color: var(--white) !important; box-shadow: inset 0 2px 4px rgba(0,0,0,0.25) !important; }

/* Search Results */
.search-results {
  margin-top: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: 280px;
  overflow-y: auto;
}
.search-result-item {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--primary-l); }
.search-result-name { font-weight: 600; }
.search-result-loc { font-size: 0.82rem; color: var(--text-light); }
.search-no-results { padding: 0.8rem 1rem; color: var(--text-light); font-style: italic; }
.club-search-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.club-search-logo-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.club-search-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.club-search-logo-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-l);
}
.club-search-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* Current club display with logo */
.current-club-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  background: var(--primary-l);
  color: var(--primary-d);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
}
.current-club-check { font-size: 1rem; flex-shrink: 0; }
.current-club-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}
.current-club-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Recent clubs quick-select */
.recent-clubs {
  margin-bottom: 0.8rem;
}
.recent-clubs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.recent-clubs-label {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.recent-clubs-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.recent-clubs-reset {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.recent-club-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  min-width: 64px;
  max-width: 90px;
}
.recent-club-btn:hover {
  border-color: var(--primary);
  background: var(--primary-l);
  transform: translateY(-1px);
}
.recent-club-btn--active {
  border-color: var(--border);
  background: var(--white);
}
.recent-club-logo-wrap {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.recent-club-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.recent-club-logo-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-l);
  color: var(--primary-d);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.recent-club-name {
  font-size: 0.7rem;
  color: var(--text);
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* Selected club info card */
.selected-club-info {
  margin-top: 0.8rem;
}
.selected-club-label {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.selected-club-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.selected-club-card--empty {
  color: var(--text-light);
  font-style: italic;
  justify-content: center;
  min-height: 88px;
}
.selected-club-logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
}
.selected-club-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.selected-club-logo-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.selected-club-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.selected-club-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-d);
  word-break: break-word;
}
.selected-club-location {
  font-size: 0.82rem;
  color: var(--text-light);
}
.selected-club-link {
  font-size: 0.75rem;
}
.selected-club-link a {
  color: var(--primary);
  text-decoration: none;
}
.selected-club-link a:hover {
  text-decoration: underline;
}
.team-overview {
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}
.team-overview summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--primary-d);
  list-style: none;
  user-select: none;
  font-size: 1.45rem;
}
.team-overview summary::-webkit-details-marker {
  display: none;
}
.team-overview-list {
  padding: 0 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.team-overview-table {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-top: 1px solid #eef2ee;
  align-items: start;
}
.team-overview-table--head {
  border-top: none;
  padding-top: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.team-overview-name {
  font-weight: 600;
  min-width: 0;
}
.team-overview-comp {
  font-size: 0.82rem;
  color: var(--text-light);
  min-width: 0;
}

/* Venues List / Legend */
.venues-list h3 { margin-bottom: 0.6rem; }
.venues-list ul { list-style: none; margin-bottom: 0.8rem; }
.venues-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 5px;
  background: var(--bg);
  margin-bottom: 0.3rem;
}
.venue-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.venue-short-name {
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
}
.venue-full-name {
  font-size: 0.78rem;
  color: var(--text-light);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.venue-id { font-size: 0.75rem; color: var(--text-light); margin-right: auto; }
.btn-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--danger);
  padding: 0 0.2rem;
  line-height: 1;
  flex-shrink: 0;
}
.btn-remove:hover { color: #922b21; }
.load-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.venue-summary {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.venue-summary-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  background: var(--bg);
}

/* Empty / Error messages */
.empty-msg { color: var(--text-light); font-style: italic; font-size: 0.9rem; }
.error-msg {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: var(--danger);
  padding: 0.7rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.8rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-light);
}
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Panel header row */
.panel-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: 2px solid var(--primary-l);
  padding-bottom: 0.6rem;
  margin-bottom: 1.2rem;
}
.panel-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.8rem;
}
.panel-header h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
  flex: 1;
  border-left: 4px solid var(--primary);
  padding-left: 0.6rem;
}
.view-controls {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: auto;
  margin-top: 0;
  flex-shrink: 0;
}
.view-controls .btn {
  flex: 0 0 auto;
}
.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  justify-content: center;
  width: 100%;
}
.week-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  text-align: center;
}

/* Week Grid wrapper – horizontally scrollable on small screens */
.week-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Week Grid */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  font-size: 0.82rem;
}

.wg-header-corner { background: transparent; }
.wg-day-header {
  background: linear-gradient(180deg, #007a3d 0%, var(--primary) 100%);
  color: var(--white);
  text-align: center;
  padding: 0.4rem 0.15rem;
  border-radius: 4px 4px 0 0;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.wg-day-header.today {
  background: linear-gradient(180deg, #ffa020 0%, var(--accent) 100%);
  box-shadow: 0 0 0 2px var(--accent-d);
}
.wg-day-short { font-weight: 800; font-size: 0.72rem; }
.wg-day-date  { font-size: 0.64rem; opacity: 0.9; font-weight: 400; }

/* Full-width venue name header spanning all 7 grid columns */
.wg-venue-row-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-l);
  color: var(--primary-d);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-top: 4px;
  border-left: 3px solid var(--primary);
  overflow: hidden;
}
.wg-venue-row-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wg-venue-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wg-cell {
  background: #fafcfa;
  border: 1px solid var(--border);
  min-height: 60px;
  padding: 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
/* Subtle alternating row stripe for grass field feel */
.wg-row-even { background: #f4faf4; }

.game-chip {
  border-radius: 4px;
  padding: 0.25rem 0.3rem;
  cursor: pointer;
  color: var(--white);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 62px;
  justify-content: center;
}
.game-chip:hover { filter: brightness(1.12); }
.chip-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
  display: block;
  flex-shrink: 0;
}
.chip-logo-fallback {
  width: 26px;
  height: 26px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--white);
  flex-shrink: 0;
}
.game-chip .chip-time { font-weight: 800; font-size: 0.7rem; text-align: center; line-height: 1.15; }
.chip-result { font-weight: 800; font-size: 0.7rem; text-align: center; line-height: 1.1; }
/* Team category legend */
.team-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  padding: 0.55rem 0.8rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.8rem;
  margin-top: 0.8rem;
}
.legend-label {
  font-weight: 700;
  color: var(--text-light);
  font-size: 0.78rem;
  flex-shrink: 0;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
}
.legend-dot {
  display: none;
}

/* Game detail modal */
.game-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.game-modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
}
.game-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  color: var(--white);
}
.game-modal-category {
  font-weight: 700;
  font-size: 0.95rem;
}
.game-modal-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  opacity: 0.85;
}
.game-modal-close:hover { opacity: 1; }
.game-modal-body { padding: 1rem; }
.game-modal-teams {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
}
.game-modal-teams--with-logos {
  justify-content: space-between;
  gap: 0.75rem;
}
.game-modal-team-block {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 0;
}
.game-modal-team-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}
.game-modal-vs { color: var(--text-light); font-weight: 400; }
.game-modal-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-light);
}
.game-modal-meta-row { line-height: 1.4; }
.game-modal-maps-link {
  color: var(--primary);
  text-decoration: none;
}
.game-modal-maps-link:hover { text-decoration: underline; }

/* List view */
.day-group { margin-bottom: 1.2rem; }
.day-group-header {
  background: linear-gradient(90deg, var(--primary-l) 0%, #f0f7f0 100%);
  color: var(--primary-d);
  font-weight: 700;
  padding: 0.45rem 0.8rem 0.45rem 1rem;
  border-radius: 5px;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  border-left: 4px solid var(--primary);
}
.game-list-item {
  display: grid;
  grid-template-columns: 56px 34px minmax(0, 1fr) 56px;
  gap: 0.45rem 0.6rem;
  align-items: center;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.game-list-item--lean {
  grid-template-columns: 56px 40px minmax(0, 1fr);
}
.game-list-item:last-child { border-bottom: none; }
.game-list-item:hover { background: var(--bg); }
.gli-time { font-weight: 700; color: var(--primary); white-space: nowrap; }
.gli-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}
.gli-logo--lean-left {
  width: 40px;
  height: 40px;
}
.gli-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.gli-logo-img--large {
  width: 34px;
  height: 34px;
}
.gli-result {
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.gli-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.gli-main-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.gli-vs {
  color: var(--text-light);
  font-size: 0.8rem;
}
.gli-opponent {
  font-weight: 700;
  min-width: 0;
}
.gli-category-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}
.gli-category-chip--rect {
  border-radius: 4px;
}
.gli-venue {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-light);
  white-space: nowrap;
  grid-column: 3 / -1;
}
.gli-venue--lean {
  grid-column: auto;
  white-space: normal;
}
.gli-venue-short {
  display: inline;
}
.gli-venue-long {
  display: none;
}
@media (min-width: 900px) {
  .gli-venue-short {
    display: none;
  }
  .gli-venue-long {
    display: inline;
  }
}
.gli-venue .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.gli-teams {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.4rem;
  min-width: 0;
}
.gli-home { font-weight: 600; }
.gli-opponent { font-weight: 600; }
.gli-vs { color: var(--text-light); font-size: 0.8rem; }
.gli-guest { color: var(--text); }
.gli-comp { color: var(--text-light); font-size: 0.78rem; white-space: nowrap; }

/* btn-edit (pencil button next to venue items) */
.btn-edit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--primary);
  padding: 0 0.2rem;
  line-height: 1;
  flex-shrink: 0;
}
.btn-edit:hover { color: var(--primary-d); }

/* venue-extra tag (alias/pattern count) */
.venue-extra {
  font-size: 0.72rem;
  color: var(--white);
  background: var(--primary);
  border-radius: 10px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

/* Venue editor panel */
.venue-editor {
  margin-top: 1.2rem;
  border: 2px solid var(--primary-l);
  border-radius: var(--radius);
  padding: 1.2rem;
  background: #f9fdfb;
}
.venue-editor h3 {
  color: var(--primary);
  margin-bottom: 1rem;
}
.editor-field {
  margin-bottom: 0.9rem;
}
.editor-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.editor-field input,
.editor-field textarea {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.editor-field input:focus,
.editor-field textarea:focus { border-color: var(--primary); }
.editor-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.editor-status {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 5px;
}
.editor-status-ok  { background: #e8f5e9; color: #2e7d32; }
.editor-status-err { background: #fdecea; color: var(--danger); }
.editor-status-warn { background: #fff8e1; color: #f57f17; }

/* Hidden utility */
.hidden { display: none !important; }

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-light);
  border-top: 3px solid var(--primary);
  background: var(--white);
  margin-top: auto;
}
footer a { color: var(--primary); }

/* Responsive – mobile */
@media (max-width: 600px) {
  header {
    padding: 1rem 1rem 0.9rem;
  }
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .header-meta {
    justify-content: flex-start;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0;
  }
  header h1 { font-size: 1.5rem; }
  .header-sub { font-size: 0.78rem; }

  main { margin: 1rem auto; padding: 0 0.6rem; gap: 1rem; }
  .panel { padding: 1rem; }

  .panel-header { flex-direction: column; align-items: flex-start; }
  .panel-header-top {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .view-controls {
    width: 100%;
    margin-top: 0.5rem;
  }
  .view-controls .btn {
    flex: 1;
  }
  .nav-controls { width: 100%; justify-content: space-between; flex-wrap: nowrap; }
  .week-label { font-size: 0.78rem; }
  .date-picker-input { max-width: 110px; }

  .game-list-item {
    grid-template-columns: 46px 30px 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 0.2rem 0.5rem;
    padding: 0.4rem 0.6rem;
  }
  .game-list-item--lean {
    grid-template-columns: 46px 34px 1fr;
    grid-template-rows: auto;
  }
  .gli-time { grid-column: 1; }
  .gli-logo { grid-column: 2; }
  .gli-main { grid-column: 3; }
  .gli-teams { grid-column: 3 / 5; }
  .gli-result { grid-column: 4; text-align: right; }
  .gli-venue { grid-column: 1 / -1; }
  .gli-venue--lean { grid-column: auto; }
  .gli-comp  { grid-column: 1 / -1; font-size: 0.74rem; }

  .action-row .btn { flex: 1; }
}
