/* Global Layout */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Autodarts-ähnlicher Hintergrund: sanfter blauer Verlauf */
    background: radial-gradient(circle at center,
        #0f5fb8 0,
        #094389 35%,
        #031227 70%,
        #000000 100%);
    color: #f4f7ff;
}

a {
    color: #9bd0ff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Obere Leiste */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px 4px;
    font-size: 14px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: #e5e7eb;
}

.logo:hover {
    text-decoration: none;
}

.user-info {
    font-size: 13px;
    color: #e5e7eb;
}

.btn-small {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-size: 12px;
}

.btn-small:hover {
    background: rgba(30, 64, 175, 0.95);
    text-decoration: none;
}

/* Hauptbereich: Card zentrieren */
.content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 8px 32px;
}

/* Footer unten rechts */
.footer {
    margin-top: auto;
    padding: 4px 24px 10px;
    text-align: right;
    font-size: 12px;
    color: #9fb6e1;
}

/* Zentrale Karte */
.card {
    width: 100%;
    max-width: 1100px;
    background: rgba(3, 12, 30, 0.92);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
    padding: 20px 24px 24px;
    border: 1px solid rgba(36, 99, 235, 0.35);
}

h1 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 26px;
    letter-spacing: 0.03em;
}

h2 {
    margin-top: 16px;
    margin-bottom: 6px;
    font-size: 20px;
}

h3 {
    margin-top: 10px;
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 500;
}

p {
    margin: 4px 0;
    font-size: 14px;
}

.info {
    font-size: 13px;
    color: #9fb6e1;
}

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #22c55e);
    font-size: 11px;
    color: #f9fafb;
}

.error {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.7);
    font-size: 13px;
}

.success {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.7);
    font-size: 13px;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    border-radius: 999px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    color: #f9fafb;
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.35);
    transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.06s ease;
}

button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.55);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.45);
}

.btn-secondary {
    margin-top: 8px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.9);
    color: #e5e7eb;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.7);
    padding: 5px 14px;
    font-size: 12px;
}

.btn-secondary:hover {
    filter: brightness(1.08);
}

/* Tabs oben */
.tabs {
    display: flex;
    margin-top: 16px;
    border-bottom: 1px solid rgba(30, 64, 175, 0.8);
}

.tabs a {
    padding: 8px 16px;
    margin-right: 6px;
    border-radius: 999px 999px 0 0;
    background: transparent;
    color: #cbd5ff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    position: relative;
    top: 1px;
}

.tabs a.active {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #f9fafb;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.6);
}

.tabs a:not(.active):hover {
    background: rgba(15, 23, 42, 0.95);
}

/* Scoreboard – zwei große Boxen wie bei Autodarts */
.scoreboard {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

/* große, ruhige Box ohne fetten Neon-Glow */
.player-box {
    background: linear-gradient(
        to bottom,
        rgba(32, 73, 135, 0.95),
        rgba(19, 47, 92, 0.98)
    );
    border-radius: 18px;
    border: 1px solid rgba(209, 213, 219, 0.25);
    padding: 16px 20px 18px;
    box-shadow:
        0 14px 28px rgba(15, 23, 42, 0.75),
        0 0 20px rgba(15, 23, 42, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player-name {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Score-Controls */
.score-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.9);
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

/* Zahl in der Mitte – groß & glatt */
.score-input {
    width: 3.2em;
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    background: transparent;
    border: none;
    color: #f9fafb;
    outline: none;
}

/* Spinner (Pfeile) bei number-Inputs ausblenden */
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.score-input[type=number] {
    -moz-appearance: textfield;
}

/* runde + / − Buttons */
.score-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(180deg, #1f2937, #020617);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-size: 22px;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.score-btn:hover {
    filter: brightness(1.2);
}

.score-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.9);
}

/* Tabelle */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.table th,
.table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(30, 64, 175, 0.6);
}

.table thead th {
    text-align: left;
    font-weight: 600;
    color: #e5e7ff;
    background: rgba(15, 23, 42, 0.95);
}

.table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.8);
}

.table tbody tr:nth-child(odd) {
    background: rgba(15, 23, 42, 0.6);
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.22);
}

/* Formulare – Neues Turnier, Login etc. */
.new-tournament-form {
    margin-top: 10px;
    font-size: 13px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
}

.form-row-2 .form-field {
    flex: 1 1 260px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-size: 13px;
    color: #e5e7eb;
}

.new-tournament-form input[type="text"],
.new-tournament-form input[type="number"],
.new-tournament-form input[type="password"],
.new-tournament-form select {
    width: 100%;
    max-width: 280px;
    background: rgba(8, 28, 62, 0.97);
    border-radius: 999px;
    border: 1px solid rgba(107, 145, 220, 0.9);
    padding: 6px 10px;
    font-size: 13px;
    color: #f4f7ff;
    outline: none;
    margin-top: 3px;
}

.new-tournament-form input[type="text"]:focus,
.new-tournament-form input[type="number"]:focus,
.new-tournament-form input[type="password"]:focus,
.new-tournament-form select:focus {
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.95);
    border-color: rgba(129, 140, 248, 0.95);
}

/* Spieler-Eingabefelder */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 20px;
    margin-top: 8px;
}

/* Gruppenblöcke in der Übersicht */
.event-block {
    margin-top: 18px;
}

/* Mobile: Scoreboard untereinander */
@media (max-width: 720px) {
    .scoreboard {
        grid-template-columns: 1fr;
    }
}

/* Radio-Bereich oben */
.radio-inline {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-inline .radio-player,
.radio-inline audio {
    max-width: 260px;
}

.tv-controls {
    margin-top: 4px;
}
