*,
*::before,
*::after {
    box-sizing: border-box;
    font-family: 'Google Sans Code', monospace;
}

:focus,
:hover,
:active {
    outline: none;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Google Sans Code', monospace;
    height: 100vh;
    width: 100vw;
}

#app {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
}

#terminal-container {
    position: relative;
    width: 95vw;
    max-width: 1170px;
    height: 800px;
    overflow: hidden; /* Ensure proper clipping */
}

#terminal-container.maximized {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    z-index: 1000;
}

#terminal {
    width: 100%;
    height: 100%;
    transition: .2s;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#window {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    cursor: default;
}

.btn {
    margin-right: 10px;
    border: none;
    height: 13px;
    width: 13px;
    border-radius: 50%;
    box-shadow: 0 2px 2px #33333375;
    cursor: pointer;
}

.red {
    background-color: #FF4136;
}

.error {
    color: #FF4136;
    font-weight: 700;
}

.yellow {
    background-color: #FFDC00;
}

.info {
    color: #FFDC00;
}

.green {
    background-color: #2ECC40;
}

.scroll-to-load-indicator {
    color: #00ff00;
    font-style: italic;
}

.progress-status {
    color: #ffff00;
}

.progress-bar {
    color: #00ff00;
    font-family: monospace;
}

.progress-complete {
    color: #00ff00;
}

.progress-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(34, 35, 51, 0.95);
    border-top: 1px solid #444;
    padding: 10px 15px;
    z-index: 25;
    text-align: left;
    font-weight: normal;
    font-size: 0.85rem;
    color: #F4F4F4;
    backdrop-filter: blur(5px);
}

.light .progress-overlay {
    background: rgba(227, 227, 227, 0.95);
    border-color: #ccc;
    color: #474554;
}

.progress-overlay.complete {
    color: #00ff00;
}

.article-content-expanded {
    margin-bottom: 80px;
}

#field {
    position: relative;
}

.preview-label {
    color: #888888;
    font-style: italic;
    font-size: 0.9em;
}

.content-preview {
    color: #aaaaaa;
    font-style: italic;
    opacity: 0.8;
    border-left: 2px solid #444444;
    padding-left: 10px;
}

.markdown-bold {
    font-weight: bold;
}

/* Modern Article Color Classes */
.article-red {
    color: #EF4444 !important; /* Red 500 */
}

.article-blue {
    color: #3B82F6 !important; /* Blue 500 */
}

.article-green {
    color: #10B981 !important; /* Emerald 500 */
}

.article-yellow {
    color: #F59E0B !important; /* Amber 500 */
}

.article-purple {
    color: #7C3AED !important; /* Violet 600 */
}

.article-orange {
    color: #F97316 !important; /* Orange 500 */
}

.article-cyan {
    color: #06B6D4 !important; /* Cyan 500 */
}

.article-pink {
    color: #EC4899 !important; /* Pink 500 */
}

.light .preview-label {
    color: #666666;
}

.light .content-preview {
    color: #555555;
    border-left-color: #cccccc;
}

.link {
    color: #06B6D4; /* Cyan 500 */
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
}

.prompt {
    color: #F25D94; /* Hot Pink */
}

.light .prompt {
     color: #7C3AED; /* Purple 600 */
}

.highlight {
    font-weight: 700;
    color: #F25D94; /* Hot Pink */
}

.light .highlight {
    color: #7C3AED; /* Purple 600 */
}

#title,
#field {
    font-size: .85rem;
}

#title {
    margin-left: auto;
}

#terminal-body {
    height: calc(100% - 40px);
    display: flex;
    flex-direction: column;
}

#terminal-header {
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(
        to bottom,
        rgba(34, 35, 51, 0.98) 0%,
        rgba(34, 35, 51, 0.95) 80%,
        rgba(34, 35, 51, 0.85) 100%
    );
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    min-height: 96px;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#terminal-header > * {
    pointer-events: all;
}

#field {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

#terminal-body.with-header #field {
    margin-top: 136px; /* Fixed header height + some spacing */
    height: calc(100% - 136px);
}

#terminal-input {
    padding: 10px 15px;
    border-top: 1px solid #444;
    background: rgba(34, 35, 51, 0.95);
    backdrop-filter: blur(5px);
    position: sticky;
    bottom: 0;
    z-index: 10;
    font-family: 'Google Sans Code', monospace;
    font-size: 0.85rem;
}

