/* ===== Cassette Tape Clock Theme ===== */

.cs-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);
}

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

.cs-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;
}

.cs-switch:focus-visible {
    outline: 2px solid rgba(248, 191, 120, 0.6);
    outline-offset: 2px;
}

.cs-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;
}

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

.cs-switch[aria-pressed="true"] .cs-switch-thumb {
    transform: translateX(18px);
    background: #f8bf78;
    box-shadow: 0 0 8px rgba(248, 191, 120, 0.7);
}

/* ===== Stage ===== */
.cs-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    perspective: 1200px;
}

.cs-tape {
    position: relative;
    width: min(440px, 92vw);
    aspect-ratio: 1.55 / 1;
    padding: 14px 18px 16px;
    border-radius: 14px;
    background:
        linear-gradient(180deg,
            #f6f1e7 0%,
            #ece4d3 12%,
            #e2d7c1 30%,
            #d8c9ad 70%,
            #c8b894 100%);
    box-shadow:
        0 30px 60px -22px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.18);
    color: #4a3520;
    font-family: "Menlo", "Monaco", "Consolas", monospace;
}

/* Top edge with screw holes */
.cs-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cs-hole {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #6b553a 0%, #2d2114 70%);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6);
}

/* Label */
.cs-label {
    padding: 6px 4px 8px;
    text-align: center;
    border-bottom: 1px dashed rgba(74, 53, 32, 0.3);
}

.cs-label-brand {
    font-family: "Georgia", "Times New Roman", serif;
    font-weight: 700;
    font-size: clamp(13px, 1.5vw, 17px);
    letter-spacing: 0.35em;
    color: #4a3520;
}

.cs-label-type {
    margin-top: 2px;
    font-size: 9px;
    letter-spacing: 0.25em;
    color: rgba(74, 53, 32, 0.55);
}

.cs-label-side {
    margin-top: 6px;
    font-size: 10px;
    letter-spacing: 0.4em;
    color: rgba(74, 53, 32, 0.6);
}

.cs-label-time {
    margin-top: 6px;
    font-family: "Menlo", "Monaco", monospace;
    font-weight: 700;
    font-size: clamp(22px, 4vw, 32px);
    letter-spacing: 0.12em;
    color: #1a1208;
    font-variant-numeric: tabular-nums;
}

/* Window with reels */
.cs-window {
    position: relative;
    margin: 12px 0 6px;
    height: 38%;
    min-height: 110px;
    border-radius: 6px;
    background:
        linear-gradient(180deg, #1a1612 0%, #0c0a08 100%);
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.6),
        inset 0 4px 8px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

/* The visible tape between reels */
.cs-tape-line {
    position: absolute;
    left: 22%;
    right: 22%;
    top: 50%;
    height: 6px;
    transform: translateY(-50%);
    background: #2a201a;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6);
}

.cs-tape-line-inner {
    position: absolute;
    inset: 1px 0;
    background: repeating-linear-gradient(
        90deg,
        #3a2e25 0px,
        #3a2e25 4px,
        #2a201a 4px,
        #2a201a 5px
    );
}

.cs-reel {
    position: absolute;
    top: 50%;
    width: 36%;
    aspect-ratio: 1;
    transform: translateY(-50%);
    animation: cs-spin 4s linear infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.cs-reel-left  { left: 4%; }
.cs-reel-right { right: 4%; }

.cs-reel svg {
    width: 100%;
    height: 100%;
}

.cs-tape.no-spin .cs-reel {
    animation-play-state: paused;
}

@keyframes cs-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to   { transform: translateY(-50%) rotate(360deg); }
}

/* Bottom info */
.cs-bottom {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 6px;
    padding: 0 4px;
}

.cs-counter {
    font-family: "Menlo", "Monaco", monospace;
    font-weight: 700;
    font-size: clamp(13px, 1.6vw, 17px);
    letter-spacing: 0.2em;
    color: #1a1208;
    background: #fff;
    padding: 2px 10px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
}

.cs-meta {
    font-size: 10px;
    letter-spacing: 0.25em;
    color: rgba(74, 53, 32, 0.6);
    text-transform: uppercase;
}

@media (max-width: 640px) {
    .cs-tape { padding: 10px 12px 12px; }
    .cs-window { min-height: 80px; }
    .cs-toolbar { gap: 6px 12px; padding: 5px 10px; }
    .cs-toggle-label { font-size: 11px; }
}