/* ==========================================================================
   ThaySauros Chest (Round 24)
   Full-screen teaser / opening overlay + the admin management panel.
   Everything is prefixed tsc- so nothing leaks into the rest of the app.
   ========================================================================== */

.tsc-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playpen Sans', 'Comic Sans MS', cursive, sans-serif;
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    transition: opacity 0.35s ease;
    touch-action: manipulation;
}
.tsc-overlay.tsc-in { opacity: 1; }
/* While the overlay fully covers the screen, stop drawing the page underneath it
   (saves a lot of work on slower school PCs). Layout is untouched. */
html.tsc-page-hidden body > *:not(.tsc-overlay) { visibility: hidden !important; }
.tsc-overlay.tsc-out { opacity: 0; transition: opacity 0.45s ease; }

/* ---- background: moving rainbow gradient + spinning sunburst + vignette --- */
/* The gradient is 2x the screen and slides with a transform, so the browser
   only moves a ready-made layer instead of repainting the screen every frame. */
.tsc-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 200%;
    height: 200%;
    background: linear-gradient(125deg, #ff2d95, #ff7a18, #ffd200, #2ee6a6, #19b6ff, #8a3dff, #ff2d95);
    animation: tscBgShift 9s ease-in-out infinite alternate;
    will-change: transform;
}
@keyframes tscBgShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50%, -50%); }
}
.tsc-rays {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 122vmax;
    height: 122vmax;
    margin: -61vmax 0 0 -61vmax;
    /* the sunburst picture is drawn once by thaysauros-chest.js (no mask = cheap to spin) */
    background-size: 100% 100%;
    opacity: 0.8;
    will-change: transform;
}
.tsc-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(20,0,40,0.55) 100%);
    pointer-events: none;
}
.tsc-dim {
    position: absolute;
    inset: 0;
    background: #12002a;
    opacity: 0;
    pointer-events: none;
}
.tsc-flash {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 30;
}

/* ---- sparkles drifting up through the background ------------------------- */
.tsc-sparkle {
    position: absolute;
    bottom: -20px;
    width: 10px;
    height: 10px;
    pointer-events: none;
    background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    animation: tscSparkle linear infinite;
    opacity: 0;
}
.tsc-sparkle::before, .tsc-sparkle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    background: #fff;
    border-radius: 2px;
    transform: translate(-50%, -50%);
}
.tsc-sparkle::before { width: 2px; height: 22px; }
.tsc-sparkle::after { width: 22px; height: 2px; }
@keyframes tscSparkle {
    0% { transform: translateY(0) scale(0.3) rotate(0deg); opacity: 0; }
    15% { opacity: 1; }
    50% { transform: translateY(-55vh) scale(1) rotate(180deg); opacity: 0.9; }
    100% { transform: translateY(-112vh) scale(0.4) rotate(360deg); opacity: 0; }
}

