:root {
    --green-dark: #1a5f2a;
    --green-mid: #2d8a42;
    --gold: #f5c518;
    --gold-dark: #d4a800;
}

body {
    background-color: #f0f4f0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold) !important;
    letter-spacing: 0.5px;
}

.navbar-brand span {
    color: white;
    font-weight: 400;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--green-dark) 0%, #1e7a35 50%, var(--green-dark) 100%);
    color: white;
    padding: 70px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "⚽";
    font-size: 280px;
    position: absolute;
    opacity: 0.07;
    right: 3%;
    top: -40px;
    transform: rotate(15deg);
    line-height: 1;
    pointer-events: none;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero h2 {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.9;
}

.btn-gold {
    background: var(--gold);
    color: #000;
    border: none;
    font-weight: 700;
    padding: 12px 36px;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: all 0.2s;
}

.btn-gold:hover {
    background: var(--gold-dark);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Cards */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card-header {
    border-radius: 14px 14px 0 0 !important;
    font-weight: 600;
}

.card-header.bg-success {
    background: linear-gradient(90deg, var(--green-dark), var(--green-mid)) !important;
}

.prize-card { transition: transform 0.2s, box-shadow 0.2s; }
.prize-card.gold  { border-top: 5px solid #FFD700; }
.prize-card.silver { border-top: 5px solid #C0C0C0; }
.prize-card.bronze { border-top: 5px solid #CD7F32; }

/* Team selector cards */
.team-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    margin: 3px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    transition: all 0.15s;
    user-select: none;
    font-size: 0.88rem;
    font-weight: 500;
}

.team-chip:hover:not(.disabled-chip) {
    border-color: var(--green-mid);
    background: #e8f5e9;
    color: var(--green-dark);
}

.team-chip.selected-chip {
    border-color: var(--green-dark);
    background: var(--green-dark);
    color: white;
}

.team-chip.disabled-chip {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8f9fa;
}

.team-chip input[type="checkbox"],
.team-chip input[type="radio"] {
    display: none;
}

/* Group card */
.group-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    background: white;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--green-dark);
    border-bottom: 2px solid #e8f5e9;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.group-label {
    width: 30px;
    height: 30px;
    background: var(--green-dark);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.group-counter {
    margin-left: auto;
    font-size: 0.8rem;
    color: #666;
    font-weight: 400;
}

/* Stage navigation */
.stage-nav .nav-link {
    color: var(--green-dark);
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.stage-nav .nav-link:hover {
    background: #e8f5e9;
    border-color: #dee2e6;
}

.stage-nav .nav-link.active {
    background: white;
    color: var(--green-dark);
    border-color: #dee2e6;
}

.stage-nav .nav-link .badge {
    font-size: 0.7rem;
}

.stage-pane {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0 12px 12px 12px;
    padding: 24px;
}

/* Selection counter badge */
.sel-counter {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* Leaderboard */
.leaderboard-table th {
    background: var(--green-dark);
    color: white;
    font-weight: 600;
    border: none;
}

.leaderboard-table tr:nth-child(1) td { background: #fffde7; }
.leaderboard-table tr:nth-child(2) td { background: #f5f5f5; }
.leaderboard-table tr:nth-child(3) td { background: #fbe9e7; }

.rank-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}
.rank-badge.r1 { background: #FFD700; color: #000; }
.rank-badge.r2 { background: #C0C0C0; color: #000; }
.rank-badge.r3 { background: #CD7F32; color: white; }
.rank-badge.rn { background: #6c757d; color: white; font-weight: 600; }

/* Admin sidebar layout */
.admin-layout { display: flex; min-height: calc(100vh - 56px); }

.admin-sidebar {
    width: 220px;
    background: var(--green-dark);
    flex-shrink: 0;
    padding: 20px 0;
}

.admin-sidebar .sidebar-title {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 20px 6px;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 10px 20px;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    transition: all 0.15s;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.12);
}

.admin-sidebar .nav-link i {
    width: 16px;
    text-align: center;
    opacity: 0.8;
}

.admin-content {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
}

/* Stat cards */
.stat-card {
    background: white;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--green-dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-top: 6px;
}

/* Progress for stages */
.stage-progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stage-progress-item:last-child { border-bottom: none; }

.stage-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stage-dot.done { background: #1a5f2a; }
.stage-dot.pending { background: #dee2e6; }

/* Deadline badge */
.deadline-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.88rem;
}

/* Footer */
footer {
    background: var(--green-dark);
    color: rgba(255,255,255,0.7);
    padding: 16px 0;
    text-align: center;
    font-size: 0.85rem;
    margin-top: auto;
}

/* Toast */
.save-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero::before { display: none; }
    .admin-sidebar { width: 60px; }
    .admin-sidebar .nav-link span,
    .admin-sidebar .sidebar-title { display: none; }
    .admin-content { padding: 16px; }
    .stage-nav .nav-link { padding: 8px 10px; font-size: 0.8rem; }
}
