/* ============================================
   Pulse Chain - Feuille de styles
   Design inspiré de Pulse Pattern
   ============================================ */

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

#game-main {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

#gameCanvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 18px;
    pointer-events: none;
    z-index: 10;
}

.score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    font-size: 9px;
    color: #00d2ff;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.7;
}

.score-value {
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px #00d2ff, 0 0 30px #00d2ff;
    line-height: 1;
}

.best-hud {
    font-size: 13px;
    color: #7b2ff7;
    text-shadow: 0 0 8px #7b2ff7;
    line-height: 1;
}

#livesDisplay {
    display: flex;
    gap: 5px;
    padding-top: 4px;
}

.life-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7b2ff7;
    box-shadow: 0 0 8px #7b2ff7, 0 0 16px #7b2ff7;
}

.life-dot.lost {
    background: #333;
    box-shadow: none;
}

#comboDisplay {
    font-size: 11px;
    color: #ff6fd8;
    letter-spacing: 2px;
    text-align: center;
    text-shadow: 0 0 8px #ff6fd8;
    min-height: 16px;
}

/* OVERLAY SCREENS */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: rgba(15, 12, 41, 0.92);
}

.screen.hidden {
    display: none;
}

.screen-title {
    font-size: clamp(36px, 12vw, 64px);
    font-weight: 900;
    background: linear-gradient(90deg, #00d2ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

.screen-title-alt {
    background: linear-gradient(90deg, #7b2ff7, #ff6fd8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.screen-title-gameover {
    font-size: clamp(28px, 9vw, 52px);
    background: linear-gradient(90deg, #ff6fd8, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.screen-sub {
    font-size: clamp(10px, 3vw, 14px);
    color: #7b2ff7;
    letter-spacing: 3px;
    margin-top: 8px;
    text-shadow: 0 0 10px #7b2ff7;
}

.screen-divider {
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00d2ff, transparent);
    margin: 24px 0;
    box-shadow: 0 0 8px #00d2ff;
}

.screen-info {
    font-size: clamp(9px, 2.5vw, 12px);
    color: #aaa;
    text-align: center;
    letter-spacing: 2px;
    line-height: 2;
    max-width: 320px;
    padding: 0 20px;
}

.screen-info span {
    color: #ff6fd8;
    text-shadow: 0 0 6px #ff6fd8;
}

.btn-start {
    margin-top: 32px;
    padding: 16px 48px;
    background: linear-gradient(135deg, #00d2ff, #7b2ff7);
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: clamp(14px, 4vw, 18px);
    font-weight: 700;
    letter-spacing: 4px;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4);
    transition: all 0.2s;
    pointer-events: all;
    -webkit-tap-highlight-color: transparent;
}

.btn-start:active {
    transform: scale(0.97);
    box-shadow: 0 2px 15px rgba(0, 210, 255, 0.6);
}

.score-final {
    font-size: clamp(28px, 9vw, 52px);
    font-weight: 900;
    color: #ff6fd8;
    text-shadow: 0 0 20px #ff6fd8, 0 0 60px #ff6fd8;
    margin: 8px 0;
}

.best-label {
    font-size: 10px;
    color: #7b2ff7;
    letter-spacing: 3px;
    text-shadow: 0 0 8px #7b2ff7;
}

#titleBest {
    font-size: 11px;
    color: #7b2ff7;
    letter-spacing: 3px;
    text-shadow: 0 0 8px #7b2ff7;
    margin-top: 16px;
}

@keyframes pulse {
    from {
        filter: brightness(1);
    }
    to {
        filter: brightness(1.3);
    }
}

#chainAnnounce {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translateX(-50%) translateY(-50%);
    font-size: 42px;
    font-weight: 900;
    color: #ff6fd8;
    text-shadow: 0 0 20px #ff6fd8, 0 0 60px #ff6fd8;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    letter-spacing: 2px;
    text-align: center;
    line-height: 1.2;
}

#levelAnnounce {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 900;
    color: #00d2ff;
    text-shadow: 0 0 20px #00d2ff, 0 0 60px #00d2ff;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    letter-spacing: 6px;
}

#newRecordBanner {
    position: absolute;
    left: 50%;
    top: 14%;
    transform: translateX(-50%);
    font-weight: 900;
    font-size: clamp(16px, 5vw, 26px);
    letter-spacing: 4px;
    color: #ff6fd8;
    text-shadow: 0 0 16px #ff6fd8, 0 0 40px #ff6fd8;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.4s;
}

/* Responsive */
@media (max-height: 600px) {
    #ui {
        padding: 8px 12px;
    }

    .score-value {
        font-size: 20px;
    }

    .score-label {
        font-size: 8px;
    }
}
