:root {
    --bg-color: #050505;
    --card-bg: #111111;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent: #00ff41;
    /* Hacker Green */
    --accent-glow: rgba(0, 255, 65, 0.5);
    --font-heading: 'Space Mono', monospace;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    /* Force scroll */
    min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.03em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* Utility */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.highlight {
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-primary:hover {
    background: #00cc33;
    box-shadow: 0 0 25px var(--accent-glow);
}

.btn-outline {
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-outline:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.2rem;
}

.btn-glow {
    background: var(--accent);
    color: #000;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 255, 65, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 65, 0);
    }
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 255, 65, 0.15);
    height: 52px;
}

.logo {
    font-size: 1.2rem;
    white-space: nowrap;
}

.nav-source-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-source-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-right: 8px;
}

.btn-nav-source {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-nav-source:hover {
    border-color: var(--accent);
    color: #fff;
    background: rgba(0, 255, 65, 0.05);
}

.btn-nav-source.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.15);
}

.nav-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Navbar Recording Indicator */
.nav-recording-indicator {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 60, 60, 0.4);
    background: rgba(255, 30, 30, 0.1);
    color: #ff4444;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: rec-pulse 1s infinite;
}

.nav-recording-indicator .rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4444;
}

.nav-recording-indicator .rec-text {
    font-weight: 700;
}

.nav-recording-indicator .rec-timer {
    color: #ff8888;
}

