/* ========================================
   GAMES PAGE - Catalogue de jeux
   Mini-jeux pour enfants
   ======================================== */

.games-page {
    min-height: 100vh;
    padding: var(--space-4);
    padding-bottom: calc(80px + var(--space-6));
    background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
                radial-gradient(ellipse at 20% 60%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
}

/* ========== CATALOGUE DES JEUX ========== */
.games-catalog {
    max-width: 1000px;
    margin: var(--space-6) auto;
}

.games-catalog.hidden {
    display: none;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-5);
}

/* Carte du catalogue */
.catalog-card {
    position: relative;
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.catalog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -15px rgba(139, 92, 246, 0.4);
}

.catalog-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 215, 0, 0.2) 60deg,
        rgba(139, 92, 246, 0.2) 120deg,
        rgba(236, 72, 153, 0.2) 180deg,
        rgba(59, 130, 246, 0.2) 240deg,
        transparent 360deg
    );
    animation: glow-rotate 10s linear infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.catalog-card:hover .catalog-card-glow {
    opacity: 1;
}

.catalog-card-badge {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    padding: var(--space-1) var(--space-2);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.8) 0%, rgba(236, 72, 153, 0.8) 100%);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.catalog-card-icon {
    display: flex;
    gap: var(--space-2);
    font-size: 3rem;
    margin: var(--space-2) 0;
}

.catalog-card-icon span {
    animation: float-gentle 3s ease-in-out infinite;
}

.catalog-card-icon span:last-child {
    animation-delay: 0.5s;
}

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

.catalog-card-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.catalog-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.catalog-card-meta {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: center;
}

.meta-tag {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.meta-tag i {
    font-size: 0.65rem;
}

.catalog-card-score {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 215, 0, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    color: #FFD700;
}

.catalog-card-score i {
    font-size: 0.9rem;
}

.catalog-play-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: var(--space-2);
}

.catalog-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.5);
}

/* Carte "Bientôt" */
.catalog-card-coming {
    opacity: 0.6;
    cursor: default;
}

.catalog-card-coming:hover {
    transform: none;
    box-shadow: none;
}

.catalog-card-icon-coming {
    opacity: 0.5;
    filter: grayscale(50%);
}

.catalog-card-icon-coming span {
    animation: none;
}

.catalog-card-coming-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: var(--space-2);
}

/* ========== CONTENEUR DE JEU ========== */
.game-container {
    max-width: 1000px;
    margin: 0 auto;
}

.game-container.hidden {
    display: none;
}

/* Bouton retour */
.back-to-catalog-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: var(--space-4);
}

.back-to-catalog-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.back-to-catalog-btn i {
    font-size: 0.8rem;
}

/* Mode plein écran */
#games-view.fullscreen-mode {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    overflow: auto;
}

#games-view.fullscreen-mode .games-page {
    padding-bottom: var(--space-4);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#games-view.fullscreen-mode .game-play-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

#games-view.fullscreen-mode .game-area-container {
    flex: 1;
}

#games-view.fullscreen-mode .game-area {
    height: calc(100vh - 180px);
}

#games-view.fullscreen-mode .page-header {
    display: none;
}

/* Header spécial jeux avec emojis */
.games-header .page-header__title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.games-header .title-emoji {
    font-size: 1.2em;
    animation: bounce-gentle 2s ease-in-out infinite;
}

.games-header .title-emoji:last-child {
    animation-delay: 0.5s;
}

@keyframes bounce-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Grid d'intro */
.games-grid,
.games-grid-coop {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-5);
    max-width: 900px;
    margin: var(--space-6) auto;
}

@media (max-width: 768px) {
    .games-grid,
    .games-grid-coop {
        grid-template-columns: 1fr;
    }
}

/* Icon coop avec 2 emojis */
.game-icon-coop {
    display: flex;
    gap: var(--space-2);
}

.game-icon-coop .game-icon-emoji {
    animation: none;
}

.game-icon-coop .game-icon-emoji:first-child {
    animation: float-left 2s ease-in-out infinite;
}

.game-icon-coop .game-icon-emoji:last-child {
    animation: float-right 2s ease-in-out infinite;
}

@keyframes float-left {
    0%, 100% { transform: translateX(0) rotate(-5deg); }
    50% { transform: translateX(-5px) rotate(5deg); }
}

@keyframes float-right {
    0%, 100% { transform: translateX(0) rotate(5deg); }
    50% { transform: translateX(5px) rotate(-5deg); }
}

