@import url('https://fonts.googleapis.com/css2?family=Baskervville:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=MedievalSharp&family=Uncial+Antiqua&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1;
}


/* Tailwind Directives (if using build step, otherwise these are just custom CSS) */

/* ========================================
   THEME SYSTEM - CSS VARIABLES
   ======================================== */

:root {
    /* Default Theme: Parchment Gold */
    --theme-bg-main: #110e0d;
    --theme-bg-secondary: #1a1613;
    --theme-primary: #D4AF37;
    --theme-primary-glow: rgba(212, 175, 55, 0.5);
    --theme-border: #44403c;
    --theme-border-accent: #5D4037;
    --theme-text-primary: #d6d3d1;
    --theme-text-secondary: #a8a29e;
    --theme-parchment: #F5E6CA;
    --theme-parchment-texture: url('https://www.transparenttextures.com/patterns/beige-paper.png');
    --theme-parchment-dark: #D8C3A5;
    --theme-card-bg: #EADDCF;
    --theme-accent-red: #8a1c1c;
    --theme-wood-dark: #3E2723;
    --theme-wood-light: #5D4037;
    --theme-stone-dark: #1c1917;

    /* Content Text Colors */
    --theme-content-heading: #1c1917;
    --theme-content-text: #44403c;
    --theme-content-muted: #78716c;

    /* Card Styling */
    --theme-card-inner: #d7ccc8;
    --theme-card-border: #a1887f;
    --theme-skill-card-bg: rgba(215, 204, 200, 0.3);

}

/* Blood Moon Theme */
[data-theme="blood"] {
    --theme-bg-main: #0a0505;
    --theme-bg-secondary: #1a0808;
    --theme-primary: #dc2626;
    --theme-primary-glow: rgba(220, 38, 38, 0.5);
    --theme-border: #7f1d1d;
    --theme-border-accent: #991b1b;
    --theme-text-primary: #fecaca;
    --theme-text-secondary: #fca5a5;
    --theme-parchment: #1c1512;
    --theme-parchment-texture: url('https://www.transparenttextures.com/patterns/carbon-fibre.png');
    --theme-parchment-dark: #271a17;
    --theme-card-bg: #1f0a0a;
    --theme-accent-red: #ef4444;
    --theme-wood-dark: #2a0a0a;
    --theme-wood-light: #450a0a;
    --theme-stone-dark: #1a0505;

    /* Blood Moon Text */
    --theme-content-heading: #fecaca;
    --theme-content-text: #fca5a5;
    --theme-content-muted: #f87171;

    /* Blood Moon Cards */
    --theme-card-inner: #2a1515;
    --theme-card-border: #7f1d1d;
    --theme-skill-card-bg: rgba(127, 29, 29, 0.3);
}

/* Mystic Forest Theme */
[data-theme="mystic"] {
    --theme-bg-main: #021a1a;
    --theme-bg-secondary: #0d2626;
    --theme-primary: #2dd4bf;
    --theme-primary-glow: rgba(45, 212, 191, 0.5);
    --theme-border: #115e59;
    --theme-border-accent: #0f766e;
    --theme-text-primary: #ccfbf1;
    --theme-text-secondary: #5eead4;
    --theme-parchment: #042f2e;
    --theme-parchment-texture: url('https://www.transparenttextures.com/patterns/dark-matter.png');
    --theme-parchment-dark: #115e59;
    --theme-card-bg: #0f3d3d;
    --theme-accent-red: #facc15;
    /* Firefly yellow replacing red accents */
    --theme-wood-dark: #022c22;
    --theme-wood-light: #042f2e;
    --theme-stone-dark: #0f3d3d;

    /* Mystic Forest Text */
    --theme-content-heading: #ccfbf1;
    --theme-content-text: #99f6e4;
    --theme-content-muted: #5eead4;

    /* Mystic Forest Cards */
    --theme-card-inner: #0d4d4d;
    --theme-card-border: #0f766e;
    --theme-skill-card-bg: rgba(15, 118, 110, 0.3);
}

/* Custom Cursor - Hunter's Dagger */
body {
    cursor: url('assets/cursor-dagger.svg') 4 2, auto;
}

/* Pointer cursor for interactive elements */
a,
button,
.nav-btn,
.skill-card,
.close-tab-btn,
.settings-btn,
.theme-btn,
.toggle-btn,
.confirm-btn,
[role="button"],
input[type="submit"],
input[type="button"] {
    cursor: url('assets/cursor-dagger-pointer.svg') 4 2, pointer;
}

