/* Schiedsrichter-App — Mobile-First */

/* ---- Layout ---- */
.wt_body--judge {
    background: var(--wt-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Doppeltipp-Zoom deaktivieren, Scrollen bleibt möglich */
    touch-action: manipulation;
}

/* Alle interaktiven Elemente ebenfalls */
.wt_body--judge button,
.wt_body--judge a,
.wt_body--judge input,
.wt_body--judge textarea {
    touch-action: manipulation;
}

/* Floating Top-Header */
.wt_top-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 16px;
    background: linear-gradient(to bottom, var(--wt-bg) 70%, transparent);
    pointer-events: none;
}
.wt_top-header > * { pointer-events: auto; }

/* Scroll-Bereich */
.wt_scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-top: 64px;    /* Platz für Top-Header */
    padding-bottom: 100px; /* Platz für Tab-Bar */
}
.wt_scroll::-webkit-scrollbar { width: 0; }

/* ---- Tab-Bar ---- */
.wt_tabbar {
    position: fixed;
    left: 12px; right: 12px; bottom: 16px;
    height: 64px;
    border-radius: 24px;
    background: var(--wt-surface);
    border: 1px solid var(--wt-border);
    box-shadow: var(--wt-shadow-md);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 50;
    backdrop-filter: blur(20px);
}
.wt_tabbar__btn {
    appearance: none;
    background: transparent;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--wt-text-subtle);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: 24px;
    position: relative;
    padding: 0;
    transition: color 150ms ease;
}
.wt_tabbar__btn--active { color: var(--wt-red); }
.wt_tabbar__btn--active::before {
    content: '';
    position: absolute;
    top: 8px;
    width: 22px; height: 3px;
    background: var(--wt-red);
    border-radius: 999px;
}
.wt_tabbar__btn svg { width: 18px; height: 18px; }

/* Kein Tab-Bar auf Login/Confirm-Seiten */
.wt_scroll--no-tabbar { padding-bottom: 32px; }

/* ---- Tab-Badge (Ungelesen-Zähler) ---- */
.wt_tab-badge {
    position: absolute;
    top: -4px; right: -8px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--wt-red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ---- Score-Card (Aktiv Tab: letzte Bewertungen) ---- */
.wt_score-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--wt-surface);
    border: 1px solid var(--wt-border);
    border-radius: var(--wt-r-lg);
    margin-bottom: 8px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 120ms ease;
    appearance: none;
}
.wt_score-card:active { background: var(--wt-surface-alt); }

/* ---- Verlauf-Gruppen ---- */
.wt_group-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--wt-border);
}
.wt_group-row:last-child { border-bottom: 0; }
.wt_group-row--pending { opacity: 0.55; }

/* ---- Chat ---- */
.wt_chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 18px 14px;
}
.wt_chat-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}
.wt_chat-bubble--zentrale {
    align-self: flex-start;
    background: var(--wt-surface);
    border: 1px solid var(--wt-border);
    border-bottom-left-radius: 6px;
    color: var(--wt-text);
}
.wt_chat-bubble--judge {
    align-self: flex-end;
    background: var(--wt-red);
    color: #fff;
    border-bottom-right-radius: 6px;
}
.wt_chat-meta {
    font-size: 10px;
    color: var(--wt-text-subtle);
    margin-top: 3px;
    font-family: 'JetBrains Mono', monospace;
}
.wt_chat-meta--right { text-align: right; }

/* ---- Chat-Eingabe (über Tab-Bar) ---- */
.wt_chat-input-bar {
    position: fixed;
    left: 12px; right: 12px;
    bottom: 92px;
    background: var(--wt-surface);
    border: 1px solid var(--wt-border);
    border-radius: 18px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 8px 8px 14px;
    box-shadow: var(--wt-shadow-md);
    z-index: 40;
}
.wt_chat-input-bar textarea {
    flex: 1;
    border: 0;
    background: transparent;
    font-size: 16px; /* verhindert iOS-Zoom beim Fokus */
    font-family: inherit;
    font-size: 14px;
    color: var(--wt-text);
    resize: none;
    max-height: 80px;
    outline: none;
    line-height: 1.4;
    padding: 2px 0;
}
.wt_chat-input-bar textarea::placeholder { color: var(--wt-text-subtle); }
.wt_chat-send-btn {
    width: 36px; height: 36px;
    border-radius: 12px;
    background: var(--wt-red);
    border: 0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 120ms ease;
}
.wt_chat-send-btn:disabled { opacity: 0.4; cursor: default; }

/* Chat-Scroll: extra Platz für Eingabeleiste */
.wt_scroll--chat { padding-bottom: 168px; }

/* ---- Seiten-Padding ---- */
.wt_page { padding: 8px 18px; }
.wt_page + .wt_page { padding-top: 0; }

/* ---- Login ---- */
.wt_login-hero    { padding: 28px 24px 16px; }
.wt_login-scanner { padding: 8px 24px 20px; }
.wt_login-actions { padding: 0 24px; display: flex; flex-direction: column; gap: 10px; }

/* ---- Dashboard ---- */
.wt_cta-btn {
    height: 64px;
    font-size: 16px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(212,38,58,0.25), inset 0 1px 0 rgba(255,255,255,0.18);
}

