/* Jarvis Audio Chatbot · Mobile View
   Separate Mobile CSS for fast phone use.
   Wichtig offen: Chatbot, Schnellstart, Steuerung, Missionen.
   Weniger wichtig: einklappbar.
*/

.mobile-quickbar,
.mobile-fold-toggle {
    display: none;
}

@media (max-width: 860px) {
    html {
        scroll-padding-top: 92px;
    }

    body {
        background:
            radial-gradient(circle at 50% 0%, rgba(0, 255, 170, 0.13), transparent 22rem),
            linear-gradient(160deg, #010302, #03100d 55%, #010504);
    }

    .site-header {
        position: sticky;
        top: 0;
        padding: 0.72rem 0.75rem;
        gap: 0.6rem;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
    }

    .brand {
        width: 100%;
    }

    .brand-orb {
        width: 34px;
        height: 34px;
        flex: 0 0 auto;
    }

    .brand strong {
        font-size: 0.98rem;
    }

    .brand small {
        font-size: 0.78rem;
    }

    .menu-toggle {
        width: 100%;
        justify-content: center;
        padding: 0.65rem 0.9rem;
    }

    .top-links {
        max-height: 62vh;
        overflow: auto;
        border: 1px solid rgba(0,255,170,.16);
        border-radius: 18px;
        padding: 0.55rem;
        background: rgba(0, 8, 7, 0.86);
    }

    .top-links a {
        text-align: center;
        padding: 0.72rem 0.8rem;
    }

    .page-shell {
        width: min(100% - 0.7rem, 1280px);
        margin-top: 0.55rem;
    }

    .cover-stage {
        min-height: 430px;
        border-radius: 18px;
        margin-bottom: 0.6rem;
    }

    .cover-picture img {
        object-position: 73% center;
    }

    .cover-stage::after {
        background:
            linear-gradient(180deg, rgba(0,8,7,.78), rgba(0,8,7,.48) 34%, rgba(0,8,7,.9)),
            linear-gradient(90deg, rgba(0,8,7,.94), rgba(0,8,7,.62) 54%, rgba(0,8,7,.82));
    }

    .cover-overlay {
        min-height: 430px;
        padding: 1rem;
        justify-content: flex-end;
        max-width: 100%;
    }

    .cover-overlay h1 {
        font-size: clamp(2.1rem, 14vw, 4.5rem);
        letter-spacing: 0;
        max-width: 9ch;
    }

    .cover-overlay p {
        font-size: 0.96rem;
        line-height: 1.48;
        max-width: 34rem;
    }

    .jarvis-audio-panel {
        gap: 0.45rem;
    }

    .jarvis-audio-button,
    .jarvis-link-button,
    .launcher-card a,
    .launcher-card button,
    .assist-grid button,
    .story-grid button,
    .soest-grid button,
    .controls-grid button {
        min-height: 46px;
        padding: 0.72rem 0.85rem;
        font-size: 0.95rem;
    }

    .mobile-quickbar {
        position: sticky;
        top: 78px;
        z-index: 12;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.35rem;
        margin: 0.55rem 0 0.75rem;
        padding: 0.4rem;
        border: 1px solid rgba(0,255,170,.18);
        border-radius: 18px;
        background: rgba(0, 8, 7, 0.9);
        backdrop-filter: blur(12px);
        box-shadow: 0 0 24px rgba(0,255,170,.08);
    }

    .mobile-quickbar a {
        display: grid;
        place-items: center;
        min-height: 44px;
        padding: 0.35rem 0.2rem;
        border: 1px solid rgba(0,255,170,.18);
        border-radius: 14px;
        background: rgba(0, 30, 24, 0.62);
        color: #dffff6;
        text-decoration: none;
        font-size: 0.78rem;
        font-weight: 900;
        line-height: 1.15;
        text-align: center;
    }

    .mobile-quickbar a:active {
        transform: scale(0.98);
        border-color: rgba(0,255,170,.65);
    }

    .panel,
    .value-card,
    .launcher-card,
    .chatbot-panel,
    .mission-guide,
    .favorite-panel,
    .hud-card,
    .status-card,
    .mini-panel,
    .assist-grid article,
    .story-grid article,
    .soest-grid article,
    .planet-grid article,
    .controls-grid article {
        border-radius: 18px;
    }

    .panel {
        padding: 0.92rem;
        margin-bottom: 0.75rem;
    }

    .section-head {
        margin-bottom: 0.7rem;
    }

    .section-head h2,
    .core-copy h2,
    .hud-card h2,
    .status-card h2,
    .favorite-panel h2 {
        font-size: 1.35rem;
    }

    .row-head {
        gap: 0.65rem;
    }

    /* Chat stays important and open */
    #chatbot {
        padding: 0.85rem;
        border-color: rgba(0,255,170,.46);
    }

    .dialog-note {
        font-size: 0.9rem;
        padding: 0.7rem;
    }

    .chat-messages {
        min-height: 310px;
        max-height: 58vh;
        padding: 0.75rem;
        gap: 0.65rem;
        border-radius: 16px;
    }

    .chat-message {
        max-width: calc(100% - 0.8rem);
        padding: 0.72rem 0.82rem;
        border-radius: 16px;
    }

    .chat-message p {
        font-size: 0.96rem;
        line-height: 1.5;
    }

    .chat-message .answer-links {
        gap: 0.4rem;
    }

    .chat-message .answer-links a,
    .chat-message .answer-links button {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    .chat-form {
        position: sticky;
        bottom: 0.35rem;
        z-index: 9;
        padding: 0.45rem;
        border: 1px solid rgba(0,255,170,.16);
        border-radius: 18px;
        background: rgba(0, 8, 7, 0.92);
        backdrop-filter: blur(12px);
    }

    .chat-form input {
        min-height: 48px;
        border-radius: 16px;
        font-size: 1rem;
    }

    .chatbot-tools {
        max-width: none;
    }

    .question-chips {
        max-height: 160px;
        overflow: auto;
        padding-bottom: 0.15rem;
    }

    .question-chips button {
        min-height: 38px;
        font-size: 0.86rem;
    }

    /* Important grids: open, but compact */
    .launcher-grid,
    .controls-grid,
    .mission-layout {
        gap: 0.65rem;
    }

    .launcher-card,
    .controls-grid article {
        min-height: auto;
        padding: 0.85rem;
    }

    .launcher-card .icon,
    .controls-grid span,
    .soest-grid span,
    .planet-grid span {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 1.25rem;
    }

    .mission-layout {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mission-detail {
        padding: 0.85rem;
        border-radius: 16px;
    }

    .mission-detail h3 {
        font-size: 1.18rem;
    }

    .jarvis-select {
        min-height: 48px;
        border-radius: 16px;
        font-size: 0.96rem;
    }

    .button-row {
        gap: 0.45rem;
    }

    .button-row > * {
        width: 100%;
    }

    /* Mobile folds */
    .mobile-fold {
        position: relative;
        padding-top: 0.75rem;
    }

    .mobile-fold-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 48px;
        margin: 0 0 0.65rem;
        padding: 0.72rem 0.85rem;
        border: 1px solid rgba(0,255,170,.3);
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(0,255,170,.16), rgba(0,20,18,.88));
        color: #eafff8;
        font-weight: 900;
        letter-spacing: 0.02em;
        cursor: pointer;
        box-shadow: 0 0 18px rgba(0,255,170,.1);
    }

    .mobile-fold-toggle span {
        text-align: left;
    }

    .mobile-fold-toggle strong {
        display: grid;
        place-items: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        color: #001b14;
        background: linear-gradient(135deg, #00ffaa, #8dffe6);
        font-size: 1.2rem;
        line-height: 1;
    }

    .mobile-fold.mobile-fold-closed > :not(.mobile-fold-toggle) {
        display: none !important;
    }

    .mobile-fold.mobile-fold-open > :not(.mobile-fold-toggle) {
        animation: mobileFoldIn 0.18s ease-out both;
    }

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

    /* Status/audio core is less important on phone: collapsed by default.
       When opened, make it one column. */
    #status.mobile-fold-open {
        display: grid;
        grid-template-columns: 1fr;
    }

    #status.mobile-fold-closed {
        display: block;
    }

    #status.mobile-fold-open .module-stack,
    #status.mobile-fold-open .right-stack {
        grid-template-columns: 1fr;
    }

    #status.mobile-fold-open .audio-core {
        min-height: 420px;
    }

    .core-orb {
        width: min(285px, 76vw);
        height: min(285px, 76vw);
    }

    .ring-2 {
        inset: 30px;
    }

    .ring-3 {
        inset: 65px;
    }

    .core-ball {
        width: 108px;
        height: 108px;
    }

    .wave-strip {
        height: 70px;
        margin-top: -1.4rem;
        transform: scale(0.85);
    }

    .mic-pad {
        width: 86px;
        height: 86px;
    }

    .mic-symbol {
        font-size: 2rem;
    }

    .status-results,
    .faq-stats,
    .story-grid,
    .soest-grid,
    .planet-grid,
    .assist-grid,
    .value-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .faq-categories {
        max-height: 150px;
        overflow: auto;
    }

    .log-output {
        max-height: 190px;
        min-height: 120px;
        font-size: 0.82rem;
    }

    .site-footer {
        width: min(100% - 0.9rem, 1280px);
        padding-bottom: 1rem;
    }

    .footer-links {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .footer-links a {
        display: grid;
        place-items: center;
        min-height: 40px;
        border: 1px solid rgba(0,255,170,.18);
        border-radius: 14px;
        background: rgba(0,30,24,.45);
        text-align: center;
    }
}

