:root {
    --bg-dark: #0a0a0c;
    --surface: #1a1a1e;
    --accent: #ff4757;
    --primary: #2ed573;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --font-main: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.game-container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #000;
}

.game-header {
    padding: 1rem;
    background: var(--surface);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

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

.stat-item .label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.stat-item .value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    width: 100%;
    height: 100%;
    background: var(--primary);
    transition: width 1s linear, background-color 0.3s ease;
}

.images-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
    overflow: hidden;
}

.image-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #111;
    cursor: crosshair;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
}

.differences-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.diff-point {
    position: absolute;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    /* background: rgba(255,0,0,0.2); Uncomment for debugging */
    border-radius: 50%;
}

.marker {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: foundPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.marker::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary);
    font-weight: bold;
}

.penalty-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 71, 87, 0.3);
    pointer-events: none;
    opacity: 0;
    z-index: 10;
}

@keyframes penaltyFade {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes foundPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}

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

.overlay-content {
    padding: 2rem;
}

.overlay h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.overlay h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.overlay p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.btn {
    background: var(--text);
    color: var(--bg-dark);
    border: none;
    padding: 1rem 2rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

#restart-btn {
    background: var(--accent);
    color: #fff;
}