body {
    background: #f0f0f0;
    font-family: Arial, sans-serif;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    height: 100svh;
}
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
}
.side-lights {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.main-traffic {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0 40px;
}
.light {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #bbb;
    border: 2px solid #888;
    margin: 0 auto;
    box-shadow: 0 0 8px #888;
    opacity: 0.08;  /* Standardmäßig aus */
    transition: opacity 0.3s ease;  /* Sanfter Übergang */
}
.light.red { background: #a00; }
.light.yellow { background: #ff0; }
.light.green { background: #0a0; }
.light.white { background: #fff; border: 2px solid #ccc; }
.light.blue { background: #00f; }

/* Aktive Fehlerlampe */
.side-lights .light.active {
    opacity: 1;
}

.zeit-anzeige {
    margin-top: 60px;
    font-size: 2em;
    font-weight: bold;
}

.judge-container {
    margin: 40px auto;
    max-width: 400px;
    border-radius: 12px;
    padding: 24px;
}
.button-row, .error-row, .zeiten-row {
    margin: 18px 0;
}
button {
    font-size: 1.1em;
    padding: 8px 18px;
    margin: 0 6px;
    border-radius: 6px;
    border: 1px solid #888;
    background: #eee;
    cursor: pointer;
    transition: background 0.2s;
}
button:hover {
    background: #ddd;
}
.error-btn {
    background: #fbb;
}
.error-btn.active {
    background: #f00;
    color: #fff;
}
#zeiten-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
#zeiten-list li {
    margin: 4px 0;
}

/* --- Modernes, mobilfreundliches Judge-UI --- */
.judge-container.modern {
    max-width: 420px;
    margin: 0 auto;
    border-radius: 18px;
    padding: 24px 10px 32px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
.zeiten-label, .gesamtzeit-label, .fehler-label {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}
.zeiten-list-modern {
    width: 100%;
    margin: 0 0 10px 0;
    padding: 0;
    list-style: none;
    font-size: 1.1em;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.zeiten-list-modern li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0 4px 0;
    border-bottom: 1px solid #eee;
    gap: 3rem;
}

body > div.judge-container.modern > div.zeiten-row > div.gesamtzeit-label{
    margin-top: 1rem;    
}

body > div.judge-container.modern > div.zeiten-row > div.zeiten-label{
    font-size: 2rem;
}
.gesamtzeit-modern {
    font-size: 2.1em;
    font-weight: bold;
    margin: 8px 0 0 0;
    color: #222;
}
.button-grid-modern {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0 10px 0;
}
.button-row-modern {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: center;
}
.main-btn {
    font-size: 1.2em;
    padding: 16px 18px;
    border-radius: 12px;
    border: none;
    background: #222;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px #bbb;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 180px;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
}
.main-btn:active {
    background: #444;
    transform: scale(0.97);
}
.error-row-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: nowrap;
    justify-content: center;
}
.error-btn-modern {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #888;
    color: #fff;
    font-size: 1.3em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px #bbb;
    cursor: pointer;
    transition: border 0.2s, box-shadow 0.2s, transform 0.1s;
    outline: none;
}
.error-btn-modern span {
    font-size: 1.1em;
    font-weight: bold;
}
.error-btn-modern.active, .error-btn-modern:active {
    border: 3px solid #222;
    box-shadow: 0 2px 12px #f00;
    transform: scale(0.97);
}
@media (max-width: 600px) {
    .judge-container.modern {
        max-width: 98vw;
        padding: 10px 2vw 18px 2vw;
    }
    .zeiten-list-modern li {
        font-size: 1em;
    }
    .main-btn {
        font-size: 1em;
        padding: 12px 8px;
        max-width: 100vw;
    }
    .button-row-modern {
        gap: 8px;
    }
    .button-grid-modern {
        gap: 6px;
    }
    .error-btn-modern {
        width: 38px;
        height: 38px;
        font-size: 1em;
    }
}
/* --- Bestehende Styles bleiben erhalten --- */

.settings-btn {
    margin: 24px auto 0 auto;
    display: block;
    font-size: 1.1em;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    background: #222;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px #bbb;
    cursor: pointer;
    transition: background 0.2s;
}
.settings-btn:active { background: #444; }

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}
.modal.show { display: flex; }
.modal-content {
    background: #fff;
    color: #222;
    padding: 24px 18px;
    border-radius: 14px;
    min-width: 260px;
    max-width: 90vw;
    box-shadow: 0 2px 16px #2225;
    position: relative;
    text-align: left;
}
.close-modal {
    position: absolute;
    right: 18px; top: 12px;
    font-size: 1.6em;
    cursor: pointer;
}
.modal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0;
    font-size: 1.1em;
}
body.darkmode, .modal-content.darkmode {
    background: #111 !important;
    color: #fff !important;
}

body.darkmode > div.judge-container.modern > div.error-row-modern > span{
    color: #ffffff;
}


.judge-container.modern.darkmode, .gesamtzeit-modern.darkmode, .container.darkmode {
    background: #111 !important;
    color: #fff !important;
}
.main-btn.darkmode, .settings-btn.darkmode {
    background: #fff !important;
    color: #111 !important;
    border: 2px solid #fff !important;
}
input[type="checkbox"] {
    width: 24px; height: 24px;
}

/* Fehlerlampen ausblenden wenn deaktiviert */
body[data-show-errors="0"] .side-lights {
    display: none !important;
}

.modal-section {
    margin: 24px 0;
}

.modal-section h3 {
    font-size: 1.2em;
    margin: 0 0 12px 0;
    color: inherit;
}

.dog-names-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dog-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dog-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    background: #fff;
    color: #222;
    transition: border-color 0.2s;
}

.darkmode .dog-name-input {
    background: #222;
    color: #fff;
    border-color: #444;
}

.dog-name-input:focus {
    outline: none;
    border-color: #666;
}

.darkmode .dog-name-input:focus {
    border-color: #888;
}

/* Mobile Optimierungen */
@media (max-width: 600px) {
    .modal-content {
        padding: 16px 12px;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .dog-name-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .dog-name-row label {
        font-size: 0.9em;
    }
    
    .dog-name-input {
        padding: 10px;
        font-size: 1.1em;
    }
} 

body > div.container > div.main-traffic {
    scale: 1.3;
}

.viewer-container.modern {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 16px #bbb;
    padding: 32px 10px 40px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}
.viewer-container.modern .zeiten-list-modern {
    font-size: 2.1em;
    gap: 16px;
}
.viewer-container.modern .zeiten-label,
.viewer-container.modern .gesamtzeit-label {
    font-size: 1.3em;
    margin-bottom: 10px;
}
.viewer-container.modern .gesamtzeit-modern {
    font-size: 3em;
    margin: 18px 0 0 0;
    color: #222;
    font-weight: bold;
}
.viewer-container.modern.darkmode .gesamtzeit-modern {
    color: #fff;
}
@media (max-width: 600px) {
    .viewer-container.modern {
        max-width: 100vw;
        padding: 8vw 2vw 10vw 2vw;
        gap: 18px;
    }
    .viewer-container.modern .zeiten-list-modern {
        font-size: 1.3em;
        gap: 10px;
    }
    .viewer-container.modern .gesamtzeit-modern {
        font-size: 2.1em;
        margin: 10px 0 0 0;
    }
}
.ergebnis-section {
    margin-top: 24px;
    background: #f7f7f7;
    border-radius: 12px;
    padding: 16px 10px;
    width: 100%;
    box-shadow: 0 2px 8px #bbb;
    text-align: left;
}
.viewer-container.modern.darkmode .ergebnis-section {
    background: #222;
    color: #fff;
    box-shadow: 0 2px 8px #000;
}
@media (max-width: 600px) {
    .viewer-container.modern {
        max-width: 98vw;
        padding: 10px 2vw 18px 2vw;
    }
    .ergebnis-section {
        padding: 10px 4px;
    }
}

/* Neue Styles für die Startseite */
.welcome-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    text-align: center;
}

.welcome-container h1 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #222;
}

.welcome-container p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}

/* Styles für die Trainingsübersicht */
.training-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    text-align: center;
}