/* Info des contrôles joueurs */
.players-controls-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-5) 0;
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
}

.player-avatar {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px currentColor);
}

.player1-control .player-avatar {
    color: #FFD700;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
}

.player2-control .player-avatar {
    color: #FF6B9D;
    filter: drop-shadow(0 0 15px rgba(255, 107, 157, 0.6));
}

.player-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.player-keys {
    display: flex;
    gap: var(--space-2);
}

.key-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-2);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.player1-control .key-badge {
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.1);
}

.player2-control .key-badge {
    border-color: rgba(255, 107, 157, 0.4);
    background: rgba(255, 107, 157, 0.1);
}

.players-vs {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-tertiary);
}

/* Feature danger (bombe) */
.game-feature-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #EF4444 !important;
}

/* Hints multiples */
.game-hints {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.game-hints kbd {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* Carte d'intro du jeu */
.game-intro-card {
    position: relative;
    padding: var(--space-6);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-intro-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 60px -20px rgba(139, 92, 246, 0.3);
}

.game-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 215, 0, 0.3) 60deg,
        rgba(139, 92, 246, 0.3) 120deg,
        rgba(236, 72, 153, 0.3) 180deg,
        rgba(59, 130, 246, 0.3) 240deg,
        rgba(16, 185, 129, 0.3) 300deg,
        transparent 360deg
    );
    animation: glow-rotate 8s linear infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.game-intro-card:hover .game-card-glow {
    opacity: 1;
}

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

.game-card-content {
    position: relative;
    z-index: 1;
}

/* Icône du jeu avec animations */
.game-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-5);
}

.game-icon {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.1) 100%);
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3),
                inset 0 0 20px rgba(255, 215, 0, 0.1);
    animation: pulse-glow 2s ease-in-out infinite;
}

.game-icon-emoji {
    font-size: 3.5rem;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    animation: star-pulse 1.5s ease-in-out infinite;
}

@keyframes star-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.1); }
    50% { box-shadow: 0 0 60px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.2); }
}

.game-icon-sparkles {
    position: absolute;
    inset: -20px;
    pointer-events: none;
}

.game-icon-sparkles span {
    position: absolute;
    font-size: 1.5rem;
    animation: sparkle-float 3s ease-in-out infinite;
}

.game-icon-sparkles span:nth-child(1) {
    top: 0;
    right: 0;
    animation-delay: 0s;
}

.game-icon-sparkles span:nth-child(2) {
    bottom: 10px;
    left: -10px;
    animation-delay: 1s;
}

.game-icon-sparkles span:nth-child(3) {
    top: 50%;
    right: -15px;
    animation-delay: 2s;
}

@keyframes sparkle-float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-10px) scale(1.2); opacity: 0.7; }
}

.game-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--space-3);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF69B4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: var(--space-5);
}

/* Features du jeu */
.game-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
}

.game-feature {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.game-feature:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    transform: scale(1.05);
}

.feature-icon {
    font-size: 1.2rem;
}

/* Carte des stats */
.game-stats-card {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stats-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.stats-title i {
    color: #FFD700;
}

.high-score-display {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.high-score-value {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
    line-height: 1;
}

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

.stats-decoration {
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 6rem;
    opacity: 0.1;
    transform: rotate(-15deg);
}

/* Bouton de démarrage */
.game-controls-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.game-start-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    font-size: 1.5rem;
    font-weight: 800;
    color: #000;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px -10px rgba(255, 165, 0, 0.5),
                0 0 0 0 rgba(255, 215, 0, 0.4);
    animation: btn-glow 2s ease-in-out infinite;
}

@keyframes btn-glow {
    0%, 100% { box-shadow: 0 10px 40px -10px rgba(255, 165, 0, 0.5), 0 0 0 0 rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 15px 50px -10px rgba(255, 165, 0, 0.7), 0 0 0 10px rgba(255, 215, 0, 0); }
}

.game-start-btn:hover {
    transform: scale(1.08) translateY(-4px);
    box-shadow: 0 20px 60px -15px rgba(255, 165, 0, 0.6);
}

.game-start-btn:active {
    transform: scale(0.98);
}

.btn-icon {
    font-size: 1.8rem;
    animation: rocket-shake 0.5s ease-in-out infinite;
}

@keyframes rocket-shake {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(-5deg); }
    75% { transform: translateY(2px) rotate(5deg); }
}

