/* ============================================
   Styles Premium DESKTOP
   ============================================ */

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

/* Import de la police Ethnocentric */
@font-face {
    font-family: 'Ethnocentric';
    src: url('fonts/Ethnocentric-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-primary: #1a2233; --bg-secondary: #151d2b; --bg-tertiary: #0f1520;
    --accent-ocher: #d4883e; --accent-ocher-light: #e8a050;
    --accent-red: #ff4466; --accent-blue: #4488ff; --accent-gold: #ffd700;
    --accent-orange: #ff8800; --accent-drone: #00ccff; --accent-drop: #66ccff;
    --text-primary: #ffffff; --text-secondary: #b0b0c0; --text-muted: #606070;
    --gold: #ffd700;
    --glow-ocher: rgba(212, 136, 62, 0.4); --glow-gold: rgba(255, 215, 0, 0.5); --glow-blue: rgba(0, 204, 255, 0.5);
    --box-bg-top: rgba(26, 34, 51, 0.95); --box-bg-bottom: rgba(15, 21, 32, 0.95);
}

html, body { width: 100%; height: 100%; overflow: hidden; font-family: 'Segoe UI', 'Arial', sans-serif; color: var(--text-primary); }
body, .screen { background: radial-gradient(ellipse at center, #3d4e68 0%, #1a2233 40%, #0d1118 70%, #000000 100%); }
.screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; z-index: 100; opacity: 1; visibility: visible; transition: opacity 250ms ease, visibility 250ms ease; }
.screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; display: flex !important; }
.hidden { display: none !important; }
/* Exception : .screen.hidden conserve display:flex pour que la transition fonctionne */
.rules-container, .end-container, #court-box { background: linear-gradient(180deg, var(--box-bg-top) 0%, var(--box-bg-bottom) 100%); border: 1px solid rgba(212, 136, 62, 0.25); border-radius: 20px; backdrop-filter: blur(10px); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 5px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05); }

/* ACCUEIL */
.home-container { text-align: center; padding: 25px 30px; max-width: 800px; width: 95%; position: relative; z-index: 2; }
.game-title { 
    font-family: 'Ethnocentric', 'Arial Black', 'Arial Bold', Arial, sans-serif;
    font-weight: normal !important;
    font-style: normal;
    font-size: clamp(2.5rem, 8vw, 4rem); 
    letter-spacing: 0.12em; 
    margin-bottom: 8px; 
    color: var(--gold); 
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 1px 2px 0 #c9a227, 2px 3px 0 #b8941f, 3px 4px 0 #a7841a, 4px 5px 0 #856610, 5px 6px 8px rgba(0, 0, 0, 0.5); 
    animation: titleFloat 3s ease-in-out infinite; 
}
@keyframes titleFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.subtitle { font-size: 0.9rem; color: var(--text-secondary); letter-spacing: 0.35em; margin-bottom: 20px; text-transform: uppercase; }

/* Start Wrapper */
.start-wrapper { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px; width: 100%; margin-bottom: 20px; }

/* Mode Selection Row */
.mode-selection-row { display: flex; align-items: center; gap: 15px; }
.mode-label { color: var(--text-secondary); font-size: 0.8rem; letter-spacing: normal; text-transform: none; }

/* Switch Home: Horizontal */
.mode-switch-home { display: flex; flex-direction: row; gap: 5px; background: rgba(0, 0, 0, 0.4); padding: 5px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.1); }

/* Row for Buttons */
.action-buttons-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.start-button { padding: 14px 45px; font-size: 1.3rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; background: linear-gradient(135deg, var(--accent-ocher) 0%, var(--accent-ocher-light) 100%); color: var(--bg-primary); border: none; border-radius: 12px; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.start-button:hover { transform: scale(1.05); box-shadow: 0 0 30px var(--glow-ocher); }

/* Mobile Button Specific Style */
.start-button.mobile-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.start-button.mobile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-ocher);
    color: var(--accent-ocher-light);
    box-shadow: 0 0 20px rgba(212, 136, 62, 0.3);
}
.btn-icon-svg { width: 24px; height: 24px; }

