/* ============================================================================
   IBM PC/XT & x86 Web Emulator Suite Styling
   ============================================================================ */

:root {
    --bg-dark: #0a0e14;
    --bg-panel: #131920;
    --bg-panel-header: #1b232c;
    --border-color: #273444;
    --border-focus: #00ff9d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #536374;
    --accent-cyan: #00e5ff;
    --accent-green: #00ff9d;
    --accent-amber: #ffb86c;
    --accent-red: #ff5555;
    --font-mono: 'Fira Code', 'Cascadia Code', 'Source Code Pro', 'Consolas', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* App Header */
.app-header {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

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

.brand-badge {
    background: linear-gradient(135deg, #0077b6, #00b4d8);
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    letter-spacing: 1px;
}

.app-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #ffffff, #90e0ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Main Layout */
.main-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* IBM PC Case & Monitor Frame */
.pc-desktop-case {
    background: #141b24;
    border: 2px solid #28374a;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* CRT Screen Frame */
.crt-monitor-frame {
    background: #0d1218;
    border: 14px solid #1c2633;
    border-radius: 16px;
    padding: 10px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 8px 24px rgba(0, 0, 0, 0.6);
    position: relative;
    max-width: 100%;
    width: 664px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.cga-canvas {
    display: block;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 4 / 3;
    height: auto;
    background: #000;
    border-radius: 4px;
    image-rendering: pixelated;
    outline: none;
    cursor: text;
    touch-action: none;
}

.cga-canvas:focus {
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.45);
}

.cga-canvas.cga-power-off {
    filter: brightness(0);
    box-shadow: none !important;
    cursor: default;
}

.crt-scanlines {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    border-radius: 4px;
}

.crt-scanlines.scanlines-off {
    display: none !important;
}

/* Invisible input trap for mobile keyboards */
.mobile-input-trap {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    top: 0;
    left: 0;
    border: none;
    outline: none;
    padding: 0;
    margin: 0;
    z-index: -1;
}

/* Monitor Badging & Mode Switchers */
.monitor-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 664px;
    font-family: var(--font-mono);
    font-size: 12px;
    margin-bottom: -6px;
}

.monitor-brand-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.ibm-badge {
    color: #38bdf8;
    font-weight: 800;
    letter-spacing: 1px;
    white-space: nowrap;
    flex-shrink: 0;
}

.monitor-status-slot {
    display: inline-flex;
    align-items: center;
    width: 180px;
    flex-shrink: 0;
}

.monitor-hint-badge {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    background: rgba(27, 38, 53, 0.7);
    border: 1px solid #28374a;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.monitor-hint-badge:hover {
    color: #38bdf8;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}

.mouse-badge {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid #38bdf8;
    color: #38bdf8;
    font-weight: bold;
    font-family: var(--font-mono);
    user-select: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.filter-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-filter {
    background: #182230;
    border: 1px solid #2b3b50;
    color: #94a3b8;
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-filter.active {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
}

/* Storage & Drives Bay */
.storage-bay {
    width: 100%;
    max-width: 800px;
    background: #0e151e;
    border: 1px solid #222f40;
    border-radius: 8px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.drives-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.drive-divider {
    width: 1px;
    height: 20px;
    background: #2a3b50;
    margin: 0 4px;
}

.drive-unit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.drive-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
}

.btn-boot {
    background: rgba(0, 255, 157, 0.12);
    border-color: rgba(0, 255, 157, 0.4);
    color: var(--accent-green);
    font-size: 11px;
    padding: 2px 7px;
    font-weight: 600;
}

.btn-boot:hover {
    background: rgba(0, 255, 157, 0.25);
    border-color: var(--accent-green);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}

.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transition: all 0.15s;
}

.led-off {
    background: #2b394a;
}

.led-active-red {
    background: #ff3333;
    box-shadow: 0 0 10px #ff3333;
}

.led-active-amber {
    background: #ffb86c;
    box-shadow: 0 0 10px #ffb86c;
}

.led-active-green {
    background: #00ff9d;
    box-shadow: 0 0 10px #00ff9d;
}

/* Control Buttons & Sliders */
.btn-retro {
    background: #1b2636;
    color: #e2e8f0;
    border: 1px solid #2e415b;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.btn-retro:hover {
    background: #283952;
    border-color: #38bdf8;
    color: #38bdf8;
}

.btn-run {
    background: rgba(0, 255, 157, 0.15);
    color: #00ff9d;
    border-color: #00ff9d;
}

.btn-danger {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
    border-color: #ff5555;
}

.status-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(0, 255, 157, 0.15);
    color: #00ff9d;
    border: 1px solid #00ff9d;
}

.interactive-pill {
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    outline: none;
}

.interactive-pill:hover {
    background: rgba(0, 255, 157, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.45);
}

.interactive-pill:active {
    transform: translateY(0);
}

/* --- Turbo Panel & Retro 7-Segment LED Display --- */
.turbo-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 8px;
}

.seven-segment-display {
    background: #06090e;
    border: 2px solid #1a2535;
    border-radius: 4px;
    padding: 3px 10px;
    display: flex;
    align-items: baseline;
    gap: 5px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(255, 255, 255, 0.05);
}

.segment-text {
    font-family: 'Courier New', 'VT323', monospace;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #ff3344;
    text-shadow: 0 0 6px #ff2233, 0 0 12px rgba(255, 34, 51, 0.6);
    min-width: 32px;
    text-align: center;
    transition: all 0.2s ease;
}

.seven-segment-display.turbo-active .segment-text {
    color: #00ffaa;
    text-shadow: 0 0 6px #00ffaa, 0 0 14px rgba(0, 255, 170, 0.7);
}

.seven-segment-display.warp-active .segment-text {
    color: #ffb833;
    text-shadow: 0 0 6px #ffb833, 0 0 14px rgba(255, 184, 51, 0.7);
}

.segment-unit {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.turbo-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-turbo {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 6px 12px;
}

.btn-turbo.active {
    background: rgba(0, 255, 170, 0.12);
    border-color: #00ffaa;
    color: #00ffaa;
    box-shadow: 0 0 8px rgba(0, 255, 170, 0.3);
}

.btn-warp {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 6px 10px;
    color: #94a3b8;
}

.btn-warp.active {
    background: rgba(255, 184, 51, 0.15);
    border-color: #ffb833;
    color: #ffb833;
    box-shadow: 0 0 8px rgba(255, 184, 51, 0.35);
}

/* Drop Zone */
.drop-zone {
    width: 100%;
    max-width: 800px;
    border: 2px dashed #2b3b50;
    background: rgba(15, 23, 35, 0.6);
    border-radius: 8px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease-in-out;
}

.drop-zone.drag-over {
    border-color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.12);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
}

.drop-zone-text {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.drop-icon {
    font-size: 26px;
    flex-shrink: 0;
}

.drop-prompt strong {
    display: block;
    font-size: 13px;
    color: var(--text-primary);
}

.drop-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.drop-zone-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.btn-drop-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 11px;
    padding: 6px 12px;
    white-space: nowrap;
}

.btn-drop-action input[type="file"] {
    display: none;
}

/* Collapsible 8086 Assembler & Debugger Lab Accordion */
.dev-lab-accordion {
    background: #141b24;
    border: 1px solid #28374a;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dev-lab-accordion:hover {
    border-color: #364b63;
}

.dev-lab-accordion[open] {
    border-color: #38bdf8;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.dev-lab-summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.55) 0%, rgba(15, 23, 34, 0.55) 100%);
    transition: background-color 0.2s ease;
}

.dev-lab-summary::-webkit-details-marker {
    display: none;
}

.dev-lab-summary:hover {
    background: rgba(30, 41, 59, 0.75);
}

.dev-lab-summary-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dev-lab-icon {
    font-size: 18px;
    line-height: 1;
}

.dev-lab-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dev-lab-titles strong {
    font-size: 13px;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.dev-lab-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.dev-lab-summary-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dev-lab-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.dev-lab-chevron {
    font-size: 14px;
    color: #94a3b8;
    transition: transform 0.25s ease, color 0.2s ease;
    display: inline-block;
}

.dev-lab-accordion[open] .dev-lab-chevron {
    transform: rotate(180deg);
    color: #38bdf8;
}

.dev-lab-body {
    padding: 16px;
    border-top: 1px solid #223042;
    background: #0f151d;
}

/* Assembler & Debugger Grid */
.dev-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

@media (max-width: 900px) {
    .dev-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.panel-header {
    background: var(--bg-panel-header);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #38bdf8;
}

.editor-wrap {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.code-textarea {
    width: 100%;
    height: 280px;
    background: #090e15;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #a5f3fc;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 12px;
    resize: vertical;
    outline: none;
    line-height: 1.4;
}

.code-textarea:focus {
    border-color: var(--border-focus);
}

/* Registers View */
.reg-grid {
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.reg-box {
    background: #0b1118;
    border: 1px solid #1e2a3a;
    border-radius: 4px;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
}

.reg-name {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
}

.reg-val {
    font-size: 13px;
    color: var(--accent-amber);
    font-weight: 700;
}

/* ============================================================================
   Mobile & Touchscreen Companion Suite Styling
   ============================================================================ */

.mobile-companion-panel {
    width: 100%;
    max-width: 664px;
    background: #0f1620;
    border: 1px solid #223247;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
}

/* Tab Bar for Switching Companion Modes */
.mobile-mode-bar {
    display: flex;
    gap: 6px;
    justify-content: space-between;
    width: 100%;
    background: #090e15;
    padding: 4px;
    border-radius: 6px;
    border: 1px solid #1a2738;
}

.btn-touch-tab {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    padding: 7px 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    white-space: nowrap;
    touch-action: manipulation;
}

.btn-touch-tab:hover {
    color: #e2e8f0;
    background: rgba(56, 189, 248, 0.08);
}

.btn-touch-tab.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Quick Control Keys Ribbon */
.mobile-quick-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    width: 100%;
}

.btn-touch-key {
    background: #182333;
    color: #e2e8f0;
    border: 1px solid #2b3d54;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 8px 10px;
    cursor: pointer;
    transition: transform 0.08s, background 0.15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    min-width: 38px;
    text-align: center;
}

.btn-touch-key:active,
.btn-touch-key.active {
    background: #2b4566;
    border-color: #38bdf8;
    color: #38bdf8;
    transform: translateY(2px);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.btn-touch-primary {
    background: rgba(0, 255, 157, 0.15);
    border-color: #00ff9d;
    color: #00ff9d;
    font-weight: 800;
}

.btn-touch-primary:active {
    background: #00ff9d;
    color: #000000;
}

.btn-touch-danger {
    background: rgba(255, 85, 85, 0.15);
    border-color: #ff5555;
    color: #ff5555;
}

.btn-touch-ctrl {
    background: rgba(255, 184, 108, 0.15);
    border-color: #ffb86c;
    color: #ffb86c;
}

/* Touch Controller Dock - sits directly beneath CRT monitor frame */
.touch-controller-dock {
    width: 100%;
    max-width: 664px;
    margin: -6px auto 0 auto;
    z-index: 5;
    animation: drawerFadeIn 0.2s ease-out;
}

/* Touch Drawers */
.touch-drawer {
    width: 100%;
    background: #0f1620;
    border: 1px solid #223247;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    animation: drawerFadeIn 0.2s ease-out;
}

@keyframes drawerFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Virtual Gamepad & D-Pad --- */
.touch-gamepad-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 16px;
    padding: 6px 0;
}

.dpad-cross {
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
}

.dpad-row {
    display: flex;
    align-items: center;
}

.dpad-btn {
    width: 48px;
    height: 48px;
    background: #1c2635;
    border: 2px solid #334761;
    color: #94a3b8;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: background 0.1s, transform 0.08s;
}

.dpad-up {
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

.dpad-down {
    border-radius: 0 0 8px 8px;
    border-top: none;
}

.dpad-left {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.dpad-right {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.dpad-center {
    width: 48px;
    height: 48px;
    background: #141c26;
    border: none;
}

.dpad-btn:active,
.dpad-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.gamepad-actions {
    display: flex;
    gap: 18px;
    align-items: center;
}

.btn-action-round {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-mono);
    border: 2px solid;
    transition: transform 0.08s, box-shadow 0.15s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.btn-action-round span {
    font-size: 16px;
    font-weight: 900;
}

.btn-action-round small {
    font-size: 8px;
    font-weight: 700;
    opacity: 0.8;
}

.btn-action-a {
    background: rgba(0, 255, 157, 0.15);
    border-color: #00ff9d;
    color: #00ff9d;
}

.btn-action-a:active,
.btn-action-a.active {
    background: #00ff9d;
    color: #000;
    transform: scale(0.94);
    box-shadow: 0 0 16px rgba(0, 255, 157, 0.7);
}

.btn-action-b {
    background: rgba(255, 85, 85, 0.15);
    border-color: #ff5555;
    color: #ff5555;
}

.btn-action-b:active,
.btn-action-b.active {
    background: #ff5555;
    color: #fff;
    transform: scale(0.94);
    box-shadow: 0 0 16px rgba(255, 85, 85, 0.7);
}

/* --- Virtual Touchpad Surface --- */
.virtual-touchpad-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.touchpad-surface {
    width: 100%;
    height: 140px;
    background: radial-gradient(circle at center, #141c27, #0b1118);
    border: 2px dashed #24354a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    cursor: crosshair;
}

.touchpad-hint {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    pointer-events: none;
}

.touchpad-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-mouse-click {
    flex: 1;
    background: #182333;
    border: 1px solid #2b3d54;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.1s ease;
}

.btn-mouse-click:active,
.btn-mouse-click.active {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
    transform: translateY(2px);
}

/* Fullscreen CRT Monitor Mode */
:fullscreen .crt-monitor-frame,
:-webkit-full-screen .crt-monitor-frame {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: #000 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

:fullscreen .cga-canvas,
:-webkit-full-screen .cga-canvas {
    width: auto !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    aspect-ratio: 4 / 3 !important;
}

:fullscreen .crt-scanlines,
:-webkit-full-screen .crt-scanlines {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Responsive Scaling for Small Displays & Smartphones */
@media (max-width: 768px) {
    .main-container {
        padding: 10px;
        gap: 14px;
    }

    .pc-desktop-case {
        padding: 12px;
        border-radius: 8px;
        gap: 14px;
    }

    .crt-monitor-frame {
        border-width: 8px;
        padding: 6px;
        border-radius: 10px;
    }

    .crt-scanlines {
        top: 6px;
        left: 6px;
        right: 6px;
        bottom: 6px;
    }

    .app-header {
        padding: 8px 12px;
    }

    .app-title {
        font-size: 15px;
    }

    .brand-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .monitor-bar {
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
        align-items: center;
    }

    .storage-bay {
        padding: 10px 12px;
        justify-content: center;
    }

    .turbo-panel {
        margin-left: 0;
    }

    .drop-zone {
        flex-direction: column;
        text-align: center;
    }

    .drop-zone-text {
        flex-direction: column;
        text-align: center;
    }

    .touch-controller-dock {
        margin: -4px auto 0 auto;
    }
}

@media (max-width: 480px) {
    .crt-monitor-frame {
        border-width: 4px;
        padding: 3px;
        border-radius: 6px;
    }

    .crt-scanlines {
        top: 3px;
        left: 3px;
        right: 3px;
        bottom: 3px;
    }

    .touch-controller-dock {
        margin: -2px auto 0 auto;
    }

    .touch-controller-dock .touch-drawer {
        padding: 8px 10px;
        border-radius: 8px;
    }

    .mobile-mode-bar {
        flex-wrap: wrap;
    }

    .btn-touch-tab {
        flex: 1 1 40%;
    }

    .dpad-btn {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }

    .dpad-center {
        width: 42px;
        height: 42px;
    }

    .btn-action-round {
        width: 52px;
        height: 52px;
    }
}

/* ============================================================================
   HDD Persistence Panel & Auto-Save Badge
   ============================================================================ */
.hdd-persist-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.persist-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(39, 52, 68, 0.6);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    user-select: none;
}

.persist-badge.saved {
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent-green);
    border-color: rgba(0, 255, 157, 0.3);
}

.persist-badge.saving {
    background: rgba(255, 184, 108, 0.15);
    color: var(--accent-amber);
    border-color: rgba(255, 184, 108, 0.4);
    animation: persistPulse 1s infinite alternate;
}

@keyframes persistPulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

.btn-mini {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
}

/* Footer Link Buttons */
.btn-footer-link {
    background: none;
    border: none;
    color: #38bdf8;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.btn-footer-link:hover {
    color: #7dd3fc;
    background-color: rgba(56, 189, 248, 0.1);
    text-decoration: underline;
}

/* ============================================================================
   Modal Dialog Component (Impressum, Datenschutz, Reset Confirm)
   ============================================================================ */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 12, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 16px;
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.modal-window {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.1);
    border-radius: 10px;
    width: 100%;
    max-width: 760px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    background: var(--bg-panel-header);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal-tabs {
    display: flex;
    gap: 8px;
}

.modal-tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.modal-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.modal-tab-btn.active {
    color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.08);
    border-bottom-color: var(--accent-cyan);
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.modal-close-btn:hover {
    color: var(--accent-red);
    background: rgba(255, 85, 85, 0.1);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary);
    flex: 1 1 auto;
}

.modal-body h2 {
    font-size: 16px;
    margin: 16px 0 8px 0;
    color: var(--accent-cyan);
    border-bottom: 1px solid rgba(39, 52, 68, 0.6);
    padding-bottom: 4px;
}

.modal-body h2:first-child {
    margin-top: 0;
}

.modal-body h3 {
    font-size: 14px;
    margin: 14px 0 6px 0;
    color: var(--accent-green);
}

.modal-body p {
    margin-bottom: 10px;
}

.modal-body ul {
    margin: 8px 0 12px 20px;
}

.modal-body li {
    margin-bottom: 4px;
}

.modal-body .legal-box {
    background: rgba(10, 14, 20, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 14px;
    margin: 12px 0;
}

.modal-footer {
    background: var(--bg-panel-header);
    border-top: 1px solid var(--border-color);
    padding: 10px 18px;
    display: flex;
    justify-content: flex-end;
}

/* ============================================================================
   Changelog Modal Component
   ============================================================================ */
.changelog-toolbar {
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-panel);
    padding: 2px 0 10px 0;
    z-index: 2;
    border-bottom: 1px solid rgba(39, 52, 68, 0.4);
}

.changelog-search-input {
    flex: 1;
    background: rgba(10, 14, 20, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.changelog-search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.changelog-count {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.changelog-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    padding: 24px 0;
    font-size: 13px;
    justify-content: center;
}

.changelog-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: changelogSpin 0.8s linear infinite;
    display: inline-block;
}

@keyframes changelogSpin {
    to { transform: rotate(360deg); }
}

.changelog-release {
    background: rgba(14, 19, 27, 0.65);
    border: 1px solid rgba(39, 52, 68, 0.7);
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 16px;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.changelog-release:hover {
    border-color: rgba(0, 229, 255, 0.35);
}

.changelog-release-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(39, 52, 68, 0.5);
}

.changelog-version-badge {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.28);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.changelog-date {
    font-size: 12px;
    color: var(--text-muted);
}

.changelog-category {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-green);
    margin: 10px 0 6px 0;
}

.changelog-release ul {
    margin: 6px 0 10px 18px;
    padding: 0;
}

.changelog-release li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.changelog-release code {
    font-family: var(--font-mono);
    font-size: 11.5px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--accent-amber);
}

.changelog-release a {
    color: var(--accent-cyan);
    text-decoration: none;
}

.changelog-release a:hover {
    text-decoration: underline;
}

.btn-eject {
    background: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
    transition: all 0.15s ease;
}

.btn-eject:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #ef4444;
}

/* Retro Toast HUD Notification */
.retro-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(10, 16, 26, 0.95);
    border: 1px solid var(--accent-cyan);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 229, 255, 0.35);
    color: #e0f2fe;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99999;
    letter-spacing: 0.3px;
    max-width: 90vw;
    text-align: center;
}

.retro-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Live Keyboard & Game Telemetry HUD */
.diag-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #334155;
    color: #94a3b8;
    font-family: var(--font-mono);
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

.diag-status-pill.active-keys {
    border-color: #00ff9d;
    color: #00ff9d;
    background: rgba(0, 255, 157, 0.12);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.25);
}

.diag-status-pill.gpc-green {
    border-color: #38bdf8;
    color: #38bdf8;
}

.live-diag-hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    background: rgba(10, 15, 26, 0.94);
    border: 1px solid var(--accent-cyan);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 229, 255, 0.2);
    border-radius: 8px;
    padding: 14px 16px;
    color: #e2e8f0;
    font-family: var(--font-mono);
    z-index: 100;
    backdrop-filter: blur(6px);
    animation: diagFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes diagFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.diag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.diag-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--accent-cyan);
}

.diag-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.diag-close-btn:hover {
    color: #ff5555;
}

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

@media (max-width: 600px) {
    .diag-grid {
        grid-template-columns: 1fr;
    }
}

.diag-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 10px;
}