.input-box {
    border: 1px solid #B794F6;
    border-radius: 2px;
    padding: 8px 12px;
    background: transparent;
    cursor: text;
    transition: border-color 0.2s ease;
    margin-left: 8px;
    flex: 1;
    min-height: 20px;
    display: flex;
    align-items: center;
    font-family: 'Google Sans Code', monospace;
}

.input-box:hover {
    border-color: #C3A6F0;
}

.input-box.focused {
    border-color: #9F7AEA;
    box-shadow: 0 0 5px rgba(159, 122, 234, 0.3);
}

/* Modern Mobile Terminal Input */
.terminal-text-input {
    background: transparent;
    border: none;
    outline: none;
    color: #F4F4F4;
    font-family: 'Google Sans Code', monospace;
    font-size: 0.85rem;
    flex: 1;
    padding: 0;
    margin: 0;
    caret-color: #F4F4F4;
    width: 100%;
    min-width: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.terminal-text-input::placeholder {
    color: rgba(244, 244, 244, 0.3);
    transition: opacity 0.2s ease;
}

.terminal-text-input:focus::placeholder {
    opacity: 0;
}

.terminal-text-input:focus {
    outline: none;
    border: none;
}

/* Mobile-First Responsive Design */
@media (hover: none) and (pointer: coarse) {
    /* Mobile terminal redesign */
    #terminal-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        border-radius: 0 !important;
    }
    
    #terminal {
        border-radius: 0 !important;
        height: 100vh !important;
    }
    
    #window {
        display: none; /* Hide window controls on mobile */
    }
    
    #terminal-body {
        height: 100vh !important;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    
    /* Mobile input area */
    #terminal-input {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(34, 35, 51, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        border-top: 1px solid rgba(159, 122, 234, 0.3) !important;
        padding: 16px 20px !important;
        z-index: 1000 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    }
    
    .input-line {
        display: flex;
        align-items: center;
        background: rgba(159, 122, 234, 0.1);
        border: 1px solid rgba(159, 122, 234, 0.3);
        border-radius: 12px;
        padding: 12px 16px;
        min-height: 48px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }
    
    .input-line::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, 
            rgba(159, 122, 234, 0.1) 0%, 
            rgba(242, 93, 148, 0.1) 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: -1;
    }
    
    .input-line.focused::before {
        opacity: 1;
    }
    
    .input-line.focused {
        border-color: rgba(159, 122, 234, 0.6);
        box-shadow: 0 0 20px rgba(159, 122, 234, 0.2);
        transform: translateY(-2px);
        animation: mobile-focus-pulse 0.6s ease-out;
    }
    
    @keyframes mobile-focus-pulse {
        0% {
            transform: translateY(0) scale(1);
            box-shadow: 0 0 0 rgba(159, 122, 234, 0);
        }
        50% {
            transform: translateY(-1px) scale(1.02);
            box-shadow: 0 0 30px rgba(159, 122, 234, 0.4);
        }
        100% {
            transform: translateY(-2px) scale(1);
            box-shadow: 0 0 20px rgba(159, 122, 234, 0.2);
        }
    }
    
    /* Mobile command success animation */
    @keyframes mobile-command-success {
        0% {
            transform: scale(1);
            background: rgba(159, 122, 234, 0.1);
        }
        25% {
            transform: scale(0.98);
            background: rgba(16, 185, 129, 0.2);
        }
        50% {
            transform: scale(1.02);
            background: rgba(16, 185, 129, 0.15);
        }
        100% {
            transform: scale(1);
            background: rgba(159, 122, 234, 0.1);
        }
    }
    
    .mobile-command-success {
        animation: mobile-command-success 0.4s ease-out;
    }
    
    /* Enhanced touch targets for mobile */
    .terminal-text-input:active {
        transform: scale(0.99);
    }
    
    /* Better visual feedback for mobile interactions */
    .input-line:active {
        transform: translateY(-1px) scale(0.99);
        transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Prevent text selection on mobile UI elements */
    .prompt, .nav-tree-item, .enhanced-nav-tree {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    
    /* Improved touch targets for mobile navigation */
    .nav-tree-item {
        min-height: 44px !important;
        padding: 8px 12px !important;
        margin: 4px 0 !important;
        display: inline-block !important;
        border-radius: 6px !important;
        transition: all 0.2s ease !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
        background: rgba(159, 122, 234, 0.05) !important;
        border: 1px solid rgba(159, 122, 234, 0.15) !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    .nav-tree-item:hover, .nav-tree-item:active {
        background: rgba(159, 122, 234, 0.15) !important;
        border-color: rgba(159, 122, 234, 0.3) !important;
        transform: scale(0.98) !important;
    }
    
    /* Mobile Tetris Game Optimizations */
    @media (hover: none) and (pointer: coarse) {
        .game-grid {
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
        }
        
        .game-grid .grid-cell {
            border-width: 0.5px !important;
        }
        
        /* Better touch targets for mobile Tetris controls */
        .mobile-tetris-control {
            min-height: 44px;
            min-width: 44px;
            padding: 12px;
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .mobile-tetris-control:active {
            transform: scale(0.95);
            opacity: 0.8;
        }
        
        /* Mobile game over overlay improvements */
        .mobile-game-over {
            touch-action: manipulation;
            -webkit-tap-highlight-color: transparent;
            transition: all 0.3s ease;
        }
        
        .mobile-game-over:active {
            transform: scale(0.98);
            background: rgba(0, 0, 0, 0.95) !important;
        }
        
        /* Mobile bottom panel blur effect */
        .mobile-bottom-panel {
            backdrop-filter: blur(20px) !important;
            -webkit-backdrop-filter: blur(20px) !important;
            box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4) !important;
        }
        
        /* Better visual feedback for pieces */
        .mobile-piece-container {
            background: rgba(139, 92, 246, 0.1);
            border: 1px solid rgba(139, 92, 246, 0.3);
            border-radius: 8px;
            padding: 8px;
            transition: all 0.2s ease;
        }
        
        .mobile-piece-container:active {
            background: rgba(139, 92, 246, 0.2);
            transform: scale(0.98);
        }
    }
    
    .prompt {
        color: var(--primary) !important;
        font-weight: 700 !important;
        margin-right: 12px !important;
        font-size: 14px !important;
        flex-shrink: 0;
    }
    
    .terminal-text-input {
        font-size: 16px !important; /* Prevent zoom on iOS */
        color: #F4F4F4 !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
        flex: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
        font-family: 'Google Sans Code', monospace !important;
        font-weight: 400 !important;
    }
    
    .terminal-text-input::placeholder {
        color: rgba(244, 244, 244, 0.4) !important;
        font-style: italic;
    }
    
    /* Adjust field for mobile input */
    #field {
        padding-bottom: 120px !important; /* Space for input */
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-top: 20px !important;
    }
    
    #terminal-body.with-header #field {
        margin-top: 0 !important;
        height: calc(100vh - 140px) !important;
        padding-top: 100px !important; /* Increased to account for larger mobile header */
    }
    
    /* Mobile header adjustments - Compact version */
    #terminal-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: rgba(34, 35, 51, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        border-bottom: 1px solid rgba(159, 122, 234, 0.3) !important;
        z-index: 999 !important;
        padding: 12px 16px !important;
        padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
        min-height: auto !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: center !important;
        gap: 8px !important;
    }
    
    .enhanced-nav-tree {
        width: 100% !important;
        font-size: 14px !important;
        padding: 12px 16px !important;
        margin: 0 !important;
        background: rgba(159, 122, 234, 0.08) !important;
        border: 1px solid rgba(159, 122, 234, 0.25) !important;
        border-radius: 8px !important;
        flex: none !important;
        max-width: none !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: initial !important;
        line-height: 1.4 !important;
    }
    
    #terminal-banner {
        font-size: 12px !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        max-width: none !important;
        width: 100% !important;
        overflow: visible !important;
        text-overflow: initial !important;
        white-space: normal !important;
        text-align: center !important;
    }
}