.rules-container { padding: 20px 25px; margin-bottom: 20px; }
.rules-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; text-align: left; }
.rules-column { display: flex; flex-direction: column; gap: 15px; }
.rules-section h3 { font-size: 0.85rem; color: var(--accent-blue); margin-bottom: 6px; letter-spacing: 0.1em; }
.rules-section p { color: var(--text-secondary); font-size: 0.8rem; margin-bottom: 4px; line-height: 1.4; }
.rules-section p.warning { color: var(--accent-red); margin-top: 4px; }
.highlight-section { border: 1px solid rgba(212, 136, 62, 0.3); padding: 10px; border-radius: 8px; background: rgba(0,0,0,0.2); }
kbd { display: inline-block; padding: 2px 6px; font-size: 0.75rem; font-family: monospace; background: var(--bg-tertiary); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 3px; color: var(--text-primary); }
.special-shots { list-style: none; padding: 0; }
.special-shots li { padding: 4px 0; color: var(--text-secondary); font-size: 0.8rem; }
.special-shots strong { color: var(--accent-ocher-light); }

/* NOUVEAU : Style pour le lien Guide Complet avec animation de pulsation */
.full-guide-section {
    margin-top: 5px;
    border: none;
    padding: 0;
    background: transparent;
}

/* Animation de pulsation lente orange <-> bleu */
@keyframes pulseGuide {
    0%, 100% { color: #e8a050; }
    50% { color: #4488ff; }
}

.guide-link {
    font-size: 0.85rem;
    color: var(--accent-ocher-light);
    font-weight: bold;
    cursor: pointer;
    margin: 0;
    animation: pulseGuide 3s ease-in-out infinite;
}
.guide-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.logo-container { margin-top: 20px; display: flex; justify-content: center; align-items: center; }
.copyright-symbol { color: var(--accent-blue); margin-right: 6px; font-size: 1.1em; }
.logo-text-link { font-size: 0.85rem; color: var(--accent-blue); font-weight: 700; letter-spacing: 0.1em; text-decoration: none; text-transform: uppercase; transition: color 0.2s ease; }
.logo-text-link:hover { color: var(--accent-ocher-light); }

/* JEU */
#game-screen { flex-direction: column; gap: 10px; padding: 15px; padding-bottom: 80px; position: relative; }
#controls-trigger { position: absolute; top: 20px; left: 20px; display: flex; align-items: center; gap: 10px; cursor: pointer; z-index: 50; }
#keys-hint { width: 32px; height: 32px; color: var(--text-secondary); opacity: 0.7; transition: opacity 0.2s, color 0.2s; }
#controls-label { font-size: 0.8rem; letter-spacing: 0.1em; color: var(--text-secondary); text-transform: uppercase; opacity: 0.7; transition: opacity 0.2s, color 0.2s; }
#controls-trigger:hover #keys-hint, #controls-trigger:hover #controls-label { opacity: 1; color: #ffffff; }
#controls-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 500; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-content { position: relative; max-width: 860px; width: 92%; max-height: 90vh; overflow-y: auto; }
.modal-close-btn { position: absolute; top: 15px; right: 20px; font-size: 1.8rem; color: var(--accent-ocher); background: none; border: none; cursor: pointer; z-index: 10; transition: color 0.2s, transform 0.2s; }
.modal-close-btn:hover { color: var(--accent-ocher-light); transform: rotate(90deg); }

/* Modal : structure en lignes horizontales */
.modal-3col, .modal-col { display: none; }

.modal-row { margin-bottom: 20px; }
.modal-row:last-child { margin-bottom: 0; }

.modal-row-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-ocher); border-bottom: 1px solid rgba(212, 136, 62, 0.25); padding-bottom: 6px; margin-bottom: 12px; }
.modal-row-title--bumpers { color: var(--accent-blue); border-bottom-color: rgba(68, 136, 255, 0.25); }
.modal-row-title--settings { color: var(--text-secondary); border-bottom-color: rgba(176, 176, 192, 0.2); }

