/* =========================================================
   MINRAUD // THE REALITY STUDIO STYLESHEET (main.css/minraud.css)
   Stop-The-Wedding Tactile Instrument Architecture
========================================================= */

:root {
    --red: #ff0033;
    --red-bright: #ff335c;
    --red-dim: #3d020a;
    --red-dark: #190004;
    --black: #0a0a0a;
    --panel-bg: #111113;
    --border-dark: #2a2a30;
}

*, *::before, *::after {
    box-sizing: border-box;
}

::selection {
    background: var(--red);
    color: var(--black);
    text-shadow: none;
}

/* --- CORE LAYOUT --- */
body {
    background: #0a0a0a;
    color: #f0f0f0;
    font-family: "Nova Flat", system-ui, 'Courier New', monospace;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body::before {
    display: none;
}

.main-content {
    padding: 0.75rem 1rem;
    flex: 1;
    max-width: 1820px;
    width: 100%;
    margin: 0 auto;
}

.header-media-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 1.1rem;
    position: relative;
    z-index: 10000;
    flex-wrap: wrap;
}

/* =========================================================
   STOP THE WEDDING 3-ZONE INSTRUMENT COCKPIT
   Left Wing (Cut-Up + AI) | Center Stage (Waghdas Folio) | Right Wing (Ghadis + Dispatch)
========================================================= */
.studio-grid {
    display: grid;
    grid-template-columns: 370px minmax(420px, 1fr) 360px;
    gap: 0.9rem;
    align-items: stretch;
}

.wing-column {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.center-folio-stage {
    display: flex;
    flex-direction: column;
}

@media (max-width: 1320px) {
    .studio-grid {
        grid-template-columns: 1fr 1fr;
    }
    .center-folio-stage {
        grid-column: 1 / -1;
        order: -1; /* Keep Waghdas Folio prominent on tablet */
    }
}

@media (max-width: 820px) {
    .main-content {
        padding: 0.5rem;
    }
    .studio-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .center-folio-stage {
        order: 0;
    }
}

/* --- INSTRUMENT CARDS & CORNER RIVETS --- */
.panel.instrument-card,
.folio-frame {
    background: linear-gradient(180deg, #141418 0%, #0c0c0f 100%);
    border: 1px solid #2e1118;
    border-radius: 4px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.85), 0 4px 16px rgba(0, 0, 0, 0.6);
}

.cutup-card {
    border-color: rgba(255, 0, 51, 0.55) !important;
}

.card-corner {
    position: absolute;
    width: 7px;
    height: 7px;
    border-color: var(--red);
    pointer-events: none;
    opacity: 0.75;
}
.card-corner.tl { top: 4px; left: 4px; border-top: 2px solid var(--red); border-left: 2px solid var(--red); }
.card-corner.tr { top: 4px; right: 4px; border-top: 2px solid var(--red); border-right: 2px solid var(--red); }
.card-corner.bl { bottom: 4px; left: 4px; border-bottom: 2px solid var(--red); border-left: 2px solid var(--red); }
.card-corner.br { bottom: 4px; right: 4px; border-bottom: 2px solid var(--red); border-right: 2px solid var(--red); }

.instrument-header {
    border-bottom: 1px solid #2c1016;
    padding-bottom: 0.4rem;
    margin-bottom: 0.6rem;
}

.instrument-num {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 0.58rem;
    letter-spacing: 2px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.instrument-title {
    margin: 0;
    font-size: 1.05rem;
    color: #f5f5f5;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cutup-card .instrument-title {
    color: var(--red);
    text-shadow: 0 0 10px rgba(255, 0, 51, 0.45);
}

/* --- MODULE I: SVG BLADE TURRET (TamaghisEXPRESScut) --- */
.blade-turret-wrap {
    background: #070709;
    border: 1px solid #2a0d14;
    border-radius: 4px;
    padding: 6px 8px 4px;
    margin-bottom: 8px;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
}

.blade-turret-svg {
    width: 100%;
    max-width: 210px;
    height: 82px;
    display: block;
    margin: 0 auto;
}

#turretNeedle {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.turret-readout {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    color: var(--red);
    text-transform: uppercase;
    margin-top: 2px;
}

.mixer-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 6px 0;
}

