/* ═══════════════════════════════════════════════════════════════
   LAYOUT.CSS - Grid & Container
   Max 300 Lines | GrowTycoon
   ═══════════════════════════════════════════════════════════════ */

/* ─── App Container ─── */
#app {
    position: relative;
    width: 100%;
    max-width: var(--container-max);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--dark-bg);
}

/* ─── HUD Panel (Top) ─── */
.hud-panel {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--container-max);
    height: var(--hud-height);
    padding: var(--space-3) var(--space-4);
    padding-top: calc(var(--space-3) + var(--safe-area-top));
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: var(--z-nav);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-2);
}

.hud-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud-stat {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.hud-icon {
    font-size: var(--text-xl);
}

.hud-value {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: white;
}

.hud-money .hud-value {
    color: var(--neon-green);
}

.hud-gps .hud-value {
    color: var(--neon-purple);
}

.hud-unit {
    font-size: var(--text-sm);
    color: var(--gray-400);
}

.hud-level {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.hud-level-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.hud-level-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
    border-radius: var(--radius-full);
    transition: width var(--duration-normal) var(--ease-smooth);
}

.hud-level-text {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    color: var(--neon-blue);
    white-space: nowrap;
}

/* ─── Main Game Area ─── */
.game-area {
    flex: 1;
    position: relative;
    margin-top: var(--hud-height);
    margin-bottom: var(--nav-height);
    overflow: hidden;
}

.grow-room {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: calc(100vh - var(--hud-height) - var(--nav-height));
    min-height: calc(100dvh - var(--hud-height) - var(--nav-height));
    background: linear-gradient(180deg, var(--gray-100) 0%, var(--dark-bg) 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-4);
}

/* ─── Bottom Navigation ─── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--container-max);
    height: var(--nav-height);
    padding-bottom: var(--safe-area-bottom);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    z-index: var(--z-nav);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    color: var(--gray-400);
    transition: color var(--duration-fast) var(--ease-smooth),
                transform var(--duration-fast) var(--ease-bounce);
}

.nav-btn:active {
    transform: scale(0.9);
}

.nav-btn.active {
    color: var(--neon-green);
}

.nav-icon {
    font-size: var(--text-2xl);
}

.nav-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

/* ─── Panel Overlay ─── */
.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-normal) var(--ease-smooth),
                visibility var(--duration-normal);
}

.panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ─── Slide-Up Panels ─── */
.slide-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: var(--container-max);
    max-height: 70vh;
    background: var(--dark-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: var(--z-panel);
    display: flex;
    flex-direction: column;
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.slide-panel.active {
    transform: translateX(-50%) translateY(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
}

.panel-header h2 {
    font-size: var(--text-lg);
}

.panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: var(--gray-400);
    background: var(--gray-200);
    border-radius: var(--radius-full);
    transition: background var(--duration-fast);
}

.panel-close:hover {
    background: var(--gray-300);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    padding-bottom: calc(var(--space-4) + var(--safe-area-bottom));
}