.modal-row-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; align-items: start; }

.modal-cell { display: flex; flex-direction: column; gap: 10px; }

.modal-bumpers-intro { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.4; }

.bumper-entry { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.06); border-radius: 7px; }
.bumper-picto { flex-shrink: 0; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.bumper-desc { display: flex; flex-direction: column; gap: 1px; }
.bumper-name { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; }
.bumper-desc span { font-size: 0.67rem; color: var(--text-secondary); line-height: 1.35; }

.modal-setting-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; }
.modal-setting-item div { display: flex; flex-direction: column; gap: 3px; }
.modal-setting-item strong { font-size: 0.75rem; color: var(--text-primary); letter-spacing: 0.05em; }
.modal-setting-item span { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.4; }

/* TOP-BAR & COURT-BOX */
#top-bar { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 200; 
    width: 85%; 
    max-width: 1100px; 
    padding: 0; 
    position: relative;
    transition: width 0.3s ease, max-width 0.3s ease; 
}
#court-box { 
    width: 85%; 
    max-width: 1100px; 
    aspect-ratio: 16/9; 
    min-height: 300px; 
    max-height: 60vh; 
    position: relative; 
    overflow: hidden; 
    padding: 0; 
    transition: aspect-ratio 0.3s ease, max-width 0.3s ease, border-radius 0.3s ease, border 0.3s ease; 
}

.mode-2d #court-box { aspect-ratio: 4/3; max-width: 800px; }
.mode-2d #top-bar { max-width: 800px; }

#supershot-container { 
    position: absolute; 
    left: 0; 
    top: 50%; 
    transform: translateY(-50%); 
}
#droneshot-container { 
    position: absolute; 
    right: 0; 
    top: 50%; 
    transform: translateY(-50%); 
}

#scoreboard { display: flex; align-items: center; gap: 18px; padding: 10px 30px; background: rgba(0, 0, 0, 0.85); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; backdrop-filter: blur(10px); flex-shrink: 0; }
.score-player, .score-ia { display: flex; flex-direction: column; align-items: center; min-width: 60px; }
.score-label { font-size: 0.7rem; letter-spacing: 0.12em; margin-bottom: 3px; }
.score-player .score-label { color: var(--accent-ocher-light); }
.score-ia .score-label { color: var(--accent-red); }
.score-value { font-size: 2rem; font-weight: 900; display: inline-block; font-family: 'Ethnocentric', 'Arial Black', Arial, sans-serif; }
.score-player .score-value { color: var(--accent-ocher-light); text-shadow: 0 0 12px var(--glow-ocher); }
.score-ia .score-value { color: var(--accent-red); text-shadow: 0 0 12px rgba(255, 68, 102, 0.3); }

@keyframes scorePop { 0% { transform: scale(1.4); } 100% { transform: scale(1); } }
.score-pop { animation: scorePop 300ms ease-out forwards; }
.score-divider { font-size: 1.5rem; color: var(--text-muted); }
#game-canvas-2d, #game-canvas-3d { display: block; width: 100%; height: 100%; border-radius: 20px; position: absolute; top: 0; left: 0; }
#game-canvas-2d { z-index: 1; }
#game-canvas-3d { z-index: 2; }

/* PAUSE OVERLAY */
#pause-overlay { 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.6); 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    gap: 10px;
    border-radius: 20px; 
    z-index: 10; 
    pointer-events: none; 
}
#pause-overlay span:first-child {
    font-family: 'Ethnocentric', 'Arial Black', 'Arial Bold', Arial, sans-serif;
    font-weight: normal !important;
    font-style: normal;
    font-size: clamp(2.5rem, 8vw, 4rem);
    letter-spacing: 0.12em;
    color: var(--gold);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 1px 2px 0 #c9a227, 2px 3px 0 #b8941f, 3px 4px 0 #a7841a, 4px 5px 0 #856610, 5px 6px 8px rgba(0, 0, 0, 0.5);
    animation: titleFloat 3s ease-in-out infinite;
    text-transform: uppercase;
}

