/* ========================================
   SECTIONS DE TEMPS
   ======================================== */
.time-section {
    margin-bottom: 40px;
    padding: 0 0 15px 0;
}

.time-section:last-child {
    margin-bottom: 0;
}

.time-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-title iconify-icon {
    font-size: 1.2em;
    color: var(--primary);
}

body.dark-mode .time-title {
    color: var(--text-light);
}

/* (styles de grille déplacés vers game-cards.css pour éviter les conflits) */

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Onglets au-dessus des sections */
.time-tabs { display: flex; gap: 10px; align-items: center; margin: 0; position: relative; min-height: 40px; }

/* Piste et sprite décoratifs (runner pixel) */
.time-tabs-runner-track {
    position: relative;
    flex: 1 1 auto; /* occupe tout l'espace restant après les onglets */
    height: 40px; /* centrage vertical aligné sur la hauteur des onglets */
    margin-left: 8px; /* léger espace après le dernier onglet */
    overflow: hidden; /* clippe le sprite dans la piste */
    pointer-events: none; /* pure décoratif */
}

.runner-sprite {
    position: absolute;
    left: -80px; /* part juste après le dernier onglet (piste relative) */
    top: 50%;
    transform: translateY(-50%);
    width: 80px; /* largeur sprite */
    height: 40px; /* hauteur sprite alignée sur la ligne */
    image-rendering: pixelated;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: 0.95;
    will-change: left, opacity;
}

/* Sprite sources */
.runner-sprite.mario { background-image: image-set(url('../img/mario_pixel.webp') type('image/webp'), url('../img/mario_pixel.gif') type('image/gif')); width: 80px; height: 40px; left: -80px; animation: runnerMarioCycle 10s linear infinite; }
.runner-sprite.sonic { background-image: image-set(url('../img/sonic_pixel.webp') type('image/webp'), url('../img/sonic_pixel.gif') type('image/gif')); width: 80px; height: 40px; left: -80px; animation: runnerSonicCycle 10s linear infinite; }

/* Cycle total 10s: 0–60% Mario traverse, 60–100% Sonic traverse */
@keyframes runnerMarioCycle {
    0% { left: -80px; opacity: 1; }
    59.999% { left: calc(100% + 80px); opacity: 1; } /* Mario prend 60% du cycle → plus lent */
    60% { left: -80px; opacity: 0; }
    100% { left: -80px; opacity: 0; }
}

@keyframes runnerSonicCycle {
    0% { left: -80px; opacity: 0; }
    59.999% { left: -80px; opacity: 0; }
    60% { left: -80px; opacity: 1; }
    100% { left: calc(100% + 80px); opacity: 1; } /* Sonic ne prend que 40% → plus rapide */
}

.time-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
    border: 1px solid rgba(var(--primary-rgb), 0.25); /* liseret gris/teinte comme le menu */
    background: rgba(var(--primary-rgb), 0.10);
    backdrop-filter: var(--glass-backdrop-medium);
    -webkit-backdrop-filter: var(--glass-backdrop-medium);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal) var(--transition-easing);
}

.time-tab iconify-icon { font-size: 1.05rem; color: #fff; }

/* Variantes légères par onglet (discrètes) */
.time-tab[data-target="yesterdaySection"] { border-color: rgba(var(--primary-rgb), 0.25); }
.time-tab[data-target="todaySection"] { border-color: rgba(var(--primary-rgb), 0.35); background: rgba(var(--primary-rgb), 0.12); }
.time-tab[data-target="upcomingSection"] { border-color: rgba(var(--primary-rgb), 0.25); }

.time-tab::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow) ease;
    pointer-events: none;
}
.time-tab:hover::before { left: 100%; }

.time-tab:hover {
    background: rgba(var(--primary-rgb), 0.14);
    border-color: rgba(var(--primary-rgb), 0.45);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.22);
}

.time-tab.active {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.22), rgba(var(--primary-rgb), 0.34));
    border-color: rgba(var(--primary-rgb), 0.6);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.35);
    transform: translateY(-2px);
    color: #fff;
}

.time-tab.active:hover {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.35), rgba(var(--primary-rgb), 0.45));
    box-shadow: 
        0 10px 30px rgba(var(--primary-rgb), 0.5),
        0 0 0 1px rgba(var(--primary-rgb), 0.8);
    transform: translateY(-3px);
}

