/* ============================================
   AI STARTUP SIMULATOR v0.8
   TYCOON GAME EDITION — Full Visual Overhaul
   ============================================ */

/* ── Google Fonts loaded in HTML:
   Fredoka (headings, game UI)
   Nunito (body, descriptions)
   ── */

:root {
    /* ═══ Background ═══ */
    --bg-deep: #0e0e2c;
    --bg-primary: #151538;
    --bg-panel: #1c1c4a;
    --bg-panel-hover: #24245a;
    --bg-inset: #12122e;

    /* ═══ Category Colors ═══ */
    --cat-data: #4fc3f7;
    --cat-data-bg: rgba(79, 195, 247, 0.10);
    --cat-data-border: #2a6a8a;
    --cat-data-light: #b3e5fc;

    --cat-money: #66bb6a;
    --cat-money-bg: rgba(102, 187, 106, 0.10);
    --cat-money-border: #2e6e32;
    --cat-money-light: #c8e6c9;

    --cat-click: #ffa726;
    --cat-click-bg: rgba(255, 167, 38, 0.10);
    --cat-click-border: #8a5a1a;
    --cat-click-light: #ffe0b2;

    /* ═══ Accent Colors ═══ */
    --accent-gold: #ffd54f;
    --accent-gold-dark: #c8a415;
    --accent-gold-shadow: #8a6e0a;

    --accent-blue: #42a5f5;
    --accent-blue-dark: #1565c0;
    --accent-blue-shadow: #0d47a1;
    --accent-blue-light: #90caf9;

    --accent-green: #66bb6a;
    --accent-green-dark: #388e3c;
    --accent-green-shadow: #1b5e20;

    --accent-red: #ef5350;
    --accent-red-dark: #c62828;
    --accent-red-shadow: #7f1d1d;

    --accent-cyan: #26c6da;
    --accent-cyan-dark: #00838f;
    --accent-cyan-shadow: #004d40;

    --accent-purple: #ce93d8;
    --accent-purple-dark: #7b1fa2;
    --accent-purple-shadow: #4a148c;

    /* ═══ AGI ═══ */
    --agi-color: #e040fb;
    --agi-dim: rgba(224, 64, 251, 0.12);
    --agi-glow: rgba(224, 64, 251, 0.35);
    --agi-shadow: #6a1b9a;

    /* ═══ Text ═══ */
    --text-white: #ffffff;
    --text-light: #c8c8e8;
    --text-muted: #7878a8;
    --text-dim: #4a4a70;

    /* ═══ Game UI ═══ */
    --border-thick: 3px;
    --radius-game: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --radius-round: 50px;

    /* ═══ Layout ═══ */
    --topbar-h: 60px;
    --bottomnav-h: 72px;
    --max-game-width: 580px;

    /* ═══ Motion ═══ */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: 0.12s ease;
    --transition-smooth: 0.25s var(--ease-out);
}

/* ══════════════════════════════════
   RESET & BASE
   ══════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-deep);
    color: var(--text-white);
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* ══════════════════════════════════
   GAME BACKGROUND — Stars & Gradient
   ══════════════════════════════════ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(2px 2px at 10% 15%, rgba(255,255,255,0.15), transparent),
        radial-gradient(2px 2px at 30% 40%, rgba(255,255,255,0.1), transparent),
        radial-gradient(1px 1px at 55% 20%, rgba(255,255,255,0.12), transparent),
        radial-gradient(2px 2px at 75% 60%, rgba(255,255,255,0.08), transparent),
        radial-gradient(1px 1px at 90% 30%, rgba(255,255,255,0.1), transparent),
        radial-gradient(2px 2px at 20% 80%, rgba(255,255,255,0.06), transparent),
        radial-gradient(1px 1px at 60% 75%, rgba(255,255,255,0.09), transparent),
        radial-gradient(2px 2px at 85% 85%, rgba(255,255,255,0.07), transparent),
        radial-gradient(1px 1px at 45% 55%, rgba(255,255,255,0.11), transparent),
        radial-gradient(2px 2px at 5% 50%, rgba(255,255,255,0.08), transparent),
        radial-gradient(ellipse at 50% 0%, rgba(79,195,247,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 100%, rgba(206,147,216,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ══════════════════════════════════
   GAME ICON — Image Tags
   ══════════════════════════════════ */
.game-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px;
    image-rendering: auto;
}

.game-icon-sm {
    width: 22px;
    height: 22px;
    padding: 2px;
    border-radius: 4px;
}

.game-icon-xs {
    width: 18px;
    height: 18px;
    padding: 1px;
    border-radius: 3px;
    background: transparent;
}

