/* Modern CSS for The Scorekeeper */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

body.scorekeeper-embed {

    display: block;

    min-height: 0;

    align-items: stretch;

    justify-content: flex-start;

    padding: 0;

    background-color: transparent;

}

body.scorekeeper-embed #app {

    width: 100%;

    max-width: 100%;

    margin: 0;

    padding: 0;

}

body.scorekeeper-embed #app[data-view] {

    max-width: 100%;

}

body.scorekeeper-embed header,
body.scorekeeper-embed #top-navigation,
body.scorekeeper-embed #sync-banner {

    display: none !important;

}

body.scorekeeper-embed #main-content {

    padding: 0;

}

body.scorekeeper-embed .card {

    box-shadow: none;

    border: none;

}

#app {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 0;
}

#app[data-view="attendance"] {
    max-width: 960px;
}

#app[data-view="admin-dashboard"],
#app[data-view="admin-home"],
#app[data-view="admin-operations"],
#app[data-view="admin-visitors"] {
    max-width: 1100px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 1.8em;
}

header p {
    color: var(--secondary-color);
    font-size: 1.1em;
}

/* Page title outside card */
#main-content h1 {
    color: var(--primary-color);
    font-size: 2em;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

#top-navigation {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-btn {
    display: inline-block;
    padding: 16px 24px;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.nav-btn:hover {
    background: #475569;
    transform: translateY(-1px);
}

.nav-btn.primary {
    background: var(--primary-color);
}

.nav-btn.primary:hover {
    background: #1d4ed8;
}

.card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    width: 100%;
    text-align: center;
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.4em;
}

.btn {
    display: inline-block;
    padding: 18px 32px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    max-width: 350px;
    margin: 8px auto;
}

.btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning-color);
    color: #1f2937;
}

.btn-warning:hover {
    background: #d97706;
    color: #111827;
}

.btn-danger {
    background: var(--danger-color);
}

.btn-danger:hover {
    background: #dc2626;
}

.form-group {
    margin-bottom: 18px;
    text-align: left;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--background-color);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
}

.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 16px;
}

.game-item {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-background);
    cursor: pointer;
    transition: all 0.2s;
}

