/* ===== BASE STYLES & VARIABLES ===== */
:root {
    --bg-dark: #0a0a0c;
    --bg-panel: #16161c;
    --text-main: #e0e0e0;
    --accent-color: #00ffcc;
    --neon-green: #39ff14;
    --neon-red: #ff073a;
    --font-arcade: 'Press Start 2P', monospace;
    --font-main: 'Roboto', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* ===== LAYOUT ===== */
.game-container {
    width: 100%;
    max-width: 1400px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== HEADER ===== */
.game-header {
    background: var(--bg-panel);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #2a2a35;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.1);
    text-align: center;
}

.game-title {
    font-family: var(--font-arcade);
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
    line-height: 1.5;
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #000;
    padding: 15px 30px;
    border-radius: 8px;
    border: 1px solid #333;
}

.timer {
    font-family: var(--font-arcade);
    font-size: 1.5rem;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.timer.warning {
    color: var(--neon-red);
    text-shadow: 0 0 10px rgba(255, 7, 58, 0.7);
    animation: blink 1s infinite;
}

.score {
    font-family: var(--font-arcade);
    font-size: 1rem;
    color: #fff;
}

#score-display {
    color: var(--neon-green);
    font-size: 1.5rem;
}

/* ===== GAME AREA ===== */
.game-area {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.image-wrapper {
    position: relative;
    max-width: 100%;
    /* Creates a dark framing around the image */
    border: 4px solid #333;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    overflow: hidden;
    user-select: none;
}

.game-image {
    display: block;
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    /* The pointer-events are active to capture clicks */
    cursor: crosshair;
}

.markers-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to the image */
}

/* ===== MARKERS & ANIMATIONS ===== */
.marker-correct {
    position: absolute;
    border: 3px solid var(--neon-green);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--neon-green), inset 0 0 15px var(--neon-green);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.marker-wrong {
    position: absolute;
    color: var(--neon-red);
    font-family: var(--font-main);
    font-weight: bold;
    font-size: 2rem;
    transform: translate(-50%, -50%);
    text-shadow: 0 0 10px var(--neon-red);
    animation: flashWrong 0.8s forwards;
    opacity: 0;
}

/* ===== OVERLAY MODALS ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    background: var(--bg-panel);
    padding: 50px;
    border-radius: 12px;
    border: 2px solid var(--accent-color);
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 255, 204, 0.2);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.overlay.hidden .overlay-content {
    transform: scale(0.8);
}

#overlay-title {
    font-family: var(--font-arcade);
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 2px 2px 0px var(--accent-color);
}

.arcade-btn {
    background: transparent;
    color: var(--accent-color);
    font-family: var(--font-arcade);
    font-size: 1rem;
    padding: 15px 30px;
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.arcade-btn:hover {
    background: var(--accent-color);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--accent-color);
}

/* ===== KEYFRAMES ===== */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    80% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes flashWrong {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .stats-bar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .game-title {
        font-size: 0.9rem;
    }
    
    #overlay-title {
        font-size: 1.5rem;
    }
}