.game-icon-lg {
    width: 56px;
    height: 56px;
    padding: 6px;
    border-radius: 12px;
}

/* ══════════════════════════════════
   GAME PANEL — Chunky Tycoon Style
   ══════════════════════════════════ */
.game-panel {
    background: var(--bg-panel);
    border: var(--border-thick) solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-game);
    box-shadow:
        0 5px 0 rgba(0, 0, 0, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.3);
    padding: 18px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.panel-title {
    font-family: 'Fredoka', cursive;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.panel-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -8px;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ══════════════════════════════════
   GAME BUTTON — 3D Push Button
   ══════════════════════════════════ */
.game-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 12px 20px;
    border: 3px solid;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Fredoka', cursive;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    position: relative;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.game-btn:active:not(:disabled) {
    transform: translateY(4px) !important;
    box-shadow: 0 0 0 transparent !important;
    transition: transform 0.04s ease, box-shadow 0.04s ease;
}

.game-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    filter: saturate(0.3) brightness(0.7);
    transform: none !important;
}

.game-btn .btn-label { font-size: 0.85rem; font-weight: 700; }
.game-btn .btn-sub {
    font-family: 'Nunito', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.8;
}

.btn-wide { width: 100%; }

/* Button Colors */
.btn-blue {
    background: linear-gradient(180deg, #64b5f6, #42a5f5);
    border-color: var(--accent-blue-light);
    box-shadow: 0 5px 0 var(--accent-blue-shadow), 0 8px 16px rgba(0,0,0,0.25);
}
.btn-blue:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--accent-blue-shadow), 0 12px 20px rgba(0,0,0,0.3); }

.btn-green {
    background: linear-gradient(180deg, #81c784, #66bb6a);
    border-color: #a5d6a7;
    box-shadow: 0 5px 0 var(--accent-green-shadow), 0 8px 16px rgba(0,0,0,0.25);
}
.btn-green:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--accent-green-shadow), 0 12px 20px rgba(0,0,0,0.3); }

.btn-gold {
    background: linear-gradient(180deg, #ffe082, #ffd54f);
    border-color: #fff176;
    box-shadow: 0 5px 0 var(--accent-gold-shadow), 0 8px 16px rgba(0,0,0,0.25);
    color: #3e2723;
    text-shadow: none;
}
.btn-gold:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--accent-gold-shadow), 0 12px 20px rgba(0,0,0,0.3); }

.btn-red {
    background: linear-gradient(180deg, #ef5350, #d32f2f);
    border-color: #ef9a9a;
    box-shadow: 0 5px 0 var(--accent-red-shadow), 0 8px 16px rgba(0,0,0,0.25);
}
.btn-red:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--accent-red-shadow), 0 12px 20px rgba(0,0,0,0.3); }

.btn-cyan {
    background: linear-gradient(180deg, #4dd0e1, #26c6da);
    border-color: #80deea;
    box-shadow: 0 5px 0 var(--accent-cyan-shadow), 0 8px 16px rgba(0,0,0,0.25);
}
.btn-cyan:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--accent-cyan-shadow), 0 12px 20px rgba(0,0,0,0.3); }

.btn-purple {
    background: linear-gradient(180deg, #ce93d8, #ab47bc);
    border-color: #e1bee7;
    box-shadow: 0 5px 0 var(--accent-purple-shadow), 0 8px 16px rgba(0,0,0,0.25);
}
.btn-purple:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--accent-purple-shadow), 0 12px 20px rgba(0,0,0,0.3); }

.btn-sm {
    padding: 8px 14px;
    font-size: 0.75rem;
}

/* ══════════════════════════════════
   TOP BAR
   ══════════════════════════════════ */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
    background: linear-gradient(180deg, #1a1a4a, #12123a);
    border-bottom: 3px solid rgba(255, 213, 79, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    gap: 8px;
}

.top-bar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }

.logo-text {
    font-family: 'Fredoka', cursive;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd54f 0%, #ffab40 50%, #ff6e40 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    text-shadow: none;
}

.hq-badge {
    font-family: 'Fredoka', cursive;
    font-size: 0.6rem;
    font-weight: 500;
    padding: 3px 10px;
    background: linear-gradient(135deg, rgba(255,213,79,0.15), rgba(255,213,79,0.05));
    border: 2px solid rgba(255, 213, 79, 0.3);
    border-radius: var(--radius-round);
    color: var(--accent-gold);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.top-bar-right { display: flex; gap: 6px; flex-shrink: 0; }

.stat-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-round);
    font-family: 'Fredoka', cursive;
    font-size: 0.7rem;
    font-weight: 600;
}