.training-container h1 {
    font-size: 2em;
    margin-bottom: 10px;
    color: #222;
}

.session-id {
    font-family: monospace;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 30px;
}

.qr-section {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin: 30px 0;
}

.qr-box {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 300px;
}

.qr-box h2 {
    font-size: 1.4em;
    margin-bottom: 15px;
    color: #222;
}

.qr-box img {
    width: 200px;
    height: 200px;
    margin: 10px 0;
}

.qr-box p {
    font-size: 1em;
    color: #666;
    margin: 15px 0;
}

.link-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #222;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 10px;
    transition: background 0.2s;
}

.link-btn:hover {
    background: #444;
}

.back-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #f5f5f5;
    color: #222;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 30px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #eee;
}

/* Darkmode Anpassungen */
body.darkmode .welcome-container h1,
body.darkmode .training-container h1 {
    color: #fff;
}

body.darkmode .welcome-container p,
body.darkmode .session-id {
    color: #aaa;
}

body.darkmode .qr-box {
    background: #222;
}

body.darkmode .qr-box h2 {
    color: #fff;
}

body.darkmode .qr-box p {
    color: #aaa;
}

body.darkmode .link-btn {
    background: #444;
    color: #fff;
}

body.darkmode .link-btn:hover {
    background: #555;
}

body.darkmode .back-btn {
    background: #333;
    color: #fff;
}

body.darkmode .back-btn:hover {
    background: #444;
}

/* Mobile Anpassungen */
@media (max-width: 600px) {
    .qr-section {
        gap: 20px;
    }
    
    .qr-box {
        width: 100%;
        max-width: none;
    }
    
    .qr-box img {
        width: 180px;
        height: 180px;
    }
}