.game-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.game-item.selected {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.score-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 20px;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.team-score {
    text-align: center;
    flex: 1;
}

.team-score h3 {
    margin-bottom: 8px;
    color: var(--primary-color);
}

.team-score .score {
    font-size: 3em;
    font-weight: bold;
    color: var(--text-color);
}

.stats-section {
    margin: 20px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stat-item {
    background: var(--card-background);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stat-item h4 {
    margin-bottom: 8px;
    color: var(--primary-color);
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    #app {
        max-width: 100%;
        padding: 0;
    }

    .card {
        padding: 16px;
        margin-bottom: 10px;
    }

    .card h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .btn {
        padding: 16px 24px;
        font-size: 16px;
        max-width: 100%;
    }

    .nav-btn {
        padding: 14px 20px;
        font-size: 15px;
        min-width: 100px;
        max-width: 150px;
    }

    #top-navigation {
        gap: 8px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .score-display {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .game-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Game Grid Layout */
.game-selection-card {
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

.game-selection-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.game-selection-card .game-grid {
    flex: 1 1 auto;
    margin-top: 0;
    overflow-y: auto;
    padding-right: 6px;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    scrollbar-color: rgba(37, 99, 235, 0.4) transparent;
}

.game-selection-card .game-grid::-webkit-scrollbar {
    width: 6px;
}

.game-selection-card .game-grid::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.4);
    border-radius: 9999px;
}

.game-item {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.game-item:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-item h3 {
    color: var(--primary-color);
    font-size: 1em;
}

.game-item p {
    margin: 0;
    font-size: 0.85em;
    color: var(--text-color);
    line-height: 1.4;
}

/* Mobile adjustments for game grid */
@media (max-width: 600px) {
    .game-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .game-item {
        padding: 12px;
    }
}

/* Goal Form 5x2 Grid Layout */
.goal-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: repeat(5, auto);
    gap: 15px;
    margin-top: 20px;
    align-items: start;
}

/* Explicit grid positioning for goal form */
.goal-form-grid .form-group:nth-child(1) { grid-column: 1; grid-row: 1; } /* Team */
.goal-form-grid .form-group:nth-child(2) { grid-column: 1; grid-row: 2; } /* Scorer */
.goal-form-grid .form-group:nth-child(3) { grid-column: 1; grid-row: 3; } /* Assist */
.goal-form-grid .form-group:nth-child(4) { grid-column: 1; grid-row: 4; } /* Goal Type */
.goal-form-grid .form-group:nth-child(5) { grid-column: 1; grid-row: 5; } /* Shot Type */
.goal-form-grid .form-group:nth-child(6) { grid-column: 2; grid-row: 1; } /* Period */
.goal-form-grid .form-group:nth-child(7) { grid-column: 2; grid-row: 2/4; } /* Time (spans 2 rows) */
.goal-form-grid .form-group:nth-child(8) { grid-column: 2; grid-row: 5; } /* Breakaway */

.radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: 500;
}

.radio-label input[type="radio"] {
    margin: 0;
}

/* Time Input with Keypad */
.time-entry {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.time-entry-display {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #f1f5f9;
    min-width: 140px;
    text-align: center;
}

.time-entry-keypad {
    display: grid;
    grid-template-columns: repeat(3, minmax(60px, 1fr));
    gap: 10px;
    width: 100%;
}

.time-keypad-button {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-background);
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.time-keypad-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.time-entry-actions {
    width: 100%;
    display: flex;
    justify-content: center;
}

.time-entry-clear {
    padding: 10px 18px;
    border: none;
    border-radius: 9999px;
    background: var(--danger-color);
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.time-entry-clear:hover {
    background: #dc2626;
}

.form-group--time {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.penalty-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 15px;
    margin-top: 20px;
    align-items: start;
}

.minutes-options {
    display: flex;
    gap: 10px;
}

.minutes-button {
    flex: 1;
    padding: 10px 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-background);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.minutes-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.minutes-button.is-active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
      .goal-form-grid,
      .penalty-form-grid {
          grid-template-columns: 1fr;
      }

      .goal-form-grid .form-group {
          grid-column: 1 !important;
          grid-row: auto !important;
      }

      .goal-form-grid .form-group.form-group--time {
          grid-row: auto !important;
      }

      .radio-group {
          gap: 10px;
      }

      .time-entry-keypad {
          grid-template-columns: repeat(3, minmax(80px, 1fr));
      }
  }

/* Attendance Page 2-Column Layout */
.attendance-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 78vh;
    padding: 24px;
    overflow: hidden;
}

.attendance-card__intro {
    text-align: center;
    margin: 0;
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.5;
}

.attendance-card__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.attendance-card__actions .btn {
    flex: 1 1 220px;
    max-width: 260px;
}

.attendance-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 0;
    align-items: flex-start;
}

.attendance-card .attendance-grid {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-gutter: stable;
}

.attendance-card .attendance-grid::-webkit-scrollbar {
    width: 6px;
}

.attendance-card .attendance-grid::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.4);
    border-radius: 9999px;
}

@media (max-width: 900px) {
    #app[data-view="attendance"] {
        max-width: 100%;
    }

    .attendance-card {
        max-height: none;
        padding: 20px;
    }

    .attendance-card .attendance-grid {
        overflow: visible;
        padding-right: 0;
    }
}

.attendance-swap-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.team-swap-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    max-width: 200px;
}

.team-swap-control .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 140px;
    font-size: 15px;
    padding: 12px 20px;
}

.team-swap-icon {
    display: inline-block;
    margin-left: 2px;
    font-size: 13px;
}

.team-swap-note {
    font-size: 12px;
    color: var(--secondary-color);
    line-height: 1.4;
    max-width: 220px;
    margin: 8px 0 0;
}

.team-column {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.team-column h3 {
    color: var(--primary-color);
    margin: 0 0 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    word-break: break-word;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 6px;
}

.checkbox-item:hover {
    background: #f8fafc;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

/* Extra small mobile adjustments */
@media (max-width: 480px) {
    .nav-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-width: 80px;
        max-width: 120px;
    }

    #top-navigation {
        gap: 6px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 15px;
    }

    .attendance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .attendance-swap-row {
        gap: 8px;
        flex-wrap: wrap;
    }

    .team-column {
        padding: 10px 8px;
    }

    .team-column h3 {
        font-size: 1rem;
    }

    .checkbox-item label {
        font-size: 0.95rem;
    }

    
.score-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #f3f6fb 0%, #eef2f9 100%);
  color: #1f2937;
  font-size: 0.85rem;
}

.score-meta__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-meta__item--left {
  text-align: left;
}

.score-meta__item--center {
  flex: 1.4 1 0;
  text-align: center;
}

.score-meta__item--right {
  text-align: right;
}

