* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: #0d0d0d;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    touch-action: none;
}

.game-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    box-shadow: 0 0 30px rgba(0,0,0,0.9);
    transition: box-shadow 0.2s;
}

.game-container.flash-success {
    box-shadow: inset 0 0 50px rgba(0, 255, 204, 0.3), 0 0 30px rgba(0,0,0,0.9);
}

.header {
    display: flex;
    justify-content: space-between;
    padding: 20px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #888;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid #222;
}

#score, #highScore {
    color: #00ffcc;
    font-size: 1.5rem;
    margin-left: 8px;
    text-shadow: 0 0 5px rgba(0,255,204,0.4);
}

.lock-stage {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 10px;
}

.pin {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #222;
    border: 3px solid #444;
    box-shadow: inset 0 0 8px #000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pin.active {
    background-color: #00ffcc;
    border-color: #fff;
    box-shadow: 0 0 15px #00ffcc, inset 0 0 5px #fff;
    transform: scale(1.1);
}

.canvas-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

canvas {
    max-width: 100%;
    max-height: 100%;
}

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

.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#startScreen h2 {
    color: #00ffcc;
    text-shadow: 0 0 15px rgba(0, 255, 204, 0.6);
}

#gameOverScreen h2 {
    color: #ff3366;
    text-shadow: 0 0 15px rgba(255, 51, 102, 0.6);
}

.overlay p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 15px;
}

#finalScore {
    color: #fff;
    font-size: 1.8rem;
    font-weight: bold;
}

.blink {
    animation: blink 1.2s infinite;
    margin-top: 30px !important;
    font-size: 1.3rem !important;
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}
