/* CRT Terminal Styling */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

body {
    background: #000;
    font-family: 'VT323', monospace;
    overflow: hidden;
    color: #0f0;
}

/* CRT Effect Container */
.crt {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
}

/* Scanline effect */
.crt::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 1px;
    z-index: 2;
    pointer-events: none;
    animation: scanline 0.5s linear infinite;
}

/* Flickering effect */
.crt::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes scanline {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 1px;
    }
}

@keyframes flicker {
    0% { opacity: 0.27861; }
    5% { opacity: 0.34769; }
    10% { opacity: 0.23604; }
    15% { opacity: 0.90626; }
    20% { opacity: 0.18128; }
    25% { opacity: 0.83891; }
    30% { opacity: 0.65583; }
    35% { opacity: 0.67807; }
    40% { opacity: 0.26559; }
    45% { opacity: 0.84693; }
    50% { opacity: 0.96019; }
    55% { opacity: 0.08594; }
    60% { opacity: 0.20313; }
    65% { opacity: 0.71988; }
    70% { opacity: 0.53455; }
    75% { opacity: 0.37288; }
    80% { opacity: 0.71428; }
    85% { opacity: 0.70419; }
    90% { opacity: 0.7003; }
    95% { opacity: 0.36108; }
    100% { opacity: 0.24387; }
}

.container {
    position: relative;
    z-index: 1;
    padding: 10px 20px 20px 20px;
    color: #0f0;
    text-shadow: 0 0 3px #0f0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    margin-bottom: 6px;
    border-bottom: 2px solid #0f0;
    padding-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ascii-art {
    font-size: 10px;
    line-height: 1.1;
    color: #0f0;
    flex-shrink: 0;
    margin: 0;
}

.observatory-map {
    border: 1px solid #0f0;
    padding: 10px;
    background: rgba(0, 255, 0, 0.03);
    color: #0f0;
    text-shadow: 0 0 3px #0f0;
    min-width: 220px;
}

.system-time {
    text-align: right;
    font-size: 16px;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.color-scheme-btn {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #0f0;
    color: #0f0;
    padding: 5px 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 3px #0f0;
}

.color-scheme-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px #0f0;
    transform: scale(1.05);
}

/* Audio Settings Dropdown */
.audio-settings-wrapper {
    position: relative;
    display: inline-block;
}

.audio-settings-btn {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #0f0;
    color: #0f0;
    padding: 5px 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 3px #0f0;
}

.audio-settings-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px #0f0;
    transform: scale(1.05);
}

.audio-settings-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #0f0;
    padding: 12px 14px;
    z-index: 1000;
    min-width: 240px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.15);
}

.audio-settings-dropdown.open {
    display: block;
}

.audio-setting-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.audio-setting-row:last-child {
    margin-bottom: 0;
}

.audio-label {
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    min-width: 48px;
    text-shadow: 0 0 3px #0f0;
}

.audio-value {
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    min-width: 32px;
    text-align: right;
    text-shadow: 0 0 3px #0f0;
}

.audio-setting-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #333;
    outline: none;
    cursor: pointer;
}

.audio-setting-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #0f0;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 0 0 6px #0f0;
}

.audio-setting-row input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #0f0;
    border: none;
    border-radius: 0;
    cursor: pointer;
    box-shadow: 0 0 6px #0f0;
}

/* Starmap (Array) Button */
.starmap-btn {
    background: rgba(255, 255, 0, 0.08);
    border: 2px solid #aa0;
    color: #ff0;
    padding: 5px 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px #aa0;
    position: relative;
}

.starmap-btn:hover {
    background: rgba(255, 255, 0, 0.15);
    box-shadow: 0 0 10px #ff0;
}

.mailbox-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #0ff;
    color: #0ff;
    padding: 5px 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px #0ff;
    position: relative;
}

.mailbox-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px #0ff;
    transform: scale(1.05);
}

.mailbox-icon {
    font-size: 16px;
    margin-right: 5px;
}

.mail-indicator {
    color: #ff0;
    font-size: 20px;
    animation: mailBlink 1s infinite;
    margin-left: 5px;
}

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

.journal-indicator {
    color: #0ff;
    font-size: 20px;
    animation: mailBlink 1s infinite;
    margin-left: 5px;
}

/* Journal Button */
.journal-btn {
    background: rgba(0, 255, 0, 0.08);
    border: 2px solid #0a0;
    color: #0f0;
    padding: 5px 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px #0a0;
    position: relative;
}

.journal-btn:hover {
    background: rgba(0, 255, 0, 0.15);
    box-shadow: 0 0 10px #0f0;
    transform: scale(1.05);
}

.journal-icon {
    font-size: 14px;
    margin-right: 3px;
}

/* Investigation / Project Button */
.investigation-btn {
    background: rgba(255, 0, 255, 0.1);
    border: 2px solid #f0f;
    color: #f0f;
    padding: 5px 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px #f0f;
    position: relative;
}

.investigation-btn:hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 10px #f0f;
    transform: scale(1.05);
}

.investigation-icon {
    font-size: 16px;
    margin-right: 5px;
}

.investigation-indicator {
    color: #ff0;
    font-size: 20px;
    animation: mailBlink 1s infinite;
    margin-left: 5px;
}

.day-report-btn {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #0f0;
    color: #0f0;
    padding: 5px 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px #0f0;
    position: relative;
    animation: pulse-glow 2s ease-in-out infinite;
}

.day-report-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px #0f0;
}

.day-report-icon {
    font-size: 16px;
    margin-right: 5px;
}

/* Investigation Page */
.investigation-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.investigation-header {
    text-align: center;
    margin-bottom: 30px;
}

.investigation-classification {
    color: #f00;
    font-size: 12px;
    letter-spacing: 3px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #f00;
}

.investigation-header h2 {
    color: #f0f;
    text-shadow: 0 0 10px #f0f;
    letter-spacing: 4px;
    font-size: 28px;
    margin: 10px 0;
}

.investigation-subtitle {
    color: #808;
    font-size: 14px;
    letter-spacing: 2px;
}

.investigation-content {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
}

/* 3D Shape Panel */
.investigation-shape-panel {
    flex: 0 0 320px;
}

.shape-title {
    color: #0ff;
    font-size: 14px;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #0ff;
}

#investigation-canvas {
    display: block;
    border: 2px solid #333;
    background: #000;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.1);
}

.shape-info {
    margin-top: 15px;
    text-align: center;
}

.shape-progress {
    color: #0f0;
    font-size: 16px;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.shape-form {
    color: #0ff;
    font-size: 13px;
    letter-spacing: 1px;
}

/* Fragment Cards */
.investigation-fragments {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fragment-card {
    border: 1px solid #333;
    background: rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s;
}

.fragment-card.decoded {
    border-color: #0f0;
}

.fragment-card.available {
    border-color: #ff0;
    animation: warningPulse 1.5s ease-in-out infinite;
}

.fragment-header {
    padding: 8px 12px;
    border-bottom: 1px solid #222;
    color: #888;
    font-size: 13px;
    letter-spacing: 1px;
}

.fragment-card.decoded .fragment-header {
    color: #0f0;
}

.fragment-card.available .fragment-header {
    color: #ff0;
}

.fragment-status {
    margin-right: 8px;
}

.fragment-body {
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.6;
    color: #0f0;
    min-height: 40px;
}

.fragment-locked {
    color: #444;
    font-style: italic;
}

.fragment-decoded-content {
    font-family: 'Courier New', monospace;
}

.fragment-parsed-bar {
    margin-top: 6px;
    color: #0ff;
    font-size: 11px;
}

.fragment-action-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    border: 1px solid #ff0;
    background: rgba(255, 255, 0, 0.1);
    color: #ff0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    cursor: pointer;
    text-shadow: 0 0 3px #ff0;
}

.fragment-action-btn:hover {
    background: rgba(255, 255, 0, 0.2);
    box-shadow: 0 0 8px #ff0;
}

/* Investigation Actions */
.investigation-actions {
    text-align: center;
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

#investigation-action-btn {
    background: rgba(255, 0, 255, 0.15);
    border: 2px solid #f0f;
    color: #f0f;
    text-shadow: 0 0 5px #f0f;
    font-size: 16px;
    padding: 12px 30px;
    letter-spacing: 2px;
}

#investigation-action-btn:hover {
    background: rgba(255, 0, 255, 0.3);
    box-shadow: 0 0 15px #f0f;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-bottom: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Start Screen */
.start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.start-ascii {
    font-size: 11px;
    line-height: 1.2;
    color: #0f0;
    text-shadow: 0 0 3px #0f0;
    margin-bottom: 30px;
}

.start-info {
    margin: 20px 0 40px 0;
    font-size: 18px;
    letter-spacing: 2px;
}

.start-info p {
    margin: 10px 0;
}

.start-btn {
    font-size: 24px;
    padding: 15px 40px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 10px #0f0;
    }
    50% {
        box-shadow: 0 0 20px #0f0;
        transform: scale(1.05);
    }
}

.copyright-notice {
    margin-top: 40px;
    font-size: 12px;
    color: #0f0;
    letter-spacing: 1px;
    opacity: 0.35;
}

