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

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; touch-action: 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: #fcd34d; }
.instructions { color: var(--text-muted); margin-bottom: 32px; line-height: 1.6; padding: 0 20px; }
.final-score { font-size: 1.5rem; font-weight: 700; color: #fcd34d; margin-bottom: 24px; }

.btn {
    border: none; padding: 12px 24px; border-radius: 8px; font-size: 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: 16px; padding-bottom: 12px; border-bottom: 1px solid #334155; font-weight: 700; font-size: 1.1rem; color: #fcd34d; }

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

#parking-lot {
    width: 300px; height: 300px;
    background: #334155;
    border: 4px solid #475569;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.car {
    position: absolute;
    width: 30px; height: 40px;
    font-size: 24px;
    display: flex; justify-content: center; align-items: center;
    transform-origin: center;
    transition: transform 0.1s linear, top 0.1s linear, left 0.1s linear;
    z-index: 10;
}

.parking-zone {
    position: absolute;
    width: 50px; height: 60px;
    border: 3px dashed var(--primary);
    background: rgba(245, 158, 11, 0.2);
    display: flex; justify-content: center; align-items: center;
    color: var(--primary); font-weight: bold; font-size: 1.5rem;
    z-index: 1;
}
.parking-zone.active { border-color: var(--success); background: rgba(16, 185, 129, 0.4); color: var(--success); }

.obstacle {
    position: absolute;
    width: 30px; height: 30px;
    display: flex; justify-content: center; align-items: center;
    font-size: 20px;
    z-index: 5;
}

.controls-area { margin-top: 16px; display: flex; flex-direction: column; align-items: center; }
.dpad { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dpad-row { display: flex; gap: 8px; }
.ctrl-btn {
    background: #334155; border: none; color: #fff; font-size: 1.5rem;
    width: 60px; height: 60px; border-radius: 8px; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
}
.ctrl-btn:active { background: #475569; }