.stat-pill .stat-value { font-weight: 700; font-size: 0.72rem; }
.stat-pill.stat-data .stat-value { color: var(--cat-data); }
.stat-pill.stat-capital .stat-value { color: var(--accent-gold); }
.stat-pill.stat-agi { border-color: rgba(224, 64, 251, 0.2); }
.stat-pill.stat-agi .stat-value { color: var(--agi-color); }

/* ══════════════════════════════════
   GAME WRAPPER & TABS
   ══════════════════════════════════ */
.game-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.tab-content-area {
    width: 100%;
    max-width: var(--max-game-width);
    padding: 14px 14px calc(var(--bottomnav-h) + 14px);
    overflow-y: auto;
}

.tab-panel {
    display: none;
    animation: tabBounceIn 0.35s var(--ease-bounce);
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@keyframes tabBounceIn {
    0% { opacity: 0; transform: translateY(12px) scale(0.97); }
    60% { transform: translateY(-3px) scale(1.005); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ══════════════════════════════════
   DASHBOARD — Wallet
   ══════════════════════════════════ */
.panel-wallet {
    border-color: rgba(79, 195, 247, 0.2);
    background: linear-gradient(135deg, #1c1c50, #1a2a50);
}

.wallet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.wallet-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-inset);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.wallet-card.wallet-data { border-color: rgba(79, 195, 247, 0.15); }
.wallet-card.wallet-capital { border-color: rgba(255, 213, 79, 0.15); }

.wallet-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wallet-label {
    font-family: 'Fredoka', cursive;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.wallet-value {
    font-family: 'Fredoka', cursive;
    font-size: 1.1rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-data .wallet-value { color: var(--cat-data); }
.wallet-capital .wallet-value { color: var(--accent-gold); }

.income-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 10px 14px;
    background: rgba(79, 195, 247, 0.06);
    border: 2px solid rgba(79, 195, 247, 0.08);
    border-radius: var(--radius-sm);
}

.income-line {
    font-family: 'Nunito', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.income-tag { font-size: 0.8rem; }
.multiplier-line span:last-child { color: var(--agi-color); }

/* ══════════════════════════════════
   DASHBOARD — MEGA SCRAPE BUTTON
   ══════════════════════════════════ */
.scrape-section {
    position: relative;
    margin: 4px 0;
}

.scrape-mega-btn {
    width: 100%;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 20px;
    background: linear-gradient(180deg, #5cc8ff 0%, #42a5f5 40%, #1e88e5 100%);
    border: 4px solid var(--accent-blue-light);
    border-radius: 28px;
    box-shadow:
        0 8px 0 var(--accent-blue-shadow),
        0 14px 30px rgba(0, 0, 0, 0.45),
        inset 0 3px 0 rgba(255, 255, 255, 0.25);
    cursor: pointer;
    color: white;
    font-family: 'Fredoka', cursive;
    position: relative;
    overflow: hidden;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    animation: mega-breathe 2.5s ease-in-out infinite;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.scrape-mega-btn::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(255,255,255,0.08) 10%, transparent 20%);
    animation: mega-shine 4s linear infinite;
    pointer-events: none;
}

.scrape-mega-btn:hover {
    animation: none;
    transform: scale(1.03);
    box-shadow:
        0 10px 0 var(--accent-blue-shadow),
        0 18px 36px rgba(0, 0, 0, 0.5),
        inset 0 3px 0 rgba(255, 255, 255, 0.3);
}

.scrape-mega-btn:active {
    transform: translateY(8px) scale(0.97) !important;
    box-shadow:
        0 0 0 var(--accent-blue-shadow),
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.1) !important;
    transition: transform 0.04s ease, box-shadow 0.04s ease;
    animation: none;
}

@keyframes mega-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.018); }
}

@keyframes mega-shine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.scrape-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
    background: transparent;
    padding: 0;
}

.scrape-label {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
    letter-spacing: 0.06em;
}