/* Boot Sequence */
.boot-terminal {
    font-family: 'Courier New', monospace;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.boot-content-wrapper {
    display: flex;
    gap: 40px;
    align-items: center;
}

.boot-left {
    flex: 1;
}

.boot-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boot-output {
    font-size: 16px;
    line-height: 1.6;
    color: #0f0;
    text-shadow: 0 0 3px #0f0;
    min-height: 400px;
}

.boot-proceed-btn {
    font-size: 32px !important;
    padding: 30px 50px !important;
    white-space: nowrap;
    animation: pulse 2s infinite;
}

.boot-line {
    margin: 5px 0;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.boot-line.error {
    color: #f00;
    text-shadow: 0 0 5px #f00;
}

.boot-line.warning {
    color: #ff0;
    text-shadow: 0 0 5px #ff0;
}

.boot-line.success {
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
}

.name-input-container {
    margin-top: 30px;
    text-align: center;
}

.name-prompt {
    font-size: 20px;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.name-input {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #0f0;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 20px;
    padding: 10px 20px;
    text-align: center;
    width: 300px;
    margin-right: 15px;
}

.name-input:focus {
    outline: none;
    box-shadow: 0 0 15px #0f0;
    background: rgba(0, 255, 0, 0.15);
}

.name-input::placeholder {
    color: rgba(0, 255, 0, 0.5);
}

h2 {
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 2px;
}

.instruction {
    text-align: center;
    font-size: 20px;
    margin-top: 5px;
    margin-bottom: 15px;
    opacity: 0.8;
}

/* Star Map Section */
.starmap-section {
    display: flex;
    gap: 20px;
    margin: 0 30px 15px 0;
    align-items: flex-start;
}

/* Starmap Array Panel (left side) */
.starmap-array-panel {
    flex: 0 0 280px;
    min-width: 280px;
    height: 554px;
    border: 2px solid #ffa500;
    background: rgba(255, 165, 0, 0.05);
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.2);
}

.starmap-array-title {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #ffa500;
    text-shadow: 0 0 5px #ffa500;
    border-bottom: 1px solid #ffa500;
    padding-bottom: 10px;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.starmap-array-visual {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.starmap-array-svg {
    width: 100%;
    max-width: 250px;
    height: auto;
}

.array-aligning-text {
    color: #ff0;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    text-shadow: 0 0 10px #ff0;
    animation: aligningFlash 0.5s ease-in-out infinite;
}

@keyframes aligningFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.starmap-array-svg .array-arm {
    stroke: #ffa500;
    stroke-width: 2;
    opacity: 0.4;
}

/* Array Telemetry Display */
.array-telemetry {
    padding: 8px 5px;
    border-top: 1px dashed #ffa500;
    font-size: 14px;
    font-family: 'VT323', monospace;
}

.telemetry-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin: 4px 0;
    align-items: center;
}

.telemetry-label {
    color: #888;
    font-size: 12px;
}

.telemetry-value {
    color: #0ff;
    min-width: 45px;
    font-size: 14px;
}

.telemetry-value.updating {
    color: #ff0;
    animation: telemFlicker 0.1s infinite;
}

@keyframes telemFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.starmap-array-stats {
    padding: 10px 5px;
    border-top: 1px dashed #ffa500;
    border-bottom: 1px dashed #ffa500;
}

.starmap-array-stat {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin: 6px 0;
    color: #ffa500;
}

.starmap-array-stat .stat-label {
    color: #888;
}

.starmap-array-stat span:last-child {
    color: #0ff;
    font-weight: bold;
}

.starmap-array-status {
    text-align: center;
    font-size: 14px;
    color: #ffa500;
    padding: 10px 5px;
    margin-top: auto;
}

.starmap-array-status.ready {
    color: #0f0;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 8px #0f0;
    animation: readyPulse 1.5s ease-in-out infinite;
}

@keyframes readyPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.starmap-array-status.insufficient {
    color: #ff0;
}

.starmap-array-scan-btn {
    margin: 8px auto 0;
    display: block;
    width: 90%;
    font-size: 14px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #553300 0%, #331a00 100%);
    border: 2px solid #ffa500;
    color: #ffa500;
    text-align: center;
    box-sizing: border-box;
    animation: scanBtnPulse 1.5s ease-in-out infinite;
}

.starmap-array-scan-btn:hover {
    background: linear-gradient(180deg, #774400 0%, #442200 100%);
    box-shadow: 0 0 15px #ffa500;
}

/* Array Code Section */
.array-code-section {
    padding: 10px 5px;
    border-top: 1px dashed #ffa500;
    text-align: center;
}

.array-code-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.array-code-display {
    font-size: 20px;
    font-weight: bold;
    color: #ffa500;
    text-shadow: 0 0 8px #ffa500;
    letter-spacing: 4px;
    margin-bottom: 8px;
    font-family: 'VT323', monospace;
}

.array-code-input {
    font-size: 18px;
    font-weight: bold;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    letter-spacing: 4px;
    margin-bottom: 10px;
    min-height: 24px;
    font-family: 'VT323', monospace;
}

.array-code-input.error {
    color: #f00;
    text-shadow: 0 0 5px #f00;
    animation: codeError 0.3s ease-in-out;
}

@keyframes codeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.array-code-input.success {
    color: #0f0;
    text-shadow: 0 0 8px #0f0;
}

/* Keypad */
.array-keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 5px;
}

.keypad-btn {
    background: #1a1a1a;
    border: 1px solid #ffa500;
    color: #ffa500;
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 10px 6px;
    cursor: pointer;
    transition: all 0.1s;
}

.keypad-btn:hover {
    background: #331a00;
    box-shadow: 0 0 8px #ffa500;
}

.keypad-btn:active {
    background: #ffa500;
    color: #000;
}

.keypad-btn.keypad-c {
    background: #002200;
    border-color: #0f0;
    color: #0f0;
}

.keypad-btn.keypad-c:hover {
    background: #003300;
    box-shadow: 0 0 8px #0f0;
}

.keypad-btn.keypad-clear {
    background: #220000;
    border-color: #f00;
    color: #f00;
    font-size: 14px;
}

.keypad-btn.keypad-clear:hover {
    background: #330000;
    box-shadow: 0 0 8px #f00;
}

/* Code confirmed section */
.array-code-confirmed {
    margin-top: 10px;
    text-align: center;
}

.code-confirmed-text {
    color: #0f0;
    font-size: 16px;
    text-shadow: 0 0 10px #0f0;
    margin-bottom: 8px;
    animation: confirmPulse 0.5s ease-out;
}

@keyframes confirmPulse {
    0% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.begin-alignment-btn {
    background: #002200;
    border: 2px solid #0f0;
    color: #0f0;
    font-family: 'VT323', monospace;
    font-size: 14px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 0 0 5px #0f0;
}

.begin-alignment-btn:hover {
    background: #003300;
    box-shadow: 0 0 15px #0f0;
}

.begin-alignment-btn:active {
    background: #0f0;
    color: #000;
}

/* Starmap array dish styles (smaller versions) */
.starmap-array-svg .dish-element {
    cursor: pointer;
    transition: all 0.3s;
}

.starmap-array-svg .dish-base {
    fill: #331a00;
    stroke: #ffa500;
    stroke-width: 1;
}

.starmap-array-svg .dish-bowl {
    fill: none;
    stroke: #ffa500;
    stroke-width: 2;
}

.starmap-array-svg .dish-label {
    fill: #ffa500;
    font-family: 'VT323', monospace;
    font-size: 11px;
    text-anchor: middle;
}

.starmap-array-svg .dish-power-cost {
    fill: #666;
    font-family: 'VT323', monospace;
    font-size: 8px;
    text-anchor: middle;
}

.starmap-array-svg .dish-element:hover .dish-bowl {
    stroke: #ff0;
    filter: drop-shadow(0 0 3px #ff0);
}

.starmap-array-svg .dish-element.interference .dish-bowl {
    stroke: #f00;
    animation: interferenceFlicker 0.3s ease-in-out infinite;
}

.starmap-array-svg .dish-element.interference .dish-label {
    fill: #f00;
}

.starmap-array-svg .dish-element.powered .dish-bowl {
    stroke: #0ff;
}

.starmap-array-svg .dish-element.powered .dish-label {
    fill: #0ff;
}

.starmap-array-svg .dish-element.powered .dish-power-cost {
    fill: #0ff;
}

.starmap-array-svg .dish-element.aligned .dish-bowl {
    stroke: #0f0;
    filter: drop-shadow(0 0 5px #0f0);
}

.starmap-array-svg .dish-element.aligned .dish-label {
    fill: #0f0;
}

.starmap-array-svg .dish-element.aligning .dish-bowl {
    stroke: #ff0;
    fill: rgba(255, 255, 0, 0.3);
    filter: drop-shadow(0 0 8px #ff0);
    animation: aligningPulse 0.3s ease-in-out;
}

.starmap-array-svg .dish-element.aligning .dish-base {
    stroke: #ff0;
}

.starmap-array-svg .dish-element.aligning .dish-label {
    fill: #ff0;
}

@keyframes aligningPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.starmap-array-svg .dish-element.rotating .dish-bowl {
    stroke: #ff0;
    /* No animation */
}

.starmap-container {
    flex: 1;
    text-align: center;
}

.starmap-canvas-wrap {
    display: inline-block;
    position: relative;
    max-width: 100%;
}

#starmap-canvas {
    background: #000;
    border: 1px solid #0f0;
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    max-width: 100%;
    touch-action: none;
}

/* Starmap mode toggle */
.starmap-mode-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #0f0;
    color: #0f0;
    font-family: 'VT323', monospace;
    font-size: 14px;
    padding: 4px 12px;
    cursor: pointer;
    letter-spacing: 1px;
    text-shadow: 0 0 5px #0f0;
    transition: background 0.2s;
}
.starmap-mode-btn:hover {
    background: rgba(0, 255, 0, 0.15);
}
.starmap-mode-btn.active {
    border-color: #0ff;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
}

/* Sky chart zoom controls */
.sky-chart-zoom {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    gap: 4px;
}
.zoom-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #0f0;
    color: #0f0;
    font-family: 'VT323', monospace;
    font-size: 16px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    text-shadow: 0 0 5px #0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.zoom-btn:hover {
    background: rgba(0, 255, 0, 0.15);
}

.star-info-panel {
    flex: 0 0 280px;
    min-width: 280px;
    height: 554px; /* Match starmap canvas height (550px) + border (4px) */
    border: 2px solid #0f0;
    background: rgba(0, 255, 0, 0.02);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: visible;
}

.star-info-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    letter-spacing: 2px;
    padding-bottom: 8px;
    border-bottom: 1px solid #0f0;
}

#star-visual {
    background: #000;
    border: 1px solid #0f0;
    display: block;
    margin: 0 auto;
    width: 140px;
    height: 140px;
}

.star-details {
    font-size: 14px;
    line-height: 1.4;
    color: #0f0;
    flex: 1;
    overflow-y: auto;
}

.detail-label {
    text-align: center;
    color: #666;
    font-size: 16px;
    padding: 20px;
}

.star-details strong {
    color: #0ff;
}

/* Scan Confirmation Box */
.scan-confirm-box {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #0ff;
    padding: 10px 15px;
    font-size: 18px;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    box-shadow: 0 0 15px #0ff;
    pointer-events: auto;
    z-index: 100;
    animation: scanBoxAppear 0.3s ease-out;
}

@keyframes scanBoxAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scan-confirm-box button {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #0ff;
    color: #0ff;
    font-family: 'VT323', monospace;
    font-size: 20px;
    padding: 5px 15px;
    margin: 5px;
    cursor: pointer;
    text-shadow: 0 0 5px #0ff;
    transition: all 0.2s;
}

.scan-confirm-box button:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 10px #0ff;
}

.scan-confirm-box .star-name-label {
    margin-bottom: 10px;
    font-size: 16px;
    opacity: 0.8;
}

/* Star Grid */
.star-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.star-item {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid #0f0;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.star-item:hover {
    background: rgba(0, 255, 0, 0.15);
    box-shadow: 0 0 10px #0f0;
    transform: scale(1.05);
}

.star-item.analyzed {
    border-color: #ff0;
    color: #ff0;
    text-shadow: 0 0 5px #ff0;
}

.star-item.selected {
    border-color: #0ff;
    background: rgba(0, 255, 255, 0.12);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.5), inset 0 0 8px rgba(0, 255, 255, 0.1);
}

