/* ==========================================================================
   GAME DESIGN SYSTEM & STYLESHEET (index.css)
   ========================================================================== */

:root {
    --bg-dark: #090d16;
    --panel-bg: rgba(18, 26, 44, 0.75);
    --panel-border: rgba(255, 255, 255, 0.08);
    --primary: #f59e0b;
    --primary-hover: #d97706;
    --primary-glow: rgba(245, 158, 11, 0.3);

    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    --accent: #06b6d4;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;

    --font-game: "Outfit", sans-serif;
    --font-retro: "Press Start 2P", monospace;
}

/* ==========================================================================
   WARUNG IBU ANIMATIONS (ANDROID STYLE)
   ========================================================================== */

@keyframes food-fly-to-customer {
    0% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) translate(0, -50px);
        opacity: 1;
    }
    100% {
        transform: scale(0.5) translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

.food-fly-element {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-size: 30px;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

@keyframes customer-happy {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
}

.customer-receiving {
    animation: customer-happy 0.5s ease-out !important;
}

@keyframes plus-one-float {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}

.plus-one-effect {
    position: absolute;
    color: #10b981;
    font-weight: bold;
    font-family: var(--font-retro);
    font-size: 20px;
    pointer-events: none;
    animation: plus-one-float 1s forwards;
    z-index: 100;
}

/* Base Styles & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-game);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image:
        radial-gradient(at 10% 20%, rgba(13, 20, 40, 1) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(9, 15, 30, 1) 0px, transparent 50%);
}

/* Main Container Wrapper */
#game-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   HUD / HEADER
   -------------------------------------------------------------------------- */
#hud {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    width: 100%;
    z-index: 10;
}

.hud-item {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.hud-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.hud-label {
    font-family: var(--font-retro);
    font-size: 8px;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.hud-value {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Custom H-Bar (Stamina) CSS */
#hud-money .hud-value {
    color: #4ade80; /* Hijau Duit */
    font-family: var(--font-retro);
    font-size: 14px;
}

.stamina-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stamina-icon {
    font-family: var(--font-retro);
    font-size: 12px;
    font-weight: bold;
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulse-red 2s infinite ease-in-out;
}

.stamina-bar {
    flex-grow: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

#stamina-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #10b981 100%);
    width: 100%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.stamina-text {
    font-size: 12px;
    font-weight: 700;
    width: 35px;
    text-align: right;
}

/* Custom Cleanliness Bar CSS */
#clean-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
    width: 100%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.clean-icon {
    font-family: var(--font-retro);
    font-size: 12px;
    font-weight: bold;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

/* --------------------------------------------------------------------------
   GAME CANVAS CONTAINER
   -------------------------------------------------------------------------- */
#canvas-container {
    flex-grow: 1;
    position: relative;
    background: #111827;
    border: 4px solid #1e293b;
    border-radius: 16px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.6),
        inset 0 0 20px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    image-rendering: pixelated; /* Biar pixel art nya tetap tajam! */
    cursor: default;
    transition: filter 0.5s ease;
}

/* Overlays untuk Siklus Siang-Malam */
#canvas-overlay-time {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Biar tetap bisa klik canvas di bawahnya */
    mix-blend-mode: multiply;
    transition: background-color 2s ease;
    border-radius: 12px;
}

/* --------------------------------------------------------------------------
   CONSOLE LOG / FOOTER
   -------------------------------------------------------------------------- */
#console-log {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.log-title {
    font-family: var(--font-retro);
    font-size: 8px;
    color: var(--primary);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

#log-content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-main);
    overflow-y: auto;
    max-height: 50px;
}

/* --------------------------------------------------------------------------
   MODALS (UI OVERLAYS)
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 8, 17, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.glassmorphism {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 2px rgba(255, 255, 255, 0.2);
}

.modal-content {
    border-radius: 20px;
    width: 90%;
    max-width: 550px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-title {
    font-family: var(--font-retro);
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.highlight {
    color: var(--primary);
    font-weight: 700;
}

/* Travel Options */
.travel-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.travel-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    cursor: pointer;
    text-align: left;
    color: var(--text-main);
    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.2s;
}

