/* ============================================================
   classroom-moments.css — full-screen classroom cues
   Good Job (thumbs up), Quiet please (shush), Curtain reveal.
   Loaded after the themes; every colour here is set explicitly so
   no theme can recolour the text.
   ============================================================ */

.cm-overlay {
    position: fixed;
    top: 0; left: 0;
    width: var(--app-vw, 100vw);
    height: var(--app-vh, 100vh);
    z-index: 2147483640 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    font-family: 'Outfit', 'Cairo', system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    animation: cmFadeIn .35s ease-out both;
}
.cm-overlay.cm-out { animation: cmFadeOut .45s ease-in forwards; }
.cm-overlay * { box-sizing: border-box; }
.cm-overlay .cm-title,
.cm-overlay .cm-sub,
.cm-overlay .cm-tip {
    -webkit-text-fill-color: currentColor !important;
    background: none !important;
}

@keyframes cmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmFadeOut { to { opacity: 0; } }

.cm-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 24px;
}

.cm-title {
    margin-top: 34px;
    font-size: clamp(44px, 7vw, 92px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #ffffff !important;
    text-shadow: 0 6px 30px rgba(0, 0, 0, .35);
    opacity: 0;
    animation: cmRise .6s cubic-bezier(.2, .9, .3, 1.2) .25s forwards;
}
.cm-sub {
    margin-top: 14px;
    font-size: clamp(18px, 2.2vw, 28px);
    font-weight: 500;
    color: rgba(255, 255, 255, .82) !important;
    opacity: 0;
    animation: cmRise .6s ease-out .45s forwards;
}
@keyframes cmRise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cm-hint {
    position: absolute;
    bottom: 28px; left: 0; right: 0;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, .55) !important;
    letter-spacing: .02em;
    opacity: 0;
    animation: cmFadeIn .4s ease-out 1.2s forwards;
}

/* ── Good Job ─────────────────────────────────────────────── */
.cm-praise {
    background:
        radial-gradient(60% 60% at 50% 45%, rgba(16, 185, 129, .32), transparent 70%),
        rgba(6, 14, 30, .62);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.cm-badge {
    position: relative;
    width: clamp(150px, 18vw, 210px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}
.cm-badge-disc {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, #34d399 0%, #10b981 45%, #059669 100%);
    box-shadow:
        0 24px 60px rgba(16, 185, 129, .45),
        inset 0 -10px 24px rgba(0, 0, 0, .18),
        inset 0 10px 22px rgba(255, 255, 255, .35);
    animation: cmPop .6s cubic-bezier(.2, 1.4, .4, 1) both;
}
.cm-badge-disc::after {               /* thin gold rim */
    content: '';
    position: absolute; inset: -7px;
    border-radius: 50%;
    border: 3px solid rgba(253, 224, 71, .85);
    opacity: .9;
}
.cm-badge i {
    position: relative;
    font-size: clamp(64px, 8vw, 92px);
    color: #ffffff !important;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .2));
    transform-origin: 40% 90%;
    animation: cmThumb 1.1s cubic-bezier(.2, 1.3, .4, 1) .1s both;
}
@keyframes cmPop {
    0%   { transform: scale(.2); opacity: 0; }
    100% { transform: scale(1);  opacity: 1; }
}
@keyframes cmThumb {
    0%   { transform: rotate(-40deg) scale(.3); opacity: 0; }
    45%  { transform: rotate(8deg) scale(1.08); opacity: 1; }
    70%  { transform: rotate(-4deg) scale(1); }
    100% { transform: rotate(0) scale(1); opacity: 1; }
}

.cm-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(110, 231, 183, .7);
    animation: cmRing 1.8s ease-out infinite;
}
.cm-ring:nth-child(2) { animation-delay: .6s; }
.cm-ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes cmRing {
    from { transform: scale(1); opacity: .8; }
    to   { transform: scale(2.1); opacity: 0; }
}

.cm-ray {
    position: absolute;
    left: 50%; top: 50%;
    width: 8px; height: 26px;
    margin: -13px 0 0 -4px;
    border-radius: 6px;
    opacity: 0;
    animation: cmRay .9s cubic-bezier(.1, .8, .3, 1) .25s forwards;
}
@keyframes cmRay {
    0%   { opacity: 0; transform: rotate(var(--a)) translateY(-60px) scaleY(.4); }
    30%  { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) scaleY(1); }
}