.star-item.contact {
    border-color: #f0f;
    color: #f0f;
    text-shadow: 0 0 5px #f0f;
    animation: pulse 2s infinite;
}

.star-item.star-recommended {
    border-color: #0ff;
    animation: recommendPulse 2s ease-in-out infinite;
}

@keyframes recommendPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 255, 0.2); }
    50% { box-shadow: 0 0 16px rgba(0, 255, 255, 0.5), inset 0 0 6px rgba(0, 255, 255, 0.1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.star-name {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 5px;
}

.star-coords {
    font-size: 16px;
    opacity: 0.7;
}

.star-status {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 14px;
}

/* Status Bar */
.status-bar {
    text-align: center;
    font-size: 20px;
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #0f0;
    background: rgba(0, 255, 0, 0.05);
}

/* Analysis View */
.analysis-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.target-info {
    font-size: 18px;
    padding: 15px;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid #0f0;
    flex: 0 0 250px;
    min-width: 250px;
}

.signal-display {
    flex: 1;
    text-align: center;
}

.waveform-and-contact-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.waveform-section {
    flex: 1;
}

.contact-protocol-box {
    flex: 0 0 280px;
    min-width: 280px;
    padding: 20px;
    border: 2px solid #f0f;
    background: rgba(255, 0, 255, 0.05);
    text-align: center;
}

#contact-protocol-content {
    margin-top: 15px;
}

.canvas-container {
    position: relative;
    margin: 20px auto;
    display: inline-block;
    width: 100%;
}

.canvas-label {
    font-size: 16px;
    color: #0f0;
    text-shadow: 0 0 3px #0f0;
    margin-bottom: 5px;
    letter-spacing: 2px;
    opacity: 0.8;
}

.spectrogram-label {
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
}

.canvas-container.scanning::after {
    content: "";
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 800px;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        #0f0 20%,
        #0ff 50%,
        #0f0 80%,
        transparent 100%);
    box-shadow: 0 0 10px #0f0;
    animation: scanning 2s linear infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes scanning {
    0% {
        top: 30px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: calc(100% - 10px);
        opacity: 0;
    }
}

canvas {
    border: 1px solid #0f0;
    background: rgba(0, 0, 0, 0.5);
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

canvas.active {
    box-shadow: 0 0 15px #0f0;
}

/* Signal Tuning Minigame */
.tuning-game {
    margin: 20px 0;
    padding: 20px;
    border: 2px solid #0ff;
    background: rgba(0, 255, 255, 0.05);
}

.tuning-header {
    margin-bottom: 20px;
}

.tuning-title {
    font-size: 22px;
    text-align: center;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.signal-strength-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.signal-strength-label {
    font-size: 16px;
    color: #0ff;
}

.signal-strength-bar {
    width: 300px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #0ff;
    position: relative;
    overflow: hidden;
}

.signal-strength-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f00 0%, #ff0 50%, #0f0 100%);
    transition: width 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.signal-strength-percent {
    font-size: 18px;
    color: #0ff;
    min-width: 50px;
    text-align: right;
}

.tuning-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.tuning-slider-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tuning-slider-group label {
    font-size: 18px;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    min-width: 120px;
    letter-spacing: 2px;
}

.tuning-slider {
    flex: 1;
    height: 6px;
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #0ff;
    outline: none;
    -webkit-appearance: none;
}

.tuning-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #0ff;
    cursor: pointer;
    box-shadow: 0 0 10px #0ff;
    border-radius: 2px;
}

.tuning-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #0ff;
    cursor: pointer;
    box-shadow: 0 0 10px #0ff;
    border-radius: 2px;
    border: none;
}

.slider-value {
    font-size: 18px;
    color: #0ff;
    min-width: 40px;
    text-align: right;
    font-family: 'VT323', monospace;
}

.tuning-instruction {
    text-align: center;
    font-size: 16px;
    color: #0ff;
    opacity: 0.8;
    margin-top: 15px;
}

.auto-tune-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(0, 255, 0, 0.08);
    border: 1px solid #0f0;
    color: #0f0;
    font-family: 'VT323', monospace;
    font-size: 14px;
    padding: 4px 12px;
    cursor: pointer;
    z-index: 50;
    transition: all 0.2s;
}

.auto-tune-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.4);
}

.auto-tune-btn:disabled {
    cursor: default;
    border-color: #060;
    color: #060;
}

/* Controls */
.controls {
    text-align: center;
    margin: 20px 0;
}

.btn {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #0f0;
    color: #0f0;
    font-family: 'VT323', monospace;
    font-size: 20px;
    padding: 10px 20px;
    margin: 0 10px;
    cursor: pointer;
    text-shadow: 0 0 3px #0f0;
    transition: all 0.2s;
}

.btn:hover:not(:disabled) {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px #0f0;
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.analysis-output {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #0f0;
    background: rgba(0, 255, 0, 0.05);
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 18px;
    text-align: left;
}

#analysis-text {
    line-height: 1.6;
    text-align: left;
}

/* Contact View */
.message-display {
    font-size: 22px;
    line-height: 1.8;
    padding: 30px;
    border: 2px solid #f0f;
    background: rgba(255, 0, 255, 0.05);
    margin: 20px 0;
    min-height: 400px;
    max-height: 800px;
    overflow-y: auto;
    color: #f0f;
    text-shadow: 0 0 5px #f0f;
}

.message-line {
    margin: 10px 0;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    white-space: pre;
    font-family: 'VT323', monospace;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Mailbox */
#mailbox-view.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mailbox-header {
    border: 2px solid #0ff;
    background: rgba(0, 255, 255, 0.05);
    padding: 10px 15px;
    margin-bottom: 10px;
    text-align: center;
}

.mailbox-info {
    color: #ff0;
    font-size: 16px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #ff0;
}

.mailbox-status {
    color: #0ff;
    font-size: 14px;
    text-shadow: 0 0 5px #0ff;
}

.mailbox-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.no-messages {
    text-align: center;
    color: #666;
    font-size: 18px;
    padding: 50px;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mail-item {
    border: 2px solid #0f0;
    background: rgba(0, 255, 0, 0.05);
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.mail-item:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 10px #0f0;
}

.mail-item.unread {
    border-color: #ff0;
    background: rgba(255, 255, 0, 0.05);
}

.mail-item.unread .mail-subject {
    color: #ff0;
    text-shadow: 0 0 2px #ff0;
}

.mail-item.read {
    border-color: #030;
    background: rgba(0, 255, 0, 0.02);
    opacity: 0.6;
}

.mail-item.read:hover {
    opacity: 0.85;
}

.mail-item.read .mail-from {
    color: #088;
}

.mail-item.read .mail-subject {
    color: #060;
    text-shadow: none;
}

.mail-item.read .mail-preview {
    color: #666;
}

.mail-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 1px solid #0f0;
    padding-bottom: 8px;
}

