:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #ec4899;
    --primary-hover: #db2777;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; touch-action: manipulation; user-select: none; }

.new-game-wrapper {
    background-color: var(--bg-color); color: var(--text-main);
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; overflow: hidden;
}

#game-container {
    width: 100%; max-width: 500px; background-color: var(--card-bg);
    border-radius: 16px; padding: 16px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    position: relative;
    min-height: 600px;
    display: flex; flex-direction: column;
}

.screen { display: none; flex-direction: column; align-items: center; text-align: center; animation: fadeIn 0.3s; flex: 1; justify-content: center; }
.screen.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.game-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 16px; color: #fbcfe8; }
.instructions { color: var(--text-muted); margin-bottom: 32px; line-height: 1.6; padding: 0 20px; font-size: 1.1rem; }
.final-score { font-size: 2rem; font-weight: 700; color: #fbcfe8; margin-bottom: 16px; }
.rank-title { font-size: 1.5rem; font-weight: bold; color: #fcd34d; margin-bottom: 24px; }

.btn {
    border: none; padding: 12px 24px; border-radius: 8px; font-size: 1.1rem; font-weight: 700;
    color: white; cursor: pointer; transition: all 0.2s; width: 100%; max-width: 250px;
}
.btn:active { transform: scale(0.95); }
.btn.primary { background-color: var(--primary); }
.btn.primary:hover { background-color: var(--primary-hover); }

.header { display: flex; justify-content: space-between; width: 100%; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid #334155; font-weight: 700; font-size: 1.1rem; color: #fbcfe8; }

.game-area { width: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative;}

#reaction-zone {
    width: 100%; height: 100%; border-radius: 12px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer; transition: background 0.1s; user-select: none;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}

#zone-text { font-size: 2.5rem; font-weight: 900; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
#zone-sub { font-size: 1.2rem; opacity: 0.8; margin-top: 10px; }

/* States */
.state-idle { background: #334155; color: #fff; }
.state-wait { background: var(--danger); color: #fff; }
.state-go { background: var(--success); color: #000; }
.state-result { background: var(--primary); color: #fff; }
.state-early { background: var(--warning); color: #000; }
