/* Global Utilities */
.hidden {
    display: none !important;
}

/* Reset and base styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #000;
    color: #fff;
}

/* Game Overlay */
#game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: #000;
    transition: opacity 1s ease;
}

#game-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

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

/* Game Instructions */
#game-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#game-instructions.fade-out {
    opacity: 0;
}

.game-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 2rem;
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

.game-subtitle {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.game-goal {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Game Score */
#game-score {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: #fff;
    z-index: 1001;
}

/* Main Site (hidden initially) */
#main-site {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    z-index: -1;
    transition: opacity 1s ease, visibility 1s ease;
}

#main-site.hidden {
    display: none;
    visibility: hidden;
    z-index: -1;
}

#main-site.fade-in {
    display: block;
    visibility: visible;
    opacity: 1;
    z-index: 1;
}

/* Smokey Fluid canvas */
#smokey-fluid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Contact button - dark with white outline */
.contact-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.9rem 2rem;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    z-index: 100;
    overflow: hidden;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.contact-btn .btn-text {
    position: relative;
    z-index: 2;
}

/* Dynamic glow effect */
.contact-btn .btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: 1;
}

.contact-btn:hover {
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.1),
        0 0 30px rgba(255, 255, 255, 0.05);
}

.contact-btn:hover .btn-glow {
    width: 300px;
    height: 300px;
}

/* Helsinki Clock (Left) */
.clock-container {
    position: absolute;
    bottom: 1.5rem;
    /* Aligned with footer area */
    left: 2rem;
    /* All the way in the left corner */
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    /* Match footer size */
    letter-spacing: 0.05em;
    z-index: 10;
}

#clock-time {
    font-variant-numeric: tabular-nums;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    /* Match footer color */
}

/* Location (Right) */
#location-container {
    position: absolute;
    bottom: 1.5rem;
    right: 2rem;
    text-align: right;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    z-index: 10;
    color: rgba(255, 255, 255, 0.5);
    /* Match footer color */
    font-weight: 400;
    /* Normal weight */
    text-transform: none;
    /* Ensure no capitalization */
}

/* Footer (Center) */
.footer {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    /* Updated color to match others */
    letter-spacing: 0.05em;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through if needed */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.2rem;
    }

    .game-subtitle {
        font-size: 0.5rem;
    }

    .game-goal {
        font-size: 0.45rem;
    }

    #game-score {
        font-size: 0.7rem;
    }

    .contact-btn {
        padding: 0.75rem 1.75rem;
        font-size: 0.8rem;
    }

    .footer {
        bottom: 1rem;
        font-size: 0.55rem;
    }
}

/* Skip Button - Updated to match score style */
.skip-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
    /* Ensure above canvas */
}

.skip-btn:hover {
    color: #fff;
}

/* Level Complete Overlay */
#level-complete {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    width: 100%;
}

#level-complete.hidden {
    display: none;
}

.level-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.2rem;
    /* Responsive sizing might be needed */
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.level-buttons {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    /* allow wrapping on mobile */
    justify-content: center;
}

.level-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    padding: 1rem 1.5rem;
    border: 2px solid #fff;
    cursor: pointer;
    background: transparent;
    color: #fff;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.level-btn.primary {
    background: #fff;
    color: #000;
}

.level-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.level-btn.primary:hover {
    background: #f0f0f0;
}

.level-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive for Level Complete */
@media (max-width: 768px) {
    .level-title {
        font-size: 0.9rem;
    }

    .level-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .level-btn {
        width: 200px;
        /* Fixed width for consistency on mobile */
        font-size: 0.6rem;
        padding: 0.8rem;
    }
}

/* Game Over & Leaderboard Styles */
#game-over,
#leaderboard-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    text-align: center;
}

.game-over-content,
.leaderboard-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 20px;
    width: 95%;
    max-width: 500px;
}

.game-over-score {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #fff;
    font-weight: 500;
}

#leaderboard-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#leaderboard-form input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem;
    font-family: 'Inter', sans-serif;
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#leaderboard-form input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

#leaderboard-list {
    margin: 2rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.1rem;
}

.leaderboard-entry .name {
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    font-weight: 500;
}

.leaderboard-entry .score {
    color: #fff;
    font-weight: 600;
    font-family: monospace;
}

.leaderboard-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.loading {
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}