:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --board-bg: #1e293b;
    --red: #ef4444;
    --blue: #3b82f6;
    --yellow: #eab308;
    --green: #22c55e;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    touch-action: none;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    z-index: 1;
}

header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    margin-bottom: 30px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #94a3b8;
}

header span {
    color: var(--text-color);
}

.status-banner {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    min-height: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.3s ease;
}

.board-container {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    width: 100%;
    height: 100%;
    background-color: var(--board-bg);
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 0 20px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
}

.game-board.locked {
    pointer-events: none;
}

.quadrant {
    background-color: #333;
    border-radius: 20px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.quadrant:active {
    transform: scale(0.96);
}

.game-board.locked .quadrant:active {
    transform: none;
}

.quadrant:nth-child(1) { border-top-left-radius: 100%; }
.quadrant:nth-child(2) { border-top-right-radius: 100%; }
.quadrant:nth-child(3) { border-bottom-left-radius: 100%; }
.quadrant:nth-child(4) { border-bottom-right-radius: 100%; }

.red { background-color: var(--red); }
.blue { background-color: var(--blue); }
.yellow { background-color: var(--yellow); }
.green { background-color: var(--green); }

.quadrant.flash {
    opacity: 1;
    transform: scale(1.02);
    z-index: 2;
}

.red.flash { box-shadow: inset 0 0 20px rgba(255,255,255,0.6), 0 0 40px var(--red); }
.blue.flash { box-shadow: inset 0 0 20px rgba(255,255,255,0.6), 0 0 40px var(--blue); }
.yellow.flash { box-shadow: inset 0 0 20px rgba(255,255,255,0.6), 0 0 40px var(--yellow); }
.green.flash { box-shadow: inset 0 0 20px rgba(255,255,255,0.6), 0 0 40px var(--green); }

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    text-align: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.overlay h2 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.overlay p {
    font-size: 1.5rem;
    color: #cbd5e1;
    margin-bottom: 30px;
}

.restart-prompt {
    font-size: 1.25rem !important;
    color: #94a3b8 !important;
    animation: pulse 1.5s infinite;
    cursor: pointer;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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

@media (max-height: 700px) {
    header { margin-bottom: 15px; }
    .status-banner { margin-bottom: 20px; font-size: 1.25rem; }
    .board-container { max-width: 320px; }
}

@media (max-width: 400px) {
    .overlay h2 { font-size: 2.5rem; }
    .overlay p { font-size: 1.25rem; }
}
