/* ============================================
   ChromaShift - Feuille de styles
   Design responsive et moderne
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Orbitron:wght@400;700;900&display=swap');

/* --- Reset et base --- */
#game-main *,
#game-main *::before,
#game-main *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#game-main {
    --c0: #0d0d1a;
    --c1: #ff2d6f;
    --c2: #00e5ff;
    --c3: #aaff00;
    --c4: #ff9100;
    --c5: #cc00ff;
    --glow1: rgba(255,45,111,0.6);
    --glow2: rgba(0,229,255,0.6);
    --glow3: rgba(170,255,0,0.6);
    --glow4: rgba(255,145,0,0.6);
    --glow5: rgba(204,0,255,0.6);

    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #03030a, #0d0d1a, #03030a);
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    overflow: hidden;
    touch-action: none;
}

/* --- Conteneur principal --- */
#app {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    user-select: none;
}

/* --- HUD --- */
#hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 4px;
}

.hud-val {
    font-size: 11px;
    color: #8888bb;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hud-val span {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 12px currentColor;
    letter-spacing: 1px;
}

#score-val { color: var(--c2); text-shadow: 0 0 16px var(--glow2); }
#combo-val { color: var(--c3); text-shadow: 0 0 16px var(--glow3); }
#time-val  { color: var(--c1); text-shadow: 0 0 16px var(--glow1); }

/* --- Best score --- */
#best-wrap {
    font-size: 9px;
    color: #556;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Space Mono', monospace;
}

#best-wrap .trophy { font-size: 12px; }

#best-val {
    color: var(--c4);
    font-size: 12px;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    text-shadow: 0 0 10px var(--glow4);
}

.new-record {
    animation: record-pulse 0.6s ease-in-out infinite alternate;
    color: var(--c3) !important;
    text-shadow: 0 0 16px var(--glow3) !important;
}

@keyframes record-pulse {
    from { filter: brightness(1); }
    to   { filter: brightness(1.8) drop-shadow(0 0 8px var(--c3)); }
}

/* --- Canvas --- */
#canvas-wrap {
    position: relative;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 0 40px rgba(0,229,255,0.08), 0 0 80px rgba(255,45,111,0.04);
}

#canvas-main { display: block; }

/* ── Curseur losange personnalisé (desktop uniquement) ── */
@media (hover: hover) and (pointer: fine) {
    #game-main { cursor: none; }
    #canvas-wrap {
        cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cdefs%3E%3CradialGradient id='g' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%2300e5ff' stop-opacity='1'/%3E%3Cstop offset='100%25' stop-color='%2300e5ff' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cellipse cx='16' cy='16' rx='12' ry='12' fill='url(%23g)' opacity='0.25'/%3E%3Cpolygon points='16,2 30,16 16,30 2,16' fill='none' stroke='%2300e5ff' stroke-width='1.5' opacity='0.9'/%3E%3Cpolygon points='16,7 25,16 16,25 7,16' fill='%2300e5ff' opacity='0.35'/%3E%3Ccircle cx='16' cy='16' r='2.5' fill='%23ffffff' opacity='0.95'/%3E%3Cline x1='16' y1='0' x2='16' y2='32' stroke='%2300e5ff' stroke-width='0.5' opacity='0.3'/%3E%3Cline x1='0' y1='16' x2='32' y2='16' stroke='%2300e5ff' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E") 16 16, crosshair;
    }
}

/* --- Overlay --- */
#overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(3,3,10,0.92);
    backdrop-filter: blur(6px);
    gap: 18px;
    z-index: 10;
}

#overlay.hidden { display: none; }

#overlay h1 {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--c2), var(--c5), var(--c1));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    line-height: 1.1;
    animation: pulse-title 2s ease-in-out infinite alternate;
}

@keyframes pulse-title {
    from { filter: brightness(1); }
    to   { filter: brightness(1.4) drop-shadow(0 0 20px var(--c2)); }
}

#overlay .sub {
    font-size: 10px;
    color: #556;
    letter-spacing: 3px;
    text-align: center;
    font-family: 'Space Mono', monospace;
    max-width: 260px;
    line-height: 1.8;
}

#overlay .final-score {
    font-size: 48px;
    font-weight: 900;
    color: var(--c3);
    text-shadow: 0 0 30px var(--glow3);
    letter-spacing: 2px;
}

/* --- Bouton Start --- */
#btn-start {
    cursor: pointer;
    border: 2px solid var(--c2);
    background: transparent;
    color: var(--c2);
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 4px;
    padding: 14px 36px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(0,229,255,0.3), inset 0 0 20px rgba(0,229,255,0.05);
}

#btn-start::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--c2);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s;
    z-index: -1;
}

#btn-start:hover::before { transform: scaleX(1); }
#btn-start:hover { color: #03030a; box-shadow: 0 0 40px rgba(0,229,255,0.6); }
#btn-start:active { transform: scale(0.97); }

/* --- Controls hint --- */
#controls-hint {
    display: flex;
    gap: 20px;
    margin-top: 4px;
}

.ctrl-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    color: #445;
    letter-spacing: 1px;
}

.ctrl-key {
    border: 1px solid #334;
    padding: 4px 8px;
    color: #889;
    font-size: 10px;
    min-width: 32px;
    text-align: center;
}

/* --- Color indicator --- */
#color-indicator {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ci-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
    transition: transform 0.15s, box-shadow 0.15s;
}

.ci-dot.active {
    transform: scale(1.5);
    box-shadow: 0 0 12px currentColor;
}

/* --- Progress bar --- */
#progress-bar-wrap {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.05);
    position: relative;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--c2), var(--c5));
    transition: width 0.1s linear;
    box-shadow: 0 0 8px var(--c2);
}