.scrape-sub {
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0.9;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

/* ══════════════════════════════════
   DASHBOARD — Sell Actions
   ══════════════════════════════════ */
.panel-actions {
    border-color: rgba(102, 187, 106, 0.15);
    background: linear-gradient(135deg, #1c1c4a, #1a3a2a);
}

.sell-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sell-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.game-input {
    width: 100%;
    background: var(--bg-inset);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    padding: 10px 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    outline: none;
    transition: border-color var(--transition-smooth);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.game-input:focus {
    border-color: rgba(102, 187, 106, 0.4);
}

.sell-preview {
    font-family: 'Fredoka', cursive;
    font-size: 0.75rem;
    color: var(--accent-green);
    text-align: right;
    font-weight: 600;
}

.sell-buttons {
    display: flex;
    gap: 10px;
}

.sell-buttons .game-btn { flex: 1; }

/* ══════════════════════════════════
   DASHBOARD — Boost
   ══════════════════════════════════ */
.panel-boost {
    border-color: rgba(38, 198, 218, 0.15);
    background: linear-gradient(135deg, #1a2a40, #1c1c4a);
}

.panel-boost .game-btn { margin-bottom: 8px; }

.btn-boosting {
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 5px 0 var(--accent-cyan-shadow), 0 0 20px rgba(38, 198, 218, 0.3) !important;
    animation: boost-glow 1.5s ease-in-out infinite !important;
}

.btn-cooldown {
    background: linear-gradient(180deg, #555, #444) !important;
    border-color: #666 !important;
    box-shadow: 0 3px 0 #333 !important;
    opacity: 0.5 !important;
}

@keyframes boost-glow {
    0%, 100% { box-shadow: 0 5px 0 var(--accent-cyan-shadow), 0 0 16px rgba(38, 198, 218, 0.25); }
    50% { box-shadow: 0 5px 0 var(--accent-cyan-shadow), 0 0 32px rgba(38, 198, 218, 0.45); }
}

.boost-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-inset);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.boost-bar-track.visible { opacity: 1; }

.boost-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 6px;
    transition: width 0.15s linear;
    box-shadow: 0 0 8px rgba(38, 198, 218, 0.4);
}

/* ══════════════════════════════════
   DASHBOARD — HQ
   ══════════════════════════════════ */
.panel-hq {
    border-color: rgba(206, 147, 216, 0.15);
    background: linear-gradient(135deg, #2a1a40, #1c1c4a);
    padding: 14px 18px;
}

.hq-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hq-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.hq-level-label {
    font-family: 'Fredoka', cursive;
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.hq-level-name {
    font-family: 'Fredoka', cursive;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-purple);
}

.hq-upgrade-btn-maxed {
    background: linear-gradient(180deg, #81c784, #66bb6a) !important;
    border-color: #a5d6a7 !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
    box-shadow: 0 3px 0 var(--accent-green-shadow) !important;
    cursor: default !important;
}

/* ══════════════════════════════════
   DASHBOARD — Reset
   ══════════════════════════════════ */
.panel-reset {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 12px;
    background: var(--bg-panel);
    border-color: rgba(239, 83, 80, 0.12);
}

.reset-hint {
    font-family: 'Nunito', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-dim);
    text-align: right;
}

/* ══════════════════════════════════
   TECH SHOP — Layout
   ══════════════════════════════════ */
.panel-shop {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1c1c4a, #1a1a42);
}

.shop-category {
    margin-bottom: 22px;
}

.shop-category:last-child { margin-bottom: 0; }

.shop-category-title {
    font-family: 'Fredoka', cursive;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 3px solid;
}

.cat-data .shop-category-title {
    color: var(--cat-data);
    border-color: rgba(79, 195, 247, 0.25);
}

.cat-money .shop-category-title {
    color: var(--cat-money);
    border-color: rgba(102, 187, 106, 0.25);
}

.cat-click .shop-category-title {
    color: var(--cat-click);
    border-color: rgba(255, 167, 38, 0.25);
}

.shop-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ══════════════════════════════════
   TECH SHOP — Item Cards
   ══════════════════════════════════ */
.shop-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-inset);
    border: 3px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-game);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: left;
    color: var(--text-white);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.shop-item:hover:not(:disabled):not(.tier-locked) {
    transform: translateY(-3px);
    box-shadow: 0 7px 0 rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.2);
}

.shop-item:active:not(:disabled):not(.tier-locked) {
    transform: translateY(4px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
    transition: all 0.04s ease;
}

/* Category-specific item styling */
.cat-data .shop-item {
    border-color: rgba(79, 195, 247, 0.12);
}
.cat-data .shop-item:hover:not(:disabled):not(.tier-locked) {
    border-color: rgba(79, 195, 247, 0.35);
    background: rgba(79, 195, 247, 0.06);
}

.cat-money .shop-item {
    border-color: rgba(102, 187, 106, 0.12);
}
.cat-money .shop-item:hover:not(:disabled):not(.tier-locked) {
    border-color: rgba(102, 187, 106, 0.35);
    background: rgba(102, 187, 106, 0.06);
}

.cat-click .shop-item {
    border-color: rgba(255, 167, 38, 0.12);
}
.cat-click .shop-item:hover:not(:disabled):not(.tier-locked) {
    border-color: rgba(255, 167, 38, 0.35);
    background: rgba(255, 167, 38, 0.06);
}

.shop-item-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.06);
}

