/* =============================================================================
   PAGE : PODIUM — module de page (tokens de /style.css uniquement)
   ============================================================================= */
.podium-layout { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.pulse-anim { animation: podiumGlow 2.8s ease-in-out infinite; }
@keyframes podiumGlow { 50% { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--gold) 55%, transparent)); } }

/* Barre latérale */
.sidebar-games { display: flex; flex-direction: column; gap: var(--space-4); }
/* Barre latérale « collante » seulement sur les écrans assez hauts pour l'afficher en entier */
@media (min-width: 1101px) and (min-height: 940px) { .sidebar-games { position: sticky; top: calc(var(--header-h) + var(--gap)); } }
.sidebar-header-box { display: flex; align-items: center; gap: 12px; }
.sidebar-title { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--text); }
/* Menu « Édition » sur toute la largeur : jamais coupé, quelle que soit la largeur de la colonne */
.sidebar-year { min-width: 0; }
.sidebar-year .year-dropdown { width: 100%; min-width: 0; }
.sidebar-podium-logo { width: 56px; height: 56px; object-fit: contain; }
.games-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 2px; } /* liste complète, sans ascenseur interne (était coupée sur les écrans peu hauts) */
.loading-text { grid-column: 1 / -1; color: var(--text-3); text-align: center; padding: 16px; }
.sidebar-day-header { grid-column: 1 / -1; font-family: var(--font-display); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.sidebar-day-header::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sidebar-day-header:first-child { margin-top: 0; }
.game-logo-btn {
    aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 10px; cursor: pointer; min-width: 0; overflow: hidden;
    border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border);
    transition: transform var(--dur) var(--ease-spring), border-color var(--dur-fast), box-shadow var(--dur);
}
.game-logo-btn:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.game-logo-btn.active { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent), 0 10px 26px color-mix(in srgb, var(--gold) calc(25% * var(--glow-strength)), transparent); }
.sidebar-logo-img { max-width: 100%; max-height: 100%; object-fit: contain; }
:root[data-theme="light"] .game-logo-btn { background: #14151d; }

/* Scène */
.podium-main { overflow: hidden; }
.podium-banner-hero {
    position: relative; display: flex; align-items: center; gap: 18px; padding: 22px 26px;
    border-bottom: 1px solid var(--border);
    background: radial-gradient(600px 200px at 0% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 70%);
}
.logo-container-podium { width: 70px; height: 70px; flex-shrink: 0; display: grid; place-items: center; }
.main-podium-logo { width: 100%; height: 100%; object-fit: contain; transition: transform var(--dur) var(--ease-spring); }
.game-title-display { margin: 0; font-size: var(--fs-2xl); letter-spacing: .02em; }
.silver-metal-text { background: linear-gradient(180deg, var(--text) 30%, var(--text-3) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ===== Scène du podium — style 2027 (palette du logo : bleu globe, flamme orange/rouge, étoiles or) ===== */
.css-podium-container {
    --rise: 1;
    position: relative; isolation: isolate; overflow: hidden;
    display: grid; grid-template-columns: 1fr 1.14fr 1fr; align-items: end; gap: clamp(10px, 2vw, 26px);
    min-height: clamp(440px, 54vh, 620px); padding: 64px clamp(16px, 4vw, 60px) 0;
    background:
        radial-gradient(55% 60% at 50% 105%, color-mix(in srgb, var(--brand-blue) 16%, transparent), transparent 70%),
        radial-gradient(35% 40% at 50% 28%, color-mix(in srgb, var(--brand-gold) 9%, transparent), transparent 70%);
}
/* Attente : anneau tricolore à coupures (comme autour du logo de l'accueil) */
.podium-idle { position: absolute; inset: 0; display: grid; place-items: center; z-index: -1; pointer-events: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.podium-idle-ring {
    position: absolute; width: min(440px, 78%); aspect-ratio: 1; border-radius: 50%;
    background: conic-gradient(from 14deg,
        var(--brand-blue) 0 29%, transparent 29% 31.5%, var(--brand-orange) 31.5% 45%, transparent 45% 46.3%,
        var(--brand-red) 46.3% 53%, transparent 53% 58.5%, var(--brand-blue) 58.5% 81%, transparent 81% 82%,
        var(--brand-gold) 82% 85.5%, transparent 85.5% 89.5%, var(--brand-blue) 89.5% 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
    opacity: .55; animation: podiumSpin 40s linear infinite;
}
.podium-idle-ring.is-inner { width: min(300px, 54%); opacity: .3; animation-direction: reverse; animation-duration: 28s; }
@keyframes podiumSpin { to { transform: rotate(1turn); } }
.podium-hint {
    position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1; margin: 0; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-pill);
    background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    font-size: var(--fs-sm); color: var(--text-2); transition: opacity .4s;
}
.podium-hint i { color: var(--brand-orange); }
@media (max-width: 600px) { .podium-hint { white-space: normal; width: max-content; max-width: calc(100% - 24px); text-align: center; font-size: .78rem; } }
.animate-podium .podium-idle { opacity: .18; transform: scale(1.08); }
.animate-podium .podium-hint { opacity: 0; }
.podium-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--stripe); }

/* Marches */
.podium-step { --c: var(--silver); position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.step-1st { --c: var(--gold); }
.step-3rd { --c: var(--bronze); }
.step-bar {
    position: relative; width: 100%; overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex; justify-content: center; padding-top: 18px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--c) 30%, var(--surface-solid)) 0%, var(--surface-2) 75%);
    border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-bottom: 0;
    transform-origin: bottom; opacity: .45; transition: opacity .4s;
}
/* liseré de couleur en haut de chaque marche + reflet qui balaie la marche à l'apparition */
.step-bar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--c); }
.step-1st .step-bar::before { background: linear-gradient(90deg, var(--brand-gold), #ffe7a8, var(--brand-gold)); }
.step-bar::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%);
    transform: translateX(-120%);
}
.step-1st .step-bar { height: clamp(190px, 27vh, 300px); }
.step-2nd .step-bar { height: clamp(135px, 19vh, 215px); }
.step-3rd .step-bar { height: clamp(100px, 14vh, 165px); }
.step-rank { display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: .55; }
.step-medal {
    font-family: var(--font-display); font-style: italic; font-weight: 800; letter-spacing: -.03em;
    font-size: clamp(2.4rem, 1.8rem + 2.2vw, 4.4rem); line-height: 1; color: var(--c);
}
.step-medal sup { font-size: .38em; vertical-align: top; position: relative; top: .35em; margin-left: 2px; }
.step-rank i { font-size: clamp(1rem, .8rem + .8vw, 1.6rem); color: var(--gold); }
:root[data-theme="light"] .step-bar { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, #fff) 0%, var(--surface-2) 80%); }

/* Plaque du vainqueur */
.step-name-plate {
    position: relative; width: 100%; max-width: 260px; min-height: 76px; padding: 14px 12px 12px; border-radius: var(--radius-lg);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
    background: var(--surface-solid); border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    font-weight: 700; color: var(--text); overflow-wrap: anywhere; line-height: 1.25;
    opacity: 0; transform: translateY(16px);
}
.step-name-plate::before { content: ""; position: absolute; top: -1px; left: 18%; right: 18%; height: 3px; border-radius: 0 0 3px 3px; background: var(--c); }
.step-1st .step-name-plate { border-color: color-mix(in srgb, var(--gold) 55%, transparent); box-shadow: var(--shadow-md), 0 0 0 4px color-mix(in srgb, var(--gold) 12%, transparent); }

/* 3 étoiles du logo au-dessus du vainqueur */
.step-stars { display: flex; gap: 8px; align-items: flex-end; color: var(--brand-gold); height: 22px; }
.step-stars i { font-size: .9rem; opacity: 0; transform: scale(0) rotate(-60deg); filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--brand-gold) 60%, transparent)); }
.step-stars i:nth-child(2) { font-size: 1.25rem; transform-origin: center; }

