/* ===========================================
   OLYMPIC GAMES TRACKER - MAIN STYLESHEET
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --olympic-blue: #0085C7;
    --olympic-yellow: #F4C300;
    --olympic-black: #000000;
    --olympic-green: #009F3D;
    --olympic-red: #DF0024;
    
    --bg-dark: #020408;
    --bg-card: #0A0E17;
    --bg-card-hover: #111827;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --border-color: #374151;
    --gold: #FFD700;
    --silver: #C0C0C0;
    --bronze: #CD7F32;
    
    --gradient-gold: linear-gradient(135deg, #92700A 0%, #D4A832 30%, #F5D87A 50%, #C99A20 70%, #785E08 100%);
    --gradient-dark: linear-gradient(180deg, #020408 0%, #0A0E17 100%);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--gradient-dark);
    background-color: var(--bg-dark);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Confetti canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* ===========================================
   FULLSCREEN DISPLAY MODES
   =========================================== */

.fullscreen-mode {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    background: 
        radial-gradient(ellipse at top, rgba(0, 133, 199, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(223, 0, 36, 0.1) 0%, transparent 50%),
        var(--gradient-dark);
}

.mode-content {
    max-width: 1200px;
    width: 100%;
}

/* Countdown animated background */
.countdown-mode {
    background:
        radial-gradient(ellipse at 8% 40%, rgba(255, 140, 0, 0.10) 0%, transparent 40%),
        radial-gradient(ellipse at 92% 40%, rgba(255, 140, 0, 0.10) 0%, transparent 40%),
        radial-gradient(ellipse at top, rgba(0, 133, 199, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(223, 0, 36, 0.08) 0%, transparent 50%),
        var(--gradient-dark);
    overflow: hidden;
    position: relative;
}

.countdown-mode::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 8% 40%, rgba(255, 160, 20, 0.2) 0%, transparent 45%),
        radial-gradient(ellipse at 92% 40%, rgba(255, 160, 20, 0.2) 0%, transparent 45%);
    animation: bgGlow 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Torches - Olympic style */
.torch {
    position: absolute;
    bottom: 8%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.torch-left { left: 6%; }
.torch-right { right: 6%; }

/* Flared cup at the top */
.torch-cup {
    width: 52px;
    height: 36px;
    background: linear-gradient(180deg, #D4A832 0%, #A07B18 50%, #785E08 100%);
    clip-path: polygon(10% 100%, 0% 0%, 100% 0%, 90% 100%);
    position: relative;
    z-index: 2;
}

.torch-cup::after {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 4px;
    background: linear-gradient(90deg, #785E08, #F5D87A, #D4A832, #F5D87A, #785E08);
    border-radius: 2px;
}

/* Narrow neck below cup */
.torch-neck {
    width: 22px;
    height: 14px;
    background: linear-gradient(180deg, #A07B18 0%, #C99A20 50%, #8B6914 100%);
    border-radius: 0 0 2px 2px;
}

/* Main shaft - long taper */
.torch-shaft {
    width: 18px;
    height: 140px;
    background: linear-gradient(90deg, #6B5010 0%, #C99A20 30%, #F5D87A 50%, #C99A20 70%, #6B5010 100%);
    clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
}

/* Grip section with ridges */
.torch-grip {
    width: 22px;
    height: 50px;
    background: repeating-linear-gradient(
        180deg,
        #A07B18 0px,
        #D4A832 3px,
        #785E08 5px,
        #C99A20 7px,
        #A07B18 10px
    );
    border-radius: 2px;
}

/* Tapered base */
.torch-base {
    width: 16px;
    height: 20px;
    background: linear-gradient(90deg, #5C4409 0%, #A07B18 40%, #D4A832 50%, #A07B18 60%, #5C4409 100%);
    clip-path: polygon(10% 0%, 90% 0%, 70% 100%, 30% 100%);
    border-radius: 0 0 4px 4px;
}

/* Fire coming from the cup */
.torch-fire {
    position: relative;
    width: 40px;
    height: 70px;
    margin-bottom: -8px;
    z-index: 3;
}

.flame {
    position: absolute;
    bottom: 0;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    left: 50%;
    transform: translateX(-50%);
    transform-origin: bottom center;
}

.flame-1 {
    width: 28px;
    height: 55px;
    background: linear-gradient(0deg, #FF6600 0%, #FF9900 30%, #FFCC00 65%, #FFEE88 100%);
    animation: flicker1 0.4s ease-in-out infinite alternate;
    opacity: 0.95;
}

.flame-2 {
    width: 18px;
    height: 45px;
    background: linear-gradient(0deg, #FF4400 0%, #FF8800 40%, #FFBB33 100%);
    animation: flicker2 0.3s ease-in-out infinite alternate;
    opacity: 0.8;
    bottom: 2px;
}

.flame-3 {
    width: 12px;
    height: 60px;
    background: linear-gradient(0deg, #FF3300 0%, #FF6600 25%, #FFAA00 55%, #FFEE66 100%);
    animation: flicker3 0.5s ease-in-out infinite alternate;
    opacity: 0.9;
}

@keyframes flicker1 {
    0% { transform: translateX(-50%) scaleX(1) scaleY(1) rotate(-2deg); }
    100% { transform: translateX(-50%) scaleX(0.85) scaleY(1.12) rotate(2deg); }
}

@keyframes flicker2 {
    0% { transform: translateX(-50%) scaleX(1.1) scaleY(0.9) rotate(3deg); }
    100% { transform: translateX(-50%) scaleX(0.9) scaleY(1.15) rotate(-3deg); }
}

@keyframes flicker3 {
    0% { transform: translateX(-50%) scaleX(0.9) scaleY(1.05) rotate(-1deg); }
    100% { transform: translateX(-50%) scaleX(1.05) scaleY(0.9) rotate(2deg); }
}

.torch-glow {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(255, 150, 0, 0.35) 0%, rgba(255, 100, 0, 0.12) 35%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

@media (max-width: 768px) {
    .torch { display: none; }
}

.mega-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 12vw, 8rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(180deg, #FFF5C3 0%, #FFD700 25%, #B8860B 50%, #FFD700 75%, #FFF5C3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1;
    filter: drop-shadow(0 2px 0px rgba(180, 130, 20, 0.9)) drop-shadow(0 4px 2px rgba(0, 0, 0, 0.7)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5));
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* Olympic Rings */
.olympic-rings {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.olympic-rings.large {
    gap: 1rem;
    margin-bottom: 2rem;
}

.ring {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 4px solid;
    animation: ringPulse 3s ease-in-out infinite;
}

.olympic-rings.large .ring {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

.ring:nth-child(1) { border-color: var(--olympic-blue); animation-delay: 0s; }
.ring:nth-child(2) { border-color: var(--olympic-yellow); animation-delay: 0.2s; }
.ring:nth-child(3) { border-color: #444; animation-delay: 0.4s; }
.ring:nth-child(4) { border-color: var(--olympic-green); animation-delay: 0.6s; }
.ring:nth-child(5) { border-color: var(--olympic-red); animation-delay: 0.8s; }

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* ===========================================
   COUNTDOWN MODE
   =========================================== */

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.countdown-unit {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem 3rem;
    border: none;
    min-width: 150px;
    width: 200px;
    text-align: center;
}

.countdown-value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 5rem;
    line-height: 1;
    display: block;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.countdown-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 0.5rem;
    display: block;
}

.waiting-message {
    font-size: 1.5rem;
    color: var(--text-secondary);
    padding: 3rem;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px dashed var(--border-color);
}

/* ===========================================
   BREAK MODE
   =========================================== */

.break-mode .mode-content {
    max-width: 800px;
}

.break-icon {
    font-size: 6rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.break-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.timer-value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 10rem;
    line-height: 1;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.timer-separator {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 8rem;
    color: var(--gold);
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.timer-subtext {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* Mini Scoreboard */
.mini-scoreboard {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid var(--border-color);
}

.mini-scoreboard h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.mini-teams {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mini-team {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border-radius: 10px;
}

.mini-rank {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.25rem;
    width: 30px;
    text-align: center;
    color: var(--text-secondary);
}

.mini-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.mini-name {
    flex: 1;
    font-weight: 600;
    text-align: left;
}

.mini-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
}

/* ===========================================
   NEXT GAME MODE
   =========================================== */

.next-game-mode {
    background: 
        radial-gradient(ellipse at center, rgba(245, 158, 11, 0.2) 0%, transparent 60%),
        var(--gradient-dark);
}

.pre-announce {
    font-size: 2rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 1rem;
    animation: fadeInUp 0.5s ease-out;
}

.game-announce {
    animation: scaleIn 0.6s ease-out;
    color: var(--gold);
    -webkit-text-fill-color: var(--gold);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.game-decoration {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.deco-star {
    font-size: 3rem;
    color: var(--gold);
    animation: starPulse 1.5s ease-in-out infinite;
}

.deco-star:nth-child(2) { animation-delay: 0.3s; }
.deco-star:nth-child(3) { animation-delay: 0.6s; }

@keyframes starPulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 0.7; }
}

/* ===========================================
   FINAL EVENT MODE
   =========================================== */

.final-mode {
    background: 
        radial-gradient(ellipse at top, rgba(223, 0, 36, 0.2) 0%, transparent 50%),
        var(--gradient-dark);
}

.final-badge {
    display: inline-block;
    background: var(--olympic-red);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(223, 0, 36, 0.4); }
    50% { box-shadow: 0 0 0 20px rgba(223, 0, 36, 0); }
}

.final-question {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem 3rem;
    margin: 2rem auto;
    max-width: 800px;
    border: 2px solid var(--olympic-red);
    font-size: 1.5rem;
}

.final-answer {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem 3rem;
    margin: 2rem auto;
    max-width: 800px;
    border: 2px solid var(--olympic-green);
}

.final-answer h2 {
    color: var(--olympic-green);
    margin-bottom: 1rem;
}

.answer-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3rem;
    color: var(--gold);
}

.wager-status, .wager-results {
    margin-top: 3rem;
}

.wager-status h3, .wager-results h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.wager-teams, .wager-results {
    max-width: 600px;
    margin: 0 auto;
}

.wager-team, .result-team {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.wager-team.has-wager {
    border-color: var(--olympic-green);
    background: rgba(0, 159, 61, 0.1);
}

.wager-color, .result-color {
    width: 20px;
    height: 20px;
    border-radius: 6px;
}

.wager-name, .result-name {
    flex: 1;
    font-weight: 600;
    text-align: left;
}

.wager-points {
    color: var(--text-secondary);
}

.wager-status-icon {
    font-size: 0.875rem;
}

.result-team.correct {
    border-color: var(--olympic-green);
    background: rgba(0, 159, 61, 0.1);
}

.result-team.incorrect {
    border-color: var(--olympic-red);
    background: rgba(223, 0, 36, 0.1);
}

.result-wager {
    color: var(--text-secondary);
}

.result-change {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
}

.result-change.positive {
    color: var(--olympic-green);
}

.result-change.negative {
    color: var(--olympic-red);
}

/* ===========================================
   WINNER MODE
   =========================================== */

.winner-mode {
    background: 
        radial-gradient(ellipse at center, rgba(255, 215, 0, 0.2) 0%, transparent 60%),
        var(--gradient-dark);
    overflow: hidden;
}

.trophy {
    font-size: 8rem;
    margin-bottom: 1rem;
    animation: trophyBounce 1s ease-out;
}

@keyframes trophyBounce {
    0% { transform: scale(0) rotate(-20deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.winner-title {
    color: var(--gold);
    -webkit-text-fill-color: var(--gold);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
    50% { text-shadow: 0 0 60px rgba(255, 215, 0, 0.8), 0 0 100px rgba(255, 215, 0, 0.4); }
}

.winner-team {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem 4rem;
    display: inline-block;
    border: 3px solid var(--gold);
    margin: 2rem 0;
}

.winner-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4rem;
    color: var(--team-color, var(--gold));
    line-height: 1;
}

.winner-score {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.final-standings {
    margin-top: 3rem;
}

.final-standings h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.final-team {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 2rem;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.final-medal {
    font-size: 1.5rem;
    width: 40px;
}

.final-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.final-name {
    flex: 1;
    font-weight: 600;
    text-align: left;
}

.final-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
}

/* Confetti animation */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.confetti::before {
    content: '🎊 🎉 ⭐ 🎊 🎉 ⭐ 🎊 🎉';
    position: absolute;
    font-size: 2rem;
    animation: confettiFall 5s linear infinite;
    white-space: nowrap;
}

@keyframes confettiFall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===========================================
   LOGO MODE (Photo Ops)
   =========================================== */

.logo-mode {
    background: 
        radial-gradient(ellipse at center, rgba(255, 215, 0, 0.15) 0%, transparent 60%),
        var(--gradient-dark);
}

.logo-title {
    font-size: clamp(4rem, 15vw, 12rem);
    animation: logoShine 3s ease-in-out infinite;
}

@keyframes logoShine {
    0%, 100% { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6)) drop-shadow(0 1px 0px rgba(160, 120, 20, 0.8)) brightness(1); }
    50% { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)) drop-shadow(0 1px 0px rgba(200, 160, 40, 0.9)) brightness(1.1); }
}

.logo-decoration {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.logo-decoration .deco-star {
    font-size: 4rem;
    color: var(--gold);
    animation: starFloat 2s ease-in-out infinite;
}

.logo-decoration .deco-star:nth-child(1) { animation-delay: 0s; }
.logo-decoration .deco-star:nth-child(2) { animation-delay: 0.3s; }
.logo-decoration .deco-star:nth-child(3) { animation-delay: 0.6s; }

@keyframes starFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.1); }
}

/* ===========================================
   HEAD TO HEAD MODE
   =========================================== */

.h2h-mode {
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(0, 133, 199, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(223, 0, 36, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(255, 215, 0, 0.1) 0%, transparent 40%),
        var(--gradient-dark);
    overflow: hidden;
}

.h2h-mode::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.h2h-mode .mode-content {
    position: relative;
    z-index: 1;
}

.h2h-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 3rem;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
    animation: h2hTitlePulse 3s ease-in-out infinite;
}

@keyframes h2hTitlePulse {
    0%, 100% { text-shadow: 0 0 40px rgba(255, 215, 0, 0.3); }
    50% { text-shadow: 0 0 60px rgba(255, 215, 0, 0.5), 0 0 80px rgba(255, 215, 0, 0.2); }
}

.h2h-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.h2h-team {
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(17, 24, 39, 0.8) 100%);
    border-radius: 32px;
    padding: 3rem 2rem;
    text-align: center;
    border: 4px solid var(--team-color);
    box-shadow: 
        0 0 60px color-mix(in srgb, var(--team-color) 40%, transparent),
        inset 0 0 60px color-mix(in srgb, var(--team-color) 10%, transparent);
    position: relative;
    overflow: hidden;
    animation: h2hTeamFloat 4s ease-in-out infinite;
}

.h2h-team:first-of-type {
    animation-delay: 0s;
}

.h2h-team:last-of-type {
    animation-delay: 2s;
}

@keyframes h2hTeamFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.h2h-team::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        color-mix(in srgb, var(--team-color) 20%, transparent) 60deg,
        transparent 120deg
    );
    animation: h2hTeamRotate 8s linear infinite;
    z-index: -1;
}

@keyframes h2hTeamRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.h2h-team::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(17, 24, 39, 0.95) 100%);
    border-radius: 28px;
    z-index: -1;
}

.h2h-team-badge {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--team-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.5rem;
    color: white;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--team-color) 50%, transparent);
}

.h2h-team-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    letter-spacing: 0.08em;
    color: var(--team-color);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px color-mix(in srgb, var(--team-color) 30%, transparent);
}

.h2h-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(8rem, 20vw, 16rem);
    line-height: 0.9;
    color: var(--text-primary);
    text-shadow: 
        0 0 40px color-mix(in srgb, var(--team-color) 60%, transparent),
        0 0 80px color-mix(in srgb, var(--team-color) 30%, transparent);
    position: relative;
}

.h2h-score::after {
    content: 'PTS';
    display: block;
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.h2h-vs {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--gold);
    text-shadow: 
        0 0 30px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.3);
    position: relative;
    animation: h2hVsPulse 1.5s ease-in-out infinite;
}

@keyframes h2hVsPulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.3);
    }
    50% { 
        transform: scale(1.1);
        text-shadow: 0 0 50px rgba(255, 215, 0, 0.8), 0 0 100px rgba(255, 215, 0, 0.4);
    }
}