.travel-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
    transform: scale(1.02);
}

.travel-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.05);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.travel-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.travel-name {
    font-size: 16px;
    font-weight: 700;
}

.travel-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.free {
    color: var(--success);
}
.cost {
    color: var(--primary);
}
.minus {
    color: var(--danger);
}

/* Building Action Cards */
.building-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    border-left: 3px solid var(--accent);
    padding-left: 12px;
}

.building-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition:
        background 0.2s,
        border-color 0.2s;
}

.action-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.action-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.action-name {
    font-size: 15px;
    font-weight: 700;
}

.action-effect {
    font-size: 12px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    font-family: var(--font-game);
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition:
        background 0.2s,
        transform 0.2s,
        box-shadow 0.2s;
    outline: none;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: var(--primary);
    color: #000000;
}

.btn-primary:hover {
    background: #fbbf24;
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: #ef4444ee;
    box-shadow: 0 0 15px var(--danger-glow);
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 12px;
}

.btn-pulse {
    animation: btn-glow-pulse 2s infinite ease-in-out;
}

.btn:disabled,
.btn.disabled {
    background: #374151 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    opacity: 0.5 !important;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   INTRO MODAL / TITLE SPECIFICS
   -------------------------------------------------------------------------- */
.text-center {
    text-align: center;
}

.game-logo {
    max-width: 140px;
    height: auto;
    margin: 0 auto 15px auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.game-title {
    font-family: var(--font-retro);
    font-size: 18px;
    line-height: 1.8;
    letter-spacing: 2px;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.intro-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

.tutorial-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 18px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tutorial-card h3 {
    font-size: 14px;
    font-family: var(--font-retro);
    color: var(--accent);
    font-size: 10px;
}

.tutorial-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tutorial-card li {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-main);
}

/* Collapsed Alert Specifics */
.danger-alert {
    border: 2px solid var(--danger);
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.25);
}

.warning-icon {
    font-size: 40px;
    animation: shake 0.5s infinite;
}

.danger-text {
    font-family: var(--font-retro);
    font-size: 11px;
    color: var(--danger);
}

/* --------------------------------------------------------------------------
   UTILITY & TOAST NOTIFICATION
   -------------------------------------------------------------------------- */
.toast-notification {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(6, 182, 212, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.3s ease,
        transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.toast-notification.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Sound Controller Switch */
#sound-control {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition:
        background 0.2s,
        transform 0.2s;
    z-index: 1000;
}

#sound-control:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   PROLOGUE MODAL — LEVEL 1 INTRO SCREEN
   -------------------------------------------------------------------------- */
.prologue-modal-content {
    max-width: 520px;
    gap: 16px;
    border-color: rgba(245, 158, 11, 0.25) !important;
    box-shadow:
        0 0 0 1px rgba(245, 158, 11, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.7),
        inset 0 0 40px rgba(245, 158, 11, 0.04) !important;
}

.prologue-level-badge {
    display: inline-block;
    font-family: var(--font-retro);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 30px;
    padding: 5px 16px;
    text-transform: uppercase;
    animation: badge-glow 2.5s infinite ease-in-out;
}

@keyframes badge-glow {
    0%,
    100% {
        box-shadow: 0 0 6px rgba(245, 158, 11, 0.2);
    }
    50% {
        box-shadow: 0 0 18px rgba(245, 158, 11, 0.5);
    }
}

.prologue-narasi {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.prologue-greeting {
    font-family: var(--font-retro);
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 1px;
}

.prologue-body {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
}

.prologue-body strong {
    color: var(--text-main);
}

.prologue-source {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 4px;
    padding: 1px 6px;
}

.prologue-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: linear-gradient(
        135deg,
        rgba(245, 158, 11, 0.08),
        rgba(245, 158, 11, 0.03)
    );
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 12px;
    padding: 14px 20px;
    margin: 4px 0;
    position: relative;
    overflow: hidden;
}

.prologue-stat-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(245, 158, 11, 0.07),
        transparent
    );
    animation: stat-shimmer 3s infinite ease-in-out;
}

@keyframes stat-shimmer {
    0% {
        left: -60%;
    }
    100% {
        left: 130%;
    }
}