/* Confettis aux couleurs du logo */
.podium-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.podium-confetti span {
    position: absolute; top: -14px; width: 8px; height: 13px; border-radius: 2px; opacity: 0;
    animation: confettiFall var(--d, 2.6s) cubic-bezier(.2,.6,.4,1) var(--delay, 0s) both;
}
@keyframes confettiFall {
    0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); }
    8% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(var(--x, 0px), 520px, 0) rotate(var(--r, 540deg)); }
}

/* ----- Révélation ----- */
.animate-podium .step-bar { opacity: 1; animation: riseUp .75s var(--ease-spring) both; }
.animate-podium .step-3rd .step-bar { animation-delay: .05s; }
.animate-podium .step-2nd .step-bar { animation-delay: .25s; }
.animate-podium .step-1st .step-bar { animation-delay: .45s; }
.animate-podium .step-bar::after { animation: sheen 1.1s ease-out both; }
.animate-podium .step-3rd .step-bar::after { animation-delay: .6s; }
.animate-podium .step-2nd .step-bar::after { animation-delay: .8s; }
.animate-podium .step-1st .step-bar::after { animation-delay: 1s; }
.animate-podium .step-rank { animation: rankIn .55s var(--ease-spring) both; }
.animate-podium .step-3rd .step-rank { animation-delay: .5s; }
.animate-podium .step-2nd .step-rank { animation-delay: .7s; }
.animate-podium .step-1st .step-rank { animation-delay: .95s; }
.animate-podium .step-name-plate { animation: plateIn .55s var(--ease-spring) both; }
.animate-podium .step-3rd .step-name-plate { animation-delay: .75s; }
.animate-podium .step-2nd .step-name-plate { animation-delay: .95s; }
.animate-podium .step-1st .step-name-plate { animation: plateIn .6s var(--ease-spring) 1.2s both, winnerGlow 3.2s ease-in-out 2s infinite; }
.animate-podium .step-stars i { animation: starPop .45s var(--ease-spring) both; }
.animate-podium .step-stars i:nth-child(1) { animation-delay: 1.55s; }
.animate-podium .step-stars i:nth-child(2) { animation-delay: 1.7s; }
.animate-podium .step-stars i:nth-child(3) { animation-delay: 1.85s; }
@keyframes riseUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sheen { to { transform: translateX(120%); } }
@keyframes rankIn { from { opacity: 0; transform: translateY(14px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes plateIn { from { opacity: 0; transform: translateY(20px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes starPop { 0% { opacity: 0; transform: scale(0) rotate(-60deg); } 70% { opacity: 1; transform: scale(1.3) rotate(8deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes winnerGlow { 50% { box-shadow: var(--shadow-md), 0 0 0 6px color-mix(in srgb, var(--gold) 18%, transparent), 0 0 34px color-mix(in srgb, var(--gold) 28%, transparent); } }

.podium-logo-container { width: 56px; height: 56px; border-radius: 16px; overflow: hidden; background: var(--surface-3); border: 2px solid var(--c); }
.step-1st .podium-logo-container { width: 66px; height: 66px; }
.podium-logo-img { width: 100%; height: 100%; object-fit: cover; }
.winner-name-text { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .01em; }
.step-1st .winner-name-text { font-size: 1.25rem; color: var(--gold); }
.cashprize-tag { font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.cashprize-amount { font-family: var(--font-display); font-style: italic; font-size: 1.35rem; color: var(--c); }

/* Bandeau : logo du jeu sélectionné */
.logo-container-podium { border-radius: 16px; transition: transform .45s var(--ease-spring); }
.logo-container-podium.has-game { width: 92px; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.logo-container-podium.is-swapping { transform: scale(.82) rotate(-4deg); }
.game-title-kicker { display: block; font-family: var(--font-body); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-orange); -webkit-text-fill-color: var(--brand-orange); }

@media (prefers-reduced-motion: reduce) {
    .podium-idle-ring, .podium-confetti span, .animate-podium .step-1st .step-name-plate { animation: none !important; }
    .animate-podium .step-bar, .animate-podium .step-rank, .animate-podium .step-name-plate, .animate-podium .step-stars i, .animate-podium .step-bar::after { animation-duration: .01s !important; animation-delay: 0s !important; }
}

@media (max-width: 1100px) {
    .podium-layout { grid-template-columns: minmax(0, 1fr); }
    .sidebar-games { position: static; }
    .games-list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: none; }
}
@media (max-width: 600px) {
    .css-podium-container { padding-inline: 10px; gap: 6px; }
    .step-name-plate { padding: 10px 6px 8px; min-height: 60px; font-size: .78rem; }
    .step-stars { height: 16px; gap: 4px; }
    .podium-logo-container, .step-1st .podium-logo-container { width: 42px; height: 42px; border-radius: 12px; }
    .winner-name-text { font-size: .8rem; }
    .step-1st .winner-name-text { font-size: .9rem; }
    .podium-logo-container { width: 38px; height: 38px; }
    .podium-banner-hero { padding: 16px; }
    .logo-container-podium { width: 48px; height: 48px; }
}
:root[data-theme="light"] .logo-container-podium.has-game { background: #14151d; }
