/* =========================================================
   MDT WM2026 – Rasen-Hintergrund + Glas-Oberflächen
   ========================================================= */

:root {
    --mdt-green:        #00A050;
    --mdt-green-strong: #00C75A;
    --mdt-green-deep:   #007A3D;

    /* Glas-Oberflächen: leicht durchscheinend, dunkler Ton */
    --surface:    rgba(20, 28, 22, 0.55);
    --surface-2:  rgba(255, 255, 255, 0.10);
    --surface-3:  rgba(255, 255, 255, 0.06);

    --text:       #F5F5F7;
    --text-muted: rgba(245, 245, 247, 0.68);
    --text-dim:   rgba(245, 245, 247, 0.45);

    --border:     rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.22);

    --shadow:     0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg:  0 14px 50px rgba(0, 0, 0, 0.55);

    --success: #34C759;
    --warning: #FFB340;
    --danger:  #FF453A;

    --radius-card:   16px;
    --radius-input:  12px;
    --radius-modal:  20px;
    --radius-pill:   999px;

    --transition: 0.3s ease;
    --blur:       blur(24px) saturate(160%);

    --header-h: 56px;
    --tabbar-h: 64px;

    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Rasen als globaler Hintergrund + dunkler Verlauf, damit Glas-Karten lesbar bleiben */
body {
    min-height: 100vh;
    background-color: #0a1410;
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 20, 8, 0.65) 100%),
        url('/rasen.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

button {
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, button { font-size: 15px; }
input { color: inherit; }
::placeholder { color: var(--text-dim); }

[hidden] { display: none !important; }

/* =========================================================
   Auth-Screen
   ========================================================= */

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-modal);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
}
.auth-logo {
    display: block;
    width: 120px;
    height: auto;
    margin: 0 auto 16px;
    border-radius: 12px;
    background: #fff;
    padding: 8px;
}
.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px;
    text-align: center;
    letter-spacing: -0.02em;
}
.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    margin: 0 0 24px;
}
.auth-tabs {
    display: flex;
    background: var(--surface-3);
    border: 1px solid var(--border);
    padding: 4px;
    border-radius: var(--radius-pill);
    margin-bottom: 24px;
}
.auth-tab {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}
.auth-tab.is-active {
    background: rgba(255, 255, 255, 0.18);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-error {
    color: var(--danger);
    font-size: 13px;
    margin: 0;
    min-height: 1em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* =========================================================
   Form-Felder
   ========================================================= */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding-left: 4px;
}
.field input,
.field-input {
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 17px;
    color: var(--text);
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}
.field input:focus,
.field-input:focus {
    outline: none;
    border-color: var(--mdt-green-strong);
    background: rgba(255, 255, 255, 0.16);
}
.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 4px;
}
.field-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}
.field-check input { width: 18px; height: 18px; accent-color: var(--mdt-green-strong); }

/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-input);
    font-weight: 600;
    font-size: 15px;
    transition: transform 0.15s ease, background var(--transition), opacity var(--transition);
    min-height: 44px;
    border: 1px solid transparent;
}
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; }
.btn-primary {
    background: linear-gradient(180deg, var(--mdt-green-strong), var(--mdt-green-deep));
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 167, 80, 0.35);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-small {
    padding: 8px 14px;
    font-size: 14px;
    min-height: 36px;
}

/* =========================================================
   App-Layout
   ========================================================= */

.app-screen {
    min-height: 100vh;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: calc(var(--header-h) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: rgba(10, 22, 14, 0.55);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-bottom: 1px solid var(--border);
}
.app-header-inner {
    height: var(--header-h);
    max-width: 920px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.app-logo {
    height: 32px;
    width: auto;
    border-radius: 6px;
    background: #fff;
    padding: 3px;
}
.app-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}
.desktop-nav {
    margin-left: auto;
    display: flex;
    gap: 4px;
    align-items: center;
}
.nav-btn {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}
.nav-btn:hover { color: var(--text); }
.nav-btn.is-active {
    color: #fff;
    background: rgba(0, 167, 80, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

@media (max-width: 720px) {
    .desktop-nav { display: none; }
}

.app-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

/* =========================================================
   Tabs
   ========================================================= */

.tab-panel {
    display: none;
    animation: fadeIn 0.25s ease;
}
.tab-panel.is-active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 4px 4px 0;
}
.panel-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Mobile Tab-Bar */
.tab-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 22, 14, 0.65);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
}
.tab-bar-btn {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    transition: color var(--transition);
}
.tab-bar-btn .tab-icon { font-size: 22px; }
.tab-bar-btn.is-active { color: var(--mdt-green-strong); }

