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

:root {
    --gold: #d4af37;
    --gold-light: #f5e6a3;
    --gold-dark: #b8942e;
    --bg-dark: #0a0c10;
    --bg-card: #11151c;
    --border-glow: rgba(212, 175, 55, 0.3);
    --red: #dc2626;
    --green: #10b981;
    --blue: #3b82f6;
}

body {
    background: linear-gradient(135deg, #0a0c10 0%, #0f1118 50%, #141822 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, sans-serif;
    color: #eef2ff;
    padding: 1.5rem;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 2px solid var(--gold);
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
    border-radius: 20px 20px 0 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.logo-img {
    height: 70px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-gentleman {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 6px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 40%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.logo-jack {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 2px;
}

.logo-jack span {
    color: #8B7355;
    font-weight: 400;
}

.logo-turnier {
    font-size: 0.85rem;
    color: #9ca3af;
    letter-spacing: 3px;
}

.logo-fc26 {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #0a0c10;
    display: inline-block;
    margin-left: 0.5rem;
}

/* ===== ADMIN CONTROLS ===== */
.admin-controls {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-btn {
    background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glow);
    color: #eef2ff;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.admin-btn:hover {
    background: var(--gold);
    color: #0a0c10;
    border-color: var(--gold);
}

.history-btn {
    background: linear-gradient(135deg, #1e3a5f, #0f2b44);
    border: 1px solid var(--gold);
}

.reset-all-btn {
    background: rgba(127, 29, 29, 0.9);
    border-color: var(--red);
}

.reset-all-btn:hover {
    background: var(--red);
    color: white;
}

/* ===== LAYOUT ===== */
.full-width-section {
    margin-bottom: 2rem;
}

.two-columns {
    display: flex;
    gap: 1.8rem;
    flex-wrap: wrap;
}

.left-col {
    flex: 1.2;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.right-col {
    flex: 1.8;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== SECTIONS ===== */
.section {
    background: rgba(17, 21, 28, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 1.3rem;
    border: 1px solid var(--border-glow);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
}

.section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-left: 4px solid var(--gold);
    padding-left: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

th {
    padding: 0.7rem 0.3rem;
    text-align: center;
    color: var(--gold);
    font-weight: 600;
    border-bottom: 1px solid var(--border-glow);
}

td {
    padding: 0.6rem 0.3rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th:first-child,
td:first-child {
    text-align: left;
}

.team-name-cell {
    cursor: pointer;
    transition: color 0.2s;
    font-weight: 500;
}

.team-name-cell:hover {
    color: var(--gold);
    text-decoration: underline;
}

.match-team-clickable {
    cursor: pointer;
    transition: color 0.2s;
}

.match-team-clickable:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* ===== FAIRNESS ===== */
.fairness-row-fair {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), transparent);
    border-left: 3px solid var(--green);
}

.fairness-row-unfair {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.2), transparent);
    border-left: 3px solid var(--red);
}

/* ===== STATS COMBINED ===== */
.stats-combined {
    background: linear-gradient(135deg, rgba(17, 21, 28, 0.95), rgba(10, 12, 16, 0.95));
    border-radius: 24px;
    padding: 1rem;
    border: 1px solid var(--gold);
}

.stats-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.stat-card {
    flex: 1;
    min-width: 150px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    padding: 0.8rem;
    border: 1px solid var(--border-glow);
}

.stat-card h3 {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    text-align: center;
    color: var(--gold-light);
}

.stat-list {
    list-style: none;
}

.stat-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
}

.stat-list .rank {
    color: var(--gold);
    font-weight: bold;
    width: 25px;
}

.stat-list .name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-list .value {
    font-weight: 600;
    color: var(--blue);
}

/* ===== MATCH SCORE ===== */
.spielstand {
    font-weight: 700;
    font-family: monospace;
    font-size: 1rem;
    color: var(--gold);
}

.halbzeit-stand {
    font-size: 0.65rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}

.badge {
    background: rgba(30, 41, 59, 0.8);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.65rem;
}

.badge-live {
    background: var(--red);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* ===== NEW MATCH PANEL ===== */
.new-match-panel {
    background: rgba(212, 175, 55, 0.08);
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.new-match-panel select,
.new-match-panel button {
    background: #1a1f2e;
    border: 1px solid #334155;
    border-radius: 40px;
    padding: 0.6rem 1rem;
    color: white;
    font-size: 0.85rem;
}

/* ===== TEAM PICKER ===== */
.team-picker {
    background: linear-gradient(135deg, #1a1f2e, #11151c);
    border-radius: 20px;
    padding: 1rem;
    border: 1px solid var(--border-glow);
}

.team-picker h3 {
    color: var(--gold);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.team-selection {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.team-slot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 40px;
}

.team-slot-label {
    width: 100px;
    font-weight: bold;
    color: var(--gold);
}

.team-search-input {
    flex: 2;
    min-width: 180px;
    background: #1a1f2e;
    border: 1px solid #334155;
    border-radius: 40px;
    padding: 0.5rem 1rem;
    color: white;
    font-size: 0.8rem;
}

.coach-input {
    width: 140px;
    background: #1a1f2e;
    border: 1px solid #334155;
    border-radius: 40px;
    padding: 0.5rem 1rem;
    color: white;
    font-size: 0.8rem;
}

.remove-team-btn {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0.5rem;
    opacity: 0.7;
}

.remove-team-btn:hover {
    opacity: 1;
}

.add-team-btn {
    background: var(--gold);
    border: none;
    border-radius: 40px;
    padding: 0.4rem 1rem;
    font-weight: bold;
    color: #0a0c10;
    cursor: pointer;
    margin-top: 0.5rem;
}

.reset-teams-btn {
    background: rgba(220, 38, 38, 0.8);
    border: none;
    border-radius: 40px;
    padding: 0.4rem 1rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* ===== AUTOCOMPLETE ===== */
.team-autocomplete-list {
    position: absolute;
    background: #1a1f2e;
    border: 1px solid var(--gold);
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: auto;
    min-width: 200px;
}

.team-autocomplete-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.team-autocomplete-item:hover {
    background: rgba(212, 175, 55, 0.2);
}

/* ===== LINKS ===== */
.details-link,
.delete-match-link {
    text-decoration: none;
    font-size: 0.7rem;
    cursor: pointer;
    margin-right: 0.5rem;
}

.details-link {
    color: var(--blue);
}

.delete-match-link {
    color: var(--red);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(16px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #0f1219;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 28px;
    padding: 1.5rem;
    border: 1px solid var(--gold);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.6);
}

.close-modal {
    float: right;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    color: #9ca3af;
    transition: 0.2s;
}

.close-modal:hover {
    color: var(--gold);
}

/* ===== SCORE ROW ===== */
.score-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    background: #0a0d14;
    border-radius: 28px;
    padding: 1rem;
    border: 1px solid #2a2e3a;
    margin-bottom: 1rem;
}

.score-card {
    text-align: center;
    flex: 1;
    background: linear-gradient(135deg, #12161f, #0a0d14);
    border-radius: 24px;
    padding: 1rem;
    border: 1px solid var(--border-glow);
}

.score-card .team-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
}

.score-card .score-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--gold-light);
    line-height: 1;
    margin: 0.5rem 0;
}

.halbzeit-label {
    display: inline-block;
    background: #1e1f2e;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--gold);
    margin-top: 0.3rem;
}

/* ===== EVENT BUILDER ===== */
.event-builder-card {
    background: #0a0d14;
    border-radius: 24px;
    padding: 1.2rem;
    border: 1px solid #2a2e3a;
    margin-bottom: 1rem;
}

.event-builder-card h4 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.event-input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 1rem;
}

.event-input-group input,
.event-input-group select {
    background: #1a1f2e;
    border: 1px solid #334155;
    border-radius: 40px;
    padding: 0.6rem 1rem;
    color: white;
    font-size: 0.85rem;
}

.minute-input {
    width: 80px;
}

.add-event-btn {
    background: var(--gold);
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 40px;
    font-weight: 600;
    color: #0a0c10;
    cursor: pointer;
    transition: 0.2s;
}

.add-event-btn:hover {
    background: var(--gold-light);
    transform: scale(1.02);
}

.events-dual {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.events-column {
    flex: 1;
    background: #05070c;
    border-radius: 20px;
    padding: 0.8rem;
    border: 1px solid #2a2e3a;
}

.events-column h5 {
    color: var(--gold);
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
    border-left: 3px solid var(--gold);
    padding-left: 0.6rem;
}

.event-list {
    max-height: 200px;
    overflow-y: auto;
    min-height: 100px;
}

.event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.3rem;
    border-bottom: 1px solid #1f2937;
    font-family: monospace;
    font-size: 0.75rem;
}

.event-minute {
    color: var(--gold);
    font-weight: bold;
    min-width: 40px;
}

.event-text {
    flex: 1;
    text-align: left;
}

.event-remove {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 0.2rem;
    opacity: 0.7;
}

.event-remove:hover {
    opacity: 1;
}

/* ===== STATS DUAL ===== */
.stats-dual {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.stats-team-card {
    flex: 1;
    background: #0a0d14;
    border-radius: 20px;
    padding: 1rem;
    border: 1px solid #2a2e3a;
}

.stats-team-card h4 {
    color: var(--gold);
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    border-left: 3px solid var(--gold);
    padding-left: 0.6rem;
}

.stat-table {
    width: 100%;
    border-collapse: collapse;
}

.stat-table tr td:first-child {
    width: 140px;
    text-align: left;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.4rem 0;
}

.stat-table tr td:last-child {
    text-align: right;
    padding: 0.4rem 0;
}

.stat-value-input {
    background: #1a1f2e;
    border: 1px solid #334155;
    border-radius: 30px;
    padding: 0.35rem 0.6rem;
    text-align: center;
    color: white;
    width: 100px;
    font-size: 0.8rem;
}

.stat-value-text {
    background: #1a1f2e;
    border-radius: 30px;
    padding: 0.35rem 0.8rem;
    display: inline-block;
    min-width: 70px;
    text-align: center;
    font-size: 0.8rem;
    color: #eef2ff;
}

/* ===== INTERVIEW ===== */
.interview-area {
    background: #0a0d14;
    border-radius: 20px;
    padding: 1rem;
    margin-top: 1rem;
}

.interview-area textarea {
    width: 100%;
    background: #1a1f2e;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 0.8rem;
    color: white;
    resize: vertical;
    font-family: inherit;
    font-size: 0.8rem;
}

/* ===== MOTM ===== */
.motm-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.motm-row select {
    flex: 2;
    background: #1a1f2e;
    border: 1px solid #334155;
    border-radius: 40px;
    padding: 0.6rem 1rem;
    color: white;
}

.motm-row input {
    width: 120px;
    background: #1a1f2e;
    border: 1px solid #334155;
    border-radius: 40px;
    padding: 0.6rem 1rem;
    text-align: center;
    color: white;
}

/* ===== LIVE CHECK ===== */
.live-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

/* ===== SAVE BUTTON ===== */
button.save-btn {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 40px;
    margin-top: 1.5rem;
    cursor: pointer;
    color: #0a0c10;
    transition: 0.2s;
}

button.save-btn:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

/* ===== LOGIN OVERLAY ===== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.login-box {
    background: linear-gradient(135deg, #111418, #0a0d14);
    padding: 2.5rem;
    border-radius: 32px;
    border: 2px solid var(--gold);
    text-align: center;
    min-width: 320px;
}

.login-box h2 {
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.login-box input {
    background: #1a1f2e;
    border: 1px solid #334155;
    border-radius: 40px;
    padding: 0.8rem 1rem;
    color: white;
    width: 100%;
    margin-bottom: 1rem;
}

.login-box button {
    background: var(--gold);
    border: none;
    padding: 0.7rem 2rem;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* ===== SQUAD MODAL ===== */
.squad-modal .modal-content {
    max-width: 1000px;
}

.squad-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}

.squad-table th,
.squad-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #334155;
}

.squad-table th {
    background: #1e293b;
    color: var(--gold);
}

.position-badge {
    background: rgba(212, 175, 55, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    display: inline-block;
}

.rating-badge {
    background: var(--gold-dark);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
}

/* ===== HISTORY ===== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-glow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-item:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: translateX(5px);
}

.history-item-info {
    flex: 1;
}

.history-item .tourney-name {
    font-weight: bold;
    color: var(--gold);
    font-size: 1.1rem;
}

.history-item .tourney-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

.history-item .tourney-stats {
    font-size: 0.7rem;
    margin-top: 0.3rem;
}

.delete-archive-btn {
    background: rgba(220, 38, 38, 0.8);
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    color: white;
    transition: 0.2s;
}

.archive-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glow);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
    body {
        padding: 1rem;
    }

    .stats-dual,
    .events-dual {
        flex-direction: column;
    }

    .score-row {
        flex-direction: column;
    }

    .team-slot {
        flex-direction: column;
        align-items: stretch;
    }

    .team-slot-label {
        width: auto;
    }

    .two-columns {
        flex-direction: column;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1f2e;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}
