:root {
    --bg-dark: #0f172a; 
    --bg-blue: #2563eb; 
    --btn-border: #60a5fa;
    --text: #f1f5f9;
}

body {
    margin: 0; font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg-dark); color: var(--text);
    overflow: hidden; touch-action: none; user-select: none;
}

.hidden { display: none !important; }

/* ECRANS */
.screen {
    position: absolute; width: 100%; height: 100vh; top: 0; left: 0;
    display: flex; justify-content: center; align-items: center;
    z-index: 10;
}

/* FOND ACCUEIL LUMINEUX */
#home-screen {
    background: radial-gradient(circle at center, #1e40af 0%, #0f172a 100%);
}

/* DÉCORATIONS */
.decorations { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.floating-icon { 
    position: absolute; font-size: 60px; opacity: 0.3; color: #60a5fa; 
    animation: float 6s infinite ease-in-out; filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}
.i1 { top: 12%; left: 10%; } .i2 { top: 18%; right: 15%; animation-delay: 1s; }
.i3 { bottom: 20%; left: 12%; animation-delay: 2s; } .i4 { bottom: 15%; right: 12%; animation-delay: 3s; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-25px) rotate(5deg); } }

/* UI ACCUEIL */
.content-wrapper { z-index: 100; position: relative; text-align: center; width: 100%; }
.game-title { font-size: 5.5rem; margin: 0; color: white; text-shadow: 0 0 30px rgba(37, 99, 235, 0.8); letter-spacing: 5px; }
.subtitle { color: #cbd5e1; font-size: 1.6rem; margin-bottom: 50px; font-weight: 300; }
.menu-buttons { display: flex; flex-direction: column; gap: 25px; align-items: center; width: 100%; }

button { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }

.btn-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white; border: 2px solid #60a5fa; padding: 20px 90px; font-size: 1.8rem; border-radius: 50px; font-weight: bold;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4); transition: all 0.2s ease; z-index: 999;
}
.btn-blue:hover { transform: scale(1.05) translateY(-3px); }

.btn-dark {
    background-color: rgba(15, 23, 42, 0.6); color: #93c5fd; border: 2px solid #334155;
    padding: 15px 60px; font-size: 1.2rem; border-radius: 50px; transition: 0.2s; z-index: 999;
}
.btn-dark:hover { background: rgba(30, 58, 138, 0.5); border-color: #60a5fa; color: white; }

/* BOITE DE RÈGLES (MISE EN PAGE SPÉCIALE) */
.rules-box {
    background: #1e293b; padding: 40px; border-radius: 20px; border: 1px solid #60a5fa;
    width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto; /* Scroll si trop long */
    position: relative; z-index: 200; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    text-align: left; /* Texte aligné à gauche pour la lisibilité */
}
.close-btn { position: absolute; top: 15px; right: 20px; background: none; border: none; color: #94a3b8; font-size: 2rem; transition: 0.2s; }
.close-btn:hover { color: white; transform: rotate(90deg); }

/* STYLE DU NOUVEAU CONTENU RÈGLES */
.rules-content h3 { color: #60a5fa; border-bottom: 1px solid #334155; padding-bottom: 10px; margin-top: 0; }
.rules-content h4 { color: #e2e8f0; margin-top: 20px; margin-bottom: 5px; font-size: 1.1rem; }
.rules-content p { color: #cbd5e1; line-height: 1.5; margin: 5px 0; font-size: 0.95rem; }
.rule-row { display: flex; align-items: center; gap: 15px; margin: 10px 0; }
.rule-row .icon { font-size: 1.5rem; }

/* JEU UI */
.game-container { width: 95%; max-width: 1000px; height: 90vh; display: flex; flex-direction: column; gap: 10px; }
#top-bar { display: flex; justify-content: space-between; padding: 10px; }
.info-pill { background: #1e293b; padding: 10px 25px; border-radius: 20px; font-weight: bold; border: 1px solid #475569; }

#image-area { flex-grow: 1; display: flex; align-items: center; justify-content: center; background: #000; border-radius: 15px; border: 2px solid #334155; overflow: hidden; }
#target-photo { max-width: 100%; max-height: 100%; object-fit: contain; }

#drawing-area { flex-grow: 1; display: flex; flex-direction: column; gap: 10px; background: #fff; border-radius: 15px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.tools-bar { display: flex; gap: 8px; align-items: center; justify-content: center; background: #f1f5f9; padding: 8px; border-radius: 10px; flex-wrap: wrap; border: 1px solid #cbd5e1; }
.tool { font-size: 1.4rem; padding: 5px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: white; transition: 0.2s; color: #333; }
.tool.active { background: #2563eb; color: white; border-color: #2563eb; transform: scale(1.1); }
.control-btn { font-weight: bold; color: #dc2626; border-color: #fca5a5; }
.separator { width: 1px; height: 30px; background: #cbd5e1; margin: 0 5px; }

/* CANVAS */
.canvas-box { flex-grow: 1; position: relative; cursor: crosshair; border: 2px solid #e2e8f0; border-radius: 8px; overflow: hidden; background-color: white; }
canvas { width: 100%; height: 100%; display: block; touch-action: none; background-color: white; }

.btn-action { background: #16a34a; color: white; border: none; padding: 15px; font-size: 1.2rem; border-radius: 10px; font-weight: bold; z-index: 100; box-shadow: 0 4px 6px rgba(0,0,0,0.2); transition: 0.2s; }
.btn-action:hover { background: #15803d; transform: scale(1.02); }
.map-btn { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); background: #2563eb; border: 4px solid white; border-radius: 50px; padding: 15px 60px; box-shadow: 0 10px 20px rgba(0,0,0,0.3); }

#map-area { background: #0f172a; z-index: 500; width: 100%; height: 100vh; }
#map { width: 100%; height: 100%; z-index: 1; }