@keyframes rec-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Day/Night Toggle */
.btn-nav-theme-toggle {
    font-size: 1.1rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.btn-nav-theme-toggle:hover {
    border-color: var(--accent);
    background: rgba(0, 255, 65, 0.05);
}

/* Day Mode Overrides */
body.day-mode {
    --bg-color: #f0f0f0;
    --card-bg: #ffffff;
    --text-primary: #111111;
    --text-secondary: #555555;
    background-color: var(--bg-color);
    color: var(--text-primary);
}

body.day-mode .navbar {
    background: rgba(240, 240, 240, 0.95);
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.day-mode .nav-source-label {
    color: #999;
}

body.day-mode .btn-nav-source {
    border-color: rgba(0, 0, 0, 0.15);
    color: #555;
}

body.day-mode .btn-nav-source.active {
    background: rgba(0, 255, 65, 0.08);
    color: #007722;
    border-color: #00aa44;
}

body.day-mode .nav-status {
    background: rgba(0, 255, 65, 0.08);
    border-color: rgba(0, 255, 65, 0.15);
    color: #007722;
}

body.day-mode .controls-panel {
    background: rgba(255, 255, 255, 0.98);
    border-left-color: rgba(0, 0, 0, 0.1);
}

body.day-mode .preview-section {
    background: #e8e8e8;
}

body.day-mode .control-title {
    color: #333;
}

body.day-mode .btn-toggle,
body.day-mode .btn-theme,
body.day-mode .btn-action {
    border-color: rgba(0, 0, 0, 0.15);
    color: #555;
}

body.day-mode .btn-toggle.active,
body.day-mode .btn-theme.active {
    background: rgba(0, 255, 65, 0.15);
    color: #007722;
    border-color: #00aa44;
}

body.day-mode .slider {
    background: #ddd;
}

body.day-mode .select {
    background: #fff;
    color: #333;
    border-color: rgba(0, 0, 0, 0.15);
}

body.day-mode .control-group {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.day-mode .preview-container {
    border-color: #ccc;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* Hero */
.hero {
    min-height: 60vh;
    /* Reduced from 100vh */
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 80px 0;
    /* Add padding for content */
}

.hero-content {
    z-index: 10;
    max-width: 800px;
    padding: 20px;
}

.hero h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-ctas {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
}

.tech-badges {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Background Effects */
.ascii-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, #050505 90%);
    z-index: 2;
    pointer-events: none;
}

.video-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.3;
}

.placeholder-grid {
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 255, 65, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 40px 40px;
    }
}

/* Features */
.section {
    padding: 60px 0;
    /* Reduced from 100px */
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 60px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.feature-card p {
    color: var(--text-secondary);
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: center;
}

.pricing-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    position: relative;
}

.pricing-card.popular {
    border-color: var(--accent);
    transform: scale(1.05);
    z-index: 2;
    background: #151515;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.tag {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #000;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    margin: 20px 0;
    font-family: var(--font-heading);
}

.price span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.features-list {
    list-style: none;
    margin-bottom: 30px;
    text-align: left;
}

.features-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.full-width {
    width: 100%;
}

/* Footer */
footer {
    padding: 60px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 50px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.footer-links a {
    margin-left: 20px;
    color: var(--text-secondary);
}

.copyright {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

/* Glitch Effect */
.glitch {
    position: relative;
    color: var(--text-primary);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(20px, 9999px, 80px, 0);
    }

    10% {
        clip: rect(40px, 9999px, 10px, 0);
    }

    20% {
        clip: rect(90px, 9999px, 50px, 0);
    }

    100% {
        clip: rect(10px, 9999px, 90px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(30px, 9999px, 10px, 0);
    }

    10% {
        clip: rect(70px, 9999px, 90px, 0);
    }

    20% {
        clip: rect(10px, 9999px, 50px, 0);
    }

    100% {
        clip: rect(80px, 9999px, 20px, 0);
    }
}

/* App Preview */
.app-preview-container {
    margin-top: 40px;
    background: transparent;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 80px rgba(0, 255, 65, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 1200px;
    height: 800px;
    position: relative;
    z-index: 20;
    animation: slide-up 1s ease-out forwards;
    transform: translateY(30px);
    opacity: 0;
}

@keyframes slide-up {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.app-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* Studio Mode Overrides for full-screen app */
.studio-mode {
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    background: #050505;
    padding-top: 52px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(5, 5, 5, 0.9);
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.logo {
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    color: #fff;
    font-weight: 700;
}

.logo-bracket {
    color: #555;
}

.logo-dot {
    color: #00ff41;
}

.nav-status {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: #00ff41;
    margin-left: 20px;
    background: rgba(0, 255, 65, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 65, 0.2);
}

/* Main Layout */
.main {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 52px);
}

/* Preview Area */
.preview-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    position: relative;
    overflow: hidden;
}

.preview-container {
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #222;
    overflow: hidden;
    display: grid;
}

.ascii-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    grid-area: 1 / 1;
}

.postfx-canvas {
    grid-area: 1 / 1;
    max-width: 100%;
    max-height: 100%;
    pointer-events: none;
}

#source-video {
    display: none !important;
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Controls Panel */
.controls-panel {
    width: 320px;
    background: #0a0a0a;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.05em;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

.control-value {
    color: #00ff41;
}

/* Buttons */
.btn-source,
.btn-toggle,
.btn-action {
    background: #151515;
    border: 1px solid #333;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.btn-source:hover,
.btn-toggle:hover,
.btn-action:hover {
    border-color: #666;
    background: #222;
}

.btn-source.active,
.btn-toggle.active {
    background: rgba(0, 255, 65, 0.1);
    border-color: #00ff41;
    color: #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
}

.source-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.toggle-group {
    display: flex;
    gap: 10px;
}

.toggle-group .btn-toggle {
    flex: 1;
}

/* Theme Grid */
.theme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-theme {
    background: #151515;
    border: 1px solid #333;
    color: #ccc;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.btn-theme.active {
    border-color: #fff;
    color: #fff;
}

.theme-preview {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.theme-original {
    background: linear-gradient(135deg, #f0f, #0ff);
}

.theme-green {
    background: #0f0;
}

.theme-amber {
    background: #fa0;
}

.theme-cyan {
    background: #0ff;
}

.theme-white {
    background: #fff;
}

/* Sliders & Inputs */
.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #00ff41;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.select {
    background: #151515;
    border: 1px solid #333;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    width: 100%;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.select:focus {
    border-color: #00ff41;
}

/* Action Buttons */
.btn-record {
    background: #00ff41;
    color: #000;
    border-color: #00ff41;
    font-weight: 600;
}

.btn-record:hover {
    background: #00cc33;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

.btn-screenshot {
    background: transparent;
    border: 1px solid #666;
}

.actions-group {
    flex-direction: row;
    margin-top: auto;
    /* Push to bottom */
}

.btn-action {
    flex: 1;
}

/* Footer info */
.controls-footer {
    font-size: 0.8rem;
    color: #444;
    text-align: center;
    margin-top: 10px;
}

.footer-sub {
    font-size: 0.75rem;
    color: #333;
}

/* Welcome Overlay */
.welcome-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #00ff41;
    width: 100%;
    pointer-events: none;
}

.welcome-ascii pre {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    line-height: 10px;
    white-space: pre;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.welcome-sub {
    margin-top: 20px;
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.9rem;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Gallery Select Button */
.gallery-item {
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 400px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s;
}

.gallery-canvas {
    flex: 1;
    /* Take up remaining space */
    width: 100%;
    min-height: 0;
    /* Fix flex overflow */
    display: block;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.5s;
}

.btn-select-model {
    /* Position relative (in flow) below canvas */
    position: relative;
    width: 100%;
    padding: 12px 0;
    font-size: 1rem;
    font-family: var(--font-heading);
    background: #111;
    color: var(--accent);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    z-index: 10;

    /* Hidden by default, revealed on hover */
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
    margin-top: -45px;
    /* Pull it up so it overlays or slides? No, we want it to APPEAR. 
                          If flex, hiding it leaves gap. 
                          Let's try: keeping it in flow but 0 height? No.
                          Let's use the transform/opacity trick but keep it in flow?
                          Actually, user said "under the box".
                          If I want it to "appear", maybe I should use absolute positioning at the bottom again, 
                          but OUTSIDE the canvas?
                          
                          Let's go back to: 
                          Button is flow content.
                          Default: opacity 0.
                          Hover: opacity 1.
                          
                          AND Caption:
                          Default: opacity 0.
                          Hover: opacity 1.
                       */
    margin-top: 0;
    /* Reset */
    transform: none;
    /* Reset */
}

.gallery-item:hover .btn-select-model {
    opacity: 1;
    pointer-events: auto;
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 30px var(--accent-glow);
}

.gallery-caption {
    /* Flow element - sits between canvas and button */
    order: 1;
    /* After canvas (0), before button (2) */
    width: 100%;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-select-model {
    order: 2;
    /* After caption */
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

/* Ensure container takes full size */
.studio-container {
    max-width: 100% !important;
    /* Override default container width */
    min-height: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Header tweaks */
.studio-header {
    flex-shrink: 0;
}

/* Main content layout */
.studio-container .main {
    display: flex;
    flex: 1;
    overflow: visible;
    /* Allow content to flow */
    height: auto;
    /* Let it grow */
    min-height: 500px;
    /* Minimum useful height for the app */
    flex-direction: row;
    /* Horizontal layout */
}

/* Preview Section - Takes available space */
.preview-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    /* Keep preview contained */
    background: #000;
    min-height: 500px;
    /* Ensure visibility */
}

.preview-container {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    box-shadow: none;
    border: none;
}

/* Controls Panel - Fixed width on the right */
.controls-panel {
    width: 340px;
    flex-shrink: 0;
    background: #0a0a0a;
    border-left: 1px solid rgba(0, 255, 65, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 50;
    height: auto;
    /* Match container height */
    min-height: 800px;
    max-height: 100vh;
    /* Optional: stick to viewport if we want sticky */
    overflow-y: auto;
    position: sticky;
    /* Stick to top while scrolling past studio */
    top: 0;
}

/* Hero tweaks to prevent overlap */
.hero {
    min-height: 60vh;
    margin-bottom: 0;
    /* Align perfectly with next section */
    position: relative;
    z-index: 10;
}

/* Adjust Features/Pricing sections to follow normally */
.section {
    background: #050505;
    position: relative;
    z-index: 10;
}

/* Footer fixes */
footer {
    position: relative;
    z-index: 10;
    background: #050505;
}

/* Body Scroll fix */
.studio-mode {
    height: auto;
    /* Allow body to grow */
    overflow-x: hidden;
    overflow-y: auto;
    /* Enable vertical scrolling */
}

/* Gallery Grid & Supporting Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.gallery-item:hover {
    border-color: var(--accent);
}

.gallery-canvas.loaded {
    opacity: 1;
}

.gallery-canvas:active {
    cursor: grabbing;
}

.loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    pointer-events: none;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-top: -40px;
    margin-bottom: 60px;
}

/* ═══════════════════════════════════════
   GALLERY SHOWCASE + COMPARISON
   ═══════════════════════════════════════ */
.gallery-section {
    padding: 80px 0 60px;
    background: var(--bg);
}

/* Community Gallery Grid */
.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
}

.community-gallery-card {
    position: relative;
    border-radius: 12px;
    overflow: visible;
    border: 1px solid rgba(0, 255, 65, 0.1);
    background: #0a0a0a;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    flex: 0 0 calc(33.333% - 11px);
}

.community-gallery-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 24px rgba(0, 255, 65, 0.15);
    transform: translateY(-3px);
}

.community-gallery-card img {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    border-radius: 12px;
}

.community-gallery-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    font-family: var(--font-heading);
    font-size: 0.7rem;
    color: rgba(0, 255, 65, 0.6);
    text-align: right;
}

/* Try Your Own Divider */
.tryit-divider {
    text-align: center;
    margin: 50px 0 30px;
    position: relative;
}

.tryit-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 255, 65, 0.15);
}

.tryit-divider span {
    position: relative;
    background: var(--bg);
    padding: 0 24px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Upload Zone */
.tryit-upload {
    border: 2px dashed rgba(0, 255, 65, 0.3);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    background: rgba(0, 255, 65, 0.02);
    max-width: 700px;
    margin: 0 auto;
}

.tryit-upload:hover,
.tryit-upload.drag-over {
    border-color: var(--accent);
    background: rgba(0, 255, 65, 0.06);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.15);
}

.tryit-upload-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    filter: grayscale(0.5);
}

.tryit-upload-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 8px;
}

.tryit-upload-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Comparison Viewer */
.tryit-compare {
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 1000px;
    margin: 30px auto 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 65, 0.15);
    background: #0a0a0a;
    position: relative;
    min-height: 400px;
}

.tryit-pane {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

.tryit-pane canvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.tryit-label {
    position: absolute;
    top: 12px;
    z-index: 5;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 12px;
    border-radius: 4px;
    pointer-events: none;
}

.tryit-pane-original .tryit-label {
    left: 12px;
}

.tryit-pane-ascii .tryit-label {
    right: 12px;
}

/* Slider Divider */
.tryit-slider {
    width: 4px;
    background: var(--accent);
    cursor: col-resize;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.4);
}

.tryit-slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid #000;
    box-shadow: 0 0 16px rgba(0, 255, 65, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tryit-slider-handle::before {
    content: '⟨⟩';
    font-size: 12px;
    color: #000;
    font-weight: bold;
}

/* Controls */
.tryit-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    max-width: 1000px;
    margin: 20px auto 0;
    padding: 16px 24px;
    background: rgba(0, 255, 65, 0.03);
    border: 1px solid rgba(0, 255, 65, 0.1);
    border-radius: 10px;
}

.tryit-controls label {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tryit-controls select {
    background: #111;
    color: var(--accent);
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 6px;
    padding: 6px 12px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    cursor: pointer;
}

.tryit-controls input[type="range"] {
    width: 140px;
    accent-color: var(--accent);
}

@media (max-width: 768px) {
    .tryit-compare {
        flex-direction: column;
        min-height: 300px;
    }

    .tryit-slider {
        width: 100%;
        height: 4px;
        cursor: row-resize;
    }

    .tryit-controls {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* ═══════════════════════════════════════
   EXPORT DROPDOWN
   ═══════════════════════════════════════ */
.export-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.btn-export {
    width: 100%;
    cursor: pointer;
}

.export-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    background: #111;
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 8px;
    overflow-y: auto;
    max-height: 360px;
    z-index: 100;
    margin-bottom: 4px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
}

.export-dropdown.open .export-menu {
    display: block;
}

.export-option {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #ccc;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.export-option:hover {
    background: rgba(0, 255, 65, 0.1);
    color: var(--accent);
}

.export-option .btn-icon {
    margin-right: 8px;
}

.export-option+.export-option {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.export-divider {
    border: none;
    border-top: 1px solid rgba(0, 255, 65, 0.15);
    margin: 2px 12px;
}

/* ===========================
   Features Section
   =========================== */
.features-section {
    background: #0a0a0a;
    padding: 80px 20px;
    border-top: 1px solid rgba(0, 255, 65, 0.1);
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
}

.features-header {
    text-align: center;
    margin-bottom: 60px;
}

.features-title {
    font-family: 'Space Mono', monospace;
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #00ff41, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 0.95rem;
    color: #888;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

.features-section-title {
    font-family: 'Space Mono', monospace;
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.feature-category {
    margin-bottom: 60px;
}

.feature-category-desc {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 20px;
}

/* How It Works */
.features-how {
    margin-bottom: 60px;
}

.how-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.how-step {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
}

.how-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 255, 65, 0.15);
    color: var(--accent);
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.how-step h4 {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 8px;
}

.how-step p {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.5;
}

/* Feature Grids */
.features-grid {
    display: grid;
    gap: 16px;
}

.features-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.features-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.features-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.features-grid.cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Feature Cards */
.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 24px 20px;
    transition: all 0.25s;
}

.feature-card:hover {
    border-color: rgba(0, 255, 65, 0.25);
    background: rgba(0, 255, 65, 0.03);
    transform: translateY(-2px);
}

.feature-card .feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
}

.feature-card h4 {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.5;
}

/* Compact Cards (themes) */
.feature-card.compact {
    padding: 16px 12px;
    text-align: center;
}

.feature-swatch {
    display: block;
    width: 100%;
    height: 40px;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* Mini Cards (post fx) */
.feature-card.mini {
    padding: 14px 12px;
    text-align: center;
}

.feature-icon-sm {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 6px;
}

.feature-card.mini strong {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #ccc;
    display: block;
    margin-bottom: 4px;
}

.feature-card.mini p {
    font-size: 0.65rem;
    color: #666;
    margin: 0;
}

/* Charset Previews */
.charset-preview {
    font-family: 'Space Mono', monospace;
    font-size: 1.4rem;
    color: var(--accent);
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

/* Tech Badges */
.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.tech-badge {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 65, 0.2);
    background: rgba(0, 255, 65, 0.05);
    color: var(--accent);
}

/* Site Footer */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #050505;
}

.site-footer p {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #555;
}

/* Day Mode - Features */
body.day-mode .features-section {
    background: #f5f5f5;
    border-top-color: rgba(0, 0, 0, 0.08);
}

body.day-mode .features-title {
    background: linear-gradient(135deg, #007722, #0088cc);
    -webkit-background-clip: text;
    background-clip: text;
}

body.day-mode .features-subtitle,
body.day-mode .how-step p,
body.day-mode .feature-card p,
body.day-mode .feature-category-desc {
    color: #666;
}

body.day-mode .how-step,
body.day-mode .feature-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

body.day-mode .feature-card:hover {
    background: rgba(0, 255, 65, 0.04);
    border-color: rgba(0, 180, 65, 0.3);
}

body.day-mode .feature-card h4,
body.day-mode .how-step h4 {
    color: #222;
}

body.day-mode .feature-card.mini strong {
    color: #333;
}

body.day-mode .site-footer {
    background: #eee;
    border-top-color: rgba(0, 0, 0, 0.06);
}

body.day-mode .site-footer p {
    color: #888;
}

/* Responsive Features */
@media (max-width: 768px) {
    .how-steps {
        grid-template-columns: 1fr;
    }

    .features-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid.cols-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .features-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-title {
        font-size: 1.6rem;
    }

    .terminal-flow {
        flex-direction: column;
    }

    .terminal-arrow {
        transform: rotate(90deg);
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
}

/* ===========================
   Terminal Workflow Section
   =========================== */
.terminal-section {
    background: #060d06;
    padding: 80px 20px;
    border-top: 1px solid rgba(0, 255, 65, 0.08);
}

.terminal-callout {
    max-width: 900px;
    margin: 0 auto;
}

.terminal-header {
    text-align: center;
    margin-bottom: 40px;
}

.terminal-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.terminal-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(0, 255, 65, 0.04);
    border: 1px solid rgba(0, 255, 65, 0.12);
    border-radius: 10px;
    padding: 16px 18px;
    flex: 1;
}

.terminal-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 255, 65, 0.2);
    color: var(--accent);
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
}

.terminal-step-content h4 {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #fff;
    margin-bottom: 4px;
}

.terminal-step-content p {
    font-size: 0.7rem;
    color: #888;
    line-height: 1.4;
}

.terminal-arrow {
    font-size: 1.5rem;
    color: var(--accent);
    opacity: 0.5;
    flex-shrink: 0;
}

/* Fake Terminal Window */
.terminal-code-block {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.terminal-title-bar {
    background: #2a2a2a;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot.red {
    background: #ff5f56;
}

.terminal-dot.yellow {
    background: #ffbd2e;
}

.terminal-dot.green {
    background: #27c93f;
}

.terminal-title-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #999;
    margin-left: 8px;
}

.terminal-code {
    background: #0d0d0d;
    padding: 20px 24px;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.8;
    color: #e0e0e0;
    margin: 0;
    overflow-x: auto;
}

.term-comment {
    color: #555;
}

.term-prompt {
    color: var(--accent);
    font-weight: 700;
}

.terminal-note {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #666;
    line-height: 1.7;
    text-align: center;
}

.terminal-note strong {
    color: var(--accent);
}

/* ===========================
   Pricing Section
   =========================== */
.pricing-section {
    background: #0a0a0a;
    padding: 80px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pricing-title {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #00ff41, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-bottom: 48px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 36px 28px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.pricing-card.featured {
    border-color: rgba(0, 255, 65, 0.35);
    background: rgba(0, 255, 65, 0.04);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.08);
}

.pricing-card.featured:hover {
    border-color: rgba(0, 255, 65, 0.5);
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.12);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #00ff41, #00cc66);
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pricing-tier {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 16px;
}

.pricing-price {
    margin-bottom: 24px;
}

.price-amount {
    font-family: 'Space Mono', monospace;
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
}

.price-period {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: #666;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px 0;
    text-align: left;
}

.pricing-features li {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pricing-features li.included {
    color: #ccc;
}

.pricing-features li.excluded {
    color: #555;
}

.pricing-btn {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    padding: 12px 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    width: 100%;
    border: none;
}

.pricing-btn-free {
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.pricing-btn-free:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.pricing-btn-pro {
    background: linear-gradient(135deg, #00ff41, #00cc66);
    color: #000;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(0, 255, 65, 0.2);
}

.pricing-btn-pro:hover {
    box-shadow: 0 6px 28px rgba(0, 255, 65, 0.35);
    transform: translateY(-1px);
}

/* Day Mode - Terminal & Pricing */
body.day-mode .terminal-section {
    background: #f0f5f0;
    border-top-color: rgba(0, 0, 0, 0.06);
}

body.day-mode .terminal-step {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

body.day-mode .terminal-step-content h4 {
    color: #222;
}

body.day-mode .terminal-code-block {
    border-color: rgba(0, 0, 0, 0.1);
}

body.day-mode .terminal-title-bar {
    background: #e0e0e0;
}

body.day-mode .terminal-code {
    background: #1a1a1a;
}

body.day-mode .pricing-section {
    background: #f5f5f5;
    border-top-color: rgba(0, 0, 0, 0.06);
}

body.day-mode .pricing-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.day-mode .pricing-card.featured {
    border-color: rgba(0, 180, 65, 0.4);
    background: rgba(0, 255, 65, 0.02);
}

body.day-mode .pricing-tier {
    color: #222;
}

body.day-mode .price-amount {
    color: #111;
}

body.day-mode .pricing-features li.included {
    color: #333;
}

body.day-mode .pricing-btn-free {
    background: #f0f0f0;
    color: #333;
    border-color: rgba(0, 0, 0, 0.1);
}

/* ═══════════════════════════════════════ */
/* RED RECORD BUTTON THEME (User Request) */
/* ═══════════════════════════════════════ */
.btn-record {
    background: transparent !important;
    border: 2px solid #ff4444 !important;
    color: #ff4444 !important;
    transition: all 0.2s ease;
}

.btn-record:hover {
    background: rgba(255, 68, 68, 0.1) !important;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.btn-record .rec-ring {
    opacity: 1 !important;
    /* Make ring solid/visible */
    stroke: currentColor !important;
}

.btn-record .rec-dot-svg {
    /* Ensure dot is hidden by default if JS doesn't do it */
    /* JS logic handles display:none for dot in Idle, so this is fine. */
}

/* Active Recording State */
.btn-record.recording {
    background: #ff4444 !important;
    color: #fff !important;
    /* White icon on red bg */
    border-color: #ff4444 !important;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
    animation: pulse-red 2s infinite;
}

.btn-record.recording:hover {
    background: #ff2222 !important;
    transform: scale(1.05);
}

.btn-record.recording .rec-stop-svg {
    fill: currentColor !important;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* ═══════════════════════════════════════ */
/* DROP OVERLAY (Drag-and-drop upload)    */
/* ═══════════════════════════════════════ */
.drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 65, 0.08);
    border: 3px dashed var(--accent);
    border-radius: 8px;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.drop-overlay-content {
    font-family: 'Space Mono', monospace;
    font-size: 1.6rem;
    color: var(--accent);
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    animation: drop-pulse 1.5s ease-in-out infinite;
}

@keyframes drop-pulse {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Missing FX Button Styles */
.fx-select-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.fx-select-row .select {
    flex: 1;
    min-width: 0;
}

.btn-add-fx {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
    /* Ensure no text-align centers vertically */
    line-height: 1;
}

.btn-add-fx:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Mobile Collapse Toggle (hidden on desktop) ── */
.mobile-collapse-toggle {
    display: none;
}

.mobile-scroll-arrow {
    display: none;
}

.mobile-nav-record {
    display: none;
}

.mobile-source-select {
    display: none;
}

.mobile-upload-label {
    display: none;
}

.mobile-controls-row {
    display: none;
}

.mobile-export-btn {
    display: none;
}

/* ── Collapsible container (always visible on desktop) ── */
.controls-collapsible {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ═══════════════════════════════════
   MOBILE RESPONSIVE (≤ 768px)
   ═══════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Layout: break entire height chain ── */
    /* The body.studio-mode is display:flex which causes #studio-app to stretch */
    body.studio-mode {
        display: block !important;
        min-height: auto !important;
        height: auto !important;
        padding: 0 !important;
    }

    /* Kill .container padding on mobile */
    .container,
    .container.studio-container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100vw !important;
    }

    /* ── App preview container: no fixed height on mobile ── */
    .app-preview-container {
        height: auto !important;
        overflow: visible !important;
        max-width: 100vw !important;
        margin-top: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    #studio-app,
    .studio-section {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    .studio-container {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    /* Stack main vertically, no stretch */
    .studio-container .main,
    .main {
        flex-direction: column !important;
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        overflow-y: visible !important;
        overflow-x: hidden;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* ── Visualizer: fit to content, leave room for controls ── */
    .preview-section {
        flex: none !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: 75vh !important;
        display: flex;
        align-items: stretch;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .preview-container {
        width: 100% !important;
        height: auto !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .preview-container .ascii-canvas,
    .preview-container .postfx-canvas {
        width: 100% !important;
        height: auto !important;
        max-height: 75vh !important;
        object-fit: fill;
        padding: 0 !important;
        margin: 0 !important;
    }

    .welcome-overlay {
        padding: 10px;
    }

    .welcome-ascii pre {
        font-size: 0.35rem;
        line-height: 1.1;
    }

    /* ── Source buttons: hidden in navbar, shown as tab bar below visualizer ── */
    .nav-source-buttons {
        display: none !important;
    }

    .nav-source-label {
        display: none !important;
    }

    .nav-source-buttons.mobile-source-bar {
        display: flex !important;
        width: 100%;
        justify-content: center;
        gap: 4px;
        padding: 8px 12px;
        background: rgba(10, 10, 10, 0.95);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-source-bar .btn-nav-source {
        font-size: 0.7rem;
        padding: 6px 8px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* ── Navbar: hide FPS / dark mode ── */
    #fps-counter,
    #btn-theme-toggle,
    #btn-ascii-toggle {
        display: none !important;
    }

    .logo {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* ── Mobile source quick-select dropdown ── */
    .mobile-source-select {
        display: block;
        appearance: none;
        -webkit-appearance: none;
        background: #1a1a1a;
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 6px;
        padding: 6px 8px;
        font-family: var(--font-mono);
        font-size: 0.7rem;
        cursor: pointer;
        max-width: 130px;
    }

    .mobile-source-select:focus {
        outline: none;
        border-color: #00ff41;
    }

    .mobile-upload-label {
        display: inline-flex !important;
        align-items: center;
    }

    /* ── Community Gallery: compact thumbnails on mobile ── */
    .gallery-grid {
        gap: 8px !important;
    }

    .community-gallery-card {
        flex: 0 0 calc(50% - 4px) !important;
    }

    .community-gallery-card img {
        width: 100%;
        height: auto !important;
    }

    .community-gallery-meta {
        font-size: 0.55rem;
        padding: 4px 8px;
    }

    /* ── Hide old source button bar on mobile ── */
    .nav-source-buttons.mobile-source-bar {
        display: none !important;
    }

    /* ── Mobile Export/Screenshot Button in navbar ── */
    .mobile-nav-record {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 4px 10px;
        background: rgba(0, 255, 65, 0.1);
        border: 1.5px solid rgba(0, 255, 65, 0.5);
        border-radius: 16px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .mobile-nav-record:active {
        background: rgba(0, 255, 65, 0.25);
        transform: scale(0.95);
    }

    .mobile-rec-dot {
        font-size: 0.75rem;
        line-height: 1;
        display: block;
    }

    .mobile-rec-label {
        font-family: var(--font-mono);
        font-size: 0.65rem;
        font-weight: 700;
        color: #0f0;
        letter-spacing: 0.05em;
    }

    /* ── Controls panel: tight to content ── */
    .controls-panel {
        width: 100% !important;
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        position: static !important;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px 16px;
        gap: 10px;
        overflow-y: visible !important;
    }

    /* ── Hide full actions (record is in navbar) ── */
    .actions-group {
        display: none !important;
    }

    /* ── Hide render engine toggle on mobile (always GPU) ── */
    #render-engine-group {
        display: none !important;
    }

    /* ── Hide navbar Export on mobile (now below visualizer) ── */
    .mobile-nav-record {
        display: none !important;
    }

    /* ── Mobile controls row: Presets + Export side by side ── */
    .mobile-controls-row {
        display: flex !important;
        gap: 8px;
        width: 100%;
    }

    /* ── Collapse toggle (shrunk) ── */
    .mobile-collapse-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        color: #ccc;
        font-family: 'Space Mono', monospace;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    /* ── Mobile Export button ── */
    .mobile-export-btn {
        display: flex !important;
        align-items: center;
        gap: 4px;
        padding: 12px 16px;
        background: rgba(0, 255, 65, 0.08);
        border: 1px solid rgba(0, 255, 65, 0.3);
        border-radius: 6px;
        color: #0f0;
        font-family: 'Space Mono', monospace;
        font-size: 0.85rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s;
        white-space: nowrap;
    }

    .mobile-export-btn:active {
        background: rgba(0, 255, 65, 0.2);
        transform: scale(0.95);
    }

    .mobile-collapse-toggle:hover,
    .mobile-collapse-toggle:active {
        background: rgba(0, 255, 65, 0.08);
        border-color: rgba(0, 255, 65, 0.3);
        color: #0f0;
    }

    .collapse-arrow {
        font-size: 0.9rem;
        transition: transform 0.2s;
        display: inline-block;
    }

    .collapse-arrow.expanded {
        transform: rotate(90deg);
    }

    .controls-collapsible.collapsed {
        display: none;
    }

    .controls-collapsible {
        gap: 14px;
    }

    .control-group {
        gap: 6px;
    }

    /* ── Scroll Arrow ── */
    .mobile-scroll-arrow {
        display: flex !important;
        position: absolute;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 20;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        color: rgba(255, 255, 255, 0.7);
        font-size: 1rem;
        cursor: pointer;
        backdrop-filter: blur(4px);
        animation: bounce-arrow 2s ease-in-out infinite;
    }

    .mobile-scroll-arrow:active {
        background: rgba(0, 255, 65, 0.15);
        border-color: rgba(0, 255, 65, 0.4);
        color: #0f0;
    }

    .mobile-scroll-arrow.scrolled-down .scroll-arrow-icon {
        transform: rotate(180deg);
    }

    .scroll-arrow-icon {
        display: inline-block;
        transition: transform 0.3s;
    }

    @keyframes bounce-arrow {

        0%,
        100% {
            transform: translateX(-50%) translateY(0);
        }

        50% {
            transform: translateX(-50%) translateY(6px);
        }
    }

    /* ── Compact controls ── */
    .theme-grid {
        gap: 4px;
    }

    .btn-theme {
        font-size: 0.7rem;
        padding: 4px 6px;
    }

    .slider {
        width: 100%;
    }

    .controls-footer {
        padding: 8px 0;
        font-size: 0.7rem;
    }
}