.h2h-vs::before,
.h2h-vs::after {
    content: '⚡';
    position: absolute;
    font-size: 2rem;
    top: 50%;
    transform: translateY(-50%);
    animation: h2hLightning 2s ease-in-out infinite;
}

.h2h-vs::before {
    left: -3rem;
    animation-delay: 0s;
}

.h2h-vs::after {
    right: -3rem;
    animation-delay: 1s;
}

@keyframes h2hLightning {
    0%, 100% { opacity: 0.3; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.2); }
}

/* Winner highlight when one team is ahead */
.h2h-team.winning {
    border-color: var(--gold);
    box-shadow: 
        0 0 80px rgba(255, 215, 0, 0.4),
        0 0 120px rgba(255, 215, 0, 0.2),
        inset 0 0 60px rgba(255, 215, 0, 0.1);
}

.h2h-team.winning::before {
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 215, 0, 0.3) 60deg,
        transparent 120deg
    );
}

@media (max-width: 900px) {
    .h2h-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .h2h-team {
        padding: 2rem 1.5rem;
    }
    
    .h2h-vs {
        padding: 1rem 0;
    }
    
    .h2h-vs::before,
    .h2h-vs::after {
        display: none;
    }
    
    .h2h-score::after {
        font-size: 1rem;
    }
}