.btn-sparkle {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: sparkle-sweep 3s ease-in-out infinite;
}

@keyframes sparkle-sweep {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.game-hint {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* Section de jeu */
.game-play-section {
    max-width: 900px;
    margin: 0 auto;
}

.game-play-section.hidden {
    display: none;
}

/* HUD du jeu */
.game-hud {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-5);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    min-width: 100px;
}

.hud-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hud-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.hud-score .hud-value {
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.hud-timer .hud-value {
    font-family: var(--font-mono);
}

.hud-timer .hud-value.timer-warning {
    color: #EF4444;
    animation: timer-pulse 0.5s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hud-level-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hud-level-name {
    font-size: 0.7rem;
    color: var(--neon-primary);
    font-weight: 600;
}

/* HUD joueurs */
.hud-player1,
.hud-player2 {
    flex-direction: row !important;
    gap: var(--space-2) !important;
    min-width: auto !important;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
}

.hud-player1 {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.hud-player2 {
    background: rgba(255, 107, 157, 0.15);
    border: 1px solid rgba(255, 107, 157, 0.3);
}

.hud-player-emoji {
    font-size: 1.5rem;
}

.hud-player1 .hud-value {
    color: #FFD700;
}

.hud-player2 .hud-value {
    color: #FF6B9D;
}

/* Zone de jeu */
.game-area-container {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8),
                inset 0 0 100px rgba(139, 92, 246, 0.1);
}

.game-area {
    position: relative;
    width: 100%;
    height: 500px;
    background: linear-gradient(180deg,
        #0a0a1a 0%,
        #1a1a3a 30%,
        #2a1a4a 60%,
        #3a2a5a 100%
    );
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-xl);
    overflow: hidden;
    cursor: crosshair;
    user-select: none;
    touch-action: manipulation;
}

/* Effet de niveau up */
.game-area.level-up-flash {
    animation: level-flash 0.5s ease-out;
}

@keyframes level-flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(2); }
    100% { filter: brightness(1); }
}

/* ========== PANIERS DES JOUEURS ========== */
.basket {
    position: absolute;
    bottom: 10px;
    width: 80px;
    height: 60px;
    transform: translateX(-50%);
    z-index: 50;
    /* Pas de transition pour un mouvement fluide */
}

.basket-body {
    position: relative;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    font-size: 2rem;
}

.basket-player1 .basket-body {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0.6) 100%);
    border: 3px solid #FFD700;
    border-top: none;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4),
                inset 0 -10px 20px rgba(255, 215, 0, 0.2);
}

.basket-player2 .basket-body {
    background: linear-gradient(180deg, rgba(255, 107, 157, 0.3) 0%, rgba(255, 107, 157, 0.6) 100%);
    border: 3px solid #FF6B9D;
    border-top: none;
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.4),
                inset 0 -10px 20px rgba(255, 107, 157, 0.2);
}

.basket-glow {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 30px;
    border-radius: 50%;
    pointer-events: none;
}

.basket-player1 .basket-glow {
    background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
    animation: glow-pulse-gold 1.5s ease-in-out infinite;
}

.basket-player2 .basket-glow {
    background: radial-gradient(ellipse at center, rgba(255, 107, 157, 0.4) 0%, transparent 70%);
    animation: glow-pulse-pink 1.5s ease-in-out infinite;
}

@keyframes glow-pulse-gold {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

@keyframes glow-pulse-pink {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.basket-emoji {
    filter: drop-shadow(0 0 10px currentColor);
}

.basket-player1 .basket-emoji {
    color: #FFD700;
}

.basket-player2 .basket-emoji {
    color: #FF6B9D;
}

.basket-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 700;
    white-space: nowrap;
    opacity: 0.7;
}

.basket-player1 .basket-label {
    color: #FFD700;
}

.basket-player2 .basket-label {
    color: #FF6B9D;
}

/* Animation quand le panier attrape une bombe */
.basket-hit {
    animation: basket-shake 0.5s ease-out;
}

@keyframes basket-shake {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    20% { transform: translateX(-50%) rotate(-10deg); }
    40% { transform: translateX(-50%) rotate(10deg); }
    60% { transform: translateX(-50%) rotate(-5deg); }
    80% { transform: translateX(-50%) rotate(5deg); }
}

/* Étoiles qui tombent */
.falling-star {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s ease;
    z-index: 10;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.falling-star:hover {
    transform: scale(1.2) !important;
}

.falling-star:active {
    transform: scale(0.9) !important;
}

/* Tailles d'étoiles */
.star-size-normal {
    width: 45px;
    height: 45px;
    font-size: 2rem;
}

.star-size-large {
    width: 60px;
    height: 60px;
    font-size: 2.5rem;
}

.star-size-huge {
    width: 80px;
    height: 80px;
    font-size: 3.5rem;
}

/* Types d'étoiles avec effets */
.star-golden {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    animation: star-glow-gold 1s ease-in-out infinite;
}

@keyframes star-glow-gold {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1)); }
}