.module-btn {
    background: #110c0e;
    border: 1px solid #38151d;
    color: #ccc;
    padding: 8px 9px;
    cursor: pointer;
    font-family: "Nova Flat", monospace;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.7rem;
    text-transform: uppercase;
    border-radius: 3px;
}

.module-btn:hover,
.module-btn.active-blade {
    background: var(--red);
    border-color: var(--red);
    color: #000;
    box-shadow: 0 0 12px rgba(255, 0, 51, 0.5);
}

.express-icon {
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--red);
}

.module-btn:hover .express-icon,
.module-btn.active-blade .express-icon {
    color: #000;
}

.conduit-pills {
    display: flex;
    gap: 5px;
    margin: 4px 0 6px;
}

.mini-btn {
    flex: 1;
    font-size: 0.63rem;
    padding: 5px 6px;
    background: #161013;
    border: 1px solid #381820;
    color: #aaa;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mini-btn:hover {
    color: #000;
    background: var(--red);
    border-color: var(--red);
}

.buffer-chamber {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chamber-label {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    color: #777;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
}

#mixerSource {
    width: 100%;
    height: 58px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    background: #050505;
    color: #aaa;
    border: 1px dashed #3a1820;
    resize: vertical;
    padding: 5px;
    border-radius: 3px;
}

#mixerSource:focus {
    border-color: var(--red);
    outline: none;
}

#mixerOutput {
    width: 100%;
    height: 84px;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    background: #050505;
    color: #f0f0f0;
    border: 1px solid var(--red);
    resize: vertical;
    padding: 5px;
    border-radius: 3px;
}

#mixerOutput::placeholder {
    color: var(--red);
    opacity: 0.5;
}

.instrument-fire-btn {
    width: 100%;
    padding: 0.65rem;
    background: #3d020a;
    color: var(--red);
    border: 1px solid var(--red);
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.25s;
}

.instrument-fire-btn:hover {
    background: var(--red);
    color: #000;
    box-shadow: 0 0 15px var(--red);
}

/* --- CENTER STAGE: WAGHDAS MASTER FOLIO --- */
.folio-frame {
    flex: 1;
    background: linear-gradient(180deg, #1b0005 0%, #0e0003 100%);
    border: 1px solid var(--red);
    box-shadow: 0 0 30px rgba(255, 0, 51, 0.14), inset 0 0 30px rgba(0, 0, 0, 0.9);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.folio-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid #550015;
    padding-bottom: 0.5rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: 8px;
}

.folio-badge {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    letter-spacing: 2.5px;
    color: #ff6680;
    text-transform: uppercase;
}

.folio-title {
    margin: 2px 0 0 0;
    font-size: 1.45rem;
    color: var(--red);
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(255, 0, 51, 0.5);
}

.notepad-stats {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    color: #ff8096;
    background: #240007;
    border: 1px solid #5c0016;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 1px;
}

.folio-ruler {
    font-family: 'Courier New', monospace;
    font-size: 0.64rem;
    color: #ff4d6d;
    background: #1a0004;
    border: 1px solid #4d0011;
    border-bottom: none;
    padding: 4px 10px;
    letter-spacing: 2px;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0.8;
    user-select: none;
}

#notepad {
    width: 100%;
    flex: 1;
    min-height: 620px;
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    border-radius: 0 0 4px 4px;
    font-family: 'Nova Flat', monospace;
    line-height: 1.8rem;
    background: #2a0006;
    background-image: 
        linear-gradient(rgba(255, 0, 51, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 51, 0.03) 1px, transparent 1px);
    background-size: 100% 1.8rem, 1.8rem 100%;
    color: #ffd2d9;
    border: 1px solid var(--red);
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.85);
}

#notepad:focus {
    background-color: #360009;
    border-color: #ff3366;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.9), 0 0 15px rgba(255, 0, 51, 0.35);
}

@media (max-width: 820px) {
    #notepad {
        min-height: 360px;
    }
}

.folio-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    gap: 6px;
}

.folio-hint {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
    color: #994d5c;
    letter-spacing: 1px;
}

