:root {
    --bg: #0f1e2e;
    --panel: #16283b;
    --panel-2: #1e3350;
    --accent: #e0a52b;
    --accent-2: #2b8ce0;
    --text: #eef3f8;
    --muted: #9db0c4;
    --danger: #d64545;
    --ok: #3fa65a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--panel);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.topbar h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}
.topbar-actions {
    display: flex;
    gap: 10px;
}
.login-error {
    color: #f08a8a;
    margin: 0;
    font-weight: 600;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text);
    background: #2a3f56;
    transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: #33506e; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-2); }
.btn-primary:hover { background: #3a9bf0; }
.btn-danger { background: var(--danger); }
.btn-ghost { background: transparent; border: 1px solid var(--muted); }
.btn-advance { background: var(--accent); color: #241a00; font-weight: 600; }
.btn-advance:hover { background: #f2b840; }

.hidden { display: none !important; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Verwaltung */
.admin {
    padding: 20px;
    background: var(--panel);
    margin: 16px 20px;
    border-radius: 10px;
}
.add-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.add-form input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #33506e;
    background: #0f2033;
    color: var(--text);
    font-size: 1rem;
}
.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.admin-table th, .admin-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #2a3f56;
    font-size: 0.9rem;
}
.admin-table th { color: var(--muted); font-weight: 600; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-active { background: rgba(63, 166, 90, 0.2); color: #7fdd99; }
.badge-inactive { background: rgba(214, 69, 69, 0.2); color: #f08a8a; }
.badge-left { background: rgba(43, 140, 224, 0.2); color: #8dc6f5; }
.badge-right { background: rgba(224, 165, 43, 0.2); color: #f2ce85; }
.row-actions { display: flex; gap: 6px; }
.row-actions .btn { padding: 4px 10px; font-size: 0.8rem; }
.edit-name {
    width: 100%;
    padding: 6px 8px;
    border-radius: 5px;
    border: 1px solid #33506e;
    background: #0f2033;
    color: var(--text);
    font-size: 0.9rem;
}
.club-select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #33506e;
    background: #0f2033;
    color: var(--text);
    font-size: 0.9rem;
}
.clubs-admin {
    margin-bottom: 16px;
    background: #12263b;
    border: 1px solid #24425f;
    border-radius: 8px;
    padding: 12px 16px;
}
.clubs-admin summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
}
.club-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.club-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 10px;
    background: #0f2033;
    border-radius: 6px;
}
.club-list li.empty {
    justify-content: center;
    color: var(--muted);
    font-style: italic;
}
.club-list .btn { padding: 4px 10px; font-size: 0.8rem; }

/* Board */
.board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}
.column {
    background: var(--panel);
    border-radius: 10px;
    padding: 16px;
    min-height: 300px;
}
.column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.column-head h2 {
    margin: 0;
    font-size: 1.15rem;
}
.cards { display: flex; flex-direction: column; gap: 12px; }

.card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #12263b;
    border: 1px solid #24425f;
    border-radius: 8px;
    padding: 14px 16px;
    opacity: 0.75;
}
.card.current {
    opacity: 1;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(224, 165, 43, 0.35);
    background: #16304a;
}
.card .num {
    font-size: 1.6rem;
    font-weight: 700;
    min-width: 44px;
    text-align: center;
    color: var(--accent);
}
.card .info { flex: 1; }
.card .info .pname { font-size: 1.15rem; font-weight: 600; }
.card .info .pclub { font-size: 0.75rem; color: var(--muted); }
.card .info .plabel { font-size: 0.8rem; color: var(--muted); }
.card .shoot { }

.empty {
    color: var(--muted);
    padding: 20px;
    text-align: center;
    font-style: italic;
}

@media (max-width: 720px) {
    .board { grid-template-columns: 1fr; }
}

/* ===== Reine Anzeige-Ansicht (display.php) für den zweiten Bildschirm ===== */
.display-body {
    height: 100vh;
    overflow: hidden;
}
.display-board {
    height: 100vh;
    padding: 2vh 2vw;
}
.display-stack {
    display: flex;
    flex-direction: column;
    gap: 1.4vh;
    height: 100%;
}
.d-card {
    width: 90%;
    display: flex;
    align-items: center;
    gap: 2vw;
    background: #12263b;
    border: 2px solid #24425f;
    border-radius: 14px;
    padding: 1.5vh 2.5vw;
    flex: 1;
    min-height: 0;
    opacity: 0.6;
    position: relative;
}
.d-card.side-left  { align-self: flex-start; }
.d-card.side-right {
    align-self: flex-end;
    flex-direction: row-reverse;
    text-align: right;
}
.d-card.current {
    opacity: 1;
    border-color: var(--accent);
    background: #17324d;
    box-shadow: 0 0 0 4px rgba(224, 165, 43, 0.4), 0 0 30px rgba(224, 165, 43, 0.25);
}
.display-num {
    font-size: 5vw;
    font-weight: 800;
    color: var(--accent);
    min-width: 10vw;
    text-align: center;
    line-height: 1;
}
.d-card:not(.current) .display-num { color: #6f89a6; }
.display-name {
    flex: 1;
    font-size: 3.4vw;
    font-weight: 700;
    overflow-wrap: anywhere;
    line-height: 1.1;
}
.display-club {
    display: block;
    font-size: 1.9vw;
    font-weight: 500;
    color: var(--muted);
    margin-top: 0.4vh;
}
.display-flag {
    position: absolute;
    top: 1vh;
    font-size: 1.3vw;
    font-weight: 700;
    color: #241a00;
    background: var(--accent);
    padding: 0.4vh 1vw;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.side-left  .display-flag { right: 1.5vw; }
.side-right .display-flag { left: 1.5vw; }
.display-empty {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 2.4vw;
    font-style: italic;
}

