/**
 * Stopwatch & countdown — Resources / World Clock tab (scoped).
 */
#boss-mwd-timer-tools-root {
    --timer-primary: #ff8c00;
    --timer-secondary: #1a1a1a;
    --timer-border: #dee2e6;
    --timer-text: #212529;
    --timer-muted: #6b7280;
    --timer-surface: #ffffff;
    margin-top: 1.25rem;
}

#boss-mwd-timer-tools-root .resources-timer-wrap {
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--timer-border);
    background: var(--timer-surface);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

#boss-mwd-timer-tools-root .resources-timer-page-head {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--timer-border);
}

#boss-mwd-timer-tools-root .resources-timer-page-head h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--timer-secondary);
    font-family: 'Oswald', sans-serif;
}

#boss-mwd-timer-tools-root .resources-timer-page-head p {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.45;
}

#boss-mwd-timer-tools-root .resources-timer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

#boss-mwd-timer-tools-root .resources-timer-card {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
    box-sizing: border-box;
}

#boss-mwd-timer-tools-root .resources-timer-card + .resources-timer-card {
    border-left: 1px solid var(--timer-border);
}

#boss-mwd-timer-tools-root .resources-timer-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

#boss-mwd-timer-tools-root .resources-timer-kicker {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8892a3;
}

#boss-mwd-timer-tools-root .resources-timer-card-title {
    margin: 4px 0 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--timer-secondary);
    font-family: 'Oswald', sans-serif;
}

#boss-mwd-timer-tools-root .resources-timer-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(255, 140, 0, 0.14);
    color: #9a4d00;
}

#boss-mwd-timer-tools-root .resources-timer-badge[data-state='running'] {
    background: rgba(34, 197, 94, 0.15);
    color: #166534;
}

#boss-mwd-timer-tools-root .resources-timer-badge[data-state='paused'] {
    background: rgba(255, 140, 0, 0.16);
    color: #9a4d00;
}

#boss-mwd-timer-tools-root .resources-timer-badge[data-state='ready'] {
    background: rgba(148, 163, 184, 0.18);
    color: #475569;
}

#boss-mwd-timer-tools-root .resources-timer-badge[data-state='done'] {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

#boss-mwd-timer-tools-root .resources-timer-readout {
    font-family: ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, monospace;
    font-size: clamp(1.35rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--timer-secondary);
    line-height: 1.15;
}

#boss-mwd-timer-tools-root .resources-timer-readout-no-ms {
    font-variant-numeric: tabular-nums;
}

#boss-mwd-timer-tools-root .resources-timer-duration-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 4px;
}

#boss-mwd-timer-tools-root .resources-timer-duration-field label {
    display: block;
    margin: 0 0 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8892a3;
}

#boss-mwd-timer-tools-root .resources-timer-duration-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 10px;
    border: 1px solid var(--timer-border);
    border-radius: 10px;
    background: #fff;
    color: var(--timer-text);
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

#boss-mwd-timer-tools-root .resources-timer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 0;
    padding-top: 0;
}

#boss-mwd-timer-tools-root .resources-timer-card-footer {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
}

#boss-mwd-timer-tools-root .resources-timer-card-footer .resources-timer-expand {
    margin-left: auto;
    flex-shrink: 0;
}

#boss-mwd-timer-tools-root .resources-timer-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

#boss-mwd-timer-tools-root .resources-timer-expand-icon {
    display: block;
    flex-shrink: 0;
}

#boss-mwd-timer-tools-root .resources-timer-readout-fs {
    font-size: clamp(2.15rem, 9vw, 4.25rem);
    text-align: center;
    margin: 0.35rem 0 0.85rem;
}

#boss-mwd-timer-tools-root .resources-timer-actions-modal {
    justify-content: center;
    flex-wrap: wrap;
}

#boss-mwd-timer-tools-root .resources-timer-modal-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

#boss-mwd-timer-tools-root .resources-timer-modal {
    position: fixed;
    inset: 0;
    z-index: 10052;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.52);
    padding: 20px;
    backdrop-filter: blur(6px);
}

#boss-mwd-timer-tools-root .resources-timer-modal[hidden] {
    display: none !important;
}

