/* Maze Runner Styles */

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

body {
    background: var(--bg-dark, #050505);
    color: var(--text-main, #ffffff);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header */
.g4f-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    position: relative;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main, #fff);
    font-weight: 600;
    font-size: 1.1rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-neon, #6366f1), var(--secondary-neon, #ec4899));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.highlight-4 {
    color: var(--primary-neon, #6366f1);
}

.lang-switch {
    display: flex;
    gap: 6px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.lang-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
}

/* Game Container */
.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px;
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    max-width: 800px;
    flex-direction: column;
    align-items: center;
}

.screen.active {
    display: flex;
}

/* Start Screen */
.start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 40px 20px;
    text-align: center;
}

.game-title-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-title {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #06b6d4, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
}

/* Size Selector */
.size-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.size-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.25s;
    font-family: inherit;
}

.size-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.size-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.start-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.start-hint {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
}

.controls-info {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px 28px;
    text-align: left;
    width: 100%;
    max-width: 360px;
}

.controls-info h3 {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.controls-info ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.controls-info li {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

/* Neon Button */
.neon-btn {
    padding: 14px 40px;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.neon-btn.primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(236, 72, 153, 0.15));
    color: #fff;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.neon-btn.primary:hover {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.neon-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

.neon-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.neon-btn.small {
    padding: 8px 20px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Game Screen */
#game-screen {
    padding-top: 0;
}

.game-hud {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 12px 16px;
    width: 100%;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hud-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hud-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 16px;
}

/* Game Actions */
.game-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
}

/* Pause Overlay */
.pause-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
    border-radius: 16px;
}

.pause-overlay.hidden {
    display: none;
}

.pause-text {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.pause-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* Game Over / Result */
.glass-panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    padding: 36px 32px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    margin-top: 40px;
}

.result-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.new-record {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(251, 146, 60, 0.2));
    border: 1px solid rgba(250, 204, 21, 0.4);
    color: #fbbf24;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 16px;
    animation: recordPulse 1.5s ease-in-out infinite;
}

.new-record.hidden {
    display: none;
}

@keyframes recordPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(250, 204, 21, 0.1); }
    50% { box-shadow: 0 0 25px rgba(250, 204, 21, 0.25); }
}

.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.score-row.final {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #fff;
}

.score-row.best {
    color: rgba(255, 255, 255, 0.5);
}

.score-num {
    font-weight: 700;
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Ad Container */
.g4f-ad-container {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    margin: 24px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.ad-placeholder-content {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.8rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
}

/* Win Celebration Overlay */
.celebration-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
}

.celebration-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: celebrationFall 1.5s ease-in forwards;
}

@keyframes celebrationFall {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(100vh) scale(0.3); }
}

/* Mobile */
@media (max-width: 600px) {
    .g4f-header {
        padding: 12px 16px;
    }

    .game-title {
        font-size: 2rem;
    }

    .game-hud {
        gap: 16px;
        padding: 8px 12px;
    }

    .hud-value {
        font-size: 1.1rem;
    }

    .neon-btn {
        padding: 12px 32px;
        font-size: 0.95rem;
    }

    .glass-panel {
        padding: 28px 20px;
        margin-top: 24px;
    }

    .canvas-wrapper {
        border-radius: 12px;
    }

    .size-selector {
        gap: 6px;
    }

    .size-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}