/* ===========================================
   SCOREBOARD DISPLAY (TV VIEW)
   =========================================== */

.scoreboard-container {
    min-height: 100vh;
    padding: 2rem;
    background: 
        radial-gradient(ellipse at top, rgba(0, 133, 199, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(223, 0, 36, 0.08) 0%, transparent 50%),
        var(--gradient-dark);
}

.scoreboard-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    position: relative;
}

.scoreboard-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 4px;
    background: url('../gold-foil.jpg') center/cover;
    border-radius: 2px;
}

.site-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(180deg, #FFF5C3 0%, #FFD700 25%, #B8860B 50%, #FFD700 75%, #FFF5C3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 0px rgba(180, 130, 20, 0.9)) drop-shadow(0 4px 2px rgba(0, 0, 0, 0.7)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5));
}

/* Team Cards Grid */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.team-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardSlideIn 0.6s ease-out backwards;
}

.team-card:nth-child(1) { animation-delay: 0.1s; }
.team-card:nth-child(2) { animation-delay: 0.2s; }
.team-card:nth-child(3) { animation-delay: 0.3s; }
.team-card:nth-child(4) { animation-delay: 0.4s; }
.team-card:nth-child(5) { animation-delay: 0.5s; }
.team-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--team-color, var(--olympic-blue));
}