/* --- MODULE II: BA'DAN AI & BYOK SLOT --- */
.byok-slot {
    margin: 0.4rem 0;
    padding: 8px;
    border: 1px dashed var(--red);
    background: rgba(0, 0, 0, 0.75);
    border-radius: 3px;
}

.byok-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--red);
    font-weight: bold;
    margin-bottom: 5px;
}

.byok-header a {
    color: var(--red);
    text-decoration: underline;
    font-size: 0.6rem;
}

.led-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--red);
    margin-right: 5px;
    box-shadow: 0 0 6px var(--red);
}

#novaApiKey {
    width: 100%;
    background: #111;
    border: 1px solid #333;
    color: var(--red);
    padding: 6px 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.74rem;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.byok-note {
    font-size: 0.56rem;
    color: #666;
    line-height: 1.35;
    margin-bottom: 4px;
}

.byok-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.56rem;
    color: #555;
}

#clearKeyBtn {
    background: transparent;
    border: 1px solid #333;
    color: #777;
    font-size: 0.56rem;
    padding: 2px 7px;
}

/* --- COMPACT TELEGRAPH ROTARY KNOB (YASS-WADDAH) --- */
.knob-module {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #090a0d;
    border: 1px solid #24262e;
    padding: 7px 10px;
    margin: 0.45rem 0;
    border-radius: 3px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7);
    user-select: none;
    -webkit-user-select: none;
}

.knob-bezel {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle, #1a1c24 0%, #0d0e12 100%);
    border: 2px solid #24262e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 8px rgba(255, 0, 51, 0.15);
    cursor: grab;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.knob-bezel:active {
    cursor: grabbing;
    border-color: var(--red);
    box-shadow: 0 0 12px rgba(255, 0, 51, 0.4);
}

.knob-cap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #222530, #101115);
    border: 1px solid #333842;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1), 0 3px 6px rgba(0, 0, 0, 0.6);
    transform: rotate(45deg);
    transition: transform 0.05s ease-out;
}

.knob-indicator {
    position: absolute;
    top: 2px;
    left: 50%;
    width: 2px;
    height: 8px;
    background: var(--red);
    transform: translateX(-50%);
    box-shadow: 0 0 6px var(--red);
    border-radius: 1px;
}

.knob-readout-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
}

.knob-label {
    font-size: 0.62rem;
    letter-spacing: 1.5px;
    color: #8a909d;
    text-transform: uppercase;
}

.knob-value-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

#creativityValue {
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--red);
    text-shadow: 0 0 8px rgba(255, 0, 51, 0.5);
    font-family: 'Nova Flat', 'Courier New', monospace;
}

.knob-unit {
    font-size: 0.58rem;
    color: #555;
    letter-spacing: 1px;
}

.knob-ticks-label {
    font-size: 0.54rem;
    color: #444;
    letter-spacing: 1px;
    display: flex;
    gap: 6px;
}

#prompt {
    width: 100%;
    background: #0a0a0a;
    color: #f0f0f0;
    border: 1px solid #333;
    border-radius: 3px;
    padding: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
    resize: vertical;
    font-family: 'Courier New', monospace;
    min-height: 68px;
}

#prompt:focus {
    border-color: var(--red);
    outline: none;
}

.ai-monitor-wrap {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.story-output {
    flex: 1;
    background: #070709;
    border: 1px solid #333;
    border-radius: 3px;
    padding: 0.6rem;
    white-space: pre-wrap;
    overflow-y: auto;
    height: 125px;
    max-height: 180px;
    font-size: 0.8rem;
    color: #ccc;
    margin-top: 3px;
}

/* --- MODULE III: GHADIS SUNDIAL LEXICON --- */
#dict-title {
    color: var(--red) !important;
    text-shadow: 0 0 10px rgba(255, 0, 51, 0.6);
    letter-spacing: 2px;
}

.sundial-receiver {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #08080a;
    border: 1px solid #2b1017;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.sundial-wheel {
    width: 66px;
    height: 66px;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}

.sundial-svg {
    width: 100%;
    height: 100%;
    display: block;
}

#sundialSpokes {
    transform-origin: 50px 50px;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.sundial-wheel:hover #sundialSpokes {
    filter: drop-shadow(0 0 5px var(--red));
}