.star-rainbow {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
    animation: star-rainbow 2s linear infinite;
}

@keyframes star-rainbow {
    0% { filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)); }
    16% { filter: drop-shadow(0 0 15px rgba(255, 165, 0, 0.8)); }
    33% { filter: drop-shadow(0 0 15px rgba(255, 255, 0, 0.8)); }
    50% { filter: drop-shadow(0 0 15px rgba(0, 255, 0, 0.8)); }
    66% { filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.8)); }
    83% { filter: drop-shadow(0 0 15px rgba(138, 43, 226, 0.8)); }
    100% { filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)); }
}

.star-heart {
    filter: drop-shadow(0 0 12px rgba(255, 105, 180, 0.9));
    animation: heart-beat 0.8s ease-in-out infinite;
}

@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.1); }
}

.star-diamond {
    filter: drop-shadow(0 0 20px rgba(0, 255, 255, 1));
    animation: diamond-sparkle 1.5s ease-in-out infinite;
}

@keyframes diamond-sparkle {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(0, 255, 255, 1));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(0, 255, 255, 1)) brightness(1.3);
        transform: scale(1.1);
    }
}

.star-unicorn {
    filter: drop-shadow(0 0 25px rgba(255, 0, 255, 1));
    animation: unicorn-magic 1s ease-in-out infinite;
}

@keyframes unicorn-magic {
    0%, 100% {
        filter: drop-shadow(0 0 25px rgba(255, 0, 255, 1));
        transform: scale(1) rotate(0deg);
    }
    25% {
        filter: drop-shadow(0 0 30px rgba(0, 255, 255, 1));
    }
    50% {
        filter: drop-shadow(0 0 35px rgba(255, 215, 0, 1));
        transform: scale(1.15) rotate(10deg);
    }
    75% {
        filter: drop-shadow(0 0 30px rgba(255, 105, 180, 1));
    }
}

/* Animation d'apparition des étoiles */
@keyframes starAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Animation de capture */
.star-caught {
    animation: star-catch 0.3s ease-out forwards !important;
    pointer-events: none;
}

@keyframes star-catch {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Particules de capture */
.catch-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-explode 0.6s ease-out forwards;
}

@keyframes particle-explode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--end-x), var(--end-y)) scale(0);
        opacity: 0;
    }
}

/* Points flottants */
.floating-points {
    position: absolute;
    font-size: 1.2rem;
    font-weight: 800;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    pointer-events: none;
    animation: points-float 1s ease-out forwards;
    z-index: 100;
    transform: translate(-50%, -50%);
}

.points-diamond {
    color: #00FFFF;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.9);
    font-size: 1.5rem;
}

.points-unicorn {
    color: #FF00FF;
    text-shadow: 0 0 20px rgba(255, 0, 255, 0.9);
    font-size: 1.8rem;
}

@keyframes points-float {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -70%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -150%) scale(1);
        opacity: 0;
    }
}

/* Onde de capture pour étoiles rares */
.catch-wave {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: wave-expand 0.8s ease-out forwards;
}

.wave-diamond {
    border: 3px solid #00FFFF;
    box-shadow: 0 0 20px #00FFFF;
}

.wave-unicorn {
    border: 4px solid #FF00FF;
    box-shadow: 0 0 30px #FF00FF, 0 0 60px #00FFFF;
}

@keyframes wave-expand {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Messages flottants */
.floating-message {
    position: absolute;
    padding: var(--space-2) var(--space-4);
    background: rgba(0, 0, 0, 0.8);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    z-index: 200;
    animation: message-pop 2s ease-out forwards;
}

.floating-message-center {
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(236, 72, 153, 0.9) 100%);
}

.floating-message-top {
    left: 50%;
    top: 20%;
    transform: translate(-50%, -50%);
}

.floating-message-bottom {
    left: 50%;
    bottom: 20%;
    transform: translate(-50%, 50%);
}