/* Hint ESC sous PAUSE */
#pause-esc-hint {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    color: var(--accent-ocher) !important;
    text-shadow: none !important;
    opacity: 0.85;
    border: 1px solid rgba(212, 136, 62, 0.5);
    border-radius: 5px;
    padding: 3px 10px;
}
#pause-esc-hint kbd {
    background: rgba(212, 136, 62, 0.2);
    border-color: rgba(212, 136, 62, 0.6);
    color: var(--accent-ocher);
    font-size: 0.8rem;
    padding: 1px 6px;
}

/* FULLSCREEN MODE (Canevas zoomé [Z]) */
/* CORRECTION: Supprimé #shot-indicator de la règle display:none */
.fullscreen-mode #game-controls, .fullscreen-mode #pause-container { display: none !important; }
.fullscreen-mode #top-bar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); width: auto; background: rgba(0, 0, 0, 0.7); padding: 10px 20px; border-radius: 15px; border: 1px solid rgba(255,255,255,0.1); z-index: 1000; backdrop-filter: blur(5px); }
.fullscreen-mode #supershot-container { position: static; transform: none; }
.fullscreen-mode #droneshot-container { position: static; transform: none; }
/* Bouton visible uniquement quand isFullscreenMode = true (géré par JS) */
#exit-fullscreen-box { display: none; position: fixed; bottom: 20px; left: 20px; z-index: 1001; }
.fullscreen-mode #exit-fullscreen-box { display: flex !important; }
.fullscreen-mode #court-box { width: 100%; max-width: 100%; margin-top: 80px; height: calc(100vh - 140px); max-height: calc(100vh - 140px); border-radius: 0; border: none; }
.fullscreen-mode #pause-overlay { border-radius: 0; }

/* SWITCH 2D/3D */
.mode-switch-box { border-color: rgba(255, 215, 0, 0.3); }
.switch-vertical { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; }
.mode-btn { background: transparent; border: 1px solid var(--text-secondary); color: var(--text-primary); padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; cursor: pointer; transition: all 0.2s; text-align: center; }
.mode-btn:hover { border-color: var(--accent-ocher); }
.mode-btn.active-mode { background: transparent; color: var(--accent-ocher); border-color: var(--accent-ocher); box-shadow: 0 0 8px var(--glow-ocher); }

/* Control Box Styles (Shared) */
.control-box { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px; background: rgba(0, 0, 0, 0.85); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; font-size: 0.6rem; letter-spacing: 0.12em; color: var(--text-secondary); width: 60px; text-align: center; }
.control-label { font-size: 0.6rem; letter-spacing: 0.12em; color: var(--text-secondary); margin-top: 2px; }

.fullscreen-box { border: none; background: transparent; padding: 0; width: auto; }
.fullscreen-box .icon-btn { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.85); border-radius: 8px; }
.fullscreen-box .icon-svg { color: var(--text-secondary); width: 24px; height: 24px; top: 8px; left: 8px; }
.fullscreen-box .icon-btn:hover { background: var(--accent-ocher); }
.fullscreen-box .icon-btn:hover .icon-svg { color: var(--bg-primary); }
.fullscreen-box .control-label { width: 60px; }

#exit-fullscreen-box { border-color: rgba(212, 136, 62, 0.3); }
#exit-fullscreen-box .icon-btn { width: 40px; height: 40px; background: rgba(0,0,0,0.85); border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); }
#exit-fullscreen-box .icon-svg { width: 24px; height: 24px; top: 8px; left: 8px; color: var(--accent-ocher); }
#exit-fullscreen-box:hover { border-color: var(--accent-ocher); }

.gauge-container { display: flex; flex-direction: column; align-items: center; gap: 5px; background: rgba(0, 0, 0, 0.75); padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.1); min-width: 100px; }
.gauge-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em; color: var(--text-secondary); }
.gauge-bar-bg { width: 80px; height: 10px; background: rgba(0, 0, 0, 0.85); border: 2px solid rgba(255, 215, 0, 0.25); border-radius: 5px; overflow: hidden; }
.gauge-bar { width: 0%; height: 100%; border-radius: 3px; transition: width 0.3s ease; }

