/* ═══ MOBILE RESPONSIVE — COMPLETE REWRITE ═══ */
/* Fixes: touch controls, orientation persistence, all sections responsive */

/* Desktop: hide mobile CTA and expand buttons */
.section-mobile-cta {
    display: none;
}
.expand-close {
    display: none;
}

/* Base mobile: any screen <= 768px */
@media (max-width: 768px) {
    html, body {
        touch-action: manipulation;
        overscroll-behavior: none;
        -webkit-overflow-scrolling: auto;
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    /* Always show mobile controls on mobile regardless of orientation */
    .mob-controls {
        display: flex !important;
        position: fixed !important;
        bottom: 16px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 999 !important;
        gap: 20px !important;
    }

    .mob-btn {
        width: 56px !important;
        height: 56px !important;
        font-size: 20px !important;
        background: rgba(0, 0, 0, 0.85) !important;
        border: 2px solid rgba(51, 255, 136, 0.6) !important;
        color: #33ff88 !important;
        backdrop-filter: blur(4px);
        -webkit-tap-highlight-color: transparent;
    }

    .mob-btn:active {
        background: rgba(51, 255, 136, 0.3) !important;
        border-color: #33ff88 !important;
    }

    /* Hide keyboard hint and nav dots on mobile */
    .kbd-hint {
        display: none !important;
    }
    .section-nav {
        display: none !important;
    }
    .walk-hint {
        font-size: 7px !important;
        bottom: 90px !important;
    }

    /* Section titles */
    .section-title {
        font-size: 12px !important;
        padding-top: 10px !important;
        letter-spacing: 2px;
    }

    /* Logo and social scaling — only visible in first room */
    .band-logo {
        transform: translate(-50%, -50%) scale(0.5) !important;
        transition: opacity 0.3s ease;
    }
    .band-logo.hidden-by-room {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .social-links {
        top: 6px !important;
        left: 12px !important;
        gap: 8px !important;
        transition: opacity 0.3s ease;
    }
    .social-links.hidden-by-room {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .pixel-icon {
        width: 20px !important;
        height: 20px !important;
    }

    .social-label {
        font-size: 5px !important;
    }

    /* UI overlays above controls */
    .ui-sound {
        bottom: 80px !important;
        left: 10px !important;
        font-size: 7px !important;
        padding: 5px 8px !important;
    }

    .ui-secrets {
        bottom: 80px !important;
        right: 10px !important;
        font-size: 7px !important;
        padding: 5px 8px !important;
    }

    /* Discovery markers */
    .easter-egg {
        opacity: 0.75 !important;
        z-index: 9000 !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer !important;
    }

    /* Reaction tracker in specimens room */
    .reaction-tracker {
        font-size: 9px !important;
        padding: 6px 10px !important;
    }

    /* Reaction result banner */
    .reaction-result-banner {
        padding: 12px 20px !important;
        max-width: 85vw !important;
    }
    .reaction-result-name {
        font-size: 16px !important;
    }
    .reaction-result-text {
        font-size: 11px !important;
    }
}

/* ═══ PORTRAIT MODE ═══ */
@media (max-width: 768px) and (orientation: portrait) {
    /* Canvas: 16:9 letterbox centered */
    #worldCanvas {
        width: 100vw !important;
        height: 56.25vw !important;
        top: 50% !important;
        left: 0 !important;
        transform: translateY(-50%) !important;
    }

    #playerCanvas {
        /* Player canvas synced via JS */
    }

    .horizontal-wrapper {
        height: 56.25vw !important;
        width: 100vw !important;
        top: 50% !important;
        left: 0 !important;
        position: fixed !important;
        transform: translateY(-50%) !important;
    }

    .section {
        height: 56.25vw !important;
        width: 100vw !important;
        overflow: hidden !important;
        position: relative;
    }

    /* All scene-bg children: clamp within section bounds */
    .scene-bg {
        height: 100% !important;
        overflow: hidden !important;
        position: relative;
    }

    /* Section titles: pin to top, shrink */
    .section-title {
        position: absolute !important;
        top: 4px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        font-size: 8px !important;
        z-index: 15;
        white-space: nowrap;
    }

    /* ── Specimen Grid — hide in portrait letterbox, use expand CTA ── */
    .specimen-grid {
        display: none !important;
    }
    .section-specimens .reaction-tracker {
        display: none !important;
    }

    /* ── Observatory / Files — hide in portrait letterbox ── */
    .classified-files {
        display: none !important;
    }
    .files-subtitle {
        display: none !important;
    }

    /* ── Investigation Board ── */
    .section-team .inv-board {
        display: none !important;
    }

    /* ── Whitelist Form ── */
    .section-command .wl-container {
        display: none !important;
    }

    /* ── Generic section expand CTA (shared with agent-mobile-cta) ── */
    .section-mobile-cta {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        height: 100%;
        text-align: center;
        position: relative;
        z-index: 10;
    }
    .section-mobile-cta .cta-icon {
        font-family: var(--font-pixel);
        font-size: 18px;
        color: #cc8888;
        text-shadow: 2px 2px 0 #000;
        letter-spacing: 3px;
    }
    .section-command .section-mobile-cta .cta-icon {
        color: #88aacc;
    }
    .section-mobile-cta .cta-status {
        font-family: var(--font-pixel);
        font-size: 7px;
        color: #e8d8d8;
        letter-spacing: 3px;
        padding: 4px 10px;
        background: #181010;
        border: 1px solid #3a1f1f;
    }
    .section-command .section-mobile-cta .cta-status {
        color: #d8e8ff;
        background: #101018;
        border-color: #1f1f3a;
    }
    .section-mobile-cta .cta-btn {
        font-family: var(--font-pixel);
        font-size: 9px;
        letter-spacing: 3px;
        background: #301a1a;
        color: #ffd8d8;
        border: 1px solid #502c2c;
        padding: 12px 20px;
        cursor: pointer;
        min-width: 200px;
        -webkit-tap-highlight-color: transparent;
    }
    .section-command .section-mobile-cta .cta-btn {
        background: #1a1a30;
        color: #d8d8ff;
        border-color: #2c2c50;
    }
    .section-specimens .section-mobile-cta .cta-icon {
        color: #88ccaa;
    }
    .section-specimens .section-mobile-cta .cta-status {
        color: #d8ffe8;
        background: #0e1818;
        border-color: #1f3a3a;
    }
    .section-specimens .section-mobile-cta .cta-btn {
        background: #1a301a;
        color: #d8ffd8;
        border-color: #2c502c;
    }
    .section-observatory .section-mobile-cta .cta-icon {
        color: #88aacc;
    }
    .section-observatory .section-mobile-cta .cta-status {
        color: #d8e8ff;
        background: #101018;
        border-color: #1f1f3a;
    }
    .section-observatory .section-mobile-cta .cta-btn {
        background: #1a1a30;
        color: #d8d8ff;
        border-color: #2c2c50;
    }
    .section-mobile-cta .cta-btn:active {
        background: #502c2c;
        transform: translateY(1px);
    }
    .section-mobile-cta .cta-hint {
        font-family: var(--font-pixel);
        font-size: 7px;
        color: #806a6a;
        letter-spacing: 2px;
        max-width: 80vw;
        line-height: 1.5;
    }

    /* ── Expand close button (shared) ── */
    .expand-close {
        display: none;
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 10001;
        width: 36px;
        height: 36px;
        background: #2c0808;
        border: 1px solid #5a1a1a;
        color: #ff8888;
        font-family: var(--font-pixel);
        font-size: 16px;
        cursor: pointer;
    }

    /* ── Team expanded state ── */
    body.team-expanded .expand-close#teamClose {
        display: block;
    }
    body.team-expanded #worldCanvas,
    body.team-expanded #playerCanvas,
    body.team-expanded .mob-controls,
    body.team-expanded .ui-sound,
    body.team-expanded .ui-secrets,
    body.team-expanded .site-footer,
    body.team-expanded .social-links,
    body.team-expanded .band-logo {
        display: none !important;
    }
    body.team-expanded .horizontal-wrapper {
        transform: none !important;
        height: 100vh !important;
        top: 0 !important;
        position: relative !important;
    }
    body.team-expanded .horizontal-wrapper > .section:not(.section-team) {
        display: none !important;
    }
    body.team-expanded .section-team {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: auto !important;
        min-height: 100vh !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        transform: none !important;
    }
    body.team-expanded .section-team .team-bg {
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        padding: 16px 8px 30px !important;
    }
    body.team-expanded .section-mobile-cta {
        display: none !important;
    }
    body.team-expanded .section-team .inv-board {
        display: block !important;
        position: relative !important;
        transform: none !important;
        width: 100% !important;
        height: 0 !important;
        padding-bottom: 150% !important; /* taller ratio for mobile stacking */
        min-height: unset !important;
        overflow: visible !important;
    }
    body.team-expanded .inv-board .inv-case-header {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        margin: 0 auto 12px !important;
        width: fit-content;
    }
    body.team-expanded .inv-board .inv-timeline {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        height: 40px !important;
        margin: 0 auto 16px !important;
        width: 90% !important;
    }
    body.team-expanded .inv-card {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        width: 90% !important;
        max-width: 260px !important;
        height: auto !important;
        margin: 12px auto !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 12px !important;
    }
    body.team-expanded .card-mugshot {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        border-radius: 4px !important;
    }
    body.team-expanded .card-info {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }
    body.team-expanded .card-annotation {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin-top: 6px !important;
    }
    body.team-expanded .card-circle-mark {
        display: none !important;
    }
    body.team-expanded .inv-evidence,
    body.team-expanded .inv-note {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        margin: 8px auto !important;
        width: 85% !important;
    }
    body.team-expanded .red-strings {
        display: none !important;
    }
    body.team-expanded .inv-lamp {
        display: none !important;
    }
    body.team-expanded .board-vignette {
        display: none !important;
    }

    /* ── Command expanded state ── */
    body.command-expanded .expand-close#commandClose {
        display: block;
    }
    body.command-expanded #worldCanvas,
    body.command-expanded #playerCanvas,
    body.command-expanded .mob-controls,
    body.command-expanded .ui-sound,
    body.command-expanded .ui-secrets,
    body.command-expanded .site-footer,
    body.command-expanded .social-links,
    body.command-expanded .band-logo {
        display: none !important;
    }
    body.command-expanded .horizontal-wrapper {
        transform: none !important;
        height: 100vh !important;
        top: 0 !important;
        position: relative !important;
    }
    body.command-expanded .horizontal-wrapper > .section:not(.section-command) {
        display: none !important;
    }
    body.command-expanded .section-command {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: auto !important;
        min-height: 100vh !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        transform: none !important;
    }
    body.command-expanded .section-command .command-bg {
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        padding: 16px 8px 30px !important;
    }
    body.command-expanded .section-mobile-cta {
        display: none !important;
    }
    body.command-expanded .section-command .wl-container {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 12px !important;
    }
    body.command-expanded .wl-panels {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }
    body.command-expanded .wl-panel {
        width: 100% !important;
        max-width: 100% !important;
    }
    body.command-expanded .wl-title {
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }
    body.command-expanded .wl-subtitle {
        font-size: 10px !important;
    }
    body.command-expanded .monitor-wall {
        display: none !important;
    }

    /* ── Specimen expanded state ── */
    body.specimen-expanded .expand-close#specimenClose {
        display: block;
    }
    body.specimen-expanded #worldCanvas,
    body.specimen-expanded #playerCanvas,
    body.specimen-expanded .mob-controls,
    body.specimen-expanded .ui-sound,
    body.specimen-expanded .ui-secrets,
    body.specimen-expanded .site-footer,
    body.specimen-expanded .social-links,
    body.specimen-expanded .band-logo {
        display: none !important;
    }
    body.specimen-expanded .horizontal-wrapper {
        transform: none !important;
        height: 100vh !important;
        top: 0 !important;
        position: relative !important;
    }
    body.specimen-expanded .horizontal-wrapper > .section:not(.section-specimens) {
        display: none !important;
    }
    body.specimen-expanded .section-specimens {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: auto !important;
        min-height: 100vh !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        transform: none !important;
    }
    body.specimen-expanded .section-specimens .specimens-bg {
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        padding: 16px 8px 30px !important;
    }
    body.specimen-expanded .section-mobile-cta {
        display: none !important;
    }
    body.specimen-expanded .specimen-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        max-width: 95vw !important;
        margin: 12px auto !important;
        padding: 0 8px !important;
    }
    body.specimen-expanded .specimen-flask {
        transform: scale(0.55);
        transform-origin: center top;
    }
    body.specimen-expanded .specimen-label {
        font-size: 7px !important;
    }
    body.specimen-expanded .specimen-note {
        font-size: 8px !important;
    }

    /* ── Observatory expanded state ── */
    body.observatory-expanded .expand-close#observatoryClose {
        display: block;
    }
    body.observatory-expanded #worldCanvas,
    body.observatory-expanded #playerCanvas,
    body.observatory-expanded .mob-controls,
    body.observatory-expanded .ui-sound,
    body.observatory-expanded .ui-secrets,
    body.observatory-expanded .site-footer,
    body.observatory-expanded .social-links,
    body.observatory-expanded .band-logo {
        display: none !important;
    }
    body.observatory-expanded .horizontal-wrapper {
        transform: none !important;
        height: 100vh !important;
        top: 0 !important;
        position: relative !important;
    }
    body.observatory-expanded .horizontal-wrapper > .section:not(.section-observatory) {
        display: none !important;
    }
    body.observatory-expanded .section-observatory {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: auto !important;
        min-height: 100vh !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        transform: none !important;
    }
    body.observatory-expanded .section-observatory .observatory-bg {
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        padding: 16px 8px 30px !important;
    }
    body.observatory-expanded .section-mobile-cta {
        display: none !important;
    }
    body.observatory-expanded .classified-files {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        padding: 12px !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
    }
    body.observatory-expanded .files-subtitle {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        top: auto !important;
        font-size: 10px !important;
        margin-bottom: 12px !important;
    }
    body.observatory-expanded .file-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    body.observatory-expanded .research-file {
        padding: 14px 10px !important;
    }
    body.observatory-expanded .research-file h3 {
        font-size: 8px !important;
    }
    body.observatory-expanded .research-file p {
        font-size: 10px !important;
    }

    /* ── Footer ── */
    .site-footer {
        bottom: 8px !important;
        transform: translateX(-50%) scale(0.65);
    }

    /* ── Agent Section (portrait CTA mode) ── */
    .agent-bg {
        padding: 16px 10px 24px !important;
        height: 56.25vw !important;
        overflow: hidden !important;
        position: relative;
    }

    .agent-bg .agent-layout {
        display: none !important;
    }

    .agent-mobile-cta {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        height: 100%;
        text-align: center;
        position: relative;
        z-index: 10;
    }
    .agent-mobile-cta .cta-icon {
        font-family: var(--font-pixel);
        font-size: 24px;
        color: #88ccaa;
        text-shadow: 2px 2px 0 #000;
        letter-spacing: 4px;
    }
    .agent-mobile-cta .cta-status {
        font-family: var(--font-pixel);
        font-size: 7px;
        color: #d8ffe8;
        letter-spacing: 3px;
        padding: 4px 10px;
        background: #0e1818;
        border: 1px solid #1f3a3a;
    }
    .agent-mobile-cta .cta-status.connected {
        color: #88ffaa;
        border-color: #2c5a3a;
    }
    .agent-mobile-cta .cta-hint {
        font-family: var(--font-pixel);
        font-size: 7px;
        color: #6a8580;
        letter-spacing: 2px;
        max-width: 80vw;
        line-height: 1.5;
    }
    .agent-mobile-cta .cta-btn {
        font-family: var(--font-pixel);
        font-size: 9px;
        letter-spacing: 3px;
        background: #1a3030;
        color: #d8ffe8;
        border: 1px solid #2c5050;
        padding: 12px 20px;
        cursor: pointer;
        min-width: 200px;
        -webkit-tap-highlight-color: transparent;
    }
    .agent-mobile-cta .cta-btn.cta-primary {
        background: #1f3a2a;
        border-color: #3a6a4a;
        color: #b8ffd0;
    }
    .agent-mobile-cta .cta-btn.cta-primary:disabled {
        opacity: 0.5;
    }
    .agent-mobile-cta .cta-btn:active {
        background: #2c5050;
        transform: translateY(1px);
    }

    /* Expanded agent mode */
    body.agent-expanded {
        overflow: auto !important;
        touch-action: auto !important;
    }
    body.agent-expanded #worldCanvas,
    body.agent-expanded #playerCanvas,
    body.agent-expanded .mob-controls,
    body.agent-expanded .ui-sound,
    body.agent-expanded .ui-secrets,
    body.agent-expanded .site-footer,
    body.agent-expanded .social-links,
    body.agent-expanded .band-logo {
        display: none !important;
    }
    body.agent-expanded .horizontal-wrapper {
        transform: none !important;
        height: 100vh !important;
        top: 0 !important;
        position: relative !important;
    }
    body.agent-expanded .horizontal-wrapper > .section:not(.section-agent) {
        display: none !important;
    }
    body.agent-expanded .section-agent {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: auto !important;
        min-height: 100vh !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        transform: none !important;
    }
    body.agent-expanded .section-agent .agent-bg {
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        padding: 50px 12px 30px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    body.agent-expanded .agent-mobile-cta {
        display: none !important;
    }
    body.agent-expanded .agent-bg .agent-layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        max-width: 100% !important;
        padding: 0 4px !important;
    }
    body.agent-expanded .agent-terminals {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    body.agent-expanded .track-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    body.agent-expanded .nft-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }
    body.agent-expanded .panel-btn {
        width: 100% !important;
    }

    /* Close button in expanded mode */
    .agent-close {
        display: none;
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 10001;
        width: 36px;
        height: 36px;
        background: #2c0808;
        border: 1px solid #5a1a1a;
        color: #ff8888;
        font-family: var(--font-pixel);
        font-size: 16px;
        cursor: pointer;
    }
    body.agent-expanded .agent-close {
        display: block;
    }

    .agent-subtitle {
        font-size: 6px !important;
        letter-spacing: 2px !important;
        margin: 4px 0 10px !important;
    }

    .agent-layout {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        max-width: 100% !important;
    }

    .agent-left,
    .agent-right {
        gap: 8px !important;
    }

    /* Server rack compact */
    .server-rack {
        padding: 8px 10px !important;
    }
    .rack-grid,
    .rack-legend {
        display: none !important;
    }
    .rack-summary {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 10px 4px 4px;
    }
    .rack-summary .rs-row {
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 8px 10px;
        background: #0e1818;
        border: 1px solid #1f3a3a;
    }
    .rack-summary .rs-key {
        font-family: var(--font-pixel);
        font-size: 6px;
        letter-spacing: 2px;
        color: #6a8580;
    }
    .rack-summary .rs-val {
        font-family: var(--font-pixel);
        font-size: 14px;
        color: #d8ffe8;
    }
    .rack-summary .rs-val.active { color: #88ffaa; }
    .rack-summary .rs-val.mine { color: #ffd28c; }

    /* Ctrl panels compact */
    .ctrl-panel {
        padding: 8px 10px !important;
    }
    .panel-title {
        font-size: 7px !important;
    }
    .panel-row {
        font-size: 10px !important;
        padding: 3px 0 !important;
    }
    .panel-key,
    .panel-val {
        font-size: 10px !important;
    }
    .panel-btn {
        font-size: 8px !important;
        padding: 10px 12px !important;
        margin-top: 6px !important;
    }
    .panel-input {
        font-size: 11px !important;
        padding: 7px 8px !important;
    }
    .panel-note {
        font-size: 9px !important;
    }

    /* Track cards */
    .track-grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
    .track-card {
        padding: 8px 10px !important;
    }
    .track-name {
        font-size: 8px !important;
    }
    .track-desc {
        font-size: 10px !important;
        line-height: 1.3 !important;
    }
    .track-stats {
        font-size: 8px !important;
    }

    /* CRT logs */
    .crt-screen {
        padding: 6px 8px !important;
        min-height: 60px !important;
    }
    .crt-line {
        font-size: 10px !important;
    }
    .crt-header {
        font-size: 6px !important;
    }

    /* Deploy button */
    .deploy-btn {
        padding: 12px !important;
        font-size: 9px !important;
    }

    /* Discovery markers positions */
    .egg-1 { top: 31% !important; left: 8% !important; bottom: auto !important; right: auto !important; }
    .egg-2 { top: 26% !important; right: 9% !important; left: auto !important; bottom: auto !important; }
    .egg-3 { top: 21% !important; left: 11% !important; bottom: auto !important; right: auto !important; }
    .egg-4 { bottom: 35% !important; right: 8% !important; top: auto !important; left: auto !important; }
    .egg-5 { top: 28% !important; left: 14% !important; bottom: auto !important; right: auto !important; }
    .egg-6 { bottom: 30% !important; right: 14% !important; top: auto !important; left: auto !important; }
}

/* ═══ LANDSCAPE MOBILE ═══ */
@media (max-width: 768px) and (orientation: landscape) {
    /* Full viewport in landscape */
    #worldCanvas {
        width: 100vw !important;
        height: 100vh !important;
    }

    .horizontal-wrapper {
        height: 100vh !important;
        top: 0 !important;
        transform: none !important;
    }

    .section {
        height: 100vh !important;
    }

    /* Slightly smaller controls in landscape */
    .mob-controls {
        bottom: 8px !important;
        gap: 16px !important;
    }

    .mob-btn {
        width: 44px !important;
        height: 44px !important;
        font-size: 16px !important;
    }

    .band-logo {
        transform: translate(-50%, -50%) scale(0.7) !important;
        transition: opacity 0.3s ease;
    }
    .band-logo.hidden-by-room {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .social-links {
        top: 6px !important;
        gap: 12px !important;
        transition: opacity 0.3s ease;
    }
    .social-links.hidden-by-room {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .pixel-icon {
        width: 26px !important;
        height: 26px !important;
    }

    .social-label {
        font-size: 6px !important;
    }

    .section-title {
        font-size: 11px !important;
        padding-top: 8px !important;
    }

    .specimen-grid {
        gap: 10px 16px !important;
        margin: 12px auto 6px !important;
    }

    .specimen-flask {
        transform: scale(0.55);
        transform-origin: center top;
    }

    .specimen-label {
        font-size: 6px !important;
    }

    .classified-files {
        transform: translate(-50%, -50%) scale(0.65) !important;
    }

    /* In landscape the inv-board stays visible (scenes.css handles scale) */
    /* but hide the CTA since board renders OK in landscape */
    .section-team .section-mobile-cta {
        display: none !important;
    }
    .section-team .inv-board {
        display: block !important;
    }

    /* Specimens and observatory: content fits in landscape, hide CTA */
    .section-specimens .section-mobile-cta {
        display: none !important;
    }
    .section-specimens .specimen-grid {
        display: grid !important;
    }
    .section-observatory .section-mobile-cta {
        display: none !important;
    }
    .section-observatory .classified-files {
        display: block !important;
    }
    .section-observatory .files-subtitle {
        display: block !important;
    }

    /* WL form: show CTA in landscape too since form overflows */
    .section-command .section-mobile-cta {
        display: flex !important;
        height: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    .section-command .wl-container {
        display: none !important;
    }

    /* Agent section in landscape: show CTA, hide layout (overflows) */
    .section-agent .agent-mobile-cta {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        height: 100%;
    }
    .section-agent .agent-layout {
        display: none !important;
    }

    .command-terminal {
        transform: scale(0.72);
        transform-origin: center center;
    }

    .ui-sound {
        bottom: 8px !important;
        left: 8px !important;
        font-size: 7px !important;
        padding: 4px 6px !important;
    }

    .ui-secrets {
        bottom: 8px !important;
        right: 8px !important;
        font-size: 7px !important;
        padding: 4px 6px !important;
    }

    .site-footer {
        bottom: 4px !important;
        transform: translateX(-50%) scale(0.65);
    }
}

/* ═══ SMALL PHONES (< 380px) ═══ */
@media (max-width: 380px) and (orientation: portrait) {
    .specimen-flask {
        transform: scale(0.35) !important;
    }

    .mob-btn {
        width: 48px !important;
        height: 48px !important;
    }

    .section-title {
        font-size: 10px !important;
    }

    .section-mobile-cta .cta-icon {
        font-size: 14px !important;
    }
    .section-mobile-cta .cta-btn {
        font-size: 8px !important;
        min-width: 160px !important;
        padding: 10px 16px !important;
    }
}

/* ═══ TOUCH VISUAL FEEDBACK ═══ */
@media (pointer: coarse) {
    /* Larger tap targets for touch devices */
    .specimen-container {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }

    .research-file {
        padding: 16px 12px !important;
    }

    /* Prevent text selection on touch-interactive elements */
    .mob-btn,
    .specimen-container,
    .easter-egg,
    .track-card,
    .panel-btn,
    .deploy-btn {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
}