.light .input-box {
    background: rgba(255, 255, 255, 0.2);
    border-color: #7C3AED;
}

.light .input-box:hover {
    border-color: #8B5CF6;
    background: rgba(255, 255, 255, 0.3);
}

.light .input-box.focused {
    border-color: #6D28D9;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
    background: rgba(255, 255, 255, 0.4);
}

/* Light theme terminal input */
.light .terminal-text-input {
    color: #474554;
    caret-color: #474554;
}

.exit-cli-link {
    color: var(--warning);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    padding: 2px 6px;
    margin-left: 12px;
    border: 1px solid var(--warning);
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.1);
}

.exit-cli-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(242, 93, 148, 0.2);
    text-decoration: none;
}

.input-line {
    display: flex;
    align-items: center;
}

#terminal-input .prompt {
    color: var(--primary);
    font-weight: bold;
    margin-right: 8px;
}

#terminal-input #query {
    color: var(--text-primary);
}


#field::-webkit-scrollbar {
    width: 10px;
}

#field.dark::-webkit-scrollbar-thumb {
    background-color: #8B5CF6;
}

#field.light::-webkit-scrollbar-thumb {
    background-color: #8B5CF6;
}

#field::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.1);
}

#field::-webkit-scrollbar-thumb:hover {
    background-color: #A78BFA;
}

