/**
 * Scripts Game CSS
 * Styles spécifiques aux jeux interactifs
 *
 * @package WP_Dix_Scripts
 */

/* ==========================================================================
   CONTAINER JEU
   ========================================================================== */

.dix-script[data-type="game"] .dix-script__container,
.game-container,
.game__container {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    max-width: 900px;
    margin: 0 auto;
}

/* ==========================================================================
   ÉCRANS DE JEU
   ========================================================================== */

.game__screen {
    display: none;
    min-height: 400px;
    padding: 1.5rem;
}

.game__screen.is-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   HEADER JEU
   ========================================================================== */

.game__header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.game__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--script-text);
    margin: 0 0 0.5rem;
}

.game__subtitle {
    font-size: 1rem;
    color: var(--script-text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   CHOIX VISUELS (sélection initiale)
   ========================================================================== */

.game__choices {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.game__choice {
    cursor: pointer;
    padding: 1.5rem;
    border: 3px solid var(--script-border);
    border-radius: var(--script-radius);
    background: var(--script-bg-tertiary);
    text-align: center;
    transition: all 0.3s ease;
}

.game__choice:hover {
    border-color: var(--script-color-primary);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.game__choice.is-selected {
    border-color: var(--script-color-primary);
    background: rgba(59, 130, 246, 0.15);
}

.game__choice-visual {
    margin-bottom: 1rem;
}

.game__choice-label {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--script-text);
    margin-bottom: 0.5rem;
}

.game__choice-info {
    font-size: 0.875rem;
    color: var(--script-text-secondary);
}

@media (max-width: 768px) {
    .game__choices {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .game__choice {
        width: 100%;
        max-width: 280px;
    }
}

/* ==========================================================================
   ZONE DE JEU INTERACTIVE
   ========================================================================== */

.game__play-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.game__interactive-element {
    cursor: pointer;
    position: relative;
    transition: transform 0.1s ease;
}

.game__interactive-element:hover {
    transform: scale(1.05);
}

.game__interactive-element:active {
    transform: scale(0.95);
}

/* ==========================================================================
   COMPTEUR ET PROGRESSION
   ========================================================================== */

.game__progress-container {
    width: 100%;
    margin-bottom: 1.5rem;
}

.game__counter {
    text-align: center;
    margin-bottom: 0.5rem;
}

.game__counter-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--script-color-primary);
}

.game__counter-label {
    font-size: 0.875rem;
    color: var(--script-text-secondary);
    margin-top: 0.25rem;
}

.game__progress-bar {
    width: 100%;
    height: 30px;
    background: var(--script-border);
    border-radius: var(--script-radius-sm);
    overflow: hidden;
    position: relative;
    margin: 1rem 0;
}

.game__progress-fill {
    height: 100%;
    background: var(--script-color-primary);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.game__instruction {
    text-align: center;
    color: var(--script-text-secondary);
    font-size: 0.875rem;
    margin: 1rem 0;
    animation: dix-script-pulse 2s infinite;
}

/* ==========================================================================
   RÉSULTATS DU JEU
   ========================================================================== */

.game__result {
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.game__result-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--script-text);
    margin-bottom: 1.5rem;
}

.game__result-box {
    background: var(--script-bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--script-radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--script-border);
}

.game__result-line {
    font-size: 1rem;
    color: var(--script-text);
    line-height: 1.6;
}

.game__result-line strong {
    color: var(--script-result-optimal);
}

.game__result-highlight {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--script-color-primary);
}

/* ==========================================================================
   COMPARAISON AVEC PRODUIT
   ========================================================================== */

.game__comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: var(--script-bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--script-radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--script-border);
}

.game__comparison-image {
    width: 100px;
    height: auto;
    flex-shrink: 0;
}

.game__comparison-text {
    flex: 1;
    min-width: 250px;
    text-align: left;
}

.game__comparison-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--script-text-secondary);
    margin-bottom: 0.5rem;
}

.game__comparison-content {
    font-size: 0.9375rem;
    color: var(--script-text);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .game__comparison {
        flex-direction: column;
        text-align: center;
    }

    .game__comparison-text {
        text-align: center;
    }

    .game__comparison-image {
        width: 80px;
    }
}

/* ==========================================================================
   BOUTONS DE JEU
   ========================================================================== */

.game__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: var(--script-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.game__btn--primary {
    background: var(--script-color-primary);
    color: white;
}

.game__btn--primary:hover {
    background: var(--script-color-primary-hover);
    transform: translateY(-2px);
}

.game__btn--secondary {
    background: var(--script-bg-tertiary);
    border: 1px solid var(--script-border);
    color: var(--script-text);
}

.game__btn--secondary:hover {
    background: var(--script-color-primary);
    border-color: var(--script-color-primary);
    color: white;
}

.game__btn:active {
    transform: translateY(0);
}

/* ==========================================================================
   ANIMATIONS DE JEU
   ========================================================================== */

@keyframes game-shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-5px, -3px) rotate(-2deg); }
    50% { transform: translate(5px, 2px) rotate(2deg); }
    75% { transform: translate(-3px, 3px) rotate(-1deg); }
}

.game__interactive-element.is-shaking {
    animation: game-shake 0.3s ease;
}

@keyframes game-cut {
    0% {
        top: -60px;
        opacity: 1;
        transform: translateX(-50%) rotate(-45deg);
    }
    50% {
        top: 50px;
        opacity: 1;
        transform: translateX(-50%) rotate(-25deg);
    }
    100% {
        top: 100px;
        opacity: 0;
        transform: translateX(-50%) rotate(-15deg);
    }
}

.game__knife {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);
    font-size: 50px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s ease;
}

.game__knife.is-cutting {
    animation: game-cut 0.4s ease;
}

/* ==========================================================================
   PARTICULES (effet splash)
   ========================================================================== */

.game__particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    animation: game-splash 0.6s ease forwards;
}

@keyframes game-splash {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* ==========================================================================
   MODE CLAIR
   ========================================================================== */

[data-theme="light"] .game__choice {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--script-border);
}

[data-theme="light"] .game__choice:hover {
    background: rgba(59, 130, 246, 0.08);
}

[data-theme="light"] .game__result-box,
[data-theme="light"] .game__comparison {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .game__progress-bar {
    background: var(--script-border);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .game__screen {
        padding: 1rem;
        min-height: 350px;
    }

    .game__title {
        font-size: 1.5rem;
    }

    .game__subtitle {
        font-size: 0.875rem;
    }

    .game__counter-value {
        font-size: 1.75rem;
    }

    .game__result-title {
        font-size: 1.125rem;
    }
}