.score-meta__label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.score-meta__value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #111827;
}

@media (max-width: 640px) {
  .score-meta-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .score-meta__item,
  .score-meta__item--center,
  .score-meta__item--right {
    text-align: left;
  }
}

.scoreboard {
        grid-template-columns: minmax(0, 1fr) minmax(72px, 0.5fr) minmax(0, 1fr);
        gap: 10px;
    }

    .scoreboard .team {
        padding: 12px 8px;
    }

    .score {
        font-size: 2.2rem;
    }

    .scoreboard .team-swap-control .btn {
        padding: 8px 10px;
        font-size: 13px;
    }

    .scoreboard .team-swap-note {
        max-width: 120px;
        font-size: 10px;
    }
}

/* Mobile adjustments for attendance grid */
@media (max-width: 768px) {
    .attendance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .attendance-swap-row {
        gap: 10px;
    }

    .attendance-card__actions .btn {
        flex: 1 1 140px;
        max-width: none;
    }

    .team-swap-control {
        max-width: 160px;
    }

    .team-swap-control .btn {
        min-width: 0;
        width: 100%;
        padding: 10px 14px;
        font-size: 14px;
    }

    .team-swap-note {
        max-width: 100%;
    }

    .team-column {
        padding: 12px 10px;
    }
}

/* Jersey Number Input Styles */
.jersey-number-input {
    width: 50px;
    height: 36px;
    padding: 8px;
    margin-left: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    background: var(--card-background);
    cursor: pointer;
    transition: border-color 0.2s;
}

.jersey-number-input.placeholder {
    color: var(--danger-color);
    font-weight: 600;
}

.jersey-number-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.jersey-number-input:hover {
    border-color: var(--primary-color);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-background);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 8px;
    color: var(--primary-color);
}

.modal-content p {
    margin-bottom: 20px;
    color: var(--text-color);
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    margin-bottom: 20px;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
/* New layout helpers for modular views */
.scoreboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.scoreboard-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 0;
}

.scoreboard-center .score-divider {
    font-size: 20px;
    font-weight: 600;
}

.scoreboard .team {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    min-width: 0;
}

.scoreboard .team h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
    text-align: center;
    word-break: break-word;
}

@media (max-width: 600px) {
    .scoreboard .team h2 {
        font-size: 1.1rem;
    }
}

.score-divider {
    text-align: center;
    font-weight: 600;
    color: var(--secondary-color);
}

.score {
    font-size: 3rem;
    font-weight: 700;
    margin-top: 10px;
}

.shot-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.overtime-banner {
    margin: 12px 0 18px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--secondary-color);
    font-weight: 500;
}

.overtime-banner.is-set {
    background: rgba(16, 185, 129, 0.16);
    color: var(--success-color);
}

.overtime-team-options {
    justify-content: center;
    gap: 12px;
}

.overtime-team-options .minutes-button {
    flex: 1;
    min-width: 140px;
}

.shot-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #e2e8f0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.shot-button:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

.score-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 10px;
    justify-items: stretch;
    margin-bottom: 20px;
}

.score-actions .btn {
    width: 100%;
}

.event-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.event-column {
    background: #f1f5f9;
    border-radius: 10px;
    padding: 16px;
    text-align: left;
}

.event-list {
    list-style: decimal inside;
    margin: 0;
    padding: 0;
}

.event-list li {
    margin-bottom: 8px;
}

.event-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
}

.event-row__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-row__actions {
    display: flex;
    gap: 6px;
}

.event-action {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.2s;
}

.event-action:hover {
    text-decoration: underline;
}

.event-action--danger {
    color: var(--danger-color);
}

.muted {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.attendance-summary {
    line-height: 1.5;
    text-align: left;
}

.history-grid {
    display: grid;
    gap: 16px;
}

@media (max-width: 768px) {
    .scoreboard {
        grid-template-columns: minmax(0, 1fr) minmax(90px, 0.6fr) minmax(0, 1fr);
        gap: 12px;
    }

    .scoreboard .team {
        padding: 14px 12px;
    }

    .scoreboard-center {
        gap: 8px;
    }

    .score {
        font-size: 2.5rem;
    }
}

#sync-banner {
    display: none;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    box-shadow: var(--shadow);
}

#sync-banner.sync-info {
    background: #e0f2fe;
    color: #0c4a6e;
}

#sync-banner.sync-success {
    background: #dcfce7;
    color: #166534;
}

#sync-banner.sync-error {
    background: #fee2e2;
    color: #991b1b;
}