@media (min-width: 721px) {
    .tab-bar { display: none; }
    .app-screen { padding-bottom: 24px; }
}

/* =========================================================
   Spielkarten (Glas)
   ========================================================= */

.game-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.game-group-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 4px 4px 8px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.game-card {
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color var(--transition);
}

.game-day-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 12px;
    opacity: 0.5;
}
.game-card.is-live {
    border-color: rgba(0, 200, 90, 0.5);
    box-shadow: 0 0 0 1px rgba(0, 200, 90, 0.4), var(--shadow);
}

.game-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.game-stage { color: var(--mdt-green-strong); }

.game-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}
.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.team .flag { font-size: 36px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }
.team .name { font-size: 15px; font-weight: 600; }

.game-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 90px;
}
.kickoff-time {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
}
.score-display {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}
.score-display .sep { margin: 0 8px; color: var(--text-muted); }

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 200, 90, 0.25);
    color: var(--mdt-green-strong);
    border: 1px solid rgba(0, 200, 90, 0.4);
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mdt-green-strong);
    animation: pulse 1.2s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0, 200, 90, 0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(0, 200, 90, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 200, 90, 0); }
}

/* Tipp-Bereich */
.tip-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.tip-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.tip-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.tip-value { font-weight: 700; font-size: 17px; }
.tip-points {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(52, 199, 89, 0.25);
    color: #5BE584;
    border: 1px solid rgba(52, 199, 89, 0.4);
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 700;
}
.tip-points.zero {
    background: var(--surface-2);
    color: var(--text-muted);
    border-color: var(--border);
}
.tip-potential {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 179, 64, 0.22);
    color: var(--warning);
    border: 1px solid rgba(255, 179, 64, 0.4);
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 600;
}

.tip-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.tip-input {
    width: 64px;
    padding: 10px;
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    -moz-appearance: textfield;
}
.tip-input::-webkit-outer-spin-button,
.tip-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tip-input:focus {
    outline: none;
    border-color: var(--mdt-green-strong);
    background: rgba(255, 255, 255, 0.18);
}
.tip-form .colon { font-size: 22px; font-weight: 700; color: var(--text-muted); }

.all-tips {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.all-tips summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--mdt-green-strong);
    list-style: none;
}
.all-tips summary::-webkit-details-marker { display: none; }
.all-tips ul {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.all-tips li {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 6px 0;
}
.all-tips .other-points {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.finished-toggle {
    margin-bottom: 24px;
}
.finished-toggle > summary {
    cursor: pointer;
    list-style: none;
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 14px 16px;
    font-weight: 600;
    box-shadow: var(--shadow);
    color: var(--text-muted);
    text-align: center;
}
.finished-toggle > summary::-webkit-details-marker { display: none; }
.finished-toggle[open] > summary { margin-bottom: 12px; }

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--mdt-green-strong);
    font-size: 12px;
    font-weight: 600;
}

/* =========================================================
   Rangliste (Glas)
   ========================================================= */