.team-card.rank-1 {
    border-color: var(--gold);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
}

.team-card.rank-2 {
    border-color: var(--silver);
    box-shadow: 0 0 30px rgba(192, 192, 192, 0.15);
}

.team-card.rank-3 {
    border-color: var(--bronze);
    box-shadow: 0 0 30px rgba(205, 127, 50, 0.15);
}

.team-rank {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    background: var(--bg-card-hover);
    border: 2px solid var(--border-color);
}

.rank-1 .team-rank {
    background: var(--gradient-gold);
    color: #000;
    border: none;
}

.rank-2 .team-rank {
    background: linear-gradient(135deg, #E8E8E8 0%, #A8A8A8 100%);
    color: #000;
    border: none;
}

.rank-3 .team-rank {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: #FFF;
    border: none;
}

.team-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.team-score-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 1rem;
}

.team-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4rem;
    line-height: 1;
    background: linear-gradient(135deg, var(--team-color, #FFF) 0%, var(--text-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.team-drinks {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* QR Footer (centered, legacy) */
.qr-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 12px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.qr-footer img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
}

.qr-footer span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* QR Corner (fixed bottom-right) */
.qr-corner {
    position: fixed;
    bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 12px;
    z-index: 100;
}

.qr-corner img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
}

.qr-corner span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    order: -1;
}

