/* ============================================
   FastFire - Feuille de styles
   Design responsive - style pulsepattern
   ============================================ */

/* --- Reset et base --- */
#game-main * {
    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;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: none;
    -webkit-touch-callout: none;
}

/* --- Conteneur principal --- */
#game-main #game-container {
    width: 100%;
    max-width: 500px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 15px;
    gap: 8px;
}

/* --- En-tête --- */
#game-main #game-header {
    width: 100%;
    text-align: center;
    flex-shrink: 0;
}

#game-main #game-title {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(90deg, #00d2ff, #7b2ff7, #ff6fd8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* --- Scores --- */
#game-main #scores-container {
    display: flex;
    justify-content: center;
    gap: 30px;
}

#game-main .score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-main .score-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

#game-main .score-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

/* --- Barre d'informations --- */
#game-main #info-bar {
    width: 100%;
    display: flex;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 6px 10px;
    flex-shrink: 0;
}

#game-main .info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-main .info-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

#game-main .info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

/* --- Zone de jeu --- */
#game-main #game-area {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #0a0a1a;
    border-radius: 10px;
    border: 1px solid rgba(123, 47, 247, 0.3);
    min-height: 0;
}

#game-main #gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- Overlay --- */
#game-main #game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#game-main #game-overlay.hidden {
    display: none;
}

#game-main #overlay-content {
    text-align: center;
    padding: 20px;
}

#game-main #overlay-title {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(90deg, #00d2ff, #7b2ff7, #ff6fd8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

#game-main #overlay-message {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #ccc;
}

/* --- High scores --- */
#game-main #high-scores-display {
    margin-top: 20px;
}

#game-main #high-scores-display h3 {
    color: #ff6fd8;
    margin-bottom: 10px;
}

#game-main #scores-list {
    list-style: none;
    padding: 0;
}

#game-main #scores-list li {
    padding: 5px 10px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    font-size: 0.9rem;
}

/* --- Boutons --- */
#game-main #controls-container {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 8px 0;
    flex-shrink: 0;
}

#game-main .game-btn {
    padding: 12px 36px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

#game-main .game-btn:active {
    transform: scale(0.95);
}

#game-main .game-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#game-main .btn-play {
    background: linear-gradient(135deg, #00d2ff, #7b2ff7);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

#game-main .btn-play:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
}

#game-main .btn-stop {
    background: linear-gradient(135deg, #ff5252, #d50000);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

#game-main .btn-stop:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(255, 82, 82, 0.5);
}

#game-main .btn-rules {
    background: linear-gradient(135deg, #ff6fd8, #7b2ff7);
    color: #fff;
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.3);
}

#game-main .btn-rules:hover {
    box-shadow: 0 6px 20px rgba(123, 47, 247, 0.5);
}

/* --- Modal Règles --- */
#game-main .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    animation: ff-fadeIn 0.25s ease;
}

#game-main .modal-overlay.hidden {
    display: none !important;
}

#game-main .modal-content {
    background: linear-gradient(135deg, #1a1a3e, #2a2a5e);
    border: 1px solid rgba(123, 47, 247, 0.4);
    border-radius: 16px;
    padding: 24px 20px;
    max-width: 440px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    animation: ff-slideUp 0.3s ease;
}

@keyframes ff-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ff-slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#game-main .modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

#game-main .modal-close:hover {
    color: #fff;
}

#game-main .modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 14px;
    background: linear-gradient(90deg, #00d2ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

#game-main .modal-body {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #ccc;
}

#game-main .modal-body h3 {
    font-size: 0.95rem;
    color: #b0b0ff;
    margin: 14px 0 6px;
    font-weight: 600;
}

#game-main .modal-body p {
    margin-bottom: 8px;
}

#game-main .modal-body ol,
#game-main .modal-body ul {
    padding-left: 20px;
    margin-bottom: 8px;
}

#game-main .modal-body li {
    margin-bottom: 4px;
}

/* --- High score input --- */
#game-main .high-score-input {
    margin-top: 15px;
}

#game-main .high-score-input input {
    padding: 10px;
    font-size: 1rem;
    border: 2px solid rgba(0, 210, 255, 0.6);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    width: 200px;
    text-align: center;
}

#game-main .high-score-input button {
    padding: 10px 20px;
    font-size: 1rem;
    background: linear-gradient(135deg, #00d2ff, #7b2ff7);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 600;
}

#game-main .high-score-input button:hover {
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
}

/* --- Utilitaires --- */
#game-main .hidden {
    display: none !important;
}

/* --- Responsive : petits écrans --- */
@media (max-height: 600px) {
    #game-main #game-container {
        padding: 5px 10px;
        gap: 4px;
    }

    #game-main #game-title {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    #game-main .score-number {
        font-size: 1.1rem;
    }

    #game-main #info-bar {
        padding: 4px 8px;
    }

    #game-main .info-label {
        font-size: 0.6rem;
    }

    #game-main .info-value {
        font-size: 0.85rem;
    }

    #game-main .game-btn {
        padding: 10px 28px;
        font-size: 0.85rem;
    }
}

/* --- Responsive : grands écrans / tablettes --- */
@media (min-width: 768px) {
    #game-main #game-container {
        padding: 20px;
        gap: 12px;
    }

    #game-main #game-title {
        font-size: 2rem;
    }

    #game-main .score-number {
        font-size: 1.8rem;
    }
}

/* --- Touch Feedback --- */
@media (pointer: coarse) {
    #game-main .game-btn {
        padding: 14px 32px;
        font-size: 1.05rem;
    }
}

/* --- Mode paysage mobile --- */
@media (orientation: landscape) and (max-height: 500px) {
    #game-main #game-container {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 5px 10px;
        gap: 4px;
        max-width: 100%;
        justify-content: center;
    }

    #game-main #game-header {
        width: 50%;
        order: 1;
    }

    #game-main #game-title {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    #game-main .score-number {
        font-size: 1rem;
    }

    #game-main #info-bar {
        width: 50%;
        order: 2;
        padding: 3px 6px;
    }

    #game-main #game-area {
        order: 3;
        flex: 1 1 auto;
        width: 100%;
    }

    #game-main #controls-container {
        order: 4;
        width: auto;
        flex-direction: column;
        padding: 0 10px;
    }

    #game-main .game-btn {
        padding: 8px 20px;
        font-size: 0.8rem;
    }
}