.shop-item-icon .game-icon {
    background: transparent;
    padding: 0;
    width: 36px;
    height: 36px;
}

.shop-item-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.shop-item-name {
    font-family: 'Fredoka', cursive;
    font-size: 0.82rem;
    font-weight: 600;
}

.shop-item-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
}

.shop-item-desc strong {
    color: var(--text-light);
    font-weight: 700;
}

.shop-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.shop-item-cost {
    font-family: 'Fredoka', cursive;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.shop-item-owned {
    font-family: 'Nunito', sans-serif;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* Affordability */
.shop-item.unaffordable {
    opacity: 0.45;
    filter: grayscale(0.5);
    cursor: not-allowed;
}

/* ══════════════════════════════════
   SHOP — Tier-Locked Items (VISIBLE!)
   ══════════════════════════════════ */
.shop-item.tier-locked {
    opacity: 0.4;
    filter: grayscale(0.9) brightness(0.6);
    cursor: not-allowed;
    pointer-events: none;
}

.shop-item.tier-locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(0, 0, 0, 0.08) 8px,
        rgba(0, 0, 0, 0.08) 16px
    );
    border-radius: var(--radius-game);
    pointer-events: none;
}

.shop-item-req {
    font-family: 'Fredoka', cursive;
    font-size: 0.55rem;
    font-weight: 500;
    color: var(--accent-gold);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.shop-item.tier-unlocked .shop-item-req { display: none; }

/* ══════════════════════════════════
   AGI TAB
   ══════════════════════════════════ */
.agi-panel {
    text-align: center;
    padding: 24px 18px;
    border-color: rgba(224, 64, 251, 0.15);
    background: linear-gradient(135deg, #2a1a50, #1c1c4a);
}

.agi-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.agi-orb-container {
    position: relative;
    width: 90px;
    height: 90px;
}

.agi-orb {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(224, 64, 251, 0.4), rgba(66, 165, 245, 0.2), var(--bg-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(224, 64, 251, 0.3);
    box-shadow:
        0 0 30px var(--agi-glow),
        0 5px 0 var(--agi-shadow),
        inset 0 0 20px rgba(224, 64, 251, 0.1);
    animation: orb-breathe 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

.agi-orb-text {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.agi-orb-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid rgba(224, 64, 251, 0.2);
    animation: orb-ring-spin 8s linear infinite;
    z-index: 1;
}

.agi-orb-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--agi-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--agi-color);
}

@keyframes orb-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 0 25px var(--agi-glow), 0 5px 0 var(--agi-shadow); }
    50% { transform: scale(1.06); box-shadow: 0 0 45px var(--agi-glow), 0 5px 0 var(--agi-shadow); }
}

@keyframes orb-ring-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.agi-orb.level-5 {
    background: radial-gradient(circle at 35% 35%, rgba(224, 64, 251, 0.55), rgba(239, 83, 80, 0.25), var(--bg-deep));
    border-color: rgba(239, 83, 80, 0.3);
}

.agi-orb.level-10 {
    background: radial-gradient(circle at 35% 35%, rgba(239, 83, 80, 0.6), rgba(255, 213, 79, 0.3), var(--bg-deep));
    border-color: rgba(255, 213, 79, 0.4);
}

.agi-title {
    font-family: 'Fredoka', cursive;
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--agi-color), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.agi-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    max-width: 320px;
    line-height: 1.5;
}

.agi-level-display {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.agi-level-label {
    font-family: 'Fredoka', cursive;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.agi-level-value {
    font-family: 'Fredoka', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--agi-color);
    text-shadow: 0 0 20px var(--agi-glow), 0 3px 0 rgba(0,0,0,0.3);
}

.agi-progress-track {
    width: 100%;
    height: 24px;
    background: var(--bg-inset);
    border: 3px solid rgba(224, 64, 251, 0.12);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    margin-bottom: 18px;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

.agi-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--agi-color));
    border-radius: 12px;
    transition: width 0.4s var(--ease-out);
    position: relative;
    box-shadow: 0 0 10px rgba(224, 64, 251, 0.3);
}

.agi-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 12px;
}

.agi-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka', cursive;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.agi-feed-section { margin-bottom: 16px; }

