/* ===== Rings (Concentric Progress Arcs) Theme ===== */

.rg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(6px);
}

.rg-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted, #6b7280);
    letter-spacing: 0.02em;
    user-select: none;
}

.rg-switch {
    position: relative;
    width: 38px;
    height: 20px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.rg-switch:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.6);
    outline-offset: 2px;
}

.rg-switch-thumb {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #94a3b8;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.25s ease,
                box-shadow 0.25s ease;
}

.rg-switch[aria-pressed="true"] {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.rg-switch[aria-pressed="true"] .rg-switch-thumb {
    transform: translateX(18px);
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
}

/* ===== Stage ===== */
.rg-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 24px;
}

.rg-ring-stack {
    --ring-size: clamp(280px, 60vmin, 480px);

    position: relative;
    width: var(--ring-size);
    height: var(--ring-size);
}

.rg-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* start arcs at 12 o'clock */
    overflow: visible;
}

.rg-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.rg-arc {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    /* dasharray set in JS based on circumference: full - filled, filled */
    transition: stroke-dashoffset 0.2s linear;
}

.rg-arc-seconds {
    stroke: url(#rg-grad-seconds);
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.45));
}

.rg-arc-minutes {
    stroke: url(#rg-grad-minutes);
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.45));
}

.rg-arc-hours {
    stroke: url(#rg-grad-hours);
    filter: drop-shadow(0 0 6px rgba(251, 146, 60, 0.45));
}

/* ===== Center ===== */
.rg-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}

.rg-time {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", sans-serif;
    font-weight: 200;
    font-size: clamp(28px, 5vw, 44px);
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
    line-height: 1;
    text-align: center;
}

.rg-time-main {
    display: block;
}

.rg-time-corner {
    position: absolute;
    top: -0.85em;
    right: 0.15em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", sans-serif;
    font-weight: 500;
    font-size: clamp(11px, 1.3vw, 14px);
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    line-height: 1;
    pointer-events: none;
}

.rg-date {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", sans-serif;
    font-weight: 500;
    font-size: clamp(11px, 1.3vw, 14px);
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ===== Legend ===== */
.rg-legend {
    display: flex;
    gap: 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
}

.rg-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.rg-dot-seconds { background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.6); }
.rg-dot-minutes { background: #a855f7; box-shadow: 0 0 8px rgba(168, 85, 247, 0.6); }
.rg-dot-hours   { background: #fb923c; box-shadow: 0 0 8px rgba(251, 146, 60, 0.6); }

/* Hide seconds ring when not showing seconds */
.rg-ring-stack.no-seconds .rg-arc-seconds,
.rg-ring-stack.no-seconds .rg-track:nth-of-type(1) {
    display: none;
}

/* Smooth (sweep) animations */
.rg-ring-stack.sweep .rg-arc {
    transition: none;
}

@media (max-width: 640px) {
    .rg-legend { gap: 10px; font-size: 10px; }
    .rg-toolbar { gap: 6px 12px; padding: 5px 10px; }
    .rg-toggle-label { font-size: 11px; }
}