/* Farm Plow Simulator - Clean Modern UI */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #4a7c23;
    --primary-dark: #3a6219;
    --accent: #c4a35a;
    --soil: #5d4037;
    --sky: #87CEEB;
    --text-light: #ffffff;
    --text-dark: #2c2c2c;
    --panel-bg: rgba(255, 255, 255, 0.92);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --radius: 12px;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, #87CEEB 0%, #98d4ee 100%);
    color: var(--text-dark);
    user-select: none;
    touch-action: none;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #a8d8a8 50%, #7cb342 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    padding: 40px;
}

.loading-icon {
    font-size: 80px;
    animation: bounce 1s infinite ease-in-out;
    margin-bottom: 20px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.loading-content h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(255,255,255,0.5);
}

.loading-bar {
    width: 280px;
    max-width: 80vw;
    height: 8px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 20px;
}

.loading-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: width 0.3s ease;
    border-radius: 4px;
}

#loading-text {
    color: var(--text-dark);
    opacity: 0.7;
    font-size: 0.95rem;
}

/* Game Container */
#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    pointer-events: none;
    z-index: 100;
}

.stat-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 16px 24px;
    box-shadow: var(--shadow);
    display: inline-flex;
    gap: 30px;
    pointer-events: auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.progress-bar {
    width: 120px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #8bc34a);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Mobile Controls - Virtual Joystick */
#mobile-controls {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 100;
    display: none;
    pointer-events: none;
}

.virtual-joystick {
    position: relative;
    width: 140px;
    height: 140px;
    pointer-events: auto;
}

.joystick-base {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 3px solid rgba(74, 124, 35, 0.5);
    box-shadow: var(--shadow), inset 0 0 30px rgba(0,0,0,0.1);
}

.joystick-knob {
    position: absolute;
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.3);
    transition: transform 0.05s ease-out;
    pointer-events: none;
}

.joystick-knob.active {
    background: linear-gradient(145deg, #5a9c2d, var(--primary));
    box-shadow: 0 2px 10px rgba(0,0,0,0.4), inset 0 2px 0 rgba(255,255,255,0.3);
}

/* Rotate Device Overlay - Hidden by default */
#rotate-device-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #a8d8a8 50%, #7cb342 100%);
    display: none !important;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    text-align: center;
}

.rotate-content {
    padding: 40px;
}

.rotate-icon {
    font-size: 80px;
    animation: rotatePhone 2s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(90deg); }
}

.rotate-content p {
    font-size: 1.3rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* Field Complete Notification */
#field-complete {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    70% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.notification-content {
    background: var(--panel-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 30px 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-icon {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
}

.notification-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Health Panel */
.health-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    gap: 15px;
    margin-top: 12px;
    pointer-events: auto;
}

.health-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
}

.health-icon {
    font-size: 1.2rem;
}

.health-bar {
    width: 150px;
    height: 14px;
    background: #e0e0e0;
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 7px;
}

.health-fill.warning {
    background: linear-gradient(90deg, #FF9800, #FFC107);
}

.health-fill.danger {
    background: linear-gradient(90deg, #f44336, #FF5722);
    animation: pulse-danger 0.5s infinite alternate;
}

@keyframes pulse-danger {
    0% { opacity: 1; }
    100% { opacity: 0.7; }
}

.health-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    min-width: 45px;
}

/* Health Row - contains health panel and action buttons */
.health-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    pointer-events: auto;
}

.health-row-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.health-row-btn {
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.health-row-btn.other-games {
    background: linear-gradient(135deg, var(--accent), #b8963d);
    color: white;
}

.health-row-btn.other-games:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 163, 90, 0.4);
}

.health-row-btn.share {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
}

.health-row-btn.share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* Game Over Screen */
#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.game-over-content {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.game-over-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.game-over-content h2 {
    font-size: 2rem;
    color: #d32f2f;
    margin-bottom: 10px;
}

.game-over-content p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 25px;
}

.game-over-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
}

.final-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.final-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.final-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.restart-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(74, 124, 35, 0.4);
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 124, 35, 0.5);
}

.restart-btn:active {
    transform: translateY(0);
}

/* See Other Games Button */
.other-games-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #b8963d);
    color: white;
    text-decoration: none;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(196, 163, 90, 0.4);
    margin-top: 15px;
}

.other-games-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 163, 90, 0.5);
}

