/* ============================================================
   chatygo – Master-Stylesheet (Single Source of Truth)
   Night-Stream: Navy + Teal
   Deploy: Diese Datei per Script in jedes Domain-Webroot kopieren.
   ============================================================ */

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

:root {
    --bg:           #0d1b2a;
    --surface:      #0f2035;
    --surface2:     #142840;
    --surface3:     #1a3050;
    --border:       #1e3a52;
    --border-light: #254b68;
    --accent:       #00c9a7;
    --accent-dark:  #00a88c;
    --accent-dim:   rgba(0,201,167,0.12);
    --text:         #ddeaf3;
    --text-muted:   #6e9ab0;
    --text-faint:   #3a5c72;
    --radius:       4px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
}

/* ── Navigation ── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 2.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.nav-brand span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 0;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Hero ── */
.hero {
    padding: 6rem 2.5rem 5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.hero-tag {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 680px;
    color: #f0f8ff;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 520px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: #0d1b2a;
}
.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}
.btn-secondary:hover {
    color: var(--text);
    border-color: var(--accent);
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Divider ── */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
}

/* ── Sections ── */
section {
    padding: 4.5rem 2.5rem;
}

section.alt {
    background: var(--surface);
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.section-tag {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.6rem;
}

.section-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.6rem;
    color: #f0f8ff;
}

.section-sub {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
}

/* ── Feature List ── */
.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.feature-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.feature-item:nth-child(2n) {
    border-right: none;
}

.feature-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.feature-item h3 {
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-item h3::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}

.feature-item p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ── Steps ── */
.steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-left: 2px solid var(--border);
    padding-left: 2rem;
    margin-top: 1.5rem;
}

.step {
    padding: 0 0 2rem 0;
    position: relative;
}

.step:last-child {
    padding-bottom: 0;
}

.step::before {
    content: '';
    position: absolute;
    left: -2.4rem;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    background: var(--bg);
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.step-num {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.step h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #f0f8ff;
}

.step p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.step code {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 0.1em 0.45em;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    color: var(--accent);
}

/* ── Command Table ── */
.cmd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.cmd-table th {
    text-align: left;
    padding: 0.75rem 1.1rem;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    color: var(--text-faint);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cmd-table td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.cmd-table tr:last-child td { border-bottom: none; }
.cmd-table tr:hover td { background: var(--surface2); }

.cmd-table code {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 0.15em 0.5em;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 0.875em;
    white-space: nowrap;
}

/* ── Info Box ── */
.info-box {
    background: var(--surface2);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 1.5rem 0;
    line-height: 1.6;
}

.warn-box {
    border-left-color: #f59e0b;
}

.info-box strong { color: var(--text); }

/* ── Event Grid ── */
.event-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.event-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.event-row:last-child { border-bottom: none; }
.event-row:hover { background: var(--surface2); }

.event-name {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    min-width: 280px;
}

.event-arrow {
    color: var(--text-faint);
    flex-shrink: 0;
}

.event-action {
    color: var(--text-muted);
}

/* ── Matrix-ID ── */
.matrix-id {
    display: inline-flex;
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.55rem 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--accent);
    margin: 0.75rem 0 1.75rem;
}

/* ── CTA ── */
.cta {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    margin-top: 2rem;
}

/* ── Footer ── */
footer {
    border-top: 1px solid var(--border);
    padding: 2rem 2.5rem;
    color: var(--text-faint);
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer a {
    color: var(--text-faint);
    text-decoration: none;
    transition: color 0.15s;
}

footer a:hover { color: var(--text-muted); }

footer nav {
    position: static;
    background: none;
    border: none;
    padding: 0;
    height: auto;
    gap: 1.5rem;
}

footer nav a {
    font-size: 0.8rem;
}

/* ══════════════════════════════════════════════════════════════
   SEITEN-SPEZIFISCHE KOMPONENTEN
   ══════════════════════════════════════════════════════════════ */

/* ── Pfad-Karten (chatygo.de Startseite) ── */
.paths {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.path-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.path-card.highlight {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(0,201,167,0.06) 100%);
}

.path-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.path-label.streamer { color: var(--accent); }

.path-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f0f8ff;
    letter-spacing: -0.02em;
}

.path-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
}

.path-card code {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    color: var(--accent);
}

.path-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.path-card .btn {
    align-self: flex-start;
}

/* ── Stats ── */
.stats {
    display: flex;
    gap: 3rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.04em;
    font-family: 'Fira Code', monospace;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-faint);
}