.mail-from {
    color: #0ff;
    font-weight: bold;
    text-shadow: 0 0 2px #0ff;
    font-size: 18px;
}

.mail-date {
    color: #aaa;
    font-size: 15px;
}

.mail-subject {
    color: #0f0;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 0 2px #0f0;
}

.mail-preview {
    color: #bbb;
    font-size: 18px;
    line-height: 1.6;
}

.mail-body {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #0f0;
    color: #0f0;
    font-size: 20px;
    line-height: 1.8;
    white-space: pre-wrap;
    display: none;
}

.mail-item.expanded .mail-body {
    display: block;
}

.mail-item.expanded .mail-preview {
    display: none;
}

/* ─────────── Journal View ─────────── */

.journal-header {
    border: 2px solid #0a0;
    background: rgba(0, 255, 0, 0.03);
    padding: 10px 15px;
    margin-bottom: 10px;
    text-align: center;
}

.journal-info {
    color: #0f0;
    font-size: 14px;
    margin-bottom: 10px;
    letter-spacing: 2px;
    opacity: 0.7;
}

.journal-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.journal-tab {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid #030;
    color: #060;
    padding: 6px 16px;
    font-family: 'VT323', monospace;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.2s;
}

.journal-tab:hover {
    border-color: #0a0;
    color: #0f0;
}

.journal-tab.active {
    border-color: #0f0;
    color: #0f0;
    background: rgba(0, 255, 0, 0.12);
    text-shadow: 0 0 5px #0f0;
}

.journal-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.journal-empty {
    text-align: center;
    color: #555;
    font-size: 18px;
    padding: 40px;
}

.journal-entry {
    border: 1px solid #030;
    background: rgba(0, 255, 0, 0.02);
    padding: 12px 15px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.journal-entry:hover {
    border-color: #0a0;
}

.journal-entry-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.journal-entry-star {
    color: #0ff;
    font-size: 17px;
    font-weight: bold;
}

.journal-entry-day {
    color: #555;
    font-size: 14px;
}

.journal-entry-title {
    color: #0f0;
    font-size: 20px;
    margin-bottom: 8px;
}

.journal-entry-content {
    color: #0a0;
    font-size: 17px;
    line-height: 1.7;
    opacity: 0.85;
    white-space: pre-wrap;
}

/* Terminal Log */
.terminal-log {
    border-top: 2px solid #0f0;
    padding-top: 8px;
    max-height: 80px;
}

.log-title {
    font-size: 16px;
    margin-bottom: 3px;
}

.log-content {
    font-size: 14px;
    max-height: 60px;
    overflow-y: auto;
}

.log-entry {
    margin: 2px 0;
    opacity: 0.7;
}

.log-entry.highlight {
    color: #ff0;
    text-shadow: 0 0 5px #ff0;
    opacity: 1;
}

/* Pattern Recognition Minigame */
.pattern-game {
    margin: 20px 0;
    padding: 20px;
    border: 2px solid #0ff;
    background: rgba(0, 255, 255, 0.05);
}

.pattern-header {
    margin-bottom: 15px;
    text-align: center;
}

.pattern-title {
    font-size: 22px;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.pattern-instruction {
    font-size: 14px;
    color: #0ff;
    opacity: 0.8;
}

/* Scrolling signal stream canvas */
.pattern-stream-wrap {
    text-align: center;
    padding: 10px 0;
}

#pattern-stream {
    border: 1px solid #0ff;
    background: #000;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.25);
    cursor: crosshair;
    width: 100%;
    max-width: 500px;
}

/* Capture slots row */
.pattern-captures {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 12px 0;
}

.capture-slot {
    position: relative;
    border: 2px solid #333;
    background: #000;
    padding: 0;
    transition: all 0.3s;
}

.capture-slot canvas {
    display: block;
}

.capture-slot.captured {
    border-color: #0f0;
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.5);
}

.capture-label {
    position: absolute;
    top: 2px;
    left: 5px;
    font-size: 10px;
    color: #555;
    letter-spacing: 1px;
    z-index: 1;
}

.capture-slot.captured .capture-label {
    color: #0f0;
}

/* Canvas drag selection (button removed — interaction is click-and-drag) */
#pattern-stream {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.pattern-status {
    text-align: center;
    font-size: 18px;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #0ff;
    background: rgba(0, 255, 255, 0.05);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #0f0;
    box-shadow: 0 0 5px #0f0;
}

/* White Mode Color Scheme */
body.white-mode .container,
body.white-mode .ascii-art,
body.white-mode .observatory-map,
body.white-mode .boot-output,
body.white-mode .boot-line:not(.error):not(.warning):not(.success) {
    color: #fff;
    text-shadow: none;
}

body.white-mode .header,
body.white-mode .terminal-log {
    border-color: #fff;
}

body.white-mode .name-input,
body.white-mode .btn {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

body.white-mode .btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px #fff;
}

body.white-mode .color-scheme-btn {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
    text-shadow: none;
}

body.white-mode .color-scheme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px #fff;
}

body.white-mode .name-input {
    background: rgba(255, 255, 255, 0.1);
    text-shadow: none;
}

body.white-mode .name-input:focus {
    box-shadow: 0 0 15px #fff;
    background: rgba(255, 255, 255, 0.15);
}

body.white-mode .name-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

body.white-mode .instruction,
body.white-mode .status-bar,
body.white-mode .star-item,
body.white-mode .target-info,
body.white-mode .analysis-output,
body.white-mode .starmap-container,
body.white-mode .star-info-panel {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

body.white-mode .star-info-title {
    color: #fff;
    text-shadow: none;
    border-bottom-color: #fff;
}

body.white-mode #star-visual {
    border-color: #fff;
}

body.white-mode .star-details {
    color: #fff;
}

body.white-mode .star-item:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px #fff;
}

body.white-mode .star-item.selected {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px #fff;
}

body.white-mode .canvas-label,
body.white-mode .start-ascii,
body.white-mode .start-info {
    color: #fff;
    text-shadow: none;
}

body.white-mode .mail-item {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

body.white-mode .mail-item:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px #fff;
}

body.white-mode .mail-subject,
body.white-mode .mail-body {
    color: #fff;
    text-shadow: none;
}

body.white-mode .mail-header {
    border-bottom-color: #fff;
}

body.white-mode .capture-slot {
    border-color: #fff;
}

body.white-mode .capture-slot.captured {
    border-color: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

body.white-mode canvas {
    border-color: #fff;
}

body.white-mode ::-webkit-scrollbar-thumb {
    background: #fff;
    box-shadow: 0 0 5px #fff;
}

/* ========================================
   DISH ARRAY STYLES
   ======================================== */

/* Catalog Header with Array Button */
.catalog-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 10px;
}

.catalog-header h3 {
    margin: 20px 0 15px 0 !important;
}

/* Array Status Button */
.array-status-btn {
    position: absolute;
    right: 0;
    background: rgba(255, 165, 0, 0.1);
    border: 2px solid #ffa500;
    color: #ffa500;
    text-shadow: 0 0 5px #ffa500;
    font-size: 14px;
    padding: 8px 15px;
}

.array-status-btn:hover {
    background: rgba(255, 165, 0, 0.2);
    box-shadow: 0 0 15px #ffa500;
}

.array-icon {
    margin-right: 5px;
}

.aligned-count {
    margin-left: 10px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #ffa500;
    font-size: 12px;
}

/* Weak Signal Star Indicator */
.star-item.weak-signal {
    border-color: #ffa500;
    background: rgba(255, 165, 0, 0.05);
    position: relative;
}

.star-item.weak-signal::before {
    content: '~ WEAK ~';
    position: absolute;
    top: 3px;
    right: 5px;
    font-size: 10px;
    color: #ffa500;
    text-shadow: 0 0 3px #ffa500;
}

.star-item.weak-signal:hover {
    background: rgba(255, 165, 0, 0.1);
    box-shadow: 0 0 10px #ffa500;
}

/* Array View */
.array-header {
    border: 2px solid #ffa500;
    background: rgba(255, 165, 0, 0.05);
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.array-info {
    color: #ffa500;
    font-size: 16px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #ffa500;
}

.array-target {
    color: #0ff;
    font-size: 18px;
    text-shadow: 0 0 5px #0ff;
}

.array-container {
    display: flex;
    gap: 30px;
    margin: 20px 0;
    align-items: flex-start;
    justify-content: center;
}

/* Array Tutorial */
.array-tutorial {
    border: 1px solid #ffa500;
    background: rgba(255, 165, 0, 0.05);
    padding: 12px 20px;
    margin-bottom: 15px;
}

.tutorial-title {
    color: #ffa500;
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-align: center;
}

.tutorial-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    justify-content: center;
}

.tutorial-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #888;
}

.step-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.step-text {
    color: #aaa;
}

/* Array Button Row */
.array-button-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 15px;
}