@keyframes blinkGlow { 0% { box-shadow: 0 0 5px var(--glow-color); } 20% { box-shadow: 0 0 15px var(--glow-color); } 40% { box-shadow: 0 0 5px var(--glow-color); } 60% { box-shadow: 0 0 15px var(--glow-color); } 80% { box-shadow: 0 0 5px var(--glow-color); } 100% { box-shadow: 0 0 10px var(--glow-color); } }
#supershot-container { border-color: rgba(255, 215, 0, 0.3); }
#supershot-container .gauge-bar { background: linear-gradient(90deg, var(--accent-orange), var(--accent-gold)); }
#supershot-container .gauge-bar.full { --glow-color: var(--glow-gold); animation: blinkGlow 1s ease-in-out 2 forwards; }
#supershot-percent { font-size: 0.7rem; font-weight: 700; color: var(--accent-gold); }
#droneshot-container { border-color: rgba(0, 204, 255, 0.3); }
.drone-label { color: var(--accent-drone); }
#droneshot-container .gauge-bar-bg { border-color: rgba(0, 204, 255, 0.25); }
.drone-bar { background: linear-gradient(90deg, #4488ff, #00ccff); }
.drone-bar.full { --glow-color: var(--glow-blue); animation: blinkGlow 1s ease-in-out 2 forwards; }
.drone-percent { font-size: 0.7rem; font-weight: 700; color: var(--accent-drone); }

#pause-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; }
.pause-btn { background: rgba(0, 0, 0, 0.85) !important; border: 2px solid var(--accent-ocher) !important; color: var(--accent-ocher) !important; font-weight: 700; width: 100px; font-size: 0.9rem; transition: all 0.2s; }
.pause-btn:hover { background: var(--accent-ocher) !important; color: var(--bg-primary) !important; box-shadow: 0 0 15px var(--glow-ocher); }
.pause-btn.paused { background: var(--accent-ocher) !important; color: var(--bg-primary) !important; }

#shot-indicator { 
    position: fixed; 
    bottom: 15px; 
    right: 15px; 
    padding: 7px 15px; 
    background: rgba(0, 0, 0, 0.85); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-radius: 8px; 
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Alignement à droite */
    gap: 4px; /* Espace entre le tir et les échanges */
}
#current-shot { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; color: var(--accent-ocher-light); transition: color 0.2s; }
.shot-gold { color: var(--accent-gold) !important; text-shadow: 0 0 8px var(--glow-gold); }
.shot-blue { color: var(--accent-drone) !important; text-shadow: 0 0 8px var(--glow-blue); }

/* Style pour le compteur d'échanges (identique à "AIDE") */
#rally-counter {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-transform: uppercase;
    opacity: 0.7;
}
#rally-count {
    font-variant-numeric: tabular-nums; /* Chiffres à chasse fixe */
    display: inline-block;
    min-width: 1.2em; /* Sécurité pour largeur */
    text-align: right;
}

#game-controls { position: fixed; bottom: 15px; left: 15px; display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 200; }
.control-box { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px; background: rgba(0, 0, 0, 0.85); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; font-size: 0.6rem; letter-spacing: 0.12em; color: var(--text-secondary); width: 96px; text-align: center; }
.control-label { font-size: 0.6rem; letter-spacing: 0.12em; color: var(--text-secondary); margin-top: 2px; }

/* MODIF: Home button hover blue */
.home-box .icon-svg { color: var(--text-secondary); }
.home-box .icon-btn:hover .icon-svg { color: var(--accent-blue); }

.difficulty-box { border-color: rgba(255, 255, 255, 0.1); }
.difficulty-box label { color: var(--text-secondary); }
.difficulty-box #ia-value { color: var(--text-secondary); }

#ia-controls { display: none; }