#sync-banner.sync-warning {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 768px) {
    .score-actions {
        grid-template-columns: 1fr;
    }
}

.stats-card {
    text-align: left;
}

.stats-card h2 {
    text-align: left;
    margin-bottom: 16px;
}

.stats-card .stats-section {
    margin: 0;
}

.stats-card .stats-section + .stats-section {
    margin-top: 28px;
}

.division-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.division-chip {
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--card-background);
    color: var(--secondary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.division-chip:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
}

.division-chip.is-active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow);
}

.division-chip.is-active:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.stats-table-container {
    margin-top: 12px;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-background);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

.stats-table col.stats-team-column {
    width: 38%;
}

.stats-table col.stats-metric-column {
    width: calc(62% / 7);
}

.stats-table--players col.stats-player-column {
    width: 35%;
}

.stats-table--players col.stats-player-metric-column {
    width: calc(65% / 7);
}

.stats-table thead {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-table thead th {
    vertical-align: bottom;
}

.stats-sort-button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stats-sort-button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.stats-table thead th:not(:first-child) .stats-sort-button {
    flex-direction: column;
    gap: 6px;
}

.stats-sort-button .stats-sort-indicator {
    font-size: 0.75em;
}

.stats-sort-button.is-active .stats-sort-indicator {
    color: var(--primary-color);
}

.stats-table thead th:not(:first-child) {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    padding: 12px 4px;
    line-height: 1.1;
}

.stats-table th,
.stats-table td {
    padding: 10px 6px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.stats-table th:first-child,
.stats-table td:first-child {
    text-align: left;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
    padding: 10px 3px 10px 6px;
}

.stats-table tbody th {
    font-weight: 600;
}

@media (max-width: 480px) {
    .stats-table {
        font-size: 0.8rem;
    }

    .stats-table th,
    .stats-table td {
        padding: 8px 4px;
    }

    .stats-table thead th:not(:first-child) {
        padding: 10px 2px;
    }

    .stats-table col.stats-team-column {
        width: 42%;
    }

    .stats-table--players col.stats-player-column {
        width: 55%;
    }
}

.stats-table tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.12);
}

.stats-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.15);
}

.traffic-table thead th {
    vertical-align: bottom;
}

.traffic-table thead th:not(:first-child) {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    padding: 12px 4px;
    line-height: 1.1;
}

@media (max-width: 480px) {
    .traffic-table thead th:not(:first-child) {
        padding: 10px 2px;
    }
}

.stats-player-name {
    display: block;
}

.stats-player-team {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.empty-state {
    padding: 24px 16px;
    text-align: center;
    color: var(--secondary-color);
    font-weight: 500;
}

.stats-table-hint {
    margin: 12px 0 6px;
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-align: left;
}

tbody .stats-player-row {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

tbody .stats-player-row:hover {
    background: rgba(37, 99, 235, 0.15);
    transform: translateX(2px);
}

tbody .stats-player-row:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    background: rgba(37, 99, 235, 0.15);
}

.stats-flyout[hidden] {
    display: none;
}

.stats-flyout {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(15, 23, 42, 0.55);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.stats-flyout.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.stats-flyout__panel {
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    max-width: 640px;
    width: 100%;
    max-height: calc(100vh - 48px);
    padding: 28px;
    padding-bottom: 36px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.stats-flyout__header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.stats-flyout__header--team {
    align-items: flex-start;
}

.stats-flyout__title-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
}

.stats-flyout__team-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
}

.stats-flyout__division-badge {
    font-size: 0.95rem;
    color: var(--secondary-color);
    white-space: nowrap;
    text-align: center;
}

.stats-flyout__header h3 {
    flex: 1;
    text-align: center;
    margin: 0;
}

.stats-flyout__close {
    margin-top: 16px;

    border: none;
    background: transparent;
    color: var(--secondary-color);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    transition: color 0.2s ease;
}

.stats-flyout__close:hover,
.stats-flyout__close:focus-visible {
    color: var(--primary-color);
}

.stats-flyout__subtitle {
    margin-bottom: 16px;
    color: var(--secondary-color);
    font-size: 0.9rem;
    text-align: center;
}


.stats-flyout__content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.stats-flyout__content--team {
    flex: 1 1 auto;
    align-items: flex-start;
    justify-content: center;
}

.stats-flyout__chart-group {
    flex: 1 1 360px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-flyout__chart-group .stats-flyout__legend {
    margin-bottom: 12px;
}

.stats-flyout__chart-group .stats-flyout__chart {
    margin-bottom: 16px;
}

.stats-flyout__content--team .stats-flyout__insights {
    flex: 0 1 320px;
    min-width: 240px;
    font-size: 0.82rem;
    line-height: 1.35;
    margin: 16px auto 0;
}

@media (max-width: 768px) {
    .stats-flyout__content {
    flex: 1 1 auto;
        flex-direction: column;
    }

    .stats-flyout__content--team .stats-flyout__insights {
        flex-basis: auto;
    }
}
.stats-flyout__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    justify-content: center;
}

.stats-flyout__insights {
    margin-bottom: 24px;
    text-align: center;
}

.stats-flyout__insight-group {
    margin-bottom: 16px;
}

.stats-flyout__insight-group:last-child {
    margin-bottom: 0;
}

.stats-flyout__insight-group h4 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
}