/* Ancien mode onglets retiré */
@media (max-width: 768px) {
    .time-section {
        margin-bottom: 30px;
        padding: 20px 0;
    }
    .time-tabs { flex-wrap: wrap; gap: 8px; }
    .time-tab { height: 36px; padding: 0 14px; font-size: 13px; }
    
    .time-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .games-grid {
        margin-top: 15px;
    }
}

@media (max-width: 576px) {
    .time-section {
        margin-bottom: 25px;
        padding: 15px 0;
    }
    
    .time-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .games-grid {
        margin-top: 12px;
    }
} 

/* Masquer les icônes/titres internes pour que les boutons d’onglet les remplacent visuellement */
/* Nettoyage des styles liés aux en-têtes repliables */

/* Piste principale pour Mario/Sonic entre le menu et les cartes de jeux */
.main-runner-track {
    position: relative;
    height: var(--section-gap); /* assure le même écart que bannière ↔ menu */
    margin: 0;
    overflow: visible; /* éviter la coupe du sprite */
    pointer-events: none;
    z-index: 20; /* au-dessus des game cards (z<=10), en-dessous du menu (1000) et des modales (>=1100) */
}

/* Surcharge dédiée aux sprites dans la piste principale */
.main-runner-track .runner-sprite {
    position: absolute;
    top: 100%; /* base collée au haut des game cards */
    transform: translateY(calc(-100% + 20px));
    width: 120px; /* taille doublée */
    height: 52px; /* taille doublée (≈ 2× 26px) */
    image-rendering: pixelated;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: 0.95;
    will-change: left, opacity;
    left: -120px;
    z-index: 21; /* juste au-dessus des cartes */
}

.main-runner-track .runner-sprite.mario {
    background-image: image-set(url('../img/mario_pixel.webp') type('image/webp'), url('../img/mario_pixel.gif') type('image/gif'));
    /* augmentation 10% */
    width: calc(120px * 1.1); /* 132px */
    height: calc(52px * 1.1); /* 57.2px */
    left: calc(-120px * 1.1); /* -132px */
    animation: runnerMarioCycleLarge 12s linear infinite; /* ralenti + largeur 132px */
}

.main-runner-track .runner-sprite.sonic {
    background-image: image-set(url('../img/sonic_pixel.webp') type('image/webp'), url('../img/sonic_pixel.gif') type('image/gif'));
    /* réduction 10% */
    width: calc(120px * 0.9);
    height: calc(52px * 0.9);
    left: calc(-120px * 0.9);
    animation: runnerSonicCycleSmall 10s linear infinite;
}

@keyframes runnerMarioCycle {
    0% { left: -120px; opacity: 1; }
    59.999% { left: calc(100% + 120px); opacity: 1; }
    60% { left: -120px; opacity: 0; }
    100% { left: -120px; opacity: 0; }
}

@keyframes runnerSonicCycle {
    0% { left: -120px; opacity: 0; }
    59.999% { left: -120px; opacity: 0; }
    60% { left: -120px; opacity: 1; }
    100% { left: calc(100% + 120px); opacity: 1; }
}

/* Variante pour Sonic avec taille réduite (108px ≈ 120px * 0.9) */
@keyframes runnerSonicCycleSmall {
    0% { left: -108px; opacity: 0; }
    59.999% { left: -108px; opacity: 0; }
    60% { left: -108px; opacity: 1; }
    100% { left: calc(100% + 108px); opacity: 1; }
}

/* Variante pour Mario avec taille réduite (108px ≈ 120px * 0.9) */
@keyframes runnerMarioCycleSmall {
    0% { left: -108px; opacity: 1; }
    59.999% { left: calc(100% + 108px); opacity: 1; }
    60% { left: -108px; opacity: 0; }
    100% { left: -108px; opacity: 0; }
}

/* Variante pour Mario avec taille augmentée (132px ≈ 120px * 1.1) */
@keyframes runnerMarioCycleLarge {
    0% { left: -132px; opacity: 1; }
    59.999% { left: calc(100% + 132px); opacity: 1; }
    60% { left: -132px; opacity: 0; }
    100% { left: -132px; opacity: 0; }
}

