/* ==========================================================================
   Round 27: Arkay (ἀρχή) Prestige Perks box, Kratos (κράτος) case, Bank button,
   Kratos (κράτος) Powerup popup, and the Kratos admin panel.
   ========================================================================== */

.arkay-perks-section {
    margin: 30px auto 0;
    padding: 20px;
    max-width: 75%;
    background: linear-gradient(160deg, rgba(120, 70, 200, 0.16), rgba(40, 20, 70, 0.30));
    border: 2px solid rgba(200, 150, 255, 0.45);
    border-radius: 12px;
    box-shadow: 0 0 22px rgba(160, 100, 255, 0.15);
    color: #eee;
    box-sizing: border-box;
}
@media (max-width: 768px) {
    .arkay-perks-section { max-width: 100%; padding: 16px 12px; }
}

.arkay-perks-section .greek { font-family: "Times New Roman", serif; font-style: italic; opacity: 0.9; }

.arkay-perks-title {
    margin: 0 0 14px;
    text-align: center;
    color: #e0c3ff;
    font-size: 1.25rem;
    text-shadow: 0 0 10px rgba(200, 150, 255, 0.5);
}

/* One centred stack at every width (desktop looked lopsided side by side). */
.arkay-perks-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}
@media (max-width: 560px) {
    .arkay-perks-top { gap: 12px; }
}

/* the badge: column + big number */
.arkay-badge {
    flex: 0 0 auto;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 35%, #6b3fb0 0%, #3a1d6e 60%, #22103f 100%);
    border: 3px solid #ffd700;
    box-shadow: 0 0 0 4px rgba(200, 150, 255, 0.35), 0 0 24px rgba(255, 215, 0, 0.35), inset 0 0 18px rgba(0, 0, 0, 0.5);
}
.arkay-badge-icon { font-size: 1.7rem; line-height: 1; margin-top: 4px; }
.arkay-badge-num {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.05;
    color: #fff;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
}
.arkay-badge-label {
    font-size: 0.58rem;
    letter-spacing: 0.04em;
    line-height: 1.15;
    text-transform: uppercase;
    color: #ffe68a;
    text-align: center;
    max-width: 78px;
}