/* Live indicator */
.live-indicator {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 100px;
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.live-dot {
    width: 10px;
    height: 10px;
    background: var(--olympic-red);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ===========================================
   ADMIN PANEL STYLES
   =========================================== */

.admin-container {
    min-height: 100vh;
    padding: 1rem;
    padding-bottom: 5.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.admin-header {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0,133,199,0.08) 100%);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    border: 1px solid rgba(255,255,255,0.04);
}

.admin-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.admin-header-branding {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    min-width: 0;
}

.admin-site-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: var(--gold);
    white-space: nowrap;
}

.admin-header-divider {
    color: var(--border-color);
    display: none;
}

.admin-title {
    margin: 0;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-header-quicklinks {
    display: flex;
    align-items: end;
    gap: 0.4rem;
}

.admin-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-size: 0.68rem;
    text-decoration: none;
    transition: all 0.2s;
}

.admin-chip:hover {
    background: rgba(0,133,199,0.15);
    border-color: rgba(0,133,199,0.35);
    color: var(--text-primary);
}

.admin-nav {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.2s;
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.nav-btn.active {
    background: rgba(0,133,199,0.15);
    border-color: var(--olympic-blue);
    color: var(--olympic-blue);
}

.nav-btn.logout {
    background: transparent;
    border: 1px solid rgba(223,0,36,0.3);
    color: var(--olympic-red);
}

.nav-btn.logout:hover {
    background: var(--olympic-red);
    color: white;
}

@media (max-width: 768px) {
    .admin-nav { gap: 0.2rem; }
    .nav-btn { padding: 0.3rem 0.45rem; font-size: 0.65rem; border-radius: 6px; }
    .nav-btn i { display: none; }
    .admin-container { padding: 0.75rem; padding-bottom: 5rem; }
    .admin-header { padding: 0.9rem 1rem; margin-bottom: 1rem; }
    .admin-card { padding: 1rem; margin-bottom: 0.85rem; }
    .card-title { margin-bottom: 0.85rem; }
}

@media (max-width: 640px) {
    .admin-header-branding { gap: 0.18rem; }
    .admin-title { font-size: 1.2rem; }
    .admin-header-quicklinks { justify-content: flex-end; }
    .admin-chip { font-size: 0.64rem; padding: 0.26rem 0.5rem; }
}

/* Cards and Forms */
.admin-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.04);
    transition: border-color 0.2s;
}

.admin-card:hover {
    border-color: rgba(255,255,255,0.08);
}

.card-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.15rem;
}

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

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--olympic-blue);
    box-shadow: 0 0 0 3px rgba(0,133,199,0.15);
}

.form-input[type="color"] {
    height: 42px;
    padding: 0.2rem;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    text-decoration: none;
    min-height: 2.25rem;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: rgb(from var(--olympic-blue) r g b / 0.3);
    color: var(--olympic-bule);
    border: 1px solid rgb(from var(--olympic-blue) r g b / 0.4);
}

.btn-primary:hover {
    background: var(--olympic-blue);
    box-shadow: 0 4px 12px rgb(from var(--olympic-blue) r g b / 0.3);
}

.btn-success {
    background: rgb(from var(--olympic-green) r g b / 0.3);
    color: white;
    border: 1px solid rgb(from var(--olympic-green) r g b / 0.4);
}

.btn-success:hover {
    background: var(--olympic-green);
    box-shadow: 0 4px 12px rgb(from var(--olympic-green) r g b / 0.3);
}

.btn-danger {
    background: rgb(from var(--olympic-red) r g b / 0.15);
    color: var(--olympic-red);
    border: 1px solid rgb(from var(--olympic-red) r g b / 0.14);
}

.btn-danger:hover {
    background: var(--olympic-red);
    color: white;
}

.btn-warning {
    background: rgb(from var(--olympic-yellow) r g b / 0.15);
    color: var(--olympic-yellow);
    border: 1px solid rgb(from var(--olympic-yellow) r g b / 0.13);
}