.diag-card-title {
    font-size: 10px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.diag-card-val {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 4px;
    min-height: 20px;
}

.diag-card-sub {
    font-size: 11px;
    color: #94a3b8;
}

.diag-badge-focus {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.diag-badge-focus.focus-ok {
    background: rgba(0, 255, 157, 0.15);
    color: #00ff9d;
    border: 1px solid rgba(0, 255, 157, 0.4);
}

.diag-badge-focus.focus-lost {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: pulse 1s infinite alternate;
}

.diag-footer {
    font-size: 11px;
    color: #94a3b8;
    background: rgba(56, 189, 248, 0.08);
    border-left: 3px solid var(--accent-cyan);
    padding: 6px 10px;
    border-radius: 0 4px 4px 0;
    line-height: 1.4;
}

/* ============================================================================
   Retro Hardware & Acoustic Control Panel (IBM 5160 Expansion)
   ============================================================================ */

.retro-hardware-panel {
    width: 100%;
    max-width: 800px;
    background: #111722;
    border: 1px solid #243447;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px rgba(0, 0, 0, 0.45);
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hardware-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e2c3d;
    padding-bottom: 10px;
}

.hardware-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.hardware-icon {
    font-size: 16px;
}

.hardware-panel-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    background: rgba(100, 116, 139, 0.15);
    border: 1px solid rgba(100, 116, 139, 0.3);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.hardware-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    grid-gap: 14px;
}

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

.hardware-card {
    background: #0d131b;
    border: 1px solid #1d2a3a;
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hardware-card.pacing-card {
    grid-column: 1 / -1;
    padding: 8px 12px;
    gap: 6px;
}

.hardware-card.expansion-card {
    grid-column: 1 / -1;
}

.card-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #64748b;
    text-transform: uppercase;
}

/* 1. IBM Big Red Switch (3D Mechanical Rocker & Animated Slot Travel) */
.switch-card {
    align-items: center;
    text-align: center;
    justify-content: space-between;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.switch-card.power-off-state {
    background: #080b10;
    border-color: #2b1619;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.8);
}

.switch-housing {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 0;
}

.switch-plate {
    background: linear-gradient(180deg, #232d3b 0%, #131922 100%);
    border: 2px solid #384a5f;
    border-radius: 7px;
    padding: 8px 14px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7), 0 4px 10px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.switch-plate.off {
    border-color: #4a2328;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85), 0 4px 10px rgba(0, 0, 0, 0.65);
}

.switch-plate::before,
.switch-plate::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: #64748b;
    border-radius: 50%;
    box-shadow: inset 0 1px 1px #000;
}
.switch-plate::before { top: 4px; left: 5px; }
.switch-plate::after { bottom: 4px; right: 5px; }

.switch-indicator {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    transition: color 0.25s ease, text-shadow 0.25s ease, opacity 0.25s ease;
}

.switch-plate.on .switch-indicator.on {
    color: #00ff9d;
    text-shadow: 0 0 8px rgba(0, 255, 157, 0.65);
    opacity: 1;
}

.switch-plate.on .switch-indicator.off {
    color: #475569;
    text-shadow: none;
    opacity: 0.55;
}

.switch-plate.off .switch-indicator.on {
    color: #475569;
    text-shadow: none;
    opacity: 0.45;
}

.switch-plate.off .switch-indicator.off {
    color: #ff5555;
    text-shadow: 0 0 8px rgba(255, 85, 85, 0.75);
    opacity: 1;
}

/* Recessed Mechanical Switch Well / Cavity */
.big-red-switch {
    width: 54px;
    height: 78px;
    background: #06080c;
    border: 2px solid #0f151e;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    padding: 3px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 320px;
    box-shadow:
        inset 0 6px 10px rgba(0, 0, 0, 0.95),
        inset 0 -6px 10px rgba(0, 0, 0, 0.95),
        0 1px 0 rgba(255, 255, 255, 0.08);
    transition: box-shadow 0.28s ease, border-color 0.28s ease;
}

.big-red-switch.on {
    border-color: rgba(239, 83, 80, 0.45);
    box-shadow:
        inset 0 6px 10px rgba(0, 0, 0, 0.95),
        inset 0 -8px 12px rgba(0, 0, 0, 0.95),
        0 0 16px rgba(229, 57, 53, 0.28);
}

.big-red-switch:not(.on) {
    border-color: #1e293b;
    box-shadow:
        inset 0 10px 14px rgba(0, 0, 0, 0.98),
        inset 0 -4px 8px rgba(0, 0, 0, 0.95),
        0 1px 0 rgba(255, 255, 255, 0.05);
}

.switch-well-shadow {
    position: absolute;
    inset: 2px;
    border-radius: 4px;
    pointer-events: none;
    background: repeating-linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02) 0px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(0, 0, 0, 0.4) 2px,
        rgba(0, 0, 0, 0.4) 4px
    );
}

