body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0; padding: 0;
    background-color: #eef2f5;
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh;
    background-image: url('background.jpg');
    background-size: cover; background-position: center; background-attachment: fixed;
    color: #333;
}
.container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    max-width: 720px; width: 100%; box-sizing: border-box; margin: 20px;
}
h1 { text-align: center; color: #334e68; margin-bottom: 15px; font-size: 2em; font-weight: 600; }
.intro-text { padding: 0 0 20px 0; line-height: 1.5; color: #4a6572; font-size: 0.95em; text-align: center; }
.intro-text p { margin: 0 0 6px 0; }
label { display: block; margin-bottom: 3px; font-weight: 600; color: #4a6572; font-size: 0.95em; }
input[type="text"], select {
    width: calc(100% - 24px); padding: 9px; margin-bottom: 12px;
    border: 1px solid #cddde6; border-radius: 8px; font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
input[type="text"]:focus, select:focus {
    border-color: #007bff; box-shadow: 0 0 0 3px rgba(0,123,255,0.25); outline: none;
}
.radio-group { margin-bottom: 12px; padding: 3px 0; }
.radio-group label {
    display: flex; align-items: center; margin-bottom: 8px; width: 100%;
    font-weight: normal; cursor: pointer; color: #5f7a87; font-size: 0.9em;
}
.radio-group input[type="radio"] { margin-right: 8px; width: auto; accent-color: #007bff; }
button {
    background-color: #007bff; color: white; padding: 13px 25px; border: none;
    border-radius: 8px; cursor: pointer; font-size: 1.1em; font-weight: 600;
    width: 100%; transition: background-color 0.3s ease, transform 0.2s ease; margin-top: 15px;
}
button:hover { background-color: #0056b3; transform: translateY(-2px); }
.section-title {
    margin-top: 18px; margin-bottom: 8px; font-size: 1.25em; color: #334e68;
    border-bottom: 2px solid #eef2f5; padding-bottom: 8px; font-weight: 600;
}
.form-section {
    background-color: #e6eff4; border: 1px solid #d0dbe2; border-radius: 10px;
    padding: 20px; margin-bottom: 25px; box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-section .section-title { margin-top: 0; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #d3e0ea; }
.form-section label { font-size: 1em; margin-bottom: 5px; }
.form-section input[type="text"], .form-section select { margin-bottom: 15px; }
.form-section .radio-group { margin-bottom: 15px; }

.team-details {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.25s ease;
    margin-top: 0;
}
.team-details.expanded {
    max-height: 300px;
    opacity: 1;
    margin-top: 8px;
}
.stamm-hinweis {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    margin-top: 0;
    margin-bottom: 0;
}
.stamm-hinweis.expanded {
    max-height: 40px;
    opacity: 1;
    margin-top: -10px;
    margin-bottom: 12px;
}
select:disabled {
    background-color: #eef1f3;
    color: #9aa7ae;
    cursor: not-allowed;
    border-color: #d8e0e5;
}
.form-section.active-section {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

/* Farbkodierung der Mannschafts-Sektionen erfolgt jetzt dynamisch
   über Inline-Styles, da die Mannschaften aus der Datenbank kommen. */

.summary-message {
    background-color: #e6f7ff; border: 1px solid #b3e0ff; color: #0056b3;
    padding: 15px 20px; margin-bottom: 20px; border-radius: 8px;
    font-size: 0.95em; line-height: 1.5;
    display: block;
}
.summary-message h3 { margin-top: 0; color: #004085; font-size: 1.1em; border-bottom: 1px solid #cce5ff; padding-bottom: 8px; margin-bottom: 10px; }
.summary-message ul { list-style: none; padding: 0; margin: 10px 0 0 0; }
.summary-message ul li { margin-bottom: 5px; padding-left: 15px; position: relative; }
.summary-message ul li::before { content: "•"; color: #007bff; font-weight: bold; display: inline-block; width: 1em; margin-left: -1em; }

.error-message {
    background-color: #ffe6e6; border: 1px solid #ffb3b3; color: #cc0000;
    padding: 12px; margin-bottom: 20px; border-radius: 8px; font-size: 0.95em;
    display: block;
}

/* Stamm-Konflikt Overlay */
.overlay-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
}
.overlay-backdrop.visible {
    display: flex;
    animation: fadeInBackdrop 0.2s ease;
}
@keyframes fadeInBackdrop {
    from { opacity: 0; } to { opacity: 1; }
}
.overlay-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.22);
    padding: 32px 36px 28px;
    max-width: 380px; width: 90%;
    text-align: center;
    animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.overlay-icon {
    font-size: 2.8em; margin-bottom: 12px; line-height: 1;
}
.overlay-box h3 {
    margin: 0 0 10px; font-size: 1.15em; color: #856404;
}
.overlay-box p {
    margin: 0 0 22px; font-size: 0.93em; color: #5a5a5a; line-height: 1.5;
}
.overlay-close {
    background: #ffc107; color: #3d2f00; border: none;
    padding: 11px 28px; border-radius: 8px; font-size: 1em;
    font-weight: 600; cursor: pointer; width: auto;
    transition: background 0.2s ease, transform 0.15s ease;
    margin-top: 0;
}
.overlay-close:hover { background: #e0a800; transform: translateY(-1px); }
.input-error { border-color: #ff4d4f !important; box-shadow: 0 0 0 3px rgba(255,77,79,0.25) !important; }
.section-error { border: 2px solid #ff4d4f !important; }
.radio-error .radio-group label { color: #ff4d4f !important; }

.stamm-hinweis {
    font-size: 0.82em; color: #888; font-style: italic;
}

@media (max-width: 600px) {
    .container { padding: 20px 25px; }
    h1 { font-size: 1.8em; }
    .form-section { padding: 15px; margin-bottom: 20px; }
}

/* ── Zusätze für Bearbeiten-Seite, Login, Meldeschluss, Datenschutz ── */
body.top { align-items: flex-start; }
.container.narrow { max-width: 700px; margin: 30px 20px; }
.deadline-note { text-align: center; color: #856404; background: #fff8e1; border: 1px solid #ffe08a;
    border-radius: 8px; padding: 8px 12px; margin: 0 0 20px 0; font-size: 0.92em; }
.closed-note { text-align: center; background: #fdecea; border: 1px solid #f5c2c0; color: #8a1f1a;
    border-radius: 10px; padding: 22px; font-size: 1.05em; line-height: 1.5; }
.privacy-note { margin-top: 18px; padding-top: 12px; border-top: 1px solid #e3e9ed; font-size: 0.8em;
    color: #7b8b95; line-height: 1.5; }
.privacy-note p { margin: 0 0 4px 0; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; gap: 10px; margin-top: 10px; }
.btn { flex: 1; padding: 13px; border: none; border-radius: 8px; cursor: pointer;
    font-size: 1em; font-weight: 600; transition: background-color 0.3s ease; }
.btn-save { background-color: #007bff; color: white; }
.btn-save:hover { background-color: #0056b3; }
.btn-delete { background-color: #dc3545; color: white; width: 100%; }
.btn-delete:hover { background-color: #a71d2a; }
.btn-cancel { background-color: #6c757d; color: white; flex: 0.5; }
.btn-cancel:hover { background-color: #5a6268; }
.btn-secondary { background-color: #6c757d; color: white; }
.btn-secondary:hover { background-color: #5a6268; }
.btn-primary { background-color: #007bff; color: white; }
.btn-primary:hover { background-color: #0056b3; }
.edit-warning { background-color: #fff3cd; border: 1px solid #ffc107; color: #856404;
    padding: 10px 15px; margin-bottom: 15px; border-radius: 8px; font-size: 0.9em; display: none; }
body.login { align-items: center; background-image: none; }
.login-container { background-color: #fff; padding: 35px 40px; border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); text-align: center; width: 300px; }
.login-container h1 { font-size: 1.4em; margin-bottom: 20px; }
.login-container input[type="password"] { padding: 10px; margin-bottom: 15px; border: 1px solid #cddde6;
    border-radius: 8px; width: calc(100% - 22px); font-size: 1em; }
.login-container .btn { width: 100%; margin-bottom: 10px; flex: none; }
.login-container .error { color: #dc3545; font-size: 0.9em; margin-bottom: 12px; }
.btn, .form-actions button { margin-top: 0; }
.btn-delete { margin-top: 12px; }


/* Erfolgs-Lightbox nach dem Speichern */
.success-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.22);
    padding: 28px 32px 24px;
    max-width: 460px; width: 90%;
    max-height: 90vh; overflow-y: auto;
    text-align: left;
    animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.success-box h3 { margin: 0 0 12px; font-size: 1.25em; color: #1a6b3a; }
.success-box p { margin: 0 0 12px; color: #333; line-height: 1.5; }
.success-box ul { list-style: none; padding: 0; margin: 0 0 20px; }
.success-box li {
    background: #f0fff4; border: 1px solid #c3e6cb; color: #155724;
    border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; line-height: 1.4;
}
.success-close {
    display: block; margin: 0 auto;
    background: #28a745; color: #fff; border: none;
    padding: 11px 32px; border-radius: 8px; font-size: 1em; font-weight: 600;
    cursor: pointer; width: auto;
    transition: background 0.2s ease, transform 0.15s ease;
}
.success-close:hover { background: #1e7e34; transform: translateY(-1px); }

/* Meldungs-Lightbox (Fehler / Hinweis) */
.success-box.msg-error { border-top: 6px solid #dc3545; }
.success-box.msg-error h3 { color: #b02a37; }
.success-box.msg-error .success-close { background: #dc3545; }
.success-box.msg-error .success-close:hover { background: #a71d2a; }
.success-box.msg-warn { border-top: 6px solid #ffc107; }
.success-box.msg-warn h3 { color: #856404; }
.success-box.msg-warn .success-close { background: #ffc107; color: #3d2f00; }
.success-box.msg-warn .success-close:hover { background: #e0a800; }