.btn-warning:hover {
    background: var(--olympic-yellow);
    color: #000;
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.08);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 1rem 1.75rem;
    font-size: 1.1rem;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--bg-dark);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.team-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* Mobile table cards */
@media (max-width: 768px) {
    .data-table thead {
        display: none;
    }
    
    .data-table tbody tr {
        display: block;
        padding: 1rem;
        margin-bottom: 1rem;
        background: var(--bg-dark);
        border-radius: 12px;
        border: none;
    }
    
    .data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .data-table tbody td:last-child {
        border-bottom: none;
    }
    
    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
    }
}

/* Quick score entry */
.score-entry-grid {
    display: grid;
    gap: 0.5rem;
}

.score-entry-item {
    background: var(--bg-dark);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
}

.score-entry-item .team-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-entry-item .team-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    color: white;
}

.score-entry-item input[type="number"] {
    width: 80px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Alert messages */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: 0.85rem;
    animation: alertSlideIn 0.3s ease;
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(0, 159, 61, 0.1);
    border: 1px solid rgba(0, 159, 61, 0.3);
    color: #4ADE80;
}

.alert-error {
    background: rgba(223, 0, 36, 0.1);
    border: 1px solid rgba(223, 0, 36, 0.3);
    color: #F87171;
}

/* Display Mode Buttons */
.mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
}

.mode-btn {
    padding: 1rem 0.5rem;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.04);
    background: var(--bg-dark);
    color: var(--text-secondary);
    text-decoration: none;
}

.mode-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.1);
}

.mode-btn:active {
    transform: scale(0.96);
}

.mode-btn.active {
    border-color: var(--olympic-blue);
    background: rgb(from var(--olympic-blue) r g b / 0.1);
    color: var(--olympic-blue);
}

.mode-btn .icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.3rem;
}

.mode-btn .label {
    font-weight: 600;
    font-size: 0.75rem;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0 env(safe-area-inset-bottom, 0.25rem);
    z-index: 100;
    backdrop-filter: blur(12px);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.6rem;
    font-weight: 500;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.bottom-nav a:active {
    transform: scale(0.92);
}

.bottom-nav a.active {
    color: var(--olympic-blue);
}

.bottom-nav a svg {
    width: 24px;
    height: 24px;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(circle at top, rgba(0, 118, 200, 0.18), transparent 50%),
        radial-gradient(circle at 85% 15%, rgba(252, 177, 49, 0.12), transparent 35%),
        var(--bg-main);
}

.login-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(175deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border-radius: 20px;
    padding: 2.25rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 24px 70px rgba(0,0,0,0.52);
    backdrop-filter: blur(4px);
}

.login-card-glow {
    position: absolute;
    inset: -30% auto auto -30%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(0, 118, 200, 0.24), transparent 70%);
    pointer-events: none;
}

.login-card .olympic-rings {
    justify-content: center;
}

.login-site-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.75rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
    text-align: center;
}

.login-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.09em;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.login-pin-input {
    text-align: center;
    font-size: 2rem;
    letter-spacing: 0.5em;
    font-family: 'Bebas Neue', sans-serif;
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.18);
}

.login-submit {
    margin-top: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 118, 200, 0.32);
}

