/* ==== Seite: stopwatch ==== */

body.page-stopwatch .card-header {
    text-align: center;
    margin-bottom: 20px;
}

body.page-stopwatch .card-header h1 {
    font-size: 2.1em;
    margin-bottom: 12px;
}

body.page-stopwatch .card-header p {
    color: var(--c-muted);
    font-size: 1.02em;
    margin-bottom: 32px;
}

body.page-stopwatch .sw-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

/* ==== Anzeige-Karte ==== */
body.page-stopwatch .sw-card {
    width: 100%;
    max-width: 560px;
    min-height: 480px;
    border: 1px solid rgba(102, 126, 234, 0.18);
    border-radius: 18px;
    background: var(--c-surface);
    padding: 30px 22px 26px;
    text-align: center;
    overflow: hidden;
}

body.page-stopwatch .sw-ring-wrap {
    position: relative;
    width: min(100%, 380px);
    margin: 0 auto;
    aspect-ratio: 1;
}

body.page-stopwatch .sw-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

body.page-stopwatch .sw-ring-track {
    fill: none;
    stroke: var(--c-surface-2, #e8ecfb);
    stroke-width: 12;
}

body.page-stopwatch .sw-ring-progress {
    fill: none;
    stroke: var(--c-accent);
    stroke-width: 12;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(102, 126, 234, 0.45));
}

body.page-stopwatch .sw-ring-wrap.running .sw-ring-progress {
    animation: swSweep 1s linear infinite;
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.7));
}

@keyframes swSweep {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

body.page-stopwatch .sw-ring-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

body.page-stopwatch .sw-time {
    font-size: clamp(2rem, 9vw, 3.2rem);
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--c-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

body.page-stopwatch .sw-status {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--c-muted);
}

body.page-stopwatch .sw-lap-count {
    font-size: 1em;
    font-weight: 700;
    color: var(--c-accent);
}

/* ==== Steuerung ==== */
body.page-stopwatch .sw-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

body.page-stopwatch .sw-btn {
    min-width: 96px;
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

body.page-stopwatch .sw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

body.page-stopwatch .sw-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

body.page-stopwatch .sw-btn-secondary {
    background: var(--c-surface-2, #eef1fb);
    color: var(--c-text);
    box-shadow: none;
    border: 1px solid var(--c-border);
}

body.page-stopwatch .sw-btn-secondary:hover {
    background: rgba(102, 126, 234, 0.12);
    box-shadow: none;
}

body.page-stopwatch .sw-btn-lap {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

body.page-stopwatch .sw-btn-lap:hover {
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

/* ==== Runden-Panel ==== */
body.page-stopwatch .sw-panel {
    width: 100%;
    max-width: 560px;
    border: 1px solid rgba(102, 126, 234, 0.18);
    border-radius: 14px;
    background: var(--c-surface);
    padding: 16px 18px;
    overflow: hidden;
}

body.page-stopwatch .sw-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

body.page-stopwatch .sw-panel-title .sw-title-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92em;
    font-weight: 700;
    color: var(--c-text);
}

body.page-stopwatch .sw-panel-title .sw-title-left i { color: var(--c-accent); }

body.page-stopwatch .sw-lap-stats {
    font-size: 0.82em;
    font-weight: 600;
    color: var(--c-muted);
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

body.page-stopwatch .sw-laps {
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

body.page-stopwatch .sw-empty {
    color: var(--c-muted);
    font-style: italic;
    padding: 14px;
    text-align: center;
}

body.page-stopwatch .sw-lap-row {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 34px;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--c-surface-2, #f0f3ff);
    font-variant-numeric: tabular-nums;
}

body.page-stopwatch .sw-lap-row.best {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

body.page-stopwatch .sw-lap-row.worst {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

body.page-stopwatch .sw-lap-num {
    font-weight: 700;
    color: var(--c-muted);
    font-size: 0.85em;
}

body.page-stopwatch .sw-lap-time { font-weight: 700; color: var(--c-text); }
body.page-stopwatch .sw-lap-total { color: var(--c-muted); font-size: 0.85em; }

body.page-stopwatch .sw-lap-del {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    background: rgba(239, 68, 68, 0.14);
    color: var(--c-danger);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

body.page-stopwatch .sw-lap-del:hover { background: rgba(239, 68, 68, 0.3); }

body.page-stopwatch .sw-lap-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body.page-stopwatch .sw-lap-actions .sw-btn { flex: 1; min-width: 130px; }

body.page-stopwatch .sw-opt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

body.page-stopwatch .sw-opt-inline { margin: 0; cursor: pointer; }

body.page-stopwatch .sw-opt-label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--c-muted);
    cursor: pointer;
}

/* Kipp-Schalter (Lap-Sound) */
body.page-stopwatch .sw-switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

body.page-stopwatch .sw-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

body.page-stopwatch .sw-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--c-border, #cbd5e1);
    transition: background 0.2s;
}

body.page-stopwatch .sw-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

body.page-stopwatch .sw-switch input:checked + .sw-switch-track {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.page-stopwatch .sw-switch input:checked + .sw-switch-track::after {
    transform: translateX(18px);
}

body.page-stopwatch .sw-switch input:focus-visible + .sw-switch-track {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* ==== Info & SEO ==== */
body.page-stopwatch .info-icon { font-size: 24px; }
body.page-stopwatch .info-text { flex: 1; font-size: 14px; color: var(--c-accent); font-weight: 600; }
body.page-stopwatch .info-text a { color: var(--c-accent); font-weight: 700; text-decoration: underline; }
body.page-stopwatch .seo-section h3 { margin-top: 0; }
body.page-stopwatch .seo-section p { margin-bottom: 26px; }
body.page-stopwatch .faq-section { margin-top: 0; }

/* ==== Responsive ==== */
@media (max-width: 600px) {
    body.page-stopwatch .sw-card,
    body.page-stopwatch .sw-panel {
        padding: 22px 14px;
    }
    body.page-stopwatch .sw-ring-wrap {
        width: min(100%, 320px);
    }
}

@media (max-width: 480px) {
    body.page-stopwatch .sw-btn {
        flex: 1 1 40%;
        min-height: 48px;
    }
    body.page-stopwatch .sw-lap-row {
        grid-template-columns: 30px 1fr 1fr 30px;
        gap: 6px;
    }
    body.page-stopwatch .sw-lap-actions .sw-btn {
        min-width: 130px;
    }
    body.page-stopwatch .sw-center {
        gap: 12px;
    }
}

@media (max-width: 380px) {
    body.page-stopwatch .sw-controls {
        flex-direction: column;
    }
    body.page-stopwatch .sw-btn {
        width: 100%;
        flex: none;
    }
    /* Auf sehr schmalen Geräten die Gesamtzeit ausblenden – Zwischenzeit ist das Wichtigste */
    body.page-stopwatch .sw-lap-total {
        display: none;
    }
    body.page-stopwatch .sw-lap-row {
        grid-template-columns: 30px 1fr 30px;
    }
}
