/* ===== Parking Puzzle Game Styles ===== */

.game-container {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
    min-height: 400px;
}

/* ===== SCREENS ===== */
.screen { display: none; }
.screen.active { display: block; }

/* ===== MENU ===== */
.menu-title {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #1e293b;
}
.menu-sub {
    text-align: center;
    color: #64748b;
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
}
.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 8px;
}
.level-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    border-radius: 14px;
    border: 3px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    min-height: 80px;
    -webkit-tap-highlight-color: transparent;
}
.level-btn:active { transform: scale(0.95); }
.level-btn:hover { border-color: #a78bfa; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.level-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: #e2e8f0;
}
.level-btn.locked:hover { border-color: #e2e8f0; box-shadow: none; }
.level-btn.completed { border-color: #22c55e; background: #f0fdf4; }
.level-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: #6366f1;
    line-height: 1;
}
.level-btn.completed .level-num { color: #22c55e; }
.level-btn.locked .level-num { color: #94a3b8; font-size: 1.3rem; }
.level-name {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 4px;
    text-align: center;
    line-height: 1.2;
}

/* ===== GAME SCREEN ===== */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 10px;
}
.game-hdr-btn {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    color: #475569;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.game-hdr-btn:hover { background: #e2e8f0; }
.game-hdr-btn:active { transform: scale(0.96); }

.level-info {
    text-align: center;
}
.level-info .lbl {
    font-weight: 800;
    color: #1e293b;
    font-size: 1.05rem;
}
.level-info .moves {
    font-size: 0.8rem;
    color: #64748b;
}

.canvas-wrap {
    display: flex;
    justify-content: center;
    position: relative;
    touch-action: none;
}
#gameCanvas {
    border-radius: 12px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.game-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 12px;
}
.footer-btn {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 22px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    color: #475569;
    transition: background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.footer-btn:hover { background: #e2e8f0; }
.footer-btn:active { transform: scale(0.95); }
.footer-btn.hint-btn { color: #eab308; }

.hint-bar {
    text-align: center;
    padding: 8px 12px;
    margin-top: 8px;
    background: #fefce8;
    border: 2px solid #fde68a;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #854d0e;
    font-weight: 600;
    display: none;
}
.hint-bar.show { display: block; }

/* ===== WIN OVERLAY ===== */
.win-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 16px;
    animation: fadeIn 0.3s ease;
}
.win-overlay.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.win-content {
    background: white;
    border-radius: 20px;
    padding: 28px 32px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 300px;
    width: 90%;
}
@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.win-emoji { font-size: 3rem; margin-bottom: 4px; }
.win-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}
.win-moves {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 16px;
}
.win-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    margin-bottom: 8px;
    transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.win-btn:active { transform: scale(0.96); }
.win-btn.next {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}
.win-btn.menu {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
    .level-grid { gap: 8px; }
    .level-btn { padding: 10px 6px; min-height: 68px; }
    .level-num { font-size: 1.3rem; }
    .menu-title { font-size: 1.4rem; }
}