.agi-feed-cost {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.agi-feed-cost span:nth-child(even) {
    font-family: 'Fredoka', cursive;
    color: var(--text-light);
    font-weight: 700;
}

.agi-multiplier-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--agi-dim);
    border: 2px solid rgba(224, 64, 251, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

.agi-mult-value {
    font-family: 'Fredoka', cursive;
    font-weight: 700;
    font-size: 1rem;
    color: var(--agi-color);
    text-shadow: 0 0 10px var(--agi-glow);
}

/* AGI Log Panel (replaces CRT terminal) */
.agi-log-panel {
    background: var(--bg-inset);
    border: 3px solid rgba(224, 64, 251, 0.12);
    border-radius: var(--radius-game);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3), inset 0 2px 6px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.agi-log-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(224, 64, 251, 0.06);
    border-bottom: 2px solid rgba(224, 64, 251, 0.08);
    font-family: 'Fredoka', cursive;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--agi-color);
}

.agi-log-body {
    padding: 12px 16px;
    max-height: 170px;
    overflow-y: auto;
}

.agi-log-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.agi-log-line:last-child { margin-bottom: 0; }

.agi-log-prompt {
    font-family: 'Fredoka', cursive;
    font-size: 0.72rem;
    color: var(--agi-color);
    flex-shrink: 0;
}

.agi-log-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-purple);
    word-break: break-word;
}

/* ══════════════════════════════════
   MY OFFICE
   ══════════════════════════════════ */
.panel-office {
    background: linear-gradient(135deg, #1c2a4a, #1c1c4a);
    border-color: rgba(66, 165, 245, 0.12);
}

.office-grid { display: flex; flex-direction: column; gap: 8px; }

.office-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-inset);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    transition: all var(--transition-smooth);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.office-card.active {
    border-color: rgba(66, 165, 245, 0.2);
    background: rgba(66, 165, 245, 0.04);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 12px rgba(66, 165, 245, 0.08);
}

.office-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.office-card-icon .game-icon {
    background: transparent;
    padding: 0;
    width: 36px;
    height: 36px;
}

.office-card-body { flex: 1; min-width: 0; }

.office-card-name {
    font-family: 'Fredoka', cursive;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
}

.office-card-output {
    font-family: 'Nunito', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-top: 2px;
}

.office-card-count {
    font-family: 'Fredoka', cursive;
    font-size: 1.4rem;
    font-weight: 700;
    min-width: 28px;
    text-align: right;
    color: var(--text-light);
}

.office-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--bg-inset);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-family: 'Fredoka', cursive;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; box-shadow: 0 0 14px var(--accent-green); }
}

/* ══════════════════════════════════
   MARKETS TAB
   ══════════════════════════════════ */
.panel-markets {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a3a2a, #1c1c4a);
    border-color: rgba(102, 187, 106, 0.12);
}

.market-list { display: flex; flex-direction: column; gap: 12px; }

.stock-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: var(--bg-inset);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-game);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stock-name {
    font-family: 'Fredoka', cursive;
    font-size: 0.85rem;
    font-weight: 600;
}

.stock-ticker {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
}

.stock-price-row { display: flex; align-items: center; gap: 8px; }

.stock-price {
    font-family: 'Fredoka', cursive;
    font-size: 1.15rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

.stock-price.up { color: var(--accent-green); }
.stock-price.down { color: var(--accent-red); }

.stock-risk {
    font-family: 'Fredoka', cursive;
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: var(--radius-round);
    border: 2px solid;
}

.risk-low { color: var(--accent-green); background: rgba(102,187,106,0.12); border-color: rgba(102,187,106,0.2); }
.risk-medium { color: var(--accent-cyan); background: rgba(38,198,218,0.12); border-color: rgba(38,198,218,0.2); }
.risk-medhigh { color: var(--accent-gold); background: rgba(255,213,79,0.12); border-color: rgba(255,213,79,0.2); }
.risk-high { color: #ff9800; background: rgba(255,152,0,0.12); border-color: rgba(255,152,0,0.2); }
.risk-extreme { color: var(--accent-red); background: rgba(239,83,80,0.12); border-color: rgba(239,83,80,0.2); }

.stock-portfolio {
    font-family: 'Nunito', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
}

.stock-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    align-items: center;
}

.stock-qty-input {
    width: 58px;
    padding: 6px 8px;
    background: var(--bg-deep);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xs);
    color: var(--text-white);
    font-family: 'Fredoka', cursive;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color var(--transition-smooth);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.stock-qty-input:focus { border-color: rgba(66,165,245,0.3); }

.stock-btn {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-xs);
    font-family: 'Fredoka', cursive;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    box-shadow: 0 3px 0 transparent;
}