.speed-control { width: 96px; }
input[type="range"] { writing-mode: vertical-lr; direction: rtl; -webkit-appearance: none; width: 25px; height: 70px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { width: 5px; height: 100%; background: var(--bg-tertiary); border-radius: 3px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; background: var(--accent-ocher); border-radius: 50%; cursor: pointer; margin-left: -5px; }
#speed-value { font-size: 0.8rem; font-weight: 700; color: var(--accent-ocher-light); }
#ia-value { font-size: 0.8rem; font-weight: 700; }

.control-btn { padding: 8px 18px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; background: rgba(0, 0, 0, 0.85); color: var(--text-primary); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 8px; cursor: pointer; transition: all 0.3s ease; }
.control-btn:hover { border-color: var(--accent-blue); box-shadow: 0 0 12px rgba(68, 136, 255, 0.3); }

.icon-btn { background: transparent; border: none; cursor: pointer; padding: 5px; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; position: relative; width: 24px; height: 24px; }
.icon-btn:hover { transform: scale(1.1); }
.icon-svg { width: 20px; height: 20px; transition: color 0.2s; position: absolute; top: 2px; left: 2px; }
.muted-icon { display: none; }
.music-toggle-box .icon-svg { color: var(--accent-ocher); } 
.music-toggle-box .icon-btn.muted .icon-svg { color: var(--text-primary); } 
.sound-toggle-box .icon-svg:not(.muted-icon) { color: var(--accent-ocher); } 
.sound-toggle-box .icon-btn.muted .icon-svg:not(.muted-icon) { display: none; } 
.sound-toggle-box .icon-btn.muted .muted-icon { display: block; color: var(--text-primary); } 

/* END SCREEN */
.end-screen-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 90%; 
    max-width: 400px;
    position: relative;
    z-index: 2;
    gap: 20px;
}

.end-screen-wrapper .game-title {
    margin-bottom: 0; 
    text-align: center;
    font-size: clamp(1.8rem, 6vw, 2.8rem); 
}

.end-container {
    text-align: center;
    padding: 25px 40px;
    width: 100%;
}

@keyframes endTitleIn {
    0%   { opacity: 0; transform: translateY(-40px) scale(0.85); }
    60%  { opacity: 1; transform: translateY(6px) scale(1.04); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes endFadeUp {
    0%   { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.end-animate #end-result-title {
    animation: endTitleIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.end-animate #end-message {
    animation: endFadeUp 0.4s ease both;
    animation-delay: 0.35s;
    opacity: 0;
}
.end-animate #final-score {
    animation: endFadeUp 0.4s ease both;
    animation-delay: 0.5s;
    opacity: 0;
}
.end-animate .end-buttons {
    animation: endFadeUp 0.4s ease both;
    animation-delay: 0.65s;
    opacity: 0;
}

/* TITRES VICTOIRE / DEFAITE AVEC POLICE ETHNOCENTRIC */
#end-result-title {
    font-family: 'Ethnocentric', 'Arial Black', 'Arial Bold', Arial, sans-serif;
    font-weight: normal !important;
    font-style: normal;
    font-size: 1.8rem;
    margin-bottom: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#end-result-title.win {
    color: var(--gold);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 1px 2px 0 #c9a227, 2px 3px 0 #b8941f, 3px 4px 8px rgba(0, 0, 0, 0.5);
}

#end-result-title.lose {
    color: var(--accent-red);
    text-shadow: 0 2px 12px rgba(255, 68, 102, 0.3);
}

