:root {
    --bg-dark: #050505;
    --metal-surface: #1a1a1a;
    --metal-border: #333;
    --accent-color: #00ff41; /* Giftgrün */
    --warning: #eab308; /* Gold */
    --danger: #dc2626;
    --border-color: #334155;
    --input-bg: #000;
    --font-family: 'Rajdhani', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-dark);
    /* Gitter-Hintergrund */
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)),
        repeating-linear-gradient(0deg, transparent, transparent 19px, #111 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, #111 20px);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    font-family: var(--font-family);
    color: #dcdcdc;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- SLIM HEADER --- */
header {
    width: 100%;
    max-width: 1900px;
    height: 60px; /* Fixe, schlanke Höhe */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    padding: 0 20px;
    background-color: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.1);
    position: sticky; top: 0; z-index: 100;
}

.logo-area { display: flex; align-items: center; gap: 15px; }
.mlb-logo { height: 30px; filter: drop-shadow(0 0 2px rgba(255,255,255,0.8)); }
.logo-area h1 { font-size: 1.2rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: #fff; margin: 0; }
.logo-subtitle { font-size: 0.75rem; color: var(--accent-color); border-left: 1px solid #444; padding-left: 10px; margin-left: 10px; letter-spacing: 1px; opacity: 0.8; }

.controls { display: flex; align-items: center; gap: 15px; height: 100%; }

/* --- BUTTONS & INPUTS --- */
.header-input { 
    background: #050505; border: 1px solid #333; color: #fff; font-family: 'Rajdhani'; 
    padding: 4px 8px; font-size: 0.85rem; font-weight: bold; width: 120px; height: 30px; border-radius: 2px; 
}
.header-input:focus { border-color: var(--accent-color); outline: none; box-shadow: 0 0 5px rgba(0, 255, 65, 0.3); }

button { 
    background: #222; border: 1px solid #444; color: #fff; font-family: 'Rajdhani'; 
    text-transform: uppercase; letter-spacing: 1px; padding: 0 15px; height: 30px; 
    cursor: pointer; transition: all 0.2s; font-weight: bold; font-size: 0.8rem; line-height: 28px;
}
button:hover { background: var(--accent-color); color: #000; box-shadow: 0 0 10px var(--accent-color); border-color: var(--accent-color); }

.btn-admin { background: var(--warning) !important; color: #000 !important; border: 1px solid var(--warning) !important; box-shadow: 0 0 5px var(--warning); }
.btn-admin:hover { background: #fff !important; box-shadow: 0 0 15px #fff; }

.btn-save { background: var(--accent-color); color: #000; width: 100%; padding: 12px; height: auto; margin-top: 20px;}
.btn-reset { background: #b91c1c; color: #fff; width: 48%; margin-top: 15px; height: auto; padding: 10px;}
.btn-clear { background: #7f1d1d; color: #fff; width: 48%; float: right; margin-top: 15px; height: auto; padding: 10px;}

/* User Badge & Links */
.user-badge { color: var(--accent-color); font-weight: bold; font-size: 0.9rem; letter-spacing: 1px; margin-right: 10px; text-transform: uppercase; }
.header-login-wrapper { display: flex; align-items: center; gap: 8px; margin: 0 !important; }
.register-link { color: #666; font-size: 0.75rem; text-decoration: none; margin-left: 5px; text-transform: uppercase; transition: color 0.2s; cursor: pointer; }
.register-link:hover { color: #fff; }

/* --- DASHBOARD LAYOUT --- */
.dashboard-grid { display: grid; grid-template-columns: 3.5fr 1fr; gap: 40px; width: 100%; max-width: 1900px; }
.leagues-container { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }

@media (max-width: 1400px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .leagues-container { grid-template-columns: 1fr; }
}

/* --- HEAVY METAL CHASSIS (TABELLEN) --- */
.chassis {
    background: #111; border: 1px solid #333;
    box-shadow: 0 0 0 4px #0a0a0a, 0 0 0 5px #333, 0 20px 50px rgba(0,0,0,0.9);
    position: relative; padding: 40px 10px 10px 10px; margin-bottom: 40px;
}

.header-plate {
    position: absolute; top: -25px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(180deg, #2a2a2a, #111); padding: 8px 40px;
    border: 2px solid #444; border-bottom: 4px solid #000;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8);
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    z-index: 10; min-width: 180px; text-align: center;
}
.header-plate::before, .header-plate::after { content: ''; position: absolute; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; background: #555; border-radius: 50%; box-shadow: inset 1px 1px 1px rgba(0,0,0,0.8); }
.header-plate::before { left: 10px; } .header-plate::after { right: 10px; }
.header-title { margin: 0; font-size: 1.3rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 700; color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); border-bottom: 2px solid var(--accent-color); padding-bottom: 2px; display: inline-block; }

.table-wrap { margin-top: 10px; border: 1px solid #222; background: #0d0d0d; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }

th {
    background: linear-gradient(to bottom, #222, #151515); color: #666; font-size: 0.75rem; text-transform: uppercase; padding: 10px 5px;
    border-bottom: 2px solid #000; border-right: 1px solid #000; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
th:last-child { border-right: none; }

td {
    padding: 10px 5px; border-bottom: 1px solid #1a1a1a; border-right: 1px solid #1a1a1a;
    color: #ccc; font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
tr:nth-child(even) { background-color: rgba(255, 255, 255, 0.02); }
tr:hover td { background-color: rgba(255, 255, 255, 0.05); color: #fff; }

.rank-cell { text-align: center; font-weight: bold; color: #555; background: #111; border-right: 2px solid #000; font-family: monospace; }

/* --- NEUE HIGHLIGHTS (CYBER STYLE) --- */
.highlight-box {
    background: linear-gradient(to bottom, rgba(0, 255, 65, 0), rgba(0, 255, 65, 0.15)) !important;
    color: var(--accent-color) !important;
    border-bottom: 2px solid var(--accent-color) !important;
    border-left: none !important; border-top: none !important; border-right: none !important;
    text-shadow: 0 0 8px var(--accent-color); position: relative;
}
.highlight-box::after {
    content: ''; position: absolute; bottom: 0; right: 0; width: 0; height: 0;
    border-style: solid; border-width: 0 0 10px 10px; border-color: transparent transparent var(--accent-color) transparent;
    filter: drop-shadow(0 0 2px var(--accent-color));
}

.highlight-gold {
    background: linear-gradient(to bottom, rgba(234, 179, 8, 0), rgba(234, 179, 8, 0.15)) !important;
    color: var(--warning) !important;
    border-bottom: 2px solid var(--warning) !important;
    border-left: none !important;
    text-shadow: 0 0 8px var(--warning); position: relative;
}
.highlight-gold::after {
    content: ''; position: absolute; bottom: 0; right: 0; width: 0; height: 0;
    border-style: solid; border-width: 0 0 10px 10px; border-color: transparent transparent var(--warning) transparent;
    filter: drop-shadow(0 0 2px var(--warning));
}

tfoot td { background: #111; border-top: 2px solid var(--accent-color); color: #fff; padding-top: 15px; font-weight: bold; font-size: 0.9rem; }
.footer-label { text-align: right; text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem; color: var(--accent-color); }

/* --- SCOREBOARD & PROGRESS --- */
.scoreboard-panel .chassis { padding-bottom: 20px; }
.big-number { font-size: 2.2rem; color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.2); text-align: center;}
.score-table th { color: #888; text-align: center; }
.score-table td { text-align: center; font-size: 1.1rem; }

.progress-container { padding: 15px; text-align: center; }
.progress-track { background: #000; border: 1px solid #333; height: 25px; border-radius: 0; position: relative; }
.progress-fill { height: 100%; width: 0%; background: var(--accent-color); box-shadow: 0 0 15px var(--accent-color); transition: width 0.8s ease; }
.progress-text-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #000; font-weight: bold; font-size: 0.8rem; letter-spacing: 1px; }
.status-dot { height: 8px; width: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; box-shadow: 0 0 5px currentColor; }
.dot-red { color: #ef4444; background: #ef4444; } .dot-green { color: var(--accent-color); background: var(--accent-color); } .dot-yellow { color: var(--warning); background: var(--warning); }

/* --- ADMIN LAYOUT --- */
.admin-layout-grid { display: grid; grid-template-columns: 1fr 280px; gap: 30px; align-items: start; }
.admin-sidebar { position: sticky; top: 80px; }
.admin-content { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.league-column { display: flex; flex-direction: column; gap: 30px; }

@media (max-width: 1200px) {
    .admin-layout-grid { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; order: -1; margin-bottom: 20px; }
    .admin-content { grid-template-columns: 1fr; }
}

.admin-section { background: #111; border: 1px solid #333; padding: 15px; box-shadow: 0 0 0 1px #0a0a0a, 0 0 0 2px #333; }
.admin-division-title { color: var(--accent-color); border-bottom: 1px solid #333; font-size: 1rem; letter-spacing: 1px; margin-bottom: 10px; text-transform: uppercase; font-weight: bold; }
.admin-header-row { display: grid; grid-template-columns: 30px 1fr 1fr 1fr 1.2fr; gap: 5px; margin-bottom: 5px; }
.admin-header-label { font-size: 0.7rem; color: #666; font-weight: bold; text-transform: uppercase; text-align: center; }
.admin-row { display: grid; grid-template-columns: 30px 1fr 1fr 1fr 1.2fr; gap: 5px; margin-bottom: 4px; align-items: center; }
.admin-row input, .admin-row select, .admin-sidebar input, .admin-sidebar select { width: 100%; background: #000; border: 1px solid #333; color: #ccc; padding: 4px; font-size: 0.8rem; font-family: 'Rajdhani'; height: 28px; }
.admin-row input:focus, .admin-row select:focus { border-color: var(--accent-color); color: #fff; outline: none; }
.admin-row label { text-align: center; color: #555; font-weight: bold; font-family: monospace; }
.input-wrapper { display: flex; flex-direction: column; margin-bottom: 15px; }
.input-wrapper label { color: #888; font-size: 0.8rem; margin-bottom: 5px; text-transform: uppercase; }
.points-preview { font-size: 0.75rem; color: var(--accent-color); text-align: right; margin-top: 5px; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2000; justify-content: center; align-items: center; }
.modal-content { background: #111; padding: 30px; border: 1px solid #333; box-shadow: 0 0 20px rgba(0, 255, 65, 0.2); width: 300px; text-align: center; position: relative; }
.modal-title { color: #fff; font-size: 1.5rem; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 2px; }
.modal-content input { width: 100%; background: #000; border: 1px solid #333; color: #fff; padding: 10px; margin-bottom: 15px; font-family: 'Rajdhani'; }
.close-modal { position: absolute; top: 10px; right: 15px; color: #666; cursor: pointer; font-size: 1.5rem; }
footer { margin-top: 40px; color: #444; font-size: 0.8rem; }