/* Kontrollverlust Chat-Interface */
:root {
    color-scheme: dark;
    font-family: 'Inter', system-ui, sans-serif;
    --bg: #06101c;
    --surface: #0d1725;
    --surface-muted: #111f33;
    --surface-strong: #172a40;
    --text: #e9f8ff;
    --text-secondary: #9bb9d1;
    --accent: #57ff96;
    --accent-strong: #1abf79;
    --danger: #ff5a5a;
    --border: rgba(87, 255, 150, 0.15);
    --shadow: 0 32px 100px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.25);
}

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

html, body {
    min-height: 100%;
}

body {
    background: radial-gradient(circle at top center, rgba(87, 255, 150, 0.08), transparent 32%),
                linear-gradient(180deg, #030710 0%, var(--bg) 100%);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button, input, textarea {
    font: inherit;
}

button {
    border: none;
    background: none;
}

.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.terminal-content,
.game-container {
    width: min(1100px, 100%);
    border-radius: 28px;
    background: rgba(13, 23, 37, 0.95);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.boot-screen {
    background: radial-gradient(circle at top, rgba(87, 255, 150, 0.05), transparent 35%),
                linear-gradient(180deg, #07101f 0%, #091327 100%);
}

.terminal-content {
    padding: 2.5rem;
}

.boot-header h1,
.victory-header h1,
.gameover-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text);
    letter-spacing: -0.03em;
}

.boot-subheader,
.victory-subheader,
.gameover-subheader {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.75;
}

.boot-text {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(87, 255, 150, 0.12);
    border-radius: 24px;
    padding: 2rem;
    min-height: 240px;
}

.boot-line {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: #07111f;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 42px rgba(25, 191, 87, 0.18);
}

.btn-primary {
    color: #07111f;
    box-shadow: 0 20px 45px rgba(25, 191, 87, 0.18);
}

.btn-icon {
    padding: 0.9rem 1.2rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid rgba(87, 255, 150, 0.06);
    cursor: pointer;
}

.btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.game-screen {
    background: transparent;
}

.game-container {
    display: flex;
    flex-direction: column;
    min-height: 80vh;
    overflow: hidden;
}

.top-bar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.system-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.95rem;
}

.status-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.status-value {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
}

.progress-bar {
    position: relative;
    height: 54px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    width: 0;
    transition: width 0.45s ease;
}

.progress-text {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #07111f;
    font-weight: 700;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-container {
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.chat-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nova-status {
    color: var(--accent);
    font-weight: 700;
}

.chat-sub {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.5rem;
    max-height: 56vh;
    min-height: 22rem;
    overflow-y: auto;
}

.chat-message {
    max-width: 78%;
    padding: 1rem 1.15rem;
    border-radius: 28px;
    line-height: 1.7;
    font-size: 0.97rem;
    position: relative;
}

.chat-message.nova {
    align-self: flex-start;
    background: rgba(7, 210, 255, 0.12);
    border: 1px solid rgba(7, 210, 255, 0.18);
    color: #f8fcff;
    border-top-left-radius: 4px;
}

.chat-message.user {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-top-right-radius: 4px;
}

.chat-message.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    max-width: 95%;
}

.bubble-title {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--text);
}

.puzzle-bubble {
    display: none;
    margin: 0 1.5rem 1rem;
    padding: 1.4rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.01);
}

.puzzle-bubble.active {
    display: block;
}

.chat-responses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 1.25rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(7, 16, 29, 0.7);
}

.choice-button {
    min-width: 10rem;
    padding: 0.85rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(87, 255, 150, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    transition: all 0.18s ease;
    font-weight: 700;
    text-align: center;
}

.choice-button:hover,
.choice-button:focus {
    background: linear-gradient(135deg, rgba(87,255,150,0.14), rgba(7,210,255,0.12));
    color: #07111f;
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(87, 255, 150, 0.3);
}

.puzzle-title {
    margin-bottom: 0.9rem;
    font-weight: 800;
    color: var(--text);
}

.puzzle-description,
.hint-text {
    color: var(--text-secondary);
    line-height: 1.75;
}

.puzzle-input,
textarea.puzzle-input {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(87, 255, 150, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.puzzle-input:focus,
textarea.puzzle-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 6px rgba(87, 255, 150, 0.12);
}

.puzzle-button,
.btn-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.3rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #07111f;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.puzzle-button:hover,
.btn-hint:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(25, 191, 87, 0.18);
}

.binary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.binary-switch {
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    padding: 1rem;
}

.switch-label {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: block;
}

.toggle-group {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bit {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.bit:hover {
    transform: translateY(-2px);
    border-color: rgba(87, 255, 150, 0.3);
}

.bit.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #07111f;
    border-color: var(--accent-strong);
    box-shadow: 0 20px 40px rgba(25, 191, 87, 0.16);
}

.binary-output {
    padding: 1.25rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.output-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.output-value {
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 0.4rem;
}

.audio-container,
.hint-text {
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem;
    margin: 1rem 0;
}

.audio-player {
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
}

.embedded-video {
    width: 100%;
    max-height: 340px;
    border-radius: 18px;
    background: #000;
    margin-top: 1rem;
}

.timestamp-list {
    display: grid;
    gap: 0.75rem;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 0.75rem;
}

.timestamp-item {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
    color: var(--text);
}

.timestamp-item:hover,
.timestamp-item.active {
    background: rgba(87, 255, 150, 0.12);
    border-color: rgba(87, 255, 150, 0.18);
}

.hint-system {
    display: flex;
    justify-content: center;
}

.btn-hint {
    background: linear-gradient(135deg, #ffffff, #f3f8ff);
    color: #0f172a;
}

.bottom-status {
    padding: 1.25rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.victory-screen,
.game-over-screen {
    background: radial-gradient(circle at top, rgba(87, 255, 150, 0.08), transparent 30%),
                linear-gradient(180deg, #07101f 0%, #091327 100%);
}

.victory-message,
.gameover-message {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 1.75rem;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    line-height: 1.85;
    max-height: 320px;
    overflow-y: auto;
}

.gameover-header h1 {
    color: var(--danger);
}

.gameover-subheader {
    color: #ffb3b3;
}

@media (max-width: 1024px) {
    .top-bar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .progress-bar {
        height: 48px;
    }
}

@media (max-width: 768px) {
    .screen {
        padding: 1.5rem 0.75rem;
    }

    .terminal-content,
    .game-container {
        border-radius: 24px;
    }

    .puzzle-bubble,
    .chat-messages,
    .chat-responses {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .binary-grid {
        grid-template-columns: 1fr;
    }

    .choice-button,
    .btn,
    .puzzle-button,
    .btn-hint {
        width: 100%;
    }
}