/* Sprites additionnels */
.main-runner-track .runner-sprite.yoshi {
    background-image: image-set(url('../img/yoshi_pixel.webp') type('image/webp'), url('../img/yoshi_pixel.gif') type('image/gif'));
    width: calc(120px * 1.2); /* 144px */
    height: calc(52px * 1.2); /* 62.4px */
    left: calc(-120px * 1.2); /* -144px */
    animation: runnerYoshiSequence60 60s linear infinite;
}

.main-runner-track .runner-sprite.link {
    background-image: url('../img/link_pixel.webp');
    width: calc(120px * 0.9);
    height: calc(52px * 0.9);
    left: calc(-120px * 0.9);
    animation: runnerLinkCycle 10s linear infinite;
}

.main-runner-track .runner-sprite.metal {
    background-image: url('../img/metal_pixel.webp');
    width: calc(120px * 1.1); /* 132px */
    height: calc(52px * 1.1); /* 57.2px */
    left: calc(-120px * 1.1); /* -132px */
    animation: runnerMetalSequence60 60s linear infinite;
}

.main-runner-track .runner-sprite.fleur {
    background-image: url('../img/fleur_pixel.webp');
    width: calc(120px * 0.9);
    height: calc(52px * 0.9);
    left: calc(-120px * 0.9);
    animation: runnerFleurCycle 10s linear infinite;
}

/* Séquence unique: un seul sprite visible à la fois (60s = 6 x 10s) */
.main-runner-track .runner-sprite { opacity: 0; animation-delay: 0s; }

/* Mario: 0%–16.666% (10s) */
.main-runner-track .runner-sprite.mario { animation: runnerMarioSequence60 60s linear infinite; }
@keyframes runnerMarioSequence60 {
    0% { left: -132px; opacity: 1; }
    16.666% { left: calc(100% + 132px); opacity: 1; }
    16.667% { left: -132px; opacity: 0; }
    100% { left: -132px; opacity: 0; }
}

/* Sonic: 16.666%–33.333% (10s) */
.main-runner-track .runner-sprite.sonic { animation: runnerSonicSequence60 60s linear infinite; }
@keyframes runnerSonicSequence60 {
    0% { left: -108px; opacity: 0; }
    16.666% { left: -108px; opacity: 0; }
    16.667% { left: -108px; opacity: 1; }
    33.333% { left: calc(100% + 108px); opacity: 1; }
    33.334% { left: -108px; opacity: 0; }
    100% { left: -108px; opacity: 0; }
}

/* Yoshi: 33.333%–50% (10s) */
.main-runner-track .runner-sprite.yoshi { animation: runnerYoshiSequence60 60s linear infinite; }
@keyframes runnerYoshiSequence60 {
    0% { left: -144px; opacity: 0; }
    33.333% { left: -144px; opacity: 0; }
    33.334% { left: -144px; opacity: 1; }
    50% { left: calc(100% + 144px); opacity: 1; }
    50.001% { left: -144px; opacity: 0; }
    100% { left: -144px; opacity: 0; }
}

/* Link: 50%–66.666% (10s) */
.main-runner-track .runner-sprite.link { animation: runnerLinkSequence60 60s linear infinite; }
@keyframes runnerLinkSequence60 {
    0% { left: -108px; opacity: 0; }
    50% { left: -108px; opacity: 0; }
    50.001% { left: -108px; opacity: 1; }
    66.666% { left: calc(100% + 108px); opacity: 1; }
    66.667% { left: -108px; opacity: 0; }
    100% { left: -108px; opacity: 0; }
}

/* Metal: 66.666%–83.333% (10s) */
.main-runner-track .runner-sprite.metal { animation: runnerMetalSequence60 60s linear infinite; }
@keyframes runnerMetalSequence60 {
    0% { left: -132px; opacity: 0; }
    66.666% { left: -132px; opacity: 0; }
    66.667% { left: -132px; opacity: 1; }
    83.333% { left: calc(100% + 132px); opacity: 1; }
    83.334% { left: -132px; opacity: 0; }
    100% { left: -132px; opacity: 0; }
}

/* Fleur: 83.333%–100% (10s) */
.main-runner-track .runner-sprite.fleur { animation: runnerFleurSequence60 60s linear infinite; }
@keyframes runnerFleurSequence60 {
    0% { left: -108px; opacity: 0; }
    83.333% { left: -108px; opacity: 0; }
    83.334% { left: -108px; opacity: 1; }
    100% { left: calc(100% + 108px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .runner-sprite,
    .main-runner-track .runner-sprite {
        animation: none;
        transition: none;
    }
}