.sundial-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#dictionary-search {
    width: 100%;
    padding: 0.42rem 0.55rem;
    background: #0a0a0a;
    color: #fff;
    border: 1px solid #444;
    border-radius: 3px;
    font-size: 0.78rem;
}

#dictionary-search:focus {
    border-color: var(--red);
    outline: none;
}

#search-button,
#random-word,
#clear-dict {
    color: #f5edef;
    border: 1px solid var(--red);
    background: #140003;
    box-shadow: inset 0 0 6px rgba(255, 0, 51, 0.2);
    font-weight: bold;
    letter-spacing: 0.8px;
    font-size: 0.65rem;
    padding: 4px 5px;
    transition: all 0.2s ease-in-out;
}

#search-button:hover,
#random-word:hover,
#clear-dict:hover {
    background: var(--red);
    color: #000;
    box-shadow: 0 0 12px rgba(255, 0, 51, 0.8);
}

.dictionary-result {
    background: #070709;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 0.6rem;
    overflow-y: auto;
    flex-grow: 1;
    height: 290px;
    max-height: 350px;
    font-size: 0.78rem;
    color: #ccc;
    font-variant-ligatures: none;
}

.word-title {
    color: var(--red);
    font-size: 1.05rem;
    margin: 0;
    font-weight: bold;
}

.synonym-tag {
    display: inline-block;
    background: #3d020a;
    color: #ff6666;
    padding: 0.18rem 0.42rem;
    margin: 0.15rem;
    border-radius: 2px;
    font-size: 0.68rem;
    cursor: pointer;
    border: 1px solid var(--red);
    transition: all 0.2s;
}

.synonym-tag:hover {
    background: var(--red);
    color: #000;
}

.dict-telemetry {
    font-family: 'Courier New', monospace;
    font-size: 0.62rem;
    color: #666;
    margin-top: 0.4rem;
}

.loading, .no-results {
    text-align: center;
    padding: 1rem;
    color: #666;
    font-size: 0.78rem;
}

/* --- MODULE IV: DISPATCH ASTROLABE KEYS --- */
.dispatch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.dispatch-key {
    background: #100c0e;
    border: 1px solid #38161f;
    border-radius: 4px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.dispatch-key:hover {
    border-color: var(--red);
    background: #240208;
    box-shadow: 0 0 12px rgba(255, 0, 51, 0.3);
}

.dispatch-key.danger-key {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-color: #44111b;
}

.key-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #444;
    position: absolute;
    top: 8px;
    right: 8px;
}

#micBtn.mic-on {
    background: #3d020a;
    border-color: var(--red);
    box-shadow: 0 0 14px rgba(255, 0, 51, 0.5);
}

#micBtn.mic-on .key-led {
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
}

.key-icon {
    font-size: 0.85rem;
    color: var(--red);
}

.key-name {
    font-family: "Nova Flat", monospace;
    font-size: 0.75rem;
    color: #eee;
    font-weight: bold;
    letter-spacing: 1px;
}

.key-sub {
    font-family: 'Courier New', monospace;
    font-size: 0.55rem;
    color: #777;
    letter-spacing: 1px;
}

.notepad-mic-status {
    font-family: 'Courier New', monospace;
    font-size: 0.62rem;
    color: #888;
    letter-spacing: 1px;
    min-height: 1em;
    text-transform: uppercase;
}

.notepad-mic-status.live {
    color: var(--red);
}

/* --- GENERIC BUTTONS & CONTROLS ROW --- */
button {
    background: #222;
    border: 1px solid #444;
    color: #aaa;
    cursor: pointer;
    transition: all 0.25s;
    padding: 0.4rem 0.5rem;
    border-radius: 3px;
    font-family: inherit;
}

button:hover {
    border-color: var(--red);
    color: var(--red);
}