.stock-btn.buy {
    background: linear-gradient(180deg, #81c784, #66bb6a);
    color: white;
    border-color: #a5d6a7;
    box-shadow: 0 3px 0 var(--accent-green-shadow);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.stock-btn.buy:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 var(--accent-green-shadow); }
.stock-btn.buy:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 transparent; }

.stock-btn.sell {
    background: linear-gradient(180deg, #ef5350, #d32f2f);
    color: white;
    border-color: #ef9a9a;
    box-shadow: 0 3px 0 var(--accent-red-shadow);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.stock-btn.sell:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 var(--accent-red-shadow); }
.stock-btn.sell:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 transparent; }

.stock-btn:disabled { opacity: 0.35; cursor: not-allowed; filter: saturate(0.3); }

/* ══════════════════════════════════
   CONTRACTS TAB
   ══════════════════════════════════ */
.panel-contracts {
    background: linear-gradient(135deg, #2a2a1a, #1c1c4a);
    border-color: rgba(255, 213, 79, 0.12);
}

.reputation-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    background: var(--bg-inset);
    border: 2px solid rgba(255, 213, 79, 0.12);
    border-radius: var(--radius-game);
    margin-bottom: 16px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

.reputation-label {
    font-family: 'Fredoka', cursive;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.reputation-stars {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reputation-icon { font-size: 1.5rem; }

.reputation-value {
    font-family: 'Fredoka', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 0 16px rgba(255, 213, 79, 0.3), 0 3px 0 rgba(0,0,0,0.3);
}

.reputation-hint {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-dim);
    font-style: italic;
}

.contracts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contracts-empty-hint {
    font-family: 'Nunito', sans-serif;
    font-size: 0.72rem;
    color: var(--text-dim);
    text-align: center;
    padding: 20px 0;
    font-style: italic;
}

.contract-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: var(--bg-inset);
    border: 2px solid rgba(255, 213, 79, 0.08);
    border-radius: var(--radius-game);
    animation: contractBounceIn 0.4s var(--ease-bounce);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

@keyframes contractBounceIn {
    0% { opacity: 0; transform: translateY(16px) scale(0.95); }
    60% { transform: translateY(-4px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.contract-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contract-client {
    font-family: 'Fredoka', cursive;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.contract-task {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
}

.contract-terms {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-xs);
}

.contract-cost {
    font-family: 'Nunito', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-red);
}

.contract-reward {
    font-family: 'Nunito', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-green);
}

/* ══════════════════════════════════
   BOTTOM NAVIGATION
   ══════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--bottomnav-h);
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: linear-gradient(180deg, #1a1a4a, #12123a);
    border-top: 3px solid rgba(255, 213, 79, 0.15);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-family: 'Fredoka', cursive;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 30px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    transition: transform var(--transition-smooth);
}

.nav-tab.active { color: var(--accent-gold); }
.nav-tab.active::before {
    transform: translateX(-50%) scaleX(1);
    background: var(--accent-gold);
    box-shadow: 0 0 10px rgba(255, 213, 79, 0.4);
}

.nav-tab:hover:not(.active) { color: var(--text-muted); }

/* Special tab colors */
#nav-agi.active { color: var(--agi-color); }
#nav-agi.active::before { background: var(--agi-color); box-shadow: 0 0 10px var(--agi-glow); }

#nav-contracts.active { color: var(--accent-gold); }
#nav-contracts.active::before { background: var(--accent-gold); box-shadow: 0 0 10px rgba(255,213,79,0.3); }

#nav-shop.active { color: var(--accent-cyan); }
#nav-shop.active::before { background: var(--accent-cyan); box-shadow: 0 0 10px rgba(38,198,218,0.3); }

.nav-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.nav-icon-img {
    width: 22px;
    height: 22px;
    background: transparent;
    padding: 0;
}

.nav-label {
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ══════════════════════════════════
   DIALOGUE MODAL — RPG Style
   ══════════════════════════════════ */
.dialogue-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0 14px calc(var(--bottomnav-h) + 14px);
}

.dialogue-overlay.active {
    display: flex;
}

.dialogue-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: -1;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dialogue-box {
    max-width: 560px;
    width: 100%;
    background: linear-gradient(180deg, #2a2a60, #1c1c4a);
    border: 4px solid var(--accent-gold);
    border-radius: 22px;
    box-shadow:
        0 6px 0 var(--accent-gold-shadow),
        0 -2px 20px rgba(255, 213, 79, 0.1),
        0 12px 30px rgba(0, 0, 0, 0.5);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: dialogue-slide-up 0.45s var(--ease-bounce);
    position: relative;
}

@keyframes dialogue-slide-up {
    0% { opacity: 0; transform: translateY(40px) scale(0.95); }
    60% { transform: translateY(-6px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.dialogue-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.dialogue-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--accent-gold);
    object-fit: cover;
    background: var(--bg-deep);
    flex-shrink: 0;
    box-shadow: 0 3px 0 var(--accent-gold-shadow);
}

.dialogue-content {
    flex: 1;
    min-width: 0;
}

.dialogue-speaker {
    font-family: 'Fredoka', cursive;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 6px;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.dialogue-text {
    font-family: 'Nunito', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.65;
    min-height: 45px;
}

.dialogue-text .dialogue-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent-gold);
    animation: blink-cursor 0.7s step-end infinite;
    margin-left: 2px;
    vertical-align: text-bottom;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.dialogue-next-btn {
    align-self: flex-end;
    padding: 10px 32px;
    background: linear-gradient(180deg, #ffe082, #ffd54f);
    border: 3px solid #fff176;
    border-radius: 14px;
    box-shadow: 0 5px 0 var(--accent-gold-shadow);
    font-family: 'Fredoka', cursive;
    font-size: 0.9rem;
    font-weight: 700;
    color: #3e2723;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.dialogue-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 var(--accent-gold-shadow);
}

.dialogue-next-btn:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 var(--accent-gold-shadow);
    transition: transform 0.04s ease, box-shadow 0.04s ease;
}

/* ══════════════════════════════════
   CLICK PARTICLES
   ══════════════════════════════════ */
.click-particle {
    position: absolute;
    pointer-events: none;
    z-index: 50;
    animation: particle-fly 0.85s ease-out forwards;
}

.click-particle.text-particle {
    font-family: 'Fredoka', cursive;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.4),
        0 0 8px rgba(255, 213, 79, 0.3);
}

.click-particle.icon-particle img {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

@keyframes particle-fly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    70% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translate(var(--px), var(--py)) scale(var(--ps, 0.4)) rotate(var(--pr));
    }
}

/* ══════════════════════════════════
   FLOATING TEXT & VALUE PULSE
   ══════════════════════════════════ */
.float-text {
    position: absolute;
    pointer-events: none;
    font-family: 'Fredoka', cursive;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4), 0 0 8px rgba(255, 213, 79, 0.3);
    animation: floatUp 0.9s var(--ease-out) forwards;
    z-index: 50;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    60% { opacity: 0.7; }
    100% { opacity: 0; transform: translateY(-55px) scale(0.65); }
}

.value-pulse {
    animation: pulseBounce 0.4s var(--ease-bounce);
}

@keyframes pulseBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ══════════════════════════════════
   SCROLLBAR — Game Style
   ══════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 213, 79, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 213, 79, 0.3); }