.cm-confetti {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    opacity: .95;
    animation: cmFall var(--d) cubic-bezier(.3, .1, .6, 1) var(--delay) forwards;
}
@keyframes cmFall {
    from { transform: translate3d(0, 0, 0) rotate(0); }
    to   { transform: translate3d(var(--x), calc(var(--app-vh, 100vh) + 40px), 0) rotate(var(--rot)); }
}

/* ── Quiet please ─────────────────────────────────────────── */
.cm-quiet {
    background:
        radial-gradient(50% 50% at 50% 40%, rgba(96, 165, 250, .28), transparent 70%),
        linear-gradient(180deg, rgba(15, 23, 42, .86), rgba(30, 27, 75, .86));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.cm-quiet-icon {
    position: relative;
    width: clamp(170px, 19vw, 230px);
    aspect-ratio: 1;
}
.cm-quiet-icon svg {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35));
}
.cm-quiet-icon .cm-face {
    transform-origin: 100px 100px;
    animation: cmPop .55s cubic-bezier(.2, 1.3, .4, 1) both;
}
/* zipper: the pull slides across and the teeth close one by one */
.cm-quiet-icon .cm-teeth line {
    opacity: 0;
    animation: cmTooth .15s ease-out forwards;
}
@keyframes cmTooth { from { opacity: 0; } to { opacity: 1; } }
.cm-quiet-icon .cm-zip {
    animation: cmZip .95s cubic-bezier(.45, 0, .3, 1) .5s both;
}
@keyframes cmZip {
    from { transform: translateX(0); }
    to   { transform: translateX(66px); }
}
.cm-quiet-icon .cm-zip-tab {
    transform-origin: 64px 138px;
    animation: cmTab 1.2s ease-in-out 1.4s both;
}
@keyframes cmTab {
    0%   { transform: rotate(0); }
    25%  { transform: rotate(14deg); }
    55%  { transform: rotate(-9deg); }
    80%  { transform: rotate(4deg); }
    100% { transform: rotate(0); }
}
.cm-halo {
    position: absolute;
    left: 50%; top: 45%;
    width: 120%; aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(147, 197, 253, .22), transparent 65%);
    animation: cmHalo 3s ease-in-out infinite;
}
.cm-halo + .cm-halo { width: 160%; animation-delay: 1.5s; opacity: .6; }
@keyframes cmHalo {
    0%, 100% { transform: translate(-50%, -50%) scale(.92); }
    50%      { transform: translate(-50%, -50%) scale(1.06); }
}