.controls-row {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.controls-row button {
    flex: 1;
    font-size: 0.72rem;
}

/* --- URL READOUT MODULE --- */
.url-readout-wrap {
    margin-top: 8px;
    padding: 6px;
    background: #090a0d;
    border: 1px solid #331017;
    border-radius: 2px;
}

.url-readout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.url-readout-label {
    font-size: 0.58rem;
    color: var(--red);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.url-readout-status {
    font-size: 0.55rem;
    color: #888;
    letter-spacing: 1px;
}

#urlReadout {
    width: 100%;
    background: #040405 !important;
    color: #ff4d6d !important;
    border: 1px solid var(--red) !important;
    padding: 6px 8px !important;
    font-family: 'Nova Flat', 'Courier New', monospace !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.5px;
    cursor: copy !important;
    text-overflow: ellipsis;
}

/* --- SPLASH SCREEN & CRT OVERLAY --- */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out, visibility 1s;
    overflow: hidden;
}

#splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.nova-cube {
    position: absolute;
    width: 800px;
    height: 800px;
    background-image: url('https://raw.githubusercontent.com/ghostm68/pantheon/main/nova312.gif');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    animation: cube-rotate 20s linear infinite, cube-glow 3s ease-in-out infinite;
    opacity: 0.7;
    z-index: 1;
    filter: drop-shadow(0 0 40px rgba(255, 0, 51, 0.6));
}

@keyframes cube-rotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes cube-glow {
    0%, 100% { filter: drop-shadow(0 0 40px rgba(255, 0, 51, 0.6)); opacity: 0.7; }
    50% { filter: drop-shadow(0 0 60px rgba(255, 0, 51, 0.9)); opacity: 0.9; }
}

.splash-btn {
    padding: 15px 40px;
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--red);
    color: var(--red);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 5px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    margin-top: 20px;
    position: relative;
    z-index: 10;
    box-shadow: 0 0 30px rgba(255, 0, 51, 0.3);
}

.splash-btn:hover {
    background: var(--red);
    color: #000;
    box-shadow: 0 0 40px var(--red);
    letter-spacing: 7px;
}

@media (max-width: 768px) {
    .nova-cube { width: 240px; height: 240px; }
    .splash-btn { font-size: 0.85rem; padding: 12px 18px; letter-spacing: 2px; max-width: 90%; text-align: center; }
}

#crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100001;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.4) 90%, rgba(0,0,0,0.8) 100%);
}

.scanline {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.2) 55%);
    background-size: 100% 4px;
    animation: scanline 10s linear infinite, flicker 0.15s infinite;
}

@keyframes scanline { 0% { background-position: 0 0; } 100% { background-position: 0 100%; } }
@keyframes flicker { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.25; } }

/* --- HEADER, GLITCH ORB, QR & VIDEO --- */
h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin: 0.3rem 0;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 0, 51, 0.1);
    background-image: url('https://github.com/ghostm68/pantheon/raw/main/inkrealmliquidhermes934.gif');
    background-size: cover;
    -webkit-background-clip: text;
    background-clip: text;
    animation: water-flow 30s linear infinite;
    text-shadow: 0 0 20px rgba(255, 0, 51, 0.8), 0 0 40px rgba(61, 2, 10, 0.5);
}

@keyframes water-flow { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }

.subtitle {
    font-style: italic;
    color: #aaa;
    text-align: center;
    font-size: 0.85rem;
}

.orb-container {
    display: inline-block;
    vertical-align: middle;
    margin-right: 12px;
    width: 46px;
    height: 46px;
}

.glitch-orb { width: 100%; height: 100%; fill: none; stroke-width: 3; overflow: visible; }
.orb-circle { stroke: var(--red); }
.orb-triangle { stroke: #ffffff; }
.orb-container svg { animation: slow-spin 10s linear infinite; filter: drop-shadow(0 0 5px rgba(255, 0, 51, 0.4)); }
.orb-container:hover svg { animation: glitch-shake 0.3s both infinite; }

@keyframes slow-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes glitch-shake {
    0%, 100% { transform: translate(0) rotate(0deg); }
    25% { transform: translate(-2px, 2px) rotate(-5deg); }
    75% { transform: translate(2px, -2px) rotate(5deg); }
}

#ton-qr, #quantum-video {
    width: 60px;
    height: 60px;
    border: 1px solid var(--red);
    padding: 2px;
    background: #000;
    box-shadow: 0 0 10px rgba(255, 0, 51, 0.2);
    position: relative;
    z-index: 10001;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

#ton-qr.expanded, #quantum-video.expanded {
    transform: scale(3.8);
    z-index: 999999;
    border-color: var(--red);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.95), 0 0 50px rgba(255, 0, 51, 0.8);
}