.other-games-btn:active {
    transform: translateY(0);
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* ============================================================================
   COIN DISPLAY & HUD GARAGE BUTTON
   ============================================================================ */

.coin-display .stat-value {
    color: #FFD700;
}

.coin-display .stat-value::before {
    content: '🪙 ';
}

.level-display .stat-value {
    color: var(--primary);
    font-size: 1.1rem;
}

.level-display .stat-label {
    font-weight: 600;
    color: var(--primary-dark);
}

.field-shape {
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-garage-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-dark);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    pointer-events: auto;
}

.hud-garage-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Right side button group */
.hud-right-buttons {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-direction: column !important;
    gap: 10px !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
}

.hud-btn {
    background: var(--panel-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none !important;
    border-radius: var(--radius) !important;
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: var(--shadow) !important;
    transition: all 0.2s ease !important;
    text-align: center !important;
    display: block !important;
}

.hud-other-games-btn {
    color: var(--accent) !important;
}

.hud-other-games-btn:hover {
    background: var(--accent) !important;
    color: white !important;
    transform: translateY(-2px);
}

.hud-share-btn {
    color: #4a90d9 !important;
}

.hud-share-btn:hover {
    background: #4a90d9 !important;
    color: white !important;
    transform: translateY(-2px);
}

/* Share button on game over screen */
.share-btn {
    background: linear-gradient(135deg, #4a90d9, #357abd) !important;
}

/* ============================================================================
   LEVEL COMPLETE SCREEN
   ============================================================================ */

#level-complete-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 400;
    animation: fadeIn 0.3s ease;
}

.level-complete-content {
    background: linear-gradient(145deg, #1a2332, #121826);
    border-radius: 24px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    animation: slideUp 0.4s ease;
    max-width: 90vw;
}

.level-complete-icon {
    font-size: 70px;
    margin-bottom: 15px;
}

.level-complete-content h2 {
    font-size: 1.8rem;
    color: #E6EDF6;
    margin-bottom: 25px;
}

.coins-earned {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 25px;
}

.coins-earned-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.coins-earned-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    animation: coinPulse 0.6s ease;
}

@keyframes coinPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.coins-breakdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: #888;
}

.coins-breakdown span {
    background: rgba(255,255,255,0.05);
    padding: 4px 10px;
    border-radius: 6px;
}

.level-complete-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ============================================================================
   COIN TOAST ANIMATION
   ============================================================================ */

.coin-toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a1a;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 600;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
    animation: toastIn 0.5s ease forwards;
}

.coin-toast.hiding {
    animation: toastOut 0.5s ease forwards;
}

@keyframes toastIn {
    0% { transform: translateX(-50%) translateY(-30px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes toastOut {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-30px); opacity: 0; }
}

/* ============================================================================
   GARAGE/SHOP SCREEN
   ============================================================================ */

#garage-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 20, 0.95);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 500;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.garage-overlay {
    width: 100%;
    max-width: 900px;
    padding: 30px;
}

.garage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.garage-header h1 {
    font-size: 2rem;
    color: #E6EDF6;
    margin: 0;
}

.garage-coins {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 215, 0, 0.15);
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.garage-coins .coin-icon {
    font-size: 1.5rem;
}

.garage-coins span:last-child {
    font-size: 1.4rem;
    font-weight: 700;
    color: #FFD700;
}