#end-message { font-size: 1rem; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
#final-score { font-size: 1.5rem; margin-bottom: 25px; display: flex; justify-content: center; gap: 15px; align-items: center; }
#final-score .player-final { color: var(--accent-ocher-light); font-weight: 700; font-family: 'Ethnocentric', 'Arial Black', Arial, sans-serif; }
#final-score .ia-final { color: var(--accent-red); font-weight: 700; font-family: 'Ethnocentric', 'Arial Black', Arial, sans-serif; }
#final-score .divider { color: var(--text-muted); }
.end-buttons { display: flex; gap: 12px; justify-content: center; }
.end-btn { padding: 12px 28px; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.08em; border: none; border-radius: 8px; cursor: pointer; transition: all 0.3s ease; }
.end-btn:first-child { background: linear-gradient(135deg, var(--accent-ocher) 0%, var(--accent-ocher-light) 100%); color: var(--bg-primary); }
.end-btn:first-child:hover { transform: scale(1.05); box-shadow: 0 0 20px var(--glow-ocher); }
.end-btn.secondary { background: transparent; border: 2px solid var(--text-secondary); color: var(--text-primary); }
.end-btn.secondary:hover { border-color: var(--accent-blue); color: var(--accent-blue); }

/* Bouton plein écran navigateur — page d'accueil */
.home-fullscreen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 26px;
    padding: 0;
}
.home-fullscreen-btn.active-mode svg {
    color: var(--accent-ocher);
}

/* Bouton zoom canvas — overlay coin haut-gauche du court-box */
.canvas-zoom-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 20;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    padding: 0;
}
.canvas-zoom-btn:hover {
    background: rgba(212, 136, 62, 0.3);
    border-color: var(--accent-ocher);
    color: var(--accent-ocher-light);
}
/* En mode zoom canvas actif, changer le picto pour indiquer le dézoom */
.fullscreen-mode .canvas-zoom-btn {
    top: 10px;
    left: 10px;
}

/* Section debug dans la modale */
.debug-section { margin-top: 8px; }
.debug-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.debug-row span { flex: 1; line-height: 1.3; }
.debug-switch { flex-shrink: 0; }
.fps-select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 0.7rem;
    padding: 3px 6px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}
.fps-select:focus { border-color: var(--accent-ocher); }

/* Animation d'entrée de la grande modale */
@keyframes modalIn {
    0%   { opacity: 0; transform: scale(0.96) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes modalRowIn {
    0%   { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

.modal-animate {
    animation: modalIn 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal-animate .modal-row {
    opacity: 0;
    animation: modalRowIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal-animate .modal-row:nth-child(2) { animation-delay: 0.08s; }
.modal-animate .modal-row:nth-child(3) { animation-delay: 0.16s; }
.modal-animate .modal-row:nth-child(4) { animation-delay: 0.24s; }

/* RESPONSIVE */
@media (max-width: 900px) { #court-box { width: 92%; } #top-bar { width: 92%; } }
@media (max-width: 700px) { 
    .rules-columns { grid-template-columns: 1fr; gap: 15px; } 
    .modal-row-cols { grid-template-columns: 1fr; }
    .home-container { padding: 20px; } 
    .rules-container { padding: 15px 18px; } 
    .game-title { font-size: clamp(2rem, 7vw, 2.8rem); } 
    #court-box { width: 96%; max-height: 50vh; } 
    #top-bar { width: 96%; } 
    .gauge-bar-bg { width: 60px; } 
    #scoreboard { padding: 8px 15px; gap: 10px; } 
}
@media (max-width: 480px) { 
    .start-button { padding: 12px 35px; font-size: 1.1rem; } 
    .rules-section p, .special-shots li { font-size: 0.75rem; } 
    #game-controls { bottom: 10px; left: 10px; } 
    #ia-controls { right: 10px; bottom: 52px; } 
    #shot-indicator { right: 10px; bottom: 10px; } 
    #court-box { width: 98%; } 
    #top-bar { width: 98%; gap: 2px; } 
    #supershot-container { position: static; transform: none; }
    #droneshot-container { position: static; transform: none; }
    #top-bar { justify-content: space-between; flex-wrap: wrap; }
    #game-screen { padding-bottom: 60px; } 
    .mode-selection-row { flex-direction: column; gap: 5px; } 
    .mode-switch-home { flex-direction: row; } 
    .end-screen-wrapper { gap: 10px; } 
    .end-container { padding: 20px; } 
    #end-result-title { font-size: 1.4rem; }
    .action-buttons-row {
        flex-direction: column;
        gap: 10px;
    }
}