#quantum-video iframe { width: 100%; height: 100%; border: 0; pointer-events: none; }
#quantum-video .vid-overlay { position: absolute; inset: 0; z-index: 2; cursor: pointer; }
#quantum-video .vid-close {
    display: none;
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.9);
    color: var(--red);
    border: 1px solid var(--red);
    font-size: 7px;
    padding: 2px 4px;
    z-index: 10;
}
#quantum-video.expanded .vid-close { display: block; }

/* --- CUSTOM SELECT DROPDOWN --- */
.custom-select-container { position: relative; width: 100%; margin-bottom: 0.45rem; }
.select-selected {
    background-color: #0a0a0a;
    border: 1px solid #333;
    color: var(--red);
    padding: 7px 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.74rem;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.select-selected:after { position: absolute; content: "▼"; right: 10px; top: 50%; transform: translateY(-50%); font-size: 0.65rem; color: var(--red); }
.select-selected.select-arrow-active:after { content: "▲"; }
.select-items {
    position: absolute;
    background-color: #000;
    border: 1px solid #333;
    z-index: 9999;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
}
.select-items div {
    color: #aaa;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.74rem;
    cursor: pointer;
    border-bottom: 1px solid #222;
}
.select-items div:hover, .select-items div.same-as-selected { background-color: var(--red) !important; color: #000 !important; }
.select-hide { display: none; }

/* --- NOUS & NOVA FM CORNER INTERCEPTS --- */
#nous-interface { position: fixed; top: 14px; right: 14px; font-family: 'Courier New', monospace; z-index: 10000; display: flex; flex-direction: column; align-items: flex-end; }
#nova-fm-interface { position: fixed; top: 14px; left: 14px; font-family: 'Courier New', monospace; z-index: 10000; display: flex; flex-direction: column; align-items: flex-start; }

#nous-toggle, #nova-fm-toggle {
    background: #000;
    color: #fff;
    border: 1px solid var(--red);
    padding: 7px 11px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1.5px;
    font-weight: bold;
    box-shadow: 0 0 8px rgba(255, 0, 51, 0.25);
}

#nova-fm-toggle.live { background: #3d020a; color: var(--red); box-shadow: 0 0 14px rgba(255, 0, 51, 0.6); }

#nous-panel, #nova-fm-panel {
    display: none;
    width: min(320px, 92vw);
    background: rgba(5, 5, 5, 0.96);
    border: 1px solid var(--red);
    padding: 14px;
    box-shadow: 0 0 25px #000;
    margin-top: 5px;
}