.prologue-stat-label {
    font-family: var(--font-retro);
    font-size: 8px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.prologue-stat-value {
    font-family: var(--font-retro);
    font-size: 20px;
    font-weight: 800;
    color: #4ade80;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
    letter-spacing: 1px;
}

.prologue-stat-sub {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
}

.prologue-tips-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(6, 182, 212, 0.06);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    text-align: left;
}

.prologue-tips-icon {
    font-size: 22px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.5));
    animation: tip-bounce 2s infinite ease-in-out;
}

@keyframes tip-bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.prologue-tips-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.prologue-tips-text strong {
    color: var(--accent);
    font-family: var(--font-retro);
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   ANIMATIONS & KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes pulse-red {
    0%,
    100% {
        box-shadow: 0 0 5px rgba(239, 68, 68, 0.3);
        background: rgba(239, 68, 68, 0.15);
    }
    50% {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
        background: rgba(239, 68, 68, 0.3);
    }
}

@keyframes btn-glow-pulse {
    0%,
    100% {
        box-shadow: 0 0 5px var(--primary-glow);
    }
    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* ==========================================================================
   RESPONSIVE MOBILE — Comprehensive Fix
   ========================================================================== */

/* Tablet (≤900px) */
@media (max-width: 900px) {
    #game-wrapper {
        padding: 6px;
        gap: 8px;
        height: 100vh;
        max-height: 100vh;
    }

    #hud {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .hud-item {
        padding: 8px 10px;
        border-radius: 10px;
    }

    .hud-label {
        font-size: 6px;
        margin-bottom: 4px;
    }

    .hud-value {
        font-size: 13px;
    }

    #hud-money .hud-value {
        font-size: 11px;
    }

    .modal-content {
        padding: 18px;
        max-width: 95%;
    }
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
    body {
        overflow: hidden;
    }

    #game-wrapper {
        padding: 4px;
        gap: 6px;
        height: 100svh;
        max-height: 100svh;
    }

    /* HUD: 2 baris × 3 kolom */
    #hud {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    .hud-item {
        padding: 6px 8px;
        border-radius: 8px;
        box-shadow: none;
    }

    .hud-label {
        font-size: 5px;
        letter-spacing: 0;
        margin-bottom: 3px;
    }

    .hud-value {
        font-size: 11px;
        font-weight: 700;
    }

    #hud-money .hud-value {
        font-size: 9px;
    }

    /* Obligation badge: lebih kecil */
    #obligation-badge {
        font-size: 7px !important;
        margin-top: 2px !important;
    }

    /* Stamina bar: sedikit lebih tipis */
    .stamina-bar {
        height: 8px;
    }

    .stamina-icon,
    .clean-icon {
        width: 16px;
        height: 16px;
        font-size: 8px;
    }

    .stamina-text {
        font-size: 9px;
        width: 28px;
    }

    /* Canvas container */
    #canvas-container {
        border-width: 2px;
        border-radius: 10px;
        flex-grow: 0 !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 3 / 2 !important;
        overflow: hidden !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        background: #111827;
    }

    #gameCanvas {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
    }

    /* Console log fills the remaining space */
    #console-log {
        padding: 10px 14px;
        border-radius: 8px;
        flex-grow: 1 !important; /* Grow to fill the bottom of the screen */
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .log-title {
        font-size: 6px;
        margin-bottom: 0px;
        flex-shrink: 0;
    }

    #log-content {
        font-size: 11px;
        max-height: none !important;
        flex-grow: 1;
        overflow-y: auto;
    }

    /* Sound Control */
    #sound-control {
        bottom: 12px;
        right: 12px;
        padding: 5px 10px;
        font-size: 10px;
    }

    /* Toast */
    .toast-notification {
        bottom: 70px;
        font-size: 12px;
        padding: 8px 16px;
        max-width: 85%;
        text-align: center;
    }

    /* MODALS */
    .modal-overlay {
        padding: 8px;
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 85svh;
        overflow-y: auto;
        padding: 16px;
        gap: 12px;
        border-radius: 20px 20px 8px 8px;
        transform: translateY(30px) scale(0.98);
    }

    .modal-overlay.active .modal-content {
        transform: translateY(0) scale(1);
    }

    /* Modal tengah untuk modal penting */
    #prologue-modal,
    #intro-modal,
    #collapse-modal,
    #victory-modal {
        align-items: center;
    }

    #prologue-modal .modal-content,
    #intro-modal .modal-content,
    #collapse-modal .modal-content,
    #victory-modal .modal-content {
        border-radius: 20px;
        max-height: 90svh;
    }

    .modal-title {
        font-size: 11px;
        line-height: 1.5;
    }

    .modal-subtitle {
        font-size: 12px;
    }

    .intro-text {
        font-size: 12px;
    }

    .game-title {
        font-size: 14px;
        letter-spacing: 1px;
    }

    /* Travel Buttons */
    .travel-options {
        gap: 8px;
    }

    .travel-btn {
        padding: 10px 12px;
        gap: 12px;
        border-radius: 10px;
    }

    .travel-icon {
        font-size: 22px;
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    .travel-name {
        font-size: 14px;
    }

    .travel-meta {
        font-size: 11px;
    }

    /* Action Cards */
    .action-card {
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .action-name {
        font-size: 13px;
    }

    .action-effect {
        font-size: 11px;
    }

    .btn {
        padding: 9px 16px;
        font-size: 13px;
    }

    .btn-large {
        padding: 12px 20px;
        font-size: 14px;
    }

    .modal-footer {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tutorial-card {
        padding: 12px;
    }

    .tutorial-card h3 {
        font-size: 9px;
    }

    .tutorial-card li {
        font-size: 11px;
    }

    /* Kebun Garden Grid: 2 kolom di mobile */
    .garden-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .garden-plot-card {
        min-height: 100px;
        padding: 8px;
    }

    .garden-plot-emoji {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .garden-plot-status {
        font-size: 6px;
    }

    /* Prologue specific */
    .prologue-modal-content {
        gap: 10px;
    }

    .prologue-level-badge {
        font-size: 7px;
        padding: 4px 12px;
    }

    .prologue-stat-value {
        font-size: 16px;
    }

    .prologue-body,
    .prologue-tips-text {
        font-size: 11px;
    }

    /* Warning icon */
    .warning-icon {
        font-size: 30px;
    }
}

/* Very small phones (≤380px) */
@media (max-width: 380px) {
    #hud {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    #hud-cleanliness {
        display: none;
    }

    .hud-value {
        font-size: 10px;
    }

    #hud-money .hud-value {
        font-size: 9px;
    }

    .garden-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-title {
        font-size: 10px;
    }
}

/* Landscape mode di HP */
@media (max-height: 500px) and (orientation: landscape) {
    #game-wrapper {
        gap: 4px;
        padding: 4px;
    }

    #hud {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }

    .hud-item {
        padding: 4px 6px;
    }

    .hud-label {
        display: none;
    }

    .hud-value {
        font-size: 10px;
    }

    #hud-money .hud-value {
        font-size: 9px;
    }

    .stamina-bar {
        height: 6px;
    }

    .stamina-icon,
    .clean-icon {
        width: 14px;
        height: 14px;
        font-size: 7px;
    }

    .stamina-text {
        font-size: 8px;
    }

    #console-log {
        padding: 4px 10px;
    }

    #log-content {
        font-size: 10px;
        max-height: 28px;
    }

    .modal-content {
        max-height: 92svh;
        overflow-y: auto;
    }

    .modal-overlay {
        align-items: center;
    }
}

/* Garden/Planting Interactive System */
.garden-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    margin: 10px 0;
}

.garden-plot-card {
    background: rgba(124, 92, 67, 0.12);
    border: 2px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 125px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.garden-plot-card:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.garden-plot-emoji {
    font-size: 32px;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

.garden-plot-card:hover .garden-plot-emoji {
    transform: scale(1.1);
}

.garden-plot-status {
    font-family: var(--font-retro);
    font-size: 7px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-align: center;
}

.btn-plot {
    padding: 4px 10px;
    font-size: 10px;
    border-radius: 6px;
    width: 100%;
    text-align: center;
}