.leaderboard {
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.lb-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background var(--transition);
}
.lb-row:hover { background: rgba(255, 255, 255, 0.05); }
.lb-row:last-child { border-bottom: none; }
.lb-row.is-self {
    background: rgba(0, 200, 90, 0.18);
}
.lb-rank {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}
.lb-rank.medal { font-size: 24px; }
.lb-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.lb-username { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.lb-stats {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lb-customer {
    color: var(--mdt-green-strong);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lb-quiz {
    display: inline-block;
    margin-left: 6px;
    background: rgba(255, 179, 64, 0.22);
    color: var(--warning);
    border: 1px solid rgba(255, 179, 64, 0.4);
    border-radius: var(--radius-pill);
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
}
.lb-points {
    font-weight: 700;
    font-size: 18px;
    color: var(--mdt-green-strong);
    text-align: right;
    min-width: 60px;
}
.lb-delta {
    font-size: 12px;
    margin-left: 6px;
}
.lb-delta.up   { color: var(--success); }
.lb-delta.down { color: var(--danger); }
.lb-delta.same { color: var(--text-dim); }

/* =========================================================
   Profil (Glas-Stat-Karten)
   ========================================================= */

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px;
    box-shadow: var(--shadow);
}
.stat-card .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 4px;
    color: var(--mdt-green-strong);
}

.card {
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
.card form { display: flex; flex-direction: column; gap: 12px; }

/* =========================================================
   Toaster + Modal
   ========================================================= */

.toaster {
    position: fixed;
    bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: rgba(20, 20, 22, 0.85);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 500;
    animation: toastIn 0.25s ease, toastOut 0.25s ease 2.5s forwards;
    pointer-events: auto;
}
.toast.success { background: rgba(52, 199, 89, 0.85); border-color: rgba(52, 199, 89, 0.6); color: #fff; }
.toast.error   { background: rgba(255, 69, 58, 0.85); border-color: rgba(255, 69, 58, 0.6); color: #fff; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(8px); } }

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal-card {
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-modal);
    padding: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow-lg);
}
.modal-card h3 { margin: 0 0 8px; font-size: 18px; }
.modal-card p  { margin: 0 0 20px; color: var(--text-muted); }
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* =========================================================
   Spinner & States
   ========================================================= */

.spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Loading-/Fehler-Zustand für Spiele-Tab */
.games-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 56px 16px 40px;
    color: var(--text-muted);
    text-align: center;
}
.games-loading .spinner {
    width: 36px;
    height: 36px;
    border-width: 3px;
    color: var(--mdt-green-strong);
}
.games-loading p { margin: 0; font-size: 14px; }
.games-loading .muted { font-size: 13px; color: var(--text-dim); }
.games-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.games-error-icon { font-size: 36px; line-height: 1; }
.games-error p { margin: 0; }
.games-error button { margin-top: 10px; }

.flash {
    animation: flash 0.6s ease;
}
@keyframes flash {
    0%   { background-color: rgba(0, 200, 90, 0.3); }
    100% { background-color: transparent; }
}

/* =========================================================
   Gruppentabellen (Glas)
   ========================================================= */

.groups-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 4px 16px;
    line-height: 1.4;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.group-card {
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow-x: auto;
}
.group-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--mdt-green-strong);
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}
.group-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}
.group-table th, .group-table td {
    padding: 10px 4px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.group-table th {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.group-table tr:last-child td { border-bottom: none; }
.group-table .g-pos { width: 28px; color: var(--text-muted); font-weight: 600; }
.group-table .g-team {
    text-align: left;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.group-table .g-flag { font-size: 18px; margin-right: 6px; vertical-align: -2px; }
.group-table tr.g-qualifier .g-pos {
    color: var(--mdt-green-strong);
    position: relative;
}
.group-table tr.g-qualifier .g-pos::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 2px;
    background: var(--mdt-green-strong);
}

@media (max-width: 480px) {
    .group-table { font-size: 13px; }
    .group-table th, .group-table td { padding: 8px 2px; }
    .group-table .g-flag { font-size: 16px; margin-right: 4px; }
}

/* =========================================================
   Admin (Glas-Tabellen)
   ========================================================= */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.admin-table th {
    background: rgba(255, 255, 255, 0.06);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .filter-row input {
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    width: 100%;
    color: var(--text);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
}
.badge.live      { background: rgba(0, 200, 90, 0.25);  color: var(--mdt-green-strong); border-color: rgba(0,200,90,0.4); }
.badge.finished  { background: rgba(52, 199, 89, 0.22); color: #5BE584; border-color: rgba(52,199,89,0.4); }
.badge.scheduled { background: var(--surface-2); color: var(--text-muted); }
.badge.inactive  { background: rgba(255, 69, 58, 0.22); color: var(--danger); border-color: rgba(255,69,58,0.4); }

.score-edit {
    width: 50px;
    padding: 6px;
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text);
}
.score-edit:focus {
    outline: none;
    border-color: var(--mdt-green-strong);
    background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 720px) {
    .admin-table thead { display: none; }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
    .admin-table { background: transparent; backdrop-filter: none; border: none; box-shadow: none; }
    .admin-table tr {
        background: var(--surface);
        backdrop-filter: var(--blur);
        -webkit-backdrop-filter: var(--blur);
        border: 1px solid var(--border);
        border-radius: var(--radius-card);
        margin-bottom: 8px;
        padding: 8px 12px;
    }
    .admin-table td { border: none; padding: 4px 0; }
    .admin-table td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--text-muted); }
}

/* =========================================================
   Spielerdetails-Drawer
   ========================================================= */

.drawer-card {
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow: auto;
}
.drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.drawer-head h3 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.01em;
}
.drawer-head p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}
.user-tips-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.user-tips-table th,
.user-tips-table td {
    padding: 10px 6px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.user-tips-table th {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.user-tips-table tr:last-child td { border-bottom: none; }
.ut-stage { font-size: 11px; color: var(--mdt-green-strong); text-transform: uppercase; letter-spacing: 0.04em; }
.ut-teams { font-weight: 600; }
.ut-vs    { color: var(--text-dim); margin: 0 4px; font-weight: 400; }
.ut-time  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ut-tip, .ut-result { font-size: 16px; text-align: center; min-width: 56px; }
.ut-points {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    min-width: 44px;
}
.ut-points.pos  { color: var(--mdt-green-strong); }
.ut-points.zero { color: var(--text-muted); }

@media (max-width: 480px) {
    .user-tips-table { font-size: 13px; }
    .user-tips-table th, .user-tips-table td { padding: 8px 3px; }
}

/* =========================================================
   VorabQuiz
   ========================================================= */

.quiz-intro {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 4px 12px;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.quiz-status {
    margin: 0 4px 16px;
    padding: 10px 14px;
    border-radius: var(--radius-input);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}
.quiz-status.locked { background: rgba(255, 69, 58, 0.18); color: var(--text); border-color: rgba(255, 69, 58, 0.4); }
.quiz-status.open   { background: rgba(0, 200, 90, 0.18); color: var(--text); border-color: rgba(0, 200, 90, 0.4); }

.quiz-question { margin-bottom: 8px; }
.quiz-points-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 179, 64, 0.22);
    color: var(--warning);
    border: 1px solid rgba(255, 179, 64, 0.4);
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

select.field-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                      linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) center, calc(100% - 12px) center;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    padding-right: 36px;
}
select.field-input option { background: #1c1f1c; color: var(--text); }

.quiz-eval { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.quiz-eval-row {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    padding: 12px 14px;
}
.quiz-eval-row.ok    { border-color: rgba(0, 200, 90, 0.5); background: rgba(0, 200, 90, 0.12); }
.quiz-eval-row.miss  { border-color: rgba(255, 69, 58, 0.4); background: rgba(255, 69, 58, 0.10); }
.quiz-eval-row .qe-q { font-weight: 600; margin-bottom: 6px; }
.quiz-eval-row .qe-line { font-size: 13px; color: var(--text-muted); margin-bottom: 2px; }
.quiz-eval-row .qe-line strong { color: var(--text); }
.quiz-eval-row .qe-points { margin-top: 6px; font-weight: 700; }
.quiz-eval-row.ok    .qe-points { color: var(--mdt-green-strong); }
.quiz-eval-row.miss  .qe-points { color: var(--danger); }
.quiz-eval-row.empty .qe-points { color: var(--text-dim); }
.quiz-result h3 { margin-top: 0; }

/* =========================================================
   Regelwerk
   ========================================================= */

.rules-card h4.rules-h {
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--mdt-green-strong);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rules-card h4.rules-h:first-of-type { margin-top: 4px; }
.rules-text {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}
.rules-list {
    margin: 0 0 8px;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}
.rules-list li { margin-bottom: 4px; }
.rules-list li strong { color: var(--text); }
.rules-list.small { font-size: 13px; }

.rules-table-wrap {
    overflow-x: auto;
    margin: 8px 0 12px;
    border-radius: var(--radius-input);
    border: 1px solid var(--border);
}
.rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 360px;
}
.rules-table th, .rules-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.rules-table th {
    background: rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rules-table th:first-child,
.rules-table td:first-child { text-align: left; }
.rules-table tr:last-child td { border-bottom: none; }