#nova-fm-panel audio { width: 100%; height: 34px; margin: 8px 0; }
.nova-fm-credit { font-size: 0.64rem; color: #888; line-height: 1.45; }

.nous-header { display: flex; justify-content: space-between; color: #888; border-bottom: 1px solid #222; padding-bottom: 6px; margin-bottom: 10px; font-size: 10px; letter-spacing: 2px; }
#nous-output { height: 200px; background: #000; color: #ccc; border: 1px solid #222; padding: 8px; font-size: 11px; overflow-y: auto; white-space: pre-wrap; margin-bottom: 8px; }
textarea.nous-input { width: 100%; height: 48px; background: #111; color: #fff; border: 1px solid #333; padding: 6px; font-size: 11px; font-family: 'Courier New', monospace; margin-bottom: 6px; }
.nous-btn { width: 100%; padding: 8px; background: #000; color: #aaa; border: 1px solid #333; text-transform: uppercase; font-size: 10px; font-weight: bold; }
.progress-track { width: 100%; height: 2px; background: #222; margin: 8px 0; display: none; }
.progress-fill { width: 0%; height: 100%; background: var(--red); }

@media (max-width: 768px) {
    .top-corner-dock { display: flex; justify-content: space-between; margin-bottom: 0.4rem; position: relative; z-index: 10002; }
    #nova-fm-interface, #nous-interface { position: static; }
    #nova-fm-panel, #nous-panel { position: fixed; top: 50px; left: 4vw; right: 4vw; width: 92vw; }
}

/* --- TICKERS & FOOTER --- */
#france24-ticker-container { width: 100%; background: #111; border-top: 2px solid var(--red); border-bottom: 2px solid var(--red); margin: 1rem 0; padding: 0.5rem; font-family: 'Courier New', monospace; overflow: hidden; }
#france24-ticker-heading, #sciencedaily-ticker-heading { color: #fff; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.3rem; text-align: center; }
.france24-ticker-wrapper, .sciencedaily-ticker-wrapper { width: 100%; overflow: hidden; white-space: nowrap; }
#france24-ticker { display: inline-block; white-space: nowrap; animation: ticker-scroll 60s linear infinite; padding-left: 100%; }
#sciencedaily-ticker { display: inline-block; white-space: nowrap; animation: ticker-scroll 240s linear infinite; padding-left: 100%; }
#france24-ticker.paused, #sciencedaily-ticker.paused { animation-play-state: paused; }
#france24-ticker a { color: #aaa; margin: 0 2rem; font-size: 0.82rem; border-left: 1px solid #333; padding-left: 1rem; }
#sciencedaily-ticker a { color: var(--red) !important; margin: 0 2.5rem; font-size: 0.85rem; border-left: 1px solid #333; padding-left: 1.2rem; font-weight: bold; }
@keyframes ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

#sonic-strip { display: none; border: 1px solid var(--red); padding: 8px; margin-bottom: 8px; background: #050505; text-align: center; }
.api-status { margin-top: 0.8rem; font-size: 0.72rem; color: #666; text-align: center; }
.generating { animation: pulse 1.5s infinite; color: var(--red); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.error-detail { font-size: 0.7rem; color: #ff6666; }

footer { margin-top: 1.5rem; padding: 1rem; border-top: 1px solid #333; text-align: center; font-size: 0.7rem; color: #555; background: #0a0a0a; }
footer a, a { color: inherit; text-decoration: none; }
footer a:hover { color: var(--red); text-shadow: 0 0 5px var(--red); }
.footer-wallet { color: var(--red); font-family: 'Courier New', monospace; font-size: 0.75rem; letter-spacing: 1px; word-break: break-all; margin: 15px 0; border-top: 1px dashed #333; border-bottom: 1px dashed #333; padding: 10px 0; background: rgba(255, 0, 51, 0.05); }

/* =========================================================
   DESKTOP + MOBILE LOCK FOR TURRET & SUNDIAL SIZES
========================================================= */
.blade-turret-svg {
    width: 190px !important;
    max-width: 190px !important;
    height: 76px !important;
    display: block;
    margin: 0 auto;
}

.sundial-wheel,
.sundial-svg {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    display: block;
    flex-shrink: 0;
}

@media only screen and (max-width: 768px) {
    .blade-turret-wrap {
        padding: 4px 6px 2px;
        margin-bottom: 5px;
    }
    .blade-turret-svg {
        width: 125px !important;
        max-width: 125px !important;
        height: 46px !important;
    }
    .turret-readout {
        font-size: 0.5rem;
        letter-spacing: 1px;
    }
    .mixer-controls {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        margin: 4px 0;
    }
    .module-btn {
        padding: 5px 6px;
        font-size: 0.58rem;
        gap: 4px;
        justify-content: center;
    }
    .express-icon {
        font-size: 0.8rem;
    }
    .sundial-receiver {
        padding: 5px 6px;
        gap: 8px;
        margin-bottom: 0.35rem;
    }
    .sundial-wheel,
    .sundial-svg {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }
    #dictionary-search {
        padding: 0.3rem 0.45rem;
        font-size: 0.72rem;
    }
    #search-button,
    #random-word,
    #clear-dict {
        font-size: 0.58rem;
        padding: 3px 4px;
    }
    .dictionary-result {
        height: 170px;
        max-height: 200px;
        padding: 0.45rem;
        font-size: 0.74rem;
    }
    #mixerSource {
        height: 46px;
    }
    #mixerOutput {
        height: 64px;
    }
    .panel.instrument-card,
    .folio-frame {
        padding: 0.6rem;
    }
    .instrument-num {
        font-size: 0.5rem;
        letter-spacing: 1.2px;
    }
    .instrument-title {
        font-size: 0.88rem;
    }
}