@keyframes message-pop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    15% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    30% {
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -100%) scale(0.8);
        opacity: 0;
    }
}

/* Countdown */
.game-countdown {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    font-weight: 900;
    color: #FFD700;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    z-index: 300;
    pointer-events: none;
}

.game-countdown.pop {
    animation: countdown-pop 0.8s ease-out;
}

@keyframes countdown-pop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Overlay de pause */
.game-pause-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 400;
    backdrop-filter: blur(5px);
}

.game-pause-overlay.hidden {
    display: none;
}

.pause-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.pause-icon {
    font-size: 4rem;
}

.pause-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.pause-hint {
    font-size: 1rem;
    color: var(--text-tertiary);
}

/* Contrôles du jeu */
.game-controls-playing {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.game-controls-playing.hidden {
    display: none;
}

.game-control-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.game-control-btn-secondary {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.game-control-btn-secondary:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Écran de Game Over */
.game-over-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.game-over-overlay.hidden {
    display: none;
}

.game-over-content {
    max-width: 400px;
    padding: var(--space-8);
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.95) 0%, rgba(20, 20, 40, 0.98) 100%);
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-over-content.visible {
    transform: scale(1);
    opacity: 1;
}

.game-over-stars {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    font-size: 2rem;
    margin-bottom: var(--space-4);
    animation: stars-dance 1s ease-in-out infinite;
}

@keyframes stars-dance {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.game-over-stars span:nth-child(2) { animation-delay: 0.1s; }
.game-over-stars span:nth-child(3) { animation-delay: 0.2s; }
.game-over-stars span:nth-child(4) { animation-delay: 0.3s; }
.game-over-stars span:nth-child(5) { animation-delay: 0.4s; }

.game-over-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: var(--space-4);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF69B4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.new-high-score-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: var(--radius-full);
    color: #000;
    font-weight: 800;
    margin-bottom: var(--space-4);
    animation: badge-bounce 0.6s ease-out;
}

.new-high-score-badge.hidden {
    display: none;
}

@keyframes badge-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.badge-icon {
    font-size: 1.2rem;
}

.game-over-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    margin-bottom: var(--space-5);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
}

.stat-score .stat-value {
    color: #FFD700;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.game-over-level {
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
}

.level-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    display: block;
    margin-bottom: var(--space-1);
}

.level-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--neon-primary);
}

.stars-breakdown {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.star-count {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.play-again-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: 1.2rem;
    font-weight: 700;
    color: #000;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-again-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px -10px rgba(255, 165, 0, 0.5);
}

/* Stats d'équipe dans game over */
.team-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}

.team-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2);
}

.team-stat-emoji {
    font-size: 1.5rem;
}

.team-stat-name {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.team-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--player-color, var(--text-primary));
}

.team-stat-plus,
.team-stat-equals {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-tertiary);
}

.team-stat-total {
    font-size: 1.3rem;
    font-weight: 800;
    color: #FFD700;
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 215, 0, 0.15);
    border-radius: var(--radius-md);
}

/* Points négatifs (bombe) */
.points-negative {
    color: #EF4444 !important;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.8) !important;
}

/* Style bombe */
.star-bomb {
    filter: drop-shadow(0 0 10px rgba(255, 68, 68, 0.8));
    animation: bomb-pulse 0.6s ease-in-out infinite;
}

@keyframes bomb-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 68, 68, 0.8));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 68, 68, 1));
        transform: scale(1.05);
    }
}

/* Section cachée */
.game-intro-section.hidden {
    display: none;
}


/* Responsive */
@media (max-width: 768px) {
    .games-page {
        padding: var(--space-3);
    }

    .game-area {
        height: 400px;
    }

    .game-hud {
        gap: var(--space-3);
        padding: var(--space-2) var(--space-3);
    }

    .hud-item {
        min-width: 70px;
    }

    .hud-value {
        font-size: 1.4rem;
    }

    .game-intro-card {
        padding: var(--space-4);
    }

    .game-icon {
        width: 80px;
        height: 80px;
    }

    .game-icon-emoji {
        font-size: 2.5rem;
    }

    .game-start-btn {
        padding: var(--space-3) var(--space-6);
        font-size: 1.2rem;
    }

    .game-countdown {
        font-size: 5rem;
    }

    .game-over-content {
        padding: var(--space-5);
        margin: var(--space-4);
    }

    .game-over-stats {
        gap: var(--space-5);
    }

    .stat-value {
        font-size: 2rem;
    }