.login-back-link {
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.login-back-link:hover {
    opacity: 1;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Responsive */
@media (max-width: 640px) {
    .scoreboard-container {
        padding: 1rem;
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .team-card {
        padding: 1.5rem;
    }
    
    .team-score {
        font-size: 3rem;
    }
    
    .admin-nav {
        width: 100%;
    }
    
    .admin-nav .nav-btn {
        flex: 1;
        text-align: center;
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .countdown-unit {
        padding: 1.5rem 2rem;
        min-width: 100px;
        width: 140px;
    }
    
    .countdown-value {
        font-size: 3rem;
    }
    
    .timer-value {
        font-size: 6rem;
    }
    
    .timer-separator {
        font-size: 5rem;
    }
}

/* Score Update Animation */
@keyframes scoreUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: var(--gold); }
    100% { transform: scale(1); }
}

.score-updated {
    animation: scoreUpdate 0.5s ease-out;
}

/* ==================== PODIUM MODE ==================== */
.podium-mode {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
}

.podium-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.podium-medal {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: medalBounce 2s ease-in-out infinite;
}

@keyframes medalBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.podium-first .podium-medal {
    font-size: 5rem;
}

.podium-team-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.podium-first .podium-team-name {
    font-size: 2.5rem;
}

.podium-score {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.podium-block {
    width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3rem;
    color: rgba(255,255,255,0.3);
    border-radius: 8px 8px 0 0;
}

.podium-block-1 {
    height: 200px;
    background: linear-gradient(180deg, var(--gold) 0%, #b8860b 100%);
}

.podium-block-2 {
    height: 150px;
    background: linear-gradient(180deg, #c0c0c0 0%, #808080 100%);
}

.podium-block-3 {
    height: 100px;
    background: linear-gradient(180deg, #cd7f32 0%, #8b4513 100%);
}

.podium-others {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.podium-other-team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border-radius: 10px;
}

.podium-other-rank {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: var(--text-secondary);
    width: 30px;
}

.podium-other-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.podium-other-name {
    font-weight: 600;
    min-width: 100px;
}

.podium-other-score {
    color: var(--text-secondary);
}

/* ==================== BRACKET MODE ==================== */
.bracket-mode {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
    align-items: flex-start;
    overflow-y: auto;
}

.bracket-display {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 2rem;
    overflow-x: auto;
    overflow-y: visible;
    padding: 1rem;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 250px;
}

.bracket-round-title {
    text-align: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: var(--gold);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.bracket-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    gap: 1.5rem;
}

.bracket-match {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.bracket-match.final-match {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.bracket-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--team-color, #666);
    transition: background 0.3s ease;
}

.bracket-team:first-child {
    border-bottom: 1px solid var(--border-color);
}

.bracket-team.winner {
    background: rgba(34, 197, 94, 0.2);
}

.bracket-team.winner .bracket-team-name {
    font-weight: bold;
}

.bracket-team.bye {
    opacity: 0.5;
    border-left-color: var(--gold);
    background: rgba(234, 179, 8, 0.1);
}

.bracket-team.bye .bracket-team-name {
    font-style: italic;
    color: var(--gold);
}

.bracket-team.tbd {
    opacity: 0.6;
    border-left-color: #666;
}

.bracket-team.tbd .bracket-team-name {
    font-style: italic;
    color: var(--text-secondary);
}

.bracket-match.bye-match {
    border: 1px dashed var(--gold);
}

.bracket-team-name {
    font-size: 1.1rem;
}

.bracket-team-placement {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    min-width: 54px;
    text-align: right;
    color: var(--gold);
    letter-spacing: 0.03em;
}

/* Responsive Bracket */
@media (max-width: 900px) {
    .bracket-display {
        flex-direction: column;
        align-items: center;
    }
    
    .bracket-round {
        width: 100%;
        max-width: 350px;
    }
    
    .bracket-matches {
        gap: 1rem;
    }
}

/* Responsive Podium */
@media (max-width: 640px) {
    .podium-container {
        gap: 0.5rem;
    }
    
    .podium-block {
        width: 100px;
    }
    
    .podium-block-1 { height: 150px; }
    .podium-block-2 { height: 110px; }
    .podium-block-3 { height: 70px; }
    
    .podium-medal { font-size: 2.5rem; }
    .podium-first .podium-medal { font-size: 3rem; }
    .podium-team-name { font-size: 1.25rem; }
    .podium-first .podium-team-name { font-size: 1.5rem; }
    .podium-score { font-size: 1rem; }
}

/* ==================== SCORE ANIMATIONS ==================== */
.score-animating {
    transition: transform 0.1s ease, text-shadow 0.3s ease;
}

.score-increase {
    color: var(--olympic-green) !important;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
    transform: scale(1.1);
}

.score-decrease {
    color: var(--olympic-red) !important;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    transform: scale(0.95);
}

@keyframes scorePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.score-pulse {
    animation: scorePulse 0.5s ease-out;
}

/* ===========================================
   WEATHER DISPLAY (fixed bottom-left)
   =========================================== */

.weather-corner {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(17, 24, 39, 0.9);
    border-radius: 12px;
    z-index: 100;
    font-size: 1rem;
    color: var(--text-secondary);
}

.weather-corner .weather-icon {
    font-size: 1.25rem;
}

.weather-corner .weather-temp {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Boxicons alignment helpers */
.card-title .bx,
.admin-title .bx,
.nav-btn .bx,
.btn .bx {
    vertical-align: middle;
    line-height: 1;
}

.card-title .bx {
    font-size: 1.1rem;
    margin-right: 0.25rem;
}

.mode-btn .icon .bx {
    font-size: 2rem;
}


/* ===== CEREMONY ANIMATIONS ===== */
.ceremony-stage {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}
.ceremony-stage.active {
    opacity: 1;
    pointer-events: auto;
}

.ceremony-fadein {
    opacity: 0;
    transform: translateY(30px);
    animation: ceremonyFadeIn 1s ease forwards;
}
.ceremony-delay-1 { animation-delay: 0.4s; }
.ceremony-delay-2 { animation-delay: 0.8s; }
.ceremony-delay-3 { animation-delay: 1.2s; }

@keyframes ceremonyFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.ceremony-reveal {
    opacity: 0;
    transform: scale(0.7);
    animation: ceremonyReveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
}

@keyframes ceremonyReveal {
    to { opacity: 1; transform: scale(1); }
}

.ceremony-champion .champion-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, var(--team-color, var(--gold)) 0%, transparent 70%);
    opacity: 0;
    animation: championGlow 2s ease-in 0.5s forwards;
    z-index: 1;
}

@keyframes championGlow {
    0% { opacity: 0; width: 100px; height: 100px; }
    50% { opacity: 0.3; }
    100% { opacity: 0.15; width: 600px; height: 600px; }
}

.ceremony-champion {
    position: relative;
}

#ceremony-container {
    background: #020408;
    position: relative;
    min-height: 100vh;
    width: 100%;
}

#ceremony-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center, rgba(0,133,199,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.ceremony-stage > div {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
}

/* === UTILITY CLASSES (replacing inline styles) === */
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:0.5rem; }
.grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:0.5rem; }
.grid-5 { display:grid; grid-template-columns:repeat(5,1fr); gap:0.5rem; }
.flex-between { display:flex; justify-content:space-between; align-items:center; }
.flex-center { display:flex; align-items:center; justify-content:center; }
.flex-col-center { display:flex; flex-direction:column; align-items:center; }
.flex-gap { display:flex; gap:0.5rem; align-items:center; }
.flex-wrap { display:flex; flex-wrap:wrap; gap:0.5rem; }
.text-sm { font-size:0.8rem; }
.text-xs { font-size:0.65rem; }
.text-lg { font-size:1.1rem; }
.text-gold { color:var(--gold); }
.text-green { color:var(--olympic-green); }
.text-red { color:var(--olympic-red); }
.text-blue { color:var(--olympic-blue); }
.bg-dark { background:var(--bg-dark); }
.rounded { border-radius:8px; }
.rounded-lg { border-radius:12px; }
.p-sm { padding:0.5rem; }
.p-md { padding:0.75rem; }
.p-lg { padding:1rem; }
.px-md { padding-left:0.75rem; padding-right:0.75rem; }
.py-sm { padding-top:0.4rem; padding-bottom:0.4rem; }
.m-0 { margin:0; }
.mb-sm { margin-bottom:0.4rem; }
.mb-md { margin-bottom:0.75rem; }
.mt-sm { margin-top:0.4rem; }
.mt-md { margin-top:0.75rem; }
.w-full { width:100%; }
.font-bebas { font-family:'Bebas Neue',sans-serif; }
.font-bold { font-weight:600; }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.opacity-40 { opacity:0.4; }
.opacity-80 { opacity:0.8; }
.clickable { cursor:pointer; }
.no-margin .form-group { margin:0; }

/* Portal schedule utility classes */
.portal-section-title { font-family:'Bebas Neue',sans-serif; font-size:1.1rem; margin-bottom:0.75rem; }
.schedule-row { display:flex; align-items:center; gap:0.5rem; padding:0.4rem 0; }
.schedule-row.scored { opacity:0.4; }
.schedule-row.clickable { cursor:pointer; }
.schedule-row.clickable:active { opacity:0.7; }
.schedule-time { font-size:0.8rem; min-width:45px; color:var(--text-secondary); }
.schedule-name { flex:1; font-size:0.9rem; }
.schedule-name.done { text-decoration:line-through; }
.schedule-info { color:var(--text-secondary); font-size:0.75rem; }

/* Team color bar utility */
.team-color-bar { border-left:4px solid var(--team-color); }
.team-dot { width:12px; height:12px; border-radius:50%; flex-shrink:0; }

/* === Final Scoreboard / Leaderboard Card Styles === */
.fs-team {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.25rem 1.5rem; background: var(--bg-card);
    border-radius: 14px; margin-bottom: 0.75rem;
    opacity: 0; transform: translateX(-30px);
    animation: fsSlideIn 0.6s ease forwards;
}
@keyframes fsSlideIn { to { opacity: 1; transform: translateX(0); } }
.fs-rank { font-family:'Bebas Neue',sans-serif; font-size:1.75rem; color:var(--text-secondary); width:2.5rem; text-align:center; flex-shrink:0; }
.fs-team:nth-child(1) .fs-rank { color:var(--gold); }
.fs-team:nth-child(2) .fs-rank { color:#C0C0C0; }
.fs-team:nth-child(3) .fs-rank { color:#CD7F32; }
.fs-color { width:8px; height:40px; border-radius:4px; flex-shrink:0; }
.fs-name { flex:1; font-family:'Bebas Neue',sans-serif; font-size:1.5rem; letter-spacing:0.03em; }
.fs-total { font-family:'Bebas Neue',sans-serif; font-size:2rem; flex-shrink:0; }
.fs-delta { font-family:'Bebas Neue',sans-serif; font-size:1.25rem; padding:0.3rem 0.75rem; border-radius:8px; min-width:70px; text-align:center; opacity:0; animation:fsDeltaPop 0.5s ease forwards; animation-delay:1.5s; }
.fs-delta.positive { background:rgba(0,159,61,0.15); color:#4ADE80; border:1px solid rgba(0,159,61,0.3); }
.fs-delta.negative { background:rgba(223,0,36,0.15); color:#F87171; border:1px solid rgba(223,0,36,0.3); }
@keyframes fsDeltaPop { 0%{opacity:0;transform:scale(0.5)} 50%{transform:scale(1.2)} 100%{opacity:1;transform:scale(1)} }