/* Retro Scanline Effect */
.scanlines {
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.1) 50%,
            rgba(0, 0, 0, 0.1));
    background-size: 100% 4px;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.6;
}

/* CRT Flicker Animation */
@keyframes flicker {
    0% {
        opacity: 0.97;
    }

    5% {
        opacity: 0.95;
    }

    10% {
        opacity: 0.9;
    }

    15% {
        opacity: 0.95;
    }

    20% {
        opacity: 0.99;
    }

    25% {
        opacity: 0.95;
    }

    30% {
        opacity: 0.9;
    }

    35% {
        opacity: 0.96;
    }

    40% {
        opacity: 0.98;
    }

    45% {
        opacity: 0.95;
    }

    50% {
        opacity: 0.99;
    }

    55% {
        opacity: 0.93;
    }

    60% {
        opacity: 0.9;
    }

    65% {
        opacity: 0.96;
    }

    70% {
        opacity: 1;
    }

    75% {
        opacity: 0.97;
    }

    80% {
        opacity: 0.95;
    }

    85% {
        opacity: 0.92;
    }

    90% {
        opacity: 0.9;
    }

    95% {
        opacity: 0.95;
    }

    100% {
        opacity: 0.98;
    }
}

.crt-flicker {
    animation: flicker 0.15s infinite;
}

/* Utility Classes */
.wood-frame {
    border-image: url('https://www.transparenttextures.com/patterns/wood-pattern.png') 30 round;
}

.text-shadow-strong {
    text-shadow: 2px 2px 0px #000;
}

.text-shadow-gold {
    text-shadow: 0px 0px 5px rgba(212, 175, 55, 0.6);
}

.pixelated-img {
    image-rendering: pixelated;
}

/* Custom Scrollbar - Theme Aware */
.custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--theme-border-accent) var(--theme-bg-secondary);
}

.custom-scroll::-webkit-scrollbar {
    width: 10px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: var(--theme-bg-secondary);
    border-left: 1px solid var(--theme-border);
    border-right: 1px solid var(--theme-border);
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: var(--theme-border-accent);
    border-radius: 2px;
    border: 2px solid var(--theme-bg-secondary);
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary);
}

/* Scrollbar Bounds - Top and Bottom Caps */
.custom-scroll::-webkit-scrollbar-button:start:decrement,
.custom-scroll::-webkit-scrollbar-button:end:increment {
    display: block;
    height: 8px;
    background: var(--theme-border);
    border-left: 1px solid var(--theme-border);
    border-right: 1px solid var(--theme-border);
}

.custom-scroll::-webkit-scrollbar-button:start:decrement {
    border-top: 2px solid var(--theme-primary);
}

.custom-scroll::-webkit-scrollbar-button:end:increment {
    border-bottom: 2px solid var(--theme-primary);
}

/* Layout Grid */
.layout-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    height: 100%;
}

@media (max-width: 768px) {
    .layout-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
}

/* Tab Transitions */
.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.tab-content.active {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nav Button Active State */
.nav-btn.active {
    background-color: #3a3532 !important;
}

.nav-btn.active .material-icons {
    color: var(--theme-primary) !important;
    /* Primary Color */
}

.nav-btn.active .nav-text {
    color: white !important;
}

.nav-indicator {
    display: none;
}

.nav-btn.active .nav-indicator {
    display: block;
}

/* Skill Tree Custom */
.skill-card:hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -10px;
    width: 10px;
    height: 2px;
    background-color: var(--theme-primary);
    transform: translateY(-50%);
    box-shadow: 0 0 5px var(--theme-primary-glow);
}

/* ========================================
   HEADER ENHANCEMENTS
   ======================================== */

/* Hardcore Mode Badge */
.hardcore-mode-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #292524 0%, #1c1917 100%);
    border: 2px solid #44403c;
    border-radius: 20px;
    padding: 6px 16px;
    box-shadow: 0 4px 0 #0c0a09, inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.hardcore-mode-badge:hover {
    background: var(--theme-bg-secondary);
    box-shadow: 0 4px 0 #0c0a09, inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 15px var(--theme-primary-glow);
}

.hardcore-mode-badge .badge-icon {
    color: var(--theme-primary);
    font-size: 16px;
}