/* 3D Rocker Lever that slides & tilts between ON (top) and OFF (bottom) */
.switch-paddle {
    width: 44px;
    height: 52px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;
    transition:
        transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.28s ease,
        filter 0.25s ease;
}

/* ON State: Lever snapped UP to top of well, bright IBM red-orange with bottom bevel */
.big-red-switch.on .switch-paddle {
    transform: translateY(-9px) rotateX(18deg);
    background: linear-gradient(180deg, #ff5252 0%, #e53935 45%, #b71c1c 85%, #7f0000 100%);
    border: 1px solid #ff8a80;
    box-shadow:
        inset 0 2px 2px rgba(255, 255, 255, 0.55),
        inset 0 -4px 5px rgba(0, 0, 0, 0.65),
        0 9px 0 #5f0909,
        0 12px 14px rgba(0, 0, 0, 0.85);
}

/* OFF State: Lever snapped DOWN to bottom of well, dark unlit burgundy with top bevel */
.big-red-switch:not(.on) .switch-paddle {
    transform: translateY(9px) rotateX(-18deg);
    background: linear-gradient(180deg, #4a1212 0%, #6e1a1a 52%, #8b2020 88%, #5a1212 100%);
    border: 1px solid #7f1d1d;
    box-shadow:
        inset 0 4px 6px rgba(0, 0, 0, 0.75),
        inset 0 -2px 2px rgba(255, 180, 180, 0.22),
        0 -8px 0 #2d0707,
        0 -10px 12px rgba(0, 0, 0, 0.85);
    filter: saturate(0.75) brightness(0.85);
}

.big-red-switch:hover .switch-paddle {
    filter: brightness(1.06);
}

.big-red-switch:active .switch-paddle {
    transform: translateY(0px) rotateX(0deg) scale(0.96);
    transition-duration: 0.06s;
}

.paddle-mark {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    user-select: none;
    transition: color 0.25s ease, text-shadow 0.25s ease, opacity 0.25s ease;
}

.big-red-switch.on .paddle-mark-on {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    opacity: 0.95;
}

.big-red-switch.on .paddle-mark-off {
    color: rgba(0, 0, 0, 0.45);
    opacity: 0.5;
}

.big-red-switch:not(.on) .paddle-mark-on {
    color: rgba(0, 0, 0, 0.5);
    opacity: 0.45;
}

.big-red-switch:not(.on) .paddle-mark-off {
    color: #fecaca;
    text-shadow: 0 0 6px rgba(255, 85, 85, 0.6);
    opacity: 0.95;
}

.switch-ridges {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
}

.switch-ridge {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 1px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

.switch-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
    transition: color 0.25s ease;
}

.switch-card.power-off-state .switch-status {
    color: #f87171;
}

.power-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
    transition: all 0.25s ease;
}

.power-dot.active {
    background: #00ff9d;
    box-shadow: 0 0 8px #00ff9d;
}

/* 2. Audio Card */
.audio-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.audio-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.audio-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-icon {
    font-size: 18px;
}

.audio-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.audio-sub {
    font-size: 10px;
    color: var(--text-muted);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.retro-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #253342;
    border-radius: 2px;
    outline: none;
}

.retro-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #00e5ff;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
}