#boss-mwd-timer-tools-root .resources-timer-modal-card {
    position: relative;
    width: min(96vw, 520px);
    max-height: min(92vh, 720px);
    overflow: auto;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    padding: 28px 28px 24px;
}

#boss-mwd-timer-tools-root .resources-timer-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

#boss-mwd-timer-tools-root .resources-timer-modal-close:hover {
    color: #1e293b;
}

#boss-mwd-timer-tools-root .resources-timer-modal-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 8px;
}

#boss-mwd-timer-tools-root .resources-timer-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
    #boss-mwd-timer-tools-root .resources-timer-btn {
        transition: none;
    }
}

#boss-mwd-timer-tools-root .resources-timer-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.08);
}

#boss-mwd-timer-tools-root .resources-timer-btn-primary {
    background: var(--timer-primary);
    color: #fff;
}

#boss-mwd-timer-tools-root .resources-timer-btn-primary:hover:not(:disabled) {
    filter: brightness(1.06);
}

#boss-mwd-timer-tools-root .resources-timer-btn-muted {
    background: #cbd5e1;
    color: #1f2937;
}

#boss-mwd-timer-tools-root .resources-timer-btn-muted:hover:not(:disabled) {
    filter: brightness(1.05);
}

#boss-mwd-timer-tools-root .resources-timer-btn-dark {
    background: var(--timer-secondary);
    color: #fff;
}

#boss-mwd-timer-tools-root .resources-timer-btn-dark:hover:not(:disabled) {
    filter: brightness(1.08);
}

@media (max-width: 900px) {
    #boss-mwd-timer-tools-root .resources-timer-grid {
        grid-template-columns: 1fr;
    }

    #boss-mwd-timer-tools-root .resources-timer-card + .resources-timer-card {
        border-left: none;
        border-top: 1px solid var(--timer-border);
    }
}

@media (max-width: 480px) {
    #boss-mwd-timer-tools-root .resources-timer-card-footer {
        flex-wrap: wrap;
    }

    #boss-mwd-timer-tools-root .resources-timer-card-footer .resources-timer-expand {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

html[data-theme='dark'] #boss-mwd-timer-tools-root,
body.theme-dark #boss-mwd-timer-tools-root {
    --timer-secondary: #e8eef5;
    --timer-border: rgba(255, 255, 255, 0.12);
    --timer-text: #f3f6fa;
    --timer-surface: rgba(21, 28, 39, 0.95);
}

html[data-theme='dark'] #boss-mwd-timer-tools-root .resources-timer-page-head h3,
body.theme-dark #boss-mwd-timer-tools-root .resources-timer-page-head h3,
html[data-theme='dark'] #boss-mwd-timer-tools-root .resources-timer-card-title,
body.theme-dark #boss-mwd-timer-tools-root .resources-timer-card-title,
html[data-theme='dark'] #boss-mwd-timer-tools-root .resources-timer-readout,
body.theme-dark #boss-mwd-timer-tools-root .resources-timer-readout {
    color: #e8eef5;
}

html[data-theme='dark'] #boss-mwd-timer-tools-root .resources-timer-page-head p,
body.theme-dark #boss-mwd-timer-tools-root .resources-timer-page-head p,
html[data-theme='dark'] #boss-mwd-timer-tools-root .resources-timer-kicker,
body.theme-dark #boss-mwd-timer-tools-root .resources-timer-kicker {
    color: #9aa5b8;
}

html[data-theme='dark'] #boss-mwd-timer-tools-root .resources-timer-duration-field input,
body.theme-dark #boss-mwd-timer-tools-root .resources-timer-duration-field input {
    background: #0f151d;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f3f6fa;
}

body.theme-dark #boss-mwd-timer-tools-root .resources-timer-modal-card {
    background: linear-gradient(180deg, #1a2230 0%, #151c28 100%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme='dark'] #boss-mwd-timer-tools-root .resources-timer-modal-close,
body.theme-dark #boss-mwd-timer-tools-root .resources-timer-modal-close {
    color: #94a3b8;
}

html[data-theme='dark'] #boss-mwd-timer-tools-root .resources-timer-modal-close:hover,
body.theme-dark #boss-mwd-timer-tools-root .resources-timer-modal-close:hover {
    color: #f1f5f9;
}
