/**
 * Styles des mini-jeux
 * La Bonne Adresse
 */

.game-page {
    min-height: 100vh;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.game-container {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-lg);
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--primary);
}

.game-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.game-header h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
}

.game-header p {
    color: var(--text-secondary);
}

.game-header strong {
    color: var(--primary);
}

/* Demo/Real badge */
.demo-badge,
.real-badge {
    text-align: center;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.demo-badge {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--accent);
}

.demo-badge span {
    display: block;
    font-weight: 700;
    color: var(--accent);
    font-size: 0.875rem;
    letter-spacing: 1px;
}

.demo-badge small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.real-badge {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
}

.real-badge span {
    display: block;
    font-weight: 700;
    color: var(--danger);
    font-size: 0.875rem;
    letter-spacing: 1px;
}

.real-badge small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Game info */
.game-info {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.info-item {
    text-align: center;
}

.info-item .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.info-item .value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Game area */
.game-area {
    background: var(--bg-darker);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.instructions {
    text-align: center;
}

.instructions h3 {
    margin-bottom: var(--spacing-md);
}

.instructions p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.instructions .hint {
    color: var(--accent);
    font-size: 0.875rem;
}

/* Chrono specific */
.target-time {
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: var(--spacing-xl);
}

.chrono-display {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.chrono-display.running {
    color: var(--primary);
}

.chrono-display.hidden {
    color: transparent;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.5);
}

#status-text {
    margin-top: var(--spacing-lg);
    color: var(--text-secondary);
}

/* Result */
.result {
    text-align: center;
}

.result h2 {
    margin-bottom: var(--spacing-md);
}

.result .score {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.result .score.perfect {
    color: var(--success);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.result .message {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.result .best-score {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
    animation: pulse 1s infinite;
}

/* Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-success);
}

/* Canvas games */
.game-canvas,
#game-canvas {
    border-radius: var(--radius-md);
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    cursor: crosshair;
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    touch-action: none;
}

/* Timing bar game */
.timing-container {
    width: 100%;
    position: relative;
}

.timing-track {
    width: 100%;
    height: 40px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.timing-target {
    position: absolute;
    height: 100%;
    background: rgba(16, 185, 129, 0.3);
    border-left: 2px solid var(--success);
    border-right: 2px solid var(--success);
}

.timing-target-center {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--success);
    left: 50%;
    transform: translateX(-50%);
}

.timing-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--primary);
}

/* Ball game */
.ball-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    max-width: 500px;
}

.ball-target {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid var(--primary);
    border-radius: 50%;
    opacity: 0.5;
}

.ball-target-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

/* Target game */
.target-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 400px;
}

.target-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid;
}

.target-ring.ring-1 { border-color: var(--danger); }
.target-ring.ring-2 { border-color: var(--accent); }
.target-ring.ring-3 { border-color: var(--success); }

.target-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
}

.click-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    pointer-events: none;
}

/* Distance estimation */
.estimation-container {
    position: relative;
    width: 100%;
    height: 200px;
}

.estimation-point {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.estimation-point.fixed {
    background: var(--primary);
}

.estimation-point.movable {
    background: var(--accent);
    cursor: grab;
}

.estimation-point.movable:active {
    cursor: grabbing;
}

.estimation-line {
    position: absolute;
    height: 2px;
    background: var(--border-color);
    transform-origin: left center;
}

/* Responsive - Tablettes */
@media (max-width: 768px) {
    .game-container {
        max-width: 100%;
        margin: 0 var(--spacing-sm);
    }

    .game-area {
        padding: var(--spacing-md);
        min-height: 250px;
    }

    .game-header h1 {
        font-size: 1.5rem;
    }

    .game-controls {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .game-controls .btn {
        width: 100%;
    }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
    .game-page {
        padding: var(--spacing-sm);
        align-items: flex-start;
        padding-top: var(--spacing-md);
    }

    .game-container {
        padding: var(--spacing-md);
        border-radius: var(--radius-lg);
    }

    .game-header h1 {
        font-size: 1.25rem;
    }

    .game-header p {
        font-size: 0.875rem;
    }

    .chrono-display {
        font-size: 2.5rem;
    }

    .result .score {
        font-size: 2.5rem;
    }

    .game-info {
        gap: var(--spacing-md);
    }

    .info-item .value {
        font-size: 1rem;
    }

    .game-area {
        padding: var(--spacing-sm);
        min-height: 200px;
    }

    .instructions h3 {
        font-size: 1rem;
    }

    .instructions p {
        font-size: 0.8125rem;
    }

    .demo-badge,
    .real-badge {
        padding: var(--spacing-sm);
    }

    .demo-badge span,
    .real-badge span {
        font-size: 0.75rem;
    }

    /* Timing bar sur mobile */
    .timing-track {
        height: 50px;
    }

    .timing-bar {
        width: 6px;
    }
}

/* Responsive - Très petits écrans */
@media (max-width: 400px) {
    .game-container {
        padding: var(--spacing-sm);
    }

    .game-header h1 {
        font-size: 1.125rem;
    }

    .chrono-display {
        font-size: 2rem;
    }

    .result .score {
        font-size: 2rem;
    }

    .game-info {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}