@media (max-width: 390px) {
    .mobile-quickbar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        top: 74px;
    }

    .mobile-quickbar a {
        font-size: 0.75rem;
    }

    .cover-stage,
    .cover-overlay {
        min-height: 390px;
    }

    .cover-overlay h1 {
        font-size: 2.25rem;
    }

    .chat-messages {
        max-height: 54vh;
    }
}


/* Release notice mobile tuning */
@media (max-width: 860px) {
    .release-notice {
        margin-bottom: .65rem;
    }

    .release-notice h2 {
        font-size: 1.12rem;
    }
}


/* Planeten mobile tuning */
@media (max-width: 860px) {
    .planet-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }
}


/* Planetendatenbank mobile */
@media (max-width: 860px) {
    .planet-detail-bank {
        margin-top: .75rem;
        padding-top: .75rem;
    }

    .planet-pill-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .45rem;
    }

    .planet-pill-grid button {
        min-height: 44px;
        font-size: .92rem;
    }
}

@media (max-width: 390px) {
    .planet-pill-grid {
        grid-template-columns: 1fr;
    }
}


/* Mikrofon mobile */
@media (max-width: 860px) {
    .voice-input-status {
        font-size: .9rem;
        padding: .65rem .72rem;
        margin-bottom: .65rem;
    }

    .mic-button {
        width: 100%;
    }
}


/* Mikrofon im Chat-Input mobile */
@media (max-width: 860px) {
    .chat-input-wrap {
        width: 100%;
    }

    .chat-input-wrap input {
        padding-right: 3.5rem;
    }

    .voice-input-inline-button {
        width: 2.55rem;
        height: 2.55rem;
        right: .38rem;
    }
}


/* Mikrofon Fallback mobile */
@media (max-width: 860px) {
    .voice-fallback-info {
        font-size: .84rem;
        padding: .58rem .65rem;
    }
}


/* Mikrofon v21 mobile */
@media (max-width: 860px) {
    .chat-input-wrap {
        width: 100%;
    }

    .chat-input-wrap input {
        padding-right: 3.5rem;
    }

    .voice-input-inline-button {
        width: 2.55rem;
        height: 2.55rem;
        right: .38rem;
    }
}