.hardcore-mode-badge .badge-text {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--theme-primary);
    text-shadow: 0 0 5px var(--theme-primary-glow);
}

/* Header Right Group */
.header-right-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* SYS.ONLINE Status */
.sys-status {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 2px;
    color: #4caf50;
    text-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 8px #4caf50, 0 0 16px rgba(76, 175, 80, 0.5);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 8px #4caf50, 0 0 16px rgba(76, 175, 80, 0.5);
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 4px #4caf50, 0 0 8px rgba(76, 175, 80, 0.3);
    }
}

/* Settings Button */
.settings-btn {
    background: linear-gradient(180deg, #292524 0%, #1c1917 100%);
    border: 2px solid #44403c;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 #0c0a09;
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background: linear-gradient(180deg, #3a3532 0%, #292524 100%);
    box-shadow: 0 3px 0 #0c0a09, 0 0 15px rgba(212, 175, 55, 0.4);
}

.settings-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #0c0a09;
}

.settings-btn .material-icons {
    color: #a8a29e;
    transition: color 0.2s ease;
}

.settings-btn:hover .material-icons {
    color: var(--theme-primary);
}

/* ========================================
   OPTIONS POPUP - THEME AWARE
   ======================================== */

.options-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.options-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.options-modal {
    background: linear-gradient(180deg, var(--theme-bg-secondary) 0%, var(--theme-bg-main) 100%);
    border: 4px solid var(--theme-border);
    border-radius: 8px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 0, 0, 0.8);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 2px solid var(--theme-border);
    background: rgba(0, 0, 0, 0.3);
}

.options-header span {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 3px;
    color: var(--theme-primary);
    text-shadow: 0 0 5px var(--theme-primary-glow);
}

.close-options {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    color: var(--theme-text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-options:hover {
    background: var(--theme-border);
    color: #fff;
    border-color: var(--theme-primary);
}

.options-content {
    padding: 20px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--theme-primary);
    margin-bottom: 12px;
}

/* Theme Options */
.theme-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 2px solid var(--theme-border);
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--theme-text-primary);
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--theme-border-accent);
}

.theme-btn.active {
    background: linear-gradient(90deg, var(--theme-accent-red) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-color: var(--theme-primary);
    color: #fff;
}

.theme-btn.active::after {
    content: '●';
    position: absolute;
    right: 16px;
    color: #fff;
    font-size: 10px;
}

/* Audio Toggle */
.audio-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border: 2px solid var(--theme-border);
    border-radius: 4px;
}

.audio-toggle span {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--theme-text-primary);
}

.toggle-btn {
    width: 36px;
    height: 36px;
    background: var(--theme-bg-secondary);
    border: 2px solid var(--theme-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: var(--theme-border);
    border-color: var(--theme-primary);
}

.toggle-btn .material-icons {
    color: #4caf50;
    font-size: 18px;
}

.toggle-btn.muted .material-icons {
    color: var(--theme-accent-red);
}

/* Volume Controls */
.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    margin-top: 8px;
}

.volume-label {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--theme-text-secondary);
    min-width: 100px;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--theme-border);
    border-radius: 3px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-border-accent) 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--theme-border-accent);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px var(--theme-primary-glow);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-border-accent) 100%);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--theme-border-accent);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-value {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: var(--theme-primary);
    min-width: 35px;
    text-align: right;
}

/* Confirm Button */
.confirm-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(180deg, var(--theme-accent-red) 0%, rgba(0, 0, 0, 0.3) 100%);
    border: 2px solid var(--theme-primary);
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    letter-spacing: 3px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.confirm-btn:hover {
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5), 0 0 20px var(--theme-primary-glow);
}

.confirm-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

/* ========================================
   INTERACTIVE SCROLL INDICATOR - Theme Aware
   ======================================== */

.scroll-indicator {
    position: absolute;
    right: 0;
    top: 48px;
    bottom: 0;
    width: 16px;
    background: var(--theme-bg-secondary);
    border-left: 2px solid var(--theme-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    z-index: 20;
}

.scroll-track {
    width: 6px;
    flex: 1;
    background: var(--theme-border);
    border-radius: 3px;
    position: relative;
    margin: 4px 0;
    border-top: 2px solid var(--theme-primary);
    border-bottom: 2px solid var(--theme-primary);
}

.scroll-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-border-accent) 100%);
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: top 0.1s ease-out;
}