.stats-flyout__insight-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.stats-flyout__player-link,
.stats-flyout__team-link {
    border: none;
    background: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.stats-flyout__player-link:hover,
.stats-flyout__player-link:focus-visible,
.stats-flyout__team-link:hover,
.stats-flyout__team-link:focus-visible {
    text-decoration: underline;
}

.stats-flyout__player-link:focus-visible,
.stats-flyout__team-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.stats-flyout__insight-list--bulleted {
    list-style: disc;
    padding-left: 1.2rem;
    text-align: left;
    margin: 0 auto;
}

.stats-flyout__insight-list--bulleted > li {
    margin: 0 0 6px;
    font-size: 0.95rem;
    color: var(--text-color);
}

.stats-flyout__insight-list--bulleted > li:last-child {
    margin-bottom: 0;
}

.stats-flyout__insight-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.stats-flyout__insight-item:last-child {
    margin-bottom: 0;
}

.stats-flyout__insight-name {
    font-weight: 500;
    color: var(--text-color);
}

.stats-flyout__insight-value {
    color: var(--secondary-color);
    font-weight: 500;
}

.stats-flyout__insight-empty {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.stats-flyout__insight-columns {
    display: grid;
    gap: 32px;
    justify-content: center;
    justify-items: center;
}

.stats-flyout__insight-columns--dual {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    column-gap: 64px;
}

.stats-flyout__insight-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    text-align: center;
    width: 100%;
}


.stats-flyout__insight-group--totals {
    margin-top: 16px;
    text-align: center;
}

.stats-flyout__insight-group--totals h4 {
    margin: 0 0 6px;
    text-align: center;
}

.stats-flyout__summary--totals {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.stats-flyout__insight-group h4 {
    margin-bottom: 6px;
    font-size: 1.1rem;
    font-weight: 600;
}

@media (max-width: 720px) {
    .stats-flyout__insight-columns--dual {
        grid-template-columns: 1fr;
    }
}

.stats-flyout__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.stats-flyout__legend-item::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: currentColor;
    display: inline-block;
}

.stats-flyout__legend-item--points::before {
    background: var(--primary-color);
}

.stats-flyout__legend-item--goals::before {
    background: var(--success-color);
}

.stats-flyout__legend-item--assists::before {
    background: var(--warning-color);
}

.stats-flyout__chart {
    width: 100%;
    margin-bottom: 20px;
}

.stats-chart__wrapper {
    width: 100%;
}

.stats-chart__svg {
    width: 100%;
    height: auto;
}

.stats-chart__line {
    fill: none;
    stroke-width: 2.5;
}

.stats-chart__line--points {
    stroke: var(--primary-color);
}

.stats-chart__line--goals {
    stroke: var(--success-color);
}

.stats-chart__line--assists {
    stroke: var(--warning-color);
}

.stats-chart__marker {
    stroke: #ffffff;
    stroke-width: 1.5;
}

.stats-chart__marker--points {
    fill: var(--primary-color);
}

.stats-chart__marker--goals {
    fill: var(--success-color);
}

.stats-chart__marker--assists {
    fill: var(--warning-color);
}

.stats-chart__axis-line {
    stroke: var(--border-color);
    stroke-width: 1.2;
}

.stats-chart__grid-line {
    stroke: rgba(148, 163, 184, 0.35);
    stroke-width: 1;
}

.stats-chart__tick-line {
    stroke: var(--border-color);
    stroke-width: 1;
}

.stats-chart__tick-label {
    fill: var(--secondary-color);
    font-size: 0.7rem;
    text-anchor: middle;
}

.stats-chart__tick-label--y {
    text-anchor: end;
}

.stats-flyout__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
    text-align: center;
}