/* ---- Gruppen-Banner (invertiert) ---- */
.wt_group-banner {
    background: var(--wt-text);
    color: var(--wt-bg);
    border-radius: var(--wt-r-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.wt_group-banner .wt_group-num {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* ---- Stopwatch ---- */
.wt_stopwatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px 12px 14px;
}
.wt_stopwatch__face {
    font-family: 'JetBrains Mono', monospace;
    font-size: 48px;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.wt_stopwatch__ms {
    font-size: 28px;
    color: var(--wt-text-subtle);
    font-weight: 500;
}
.wt_stopwatch__controls {
    display: flex;
    gap: 10px;
    width: 100%;
}
.wt_stopwatch__controls .wt_btn { flex: 1; }

/* ---- Impression-Auswahl ---- */
.wt_impression-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 14px;
}
.wt_impression-btn {
    appearance: none;
    border: 1px solid var(--wt-border-strong);
    background: var(--wt-surface);
    color: var(--wt-text);
    padding: 12px 6px 10px;
    border-radius: var(--wt-r-md);
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: background 120ms ease, border-color 120ms ease;
}
.wt_impression-btn__num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    opacity: 0.5;
}
.wt_impression-btn__label {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: -0.005em;
}
.wt_impression-btn--active {
    background: var(--wt-red);
    border-color: var(--wt-red);
    color: #fff;
    box-shadow: 0 4px 12px rgba(212,38,58,0.20);
}
.wt_impression-btn--active .wt_impression-btn__num { opacity: 0.85; }

/* ---- Confirm-Zusammenfassung ---- */
.wt_summary-total {
    font-family: 'JetBrains Mono', monospace;
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 0.95;
}
.wt_summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
}
.wt_summary-row__label { color: var(--wt-text-muted); }
.wt_summary-row__value { font-weight: 600; }

/* ---- Verlauf ---- */
.wt_history-fp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 600;
}

/* ---- Profil ---- */
.wt_profile-avatar {
    width: 64px; height: 64px;
    border-radius: 18px;
    background: var(--wt-red-tint);
    color: var(--wt-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    flex-shrink: 0;
}

/* ---- Abstand-Helfer ---- */
.wt_gap-sm  { display: flex; flex-direction: column; gap: 10px; }
.wt_gap-md  { display: flex; flex-direction: column; gap: 16px; }
.wt_section { padding: 0 18px 14px; }

/* ---- Typografie-Helfer ---- */
.wt_h1 {
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}
.wt_eyebrow {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--wt-text-subtle);
}
.wt_caption {
    font-size: 12px;
    line-height: 1.4;
    color: var(--wt-text-subtle);
}

/* ---- Station-Chip & Sync-Pill ---- */
.wt_station-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 12px 0 10px;
    border-radius: 999px;
    background: var(--wt-red);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.18);
    white-space: nowrap;
}
.wt_dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
    flex-shrink: 0;
}
.wt_sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--wt-surface);
    border: 1px solid var(--wt-border);
    font-size: 11px;
    font-weight: 600;
    color: var(--wt-text-muted);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.wt_pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.wt_pulse--online {
    background: var(--wt-ok);
    animation: wtPulse 2.4s ease-in-out infinite;
}
.wt_pulse--offline { background: var(--wt-warn); }
@keyframes wtPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(31,122,77,0); }
    50%      { box-shadow: 0 0 0 6px rgba(31,122,77,0.25); }
}

/* ---- Fortschrittsbalken ---- */
.wt_progress-track {
    display: flex;
    gap: 6px;
    padding: 0 0 4px;
}
.wt_progress-step {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: var(--wt-border-strong);
    transition: background 200ms ease;
}
.wt_progress-step--active { background: var(--wt-red); }
.wt_progress-step--done   { background: var(--wt-text); }

/* ---- Listenzeilen ---- */
.wt_list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wt-border);
}
.wt_list-row:last-child { border-bottom: 0; }

.wt_row-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wt-border);
}
.wt_row-line:last-child { border-bottom: 0; }
.wt_row-label {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
}
.wt_row-sub {
    font-size: 12px;
    color: var(--wt-text-subtle);
    font-weight: 500;
    margin-top: 2px;
}

/* ---- Gruppe ---- */
.wt_group-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 12px;
    background: var(--wt-red-tint);
    color: var(--wt-red);
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}
.wt_group-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--wt-text-subtle);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
    flex-wrap: wrap;
}
.wt_sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--wt-border-strong);
    display: inline-block;
    flex-shrink: 0;
}

/* ---- Check-Toggle (OK / Fehler) ---- */
.wt_check-toggle {
    display: inline-flex;
    background: var(--wt-surface-alt);
    border-radius: 999px;
    padding: 3px;
    gap: 0;
    flex-shrink: 0;
}
.wt_check-toggle__ok,
.wt_check-toggle__fail {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 6px 12px;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 600;
    font-size: 12px;
    color: var(--wt-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background 120ms ease, color 120ms ease;
}
.wt_check-toggle__ok--active {
    background: var(--wt-ok);
    color: #fff;
}
.wt_check-toggle__fail--active {
    background: var(--wt-red);
    color: #fff;
}

/* ---- Total-Pill ---- */
.wt_total-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--wt-red-tint);
    color: var(--wt-red);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Btn-Dark (Stopp) ---- */
.wt_btn--dark {
    background: var(--wt-text);
    color: var(--wt-bg);
}

/* ---- Fade-In Animation ---- */
.wt_fade-in {
    animation: wtFadeIn 220ms ease-out;
}
@keyframes wtFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Desktop */
@media (min-width: 1024px) {
    .wt_scroll { max-width: 480px; margin: 0 auto; }
    .wt_tabbar { left: calc(50% - 240px + 12px); right: calc(50% - 240px + 12px); }
    .wt_top-header { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