#field>div {
    min-height: 20px;
    width: 100%;
    cursor: text;
}

.history-item {
    transition: opacity 0.5s ease-in-out;
}

.history-item.dimmed {
    opacity: 0.5;
}

#query,
#cursor {
    display: inline-block;
}

#query {
    margin-right: 10px;
    white-space: pre;
}

#cursor {
    position: relative;
    bottom: -2px;
    left: 2px;
    width: .5rem;
    height: 3px;
}

/* Enhanced Navigation Styles */
.enhanced-nav-tree {
    padding: 1rem;
    font-size: 0.85rem;
    width: 50%;
    white-space: pre;
    color: var(--text-secondary);
    font-family: 'Google Sans Code', monospace;
    position: relative;
    z-index: 10;
    background: linear-gradient(
        to bottom,
        rgba(34, 35, 51, 0.95) 0%,
        rgba(34, 35, 51, 0.8) 50%,
        rgba(34, 35, 51, 0.6) 100%
    );
}

.nav-header {
    color: var(--success);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.nav-prompt {
    color: var(--primary);
}

.nav-command {
    color: var(--warning);
    margin-left: 0.5rem;
}

.nav-root {
    color: var(--info);
    margin-bottom: 0.3rem;
}

.nav-item {
    line-height: 1.3;
}

.nav-branch {
    color: var(--text-muted);
}

.nav-tree-item {
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--tertiary);
    position: relative;
}

.nav-tree-item:hover {
    color: var(--primary);
    background-color: rgba(242, 93, 148, 0.1);
    padding: 0 4px;
    border-radius: 2px;
}

.active-nav-item {
    color: var(--secondary);
    font-weight: bold;
}

.nav-subitem {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.nav-subbranch {
    color: var(--text-muted);
}

.nav-symlink {
    color: var(--tertiary);
    font-style: italic;
}

.nav-mode-button {
    color: #F25D94;
    cursor: pointer;
    transition: color 0.2s ease;
    font-weight: bold;
}

.nav-mode-button:hover {
    color: #FF69B4;
    text-decoration: underline;
}

.light .nav-mode-button {
    color: #7C3AED;
}

.light .nav-mode-button:hover {
    color: #8B5CF6;
}

/* Efficient Duck Container - spans entire terminal width */
#duck-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 40px; /* Start below window controls */
    left: 0;
    overflow: visible;
    min-height: 96px;
    background: transparent;
    pointer-events: none;
    z-index: 2; /* Above field but below header */
}

#duck-container > * {
    pointer-events: all;
}

/* Water Background (CSS-based animations) - spans full width */
.water-background {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    overflow: hidden;
    background: transparent;
    mask: linear-gradient(
        to top,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,0.8) 40%,
        rgba(0,0,0,0.3) 70%,
        transparent 100%
    );
    -webkit-mask: linear-gradient(
        to top,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,0.8) 40%,
        rgba(0,0,0,0.3) 70%,
        transparent 100%
    );
}

.water-layer {
    position: absolute;
    width: 100vw;
    height: 20px;
    font-family: 'Google Sans Code', monospace;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0.9;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    left: calc(-50vw + 50%);
    mask: linear-gradient(
        to left,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,0.8) 30%,
        rgba(0,0,0,0.5) 60%,
        rgba(0,0,0,0) 100%
    );
    -webkit-mask: linear-gradient(
        to left,
        rgba(0,0,0,1) 0%,
        rgba(0,0,0,0.8) 30%,
        rgba(0,0,0,0.5) 60%,
        rgba(0,0,0,0) 100%
    );
}