/* ── Vergleichs-Tabelle (mitmachen.html) ── */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 1.5rem;
}

.compare-table th {
    text-align: left;
    padding: 0.75rem 1.1rem;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    color: var(--text-faint);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.compare-table th.discord { color: #9b8ddb; }
.compare-table th.matrix  { color: var(--accent); }

.compare-table td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:first-child { color: var(--text-muted); }
.compare-table td:last-child  { color: var(--text); }

/* ── App-Grid (mitmachen.html) ── */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.app-card h3 {
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.app-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.app-card a {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
}

.app-card a:hover { text-decoration: underline; }

/* ── Login-Page Layout (join.chatygo.de) ── */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0,201,167,0.07) 0%, transparent 70%),
        var(--bg);
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.login-card h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    color: #f0f8ff;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Twitch-Button behält Markenfarbe */
.btn-twitch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: #9146ff;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    width: 100%;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-twitch:hover  { background: #772ce8; }
.btn-twitch:active { transform: scale(0.98); }

.btn-twitch svg {
    width: 22px;
    height: 22px;
    fill: white;
    flex-shrink: 0;
}

.target-hint {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(0,201,167,0.3);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

/* Inline-Divider "oder..." */
.text-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-faint);
    font-size: 0.8rem;
}

.text-divider::before,
.text-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Client-Buttons */
.clients {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.client-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem 0.9rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: border-color 0.2s, background 0.2s;
}

.client-btn:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--text);
}

/* Login Info-Box (ohne linken Balken) */
.login-info-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: left;
    line-height: 1.55;
}

.login-info-box code {
    background: var(--surface3);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    color: var(--text);
}

/* Footer unter der Login-Card */
.page-footer {
    margin-top: 2rem;
    color: var(--text-faint);
    font-size: 0.78rem;
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-footer a {
    color: var(--text-faint);
    text-decoration: none;
    transition: color 0.15s;
}

.page-footer a:hover { color: var(--text-muted); }

/* ── Callback/Loading (callback.html) ── */
.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.status-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Fira Code', monospace;
}

.status-icon.success {
    background: var(--accent-dim);
    border: 2px solid var(--accent);
    color: var(--accent);
}

.status-icon.error {
    background: rgba(239,68,68,0.1);
    border: 2px solid #ef4444;
    color: #ef4444;
}

.login-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #f0f8ff;
}

.login-card .callback-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.element-btn {
    display: block;
    background: var(--accent);
    color: #0d1b2a;
    font-weight: 600;
    padding: 0.85rem;
    border-radius: var(--radius);
    text-decoration: none;
    margin-top: 1.25rem;
    text-align: center;
    transition: background 0.2s;
}

.element-btn:hover { background: var(--accent-dark); }

.error-box {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.35);
    border-radius: var(--radius);
    padding: 1rem;
    color: #ef4444;
    margin-top: 1rem;
    font-size: 0.85rem;
    text-align: left;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-top: 1.25rem;
    display: block;
    transition: color 0.15s;
}

.back-link:hover { color: var(--text); }

#loading-view, #redirect-view, #error-view { display: none; }

/* ── Impressum / Datenschutz ── */
.legal-content {
    max-width: 720px;
    margin: 0 auto;
}

.legal-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f0f8ff;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 0.75rem;
}

.legal-content a {
    color: var(--accent);
    text-decoration: none;
}

.legal-content a:hover { text-decoration: underline; }

.legal-content ul {
    padding-left: 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 2;
    margin-bottom: 0.75rem;
}

.placeholder {
    background: var(--surface2);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 0.25em 0.6em;
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    color: #f59e0b;
}

/* ── Bot-Schutz für Kontaktdaten ── */
.eml::after {
    content: attr(data-u) "\40" attr(data-d);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    nav { padding: 0 1.25rem; }
    .hero { padding: 4rem 1.25rem 3rem; }
    section { padding: 3rem 1.25rem; }
    .feature-item:nth-child(2n) { border-right: none; }
    .feature-item { border-right: none; }
    .event-name { min-width: 0; }
    footer { flex-direction: column; gap: 1rem; text-align: center; }
    footer nav { position: static; background: none; border: none; padding: 0; height: auto; }

    /* Seiten-spezifisch */
    .paths { grid-template-columns: 1fr; }
    .stats { gap: 1.5rem; flex-wrap: wrap; }
    .app-grid { grid-template-columns: 1fr; }
    .clients { grid-template-columns: 1fr; }
    .login-card { padding: 2rem 1.5rem; }
}