/* ---- shaker (screen shake) wraps the stage (camera zoom) ----------------- */
.tsc-shaker {
    position: absolute;
    inset: 0;
    z-index: 5;
}
/* ---- stage (camera zoom target) ------------------------------------------ */
.tsc-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    will-change: transform;
}
.tsc-title {
    font-size: clamp(26px, min(6.2vw, 7.5vh), 64px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    line-height: 1.05;
    margin: 0 16px 1.5vh;
    color: #fff;
    -webkit-text-stroke: 2px rgba(80, 0, 120, 0.55);
    text-shadow: 0 0 12px #fff, 0 0 26px #ffe14d, 0 0 46px #ff4df0, 0 6px 0 rgba(90, 0, 120, 0.55);
    animation: tscTitleBob 2.2s ease-in-out infinite;
}
@keyframes tscTitleBob {
    0%, 100% { transform: translateY(0) rotate(-1.5deg) scale(1); }
    50% { transform: translateY(-6px) rotate(1.5deg) scale(1.04); }
}

/* ---- the chest: ONE closed sprite, plus a pure-white copy on top that fades in
   as the chest "heats up" (drawn once by thaysauros-chest.js, no CSS filters).
   The sprite itself (in normal flow) gives the chest its height, so the chest can
   never collapse to nothing; each width line is a fallback for older browsers. -- */
.tsc-chest-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 300px;
    max-width: 66vw;
    width: min(66vw, 400px);
    width: min(66vw, 400px, 36vh);
    min-width: 120px;
    margin: 2vh 0;
    z-index: 3;
    will-change: transform, opacity;
}
.tsc-chest-glow {
    position: absolute;
    left: 50%;
    top: 55%;
    width: 150%;
    height: 150%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(255,240,150,0.9) 0%, rgba(255,200,60,0.45) 30%, rgba(255,120,200,0) 65%);
    border-radius: 50%;
    animation: tscGlowPulse 1.6s ease-in-out infinite;
    pointer-events: none;
    will-change: transform, opacity;
}
@keyframes tscGlowPulse {
    0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.92); }
    50% { opacity: 0.95; transform: translate(-50%, -50%) scale(1.06); }
}
.tsc-chest {
    position: relative;
    transform-origin: 50% 100%;
    will-change: transform;
}
.tsc-chest-img {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.tsc-chest-white {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    opacity: 0;
    will-change: opacity;
}
.tsc-shadow {
    position: absolute;
    left: 50%;
    bottom: -6%;
    width: 80%;
    height: 12%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(40,0,60,0.45) 0%, rgba(40,0,60,0) 70%);
    border-radius: 50%;
    z-index: 0;
}
.tsc-puff {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
    z-index: 4;
}

/* ---- teaser text ---------------------------------------------------------- */
.tsc-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}
.tsc-msg {
    max-width: 920px;
    margin: 2vh 16px 0;
    text-align: center;
    font-size: clamp(18px, min(4.4vw, 5vh), 42px);
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 8px #fff, 0 0 18px #fff27a, 0 0 34px #ff4df0, 0 0 60px #8a3dff;
    position: relative;
    animation: tscMsgPulse 1.4s ease-in-out infinite alternate;
    will-change: transform;
}
@keyframes tscMsgPulse { 0% { transform: scale(1); } 100% { transform: scale(1.035); } }