.btn-toggle-active {
    background: rgba(0, 255, 157, 0.15) !important;
    border-color: #00ff9d !important;
    color: #00ff9d !important;
    font-size: 10px !important;
    padding: 3px 8px !important;
    font-weight: 700;
}

.btn-toggle-muted {
    background: rgba(100, 116, 139, 0.15) !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
    font-size: 10px !important;
    padding: 3px 8px !important;
}

/* 3. Pacing Card */
.pacing-segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pacing-btn {
    background: #141c26;
    border: 1px solid #28374a;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.pacing-btn:hover {
    border-color: #3b506b;
    background: #182330;
}

.pacing-btn.active {
    border-color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.08);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.pacing-btn .pacing-icon {
    font-size: 14px;
    line-height: 1;
}

.pacing-btn .pacing-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.pacing-btn.active .pacing-text {
    color: var(--accent-cyan);
}

/* 4. Expansion Card */
.expansion-card .slot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 11px;
    flex-wrap: wrap;
}

.slot-item:last-of-type {
    border-bottom: none;
}

.slot-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.slot-badge.slot-active {
    background: rgba(0, 255, 157, 0.12);
    border: 1px solid rgba(0, 255, 157, 0.35);
    color: #00ff9d;
}

.slot-name {
    color: var(--text-primary);
    flex-grow: 1;
}

.slot-options {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

/* Slot 1 Video Adapter Buttons */
.slot-adapter-buttons {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.btn-slot-adapter {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.btn-slot-adapter:hover:not(:disabled) {
    background: #334155;
    color: #f8fafc;
    border-color: rgba(0, 229, 255, 0.4);
}

.btn-slot-adapter.active {
    background: rgba(0, 229, 255, 0.18);
    border-color: #00e5ff;
    color: #00e5ff;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

#mon-green.btn-slot-adapter.active {
    background: rgba(0, 255, 100, 0.18);
    border-color: #00ff64;
    color: #00ff64;
    box-shadow: 0 0 8px rgba(0, 255, 100, 0.35);
}

#mon-amber.btn-slot-adapter.active {
    background: rgba(255, 176, 0, 0.18);
    border-color: #ffb000;
    color: #ffb000;
    box-shadow: 0 0 8px rgba(255, 176, 0, 0.35);
}

.btn-slot-adapter:disabled,
.btn-slot-adapter.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05);
    background: #0f172a;
    color: #475569;
}

.slot-footer {
    font-size: 10px;
    color: #64748b;
    font-style: italic;
    margin-top: 4px;
}