.array-scan-btn {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0f0;
    color: #0f0;
    animation: scanBtnPulse 1.5s ease-in-out infinite;
}

.array-scan-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 20px #0f0;
}

@keyframes scanBtnPulse {
    0%, 100% { box-shadow: 0 0 5px #0f0; }
    50% { box-shadow: 0 0 15px #0f0, 0 0 25px rgba(0, 255, 0, 0.5); }
}

.array-visual {
    flex: 0 0 420px;
    border: 2px solid #ffa500;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
}

.array-svg {
    width: 100%;
    height: auto;
}

.array-arm {
    stroke: #333;
    stroke-width: 2;
    stroke-dasharray: 5, 5;
}

/* Individual Dish Styling */
.dish-element {
    cursor: pointer;
    transition: all 0.3s ease;
}

.dish-base {
    fill: #222;
    stroke: #ffa500;
    stroke-width: 2;
}

.dish-bowl {
    fill: rgba(255, 165, 0, 0.1);
    stroke: #ffa500;
    stroke-width: 2;
    transform-origin: center;
    transition: transform 0.1s linear;
}

.dish-element:hover .dish-base {
    fill: #333;
    stroke-width: 3;
}

.dish-element.rotating .dish-bowl {
    /* No animation - just visual state change */
}

.dish-element.aligned .dish-bowl {
    fill: rgba(0, 255, 0, 0.2);
    stroke: #0f0;
}

.dish-element.aligned .dish-base {
    stroke: #0f0;
}

@keyframes dishRotate {
    0% { transform: rotate(15deg); }
    100% { transform: rotate(0deg); }
}

.dish-label {
    fill: #ffa500;
    font-family: 'VT323', monospace;
    font-size: 14px;
    text-anchor: middle;
}

.dish-power-cost {
    fill: #666;
    font-family: 'VT323', monospace;
    font-size: 11px;
    text-anchor: middle;
}

.dish-element.powered .dish-power-cost {
    fill: #0ff;
}

.dish-element.aligned .dish-power-cost {
    fill: #0f0;
}

.dish-element.aligned .dish-label {
    fill: #0f0;
}

/* Array Controls Panel */
.array-controls {
    flex: 0 0 300px;
    border: 2px solid #ffa500;
    background: rgba(255, 165, 0, 0.03);
    padding: 20px;
}

.array-stats {
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 165, 0, 0.3);
}

.stat-label {
    color: #ffa500;
    font-size: 16px;
    min-width: 150px;
}

.stat-value {
    color: #0ff;
    font-size: 20px;
    text-shadow: 0 0 5px #0ff;
}

.stat-separator, .stat-total {
    color: #666;
    font-size: 20px;
    margin: 0 5px;
}

.array-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.array-actions .btn {
    width: 100%;
    background: rgba(255, 165, 0, 0.1);
    border-color: #ffa500;
    color: #ffa500;
}

.array-actions .btn:hover:not(:disabled) {
    background: rgba(255, 165, 0, 0.2);
    box-shadow: 0 0 10px #ffa500;
}

.array-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.array-status-bar {
    text-align: center;
    font-size: 18px;
    color: #ffa500;
    padding: 15px;
    border: 1px solid #ffa500;
    background: rgba(255, 165, 0, 0.05);
    margin: 20px 0;
}

.array-status-bar.ready {
    color: #0f0;
    border-color: #0f0;
    background: rgba(0, 255, 0, 0.05);
}

.array-status-bar.insufficient {
    color: #f00;
    border-color: #f00;
    background: rgba(255, 0, 0, 0.05);
}

/* Tuning Panel Inline Array Display */
.tuning-array-panel {
    margin-top: 20px;
    padding: 15px;
    border: 2px solid #ffa500;
    background: rgba(255, 165, 0, 0.05);
}

.panel-title {
    color: #ffa500;
    font-size: 18px;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.mini-array-visual {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
}

.mini-dish {
    width: 35px;
    height: 35px;
    border: 2px solid #ffa500;
    border-radius: 50%;
    background: rgba(255, 165, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    color: #ffa500;
    cursor: pointer;
    transition: all 0.3s;
}

.mini-power {
    font-size: 8px;
    color: #0ff;
    margin-top: 1px;
}

.mini-dish:hover {
    background: rgba(255, 165, 0, 0.2);
    transform: scale(1.1);
}

.mini-dish.rotating {
    animation: miniDishPulse 0.5s ease-in-out infinite;
    border-color: #ff0;
    color: #ff0;
}

.mini-dish.aligned {
    border-color: #0f0;
    background: rgba(0, 255, 0, 0.2);
    color: #0f0;
    box-shadow: 0 0 10px #0f0;
}

/* Interference state - dish has signal noise that must be cleared */
.dish-element.interference .dish-bowl {
    fill: rgba(255, 0, 0, 0.2);
    stroke: #f00;
    animation: interferenceFlicker 0.3s ease-in-out infinite;
}

.dish-element.interference .dish-base {
    stroke: #f00;
}

.dish-element.interference .dish-label {
    fill: #f00;
}

@keyframes interferenceFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes warningPulse {
    0%, 100% {
        border-color: #ffa500;
        box-shadow: 0 0 5px rgba(255, 165, 0, 0.3);
    }
    50% {
        border-color: #ff6600;
        box-shadow: 0 0 15px rgba(255, 165, 0, 0.6);
    }
}

.mini-dish.interference {
    border-color: #f00;
    background: rgba(255, 0, 0, 0.2);
    color: #f00;
    animation: interferenceFlicker 0.3s ease-in-out infinite;
}

/* Powered state - dish is online but not yet aligned */
.dish-element.powered .dish-bowl {
    fill: rgba(0, 255, 255, 0.15);
    stroke: #0ff;
}

.dish-element.powered .dish-base {
    stroke: #0ff;
}

.dish-element.powered .dish-label {
    fill: #0ff;
}

.mini-dish.powered {
    border-color: #0ff;
    background: rgba(0, 255, 255, 0.15);
    color: #0ff;
}

/* Power indicator styling */
.power-indicator {
    color: #0ff;
    font-size: 14px;
    text-align: center;
    margin-top: 8px;
}

.power-indicator.at-limit {
    color: #f00;
    animation: interferenceFlicker 0.5s ease-in-out infinite;
}

@keyframes miniDishPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

.array-boost-display {
    text-align: center;
    margin-top: 10px;
}

.boost-label {
    color: #ffa500;
    font-size: 14px;
}

.boost-value {
    color: #0ff;
    font-size: 20px;
    text-shadow: 0 0 5px #0ff;
    margin-left: 10px;
}

.dish-status-text {
    text-align: center;
    color: #ffa500;
    font-size: 14px;
    margin-top: 10px;
}

/* White mode overrides for array */
body.white-mode .array-status-btn,
body.white-mode .array-header,
body.white-mode .array-visual,
body.white-mode .array-controls,
body.white-mode .array-status-bar,
body.white-mode .tuning-array-panel {
    border-color: #fff;
}

body.white-mode .array-status-btn,
body.white-mode .array-info,
body.white-mode .stat-label,
body.white-mode .panel-title,
body.white-mode .boost-label,
body.white-mode .dish-status-text {
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

body.white-mode .array-arm {
    stroke: #444;
}

body.white-mode .dish-base {
    stroke: #fff;
}

body.white-mode .dish-bowl {
    stroke: #fff;
    fill: rgba(255, 255, 255, 0.1);
}

body.white-mode .dish-label {
    fill: #fff;
}

body.white-mode .mini-dish {
    border-color: #fff;
    color: #fff;
}

body.white-mode .star-item.weak-signal {
    border-color: #fff;
}

body.white-mode .star-item.weak-signal::before {
    color: #fff;
    text-shadow: 0 0 3px #fff;
}

/* White mode - interference stays red for visibility */
body.white-mode .dish-element.interference .dish-bowl {
    stroke: #f66;
    fill: rgba(255, 100, 100, 0.2);
}

body.white-mode .dish-element.interference .dish-base {
    stroke: #f66;
}

body.white-mode .mini-dish.interference {
    border-color: #f66;
    background: rgba(255, 100, 100, 0.2);
    color: #f66;
}

/* White mode - powered state */
body.white-mode .dish-element.powered .dish-bowl,
body.white-mode .dish-element.powered .dish-base {
    stroke: #fff;
}

body.white-mode .mini-dish.powered {
    border-color: #fff;
    color: #fff;
}

body.white-mode .array-tutorial {
    border-color: #fff;
}

body.white-mode .tutorial-title {
    color: #fff;
}

body.white-mode .step-text {
    color: #ccc;
}

body.white-mode .array-scan-btn {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

body.white-mode .power-indicator {
    color: #fff;
}

/* === FINAL REPORT STYLES === */
.report-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    border: 2px solid #0f0;
    background: rgba(0, 20, 0, 0.9);
    max-height: 80vh;
    overflow-y: auto;
}

.report-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0f0;
}

.report-classification {
    color: #f00;
    font-size: 14px;
    letter-spacing: 3px;
    margin-bottom: 10px;
    animation: classifiedPulse 2s ease-in-out infinite;
}

@keyframes classifiedPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.report-meta {
    color: #0ff;
    font-size: 14px;
    line-height: 1.8;
    margin-top: 15px;
}

.report-section {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #0f0;
    background: rgba(0, 50, 0, 0.3);
}

.report-section.classified {
    border-color: #f00;
    background: rgba(50, 0, 0, 0.3);
}

.report-section-title {
    color: #0ff;
    font-size: 16px;
    letter-spacing: 2px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #0f0;
}

.report-section.classified .report-section-title {
    color: #f00;
    border-color: #f00;
}

.classified-badge {
    background: #f00;
    color: #000;
    padding: 2px 8px;
    margin-right: 10px;
    font-size: 12px;
    animation: classifiedPulse 1s ease-in-out infinite;
}

.report-content {
    color: #0f0;
    font-size: 14px;
    line-height: 1.8;
}

.report-scrollable {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.report-star-entry {
    padding: 8px 0;
    border-bottom: 1px dotted rgba(0, 255, 0, 0.3);
}

.report-star-entry:last-child {
    border-bottom: none;
}

.report-star-name {
    color: #0ff;
    font-size: 15px;
}

.report-star-result {
    color: #0f0;
    font-size: 13px;
    margin-left: 15px;
}

.report-star-result.contact {
    color: #f0f;
    text-shadow: 0 0 5px #f0f;
}

.report-star-result.false-positive {
    color: #ff0;
}

.report-star-result.natural {
    color: #0ff;
}

.operator-notes {
    font-style: italic;
    color: #ff0;
    white-space: pre-wrap;
}

.report-footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 2px solid #0f0;
    text-align: center;
}

.report-signature {
    color: #0ff;
    font-size: 14px;
    margin-bottom: 20px;
}

.report-submit-btn {
    background: rgba(0, 100, 0, 0.3);
    border: 2px solid #0f0;
    color: #0f0;
    padding: 15px 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.report-submit-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 20px #0f0;
    text-shadow: 0 0 10px #0f0;
}

/* === END SCREEN STYLES === */
#end-view.active {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Survey Complete Popup */
.survey-complete-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.survey-complete-content {
    background: linear-gradient(135deg, #001a00 0%, #003300 50%, #001a00 100%);
    border: 3px solid #0f0;
    border-radius: 10px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 0 30px #0f0, inset 0 0 20px rgba(0, 255, 0, 0.1);
    animation: popupPulse 2s ease-in-out infinite;
}

@keyframes popupPulse {
    0%, 100% { box-shadow: 0 0 30px #0f0, inset 0 0 20px rgba(0, 255, 0, 0.1); }
    50% { box-shadow: 0 0 50px #0f0, inset 0 0 30px rgba(0, 255, 0, 0.2); }
}

.survey-complete-icon {
    font-size: 60px;
    color: #ff0;
    text-shadow: 0 0 20px #ff0, 0 0 40px #ff0;
    margin-bottom: 20px;
    animation: starPulse 1s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.survey-complete-title {
    font-family: 'VT323', monospace;
    font-size: 42px;
    color: #0f0;
    text-shadow: 0 0 15px #0f0;
    letter-spacing: 5px;
    margin-bottom: 20px;
}

.survey-complete-stats {
    margin: 25px 0;
    padding: 15px;
    border: 1px dashed #0f0;
    background: rgba(0, 50, 0, 0.5);
}

.survey-stat {
    font-family: 'VT323', monospace;
    font-size: 24px;
    color: #0ff;
    text-shadow: 0 0 10px #0ff;
    margin-bottom: 10px;
}

.survey-stat-detail {
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: #f0f;
    text-shadow: 0 0 10px #f0f;
}

.survey-complete-message {
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: #ff0;
    margin: 25px 0;
    letter-spacing: 1px;
}

.survey-submit-btn {
    font-size: 20px;
    padding: 15px 40px;
    background: linear-gradient(180deg, #004400 0%, #002200 100%);
    border: 2px solid #0f0;
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: btnGlow 1.5s ease-in-out infinite;
}

@keyframes btnGlow {
    0%, 100% { box-shadow: 0 0 10px #0f0; }
    50% { box-shadow: 0 0 25px #0f0, 0 0 35px #0f0; }
}

.survey-submit-btn:hover {
    background: linear-gradient(180deg, #006600 0%, #003300 100%);
    transform: scale(1.05);
}

.end-screen {
    text-align: center;
}

@keyframes fadeInEnd {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.end-text {
    font-family: 'VT323', monospace;
    color: #0f0;
    text-shadow: 0 0 20px #0f0, 0 0 40px #0f0;
}

.end-day {
    font-size: 72px;
    letter-spacing: 10px;
    margin-bottom: 30px;
    opacity: 0;
}

#end-view.active .end-day {
    animation: fadeInEnd 2s ease-out forwards, textGlow 2s ease-in-out infinite;
}

.end-continued {
    font-size: 36px;
    letter-spacing: 5px;
    opacity: 0;
}

#end-view.active .end-continued {
    animation: fadeInContinued 2s ease-out 2s forwards;
}

@keyframes fadeInContinued {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 20px #0f0, 0 0 40px #0f0; }
    50% { text-shadow: 0 0 30px #0f0, 0 0 60px #0f0, 0 0 80px #0f0; }
}

.end-restart-btn {
    margin-top: 50px;
    opacity: 0;
    background: transparent;
    border: 2px solid #0f0;
    color: #0f0;
    padding: 15px 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

#end-view.active .end-restart-btn {
    animation: fadeInContinued 1s ease-out 4s forwards;
}

.end-restart-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 30px #0f0;
}

/* Fade overlay for transition */
.fade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 2s ease-in-out;
}

.fade-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* White mode overrides for report */
body.white-mode .report-container {
    border-color: #fff;
    background: rgba(20, 20, 20, 0.95);
}

body.white-mode .report-header {
    border-color: #fff;
}

body.white-mode .report-section {
    border-color: #fff;
}

body.white-mode .report-section-title {
    color: #fff;
    border-color: #fff;
}

body.white-mode .report-content {
    color: #fff;
}

body.white-mode .report-star-name {
    color: #fff;
}

body.white-mode .report-footer {
    border-color: #fff;
}

body.white-mode .report-submit-btn {
    border-color: #fff;
    color: #fff;
}

body.white-mode .end-text {
    color: #fff;
    text-shadow: 0 0 20px #fff, 0 0 40px #fff;
}

body.white-mode .end-restart-btn {
    border-color: #fff;
    color: #fff;
}

/* ============================================
   LAYOUT TOGGLE BUTTON
   ============================================ */

.layout-toggle-btn {
    background: transparent;
    border: 1px solid #0f0;
    color: #0f0;
    padding: 4px 8px;
    font-family: 'VT323', monospace;
    font-size: 13px;
    cursor: pointer;
    margin-left: 0;
    transition: all 0.3s;
}

.layout-toggle-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px #0f0;
}

body.white-mode .layout-toggle-btn {
    border-color: #fff;
    color: #fff;
}

body.white-mode .layout-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px #fff;
}

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

/* Mobile layout applies when:
   - Screen is ≤768px AND not forcing desktop
   - OR forcing mobile on any screen size */

/* Base mobile container fixes */
@media (max-width: 768px) {
    body:not(.force-desktop) {
        overflow-x: hidden;
    }

    body:not(.force-desktop) .crt {
        width: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    body:not(.force-desktop) .container {
        height: auto;
        min-height: 100vh;
        overflow: visible;
        padding: 10px;
    }

    /* Header mobile */
    body:not(.force-desktop) .header {
        padding: 10px;
    }

    body:not(.force-desktop) .ascii-art {
        font-size: 8px;
        line-height: 1.1;
        display: none;
    }

    body:not(.force-desktop) .system-time {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 12px;
        justify-content: center;
    }

    body:not(.force-desktop) .system-time > span:first-child {
        display: none;
    }

    body:not(.force-desktop) .audio-settings-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    body:not(.force-desktop) .color-scheme-btn,
    body:not(.force-desktop) .mailbox-btn,
    body:not(.force-desktop) .layout-toggle-btn {
        padding: 8px 12px;
        font-size: 12px;
        margin-left: 5px;
    }

    /* Main content mobile -- remove competing scroll container */
    body:not(.force-desktop) .main-content {
        height: auto;
        min-height: calc(100vh - 150px);
        overflow-y: visible;
        overflow-x: hidden;
    }

    /* Start screen mobile */
    body:not(.force-desktop) .start-screen {
        padding: 20px 10px;
    }

    body:not(.force-desktop) .start-ascii {
        font-size: 6px;
        line-height: 1.1;
        transform: scale(0.7);
        margin: -20px 0;
    }

    body:not(.force-desktop) .start-info {
        font-size: 14px;
    }

    body:not(.force-desktop) .start-info p {
        margin: 5px 0;
    }

    body:not(.force-desktop) .start-btn {
        font-size: 16px;
        padding: 12px 30px;
        width: 90%;
        max-width: 300px;
    }

    body:not(.force-desktop) .copyright-notice {
        font-size: 10px;
        margin-top: 20px;
    }

    /* Boot view mobile */
    body:not(.force-desktop) .boot-terminal {
        max-width: 100%;
        padding: 15px;
    }

    body:not(.force-desktop) .boot-content-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    body:not(.force-desktop) .boot-left,
    body:not(.force-desktop) .boot-right {
        width: 100%;
    }

    body:not(.force-desktop) .boot-output {
        min-height: 250px;
        max-height: 300px;
        font-size: 12px;
    }

    body:not(.force-desktop) .name-input {
        width: 100% !important;
        max-width: 280px;
    }

    body:not(.force-desktop) .boot-proceed-btn {
        width: 100%;
        max-width: 280px;
    }

    /* Starmap view mobile */
    body:not(.force-desktop) .starmap-section {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }

    /* Starmap array panel mobile */
    body:not(.force-desktop) .starmap-array-panel {
        flex: none;
        width: 100%;
        min-width: auto;
        height: auto;
        padding: 10px;
        order: -1; /* Show at top on mobile */
    }

    body:not(.force-desktop) .starmap-array-visual {
        min-height: 120px;
    }

    body:not(.force-desktop) .starmap-array-svg {
        max-width: 180px;
    }

    body:not(.force-desktop) .starmap-array-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-around;
    }

    body:not(.force-desktop) .starmap-array-stat {
        flex: 0 0 auto;
    }

    body:not(.force-desktop) .starmap-canvas-container {
        width: 100%;
        height: 250px;
    }

    body:not(.force-desktop) #starmap {
        width: 100%;
        height: 250px;
    }

    body:not(.force-desktop) .star-info-panel {
        flex: none;
        width: 100%;
        min-width: auto;
        height: auto;
        max-height: 400px;
        padding: 15px;
    }

    body:not(.force-desktop) .star-info-content h3 {
        font-size: 20px;
    }

    body:not(.force-desktop) .star-info-content p {
        font-size: 14px;
        margin: 8px 0;
    }

    body:not(.force-desktop) .star-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
        max-height: none;
    }

    body:not(.force-desktop) .star-btn {
        padding: 10px 8px;
        font-size: 12px;
    }

    body:not(.force-desktop) .scan-btn {
        width: 100%;
        font-size: 16px;
        padding: 12px 20px;
        margin-top: 10px;
    }

    body:not(.force-desktop) .array-status-btn {
        width: 100%;
        font-size: 14px;
        padding: 10px 15px;
    }

    /* Star visual mobile */
    body:not(.force-desktop) .star-visual-container {
        margin: 10px auto;
    }

    body:not(.force-desktop) #star-visual {
        width: 100px;
        height: 100px;
    }

    /* Weak signal warning mobile */
    body:not(.force-desktop) .weak-signal-warning {
        font-size: 12px;
        padding: 8px 12px;
    }

    /* Analysis view mobile */
    body:not(.force-desktop) .analysis-layout {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }

    body:not(.force-desktop) .target-info {
        flex: none;
        width: 100%;
        min-width: auto;
        padding: 15px;
    }

    body:not(.force-desktop) .target-info h3 {
        font-size: 18px;
    }

    body:not(.force-desktop) .target-info p {
        font-size: 13px;
    }

    body:not(.force-desktop) .waveform-and-contact-container {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    body:not(.force-desktop) .waveform-container {
        width: 100%;
    }

    body:not(.force-desktop) .contact-protocol-box {
        flex: none;
        width: 100%;
        min-width: auto;
        padding: 15px;
    }

    body:not(.force-desktop) #waveform {
        height: 120px;
    }

    body:not(.force-desktop) #spectrogram {
        height: 80px;
    }

    /* Tuning game mobile */
    body:not(.force-desktop) #tuning-game {
        padding: 15px;
    }

    body:not(.force-desktop) .tuning-controls {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    body:not(.force-desktop) .signal-strength-bar {
        width: 80%;
        max-width: 300px;
    }

    body:not(.force-desktop) .tuning-sliders {
        width: 100%;
    }

    body:not(.force-desktop) .tuning-sliders input[type="range"] {
        width: 100%;
    }

    body:not(.force-desktop) .tuning-feedback {
        font-size: 14px;
    }

    body:not(.force-desktop) .lock-btn {
        width: 80%;
        max-width: 250px;
        font-size: 16px;
        padding: 12px 20px;
    }

    /* Tuning array panel mobile */
    body:not(.force-desktop) .tuning-array-panel {
        padding: 10px;
        margin-top: 10px;
    }

    body:not(.force-desktop) .mini-dish-container {
        gap: 8px;
    }

    body:not(.force-desktop) .mini-dish {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }

    /* Pattern game mobile */
    body:not(.force-desktop) .pattern-game {
        padding: 15px;
    }

    body:not(.force-desktop) .pattern-captures {
        gap: 8px;
    }

    body:not(.force-desktop) .capture-slot canvas {
        width: 110px;
        height: 40px;
    }

    body:not(.force-desktop) .band-buttons {
        gap: 5px;
    }

    body:not(.force-desktop) .band-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    /* Array view mobile */
    body:not(.force-desktop) .array-container {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }

    body:not(.force-desktop) .array-visual {
        flex: none;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    body:not(.force-desktop) .array-visual svg {
        width: 100%;
        height: auto;
    }

    body:not(.force-desktop) .array-controls {
        flex: none;
        width: 100%;
        padding: 15px;
    }

    body:not(.force-desktop) .array-controls h3 {
        font-size: 18px;
    }

    body:not(.force-desktop) .array-stat {
        font-size: 14px;
    }

    body:not(.force-desktop) .array-btn {
        width: 100%;
        font-size: 14px;
        padding: 12px 20px;
    }

    /* Array tutorial mobile */
    body:not(.force-desktop) .array-tutorial {
        padding: 10px;
        font-size: 12px;
    }

    body:not(.force-desktop) .tutorial-step {
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Message display mobile */
    body:not(.force-desktop) .message-display {
        min-height: 200px;
        max-height: 350px;
        padding: 15px;
        font-size: 14px;
    }

    body:not(.force-desktop) .analysis-buttons {
        flex-direction: column;
        gap: 10px;
    }

    body:not(.force-desktop) .analysis-buttons .btn {
        width: 100%;
    }

    /* Mailbox mobile */
    body:not(.force-desktop) .mailbox-container {
        padding: 15px;
    }

    body:not(.force-desktop) .mailbox-content {
        flex: 1;
    }

    body:not(.force-desktop) .mail-item {
        padding: 10px;
        font-size: 13px;
    }

    body:not(.force-desktop) .mail-body {
        font-size: 12px;
        padding: 10px;
    }

    /* Report view mobile */
    body:not(.force-desktop) .report-container {
        max-width: 100%;
        padding: 15px;
        margin: 10px;
    }

    body:not(.force-desktop) .report-header h2 {
        font-size: 20px;
    }

    body:not(.force-desktop) .report-classification {
        font-size: 12px;
    }

    body:not(.force-desktop) .report-meta {
        font-size: 12px;
    }

    body:not(.force-desktop) .report-section-title {
        font-size: 16px;
    }

    body:not(.force-desktop) .report-content {
        font-size: 13px;
        padding: 10px;
    }

    body:not(.force-desktop) .report-scrollable {
        max-height: 200px;
    }

    body:not(.force-desktop) .report-submit-btn {
        width: 100%;
        font-size: 16px;
        padding: 12px 20px;
    }

    /* End screen mobile */
    body:not(.force-desktop) .end-day {
        font-size: 40px;
        letter-spacing: 5px;
    }

    body:not(.force-desktop) .end-continued {
        font-size: 24px;
        letter-spacing: 3px;
    }

    body:not(.force-desktop) .end-restart-btn {
        padding: 12px 30px;
        font-size: 16px;
    }

    /* Survey complete popup mobile */
    body:not(.force-desktop) .survey-complete-content {
        padding: 25px 20px;
        margin: 15px;
        max-width: calc(100% - 30px);
    }

    body:not(.force-desktop) .survey-complete-icon {
        font-size: 40px;
    }

    body:not(.force-desktop) .survey-complete-title {
        font-size: 28px;
        letter-spacing: 3px;
    }

    body:not(.force-desktop) .survey-stat {
        font-size: 18px;
    }

    body:not(.force-desktop) .survey-stat-detail {
        font-size: 14px;
    }

    body:not(.force-desktop) .survey-complete-message {
        font-size: 14px;
    }

    body:not(.force-desktop) .survey-submit-btn {
        width: 100%;
        font-size: 16px;
        padding: 12px 30px;
    }

    /* Terminal log mobile */
    body:not(.force-desktop) .terminal-log {
        max-height: 100px;
        font-size: 11px;
    }

    body:not(.force-desktop) .log-entry {
        font-size: 11px;
    }
}

/* Extra small screens (375px and below) */
@media (max-width: 375px) {
    body:not(.force-desktop) .start-ascii {
        transform: scale(0.5);
        margin: -40px 0;
    }

    body:not(.force-desktop) .star-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    body:not(.force-desktop) .pattern-captures {
        flex-wrap: wrap;
    }

    body:not(.force-desktop) .survey-complete-title {
        font-size: 22px;
    }
}

/* Force mobile layout on any screen */
body.force-mobile {
    overflow-x: hidden;
}

body.force-mobile .crt {
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

body.force-mobile .container {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 10px;
}

body.force-mobile .header {
    padding: 10px;
}

body.force-mobile .ascii-art {
    display: none;
}

body.force-mobile .system-time {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    justify-content: center;
}

body.force-mobile .system-time > span:first-child {
    display: none;
}

body.force-mobile .audio-settings-btn {
    padding: 8px 12px;
    font-size: 12px;
}

body.force-mobile .color-scheme-btn,
body.force-mobile .mailbox-btn,
body.force-mobile .layout-toggle-btn {
    padding: 8px 12px;
    font-size: 12px;
    margin-left: 5px;
}

body.force-mobile .main-content {
    height: auto;
    min-height: calc(100vh - 150px);
}

body.force-mobile .start-screen {
    padding: 20px 10px;
}

body.force-mobile .start-ascii {
    font-size: 6px;
    line-height: 1.1;
    transform: scale(0.7);
    margin: -20px 0;
}

body.force-mobile .start-info {
    font-size: 14px;
}

body.force-mobile .start-btn {
    font-size: 16px;
    padding: 12px 30px;
    width: 90%;
    max-width: 300px;
}

body.force-mobile .boot-terminal {
    max-width: 100%;
    padding: 15px;
}

body.force-mobile .boot-content-wrapper {
    flex-direction: column;
    gap: 20px;
}

body.force-mobile .boot-left,
body.force-mobile .boot-right {
    width: 100%;
}

body.force-mobile .boot-output {
    min-height: 250px;
    max-height: 300px;
    font-size: 12px;
}

body.force-mobile .name-input {
    width: 100% !important;
    max-width: 280px;
}

body.force-mobile .starmap-section {
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}

body.force-mobile .starmap-array-panel {
    flex: none;
    width: 100%;
    min-width: auto;
    height: auto;
    padding: 10px;
    order: -1;
}

body.force-mobile .starmap-array-visual {
    min-height: 120px;
}

body.force-mobile .starmap-array-svg {
    max-width: 180px;
}

body.force-mobile .starmap-array-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-around;
}

body.force-mobile .starmap-array-stat {
    flex: 0 0 auto;
}

body.force-mobile .starmap-canvas-container {
    width: 100%;
    height: 250px;
}

body.force-mobile #starmap {
    width: 100%;
    height: 250px;
}

body.force-mobile .star-info-panel {
    flex: none;
    width: 100%;
    min-width: auto;
    height: auto;
    max-height: 400px;
    padding: 15px;
}

body.force-mobile .star-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    max-height: none;
}

body.force-mobile .star-btn {
    padding: 10px 8px;
    font-size: 12px;
}

body.force-mobile .scan-btn {
    width: 100%;
    font-size: 16px;
    padding: 12px 20px;
}

body.force-mobile .analysis-layout {
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}

body.force-mobile .target-info {
    flex: none;
    width: 100%;
    min-width: auto;
}

body.force-mobile .waveform-and-contact-container {
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

body.force-mobile .contact-protocol-box {
    flex: none;
    width: 100%;
    min-width: auto;
}

body.force-mobile #tuning-game {
    padding: 15px;
}

body.force-mobile .tuning-controls {
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

body.force-mobile .signal-strength-bar {
    width: 80%;
    max-width: 300px;
}

body.force-mobile .tuning-sliders {
    width: 100%;
}

body.force-mobile .tuning-sliders input[type="range"] {
    width: 100%;
}

body.force-mobile .lock-btn {
    width: 80%;
    max-width: 250px;
}

body.force-mobile .pattern-captures {
    flex-wrap: wrap;
    gap: 8px;
}

body.force-mobile .array-container {
    flex-direction: column;
    gap: 20px;
    padding: 15px;
}

body.force-mobile .array-visual {
    flex: none;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

body.force-mobile .array-controls {
    flex: none;
    width: 100%;
}

body.force-mobile .message-display {
    min-height: 200px;
    max-height: 350px;
}

body.force-mobile .analysis-buttons {
    flex-direction: column;
    gap: 10px;
}

body.force-mobile .analysis-buttons .btn {
    width: 100%;
}

body.force-mobile .report-container {
    max-width: 100%;
    padding: 15px;
    margin: 10px;
}

body.force-mobile .report-scrollable {
    max-height: 200px;
}

body.force-mobile .report-submit-btn {
    width: 100%;
}

body.force-mobile .end-day {
    font-size: 40px;
}

body.force-mobile .end-continued {
    font-size: 24px;
}

body.force-mobile .survey-complete-content {
    padding: 25px 20px;
    margin: 15px;
    max-width: calc(100% - 30px);
}

body.force-mobile .terminal-log {
    max-height: 100px;
    font-size: 11px;
}

/* Touch optimization */
@media (max-width: 768px) {
    body:not(.force-desktop) .btn,
    body:not(.force-desktop) .star-btn,
    body:not(.force-desktop) .band-btn,
    body:not(.force-desktop) .array-btn {
        min-height: 44px;
    }

    body:not(.force-desktop) input[type="range"] {
        height: 30px;
    }

    body:not(.force-desktop) input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
}

body.force-mobile .btn,
body.force-mobile .star-btn,
body.force-mobile .band-btn,
body.force-mobile .array-btn {
    min-height: 44px;
}

body.force-mobile input[type="range"] {
    height: 30px;
}

body.force-mobile input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
}

/* ============================================
   DECRYPTION MINIGAME ANIMATIONS
   ============================================ */

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
        border-color: #0f0;
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 255, 0, 0.8), 0 0 35px rgba(0, 255, 0, 0.4);
        border-color: #0ff;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   INTERACTIVE DAY REPORT CLASSIFICATION FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

.classification-panel {
    border: 2px solid #0f0;
    background: #000;
    max-width: 650px;
    width: 100%;
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.3);
}

.classification-header {
    background: linear-gradient(180deg, #020 0%, #010 100%);
    border-bottom: 2px solid #0f0;
    padding: 15px 20px;
    color: #0f0;
    font-size: 20px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #0f0;
}

.classification-subheader {
    color: #0ff;
    font-size: 14px;
    margin-top: 5px;
    letter-spacing: 0;
}

.classification-body {
    padding: 15px 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.classification-section-label {
    color: #0f0;
    font-size: 16px;
    margin: 15px 0 8px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #030;
    letter-spacing: 1px;
}

.classification-section-label:first-child {
    margin-top: 0;
}

.signal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #020;
    gap: 10px;
}

.signal-row-highlight {
    border: 1px solid #ff0;
    background: rgba(255, 255, 0, 0.03);
    padding: 10px;
    margin: 5px 0;
    animation: warningPulse 2s ease-in-out infinite;
}

.signal-info {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.signal-name {
    color: #fff;
    font-size: 15px;
}

.signal-meta {
    color: #088;
    font-size: 11px;
    margin-top: 2px;
}

.signal-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.signal-check {
    color: #030;
    font-size: 16px;
    min-width: 20px;
    text-align: center;
    transition: color 0.3s;
}

.signal-check.done {
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
}

.classify-btn,
.verify-btn,
.priority-btn,
.assess-btn,
.mission-btn,
.recommend-btn,
.fragment-ack-btn {
    background: transparent;
    border: 1px solid #060;
    color: #080;
    font-family: 'VT323', monospace;
    font-size: 13px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.classify-btn:hover,
.verify-btn:hover,
.priority-btn:hover,
.assess-btn:hover,
.mission-btn:hover,
.recommend-btn:hover,
.fragment-ack-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0f0;
    color: #0f0;
}

.classify-btn.active,
.priority-btn.active,
.assess-btn.active,
.mission-btn.active,
.recommend-btn.active {
    background: rgba(0, 255, 0, 0.15);
    border: 2px solid #0f0;
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

.verify-btn.verified {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0f0;
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
    pointer-events: none;
}

.fragment-ack-btn.acknowledged {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0f0;
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
    pointer-events: none;
}

.priority-btn[data-value="CRITICAL"].active {
    border-color: #ff0;
    color: #ff0;
    text-shadow: 0 0 5px #ff0;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
    background: rgba(255, 255, 0, 0.1);
}

.mission-btn[data-value="COSMIC_REVELATION"].active {
    border-color: #f0f;
    color: #f0f;
    text-shadow: 0 0 5px #f0f;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
    background: rgba(255, 0, 255, 0.1);
}

.assess-btn[data-value="PARADIGM_SHIFT"].active {
    border-color: #ff0;
    color: #ff0;
    text-shadow: 0 0 5px #ff0;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
    background: rgba(255, 255, 0, 0.1);
}

.classification-footer {
    border-top: 2px solid #0f0;
    padding: 15px 20px;
    text-align: center;
}

#compile-report-btn {
    background: transparent;
    border: 2px solid #060;
    color: #080;
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 12px 35px;
    cursor: pointer;
    transition: all 0.3s;
}

#compile-report-btn.ready {
    border-color: #0f0;
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

.verify-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #020;
}

.verify-name {
    color: #fff;
    font-size: 14px;
    min-width: 140px;
}

.verify-type {
    color: #0aa;
    font-size: 12px;
    flex: 1;
    text-align: center;
}

.fragment-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #020;
    gap: 12px;
}

.fragment-status {
    font-size: 12px;
    min-width: 80px;
    text-align: center;
    padding: 2px 8px;
    border: 1px solid;
}

.fragment-status.collected {
    color: #0f0;
    border-color: #0f0;
    background: rgba(0, 255, 0, 0.05);
}

.fragment-status.pending {
    color: #f00;
    border-color: #f00;
    background: rgba(255, 0, 0, 0.05);
}

.fragment-name {
    color: #0ff;
    font-size: 14px;
    flex: 1;
}

.classification-flash {
    animation: classificationFlash 0.6s ease-out;
}

@keyframes classificationFlash {
    0% { background: rgba(0, 255, 0, 0.3); }
    100% { background: transparent; }
}