.arkay-perks-info { width: 100%; max-width: 560px; min-width: 0; margin: 0 auto; }
.arkay-perks-info p { margin: 0 0 10px; font-size: 0.92rem; color: #ddd; line-height: 1.4; }

.arkay-next-bar {
    height: 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(200, 150, 255, 0.4);
    overflow: hidden;
}
.arkay-next-fill {
    height: 100%;
    background: linear-gradient(90deg, #a46cff, #ffd700);
    border-radius: 6px;
}
.arkay-next-text { margin-top: 6px; font-size: 0.85rem; color: #e0c3ff; }

/* Kratos (κράτος) Case: 5 across. An epic shifting gradient; each powerup in it
   pulses, and the higher up the chain it is (--k, 0..1, set in kratos.js) the
   faster, bigger and brighter it pulses (--glow: gold, magenta, cyan, white-hot). */
.kcase {
    position: relative;
    margin: 18px auto 4px;
    max-width: 460px;
    padding: 12px 12px 14px;
    border-radius: 14px;
    background: linear-gradient(125deg, #1a0638, #4b1287, #12307a, #6a0f6e, #1a0638);
    background-size: 400% 400%;
    animation: kcaseSky 14s ease-in-out infinite;
    border: 2px solid transparent;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.75), 0 0 22px rgba(176, 107, 255, 0.55), 0 0 44px rgba(73, 246, 255, 0.18),
                inset 0 0 26px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}
/* a slow shine sweeping across the glass */
.kcase::before {
    content: "";
    position: absolute;
    inset: -40% -60%;
    background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.16) 50%, transparent 58%);
    animation: kcaseShine 6s ease-in-out infinite;
    pointer-events: none;
}
.kcase > * { position: relative; }
@keyframes kcaseSky { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes kcaseShine { 0% { transform: translateX(-60%); } 55%, 100% { transform: translateX(60%); } }
.kcase-tap { cursor: pointer; transition: transform 0.15s ease; }
.kcase-tap:hover { transform: translateY(-2px); }
.kcase-tap:focus-visible { outline: 3px solid #ffd700; outline-offset: 3px; }
.kcase-title {
    text-align: center;
    font-weight: 800;
    margin-bottom: 10px;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: #fff;
    text-shadow: 0 0 8px #ff5cf0, 0 0 16px #b06bff;
}
.kcase-title .greek { color: #ffe68a; }
.kcase-hint { text-align: center; margin-top: 9px; font-size: 0.72rem; color: rgba(255, 255, 255, 0.75); letter-spacing: 0.04em; }
.kcase-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.kcase-slot {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}
.kcase-slot.filled {
    --k: 0.2;
    --glow: #ffd24a;
    background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--glow) 38%, transparent), rgba(40, 10, 80, 0.85) 72%);
    border: 2px solid var(--glow);
    animation: kcasePulse calc(3.4s - 2.2s * var(--k)) ease-in-out infinite;
    animation-delay: calc(var(--d, 0s) * -1);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
    .kcase-slot.filled { background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.28), rgba(40, 10, 80, 0.85) 72%); }
}
@keyframes kcasePulse {
    0%, 100% { box-shadow: 0 0 calc(3px + 6px * var(--k)) var(--glow), inset 0 0 6px rgba(255, 255, 255, 0.15); transform: scale(1); }
    50%      { box-shadow: 0 0 calc(8px + 22px * var(--k)) var(--glow), inset 0 0 calc(6px + 10px * var(--k)) var(--glow);
               transform: scale(calc(1 + 0.03 + 0.07 * var(--k))); }
}
.kcase-icon {
    font-size: clamp(1.2rem, 5vw, 1.9rem);
    line-height: 1;
    filter: drop-shadow(0 0 calc(2px + 6px * var(--k, 0)) var(--glow, #ffd24a));
}
.kcase-label {
    font-size: 0.55rem;
    color: #fff;
    text-align: center;
    line-height: 1.1;
    margin-top: 3px;
    padding: 0 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px #000;
}
/* the slots still to fill: dark glass with a "?" that shimmers now and then */
.kcase-slot.empty {
    background: rgba(5, 0, 20, 0.45);
    border: 1.5px dashed rgba(200, 160, 255, 0.45);
}
.kcase-q {
    color: rgba(220, 190, 255, 0.55);
    font-size: 1.2rem;
    font-weight: 800;
    animation: kcaseQ 3s ease-in-out infinite;
    animation-delay: calc(var(--d, 0s) * -1);
}
@keyframes kcaseQ {
    0%, 70%, 100% { opacity: 0.45; text-shadow: none; }
    85%           { opacity: 1; text-shadow: 0 0 10px #b06bff, 0 0 18px #49f6ff; }
}
/* just unlocked (the popup): a big gold flash */
.kcase-slot.fresh { animation: kcaseFresh 0.9s ease-in-out infinite alternate; }
@keyframes kcaseFresh {
    from { box-shadow: 0 0 8px #ffd700; transform: scale(1); }
    to   { box-shadow: 0 0 28px #ffd700, 0 0 50px #fff; transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
    .kcase, .kcase::before, .kcase-slot.filled, .kcase-q, .kcase-slot.fresh { animation: none; }
}
@media (max-width: 400px) {
    .kcase-label { display: none; }
    .kcase-grid { gap: 6px; }
}

/* checklist */
.kratos-list { list-style: none; margin: 16px auto 0; padding: 0; max-width: 560px; }
.kratos-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin-bottom: 7px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(200, 150, 255, 0.25);
}
.kratos-row.unlocked { border-color: rgba(127, 219, 127, 0.55); background: rgba(60, 140, 60, 0.15); }
.kratos-row.locked { opacity: 0.85; }
.kratos-icon { font-size: 1.6rem; flex: 0 0 auto; }
.kratos-row.locked .kratos-icon { filter: grayscale(0.6); }
.kratos-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.kratos-text strong { color: #fff; font-size: 0.95rem; }
.kratos-text small { color: #bbb; font-size: 0.78rem; }
.kratos-at {
    flex: 0 0 auto;
    font-weight: 700;
    color: #e0c3ff;
    font-size: 0.85rem;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(160, 100, 255, 0.15);
    white-space: nowrap;
}
.kratos-at.done { color: #7fdb7f; background: rgba(127, 219, 127, 0.12); }
.kratos-none { text-align: center; color: #bbb; margin: 14px 0 0; }

.kratos-tease {
    margin-top: 12px;
    text-align: center;
    color: #ffd700;
    font-size: 0.92rem;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* Narrow phones (iPhone SE): the threshold chip goes under the name, and
   the Kratos case gets tighter so the emojis stay big enough to read. */
@media (max-width: 480px) {
    .kratos-row { flex-wrap: wrap; gap: 4px 10px; padding: 8px 10px; }
    .kratos-icon { font-size: 1.4rem; }
    .kratos-text { flex: 1 1 calc(100% - 44px); }
    .kratos-at { margin-left: 36px; font-size: 0.8rem; }
    .kcase { padding: 8px 6px 10px; }
    .kcase-grid { gap: 4px; }
    .kcase-slot { border-radius: 7px; }
    .kcase-slot.empty { border-width: 1px; }
    .kcase-slot.filled { border-width: 1.5px; }
    .kcase-q { font-size: 0.9rem; }
    .arkay-perks-title { font-size: 1.1rem; }
}
@media (max-width: 400px) {
    .arkay-perks-section { padding: 14px 8px; }
    .kratos-row { padding: 8px 8px; gap: 4px 8px; }
}

/* Orchard stats: the prestige pills get their own line (Round 27) */
.orchard-stats-bottom.orchard-stats-prestige { margin-top: 8px; }

/* ---- the "new powerup" popup ------------------------------------------------ */
.kratos-popup {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 4, 25, 0.82);
    padding: 16px;
    box-sizing: border-box;
    animation: kratosFade 0.35s ease-out;
}
@keyframes kratosFade { from { opacity: 0; } to { opacity: 1; } }
.kratos-popup-card {
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 22px 18px;
    border-radius: 16px;
    text-align: center;
    color: #fff;
    background: linear-gradient(170deg, #4a2690, #1d0d3a);
    border: 3px solid #ffd700;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.45);
    animation: kratosPop 0.5s cubic-bezier(.2, 1.4, .4, 1);
    box-sizing: border-box;
}
@keyframes kratosPop { from { transform: scale(0.6); } to { transform: scale(1); } }
.kratos-popup-card .greek { font-family: "Times New Roman", serif; font-style: italic; }
.kratos-popup-head { font-weight: 800; color: #ffd700; font-size: 1.15rem; margin-bottom: 12px; text-shadow: 0 0 10px rgba(255, 215, 0, 0.6); }
.kratos-popup-item { margin: 10px 0 14px; }
.kratos-popup-icon { font-size: 3.4rem; line-height: 1.1; filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8)); }
.kratos-popup-name { font-size: 1.3rem; font-weight: 800; margin-top: 4px; }
.kratos-popup-desc { color: #e0c3ff; margin-top: 4px; }
.kratos-popup-at { color: #bbb; font-size: 0.8rem; margin-top: 4px; }
.kratos-popup-btn { margin-top: 14px; min-width: 160px; }

/* ---- admin ------------------------------------------------------------------ */
.kadm-settings, .kadm-help, .kadm-add, .kadm-arkay {
    margin: 14px 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.kadm-settings input { width: 80px; margin: 0 8px; }
.kadm-settings small, .kadm-help { display: block; color: #aaa; font-size: 0.85rem; margin-top: 6px; }
.kadm-help div { margin: 3px 0; }
.kadm-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(160, 100, 255, 0.08);
    border: 1px solid rgba(200, 150, 255, 0.3);
}
.kadm-row.off { opacity: 0.55; }
.kadm-order { display: flex; flex-direction: column; gap: 3px; }
.kadm-at { width: 70px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #ffd700; }
.kadm-at small { color: #aaa; font-size: 0.7rem; }
.kadm-level {
    width: 64px;
    box-sizing: border-box;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 8px;
    padding: 4px 2px;
}
.kadm-level:focus { outline: none; border-color: #ffd700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.kadm-even { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.kadm-row.kadm-flash { animation: kadmFlash 1.2s ease-out; }
@keyframes kadmFlash { from { box-shadow: 0 0 0 3px #ffd700; } to { box-shadow: 0 0 0 3px transparent; } }
.kadm-icon { width: 52px; font-size: 1.4rem; text-align: center; }
.kadm-main { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kadm-main input { width: 100%; box-sizing: border-box; }
.kadm-effect { display: flex; flex-direction: column; gap: 4px; }
.kadm-effect input { width: 70px; }
.kadm-btns { display: flex; gap: 6px; }
.kadm-students { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.kadm-student { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); }
.kadm-student input { width: 70px; }
.kadm-initials { font-weight: 700; min-width: 34px; }
/* Round 31: Gem Transformations */
.kadm-arkay h5 { margin: 14px 0 4px; color: #e0c3ff; }
.kgem-odds-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.kgem-odds { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: rgba(160, 100, 255, 0.08); border: 1px solid rgba(200, 150, 255, 0.3); font-size: 0.85rem; }
.kgem-odds img { width: 34px; height: 34px; object-fit: contain; }
.kgem-odds input { width: 80px; }
#kgem-grabs, #kgem-daily, #kgem-mins { width: 80px; }
.kgem-sim { border-collapse: collapse; margin-top: 8px; font-size: 0.85rem; }
.kgem-sim th, .kgem-sim td { padding: 3px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); text-align: left; }
.kgem-tests, .kgem-log { margin: 6px 0 0 18px; color: #bbb; font-size: 0.85rem; }
.kgem-tests li, .kgem-log li { margin: 4px 0; }
#gift-log ul { margin: 6px 0 0 18px; color: #bbb; font-size: 0.85rem; }

/* μῦθος (Mythical) ichthus in the Dex */
.muthos-rarity {
    font-family: "Times New Roman", serif;
    font-weight: 700;
    color: #ff9de2;
    text-shadow: 0 0 8px rgba(255, 120, 220, 0.8);
}
.ichthysdex-entry.muthos-entry { box-shadow: 0 0 14px rgba(255, 120, 220, 0.45); border-color: rgba(255, 120, 220, 0.7) !important; }
.muthos-badge { font-size: 0.7rem; color: #ff9de2; margin-left: 4px; }

/* ---- Round 27: the short list's notes, the full collection, Bank Prestiges ---- */
.kratos-text em { color: #c9a8ff; font-size: 0.72rem; font-style: normal; margin-top: 2px; }
.kratos-row.replaced { opacity: 0.6; }
.kratos-row.replaced .kratos-icon { filter: grayscale(0.4); }
.kratos-list-full { text-align: left; margin-top: 14px; }
.kratos-popup-sub { color: #e0c3ff; font-weight: 700; margin: -4px 0 6px; }

.arkay-bank { margin-top: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.arkay-bank-btn {
    font-family: inherit;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    color: #2b1500;
    padding: 9px 20px;
    border-radius: 999px;
    border: 2px solid #fff3c4;
    cursor: pointer;
    background: linear-gradient(180deg, #ffe680 0%, #ffb300 100%);
    box-shadow: 0 4px 0 #9a5a00, 0 0 16px rgba(255, 200, 0, 0.55);
    animation: arkayBankPulse 1.6s ease-in-out infinite;
}
.arkay-bank-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #9a5a00, 0 0 12px rgba(255, 200, 0, 0.5); }
.arkay-bank-btn[disabled] { animation: none; cursor: default; filter: grayscale(0.8); opacity: 0.55; box-shadow: 0 3px 0 #555; }
@keyframes arkayBankPulse { 0%, 100% { box-shadow: 0 4px 0 #9a5a00, 0 0 10px rgba(255, 200, 0, 0.4); } 50% { box-shadow: 0 4px 0 #9a5a00, 0 0 24px rgba(255, 200, 0, 0.9); } }
.arkay-bank-ad { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.82rem; color: #ffd6fb; text-align: left; }
.arkay-bank-ad img { width: 46px; height: auto; flex: 0 0 auto; filter: drop-shadow(0 0 8px #ff4df0); animation: arkayBankBob 1.8s ease-in-out infinite; }
.arkay-bank-ad strong { color: #fff; text-shadow: 0 0 8px #ff4df0; }
@keyframes arkayBankBob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-4px) rotate(4deg); } }
.arkay-bank small { color: #aaa; font-size: 0.75rem; text-align: center; }
@media (prefers-reduced-motion: reduce) { .arkay-bank-btn, .arkay-bank-ad img { animation: none; } }

/* the "are you sure?" card */
.kbank-list { text-align: left; display: flex; flex-direction: column; gap: 9px; margin: 6px 0 4px; font-size: 0.92rem; line-height: 1.35; }
.kbank-good { color: #e9ffe9; }
.kbank-mega { display: flex; align-items: center; gap: 10px; }
.kbank-mega img { width: 64px; height: auto; flex: 0 0 auto; filter: drop-shadow(0 0 10px #ff4df0); }
.kbank-bad { color: #ffd2c2; background: rgba(255, 90, 60, 0.12); border: 1px solid rgba(255, 120, 90, 0.45); border-radius: 8px; padding: 8px 10px; }
.kbank-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 4px; }
.kbank-no { background: rgba(255, 255, 255, 0.12); color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); margin-top: 14px; }
.kbank-error { color: #ff8a8a; margin-top: 10px; font-weight: 700; }
/* how many to bank (only when there's more than 1) */
.kbank-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 10px; border-radius: 10px; background: rgba(255, 215, 0, 0.08); border: 1px solid rgba(255, 215, 0, 0.35); }
.kbank-pick-label { color: #ffe68a; font-weight: 700; font-size: 0.9rem; }
.kbank-stepper { display: flex; align-items: center; gap: 14px; }
.kbank-step {
    width: 42px; height: 42px; border-radius: 50%;
    font: inherit; font-size: 1.5rem; font-weight: 800; line-height: 1;
    color: #2b1500; cursor: pointer;
    border: 2px solid #fff3c4;
    background: linear-gradient(180deg, #ffe680 0%, #ffb300 100%);
    box-shadow: 0 3px 0 #9a5a00;
}
.kbank-step:active { transform: translateY(2px); box-shadow: 0 1px 0 #9a5a00; }
.kbank-step[disabled] { cursor: default; filter: grayscale(1); opacity: 0.4; transform: none; }
.kbank-count { min-width: 2.2em; text-align: center; font-size: 2rem; font-weight: 800; color: #fff; text-shadow: 0 0 12px rgba(255, 215, 0, 0.7); }
.kbank-quick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.kbank-q {
    font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer;
    color: #ffe68a; padding: 4px 12px; border-radius: 999px;
    background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 215, 0, 0.5);
}
.kbank-q.on { background: #ffd700; color: #2b1500; }
@media (max-width: 400px) {
    .arkay-bank-ad { flex-direction: column; text-align: center; gap: 4px; }
    .arkay-bank-btn { font-size: 0.85rem; padding: 8px 14px; }
    .kcase-title { font-size: 0.9rem; }
}

/* ---- Round 27 artwork: powerup pictures ------------------------------------ */
.kpic { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.kcase-icon .kpic { width: clamp(26px, 7.5vw, 54px); height: clamp(26px, 7.5vw, 54px); }
.kratos-icon .kpic { width: 2.1rem; height: 2.1rem; }
.kratos-popup-icon .kpic { width: 104px; height: 104px; margin: 0 auto; }
.kpic.kpic-inline { display: inline-block; width: 1.5em; height: 1.5em; vertical-align: -0.4em; }
.kratos-row.locked .kratos-icon .kpic { filter: grayscale(0.7) brightness(0.8); }
.kadm-pic { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.kadm-pic select { max-width: 190px; }
.kadm-pic-prev { width: 40px; height: 40px; object-fit: contain; }

/* ---- Round 27 artwork: Kratos Gems circling the dashboard's top panels ------
   They travel round a rounded rectangle just outside the top row of panels.
   kratos.js writes the path as @keyframes kgemLap (px, sized to the panels) and
   only transform / opacity animate, so the GPU does the work. At most a handful
   of gems, nothing can be clicked, perf-helpers.js pauses them off screen and
   "reduce motion" turns them off. */
.student-stats { position: relative; }
.kgem-orbit { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 3; }
.kgem { position: absolute; left: 0; top: 0; animation: kgemIn 1.1s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: var(--in, 0s); }
.kgem-lap { position: relative; animation: kgemLap var(--t, 30s) linear infinite; animation-delay: var(--dl, 0s); will-change: transform; }
.kgem-img {
    display: block;
    width: var(--gs, 34px);
    height: var(--gs, 34px);
    margin: calc(var(--gs, 34px) / -2) 0 0 calc(var(--gs, 34px) / -2);
    filter: drop-shadow(0 0 6px var(--gc, #fff)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.7));
    animation: kgemBob 3.4s ease-in-out infinite alternate;
    animation-delay: var(--db, 0s);
    will-change: transform;
}
.kgem-lap::after {   /* a little four-point twinkle on the gem now and then */
    content: '';
    position: absolute;
    left: calc(var(--gs, 34px) * 0.1);
    top: calc(var(--gs, 34px) * -0.66);
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #fff 0 16%, transparent 22%),
                linear-gradient(90deg, transparent 46%, rgba(255, 255, 255, 0.9) 49% 51%, transparent 54%),
                linear-gradient(0deg, transparent 46%, rgba(255, 255, 255, 0.9) 49% 51%, transparent 54%);
    opacity: 0;
    animation: kgemTwinkle 2.8s ease-in-out infinite;
    animation-delay: var(--db, 0s);
}
.kgem-telos { --gs2: calc(var(--gs, 34px) * 1.45); z-index: 1; }   /* Round 28: the Telos Gem is a bit bigger */
.kgem-telos .kgem-img { width: var(--gs2); height: var(--gs2); margin: calc(var(--gs2) / -2) 0 0 calc(var(--gs2) / -2);
    filter: drop-shadow(0 0 8px var(--gc)) drop-shadow(0 0 3px rgba(255, 255, 255, 0.8)); }
@keyframes kgemIn { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: scale(1); } }
@keyframes kgemBob { from { transform: rotate(-12deg) translateY(-3px) scale(0.96); } to { transform: rotate(12deg) translateY(3px) scale(1.04); } }
@keyframes kgemTwinkle { 0%, 64%, 100% { opacity: 0; transform: scale(0.2); } 78% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .kgem-orbit { display: none; } }