.water-layer-1 {
    bottom: 65px;
    color: #00FFFF;
    animation: wave-scroll-1 8s linear infinite;
    z-index: 5;
}

.water-layer-2 {
    bottom: 50px;
    color: #40E0D0;
    animation: wave-scroll-2 10s linear infinite reverse;
    z-index: 4;
}

.water-layer-3 {
    bottom: 35px;
    color: #20B2AA;
    animation: wave-scroll-3 12s linear infinite;
    z-index: 3;
}

.water-layer-4 {
    bottom: 20px;
    color: #008B8B;
    animation: wave-scroll-4 14s linear infinite reverse;
    z-index: 2;
}

.water-layer-5 {
    bottom: 5px;
    color: #006666;
    animation: wave-scroll-5 16s linear infinite;
    z-index: 1;
    opacity: 0.7;
}

/* Dynamic wave animations with varying speeds */
@keyframes wave-scroll-1 {
    0% { transform: translateX(0) translateZ(0); }
    100% { transform: translateX(-50%) translateZ(0); }
}

@keyframes wave-scroll-2 {
    0% { transform: translateX(0) translateZ(0); }
    100% { transform: translateX(-50%) translateZ(0); }
}

@keyframes wave-scroll-3 {
    0% { transform: translateX(0) translateZ(0); }
    100% { transform: translateX(-50%) translateZ(0); }
}

@keyframes wave-scroll-4 {
    0% { transform: translateX(0) translateZ(0); }
    100% { transform: translateX(-50%) translateZ(0); }
}

@keyframes wave-scroll-5 {
    0% { transform: translateX(0) translateZ(0); }
    100% { transform: translateX(-50%) translateZ(0); }
}

/* Efficient duck animation */
.animated-duck {
    animation: gentle-float 4s ease-in-out infinite;
    transform: translateZ(0); /* Enable hardware acceleration */
    transition: left 1.8s cubic-bezier(0.15, 0.35, 0.25, 0.95), 
                top 1.8s cubic-bezier(0.15, 0.35, 0.25, 0.95);
}

.animated-duck div {
    margin: 0;
    padding: 0;
    line-height: 1;
}

@keyframes gentle-float {
    0%, 100% { 
        transform: translateY(0px) translateZ(0) rotate(0deg); 
    }
    25% { 
        transform: translateY(-2px) translateZ(0) rotate(-1deg); 
    }
    50% { 
        transform: translateY(-4px) translateZ(0) rotate(0deg); 
    }
    75% { 
        transform: translateY(-2px) translateZ(0) rotate(1deg); 
    }
}

/* Breadcrumb effects */
.breadcrumb {
    will-change: transform, opacity;
    transform: translateZ(0);
    z-index: 20 !important;
    pointer-events: none;
}

@keyframes ripple-pulse {
    0% {
        transform: scale(0.3) translateZ(0);
        opacity: 1;
    }
    50% {
        transform: scale(1) translateZ(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(2) translateZ(0);
        opacity: 0;
    }
}

/* Legacy navigation styles for backwards compatibility */
.nav-about { color: #06B6D4; }
.nav-projects { color: #F25D94; }
.nav-writings { color: #10B981; }
.nav-mode { color: #F59E0B; }

.ascii-art {
    white-space: pre;
    line-height: 1;
}

.duck-container {
    margin-bottom: 1rem;
}

.duck-bobbing {
    animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0px); }
}

.ascii-art.duck {
    color: #F59E0B; /* Amber 500 */
    font-size: 1.2rem;
    margin-bottom: 0;
}

.ascii-art.water {
    color: #06B6D4; /* Cyan 500 */
    font-size: 1.2rem;
}

.clickable-text {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.clickable-text:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.article-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.article-content {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 2rem;
    border-radius: 8px;
    max-width: 80vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    font-family: 'Google Sans Code', monospace;
    line-height: 1.6;
}

.article-header {
    border-bottom: 1px solid #444;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.article-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #7FDBFF;
    margin-bottom: 0.5rem;
}

.article-date {
    color: #888;
    font-size: 0.9rem;
}

.article-body {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.1);
}

.dimmed {
    opacity: 0.3;
    pointer-events: none;
}

.typing-cursor {
    display: inline-block;
    background-color: #F25D94; /* Hot Pink */
    width: 8px;
    height: 1.2em;
    margin-left: 2px;
    animation: blink 1s infinite;
}

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

/* High Score System Animations */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 10px var(--warning);
    }
    50% { 
        transform: scale(1.05);
        text-shadow: 0 0 20px var(--warning), 0 0 30px var(--warning);
    }
}

/* Retro Gaming Font Styles */
.retro-font {
    font-family: 'Orbitron', monospace !important;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.arcade-title {
    font-family: 'Orbitron', monospace !important;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

@keyframes blink-dark {
    0%, 100% {
        background-color: #F4F4F4;
    }
    50% {
        background-color: transparent;
    }
}

@keyframes blink-light {
    0%, 100% {
        background-color: #474554;
    }
    50% {
        background-color: transparent;
    }
}

/* Mobile and small screen adjustments */
@media only screen and (max-width: 600px) {
    #app {
        padding: 10px;
    }
    #terminal-container {
        width: 95vw;
        max-width: 95vw;
    }
    #terminal-body {
        height: calc(100% - 40px);
    }
    #field {
        padding: 10px;
    }
    #terminal-body.with-header #field {
        margin-top: 50px; /* Adjusted for compact mobile header */
        height: calc(100% - 50px);
    }
    #terminal-input {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    /* Compact navigation for small screens */
    .enhanced-nav-tree {
        font-size: 13px !important;
        padding: 10px 14px !important;
    }
    
    #terminal-header {
        padding: 10px 12px !important;
        padding-top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    }
    
    #terminal-banner {
        font-size: 11px !important;
    }
    
    .nav-tree-item {
        min-height: 40px !important;
        padding: 6px 10px !important;
        font-size: 13px !important;
    }
}