/* Upgrade Grid */
.upgrade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Upgrade Cards */
.upgrade-card {
    background: linear-gradient(145deg, #1a2332, #121826);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.3s ease;
}

.upgrade-card:hover {
    border-color: rgba(0, 229, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.upgrade-card.purchased {
    animation: purchaseGlow 0.5s ease;
}

@keyframes purchaseGlow {
    0% { box-shadow: 0 0 0 rgba(0, 229, 255, 0); }
    50% { box-shadow: 0 0 30px rgba(0, 229, 255, 0.5); }
    100% { box-shadow: 0 0 0 rgba(0, 229, 255, 0); }
}

.upgrade-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 12px;
}

.upgrade-icon {
    font-size: 2rem;
    background: rgba(0, 229, 255, 0.1);
    padding: 10px;
    border-radius: 12px;
}

.upgrade-title h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    color: #E6EDF6;
}

.upgrade-level {
    font-size: 0.8rem;
    color: #00E5FF;
}

.upgrade-desc {
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.upgrade-effects {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.effect-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.effect-label {
    font-size: 0.8rem;
    color: #666;
}

.effect-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.current-effect {
    color: #8BC34A;
}

.next-effect {
    color: #00E5FF;
}

.next-effect-row.hidden-effect {
    display: none;
}

.upgrade-buy-btn {
    width: 100%;
    background: linear-gradient(135deg, #00E5FF, #00B8D4);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #0B0F14;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.upgrade-buy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 229, 255, 0.4);
}

.upgrade-buy-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
}

.upgrade-buy-btn.maxed {
    background: linear-gradient(135deg, #8BC34A, #689F38);
}

.upgrade-buy-btn .coin-icon {
    font-size: 1rem;
}

/* Garage Footer */
.garage-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 14px 35px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(74, 124, 35, 0.4);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #E6EDF6;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 14px 35px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

.btn-danger {
    background: rgba(255, 59, 59, 0.2);
    color: #FF3B3B;
    border: 1px solid rgba(255, 59, 59, 0.3);
    padding: 14px 25px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: #FF3B3B;
    color: white;
}

/* Reset Confirmation Dialog */
#reset-confirm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 600;
}

.confirm-dialog {
    background: linear-gradient(145deg, #1a2332, #121826);
    border-radius: 20px;
    padding: 35px 45px;
    text-align: center;
    max-width: 400px;
    border: 1px solid rgba(255, 59, 59, 0.3);
}

.confirm-dialog h3 {
    color: #FF3B3B;
    font-size: 1.4rem;
    margin: 0 0 15px 0;
}

.confirm-dialog p {
    color: #888;
    font-size: 0.95rem;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-panel {
        padding: 12px 16px;
        gap: 20px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .progress-bar {
        width: 80px;
    }

    .health-panel {
        padding: 10px 15px;
        gap: 10px;
    }

    .health-bar {
        width: 100px;
    }

    .health-label {
        font-size: 0.75rem;
    }

    .health-value {
        font-size: 1rem;
    }

    .game-over-content {
        padding: 30px 40px;
    }

    .game-over-icon {
        font-size: 60px;
    }

    .game-over-content h2 {
        font-size: 1.5rem;
    }

    .game-over-stats {
        gap: 20px;
    }

    .final-value {
        font-size: 1.4rem;
    }

    #mobile-controls {
        display: block;
    }

    /* Garage responsive */
    .garage-overlay {
        padding: 15px;
    }

    .garage-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .garage-header h1 {
        font-size: 1.6rem;
    }

    .upgrade-grid {
        grid-template-columns: 1fr;
    }

    .upgrade-card {
        padding: 18px;
    }

    .garage-footer {
        flex-direction: column;
    }

    .level-complete-content {
        padding: 30px 25px;
    }

    .coins-breakdown {
        flex-direction: column;
        gap: 8px;
    }

    .level-complete-buttons {
        flex-direction: column;
    }

    .hud-garage-btn {
        top: auto;
        bottom: 20px;
        right: 20px;
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .hud-right-buttons {
        bottom: 70px !important;
        right: 15px !important;
    }

    .hud-btn {
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
    }
}

/* Touch devices - show joystick */
@media (pointer: coarse) {
    #mobile-controls {
        display: block;
    }
}

/* Mobile Portrait - Show rotate overlay - DISABLED FOR TESTING
@media screen and (max-width: 900px) and (orientation: portrait) and (pointer: coarse) {
    #rotate-device-overlay {
        display: flex !important;
    }

    #game-container {
        visibility: hidden;
    }
}
*/

/* Mobile Portrait - Button positioning */
@media screen and (orientation: portrait) {
    .health-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .health-row-buttons {
        margin-top: 5px;
    }

    .health-row-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .hud-garage-btn {
        position: fixed !important;
        bottom: 20px !important;
        left: auto !important;
        right: 20px !important;
        z-index: 150 !important;
    }
}

/* Mobile Landscape - Optimize layout */
@media screen and (max-width: 900px) and (orientation: landscape) and (pointer: coarse) {
    #rotate-device-overlay {
        display: none;
    }

    #hud {
        padding: 10px 15px;
    }

    .stat-panel {
        padding: 8px 12px;
        gap: 15px;
        font-size: 0.85rem;
    }

    .stat-value {
        font-size: 0.95rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .progress-bar {
        width: 60px;
        height: 6px;
    }

    .health-panel {
        padding: 6px 12px;
        gap: 8px;
    }

    .health-bar {
        width: 80px;
        height: 10px;
    }

    .health-value {
        font-size: 0.85rem;
    }

    #mobile-controls {
        display: block;
        bottom: 15px;
        left: 15px;
    }

    .virtual-joystick {
        width: 120px;
        height: 120px;
    }

    .joystick-knob {
        width: 50px;
        height: 50px;
    }

    .hud-garage-btn {
        top: 10px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .hud-right-buttons {
        top: 45px !important;
        bottom: auto !important;
        right: 15px !important;
    }

    .hud-btn {
        padding: 6px 12px !important;
        font-size: 0.7rem !important;
    }
}