.scroll-thumb:hover {
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-primary) 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 10px var(--theme-primary-glow);
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-text-secondary);
    font-size: 14px;
    transition: color 0.2s ease;
    cursor: pointer;
}

.scroll-arrow:hover {
    color: var(--theme-primary);
}

/* ========================================
   SOUND EFFECT INDICATOR
   ======================================== */

.nav-btn {
    position: relative;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.nav-btn:hover::before {
    opacity: 1;
}

/* ========================================
   INTERACTIVE ELEMENT HOVER EFFECTS
   ======================================== */

/* Inventory Items */
.inventory-item {
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.inventory-item:hover {
    background: rgba(var(--theme-primary), 0.15);
    border-color: var(--theme-primary);
    box-shadow: 0 0 8px var(--theme-primary-glow);
}

/* Project Cards */
.project-card {
    transition: all 0.2s ease;
}

.project-card:hover {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 4px 0 #5d4037, 0 6px 6px rgba(0, 0, 0, 0.4), 0 0 15px var(--theme-primary-glow) !important;
}

/* Article Items */
.article-item {
    padding: 12px;
    margin: -12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.article-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--theme-primary);
    box-shadow: 0 0 15px var(--theme-primary-glow);
}

/* Social Links */
.social-link {
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.social-link:hover {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 10px var(--theme-primary-glow);
}

/* Career Log Card */
.career-log {
    transition: all 0.2s ease;
}

.career-log:hover {
    border-color: var(--theme-primary) !important;
    box-shadow: inset 0 0 0 1px var(--theme-primary), 0 0 15px var(--theme-primary-glow) !important;
}

/* Contact Button */
.contact-btn {
    transition: all 0.2s ease;
}

.contact-btn:hover {
    box-shadow: 0 4px 0 #1c1917, 0 0 20px rgba(212, 175, 55, 0.4) !important;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet Breakpoint - 768px */
@media (max-width: 768px) {

    /* Enable full page scrolling on mobile */
    body {
        overflow-y: visible !important;
        overflow-x: hidden;
        height: auto !important;
        min-height: 100vh;
    }

    /* Header Adjustments */
    header {
        height: 48px;
        padding: 0 12px !important;
    }

    /* Hide HARDCORE MODE badge on mobile */
    .hardcore-mode-badge {
        display: none !important;
    }

    /* Compact header stats */
    header .text-2xl {
        font-size: 1.25rem;
    }

    header .text-sm {
        font-size: 0.65rem;
    }

    /* Header right group spacing */
    .header-right-group {
        gap: 8px;
    }

    /* Lives: hide text, show hearts only */
    .header-right-group .text-sm.tracking-widest {
        display: none;
    }

    /* Settings button smaller */
    .settings-btn {
        width: 32px;
        height: 32px;
    }

    .settings-btn .material-icons {
        font-size: 18px;
    }

    /* Layout Grid: Single column on mobile */
    .layout-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        gap: 0;
        max-height: none;
        overflow: visible;
    }

    /* Main content - use page scroll */
    main {
        overflow: visible;
    }

    /* Sidebar becomes collapsible accordion - header only visible */
    aside {
        max-height: 44px;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        border-width: 4px !important;
    }

    aside.expanded {
        max-height: 600px;
        overflow-y: auto;
    }

    /* Remove per-panel scrollbars */
    #main-terminal {
        overflow: hidden;
    }

    .tab-content {
        overflow: visible;
    }

    /* Sidebar header styling for accordion */
    aside>div:first-child {
        cursor: pointer;
    }

    aside>div:first-child::after {
        content: '▼';
        margin-left: auto;
        margin-right: 8px;
        font-size: 10px;
        transition: transform 0.3s ease;
    }

    aside.expanded>div:first-child::after {
        transform: rotate(180deg);
    }

    /* Main terminal full height */
    #main-terminal {
        border-width: 4px !important;
    }

    /* Navigation Bar Mobile */
    nav>div {
        gap: 6px;
        padding: 6px;
    }

    .nav-btn {
        min-width: 56px;
        padding: 8px 10px;
    }

    .nav-btn .material-icons {
        font-size: 1.25rem;
    }

    .nav-text {
        font-size: 8px;
        letter-spacing: 0.05em;
    }

    /* Content area padding */
    .tab-content>div:last-child {
        padding: 16px !important;
    }

    /* Section headings */
    .text-4xl,
    .text-5xl {
        font-size: 1.75rem !important;
    }

    .text-2xl {
        font-size: 1.25rem;
    }

    /* Skill cards: single column */
    .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    /* Project cards: single column */
    .grid.grid-cols-1.md\\:grid-cols-2.gap-6 {
        grid-template-columns: 1fr;
    }

    /* Options modal width */
    .options-modal {
        min-width: 280px;
        max-width: 90vw;
        margin: 0 16px;
    }
}