/* Tablet and medium screens */
@media only screen and (max-width: 768px) and (min-width: 601px) {
    #terminal-body.with-header #field {
        margin-top: 0 !important;
        height: calc(100vh - 130px) !important;
        padding-top: 90px !important;
    }
    
    #terminal-header {
        padding: 10px 14px !important;
        padding-top: calc(10px + env(safe-area-inset-top, 0px)) !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    
    .enhanced-nav-tree {
        font-size: 13px !important;
        padding: 10px 14px !important;
        width: 100% !important;
    }
    
    .nav-tree-item {
        min-height: 42px !important;
        padding: 7px 11px !important;
        font-size: 13px !important;
    }
}

/* Small height screens (landscape mobile, small laptops) */
@media only screen and (max-height: 600px) {
    #terminal-body.with-header #field {
        margin-top: 0 !important;
        height: calc(100vh - 100px) !important;
        padding-top: 70px !important;
    }
    
    .enhanced-nav-tree {
        padding: 8px 12px !important;
        font-size: 12px !important;
        width: 100% !important;
    }
    
    #terminal-header {
        padding: 6px 10px !important;
        padding-top: calc(6px + env(safe-area-inset-top, 0px)) !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
    }
    
    #terminal-banner {
        font-size: 10px !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .nav-tree-item {
        min-height: 36px !important;
        padding: 5px 8px !important;
        font-size: 12px !important;
    }
}

/* Portrait mobile screens - extra tall */
@media only screen and (max-width: 480px) and (orientation: portrait) {
    #terminal-body.with-header #field {
        margin-top: 0 !important;
        height: calc(100vh - 140px) !important;
        padding-top: 100px !important;
    }
    
    #terminal-header {
        padding: 12px 12px !important;
        padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    
    .enhanced-nav-tree {
        font-size: 14px !important;
        padding: 12px 16px !important;
        width: 100% !important;
    }
    
    #terminal-banner {
        font-size: 12px !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .nav-tree-item {
        min-height: 44px !important;
        padding: 8px 12px !important;
        font-size: 14px !important;
    }
}

.active-nav-item {
    text-decoration: underline;
}

.expanded-article {
    font-weight: 700;
}

.collapsed-article {
    font-weight: 400;
}

.article-content-expanded {
    padding-left: 2rem;
}

.article-content-progressive {
    padding-left: 2rem;
}

.article-preview-clickable {
    cursor: pointer;
}

/* Terminal button styles for document reader */
.terminal-share-button {
    color: var(--tertiary);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.terminal-share-button:hover {
    color: var(--secondary);
    text-decoration: underline;
    background-color: rgba(124, 58, 237, 0.1);
}

.terminal-success {
    color: var(--success);
    font-weight: bold;
}
