:root {
    --riks: #f5c000;
    --riks-text: #c49a00;      /* darker gold — readable on white */
    --riks-dark: #a07e00;
    --wades: #1a4d23;
    --wades-light: #2a6b35;
    --wades-dark: #112f16;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    line-height: 1.5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* Nav */
.main-nav {
    background: var(--wades);
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-brand { color: var(--riks); text-decoration: none; font-weight: bold; font-size: 1.1rem; }
.nav-links a { color: #c8e6c9; text-decoration: none; margin-left: 1rem; font-size: 0.9rem; }
.nav-links a:hover { color: var(--riks); }

.admin-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--wades);
}
.admin-nav a { text-decoration: none; color: var(--wades); font-weight: 600; font-size: 0.9rem; }
.admin-nav a:hover { color: var(--wades-light); }

/* Headings */
h1 { margin: 1rem 0 0.75rem; font-size: 1.5rem; }
h2 { margin: 1.25rem 0 0.5rem; font-size: 1.2rem; }

/* Forms */
form label { display: block; margin-top: 0.75rem; font-weight: 600; font-size: 0.9rem; }
form input, form select, form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 0.25rem;
}
form input:focus, form select:focus, form textarea:focus {
    outline: 2px solid var(--wades-light);
    border-color: var(--wades);
}
form fieldset { border: 1px solid #ddd; padding: 0.75rem; margin-top: 0.75rem; border-radius: 4px; }
form fieldset legend { font-weight: 600; font-size: 0.9rem; }
button {
    margin-top: 1rem;
    padding: 0.6rem 1.5rem;
    background: var(--wades);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}
button:hover { background: var(--wades-light); }
button:disabled { background: #9ca3af; cursor: not-allowed; }

.big-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.25rem;
    font-weight: bold;
    margin-top: 1rem;
}

.byob-button {
    background: var(--riks-text);
}
.byob-button:hover { background: var(--riks-dark); }

/* Alerts */
.alert { padding: 0.75rem; border-radius: 4px; margin-bottom: 1rem; }
.alert-success { background: #d6f0da; color: var(--wades-dark); border-left: 4px solid var(--wades); }
.alert-error { background: #fee2e2; color: #991b1b; }

/* Scores */
.score-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0;
}
.team-score { text-align: center; }
.team-score h2 { margin: 0; font-size: 1.1rem; }
.score { font-size: 2.5rem; font-weight: bold; }
.vs { font-size: 1.2rem; color: #666; }
.team-1 { color: var(--riks-text); }
.team-2 { color: var(--wades); }

/* Progress bars */
.keg-bars { margin: 0.5rem 0; }
.keg-bar-group { margin: 0.5rem 0; }
.keg-bar-group label { font-size: 0.85rem; }
.progress-bar {
    height: 1.25rem;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.25rem;
}
.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
    min-width: 2px;
}
.progress-fill.team-1 { background: var(--riks); }
.progress-fill.team-2 { background: var(--wades); }

/* Events */
.event-list { display: flex; flex-direction: column; gap: 0.5rem; }
.event-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border-radius: 4px;
    border-left: 4px solid #e5e7eb;
}
.event-card.status-completed { border-left-color: var(--wades); }
.event-card.status-in_progress { border-left-color: var(--riks); }
.event-card.status-pending { border-left-color: #e5e7eb; }
.event-name { font-weight: 600; }
.event-status { font-size: 0.8rem; color: #666; }
.event-scores { font-size: 0.9rem; }
.event-scores span { margin-left: 0.5rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.5rem; text-align: left; border-bottom: 1px solid #e5e7eb; font-size: 0.9rem; }
th { font-weight: 600; background: #f0f7f1; color: var(--wades-dark); }
.data-table { margin: 0.5rem 0; }
.leaderboard td:last-child, .leaderboard th:last-child { text-align: right; }

/* Beer stats */
.brew-stats { background: #faf7e6; padding: 0.75rem; border-radius: 4px; margin-top: 0.75rem; border-left: 3px solid var(--riks); }
.brew-stats p { margin: 0.25rem 0; }
.keg-summary { display: flex; gap: 1.5rem; margin: 0.5rem 0; }

/* Inline forms */
.inline-form { display: inline; }
.inline-form select { width: auto; margin: 0; }
.save-btn {
    margin: 0;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}
.finalize-btn { background: var(--wades); margin-top: 1rem; }
.finalize-btn:hover { background: var(--wades-light); }
.undo-btn {
    margin: 0;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    background: #ef4444;
}
.undo-btn:hover { background: #dc2626; }
.form-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.form-row input[type="text"], .form-row input[type="number"], .form-row select { width: auto; flex: 1; min-width: 120px; }
.checkbox-label { display: inline-flex !important; align-items: center; gap: 0.25rem; font-size: 0.85rem; white-space: nowrap; }
.checkbox-label input[type="checkbox"] { width: auto; margin: 0; }
.form-row button { margin-top: 0; }
.add-person-form { margin: 0.5rem 0 1rem; }

/* Hints */
.hint { font-size: 0.8rem; color: #666; margin-top: 0.5rem; font-style: italic; }

/* TV Layout */
.tv-layout { padding: 2rem; max-width: none; }
.tv-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-bottom: 2rem;
}
.tv-team { text-align: center; }
.tv-team h1 { font-size: 3rem; margin: 0; }
.tv-score { font-size: 5rem; font-weight: bold; }
.tv-vs { font-size: 2rem; color: #666; }
.tv-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
}
.tv-keg h2, .tv-events h2, .tv-leaderboard h2 { margin-top: 0; }

@media (max-width: 768px) {
    .tv-body { grid-template-columns: 1fr; }
    .tv-team h1 { font-size: 2rem; }
    .tv-score { font-size: 3rem; }
}

/* Admin team roster */
.roster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.roster-team {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.75rem 1rem;
}
.roster-team h3 { margin: 0 0 0.5rem; }
.roster-team ul { margin: 0; padding-left: 1.2rem; }
.roster-status {
    color: #888;
    font-size: 0.8rem;
    margin-left: 0.4rem;
}

/* Event Banner */
.event-banner {
    background: linear-gradient(135deg, var(--wades-dark) 0%, var(--wades) 50%, var(--wades-dark) 100%);
    padding: 1.1rem 1rem;
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--riks);
    display: grid;
    place-items: center;
}

.event-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% -20%, rgba(245, 192, 0, 0.15) 0%, transparent 65%);
    pointer-events: none;
}

.banner-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
}

.banner-text {
    font-family: 'Pacifico', cursive;
    font-size: clamp(1.4rem, 4.5vw, 2.4rem);
    background: linear-gradient(90deg, var(--riks-dark) 0%, var(--riks) 30%, #fde68a 50%, var(--riks) 70%, var(--riks-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 250% auto;
    animation: banner-shimmer 5s linear infinite;
    filter: drop-shadow(0 0 14px rgba(245, 192, 0, 0.4));
    display: inline-block;
    line-height: 1.2;
}

.banner-deco {
    color: var(--riks);
    font-size: 1rem;
    opacity: 0.7;
    animation: banner-pulse 3s ease-in-out infinite;
    flex-shrink: 0;
}

.page-dashboard .banner-text {
    font-size: clamp(2rem, 7vw, 3.6rem);
}

.page-dashboard .event-banner {
    padding: 1.6rem 1rem;
}

@keyframes banner-shimmer {
    from { background-position: 250% center; }
    to   { background-position: -250% center; }
}

@keyframes banner-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%       { opacity: 0.9; transform: scale(1.2); }
}

/* Dashboard stat blocks */
.total-beers-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 1rem 0.75rem;
    text-align: center;
}
.total-beers-count {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    color: #1a1a1a;
}
.total-beers-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-top: 0.25rem;
}

.team-stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0.75rem 0;
}
.team-stat-card {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    text-align: center;
}
.team-1-card {
    background: var(--riks);
    color: var(--wades);
}
.team-2-card {
    background: var(--wades);
    color: var(--riks);
}
.team-stat-name {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
}
.team-stat-value {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0.1rem 0;
}
.team-stat-sub {
    font-size: 0.75rem;
    opacity: 0.75;
}

/* Centered dashboard section headers */
.page-dashboard h2 { text-align: center; }

/* Dashboard section cards */
.dash-section {
    border-radius: 8px;
    padding: 0.85rem 1rem 1rem;
    margin: 0.65rem 0;
    border-top: 3px solid transparent;
}
.dash-section--gold {
    background: #fffbea;
    border-top-color: var(--riks);
}
.dash-section--green {
    background: #f0f7f1;
    border-top-color: var(--wades);
}

/* Points progress bars */
.points-bars {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.75rem 0;
}
.points-bar-group {}
.points-bar-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #444;
    margin-bottom: 0.2rem;
}
.points-bar-track {
    position: relative;
    height: 2.75rem;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}
.points-bar-fill {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    max-width: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.team-1-fill { background: var(--riks); }
.team-2-fill { background: var(--wades); }
.points-bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #1a1a1a;
    z-index: 2;
    pointer-events: none;
    text-shadow: 0 0 6px rgba(255,255,255,0.6);
}

/* Score input groups on events page */
.score-inputs {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
}
.score-input-group label { font-weight: 600; }
.score-input { width: 6rem !important; font-size: 1.1rem; }
.form-group { margin-top: 1rem; }