/* volume bars that sink to silence */
.cm-bars {
    margin-top: 30px;
    height: 34px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cm-bars span {
    width: 7px;
    height: 34px;
    border-radius: 6px;
    background: linear-gradient(180deg, #bfdbfe, #60a5fa) !important;
    transform: scaleY(var(--h));
    animation: cmSink 1.8s cubic-bezier(.5, 0, .3, 1) forwards;
}
@keyframes cmSink {
    0%   { transform: scaleY(var(--h)); }
    35%  { transform: scaleY(calc(var(--h) * .9)); }
    80%  { transform: scaleY(.12); opacity: .6; }
    100% { transform: scaleY(.12); opacity: 0; }
}
.cm-quiet .cm-title { margin-top: 18px; animation-delay: .55s; }
.cm-quiet .cm-sub { animation-delay: .75s; }

/* ── Try again (supportive) ───────────────────────────────── */
.cm-support {
    background:
        radial-gradient(55% 55% at 50% 42%, rgba(139, 92, 246, .32), transparent 70%),
        rgba(17, 12, 46, .7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.cm-support-badge .cm-badge-disc {
    background: linear-gradient(145deg, #c4b5fd 0%, #8b5cf6 50%, #6d28d9 100%);
    box-shadow:
        0 24px 60px rgba(139, 92, 246, .45),
        inset 0 -10px 24px rgba(0, 0, 0, .18),
        inset 0 10px 22px rgba(255, 255, 255, .35);
}
.cm-support-badge .cm-badge-disc::after { border-color: rgba(221, 214, 254, .7); }
.cm-support-badge i {
    color: #fff7c2 !important;
    filter: drop-shadow(0 0 18px rgba(253, 224, 71, .55));
    animation: cmBulb 1.8s ease-in-out .5s infinite, cmPop .5s cubic-bezier(.2, 1.4, .4, 1) .15s both;
}
@keyframes cmBulb {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(253, 224, 71, .35)); }
    50%      { filter: drop-shadow(0 0 26px rgba(253, 224, 71, .85)); }
}
.cm-support-badge .cm-ring { border-color: rgba(196, 181, 253, .6); }
.cm-retry {
    position: absolute;
    right: -2%; bottom: 2%;
    width: 30%; aspect-ratio: 1;
    border-radius: 50%;
    display: grid; place-items: center;
    background: #ffffff !important;
    color: #7c3aed !important;
    font-size: clamp(18px, 2.2vw, 26px);
    box-shadow: 0 8px 20px rgba(76, 29, 149, .35);
    animation: cmPop .5s cubic-bezier(.2, 1.5, .4, 1) .55s both;
}
.cm-badge .cm-retry i {
    font-size: inherit;
    color: #7c3aed !important;
    -webkit-text-fill-color: #7c3aed !important;
    filter: none;
    transform-origin: 50% 50%;
    animation: cmSpin 1.1s cubic-bezier(.5, 0, .3, 1) .9s 2 both;
}
@keyframes cmSpin { to { transform: rotate(360deg); } }
.cm-tips {
    margin-top: 26px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.cm-tip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12) !important;
    border: 1px solid rgba(255, 255, 255, .2);
    color: #ede9fe !important;
    -webkit-text-fill-color: #ede9fe !important;
    font-size: clamp(14px, 1.4vw, 17px);
    font-weight: 600;
    opacity: 0;
    animation: cmRise .5s ease-out forwards;
}
.cm-tip i { color: #c4b5fd !important; -webkit-text-fill-color: #c4b5fd !important; }
.cm-bubble {
    position: absolute;
    bottom: -40px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .35), rgba(196, 181, 253, .08));
    border: 1px solid rgba(255, 255, 255, .18);
    animation: cmBubble var(--d) ease-in var(--delay) forwards;
}
@keyframes cmBubble {
    to { transform: translateY(calc(var(--app-vh, 100vh) * -1 - 60px)); opacity: 0; }
}

/* ── Reward ───────────────────────────────────────────────── */
.cm-reward {
    background:
        radial-gradient(50% 50% at 50% 45%, rgba(251, 191, 36, .25), transparent 70%),
        rgba(9, 9, 30, .6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.cm-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.cm-reward .cm-stage { z-index: 1; }
.cm-medal {
    position: relative;
    width: clamp(160px, 19vw, 220px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}
.cm-rays {
    position: absolute;
    inset: -70%;
    border-radius: 50%;
    background: repeating-conic-gradient(rgba(253, 224, 71, .22) 0 9deg, transparent 9deg 22.5deg);
    -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%);
            mask: radial-gradient(circle, #000 25%, transparent 68%);
    animation: cmSpin 14s linear infinite, cmFadeIn .8s ease-out both;
}
.cm-ribbon {
    position: absolute;
    top: 62%;
    width: 30%;
    height: 62%;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
    animation: cmRibbon .6s cubic-bezier(.2, 1.3, .4, 1) .25s both;
}
.cm-ribbon-l { left: 22%; background: linear-gradient(180deg, #ef4444, #b91c1c); transform-origin: top center; --r: 16deg; }
.cm-ribbon-r { right: 22%; background: linear-gradient(180deg, #3b82f6, #1d4ed8); transform-origin: top center; --r: -16deg; }
@keyframes cmRibbon {
    from { transform: rotate(var(--r)) scaleY(0); }
    to   { transform: rotate(var(--r)) scaleY(1); }
}
.cm-medal-disc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, transparent 58%, rgba(146, 64, 14, .35) 59%, transparent 62%),
        linear-gradient(145deg, #fef08a 0%, #facc15 35%, #f59e0b 70%, #b45309 100%);
    box-shadow:
        0 26px 60px rgba(245, 158, 11, .5),
        inset 0 10px 22px rgba(255, 255, 255, .5),
        inset 0 -12px 24px rgba(146, 64, 14, .35);
    animation: cmMedal .8s cubic-bezier(.2, 1.3, .4, 1) both;
}
@keyframes cmMedal {
    0%   { transform: scale(.2) rotateY(180deg); opacity: 0; }
    100% { transform: scale(1) rotateY(0); opacity: 1; }
}
.cm-medal i {
    position: relative;
    font-size: clamp(70px, 8.5vw, 100px);
    color: #fffbeb !important;
    -webkit-text-fill-color: #fffbeb !important;
    filter: drop-shadow(0 4px 6px rgba(146, 64, 14, .45));
    animation: cmPop .6s cubic-bezier(.2, 1.5, .4, 1) .3s both;
}
.cm-shine {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
}
.cm-shine::before {
    content: '';
    position: absolute;
    top: -20%; left: -60%;
    width: 40%; height: 140%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
    transform: rotate(20deg);
    animation: cmSweep 2.6s ease-in-out .9s infinite;
}
@keyframes cmSweep {
    0%   { left: -60%; }
    40%  { left: 130%; }
    100% { left: 130%; }
}
.cm-reward .cm-title {
    color: #fde68a !important;
    text-shadow: 0 4px 0 rgba(146, 64, 14, .5), 0 10px 40px rgba(0, 0, 0, .45);
    animation-delay: .45s;
}
.cm-reward .cm-sub { animation-delay: .65s; }

/* ── Curtain ──────────────────────────────────────────────── */
.cm-curtain {
    cursor: default;
    background: transparent;
    animation: none;
}
.cm-curtain .cm-spot {
    position: absolute; inset: 0;
    background: radial-gradient(40% 55% at 50% 58%, rgba(255, 236, 179, .22), transparent 70%);
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity .6s ease;
}
.cm-curtain.cm-ready .cm-spot { opacity: 1; }

.cm-drape {
    position: absolute;
    top: 0;
    width: 50.5%;
    height: 100%;
    z-index: 2;
    background:
        /* light from above + floor shadow */
        linear-gradient(to bottom, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 78%, rgba(0, 0, 0, .55) 100%),
        /* velvet folds */
        repeating-linear-gradient(90deg,
            #5c0a16 0px, #8e1426 26px, #b51d33 44px, #8e1426 62px, #5c0a16 88px);
    box-shadow: inset 0 0 120px rgba(0, 0, 0, .55);
    transition: transform 1.7s cubic-bezier(.65, 0, .25, 1);
    will-change: transform;
}
.cm-drape::after {                         /* gold hem */
    content: '';
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 14px;
    background: linear-gradient(to bottom, #f6d77a, #b8862b);
    box-shadow: 0 -2px 6px rgba(0, 0, 0, .35);
}
.cm-drape-l { left: 0;  transform-origin: left center; }
.cm-drape-r { right: 0; transform-origin: right center; }

/* gathered = pulled to the sides (folds squeeze together, like real fabric) */
.cm-curtain.cm-gathered .cm-drape { transform: scaleX(.1); }
.cm-curtain { transition: opacity .7s ease; }
.cm-curtain.cm-gone { opacity: 0; }

.cm-valance {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: clamp(70px, 11vh, 110px);
    z-index: 4;
    background:
        linear-gradient(to bottom, rgba(0, 0, 0, .35), rgba(0, 0, 0, 0) 60%),
        repeating-linear-gradient(90deg, #6e0c1b 0, #a3182e 30px, #6e0c1b 60px);
    -webkit-mask: radial-gradient(60px 26px at 60px 100%, transparent 98%, #000) 0 0 / 120px 100% repeat-x;
            mask: radial-gradient(60px 26px at 60px 100%, transparent 98%, #000) 0 0 / 120px 100% repeat-x;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45));
    transform: translateY(-100%);
    transition: transform .8s cubic-bezier(.3, 1.2, .4, 1);
}
.cm-valance-trim {
    position: absolute;
    top: calc(clamp(70px, 11vh, 110px) - 30px);
    left: 0; right: 0;
    height: 4px;
    z-index: 5;
    background: linear-gradient(90deg, #b8862b, #f6d77a, #b8862b);
    opacity: .85;
    transform: translateY(-200px);
    transition: transform .8s cubic-bezier(.3, 1.2, .4, 1);
}
.cm-curtain.cm-ready .cm-valance,
.cm-curtain.cm-ready .cm-valance-trim { transform: translateY(0); }
.cm-curtain.cm-gone .cm-valance,
.cm-curtain.cm-gone .cm-valance-trim { transform: translateY(-110%); transition-duration: .6s; }

.cm-curtain-card {
    position: relative;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .45s ease, transform .45s ease;
}
.cm-curtain.cm-ready .cm-curtain-card { opacity: 1; transform: translateY(0); }
.cm-curtain.cm-gathered .cm-curtain-card { opacity: 0; transform: scale(.94); transition-duration: .25s; }

.cm-curtain-card .cm-title {
    margin: 0;
    animation: none;
    opacity: 1;
    color: #fde68a !important;
    font-size: clamp(40px, 6vw, 76px);
    text-shadow: 0 4px 24px rgba(0, 0, 0, .55);
}
.cm-curtain-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border: none;
    border-radius: 999px;
    font: 700 18px/1 'Outfit', 'Cairo', system-ui, sans-serif;
    color: #3b1d00 !important;
    -webkit-text-fill-color: #3b1d00 !important;
    background: linear-gradient(180deg, #fde68a, #f2b630) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .6);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.cm-curtain-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .6); }
.cm-curtain-btn:active { transform: translateY(0) scale(.98); }
.cm-curtain-btn i { color: inherit !important; }
.cm-curtain-small {
    font-size: 14px;
    color: rgba(255, 237, 213, .7) !important;
    -webkit-text-fill-color: currentColor !important;
}
.cm-curtain-x {
    position: absolute;
    top: calc(clamp(70px, 11vh, 110px) + 10px);
    right: 18px;
    z-index: 7;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(0, 0, 0, .35) !important;
    color: #fff !important;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .4s ease .6s, background .15s;
}
.cm-curtain-x:hover { background: rgba(0, 0, 0, .55) !important; }
.cm-curtain.cm-ready .cm-curtain-x { opacity: 1; }
.cm-curtain.cm-gathered .cm-curtain-x { opacity: 0; transition-delay: 0s; }
[dir="rtl"] .cm-curtain-x { right: auto; left: 18px; }

@media (prefers-reduced-motion: reduce) {
    .cm-ring, .cm-confetti, .cm-ray, .cm-bubble, .cm-rays { animation: none !important; display: none; }
    .cm-drape { transition-duration: .6s; }
}

/* ── Traffic light widget (TrafficLightManager.js) ────────── */
.tl2 {
    position: fixed;
    z-index: 2147483600;
    display: flex;
    font-family: 'Outfit', 'Cairo', system-ui, sans-serif;
    user-select: none;
    touch-action: none;
    cursor: grab;
    animation: tl2In .25s cubic-bezier(.2, 1.2, .4, 1);
    -webkit-tap-highlight-color: transparent;
}
.tl2.tl2-out { animation: tl2Out .2s ease-in forwards; }
.tl2.tl2-dragging { cursor: grabbing; }
.tl2.tl2-dragging .tl2-housing { box-shadow: 0 30px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12); }
@keyframes tl2In { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
@keyframes tl2Out { to { opacity: 0; transform: scale(.9); } }
.tl2 * { box-sizing: border-box; }
.tl2 i { -webkit-text-fill-color: currentColor; }

.tl2-scale {
    zoom: var(--tl-s, 1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tl2-housing {
    width: 104px;
    padding: 10px 12px 12px;
    border-radius: 30px;
    background: linear-gradient(160deg, #3a3f4b 0%, #23262e 55%, #1a1c22 100%) !important;
    box-shadow:
        0 20px 44px rgba(0, 0, 0, .38),
        inset 0 1px 0 rgba(255, 255, 255, .12),
        inset 0 -2px 0 rgba(0, 0, 0, .4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.tl2-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 22px;
}
.tl2-grip { color: #6b7280 !important; font-size: 13px; padding: 0 4px; }
.tl2-x {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: none !important;
    background: rgba(255, 255, 255, .08) !important;
    color: #9ca3af !important;
    font-size: 11px;
    cursor: pointer;
    display: grid; place-items: center;
    padding: 0;
}
.tl2-x:hover { background: #ef4444 !important; color: #fff !important; }

.tl2-lamp {
    --c: #ef4444; --dim: #4a1515; --glow: rgba(239, 68, 68, .75);
    position: relative;
    width: 72px; height: 72px;
    border-radius: 50%;
    border: 4px solid #111318 !important;
    padding: 0;
    cursor: pointer;
    background:
        radial-gradient(circle, rgba(0, 0, 0, .25) 1.2px, transparent 1.6px) 0 0 / 7px 7px,
        radial-gradient(circle at 50% 45%, var(--dim), #15161a 80%) !important;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .06);
    transition: background .25s, box-shadow .25s, transform .12s;
}
.tl2-lamp::before {                 /* visor */
    content: '';
    position: absolute;
    left: -8px; right: -8px; top: -10px;
    height: 26px;
    border-radius: 40px 40px 6px 6px;
    background: linear-gradient(180deg, #2c3038, #16181d);
    clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
    pointer-events: none;
}
.tl2-lamp::after {                  /* glass highlight */
    content: '';
    position: absolute;
    top: 12%; left: 22%;
    width: 36%; height: 22%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0));
    pointer-events: none;
}
.tl2-lamp.yellow { --c: #facc15; --dim: #4a3c0c; --glow: rgba(250, 204, 21, .7); }
.tl2-lamp.green  { --c: #22c55e; --dim: #0f3a20; --glow: rgba(34, 197, 94, .75); }
.tl2-lamp:hover { transform: scale(1.04); }
.tl2-lamp:active { transform: scale(.97); }
.tl2-lamp.on {
    background:
        radial-gradient(circle, rgba(255, 255, 255, .25) 1.2px, transparent 1.7px) 0 0 / 7px 7px,
        radial-gradient(circle at 50% 42%, #fff 0%, var(--c) 38%, color-mix(in srgb, var(--c) 70%, #000) 100%) !important;
    box-shadow:
        0 0 26px 6px var(--glow),
        0 0 70px 14px color-mix(in srgb, var(--glow) 45%, transparent),
        inset 0 -4px 10px rgba(0, 0, 0, .25);
    animation: tl2Glow 2.2s ease-in-out infinite;
}
@keyframes tl2Glow {
    50% { box-shadow: 0 0 34px 9px var(--glow), 0 0 90px 20px color-mix(in srgb, var(--glow) 40%, transparent), inset 0 -4px 10px rgba(0, 0, 0, .25); }
}

.tl2-tools {
    display: grid;
    grid-template-columns: repeat(2, 26px);
    gap: 6px;
    margin-top: 2px;
}
.tl2-tool {
    width: 26px; height: 26px;
    border-radius: 8px;
    border: none !important;
    padding: 0;
    background: rgba(255, 255, 255, .08) !important;
    color: #9ca3af !important;
    font-size: 12px;
    cursor: pointer;
    display: grid; place-items: center;
    transition: background .15s, color .15s;
}
.tl2-tool:hover { background: rgba(255, 255, 255, .18) !important; color: #fff !important; }
.tl2-tool.on { color: #93c5fd !important; }

.tl2-card {
    --c: #64748b;
    width: 190px;
    margin-top: 40px;
    padding: 16px 16px 18px;
    border-radius: 20px;
    background: #ffffff !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
    border-top: 6px solid var(--c);
    text-align: center;
    cursor: grab;
}
.tl2-card[hidden] { display: none; }
.tl2-card.tl2-bump { animation: tl2Bump .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes tl2Bump { from { transform: scale(.92); } to { transform: scale(1); } }
.tl2[data-state="red"] .tl2-card    { --c: #ef4444; }
.tl2[data-state="yellow"] .tl2-card { --c: #eab308; }
.tl2[data-state="green"] .tl2-card  { --c: #22c55e; }
.tl2-card-icon {
    width: 54px; height: 54px;
    margin: 0 auto 10px;
    border-radius: 16px;
    display: grid; place-items: center;
    font-size: 24px;
    background: color-mix(in srgb, var(--c) 14%, #fff) !important;
    color: var(--c) !important;
}
.tl2-card-title {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}
.tl2[data-state="red"] .tl2-card-title,
.tl2[data-state="yellow"] .tl2-card-title,
.tl2[data-state="green"] .tl2-card-title { color: color-mix(in srgb, var(--c) 75%, #000) !important; -webkit-text-fill-color: color-mix(in srgb, var(--c) 75%, #000) !important; }
.tl2-card-text {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: #475569 !important;
    -webkit-text-fill-color: #475569 !important;
}

/* attention chime: bell button + red pulse on the housing */
.tl2-bell { color: #fca5a5 !important; }
.tl2-bell:hover { background: #ef4444 !important; color: #fff !important; }
.tl2.tl2-alert .tl2-housing { animation: tl2Alert .68s ease-in-out 4; }
.tl2.tl2-alert .tl2-bell i { animation: tl2Ring .34s ease-in-out 8; transform-origin: 50% 10%; }
@keyframes tl2Alert {
    0%, 100% { box-shadow: 0 20px 44px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 0 rgba(239, 68, 68, 0); }
    50%      { box-shadow: 0 20px 44px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 8px rgba(239, 68, 68, .45); }
}
@keyframes tl2Ring {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(18deg); }
    75% { transform: rotate(-18deg); }
}