.stats-flyout__summary--highlights {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 640px) {
    .stats-flyout__summary--highlights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.stats-flyout__summary dt {
    font-size: 0.75rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
}

.stats-flyout__summary dd {
    margin: 4px 0 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
}

.stats-flyout__action {
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content;
}

@media (max-width: 640px) {
    .stats-flyout {
        padding: 12px;
        align-items: flex-start;
    }

    .stats-flyout__panel {
    display: flex;
    flex-direction: column;
        padding: 20px;
        padding-bottom: 32px;
        max-height: calc(100vh - 24px);
    }
}
/* Rink Report */
.report-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}

.report-subtitle {
    text-align: center;
    color: var(--secondary-color);
}

.report-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.report-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.report-action-btn {
    padding: 10px 18px;
    border-radius: 9999px;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.report-action-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.report-action-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.report-filter,
.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.report-filter__btn,
.report-tab__btn {
    padding: 10px 18px;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-filter__btn.is-active,
.report-tab__btn.is-active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.report-filter__btn:hover,
.report-tab__btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.report-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.report-select {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.report-select select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    font-size: 0.95rem;
    color: var(--text-color);
}

.report-status {
    text-align: center;
    color: var(--secondary-color);
    min-height: 1.2em;
}

.report-status--info {
    color: var(--secondary-color);
}

.report-status--success {
    color: var(--success-color);
}

.report-status--error {
    color: var(--danger-color);
}

.report-card {
    text-align: left;
}

.report-lede {
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: var(--secondary-color);
}
.report-lede p {
    margin: 0 0 0.75rem;
    line-height: 1.6;
    white-space: pre-line;
}

[data-narrative-key] {
    white-space: pre-line;
}

.report-lede ul {
    margin: 0 0 0.75rem 1.2rem;
    padding: 0;
    list-style: disc;
}

.report-lede li {
    margin: 0.35rem 0;
    color: var(--text-color);
    line-height: 1.5;
}


.narrative-list {
    margin: 0 0 0.75rem 1.2rem;
    padding: 0;
    list-style: disc;
}

.narrative-list li {
    margin: 0.35rem 0;
    color: var(--text-color);
    line-height: 1.5;
}

.report-lede .narrative-subhead {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
}

.narrative-meta {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.narrative-note {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-color);
    line-height: 1.5;
}


.report-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 20px;
}

.report-metrics div {
    background: var(--background-color);
    border-radius: 12px;
    padding: 12px 18px;
    min-width: 120px;
    text-align: center;
}

.report-metrics span {
    display: block;
    font-size: 0.75rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-metrics strong {
    display: block;
    font-size: 1.3rem;
    color: var(--text-color);
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.report-game {
    background: var(--background-color);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.report-game header h3 {
    font-size: 1.05rem;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.report-game header p {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.report-game p {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.report-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.report-timeline li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.report-timeline li div {
    flex: 1;
}

.report-timeline li p {
    margin: 0;
    color: var(--text-color);
    line-height: 1.4;
}

.report-timeline__time {
    font-weight: 600;
    color: var(--text-color);
}

.report-timeline__score {
    display: inline-block;
    margin-top: 4px;
    font-weight: 600;
    color: var(--primary-color);
}

.report-timeline--full li {
    align-items: flex-start;
    flex-wrap: wrap;
}

.report-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.report-summary div {
    min-width: 120px;
    background: var(--background-color);
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.report-summary span {
    display: block;
    font-size: 0.75rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.report-summary strong {
    display: block;
    font-size: 1.2rem;
    color: var(--text-color);
}

.report-table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.report-table th,
.report-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.report-table th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
}

.report-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.report-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.report-list li {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.report-list span {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.report-list__meta {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.report-list__note {
    color: var(--secondary-color);
    font-size: 0.8rem;
}

@media (max-width: 540px) {
    .report-metrics {
        flex-direction: column;
        align-items: stretch;
    }

    .report-summary {
        flex-direction: column;
        align-items: stretch;
    }
}


.report-callouts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.report-callout {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-callout strong {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
}

.report-callout span {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.4;
}

.report-panel {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
    margin: 16px 0;
}

.report-panel h4 {
    margin: 0 0 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
}

.report-panel .report-note {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.report-list--dense {
    list-style: none;
    padding: 0;
    margin: 0;
}

.report-list--dense li {
    margin: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.report-list--dense span {
    color: var(--secondary-color);
}

.report-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.report-chart {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
}

.report-chart h3,
.report-chart h4 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
}

.report-chart--bars .chart-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.chart-bar span {
    width: 80px;
    font-weight: 600;
    font-size: 0.85rem;
}

.chart-bar__track {
    position: relative;
    flex: 1;
    height: 10px;
    background-color: rgba(37, 99, 235, 0.12);
    border-radius: 999px;
    overflow: hidden;
}

.chart-bar__fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background-image: linear-gradient(90deg, rgba(37, 99, 235, 0.9), rgba(16, 185, 129, 0.9));
    border-radius: inherit;
}

.chart-bar__track strong {
    position: absolute;
    right: 6px;
    top: -20px;
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.report-game__meta {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.matchup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.matchup-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matchup-card header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.matchup-card__summary {
    margin: 0;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.matchup-card .report-list--dense li {
    font-size: 0.85rem;
}

.report-columns.season-columns {
    margin-bottom: 12px;
}
/* Admin dashboard layout */
.admin-dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-dashboard__description {
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.admin-kpi {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-kpi__label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--secondary-color);
    letter-spacing: 0.06em;
}

.admin-kpi__value {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1;
}

.admin-kpi__hint {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.admin-visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.admin-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-card__header {
    padding: 20px 24px 0;
}

.admin-card__header h2 {
    margin-bottom: 6px;
    color: var(--primary-color);
}

.admin-card__subtitle {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.admin-card__body {
    padding: 24px;
}

.admin-chart svg {
    width: 100%;
    height: auto;
}

.admin-chart__grid line {
    stroke: rgba(148, 163, 184, 0.22);
}

.admin-chart__tick-label {
    fill: var(--secondary-color);
    font-size: 12px;
}

.admin-chart__tick--x text {
    text-anchor: middle;
    fill: var(--secondary-color);
    font-size: 12px;
}

.admin-chart__tick--x line {
    stroke: var(--border-color);
}

.admin-chart__area {
    fill: rgba(37, 99, 235, 0.15);
}

.admin-chart__line {
    fill: none;
    stroke-width: 2.5;
}

.admin-chart__line--games {
    stroke: var(--primary-color);
}

.admin-chart__line--events {
    stroke: var(--warning-color);
}

.admin-chart__legend {
    margin-top: 12px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.legend-dot {
    display: inline-flex;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.legend-dot--games {
    background: var(--primary-color);
}

.legend-dot--events {
    background: var(--warning-color);
}

.admin-event-mix {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-event-mix__bar {
    height: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.25);
    display: flex;
}

.admin-event-mix__segment {
    display: block;
}

.admin-event-mix__segment--goals {
    background: var(--primary-color);
}

.admin-event-mix__segment--penalties {
    background: var(--warning-color);
}

.admin-event-mix__legend {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.admin-event-mix__legend div {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-event-mix__legend dt {
    font-weight: 600;
    display: flex;
    gap: 6px;
    align-items: center;
}

.admin-event-mix__legend dd {
    margin: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.admin-table thead th {
    text-align: left;
    padding-bottom: 12px;
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-table tbody td {
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-empty {
    text-align: center;
    color: var(--secondary-color);
    padding: 12px 0;
    font-style: italic;
}

.admin-dashboard__timestamp {
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.85rem;
    margin-top: -8px;
}

@media (max-width: 768px) {
    .admin-card__header {
        padding: 16px 20px 0;
    }

    .admin-card__body {
        padding: 20px;
    }

    .admin-chart__legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.stats-chart__wrapper > .stats-flyout__summary {
    margin-bottom: 16px;
}

.stats-chart__wrapper > .stats-flyout__legend {
    margin-top: 12px;
    justify-content: center;
}
.admin-chart__legend--dual {
    justify-content: center;
}

.admin-home {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.admin-home__card {
    max-width: 480px;
    width: 100%;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow);
}

.admin-home__card h1 {
    margin-bottom: 8px;
}

.admin-home__card p {
    color: var(--secondary-color);
    margin-bottom: 24px;
}

.admin-home__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-home__actions .btn {
    font-size: 1rem;
    padding: 12px 18px;
}

.admin-visual-grid--single {
    grid-template-columns: minmax(260px, 1fr);
}

.admin-card__body--split {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.admin-metrics div {
    text-align: center;
}

.admin-metrics dt {
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-metrics dd {
    margin: 6px 0 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
}

.admin-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.admin-lists h3 {
    margin-bottom: 8px;
    font-size: 1rem;
}

.admin-lists ol {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.admin-lists li span {
    margin-left: 6px;
    color: var(--secondary-color);
}

.admin-distribution {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-distribution__row {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 12px;
    align-items: center;
}

.admin-distribution__label {
    font-weight: 600;
    color: var(--text-color);
}

.admin-distribution__bar {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    overflow: hidden;
    height: 10px;
}

.admin-distribution__bar span {
    display: block;
    height: 100%;
    background: var(--primary-color);
}

.admin-distribution__stats {
    display: grid;
    grid-auto-flow: column;
    gap: 12px;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.admin-card-grid {
    display: grid;
    gap: 16px;
}

.admin-card--summary .admin-card__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 640px) {
    .admin-distribution__row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .admin-distribution__stats {
        justify-content: flex-start;
    }
}

.admin-session-summary {
    display: grid;
    gap: 24px;
}

.admin-session-summary__active {
    display: grid;
    gap: 12px;
}

.admin-session-summary__active h3 {
    font-size: 1rem;
    color: var(--text-color);
}

.admin-entry-exit {
    display: grid;
    gap: 20px;
}

.admin-leaderboard {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.admin-leaderboard li {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
}

.admin-visitor-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    align-items: baseline;
    font-weight: 500;
}

.admin-visitor-row code {
    background: rgba(148, 163, 184, 0.18);
    color: var(--primary-color);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.85rem;
}

.admin-visitor-row span {
    color: var(--secondary-color);
    font-weight: 400;
}

.admin-journey {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.admin-journey__row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: flex-start;
}

.admin-journey__step {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.14);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.admin-journey__details {
    display: grid;
    gap: 4px;
}

.admin-journey__details strong {
    font-size: 1rem;
    color: var(--text-color);
}

.admin-journey__details span {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.admin-journey__details small {
    color: var(--secondary-color);
    font-size: 0.8rem;
}

.admin-journey__layout {
    display: grid;
    gap: 24px;
}

.admin-journey__summary {
    display: grid;
    gap: 16px;
}

.admin-journey__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.admin-journey__metrics dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--secondary-color);
    letter-spacing: 0.05em;
}

.admin-journey__metrics dd {
    margin: 4px 0 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.admin-journey__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.admin-journey__chart {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    padding: 20px;
    overflow-x: auto;
}

.admin-journey__chart h3 {
    margin-bottom: 16px;
    color: var(--text-color);
}

.admin-journey__chart canvas,
.admin-journey__chart svg {
    width: 100%;
}

.admin-sankey {
    width: 100%;
    height: auto;
}

.admin-sankey__link {
    fill: none;
    stroke: rgba(37, 99, 235, 0.35);
    stroke-width: 10;
    opacity: 0.85;
}

.admin-sankey__node {
    fill: var(--card-background);
    stroke: rgba(148, 163, 184, 0.6);
    stroke-width: 1;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.12));
}

.admin-sankey__label {
    font-size: 12px;
    fill: var(--text-color);
}

.admin-journey__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.admin-journey__controls label {
    font-weight: 600;
    color: var(--text-color);
}

.admin-journey__controls select {
    min-width: 220px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.admin-journey__empty {
    text-align: center;
    color: var(--secondary-color);
    padding: 20px 0;
}

@media (max-width: 768px) {
    .admin-journey__metrics {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .admin-journey__chart {
        padding: 16px;
    }
}

/* Admin share tools */
.admin-share {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.admin-share__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-share__header h1 {
  margin: 0;
}

.admin-share__hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted, #5c6470);
  max-width: 720px;
}

.admin-share__grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.admin-share__card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-share__card-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.admin-share__card-header p {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted, #5c6470);
}

.admin-share__frame {
  position: relative;
  width: 100%;
  border-radius: 12px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  padding: 0.75rem;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.admin-share__surface {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.18);
  transform-origin: top left;
}

.admin-share__surface > * {
  border-radius: 10px;
  overflow: hidden;
}

.admin-share__loading,
.admin-share__error {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 280px;
  font-size: 0.95rem;
  padding: 1rem;
}

.admin-share__loading {
  color: #475569;
}

.admin-share__error {
  color: #b91c1c;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 10px;
}

.admin-share__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-share__status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted, #5c6470);
}

.admin-share__status[data-variant='success'] {
  color: #047857;
}

.admin-share__status[data-variant='error'] {
  color: #b91c1c;
}

@media (max-width: 640px) {
  .admin-share__grid {
    grid-template-columns: 1fr;
  }
}