.tsc-num {
    display: inline-block;
    font-size: 1.6em;
    color: #fff27a;
    -webkit-text-stroke: 2px #b4006e;
    padding: 0 0.12em;
    animation: tscNumPop 0.9s ease-in-out infinite;
}
@keyframes tscNumPop {
    0%, 100% { transform: scale(1) rotate(-4deg); }
    50% { transform: scale(1.22) rotate(4deg); }
}
.tsc-bonus {
    max-width: 820px;
    margin: 1.8vh 16px 0;
    text-align: center;
    font-size: clamp(14px, min(2.7vw, 2.9vh), 26px);
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    color: #fff;
    padding: 0.45em 1.1em;
    border-radius: 999px;
    background: rgba(50, 0, 90, 0.55);
    border: 2px solid rgba(125, 243, 255, 0.85);
    box-shadow: 0 0 14px rgba(125, 243, 255, 0.75), 0 0 30px rgba(255, 77, 240, 0.5);
    text-shadow: 0 0 6px #7df3ff, 0 0 16px #b06bff, 0 0 26px #ff4df0;
    animation: tscBonusGlow 1.1s ease-in-out infinite alternate;
}
.tsc-bonus b { color: #fff27a; font-size: 1.25em; text-shadow: 0 0 8px #ffb52e, 0 0 18px #ff4df0; }
/* opacity + scale only: cheap */
@keyframes tscBonusGlow {
    0% { opacity: 0.82; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1.03); }
}
.tsc-pips {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 2.2vh;
}
.tsc-pip {
    width: clamp(22px, 4vw, 34px);
    height: clamp(22px, 4vw, 34px);
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 10px rgba(255,255,255,0.6);
}
.tsc-pip.tsc-done {
    background: radial-gradient(circle at 35% 30%, #fffbe0, #ffd200 45%, #ff7a18);
    box-shadow: 0 0 12px #fff27a, 0 0 26px #ffb52e;
    animation: tscPipGlow 1.2s ease-in-out infinite alternate;
}
@keyframes tscPipGlow { to { transform: scale(1.15); } }
.tsc-hint {
    margin-top: 2.2vh;
    font-size: clamp(13px, 2.2vw, 17px);
    opacity: 0.85;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 6px rgba(60,0,80,0.6);
    animation: tscHint 1.6s ease-in-out infinite;
}
@keyframes tscHint { 50% { opacity: 0.45; } }
.tsc-btn {
    margin-top: 2.6vh;
    font-family: inherit;
    font-size: clamp(20px, min(4.5vw, 5vh), 40px);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    border: 4px solid #fff;
    border-radius: 999px;
    padding: 0.35em 1.4em;
    cursor: pointer;
    background: linear-gradient(180deg, #ff4df0 0%, #b400ff 100%);
    box-shadow: 0 8px 0 #5a0080, 0 0 24px #ff4df0, 0 0 60px rgba(255,255,255,0.6);
    text-shadow: 0 3px 0 rgba(70,0,100,0.6);
    animation: tscBtnPulse 0.9s ease-in-out infinite;
    position: relative;
    z-index: 40;
}
.tsc-btn:active { transform: translateY(6px) scale(0.97); box-shadow: 0 2px 0 #5a0080, 0 0 24px #ff4df0; }
.tsc-btn.tsc-gold { background: linear-gradient(180deg, #ffe14d 0%, #ff8a00 100%); box-shadow: 0 8px 0 #9a4a00, 0 0 24px #ffd200, 0 0 60px rgba(255,255,255,0.6); }
.tsc-btn[disabled] { animation: none; opacity: 0.85; cursor: default; }
@keyframes tscBtnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}
.tsc-error {
    margin-top: 1.5vh;
    font-weight: 700;
    color: #fff;
    background: rgba(120, 0, 60, 0.75);
    padding: 8px 16px;
    border-radius: 12px;
}

/* ---- the opening: prize cards, labels ---------------------- */
/* (no light beam: a masked, squashed beam drew as a black bar on some devices) */
.tsc-orbit {
    position: absolute;
    left: 50%;
    top: 44%;
    width: 0;
    height: 0;
    perspective: 1000px;
    transform-style: preserve-3d;
    z-index: 10;
}
/* prizes passing BEHIND the chest live in this copy of the ring, under the chest */
.tsc-orbit.tsc-orbit-back { z-index: 1; }
.tsc-card {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--tsc-card-w, 170px);
    height: calc(var(--tsc-card-w, 170px) * 1.32);
    margin-left: calc(var(--tsc-card-w, 170px) * -0.5);
    margin-top: calc(var(--tsc-card-w, 170px) * -0.66);
    border-radius: 18px;
    padding: 5px;
    background: linear-gradient(135deg, var(--tsc-c, #ffd200), #fff 45%, var(--tsc-c, #ffd200));
    box-shadow: 0 0 24px var(--tsc-c, #ffd200);
    will-change: transform, filter;
    backface-visibility: visible;
}
.tsc-card-burst {
    position: absolute;
    left: -30%;
    top: -30%;
    width: 160%;
    height: 160%;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, var(--tsc-c, #ffd200) 35%, rgba(255,255,255,0) 68%);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    will-change: transform, opacity;
}
.tsc-cover {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #000;
    z-index: 5;
    pointer-events: none;
}
.tsc-card.tsc-dark { box-shadow: 0 0 22px 6px rgba(255,255,255,0.95); }
.tsc-card.tsc-dark .tsc-card-inner::before { display: none; }
.tsc-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 38%, rgba(255,255,255,0.35), rgba(255,255,255,0) 60%), linear-gradient(160deg, #3a0a6b, #14002e);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.tsc-card-inner::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: repeating-conic-gradient(from 0deg, var(--tsc-c, #ffd200) 0deg 10deg, transparent 10deg 30deg);
    opacity: 0.18;
    animation: tscSpin 8s linear infinite;
}
@keyframes tscSpin { to { transform: rotate(360deg); } }
.tsc-card img {
    position: relative;
    max-width: 78%;
    max-height: 62%;
    object-fit: contain;
    filter: drop-shadow(0 6px 8px rgba(0,0,0,0.45));
}
.tsc-card.tsc-avatar img { border-radius: 50%; border: 4px solid var(--tsc-c, #fff); width: 74%; aspect-ratio: 1; object-fit: cover; max-height: none; }
.tsc-card-amount {
    position: relative;
    margin-top: 4%;
    font-size: calc(var(--tsc-card-w, 170px) * 0.2);
    font-weight: 700;
    color: #fff27a;
    -webkit-text-stroke: 1px #7a3d00;
    text-shadow: 0 0 10px #ffd200;
}
.tsc-card-tag {
    position: relative;
    margin-top: 3%;
    font-size: calc(var(--tsc-card-w, 170px) * 0.085);
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--tsc-c, #ffd200);
    color: #1b0030;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.tsc-shiny-star {
    position: absolute;
    top: 6%;
    right: 8%;
    font-size: calc(var(--tsc-card-w, 170px) * 0.16);
    animation: tscNumPop 0.8s ease-in-out infinite;
}
.tsc-label {
    z-index: 6;
    position: absolute;
    left: 50%;
    top: 100%;
    margin-top: 14px;
    transform: translateX(-50%);
    width: calc(var(--tsc-card-w, 170px) * 1.25);
    text-align: center;
    font-weight: 700;
    font-size: max(13px, calc(var(--tsc-card-w, 170px) * 0.12));
    line-height: 1.15;
    color: #fff;
    text-shadow: 0 0 8px var(--tsc-c, #fff), 0 2px 0 rgba(60,0,80,0.7);
    opacity: 0;
}
.tsc-label small {
    display: block;
    margin-top: 2px;
    font-size: 0.75em;
    color: #fff;
    text-shadow: 0 1px 2px rgba(40,0,60,0.9), 0 0 6px rgba(40,0,60,0.6);
}
.tsc-ring {
    position: absolute;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    border: 6px solid var(--tsc-c, #fff);
    box-shadow: 0 0 20px var(--tsc-c, #fff), inset 0 0 20px var(--tsc-c, #fff);
    pointer-events: none;
    z-index: 9;
}
.tsc-confetti {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
}
.tsc-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 5vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 40;
}
.tsc-close-x {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 50;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    background: rgba(40,0,70,0.35);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

/* ---- MegaSauros (Round 24) ------------------------------------------------ */
/* the giant chest on the "ready" screen */
.tsc-ready-mega .tsc-stage > .tsc-chest-wrap {
    width: 360px;
    max-width: 80vw;
    width: min(80vw, 560px);
    width: min(80vw, 560px, 50vh);
}
.tsc-mega .tsc-title {
    text-shadow: 0 0 12px #fff, 0 0 26px #d07bff, 0 0 46px #8a3dff, 0 6px 0 rgba(60, 0, 110, 0.6);
}
.tsc-mega .tsc-chest-glow {
    background: radial-gradient(ellipse at center, rgba(255,235,170,0.9) 0%, rgba(210,120,255,0.5) 30%, rgba(140,60,255,0) 65%);
}
.tsc-bonus.tsc-bonus-mega {
    border-color: rgba(255, 210, 80, 0.95);
    background: rgba(60, 0, 100, 0.62);
    box-shadow: 0 0 14px rgba(255, 190, 60, 0.8), 0 0 30px rgba(176, 107, 255, 0.7);
    text-shadow: 0 0 6px #ffcf5a, 0 0 16px #b06bff, 0 0 26px #ff4df0;
}
/* MegaSauros opening: the world the camera flies through (stage coordinates) */
.tsc-mworld {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    z-index: 4;
}
/* the three ThaySauros chests that pop out of the MegaSauros */
.tsc-trio-chest {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--tsc-trio-w, 150px);
    transform-origin: 50% 100%;
    will-change: transform, opacity;
}
.tsc-mworld .tsc-card { will-change: transform; }
/* speed lines while the camera whips from chest to chest */
.tsc-speed {
    position: absolute;
    inset: -10% -40%;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    background: repeating-linear-gradient(180deg, rgba(255,255,255,0) 0 22px, rgba(255,255,255,0.5) 22px 24px, rgba(255,255,255,0) 24px 61px, rgba(255,255,255,0.3) 61px 62px);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent);
}
/* the 3x3 grid of prizes: smaller names, no second line */
.tsc-nine .tsc-label {
    margin-top: 5px;
    font-size: max(11px, calc(var(--tsc-card-w, 120px) * 0.115));
    width: calc(var(--tsc-card-w, 120px) * 1.15);
}
.tsc-nine .tsc-label small { display: none; }
.tsc-nine .tsc-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsc-bonus.tsc-bonus-mega { max-width: 980px; }
.tsc-nine .tsc-card { border-radius: 12px; padding: 3px; }
.tsc-nine .tsc-card-inner { border-radius: 10px; }

/* MegaSauros teaser: the giant chest next to a normal one */
.tsc-mscene {
    position: relative;
    flex: 0 0 auto;
    width: calc(var(--tsc-mb, 300px) * 1.4);
    height: calc(var(--tsc-mb, 300px) * 0.7);
    margin: 2vh 0;
    z-index: 3;
}
.tsc-mcam {
    position: absolute;
    inset: 0;
    will-change: transform;
}
.tsc-mfloor {
    position: absolute;
    left: -18%;
    right: -18%;
    bottom: calc(var(--tsc-mb, 300px) * -0.07);
    height: calc(var(--tsc-mb, 300px) * 0.24);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 45%, rgba(255,255,255,0) 70%);
}
.tsc-mbig {
    position: absolute;
    left: calc(var(--tsc-mb, 300px) * 0.04);
    bottom: calc(var(--tsc-mb, 300px) * 0.03);
    width: var(--tsc-mb, 300px);
    will-change: transform;
}
.tsc-mscene .tsc-chest-wrap {
    width: var(--tsc-mb, 300px);
    min-width: 0;
    max-width: none;
    margin: 0;
}
.tsc-mscene .tsc-chest-wrap .tsc-shadow { display: none; }
.tsc-mbig-shadow {
    position: absolute;
    left: calc(var(--tsc-mb, 300px) * 0.54);
    bottom: calc(var(--tsc-mb, 300px) * -0.02);
    width: calc(var(--tsc-mb, 300px) * 0.95);
    height: calc(var(--tsc-mb, 300px) * 0.12);
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(40,0,60,0.55) 0%, rgba(40,0,60,0) 70%);
}
.tsc-msmall {
    position: absolute;
    left: calc(var(--tsc-mb, 300px) * 1.22);
    bottom: calc(var(--tsc-mb, 300px) * 0.03);
    width: var(--tsc-ms, 36px);
}
.tsc-msmall .tsc-chest-img { position: relative; transform-origin: 50% 100%; }
.tsc-msmall-shadow {
    position: absolute;
    left: 50%;
    bottom: -8%;
    width: 90%;
    height: 16%;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(40,0,60,0.5) 0%, rgba(40,0,60,0) 70%);
}
.tsc-mtag {
    position: absolute;
    left: 50%;
    top: 100%;
    margin-top: 5px;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: max(8px, calc(var(--tsc-ms, 36px) * 0.24));
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    padding: 0 0.6em;
    border-radius: 999px;
    background: rgba(50, 0, 90, 0.6);
    text-shadow: 0 0 4px #fff27a;
}

/* Lite mode (slow devices): the sunburst stands still, fewer extras */
.tsc-lite .tsc-sparkles,
.tsc-lite .tsc-card-inner::before { display: none; }
.tsc-lite .tsc-bg { animation-duration: 18s; }

@media (max-width: 600px) {
    .tsc-label { margin-top: 8px; }
    .tsc-card { border-radius: 12px; padding: 3px; }
    .tsc-card-inner { border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .tsc-sparkle, .tsc-title, .tsc-msg, .tsc-num { animation-duration: 6s; }
}

/* ==========================================================================
   Admin: ThaySauros Management
   ========================================================================== */
.tsc-nav-icon {
    width: 22px;
    height: 15px;
    vertical-align: -2px;
    margin-right: 4px;
    image-rendering: pixelated;
}
.tsc-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin: 14px 0;
}
.tsc-admin-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    padding: 12px 14px;
}
.tsc-admin-card label { display: block; font-weight: 700; margin-bottom: 6px; }
.tsc-admin-card input[type=number] { width: 100%; box-sizing: border-box; }
.tsc-admin-big { font-size: 1.6em; font-weight: 700; }
.tsc-admin-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.95em; }
.tsc-admin-table th, .tsc-admin-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: left; vertical-align: middle; }
.tsc-admin-table th { background: rgba(138,61,255,0.08); }
.tsc-admin-table img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; }
.tsc-admin-table tr.tsc-off td { opacity: 0.45; }
.tsc-admin-table input[type=checkbox] { width: auto; transform: scale(1.3); }
.tsc-tier { font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #1b0030; font-size: 0.85em; white-space: nowrap; }
.tsc-admin-scroll { max-height: 460px; overflow: auto; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; }
.tsc-admin-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.tsc-admin-msg { font-weight: 700; margin-top: 8px; }
.tsc-sim-out { white-space: pre-wrap; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; padding: 12px; margin-top: 10px; font-family: inherit; line-height: 1.5; }

/* ---- Round 24 (voices, daily limit, chest panel) -------------------------- */
/* a voice clip squashes and stretches whatever is talking */
.tsc-talk { display: inline-block; will-change: transform; transform-origin: 50% 70%; }
/* "You've found all my Treasure!": the daily limit, no chest on screen */
.tsc-all-found .tsc-msg {
    margin-top: 4vh;
    font-size: clamp(26px, min(6.4vw, 7vh), 64px);
}
.tsc-sub {
    margin: 2.4vh 16px 0;
    text-align: center;
    font-size: clamp(18px, min(3.8vw, 4vh), 36px);
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 0 8px #7df3ff, 0 0 18px #b06bff, 0 0 30px #ff4df0;
}
/* an avatar they already own: still a prize card, in grey */
.tsc-card.tsc-dupe .tsc-card-tag { color: #fff; background: #6c7287; }
.tsc-card.tsc-dupe img { opacity: 0.82; }

/* the chest panel at the top of the student dashboard */
.tsc-cp-row { flex: 0 0 100%; }
.tsc-cpanel {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 14px;
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 18px;
    border-radius: 18px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(255, 190, 60, 0.13), rgba(140, 60, 255, 0.2));
    border: 1px solid rgba(255, 200, 80, 0.5);
    box-shadow: 0 0 18px rgba(255, 190, 60, 0.18), 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.tsc-cpanel:hover, .tsc-cpanel:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(255, 190, 60, 0.35), 0 6px 18px rgba(0, 0, 0, 0.3);
    outline: none;
}
.tsc-cp-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 4px 6px;
}
.tsc-cp-item + .tsc-cp-item { border-left: 1px solid rgba(255, 255, 255, 0.14); }
.tsc-cp-img {
    width: 86px;
    height: auto;
    flex: 0 0 auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.45));
    transform-origin: 50% 100%;
    animation: tscCpBob 2.8s ease-in-out infinite;
    pointer-events: none;
    user-select: none;
}
.tsc-cp-mega .tsc-cp-img { width: 100px; animation-delay: -1.4s; }
.tsc-cp-info { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.tsc-cp-num {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    color: #ffd84a;
    text-shadow: 0 0 10px rgba(255, 190, 60, 0.6), 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.tsc-cp-mega .tsc-cp-num { color: #e4bcff; text-shadow: 0 0 10px rgba(190, 110, 255, 0.75), 2px 2px 4px rgba(0, 0, 0, 0.5); }
.tsc-cp-label { margin-top: 5px; font-size: 0.9rem; font-weight: 600; color: rgba(255, 255, 255, 0.85); }
/* today's counts: 1/3 (Round 25) */
.tsc-cp-of { font-size: 0.55em; font-weight: 700; opacity: 0.8; margin-left: 2px; }
.tsc-cp-full .tsc-cp-num { color: #8dff9a; text-shadow: 0 0 10px rgba(80, 255, 120, 0.55), 2px 2px 4px rgba(0, 0, 0, 0.5); }
.tsc-cpanel { flex-wrap: wrap; row-gap: 6px; }
.tsc-cp-note {
    flex: 0 0 100%;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffe69a;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.tsc-cp-note span { white-space: nowrap; }   /* if it has to wrap, "MORE DAILY CHESTS!" stays together */
.tsc-cp-pop .tsc-cp-img { animation: tscCpPop 0.75s ease-out; }
@keyframes tscCpBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes tscCpPop {
    0% { transform: scale(1, 1); }
    25% { transform: scale(1.25, 0.8); }
    55% { transform: translateY(-16px) scale(0.92, 1.12); }
    80% { transform: scale(1.08, 0.94); }
    100% { transform: none; }
}
@media (max-width: 600px) {
    .tsc-cpanel { gap: 6px; padding: 10px 6px; }
    .tsc-cp-item { flex-direction: column; justify-content: flex-end; gap: 6px; }
    .tsc-cp-info { align-items: center; }
    .tsc-cp-img { width: 64px; }
    .tsc-cp-mega .tsc-cp-img { width: 76px; }
    .tsc-cp-num { font-size: 2rem; }
    .tsc-cp-label { font-size: 0.78rem; text-align: center; }
    .tsc-cp-note { font-size: 0.72rem; }
}
@media (max-width: 360px) {
    .tsc-cp-note { font-size: 0.68rem; letter-spacing: 0; }   /* 2 lines on the tiniest phones */
}
@media (prefers-reduced-motion: reduce) {
    .tsc-cp-img, .tsc-cp-pop .tsc-cp-img { animation: none; }
}

/* Treasure Hunter leaderboard heading (Round 25) */
.leaderboard-chest-icon {
    height: 1.35em;
    width: auto;
    vertical-align: -0.3em;
    margin-right: 2px;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

/* ---- Round 27: "bank a prestige for a FREE MegaSauros" on the all-found screen ---- */
.tsc-bank-ad {
    margin: 2.6vh auto 0;
    max-width: min(88vw, 620px);
    padding: 1.4vh 14px 1.8vh;
    border-radius: 18px;
    background: rgba(40, 0, 70, 0.62);
    border: 2px solid rgba(255, 225, 77, 0.8);
    box-shadow: 0 0 22px rgba(255, 77, 240, 0.55);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1vh;
    text-align: center;
}
.tsc-bank-ad img {
    width: clamp(90px, 22vh, 190px);
    height: auto;
    filter: drop-shadow(0 0 14px #ff4df0) drop-shadow(0 0 30px #b400ff);
    animation: tscBankBob 1.6s ease-in-out infinite;
}
.tsc-bank-text {
    font-size: clamp(17px, min(3.6vw, 3.8vh), 32px);
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    padding: 0 12px;
    text-shadow: 0 0 8px #ffe14d, 0 0 18px #ff8a00, 0 0 32px #ff4df0;
    animation: tscBankGlow 1.4s ease-in-out infinite alternate;
}
.tsc-bank-text strong { color: #ffe14d; }
.tsc-bank-go { margin-top: 0.6vh; font-size: clamp(16px, min(3.4vw, 3.6vh), 30px); }
.tsc-bank-later img { width: clamp(70px, 14vh, 130px); }
.tsc-bank-later .tsc-bank-text { font-size: clamp(15px, min(3vw, 3.2vh), 26px); }
@keyframes tscBankBob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
@keyframes tscBankGlow {
    from { text-shadow: 0 0 6px #ffe14d, 0 0 14px #ff8a00, 0 0 24px #ff4df0; }
    to   { text-shadow: 0 0 12px #ffe14d, 0 0 26px #ff8a00, 0 0 46px #ff4df0; }
}
@media (prefers-reduced-motion: reduce) { .tsc-bank-ad img, .tsc-bank-text { animation: none; } }
/* Round 27: simulator Gem boxes */
.tsc-sim-opts label { display: inline-flex; align-items: center; gap: 6px; }
.tsc-sim-opts input[type="number"] { width: 80px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.35); color: #fff; font: inherit; }