/* ══════════════════════════════════
   DESKTOP SIDEBAR (≥769px)
   ══════════════════════════════════ */
@media (min-width: 769px) {
    :root { --bottomnav-h: 0px; }

    body {
        display: grid;
        grid-template-columns: 200px 1fr;
        grid-template-rows: var(--topbar-h) 1fr;
    }

    .top-bar { grid-column: 1 / -1; grid-row: 1; }

    .bottom-nav {
        position: static;
        grid-column: 1;
        grid-row: 2;
        height: auto;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 20px 10px;
        gap: 4px;
        border-top: none;
        border-right: 3px solid rgba(255, 213, 79, 0.1);
        background: linear-gradient(180deg, #1a1a4a, #12123a);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    }

    .nav-tab {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        padding: 12px 16px;
        border-radius: var(--radius-sm);
        flex: unset;
    }

    .nav-tab::before {
        top: 50%; left: 0;
        transform: translateY(-50%) scaleY(0);
        width: 4px; height: 20px;
        border-radius: 0 4px 4px 0;
    }

    .nav-tab.active::before { transform: translateY(-50%) scaleY(1); }
    .nav-tab.active { background: rgba(255, 213, 79, 0.08); }
    #nav-agi.active { background: var(--agi-dim); }
    #nav-shop.active { background: rgba(38, 198, 218, 0.08); }

    .nav-tab:hover:not(.active) { background: rgba(255, 255, 255, 0.04); color: var(--text-muted); }

    .nav-icon { font-size: 1.1rem; }
    .nav-label { font-size: 0.72rem; }

    .game-wrapper { grid-column: 2; grid-row: 2; }
    .tab-content-area { padding: 22px 26px 40px; }

    .dialogue-overlay { padding: 0 20px 20px; }
}

@media (min-width: 1400px) {
    .tab-content-area { max-width: 620px; }
}