/* Small Mobile Breakpoint - 480px */
@media (max-width: 480px) {

    /* Extra compact header */
    header {
        height: 44px;
        padding: 0 8px !important;
    }

    /* Header stats remain visible - removed hiding rule */

    /* Score compact */
    header>div:first-child .text-2xl {
        font-size: 1rem;
    }

    header>div:first-child .text-sm {
        font-size: 0.6rem;
    }

    /* Hearts smaller */
    .header-right-group .material-symbols-outlined {
        font-size: 18px;
    }

    /* Navigation even smaller */
    .nav-btn {
        min-width: 48px;
        padding: 6px 8px;
    }

    .nav-btn .material-icons {
        font-size: 1.1rem;
    }

    .nav-text {
        font-size: 7px;
    }

    /* Main content padding */
    main {
        padding: 8px !important;
    }

    /* Increased padding bottom for mobile connection overlap fix */
    .tab-content>div:last-child {
        padding: 12px !important;
        padding-bottom: 100px !important;
    }

    /* Headings smaller */
    .text-4xl,
    .text-5xl {
        font-size: 1.5rem !important;
    }

    .text-xl {
        font-size: 1rem;
    }

    /* Quote box */
    .font-baskervville.text-xl,
    .font-baskervville.text-2xl {
        font-size: 1rem !important;
    }

    /* Sidebar accordion header text */
    aside .tracking-widest {
        font-size: 0.7rem;
    }
}

/* Extra Small Mobile - 360px */
@media (max-width: 360px) {

    /* Navigation: hide text labels */
    .nav-text {
        display: none;
    }

    .nav-btn {
        min-width: 44px;
        padding: 8px;
    }

    /* Keep Score/Level labels visible but smaller */
    header .text-stone-500 {
        font-size: 8px;
    }
}

/* ========================================
   PANEL SYSTEM - DRAG, RESIZE, CLOSE
   ======================================== */

/* Panel Base Styles */
.panel {
    position: relative;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Panel Header - Draggable Area */
.panel-header {
    cursor: default;
}

/* Panel Hidden State */
.panel.panel-hidden {
    display: none !important;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    cursor: se-resize;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.resize-handle:hover svg {
    color: var(--theme-primary);
}

/* Desktop Only - Draggable and Resizable */
@media (min-width: 1024px) {

    /* Panel Header drag disabled */
    .panel-header {
        cursor: default;
        /* user-select: none; */
    }

    /* .panel-header:active {
        cursor: grabbing;
    } */

    /* Panel in dragging state - Disabled */
    /* .panel.dragging {
        position: fixed !important;
        z-index: 1000 !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--theme-primary-glow);
        border-color: var(--theme-primary) !important;
    }

    .panel.dragging .panel-header {
        cursor: grabbing;
    } */

    /* Panel active (focused) state */
    .panel.panel-active {
        z-index: 100;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }

    /* Panel in resizing state */
    .panel.resizing {
        user-select: none;
    }

    /* Show resize handle on desktop */
    .resize-handle {
        display: flex;
    }
}

/* Close button styling */
.close-tab-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-tab-btn:hover {
    background: rgba(138, 28, 28, 0.3);
    color: var(--theme-accent-red) !important;
}



/* Tablet/Desktop Sidebar Accordion (769px and above) */
@media (min-width: 769px) {
    #sidebar-panel .accordion-icon {
        display: block !important;
        cursor: pointer;
        transition: transform 0.2s ease;
    }

    #sidebar-panel .accordion-icon:hover {
        color: var(--theme-primary);
    }

    #sidebar-panel.sidebar-collapsed {
        max-height: 48px;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    #sidebar-panel.sidebar-collapsed>div:not(.panel-header) {
        opacity: 0;
        pointer-events: none;
    }

    #sidebar-panel:not(.sidebar-collapsed) {
        transition: max-height 0.3s ease;
    }
}