/* ==========================================================
   Secret Agent Academy — styles
   ========================================================== */
:root {
  --bg: #060a14;
  --bg2: #0a1222;
  --panel: rgba(15, 26, 46, .82);
  --panel-solid: #0f1a2e;
  --panel2: #15233d;
  --line: rgba(148, 163, 184, .16);
  --text: #e2e8f0;
  --muted: #8ea0b8;
  --cyan: #22d3ee;
  --cyan2: #0891b2;
  --amber: #fbbf24;
  --red: #f43f5e;
  --green: #22c55e;
  --violet: #a78bfa;
  --gold1: #fde68a;
  --gold2: #f59e0b;
  --st-red: #ef4444;
  --st-yellow: #facc15;
  --st-green: #22c55e;
  --radius: 16px;
  --font: 'Rubik', system-ui, 'Segoe UI', Arial, sans-serif;
  --stencil: 'Black Ops One', 'Rubik', sans-serif;
  --mono: 'Share Tech Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(167, 139, 250, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(34, 211, 238, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(34, 211, 238, .035) 1px, transparent 1px);
  background-size: 44px 44px;
}
#app { position: relative; z-index: 1; min-height: 100vh; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
.en { unicode-bidi: isolate; }
.hidden { display: none !important; }
.sub { color: var(--muted); font-size: .9rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .6em 1.2em; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel2); font-weight: 500; transition: transform .12s, background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { border-color: rgba(34, 211, 238, .5); background: #1a2b4a; }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, #06b6d4, #3b82f6); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 6px 24px rgba(34, 211, 238, .25); }
.btn-primary:hover { background: linear-gradient(135deg, #22d3ee, #60a5fa); box-shadow: 0 8px 30px rgba(34, 211, 238, .4); }
.btn-big { padding: .85em 2em; font-size: 1.15rem; }
.btn.sm { padding: .35em .8em; font-size: .88rem; border-radius: 9px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: .4em .8em; }
.btn-ghost:hover { border-color: var(--cyan); }
.row-btns { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.hud-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); font-size: 1.05rem; display: grid; place-items: center; flex: none; }
.hud-btn:hover { border-color: var(--cyan); }

.bar { height: 10px; background: rgba(148, 163, 184, .15); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), #60a5fa); transition: width .6s cubic-bezier(.2, .8, .2, 1); }

/* ---------- panel ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; backdrop-filter: blur(8px); box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.panel-head { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; }
.panel-head h2 { margin: 0; font-size: 1.2rem; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .8rem;
  padding: .6rem 1.2rem; background: rgba(6, 10, 20, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: .55rem; font-family: var(--stencil); letter-spacing: .06em; font-size: 1.02rem; white-space: nowrap; }
.logo b { color: var(--cyan); font-weight: 400; }
.logo-mark { color: var(--cyan); font-size: 1.5rem; text-shadow: 0 0 14px var(--cyan); }
.topnav { display: flex; gap: .3rem; margin-inline-start: auto; }
.topnav button { background: none; border: 1px solid transparent; border-radius: 10px; padding: .45em .9em; color: var(--muted); }
.topnav button:hover { color: var(--text); }
.topnav button.on { color: var(--text); background: var(--panel2); border-color: var(--line); }
.wallet { display: flex; gap: .4rem; }
.wallet span { background: var(--panel2); border: 1px solid var(--line); padding: .35em .8em; border-radius: 99px; font-weight: 700; white-space: nowrap; }
.w-coin b { color: var(--amber); }
.w-dia b { color: #7dd3fc; }

/* ---------- toasts / modal ---------- */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel-solid); border: 1px solid var(--line); padding: .7em 1.2em; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: toastIn .3s ease-out; transition: opacity .4s, transform .4s; max-width: 90vw; }
.toast-good { border-color: rgba(34, 197, 94, .6); }
.toast-bad { border-color: rgba(244, 63, 94, .6); }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } }

.modal-back { position: fixed; inset: 0; z-index: 150; background: rgba(2, 6, 23, .7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; }
.modal-back.out { opacity: 0; transition: opacity .2s; }
.modal { position: relative; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 20px; padding: 1.6rem; width: min(440px, 100%); max-height: 86vh; overflow: auto; animation: popIn .3s cubic-bezier(.2, 1.4, .4, 1); }
.modal.wide { width: min(760px, 100%); }
.modal h2 { margin-top: 0; }
.modal-x { position: absolute; top: 12px; left: 12px; background: none; border: none; color: var(--muted); font-size: 1.1rem; }
.confirm p { font-size: 1.1rem; text-align: center; margin: .6rem 0 0; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.85); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; }

.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ==========================================================
   LOGIN
   ========================================================== */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.radar { width: 900px; height: 900px; border-radius: 50%; opacity: .5;
  background:
    repeating-radial-gradient(circle, transparent 0 79px, rgba(34, 211, 238, .14) 79px 80px),
    conic-gradient(from 0deg, rgba(34, 211, 238, .22), transparent 25%);
  animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-box { position: relative; width: min(520px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 2rem; backdrop-filter: blur(12px); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); text-align: center; animation: popIn .4s; }
.login-box.wide { width: min(760px, 100%); }
.login-logo h1 { font-family: var(--stencil); font-weight: 400; letter-spacing: .08em; font-size: 2.3rem; line-height: 1.05; margin: .4rem 0; }
.login-logo h1 b { color: var(--cyan); font-weight: 400; text-shadow: 0 0 24px rgba(34, 211, 238, .5); }
.login-logo p { color: var(--muted); margin: 0 0 1.4rem; }
.seal { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 3rem; color: var(--cyan); border: 2px solid rgba(34, 211, 238, .5); box-shadow: 0 0 40px rgba(34, 211, 238, .3), inset 0 0 20px rgba(34, 211, 238, .2); animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 60px rgba(34, 211, 238, .5), inset 0 0 30px rgba(34, 211, 238, .3); } }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.role { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.4rem 1rem; background: var(--panel2); border: 1px solid var(--line); border-radius: 18px; transition: transform .2s, border-color .2s, box-shadow .2s; }
.role:hover { transform: translateY(-4px); border-color: var(--cyan); box-shadow: 0 10px 30px rgba(34, 211, 238, .2); }
.role span { font-size: 2.6rem; }
.role b { font-size: 1.15rem; }
.role small { color: var(--muted); }
.demo-info { margin-top: 1.4rem; text-align: right; background: rgba(251, 191, 36, .07); border: 1px dashed rgba(251, 191, 36, .4); border-radius: 12px; padding: .7rem 1rem; font-size: .92rem; }
.demo-info summary { cursor: pointer; color: var(--amber); }
.demo-info p { line-height: 1.8; }
.form { text-align: right; display: flex; flex-direction: column; gap: 1rem; }
.form h2, .login-box h2 { margin: .2rem 0; text-align: center; }
.form label, .pin-row label { display: flex; flex-direction: column; gap: .4rem; color: var(--muted); }
.form input, .pin-row input, .w-tools input, .w-tools select {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: .75em 1em; font-size: 1.05rem; outline: none; transition: border-color .2s;
}
.form input:focus, .pin-row input:focus, .w-tools input:focus { border-color: var(--cyan); }
#code { text-transform: uppercase; letter-spacing: .2em; text-align: center; font-family: var(--mono); font-size: 1.4rem; }
#pin { letter-spacing: .6em; text-align: center; font-size: 1.5rem; width: 180px; }
.back { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--muted); }
.back:hover { color: var(--text); }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; margin: 1rem 0; }
.name-btn { padding: .8em .5em; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); font-weight: 500; transition: .15s; }
.name-btn:hover { border-color: var(--cyan); }
.name-btn.on { background: linear-gradient(135deg, #0e7490, #1d4ed8); border-color: var(--cyan); }
.pin-row { display: flex; align-items: flex-end; justify-content: center; gap: 1rem; flex-wrap: wrap; animation: fadeIn .3s; }

/* ==========================================================
   AGENT STAGE (avatar card)
   ========================================================== */
.agent-stage { position: relative; height: 270px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: center; }
.agent-stage.sm { height: 170px; width: 150px; flex: none; }
.agent-stage::after { content: ''; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(transparent, rgba(0, 0, 0, .35)); pointer-events: none; }
.agent-wrap { height: 82%; aspect-ratio: 120/170; position: relative; z-index: 2; margin-bottom: 4px; }
.agent-svg { width: 100%; height: 100%; display: block; overflow: visible; transform-origin: 50% 100%; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scaleY(1.015) translateY(-1px); } }
.agent-svg .leg, .agent-svg .arm { transform-box: fill-box; transform-origin: 50% 0; }
.ninja-tail { transform-box: fill-box; transform-origin: 0 0; animation: tail 1.2s ease-in-out infinite alternate; }
@keyframes tail { to { transform: rotate(12deg); } }

.pet-wrap { position: absolute; z-index: 3; top: 16%; right: 10%; width: 74px; animation: float 2.6s ease-in-out infinite; }
.agent-stage.sm .pet-wrap { width: 46px; right: 4%; }
.pet-svg { width: 100%; display: block; overflow: visible; }
@keyframes float { 50% { transform: translateY(-10px); } }
.rotor { transform-box: fill-box; transform-origin: center; animation: rotor .12s linear infinite alternate; }
@keyframes rotor { to { transform: scaleX(.25); } }
.wag { transform-box: fill-box; transform-origin: 100% 100%; animation: wag .35s ease-in-out infinite alternate; }
@keyframes wag { from { transform: rotate(-12deg); } to { transform: rotate(16deg); } }
.blink { animation: blink 2.4s infinite; }
@keyframes blink { 0%, 80%, 100% { opacity: 1; } 85% { opacity: .1; } }
.jet { transform-box: fill-box; transform-origin: 50% 0; animation: jet .15s infinite alternate; }
@keyframes jet { to { transform: scaleY(.6); opacity: .5; } }

/* card backgrounds */
.bg_midnight { background: radial-gradient(circle at 50% 30%, #1e3a5f, #0b1324 70%); }
.bg_neon { background:
  linear-gradient(transparent 94%, rgba(236, 72, 153, .55) 94%) 0 0 / 100% 26px,
  linear-gradient(90deg, transparent 94%, rgba(34, 211, 238, .45) 94%) 0 0 / 26px 100%,
  linear-gradient(#1e0b3a, #4c0d6b); }
.bg_classified { background: repeating-linear-gradient(0deg, #e9dfc7 0 22px, #ddd0b0 22px 23px); }
.bg_classified::before { content: 'CLASSIFIED'; position: absolute; top: 18%; left: 50%; transform: translateX(-50%) rotate(-14deg); font-family: var(--stencil); font-size: 2rem; color: rgba(185, 28, 28, .35); border: 4px solid rgba(185, 28, 28, .35); padding: 0 .4em; white-space: nowrap; }
.bg_matrix { background: repeating-linear-gradient(90deg, rgba(34, 197, 94, .16) 0 2px, transparent 2px 16px), repeating-linear-gradient(0deg, rgba(34, 197, 94, .06) 0 8px, transparent 8px 20px), linear-gradient(#022c22, #052e16); }
.bg_gold { background: linear-gradient(135deg, #451a03, #b45309 35%, #fcd34d 50%, #b45309 65%, #451a03); }

/* spawn animations */
.spawn-fade { animation: spFade .7s ease-out both; }
@keyframes spFade { from { opacity: 0; transform: translateY(20px); } }
.spawn-teleport { animation: spTele 1s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes spTele { 0% { transform: scale(.1, 1.6); opacity: 0; filter: brightness(4) drop-shadow(0 0 20px #22d3ee); } 60% { opacity: 1; filter: brightness(2) drop-shadow(0 0 20px #22d3ee); } 100% { transform: none; filter: none; } }
.beam { position: absolute; z-index: 1; bottom: 0; left: 50%; width: 120px; height: 100%; transform: translateX(-50%); background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .6), transparent); animation: beam 1.1s ease-out forwards; }
@keyframes beam { 0% { opacity: 0; transform: translateX(-50%) scaleX(.2); } 30% { opacity: 1; transform: translateX(-50%) scaleX(1); } 100% { opacity: 0; transform: translateX(-50%) scaleX(.1); } }
.spawn-smoke { animation: spSmoke 1.2s ease-out both; }
@keyframes spSmoke { 0%, 35% { opacity: 0; } 100% { opacity: 1; } }
.smoke { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.smoke i { position: absolute; bottom: 10%; left: 50%; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(203, 213, 225, .9), rgba(148, 163, 184, 0) 70%); animation: puff 1.4s ease-out forwards; }
.smoke i:nth-child(2) { margin-left: -70px; animation-delay: .08s; }
.smoke i:nth-child(3) { margin-left: 20px; bottom: 30%; animation-delay: .15s; }
.smoke i:nth-child(4) { margin-left: -40px; bottom: 45%; animation-delay: .22s; }
@keyframes puff { 0% { transform: translateX(-50%) scale(.2); opacity: 1; } 100% { transform: translateX(-50%) scale(3); opacity: 0; } }
.spawn-parachute { animation: spPara 1.4s cubic-bezier(.3, .7, .4, 1) both; }
@keyframes spPara { 0% { transform: translateY(-120%) rotate(-8deg); } 60% { transform: translateY(4%) rotate(4deg); } 80% { transform: translateY(-3%) rotate(-2deg); } 100% { transform: none; } }
.spawn-glitch { animation: spGlitch .9s steps(1) both; }
@keyframes spGlitch {
  0% { opacity: 0; } 10% { opacity: 1; transform: translateX(-12px); filter: hue-rotate(90deg); clip-path: inset(0 0 60% 0); }
  20% { transform: translateX(10px); clip-path: inset(40% 0 0 0); } 30% { transform: translateX(-6px); filter: hue-rotate(200deg); clip-path: inset(20% 0 30% 0); }
  45% { transform: translateX(4px); clip-path: none; filter: none; } 55% { transform: translateX(-3px) skewX(8deg); } 70%, 100% { transform: none; filter: none; clip-path: none; } }

.rank-badge { display: inline-block; padding: .3em .9em; border-radius: 99px; font-size: .9rem; font-weight: 500; background: rgba(34, 211, 238, .12); border: 1px solid rgba(34, 211, 238, .4); color: #a5f3fc; }
.rank-badge .en { font-family: var(--stencil); letter-spacing: .04em; font-weight: 400; }
.rank-badge.r5 { background: rgba(74, 222, 128, .12); border-color: rgba(74, 222, 128, .5); color: #bbf7d0; }
.rank-badge.r10 { background: rgba(167, 139, 250, .14); border-color: rgba(167, 139, 250, .5); color: #ddd6fe; }
.rank-badge.r15 { background: rgba(244, 114, 182, .14); border-color: rgba(244, 114, 182, .5); color: #fbcfe8; }
.rank-badge.r20 { background: linear-gradient(90deg, rgba(253, 230, 138, .25), rgba(245, 158, 11, .25)); border-color: var(--gold2); color: var(--gold1); }
.xp { margin: .9rem 0 .2rem; }
.xp-top { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }

/* ==========================================================
   HUB
   ========================================================== */
.hub-grid { display: grid; grid-template-columns: 300px 1fr; grid-template-areas: "agent missions" "agent weekly"; gap: 1.2rem; padding: 1.2rem; max-width: 1300px; margin: 0 auto; }
.agent-card { grid-area: agent; text-align: center; align-self: start; position: sticky; top: 80px; }
.agent-name { margin: .9rem 0 .4rem; font-size: 1.5rem; }
.hint { color: var(--muted); font-size: .88rem; margin: .8rem 0 0; }
.missions { grid-area: missions; }
.weekly { grid-area: weekly; }
.mission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.mission {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; text-align: right;
  padding: 1.1rem 1.1rem 1rem; border-radius: 16px; border: 1px solid var(--line); overflow: hidden;
  background: linear-gradient(160deg, rgba(34, 211, 238, .08), transparent 50%), var(--panel2);
  transition: transform .2s, border-color .2s, box-shadow .2s; animation: cardIn .5s both; animation-delay: calc(var(--i) * 60ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } }
.mission::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .08) 50%, transparent 60%); transform: translateX(100%); transition: transform .6s; }
.mission:hover:not(.locked) { transform: translateY(-4px); border-color: var(--cyan); box-shadow: 0 12px 34px rgba(34, 211, 238, .2); }
.mission:hover:not(.locked)::after { transform: translateX(-100%); }
.m-num { position: absolute; top: .7rem; left: .9rem; font-family: var(--mono); color: var(--muted); font-size: .85rem; }
.m-icon { font-size: 2.3rem; margin-bottom: .3rem; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.m-name { font-family: var(--stencil); font-size: 1.12rem; letter-spacing: .03em; }
.m-he { color: var(--muted); font-size: .92rem; }
.m-skill { margin-top: .5rem; font-size: .8rem; padding: .2em .7em; border-radius: 99px; background: rgba(34, 211, 238, .1); color: #a5f3fc; }
.m-best { font-size: .78rem; color: var(--amber); margin-top: .35rem; }
.mission.locked { filter: grayscale(.9); opacity: .55; cursor: not-allowed; }
.mission.locked .m-skill { background: rgba(148, 163, 184, .12); color: var(--muted); }

.ch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.ch-list li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.ch-list li.done { border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .07); }
.ch-list li.done .ch-text { text-decoration: line-through; color: var(--muted); }
.ch-ico { font-size: 1.3rem; }
.ch-text { margin-bottom: .35rem; font-size: .95rem; }
.ch-body .bar { height: 7px; }
.ch-list li.done .bar i { background: var(--green); }
.ch-prog { font-family: var(--mono); color: var(--muted); font-size: .9rem; direction: ltr; unicode-bidi: isolate; }
.ch-rew { font-weight: 700; color: #7dd3fc; }

/* ==========================================================
   GAME FRAME
   ========================================================== */
.game { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.game-hud { display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; background: rgba(6, 10, 20, .9); border-bottom: 1px solid var(--line); z-index: 5; }
.hud-title { display: flex; align-items: baseline; gap: .5rem; white-space: nowrap; }
.hud-title b { font-family: var(--stencil); font-weight: 400; letter-spacing: .04em; }
.hud-title small { color: var(--muted); }
.hud-icon { font-size: 1.3rem; }
.hud-progress { flex: 1; display: flex; align-items: center; gap: .6rem; max-width: 420px; margin-inline-start: auto; }
.hud-progress .bar { flex: 1; }
.hud-count { font-family: var(--mono); color: var(--muted); min-width: 3.4em; }
.hud-score { display: flex; gap: .7rem; font-family: var(--mono); font-size: 1.05rem; }
.hud-score .ok { color: #4ade80; }
.hud-score .bad { color: #fb7185; }
.game-stage { flex: 1; position: relative; overflow: hidden; }

.briefing { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; }
.brief-card { position: relative; text-align: center; width: min(460px, 100%); padding: 2rem 1.6rem; border-radius: 20px; background: linear-gradient(170deg, #1b2a47, #0f1a2e); border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(0, 0, 0, .5); animation: popIn .4s cubic-bezier(.2, 1.4, .4, 1); overflow: hidden; }
.brief-stamp { position: absolute; top: 18px; left: -36px; transform: rotate(-35deg); background: var(--red); color: #fff; font-family: var(--stencil); font-size: .8rem; padding: .25em 3em; letter-spacing: .1em; }
.brief-icon { font-size: 4rem; animation: float 3s ease-in-out infinite; }
.brief-card h2 { font-family: var(--stencil); font-weight: 400; letter-spacing: .05em; margin: .3rem 0 0; font-size: 2rem; }
.brief-card h3 { margin: .1rem 0 .8rem; color: var(--cyan); font-weight: 500; }
.brief-card p { color: #cbd5e1; line-height: 1.6; }
.brief-skill { display: table; margin: 0 auto 1.2rem; font-size: .85rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 99px; padding: .2em .9em; }

.float-fb { position: absolute; top: 38%; left: 50%; transform: translateX(-50%); z-index: 30; padding: .6em 1.3em; border-radius: 14px; font-size: 1.25rem; font-weight: 700; pointer-events: none; animation: floatUp 1.1s ease-out forwards; white-space: nowrap; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.float-fb.good { background: #15803d; }
.float-fb.bad { background: #be123c; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -40px); } }

/* ---------- Roof Chase ---------- */
.roof { position: absolute; inset: 0; touch-action: none; user-select: none; }
.roof canvas { position: absolute; inset: 0; display: block; cursor: pointer; }
.roof-word { position: absolute; top: 4%; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; align-items: baseline; gap: .7rem; padding: .45em 1.4em; border-radius: 16px; background: rgba(6, 10, 20, .75); border: 1px solid rgba(34, 211, 238, .5); box-shadow: 0 0 30px rgba(34, 211, 238, .25); }
.roof-word small { color: var(--muted); }
.roof-word b { font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: .02em; }
.roof-word.pop { animation: wordPop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes wordPop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
.roof-agent { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; will-change: transform; }
.roof-agent .agent-svg { animation: runBob .16s ease-in-out infinite alternate; }
@keyframes runBob { to { transform: translateY(-3px); } }
.running .leg-l, .running .arm-r { animation: swingA .32s ease-in-out infinite alternate; }
.running .leg-r, .running .arm-l { animation: swingB .32s ease-in-out infinite alternate; }
@keyframes swingA { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
@keyframes swingB { from { transform: rotate(28deg); } to { transform: rotate(-28deg); } }
.roof-agent.stumble .agent-svg { animation: stumble .5s; }
@keyframes stumble { 30% { transform: rotate(-18deg) translateX(-6px); filter: drop-shadow(0 0 10px #f43f5e); } }
.roof-ctrl { position: absolute; bottom: 16px; left: 16px; z-index: 4; display: flex; flex-direction: column; gap: 10px; }
.roof-ctrl button { width: 58px; height: 58px; border-radius: 16px; border: 1px solid rgba(34, 211, 238, .4); background: rgba(6, 10, 20, .7); font-size: 1.4rem; }
.roof-ctrl button:active { background: rgba(34, 211, 238, .3); }
.roof-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 4; font-size: .82rem; color: rgba(226, 232, 240, .55); }

/* ---------- Bomb Defusal ---------- */
.bomb-game { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem; padding: 50px 16px 16px; overflow: auto;
  background: radial-gradient(circle at 50% 30%, rgba(239, 68, 68, .08), transparent 60%); }
.bomb-game.danger { background: radial-gradient(circle at 50% 30%, rgba(239, 68, 68, .22), transparent 65%); animation: dangerPulse .5s infinite alternate; }
@keyframes dangerPulse { to { background-color: rgba(127, 29, 29, .15); } }
.bomb { position: relative; width: min(560px, 100%); }
.dynamite { position: absolute; top: -38px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.dynamite i { width: 40px; height: 110px; border-radius: 10px; background: linear-gradient(90deg, #7f1d1d, #dc2626 40%, #f87171 55%, #b91c1c 70%, #7f1d1d); box-shadow: inset 0 -12px 0 rgba(0, 0, 0, .25); }
.dynamite i::before { content: ''; display: block; width: 3px; height: 16px; margin: -14px auto 0; background: #a8a29e; }
.bomb-panel { position: relative; border-radius: 18px; padding: 1rem 1.2rem 1.2rem; background: linear-gradient(170deg, #475569, #1e293b 60%); border: 3px solid #64748b; box-shadow: 0 20px 50px rgba(0, 0, 0, .6), inset 0 2px 0 rgba(255, 255, 255, .15); }
.bomb-top { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: .8rem; color: #94a3b8; margin-bottom: .6rem; }
.led { width: 12px; height: 12px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 12px #ef4444; animation: blink 1s infinite; }
.led2 { animation-delay: .5s; }
.bomb-timer { font-family: var(--mono); font-size: clamp(2.8rem, 9vw, 4.4rem); text-align: center; color: #ef4444; text-shadow: 0 0 18px rgba(239, 68, 68, .8); background: #1a0505; border-radius: 10px; padding: .1em; letter-spacing: .06em; direction: ltr; box-shadow: inset 0 0 20px #000; }
.danger .bomb-timer { animation: timerPulse .5s infinite alternate; }
@keyframes timerPulse { to { color: #fca5a5; text-shadow: 0 0 30px #ef4444; } }
.bomb-screen { margin-top: .8rem; text-align: center; padding: .7rem; border-radius: 10px; background: #052e16; border: 2px solid #14532d; color: #86efac; box-shadow: inset 0 0 18px rgba(0, 0, 0, .7); }
.bomb-screen small { display: block; color: #4ade80; opacity: .8; font-size: .85rem; }
.bomb-screen b { font-size: clamp(1.6rem, 5vw, 2.3rem); text-shadow: 0 0 10px rgba(74, 222, 128, .6); }
.wires { width: min(560px, 100%); display: flex; flex-direction: column; gap: .7rem; }
.wire { display: grid; grid-template-columns: minmax(120px, 36%) 16px 1fr 16px; align-items: center; gap: 0; padding: .5rem .8rem; background: rgba(15, 23, 42, .8); border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, background .2s; }
.wire:hover { border-color: var(--c); background: rgba(30, 41, 59, .9); }
.wire-label { order: -1; font-weight: 700; font-size: 1.12rem; text-align: right; padding-inline-end: .6rem; }
.wire .term { width: 16px; height: 22px; border-radius: 4px; background: linear-gradient(#cbd5e1, #64748b); }
.wire svg { width: 100%; height: 40px; overflow: visible; }
.wire path { fill: none; stroke: var(--c); stroke-width: 9; stroke-linecap: round; vector-effect: non-scaling-stroke; transform-box: fill-box; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.wire .w1 { transform-origin: 0 50%; }
.wire .w2 { transform-origin: 100% 50%; }
.wire.cut .w1 { transform: translate(-6px, 8px) rotate(-10deg) scaleX(.92); }
.wire.cut .w2 { transform: translate(6px, 8px) rotate(10deg) scaleX(.92); }
.wire.good { border-color: var(--green); background: rgba(34, 197, 94, .12); }
.wire.bad { border-color: var(--red); background: rgba(244, 63, 94, .12); }
.wire.reveal { border-color: var(--green); box-shadow: 0 0 0 2px rgba(34, 197, 94, .5); }
.bomb-delta { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 1.6rem; font-weight: 900; opacity: 0; pointer-events: none; z-index: 5; padding: .2em .8em; border-radius: 12px; background: rgba(2, 6, 23, .85); }
.bomb-delta.show { animation: floatUp .8s ease-out forwards; }
.bomb-delta.good { color: #4ade80; }
.bomb-delta.bad { color: #fb7185; }
.bomb-end { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; animation: fadeIn .2s; }
.bomb-end .big { font-family: var(--stencil); font-size: clamp(3rem, 12vw, 6rem); }
.bomb-end p { font-size: 1.2rem; }
.bomb-end.win { background: rgba(5, 46, 22, .85); color: #4ade80; }
.bomb-end.boom { background: radial-gradient(circle, #fde047, #f97316 30%, #b91c1c 60%, #1c0606); animation: boom .9s ease-out; color: #fff; text-shadow: 0 4px 20px #000; }
@keyframes boom { 0% { background: #fff; } 15% { background: #fff; } }

/* ---------- Intel Archive ---------- */
.archive { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; padding: 20px 16px; overflow: auto; }
.doc { position: relative; width: min(760px, 100%); padding: 1.4rem 1.8rem 1.6rem; color: #1f2937; border-radius: 6px;
  background: repeating-linear-gradient(0deg, transparent 0 31px, rgba(30, 64, 175, .09) 31px 32px), linear-gradient(170deg, #f8f0dc, #eadcb8);
  box-shadow: 0 25px 60px rgba(0, 0, 0, .6), inset 0 0 60px rgba(146, 64, 14, .15); transform: rotate(-.6deg); }
.doc.in { animation: docIn .45s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes docIn { from { opacity: 0; transform: translateY(30px) rotate(-4deg); } }
.doc-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px double #b91c1c; padding-bottom: .4rem; font-family: var(--stencil); color: #b91c1c; letter-spacing: .1em; }
.doc-id { font-family: var(--mono); color: #475569; letter-spacing: 0; }
.doc-meta { font-family: var(--mono); font-size: .78rem; color: #64748b; margin: .5rem 0 1.1rem; }
.doc-sentence { font-family: 'Special Elite', 'Courier New', monospace; font-size: clamp(1.3rem, 3.4vw, 2rem); line-height: 1.7; margin: 0; text-align: left; }
.blank { display: inline-block; min-width: 150px; text-align: center; border-bottom: 3px dashed #1f2937; background: rgba(15, 23, 42, .06); border-radius: 4px; padding: 0 .3em; margin: 0 .15em; transition: background .2s, transform .2s; }
.blank.hover { background: rgba(14, 165, 233, .25); transform: scale(1.06); }
.blank.good { background: rgba(34, 197, 94, .3); border-bottom-color: #15803d; color: #14532d; }
.blank.bad { background: rgba(239, 68, 68, .25); border-bottom-color: #b91c1c; color: #7f1d1d; text-decoration: line-through; }
.blank.fixed { background: rgba(34, 197, 94, .3); border-bottom: 3px solid #15803d; color: #14532d; animation: wordPopS .4s; }
@keyframes wordPopS { from { transform: scale(.6); } }
.doc-redact { display: flex; flex-direction: column; gap: 7px; margin-top: 1rem; }
.doc-redact i { height: 10px; background: #111827; border-radius: 2px; width: 72%; }
.doc-redact i:nth-child(2) { width: 54%; }
.doc-redact i:nth-child(3) { width: 31%; }
.doc-trans { margin-top: .9rem; font-size: 1.15rem; min-height: 1.6em; opacity: 0; transition: opacity .3s; text-align: right; }
.doc-trans.show { opacity: 1; }
.doc-stamp { position: absolute; top: 46%; right: 8%; font-family: var(--stencil); font-size: 2.6rem; padding: .05em .4em; border: 5px solid currentColor; border-radius: 8px; transform: rotate(-14deg); opacity: 0; pointer-events: none; mix-blend-mode: multiply; }
.doc-stamp.show { animation: stamp .35s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.doc-stamp.good { color: #15803d; }
.doc-stamp.bad { color: #b91c1c; }
@keyframes stamp { from { opacity: 0; transform: rotate(-14deg) scale(2.4); } to { opacity: .85; transform: rotate(-14deg) scale(1); } }
.bank-title { color: var(--muted); font-size: .92rem; }
.bank { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.chip { padding: .6em 1.3em; font-size: 1.3rem; font-weight: 700; border-radius: 14px; border: 2px solid rgba(34, 211, 238, .55); background: linear-gradient(180deg, #16294a, #0f1a2e); touch-action: none; user-select: none; transition: transform .15s, opacity .2s, border-color .2s; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.chip:hover { transform: translateY(-3px); border-color: var(--cyan); }
.chip.dragging { opacity: .3; }
.chip.ghost { position: fixed; z-index: 500; pointer-events: none; transform: scale(1.1) rotate(-3deg); box-shadow: 0 18px 40px rgba(0, 0, 0, .6); border-color: var(--cyan); }
.chip.used.good { border-color: var(--green); background: rgba(34, 197, 94, .25); }
.chip.used.bad { border-color: var(--red); background: rgba(244, 63, 94, .25); }

/* ---------- War Room ---------- */
.warroom { position: absolute; inset: 0; display: flex; flex-direction: column; }
.wr-info { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .6rem 1rem; color: var(--muted); font-size: .9rem; border-bottom: 1px solid var(--line); }
.wr-budget { color: var(--amber); font-family: var(--mono); }
.wr-map { flex: 1; width: 100%; min-height: 0; }
.wr-sweep { transform-origin: 500px 300px; animation: spin 7s linear infinite; }
.wr-edges line { stroke: rgba(148, 163, 184, .3); stroke-width: 3; stroke-dasharray: 8 7; }
.wr-edges line.mine { stroke: var(--cyan); stroke-dasharray: none; filter: drop-shadow(0 0 6px var(--cyan)); }
.node .core { stroke-width: 3; }
.node .ring { fill: none; stroke-width: 2; opacity: .5; }
.node .ico { fill: #fff; font-size: 22px; text-anchor: middle; pointer-events: none; }
.node .lbl { fill: #cbd5e1; font-size: 13px; text-anchor: middle; letter-spacing: .12em; font-family: var(--mono); pointer-events: none; }
.node .pips rect { fill: #f43f5e; }
.node.mine .core { fill: #0e7490; stroke: var(--cyan); }
.node.mine .ring { stroke: var(--cyan); }
.node.enemy .core { fill: #3f0d12; stroke: #7f1d1d; }
.node.enemy { opacity: .7; }
.node.target { cursor: pointer; }
.node.target .core { fill: #7f1d1d; stroke: #f43f5e; transition: fill .2s; }
.node.target:hover .core { fill: #be123c; }
.node.target .ring { stroke: #f43f5e; transform-box: fill-box; transform-origin: center; animation: ringPulse 1.4s ease-out infinite; }
@keyframes ringPulse { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.node.hq .core { stroke-width: 4; }
.node.captured { animation: captured .6s cubic-bezier(.2, 1.6, .4, 1); transform-box: fill-box; transform-origin: center; }
@keyframes captured { from { filter: brightness(3) drop-shadow(0 0 20px var(--cyan)); } }
.wr-attack { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 23, .55); backdrop-filter: blur(2px); z-index: 10; animation: fadeIn .2s; }
.wr-card { width: min(520px, 100%); background: var(--panel-solid); border: 1px solid rgba(244, 63, 94, .5); border-radius: 18px; padding: 1.3rem; box-shadow: 0 25px 60px rgba(0, 0, 0, .6); animation: popIn .3s; }
.wr-head { display: flex; justify-content: space-between; align-items: center; color: #fda4af; }
.wr-step { display: flex; gap: 5px; }
.wr-step i { width: 22px; height: 8px; border-radius: 3px; background: rgba(244, 63, 94, .25); }
.wr-step i.on { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.wr-q { text-align: center; margin: 1.1rem 0; }
.wr-q small { display: block; color: var(--muted); margin-bottom: .3rem; }
.wr-q b { font-size: 2rem; }
.wr-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.wr-opts .opt { padding: .85em .5em; font-size: 1.08rem; }
.opt.good { background: rgba(34, 197, 94, .25); border-color: var(--green); }
.opt.bad { background: rgba(244, 63, 94, .25); border-color: var(--red); }
.wr-retreat { margin-top: .9rem; background: none; border: none; color: var(--muted); font-size: .9rem; }
.wr-end { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(2, 6, 23, .8); animation: fadeIn .3s; }
.wr-end .big { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 900; }
.wr-end.win .big { color: var(--cyan); text-shadow: 0 0 30px var(--cyan); }

/* ---------- Interrogation ---------- */
.interro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 16px; overflow: hidden; background: radial-gradient(ellipse at 50% 0%, #1f2937, #030712 70%); }
.lamp { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 600px; height: 100%; pointer-events: none; }
.lamp-head { width: 90px; height: 34px; margin: 0 auto; background: linear-gradient(#374151, #111827); clip-path: polygon(25% 0, 75% 0, 100% 100%, 0 100%); }
.lamp-head::before { content: ''; position: absolute; top: -40px; left: 50%; width: 2px; height: 40px; background: #374151; }
.cone { height: 90%; background: linear-gradient(rgba(254, 240, 138, .28), rgba(254, 240, 138, 0) 85%); clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%); animation: flicker 4s infinite; }
@keyframes flicker { 0%, 94%, 100% { opacity: 1; } 95% { opacity: .5; } 97% { opacity: .9; } }
.interro-q { position: relative; color: #fde68a; font-size: 1.1rem; letter-spacing: .05em; }
.card-area { position: relative; width: min(380px, 88vw); height: 300px; }
.icard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; border-radius: 14px; touch-action: none; user-select: none; cursor: grab; color: #1f2937;
  background: linear-gradient(170deg, #f6e7b8, #e5cf8f); box-shadow: 0 25px 60px rgba(0, 0, 0, .7); animation: cardDrop .35s cubic-bezier(.2, 1.4, .4, 1); }
.icard:active { cursor: grabbing; }
@keyframes cardDrop { from { opacity: 0; transform: translateY(-40px) scale(.9) rotate(4deg); } }
.icard::before { content: ''; position: absolute; top: -14px; right: 26px; width: 110px; height: 18px; border-radius: 8px 8px 0 0; background: #e5cf8f; }
.icard-file { position: absolute; top: 14px; left: 18px; font-family: var(--mono); font-size: .8rem; color: #92400e; }
.icard-en { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 900; }
.icard-eq { color: #92400e; font-size: .95rem; }
.icard-he { font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 700; }
.st { position: absolute; top: 40px; font-family: var(--stencil); font-size: 1.9rem; padding: 0 .4em; border: 4px solid currentColor; border-radius: 8px; opacity: 0; pointer-events: none; }
.st-true { left: 20px; color: #15803d; transform: rotate(-14deg); }
.st-false { right: 20px; color: #b91c1c; transform: rotate(14deg); }
.card-timer { width: min(380px, 88vw); height: 6px; border-radius: 9px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.card-timer i { display: block; height: 100%; width: 100%; background: var(--amber); transition: width .1s linear; }
.card-timer i.low { background: var(--red); }
.interro-btns { position: relative; display: flex; gap: 1.2rem; }
.interro-btns .btn { min-width: 140px; padding: .8em 1.2em; font-size: 1.15rem; font-weight: 700; }
.btn-false { border-color: rgba(244, 63, 94, .6); background: rgba(127, 29, 29, .4); }
.btn-true { border-color: rgba(34, 197, 94, .6); background: rgba(20, 83, 45, .45); }
.interro-btns small { opacity: .6; }

/* ---------- Safe Cracker ---------- */
.safe-game { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem; padding: 16px; overflow: auto; }
.safe-clue { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.safe-clue small { color: var(--muted); }
.safe-clue b { font-size: clamp(1.8rem, 6vw, 2.6rem); color: var(--amber); text-shadow: 0 0 20px rgba(251, 191, 36, .35); }
.safe-clue .pos { color: var(--muted); font-size: .85rem; }
.safe-clue .speak { margin-top: .3rem; font-size: .85rem; }
.safe { position: relative; width: 230px; height: 230px; perspective: 900px; flex: none; }
.safe-inside { position: absolute; inset: 10px; border-radius: 14px; background: radial-gradient(circle, #1f2937, #030712); display: grid; place-items: center; font-size: 3.4rem; box-shadow: inset 0 0 30px #000; }
.safe-door { position: absolute; inset: 0; border-radius: 18px; transform-origin: 0 50%; transition: transform 1s cubic-bezier(.5, 0, .3, 1); transform-style: preserve-3d;
  background: linear-gradient(145deg, #94a3b8, #475569 50%, #334155); border: 6px solid #1e293b; box-shadow: 0 20px 50px rgba(0, 0, 0, .6), inset 0 2px 0 rgba(255, 255, 255, .3); }
.safe.open .safe-door { transform: rotateY(-115deg); }
.bolt { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e2e8f0, #475569); }
.b1 { top: 10px; left: 10px; } .b2 { top: 10px; right: 10px; } .b3 { bottom: 10px; left: 10px; } .b4 { bottom: 10px; right: 10px; }
.dial { position: absolute; top: 50%; left: 46%; width: 118px; height: 118px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, #334155 55%, #0f172a 56%, #1e293b); box-shadow: 0 6px 16px rgba(0, 0, 0, .6); }
.dial-face { position: absolute; inset: 6px; border-radius: 50%; transition: transform .4s cubic-bezier(.3, 1.4, .5, 1);
  background: repeating-conic-gradient(#e2e8f0 0 1.5deg, transparent 1.5deg 12deg); -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%); mask: radial-gradient(circle, transparent 62%, #000 63%); }
.dial-face::after { content: ''; position: absolute; top: 0; left: 50%; width: 4px; height: 14px; margin-left: -2px; background: var(--red); }
.dial-knob { position: absolute; inset: 32%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #cbd5e1, #475569); }
.safe-handle { position: absolute; top: 50%; right: 14px; width: 14px; height: 70px; transform: translateY(-50%); border-radius: 7px; background: linear-gradient(90deg, #cbd5e1, #64748b); }
.safe-led { position: absolute; top: 14px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 10px #ef4444; }
.safe.open .safe-led { background: #22c55e; box-shadow: 0 0 10px #22c55e; }
.slots { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: center; }
.slot { width: 46px; height: 56px; display: grid; place-items: center; font-family: var(--mono); font-size: 1.8rem; border-radius: 10px; background: var(--bg2); border: 2px solid var(--line); border-bottom: 3px solid var(--cyan); cursor: pointer; transition: .2s; }
.slot.on { border-color: rgba(34, 211, 238, .6); animation: wordPopS .2s; }
.slots.good .slot { border-color: var(--green); background: rgba(34, 197, 94, .2); color: #bbf7d0; }
.slots.bad .slot { border-color: var(--red); background: rgba(244, 63, 94, .2); }
.slots.reveal .slot { border-color: var(--amber); color: var(--amber); }
.tiles { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; max-width: 640px; }
.tile { width: 52px; height: 56px; font-size: 1.6rem; font-weight: 900; font-family: var(--mono); border-radius: 12px; border: 1px solid #64748b; background: linear-gradient(180deg, #cbd5e1, #94a3b8); color: #0f172a; box-shadow: 0 4px 0 #475569; transition: transform .12s, opacity .2s; }
.tile:hover { transform: translateY(-2px); }
.tile:active { transform: translateY(2px); box-shadow: 0 2px 0 #475569; }
.tile.used { opacity: .18; pointer-events: none; transform: scale(.9); }

/* ==========================================================
   RESULTS
   ========================================================== */
.res-wrap { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 1.2rem; padding: 1.2rem; max-width: 1150px; margin: 0 auto; align-items: start; }
.res-main { text-align: center; position: relative; }
.res-game { color: var(--muted); font-family: var(--stencil); letter-spacing: .05em; }
.res-main .ring { width: 170px; height: 170px; margin: .8rem auto 0; display: block; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: rgba(148, 163, 184, .15); }
.ring .val { stroke: var(--cyan); stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 8px var(--cyan)); }
.res-main.fail .ring .val { stroke: var(--amber); filter: drop-shadow(0 0 8px var(--amber)); }
.res-score { margin-top: -118px; height: 118px; display: flex; flex-direction: column; align-items: center; }
.res-score b { font-size: 2.6rem; }
.res-score small { color: var(--muted); }
.res-main h2 { margin: 1rem 0; }
.rewards { display: flex; justify-content: center; gap: .7rem; flex-wrap: wrap; }
.rw { min-width: 100px; padding: .7rem; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; animation: popIn .5s both; }
.rw:nth-child(2) { animation-delay: .15s; } .rw:nth-child(3) { animation-delay: .3s; }
.rw span { font-size: 1.6rem; }
.rw b { font-size: 1.3rem; }
.rw small { color: var(--muted); font-size: .78rem; }
.rw.off { opacity: .5; }
.res-ch { margin-top: .8rem; padding: .6rem; border-radius: 12px; background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .35); }
.word-review, .mastery-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.word-review li, .mastery-list li { display: grid; grid-template-columns: auto auto minmax(90px, 1fr) minmax(90px, 1fr) 120px auto; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.word-review li.bad { border-color: rgba(244, 63, 94, .35); }
.word-review .mark { font-weight: 900; }
.word-review li.good .mark { color: #4ade80; }
.word-review li.bad .mark { color: #fb7185; }
.word-review b, .mastery-list b { font-size: 1.08rem; text-align: left; }
.tr { color: #cbd5e1; }
.chg { font-size: .78rem; color: var(--amber); white-space: nowrap; }
.say { background: none; border: 1px solid var(--line); border-radius: 8px; width: 32px; height: 32px; }
.say:hover { border-color: var(--cyan); }
.mini-bar, .m-bar { height: 8px; border-radius: 9px; background: rgba(148, 163, 184, .15); overflow: hidden; display: block; }
.mini-bar i, .m-bar i { display: block; height: 100%; border-radius: inherit; }
.st-new i { background: #64748b; }
.st-red i { background: var(--st-red); }
.st-yellow i { background: var(--st-yellow); }
.st-green i { background: var(--st-green); }
.st-gold i { background: linear-gradient(90deg, var(--gold1), var(--gold2)); box-shadow: 0 0 10px rgba(245, 158, 11, .6); }

.levelup { text-align: center; }
.lu-badge { width: 110px; height: 110px; margin: 0 auto .5rem; border-radius: 50%; display: grid; place-items: center; font-size: 3rem; font-weight: 900; color: #1c1917; background: radial-gradient(circle at 35% 30%, var(--gold1), var(--gold2)); box-shadow: 0 0 50px rgba(245, 158, 11, .6); animation: popIn .6s cubic-bezier(.2, 1.6, .4, 1); }
.lu-rank { margin: .5rem 0; }
.lu-unlock { margin-top: .5rem; padding: .6rem; border-radius: 12px; background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .4); }

/* ==========================================================
   SHOP
   ========================================================== */
.shop-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 1.2rem; padding: 1.2rem; max-width: 1250px; margin: 0 auto; align-items: start; }
.shop-preview { text-align: center; position: sticky; top: 80px; }
.shop-preview .replay { margin-top: .8rem; }
.qm-title { margin-bottom: .9rem; }
.qm-title .en { display: block; font-family: var(--stencil); font-size: 1.35rem; letter-spacing: .06em; color: var(--amber); }
.qm-title small { color: var(--muted); }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { padding: .5em 1em; border-radius: 99px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); }
.tab.on { color: #0b1222; background: var(--cyan); border-color: var(--cyan); font-weight: 700; }
.locked-cat { padding: .8rem; border-radius: 12px; margin-bottom: 1rem; text-align: center; background: rgba(148, 163, 184, .1); border: 1px dashed var(--line); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .9rem; }
.items.dim { opacity: .5; pointer-events: none; }
.item { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: .9rem; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); transition: transform .2s, border-color .2s; }
.item:hover { transform: translateY(-3px); border-color: rgba(34, 211, 238, .5); }
.item.equipped { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.item-prev { width: 100%; height: 130px; border-radius: 12px; background: rgba(2, 6, 23, .5); display: grid; place-items: center; overflow: hidden; }
.item-name { font-weight: 700; }
.mini-agent { height: 118px; aspect-ratio: 120/170; }
.mini-pet { width: 90px; animation: float 2.6s ease-in-out infinite; }
.mini-bg { width: 100%; height: 100%; position: relative; }
.mini-bg.bg_classified::before { font-size: 1.1rem; top: 40%; }
.mini-spawn { font-size: 3rem; }
.mini-spawn span { display: inline-block; }
.mini-spawn.spawn-fade span, .mini-spawn.spawn-teleport span, .mini-spawn.spawn-smoke span, .mini-spawn.spawn-parachute span, .mini-spawn.spawn-glitch span { animation: float 2s ease-in-out infinite; }
.mini-spawn { animation: none !important; }
.mini-office { font-size: 3.4rem; }
.btn-buy { background: linear-gradient(135deg, #b45309, #f59e0b); border-color: transparent; color: #1c1917; font-weight: 700; }
.tag { font-size: .9rem; color: var(--muted); padding: .5em; }
.tag.on { color: var(--cyan); }

/* ==========================================================
   PERSONAL FILE
   ========================================================== */
.file-wrap { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 1.2rem; padding: 1.2rem; max-width: 1300px; margin: 0 auto; align-items: start; }
.dossier { background: linear-gradient(170deg, rgba(120, 53, 15, .18), transparent 40%), var(--panel); }
.dossier-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-family: var(--stencil); letter-spacing: .08em; color: var(--amber); }
.stamp-sm { color: var(--red); border: 2px solid var(--red); padding: 0 .4em; transform: rotate(-6deg); font-size: .8rem; }
.dossier-body { display: flex; gap: 1rem; align-items: flex-start; }
.d-info { flex: 1; }
.d-info h2 { margin: 0 0 .4rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .8rem; }
.stats div { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: .5rem; text-align: center; }
.stats b { display: block; font-size: 1.3rem; }
.stats small { color: var(--muted); font-size: .78rem; }
.office-title { margin: 1.4rem 0 .6rem; }
.office { position: relative; height: 260px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(#1e293b 0 68%, #3b2a1a 68%); }
.office.locked { display: grid; place-items: center; color: var(--muted); background: repeating-linear-gradient(45deg, rgba(148, 163, 184, .06) 0 12px, transparent 12px 24px), var(--bg2); }
.office-wall { position: absolute; inset: 0 0 32% 0; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 40px, transparent 40px 80px); }
.office-window { position: absolute; top: 16px; left: 50%; width: 110px; height: 80px; transform: translateX(-50%); border: 5px solid #475569; border-radius: 6px; background: linear-gradient(#0c1445, #312e81); box-shadow: inset 0 0 20px rgba(0, 0, 0, .5); }
.office-window::after { content: '🌙'; position: absolute; top: 8px; right: 10px; font-size: 1rem; }
.office-desk { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); width: 60%; height: 40px; border-radius: 6px 6px 0 0; background: linear-gradient(#78350f, #451a03); display: flex; justify-content: space-around; align-items: flex-start; }
.office-desk span { margin-top: -26px; font-size: 1.6rem; }
.office-pet { position: absolute; bottom: 70px; left: 8%; width: 60px; animation: float 2.6s ease-in-out infinite; }
.office-empty { position: absolute; bottom: 70px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: .9rem; }
.gold-t { background: linear-gradient(90deg, var(--gold1), var(--gold2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .9rem; }
.chip-f { padding: .35em .9em; border-radius: 99px; border: 1px solid var(--line); background: var(--panel2); }
.chip-f.on { border-color: var(--cyan); background: rgba(34, 211, 238, .15); }
.mastery-list li { grid-template-columns: auto minmax(90px, 1fr) minmax(90px, 1fr) minmax(80px, 1.3fr) 3.4em 3.6em; }
.mastery-list.compact li { grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) minmax(80px, 1.3fr) 3.4em 3.6em; }
.m-pct { font-family: var(--mono); text-align: left; }
.m-att { font-family: var(--mono); color: var(--muted); font-size: .85rem; text-align: left; }
.empty { color: var(--muted); text-align: center; padding: 1rem; }

/* ==========================================================
   TEACHER
   ========================================================== */
.t-top { flex-wrap: wrap; }
.t-role { font-family: var(--font); font-size: .82rem; letter-spacing: 0; color: var(--amber); border: 1px solid rgba(251, 191, 36, .4); border-radius: 99px; padding: .15em .7em; margin-inline-start: .4rem; }
.t-class { margin-inline-start: auto; color: var(--muted); }
.code { font-family: var(--mono); color: var(--cyan); font-size: 1.1rem; letter-spacing: .1em; }
.t-tabs { display: flex; gap: .4rem; padding: .8rem 1.2rem 0; max-width: 1400px; margin: 0 auto; flex-wrap: wrap; }
.t-tabs button { padding: .6em 1.2em; border-radius: 12px 12px 0 0; border: 1px solid var(--line); border-bottom: none; background: rgba(15, 26, 46, .5); color: var(--muted); }
.t-tabs button.on { background: var(--panel); color: var(--text); font-weight: 700; }
.t-main { padding: 0 1.2rem 2rem; max-width: 1400px; margin: 0 auto; display: grid; gap: 1.2rem; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; margin-top: 1rem; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.kpi b { display: block; font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); }
.legend { display: flex; align-items: center; gap: .6rem; font-size: .82rem; color: var(--muted); margin-bottom: .8rem; flex-wrap: wrap; }
.legend .grad { width: 140px; height: 10px; border-radius: 9px; background: linear-gradient(90deg, rgb(34, 197, 94), rgb(250, 204, 21), rgb(239, 68, 68)); }
[dir="rtl"] .legend .grad { background: linear-gradient(-90deg, rgb(34, 197, 94), rgb(250, 204, 21), rgb(239, 68, 68)); }
.legend .nodata { margin-inline-start: 1rem; }
.heat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.tile-h { --h: transparent; position: relative; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); overflow: hidden; }
.tile-h::before { content: ''; position: absolute; inset: 0; background: var(--h); opacity: .28; }
.tile-h::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--h); }
.tile-h > * { position: relative; display: block; }
.tile-h b { font-size: 1.05rem; text-align: left; }
.tile-h span { color: #cbd5e1; font-size: .85rem; }
.tile-h em { font-style: normal; font-weight: 700; font-size: .9rem; margin-top: .2rem; }
.matrix-wrap, .w-table-wrap { overflow: auto; max-height: 560px; border-radius: 12px; border: 1px solid var(--line); }
.matrix { border-collapse: collapse; font-size: .82rem; }
.matrix th, .matrix td { border: 1px solid rgba(148, 163, 184, .1); padding: 0; }
.matrix thead th { position: sticky; top: 0; background: var(--panel-solid); height: 110px; vertical-align: bottom; z-index: 1; }
.matrix thead th span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); padding: .4rem .2rem; white-space: nowrap; }
.matrix tbody th { position: sticky; right: 0; background: var(--panel-solid); padding: .3rem .7rem; text-align: right; white-space: nowrap; font-weight: 500; }
.matrix td { --h: transparent; width: 36px; min-width: 36px; height: 30px; text-align: center; font-variant-numeric: tabular-nums; position: relative; color: #0b1222; font-weight: 700; background: var(--h); }
.matrix td.nd { background: rgba(148, 163, 184, .05); }
.t-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1rem; }
.switch-row { display: flex; align-items: center; gap: .8rem; line-height: 2; cursor: pointer; }
.switch { position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; }
.switch i { display: block; width: 48px; height: 26px; border-radius: 99px; background: #334155; transition: .2s; position: relative; }
.switch i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + i { background: var(--cyan); }
.switch input:checked + i::after { right: 25px; }
.switch input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }
#ar-n { width: 64px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: .2em .4em; text-align: center; }
.history { margin-top: .8rem; font-size: .9rem; }
.history summary { cursor: pointer; color: var(--muted); }
.h-row { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.status-sum { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 .5rem; }
.st-chip { padding: .3em .9em; border-radius: 99px; font-size: .9rem; border: 1px solid; }
.st-chip.unlearned { border-color: #64748b; color: #cbd5e1; }
.st-chip.active { border-color: #3b82f6; color: #93c5fd; background: rgba(59, 130, 246, .12); }
.st-chip.mastered { border-color: var(--green); color: #86efac; background: rgba(34, 197, 94, .12); }
.w-tools { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .9rem; }
.w-tools input, .w-tools select { padding: .5em .8em; font-size: .95rem; }
.w-tools input[type="search"] { min-width: 220px; }
.bulk { margin-inline-start: auto; display: flex; gap: .4rem; align-items: center; color: var(--muted); flex-wrap: wrap; }
.w-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.w-table th { position: sticky; top: 0; background: var(--panel-solid); text-align: right; padding: .6rem .7rem; color: var(--muted); font-weight: 500; z-index: 1; }
.w-table td { padding: .45rem .7rem; border-top: 1px solid var(--line); }
.w-table tr:hover td { background: rgba(34, 211, 238, .04); }
.w-table tr.click { cursor: pointer; }
.seg { display: inline-flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.seg button { border: none; background: transparent; padding: .3em .75em; font-size: .85rem; color: var(--muted); }
.seg button + button { border-right: 1px solid var(--line); }
.seg button.on[data-s="unlearned"] { background: #475569; color: #fff; }
.seg button.on[data-s="active"] { background: #2563eb; color: #fff; }
.seg button.on[data-s="mastered"] { background: #16a34a; color: #fff; }
.err-pill { --h: #64748b; display: inline-block; min-width: 3.2em; text-align: center; padding: .1em .5em; border-radius: 99px; font-weight: 700; font-size: .85rem; color: #0b1222; background: var(--h); }

/* ==========================================================
   SHOP v2 — backgrounds, frames, titles, spawns, office
   ========================================================== */
/* more card backgrounds */
.bg_sunset { background: linear-gradient(#1e1b4b, #9d174d 50%, #f97316 82%, #fbbf24); }
.bg_space { background:
  radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent),
  radial-gradient(1.5px 1.5px at 40% 70%, #fff, transparent), radial-gradient(1px 1px at 85% 60%, #fff, transparent),
  radial-gradient(1px 1px at 10% 85%, #fff, transparent), radial-gradient(2px 2px at 60% 45%, #c4b5fd, transparent),
  radial-gradient(circle at 75% 25%, rgba(168, 85, 247, .45), transparent 40%), radial-gradient(circle at 20% 70%, rgba(14, 165, 233, .35), transparent 45%), #050816; }
.bg_jungle { background: radial-gradient(ellipse at 10% 10%, #15803d 0 18%, transparent 19%), radial-gradient(ellipse at 90% 15%, #166534 0 20%, transparent 21%), radial-gradient(ellipse at 50% 0%, #22c55e 0 12%, transparent 13%), linear-gradient(#064e3b, #022c22); }
.bg_ocean { background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, .25) 0 3px, transparent 4px), radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .2) 0 5px, transparent 6px), radial-gradient(circle at 45% 40%, rgba(255, 255, 255, .2) 0 2px, transparent 3px), linear-gradient(#0ea5e9, #0369a1 45%, #082f49); }
.bg_desert { background: radial-gradient(circle at 75% 22%, #fef3c7 0 9%, transparent 10%), linear-gradient(#fcd34d, #f59e0b 55%, #d97706 56%, #92400e); }
.bg_lava { background: radial-gradient(circle at 30% 100%, #f97316, transparent 45%), radial-gradient(circle at 75% 100%, #ef4444, transparent 40%), linear-gradient(#1c0a0a, #450a0a); animation: lavaGlow 3s ease-in-out infinite alternate; }
@keyframes lavaGlow { to { filter: brightness(1.25); } }
.bg_aurora { background: radial-gradient(ellipse at 30% 20%, rgba(34, 197, 94, .6), transparent 50%), radial-gradient(ellipse at 70% 30%, rgba(168, 85, 247, .55), transparent 50%), linear-gradient(#020617, #0f172a); background-size: 200% 200%; animation: aurora 8s ease-in-out infinite alternate; }
@keyframes aurora { to { background-position: 100% 50%; } }
.bg_blueprint { background: linear-gradient(rgba(255, 255, 255, .15) 1px, transparent 1px) 0 0 / 20px 20px, linear-gradient(90deg, rgba(255, 255, 255, .15) 1px, transparent 1px) 0 0 / 20px 20px, #1e3a8a; }
.bg_camo { background: radial-gradient(ellipse at 20% 30%, #3f6212 0 20%, transparent 21%), radial-gradient(ellipse at 70% 20%, #365314 0 18%, transparent 19%), radial-gradient(ellipse at 40% 75%, #1a2e05 0 22%, transparent 23%), radial-gradient(ellipse at 85% 70%, #4d7c0f 0 16%, transparent 17%), #57534e; }
.bg_rainbow { background: linear-gradient(135deg, #ef4444, #f97316, #facc15, #22c55e, #3b82f6, #a855f7, #ef4444); background-size: 300% 300%; animation: aurora 6s linear infinite alternate; }
.bg_city { background: linear-gradient(90deg, #0f172a 0 12%, transparent 12% 15%, #111827 15% 30%, transparent 30% 33%, #0f172a 33% 52%, transparent 52% 55%, #111827 55% 72%, transparent 72% 75%, #0f172a 75% 100%) bottom / 100% 42% no-repeat,
  linear-gradient(90deg, transparent 20%, #1e293b 20% 26%, transparent 26% 60%, #1e293b 60% 66%, transparent 66%) bottom / 100% 62% no-repeat,
  linear-gradient(#1e1b4b, #6d28d9); }

/* frames */
.frame_circuit { border: 3px dashed #22d3ee; box-shadow: inset 0 0 18px rgba(34, 211, 238, .4); }
.frame_neon { border: 3px solid #f0abfc; box-shadow: 0 0 18px #e879f9, inset 0 0 18px rgba(232, 121, 249, .5); }
.frame_ice { border: 4px solid #bae6fd; box-shadow: inset 0 0 26px rgba(255, 255, 255, .7), 0 0 14px rgba(125, 211, 252, .6); }
.frame_fire { border: 3px solid #f97316; animation: fireFrame .6s ease-in-out infinite alternate; }
@keyframes fireFrame { from { box-shadow: 0 0 12px #f97316, inset 0 -10px 24px rgba(239, 68, 68, .6); } to { box-shadow: 0 0 24px #ef4444, inset 0 -16px 30px rgba(251, 191, 36, .6); } }
.frame_rainbow { outline: 4px solid #ef4444; outline-offset: -4px; animation: rainbowOutline 3s linear infinite; }
@keyframes rainbowOutline { 0% { outline-color: #ef4444; } 20% { outline-color: #f97316; } 40% { outline-color: #facc15; } 60% { outline-color: #22c55e; } 80% { outline-color: #3b82f6; } 100% { outline-color: #a855f7; } }
.frame_gold { border: 5px solid #f59e0b; box-shadow: 0 0 0 2px #fde68a, 0 0 22px rgba(245, 158, 11, .6), inset 0 0 22px rgba(253, 230, 138, .4); }
.frame_vip { border: 6px double #fde68a; box-shadow: 0 0 30px rgba(253, 230, 138, .7); }
.frame_vip::before { content: 'VIP'; position: absolute; top: 8px; left: 10px; z-index: 4; font-family: var(--stencil); color: #1c1917; background: linear-gradient(90deg, #fde68a, #f59e0b); padding: 0 .5em; border-radius: 6px; font-size: .8rem; }

/* titles */
.agent-title { margin: -.1rem 0 .5rem; font-size: .9rem; color: var(--amber); }
.agent-title .en { font-family: var(--stencil); letter-spacing: .04em; }
.preview-name { margin-top: .8rem; font-weight: 700; font-size: 1.2rem; }

/* accessories */
.acc .halo { animation: haloBob 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes haloBob { 50% { transform: translateY(-3px); } }

/* new pets */
.flap { transform-box: fill-box; transform-origin: 50% 100%; animation: flap .3s ease-in-out infinite alternate; }
@keyframes flap { to { transform: scaleY(.55); } }
.wave { transform-box: fill-box; transform-origin: 50% 0; animation: waveJ 1.2s ease-in-out infinite alternate; }
@keyframes waveJ { to { transform: skewX(12deg) scaleY(.9); } }
.spin-slow { transform-box: fill-box; transform-origin: center; animation: spinSlow 6s linear infinite; }
@keyframes spinSlow { 0% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } 100% { transform: rotate(-12deg); } }
.beam-ufo { animation: blink 1.6s infinite; }
.legs-spider { transform-box: fill-box; transform-origin: center; animation: crawl .25s ease-in-out infinite alternate; }
@keyframes crawl { to { transform: scaleX(1.06) translateY(1px); } }

/* new spawns */
.spawn-spin { animation: spSpin .9s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes spSpin { from { transform: rotateY(720deg) scale(.3); opacity: 0; } }
.spawn-elevator { animation: spLift 1.1s cubic-bezier(.3, .8, .4, 1) both; }
@keyframes spLift { from { transform: translateY(110%); } }
.lift { position: absolute; z-index: 3; bottom: 0; left: 50%; width: 130px; height: 10px; margin-left: -65px; border-radius: 4px; background: linear-gradient(#94a3b8, #475569); box-shadow: 0 -6px 18px rgba(34, 211, 238, .5); animation: liftIn 1.1s cubic-bezier(.3, .8, .4, 1) both; }
@keyframes liftIn { from { transform: translateY(-260px); } }
.spawn-portal { animation: spPortal 1.1s ease-out both; }
@keyframes spPortal { 0%, 30% { transform: scale(0) rotate(-90deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.portal { position: absolute; z-index: 1; left: 50%; bottom: 22%; width: 150px; height: 150px; margin-left: -75px; border-radius: 50%; background: conic-gradient(#a855f7, #22d3ee, #a855f7, #ec4899, #a855f7); -webkit-mask: radial-gradient(circle, transparent 45%, #000 47%); mask: radial-gradient(circle, transparent 45%, #000 47%); animation: portal 1.6s ease-out forwards; }
@keyframes portal { 0% { transform: scale(0) rotate(0); opacity: 1; } 40% { transform: scale(1) rotate(180deg); opacity: 1; } 100% { transform: scale(1.3) rotate(540deg); opacity: 0; } }
.spawn-lightning { animation: spBolt .9s steps(1) both; }
@keyframes spBolt { 0% { opacity: 0; } 25% { opacity: 1; filter: brightness(3); } 35% { opacity: .2; } 45% { opacity: 1; filter: brightness(2); } 100% { opacity: 1; filter: none; } }
.bolt-flash { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .9), rgba(250, 204, 21, .4) 30%, transparent 60%); animation: boltFlash .8s ease-out forwards; }
.bolt-flash::after { content: '⚡'; position: absolute; top: 4%; left: 50%; transform: translateX(-50%); font-size: 4rem; }
@keyframes boltFlash { 0% { opacity: 0; } 15% { opacity: 1; } 30% { opacity: .2; } 45% { opacity: 1; } 100% { opacity: 0; } }
.spawn-hologram { animation: spHolo 1.6s ease-out both; }
@keyframes spHolo { 0% { opacity: 0; filter: hue-rotate(160deg) brightness(2); } 40% { opacity: .5; } 60% { opacity: .3; } 100% { opacity: 1; filter: none; } }
.holo-scan { position: absolute; z-index: 3; left: 0; right: 0; height: 6px; background: rgba(34, 211, 238, .8); box-shadow: 0 0 20px #22d3ee; animation: holoScan 1.4s ease-in-out forwards; }
@keyframes holoScan { 0% { top: 100%; opacity: 1; } 90% { top: 5%; opacity: 1; } 100% { top: 5%; opacity: 0; } }

/* shop layout v2 */
.tab small { opacity: .7; font-size: .75em; }
.shop-hint { margin: -.3rem 0 .8rem; }
.preview-slot { min-height: 270px; }
.try-note { min-height: 1.4em; margin-top: .4rem; color: var(--amber); font-size: .9rem; }
.collection { margin-top: .8rem; color: var(--muted); font-size: .9rem; }
.item { position: relative; cursor: pointer; }
.item.trying { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset, 0 0 20px rgba(251, 191, 36, .25); }
.item.premium .item-prev { background: radial-gradient(circle at 50% 30%, rgba(125, 211, 252, .18), rgba(2, 6, 23, .5)); }
.own-badge { position: absolute; top: 8px; left: 8px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #052e16; font-size: .75rem; font-weight: 900; }
.btn-buy.poor { filter: grayscale(.7); opacity: .65; }
.mini-frame { width: 78%; height: 100px; border-radius: 12px; }
.mini-title { text-align: center; padding: 0 .4rem; }
.mini-title .en { display: block; font-family: var(--stencil); color: var(--amber); font-size: 1.05rem; letter-spacing: .03em; }
.mini-title small { color: var(--muted); }
.mini-spawn span { display: inline-block; animation: float 2s ease-in-out infinite; }
.mini-agent .agent-svg { overflow: visible; }

/* office v2 */
.office { height: 260px; }
.office-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 32%; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .15) 0 2px, transparent 2px 60px); }
.office .decor { position: absolute; transform: translate(-50%, -50%); line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); animation: popIn .4s; z-index: 2; }
.office .decor.ghost-decor { opacity: .6; animation: ghostPulse 1s ease-in-out infinite alternate; }
@keyframes ghostPulse { to { opacity: .95; transform: translate(-50%, -55%); } }
.shop-preview .office { margin-top: .4rem; }

/* teacher v2 */
.t-class { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.class-switch, .name-row input { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: .35em .7em; font-size: .95rem; }
.name-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; color: var(--muted); }
.name-row input { flex: 1; max-width: 260px; }
.w-tools.inline { margin: 0; }
.row-acts { white-space: nowrap; }
.sm-icon { padding: .2em .45em; font-size: .9rem; margin-inline-start: .2rem; }
.bulk-text { width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: .8em; font: inherit; color: var(--text); resize: vertical; }

/* ==========================================================
   WORLD — walkable rooms
   ========================================================== */
.world-screen { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.world-host { flex: 1; min-height: 0; position: relative; }
.world { position: absolute; inset: 0; display: flex; flex-direction: column; }
.world-viewport { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #020617; }
.world-stage { position: absolute; top: 50%; left: 50%; width: 1000px; height: 600px; transform-origin: 50% 50%; direction: ltr; overflow: hidden; border-radius: 14px; box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .6); touch-action: manipulation; user-select: none; transition: opacity .22s; cursor: pointer; }
.world-stage.leaving { opacity: 0; }
.w-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* hotspots */
.hs { position: absolute; padding: 0; margin: 0; border: none; background: none; cursor: pointer; transition: filter .2s, transform .2s; z-index: 5; }
.hs .hs-art { width: 100%; height: 100%; display: block; overflow: visible; }
.hs:hover, .hs:focus-visible { filter: drop-shadow(0 0 12px rgba(34, 211, 238, .8)); outline: none; }
.hs.locked { filter: saturate(.3) brightness(.75); }
.hs.locked:hover { filter: saturate(.5) brightness(.9) drop-shadow(0 0 8px rgba(239, 68, 68, .6)); }
.hs-label { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; direction: rtl; pointer-events: none;
  background: rgba(2, 6, 23, .82); border: 1px solid rgba(34, 211, 238, .45); border-radius: 10px; padding: .15em .7em; font-size: 15px; color: #e2e8f0; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.hs-label b { font-weight: 700; }
.hs-label small { color: var(--muted); font-size: 12px; }
.hs-game .hs-label b .en { font-family: var(--stencil); font-weight: 400; letter-spacing: .03em; }
.hs.locked .hs-label { border-color: rgba(239, 68, 68, .45); }
.hs-door:hover .door-led { animation: blink .4s infinite; }
.scan { animation: scanY 2.4s linear infinite; }
@keyframes scanY { from { transform: translateY(0); } to { transform: translateY(78px); } }

.exit-pad { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; color: #a5f3fc; font-weight: 700; font-size: 15px;
  background: radial-gradient(ellipse, rgba(34, 211, 238, .35), rgba(34, 211, 238, .05) 70%); border: 2px solid rgba(34, 211, 238, .6); animation: pulse 2s infinite; }
.board { width: 100%; height: 100%; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #1c1917; direction: rtl;
  background: radial-gradient(circle at 30% 30%, #c08a4a, #8b5a2b); border: 6px solid #5b3a1e; box-shadow: inset 0 0 12px rgba(0, 0, 0, .4); }
.board b { font-size: 15px; }
.board span { font-size: 13px; background: #fef3c7; padding: 0 .5em; border-radius: 4px; }
.board i { display: block; width: 80%; height: 8px; background: #fefce8; border-radius: 2px; transform: rotate(-2deg); }
.board i:nth-child(odd) { transform: rotate(2deg); width: 60%; }
.npc-robo { width: 100%; height: 100%; animation: float 2.6s ease-in-out infinite; }
.npc-robo .pet-svg { width: 100%; height: 100%; }
.counter { position: relative; width: 100%; height: 100%; }
.clerk { position: absolute; left: 50%; bottom: 52px; width: 90px; height: 128px; transform: translateX(-50%); }
.clerk .agent-svg { width: 100%; height: 100%; }
.counter-top { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; border-radius: 10px 10px 4px 4px; display: flex; align-items: center; justify-content: space-around; direction: rtl;
  background: linear-gradient(#92400e, #5b3a1e); border-top: 6px solid #b45309; color: #fef3c7; font-size: 15px; box-shadow: 0 10px 20px rgba(0, 0, 0, .4); }
.counter-top span { font-size: 24px; }
.desk { width: 100%; height: 100%; display: flex; align-items: flex-start; justify-content: space-around; padding-top: 6px; font-size: 34px;
  background: linear-gradient(#7c4a1e, #451a03); border-radius: 8px 8px 2px 2px; border-top: 8px solid #92400e; box-shadow: 0 14px 24px rgba(0, 0, 0, .45); }
.desk span { margin-top: -30px; }
.w-hint { position: absolute; transform: translateX(-50%); color: var(--muted); font-size: 15px; direction: rtl; pointer-events: none; }

/* agent + pet */
.w-agent { position: absolute; left: 0; top: 0; width: 110px; height: 150px; transform-origin: 55px 150px; pointer-events: none; will-change: transform; }
.w-agent-inner, .w-flip { width: 100%; height: 100%; }
.w-flip .agent-svg { width: 100%; height: 100%; }
.w-agent.running .agent-svg { animation: runBob .16s ease-in-out infinite alternate; }
.w-name { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); white-space: nowrap; direction: rtl; font-size: 14px; font-weight: 700; padding: .05em .6em; border-radius: 8px; background: rgba(2, 6, 23, .7); color: #a5f3fc; }
.w-pet { position: absolute; left: 0; top: 0; width: 60px; pointer-events: none; transform-origin: 30px 60px; will-change: transform; }
.w-pet .pet-svg { width: 100%; animation: float 2.4s ease-in-out infinite; }
.w-click-fx { position: absolute; width: 46px; height: 18px; margin: -9px 0 0 -23px; border-radius: 50%; border: 3px solid var(--cyan); opacity: 0; pointer-events: none; z-index: 1; }
.w-click-fx.on { animation: clickFx .5s ease-out; }
@keyframes clickFx { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: scale(1.6); } }
.bubble { position: absolute; z-index: 900; max-width: 300px; transform: translate(-10%, -100%); direction: rtl; padding: .6em .9em; border-radius: 14px; background: #f8fafc; color: #0f172a; font-size: 15px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: popIn .3s; pointer-events: none; }
.bubble::after { content: ''; position: absolute; bottom: -10px; left: 28px; border: 10px solid transparent; border-top-color: #f8fafc; border-bottom: 0; }

/* ambient room animation */
.fan { transform-box: fill-box; transform-origin: center; animation: spin 1.6s linear infinite; }
.laser { animation: laserY 4s ease-in-out infinite alternate; }
@keyframes laserY { to { transform: translateY(170px); } }
.radar-arm { transform-origin: 905px 70px; animation: spin 2.5s linear infinite; }
.clouds { animation: drift 30s linear infinite alternate; }
@keyframes drift { to { transform: translateX(160px); } }

/* HUD + room navigation */
.world-hud { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; pointer-events: none; z-index: 10; }
.w-chip { pointer-events: auto; display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; padding: .45em .9em; border-radius: 14px; border: 1px solid var(--line); background: rgba(6, 10, 20, .82); backdrop-filter: blur(6px); color: var(--text); text-align: right; }
.w-chip:hover { border-color: var(--cyan); }
.w-me span { font-size: .8rem; color: var(--muted); }
.w-me .bar { width: 140px; height: 6px; display: block; }
.w-ch { flex-direction: row; align-items: center; gap: .4rem; }
.w-ch b { color: #7dd3fc; }
.w-room-name { align-self: center; font-weight: 700; padding: .3em 1em; border-radius: 99px; background: rgba(6, 10, 20, .7); border: 1px solid var(--line); }
.world-nav { display: flex; justify-content: center; gap: .4rem; padding: .5rem; background: rgba(6, 10, 20, .92); border-top: 1px solid var(--line); flex-wrap: wrap; }
.world-nav button { display: flex; align-items: center; gap: .35rem; padding: .5em 1em; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); font-weight: 500; }
.world-nav button span { font-size: 1.15rem; }
.world-nav button.on { color: #0b1222; background: var(--cyan); border-color: var(--cyan); font-weight: 700; }
.profile { text-align: center; }
@media (max-width: 640px) {
  .world-hud { top: 6px; left: 6px; right: 6px; }
  .w-me .bar { width: 90px; }
  .world-nav button { padding: .45em .7em; font-size: .85rem; }
}

/* ---------- world v2: animation polish + quick chat ---------- */
.w-iris { position: absolute; inset: 0; z-index: 50; pointer-events: none; display: none; }
.w-fx { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }

/* doors that open */
.dp-l, .dp-r { transition: transform .38s cubic-bezier(.5, 0, .3, 1); }
.hs.opening .dp-l { transform: translateX(-42px); }
.hs.opening .dp-r { transform: translateX(42px); }
.door-light { opacity: .15; transition: opacity .35s; }
.hs.opening .door-light { opacity: 1; }
.hs.opening { filter: drop-shadow(0 0 22px rgba(254, 249, 195, .7)); }
.hs-door:hover .elev-arrow { animation: blink .5s infinite; }

/* stations */
.hs-game:not(.locked):hover { transform: translateY(-4px); }
.hs.activating { animation: activate .45s ease-out; }
@keyframes activate { 0% { filter: brightness(1); } 40% { filter: brightness(2.2) drop-shadow(0 0 30px #22d3ee); transform: scale(1.06); } 100% { filter: brightness(1.4); } }

/* walking: dust, lean, landing bounce, idle look-around */
.dust { position: absolute; width: 16px; height: 8px; margin: -4px 0 0 -8px; border-radius: 50%; background: rgba(203, 213, 225, .45); pointer-events: none; animation: dust .65s ease-out forwards; }
@keyframes dust { from { opacity: .8; transform: scale(.4); } to { opacity: 0; transform: translateY(-10px) scale(1.8); } }
.w-flip { transition: transform .12s; transform-origin: 50% 100%; }
.w-agent-inner { transform-origin: 50% 100%; }
.w-agent-inner.land { animation: land .28s ease-out; }
@keyframes land { 0% { transform: scale(1.06, .9); } 60% { transform: scale(.97, 1.04); } 100% { transform: none; } }
.w-agent:not(.running) .agent-head { transform-box: fill-box; transform-origin: 50% 90%; animation: lookAround 8s ease-in-out infinite; }
@keyframes lookAround { 0%, 70%, 100% { transform: none; } 76% { transform: rotate(-7deg); } 84% { transform: rotate(6deg); } 90% { transform: rotate(0); } }
.w-agent.running .arm-l, .w-agent.running .arm-r { animation-duration: .3s; }
.w-pet { transition: none; }

/* ambient effects */
.mote { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: rgba(165, 243, 252, .7); box-shadow: 0 0 6px rgba(165, 243, 252, .9); animation: mote 9s linear infinite; }
@keyframes mote { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .9; } 85% { opacity: .6; } 100% { transform: translate(40px, -140px); opacity: 0; } }
.twinkle { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; animation: twinkle 2.6s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .15; transform: scale(.5); } }
.shooting { position: absolute; top: 40px; left: 760px; width: 120px; height: 2px; background: linear-gradient(90deg, #fff, transparent); transform: rotate(-20deg); opacity: 0; animation: shoot 9s linear infinite; }
@keyframes shoot { 0%, 88% { opacity: 0; transform: translate(0, 0) rotate(-20deg); } 90% { opacity: 1; } 100% { opacity: 0; transform: translate(-420px, 150px) rotate(-20deg); } }
.lightcone { position: absolute; top: 0; width: 140px; height: 470px; background: linear-gradient(rgba(253, 230, 138, .22), transparent 80%); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); animation: flicker 6s infinite; }
.spark { position: absolute; top: 140px; width: 3px; height: 3px; border-radius: 50%; background: #fca5a5; box-shadow: 0 0 6px #ef4444; animation: spark 4s linear infinite; }
@keyframes spark { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(20px, 230px); opacity: 0; } }
.lamp-glow { position: absolute; left: 380px; top: 280px; width: 240px; height: 200px; border-radius: 50%; background: radial-gradient(rgba(253, 224, 71, .22), transparent 65%); animation: flicker 5s infinite; }

/* ROBO talks */
.hs-npc.talk .npc-robo { animation: roboTalk .5s ease-in-out 3, float 2.6s ease-in-out infinite .5s; }
@keyframes roboTalk { 50% { transform: translateY(-8px) rotate(-6deg); } }
.bubble small { display: block; color: #475569; font-size: 13px; margin-top: 2px; }
.bubble b[dir="ltr"] { display: block; text-align: left; }

/* speech bubble above the agent */
.say-bubble { position: absolute; bottom: calc(100% + 34px); left: 50%; transform: translateX(-50%); z-index: 5; white-space: nowrap; direction: rtl; pointer-events: none;
  background: #fff; color: #0f172a; border-radius: 16px; padding: .35em .9em; font-size: 17px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); animation: sayIn .3s cubic-bezier(.2, 1.6, .4, 1); transition: opacity .4s, transform .4s; }
.say-bubble::after { content: ''; position: absolute; bottom: -9px; left: 50%; margin-left: -9px; border: 9px solid transparent; border-top-color: #fff; border-bottom: 0; }
.say-bubble b { display: block; font-size: 18px; }
.say-bubble small { display: block; color: #64748b; font-size: 12px; }
.say-bubble.emo { padding: .1em .45em; background: rgba(255, 255, 255, .95); }
.say-emoji { font-size: 40px; line-height: 1.2; display: inline-block; animation: emoPop .6s ease-out; }
.say-bubble.out { opacity: 0; transform: translate(-50%, -10px); }
@keyframes sayIn { from { opacity: 0; transform: translate(-50%, 10px) scale(.6); } }
@keyframes emoPop { 40% { transform: scale(1.3) rotate(-8deg); } }

/* quick-chat panel */
.w-hud-left { display: flex; gap: .4rem; align-items: flex-start; }
.w-say { flex-direction: row; align-items: center; font-weight: 700; border-color: rgba(34, 211, 238, .5); }
.w-chat { position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(640px, calc(100% - 20px)); max-height: 46%; display: flex; flex-direction: column;
  background: rgba(6, 10, 20, .95); border: 1px solid rgba(34, 211, 238, .4); border-radius: 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); animation: popIn .25s; overflow: hidden; }
.w-chat-tabs { display: flex; gap: .3rem; padding: .5rem; border-bottom: 1px solid var(--line); }
.w-chat-tabs button { padding: .35em .9em; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); }
.w-chat-tabs button.on { color: #0b1222; background: var(--cyan); border-color: var(--cyan); font-weight: 700; }
.w-chat-x { margin-inline-start: auto; }
.w-chat-body { overflow: auto; padding: .6rem; }
.w-chat-body.emoji { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: .3rem; }
.w-emo { font-size: 26px; padding: .15em; border-radius: 10px; border: 1px solid transparent; background: none; transition: transform .12s, background .12s; }
.w-emo:hover { transform: scale(1.2); background: var(--panel2); }
.w-chat-body.phrase { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .4rem; }
.w-phr { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .45em .7em; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); text-align: left; }
.w-phr:hover { border-color: var(--cyan); }
.w-phr b { font-size: .98rem; }
.w-phr small { color: var(--muted); font-size: .78rem; align-self: flex-end; }

@media (max-height: 520px) {
  .world-screen .topnav { display: none; }
  .world-screen .topbar { padding: .3rem .8rem; }
  .world-nav { padding: .3rem; }
  .world-nav button { padding: .3em .7em; }
}

@media (orientation: portrait) and (max-width: 640px) {
  .world-viewport::after { content: '🔄 סובבו את הטלפון לרוחב לחוויה טובה יותר'; position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: .85rem; pointer-events: none; }
}

/* admin + auth v2 */
.t-role.adm { color: #f0abfc; border-color: rgba(240, 171, 252, .5); }
.admin .kpis { margin-top: 1rem; }
.pill { display: inline-block; padding: .1em .7em; border-radius: 99px; font-size: .85rem; font-weight: 700; }
.pill.good { background: rgba(34, 197, 94, .18); color: #86efac; }
.pill.bad { background: rgba(244, 63, 94, .18); color: #fda4af; }
.pill.warn { background: rgba(251, 191, 36, .18); color: #fde68a; }
.inline-label { display: flex; align-items: center; gap: .4rem; color: var(--muted); }
.inline-label input { width: auto; }
.inline-label input[type="number"] { width: 80px; }
.link-btn { background: none; border: none; color: var(--cyan); text-decoration: underline; padding: 0; }
.big-code { font-size: 1.4rem; letter-spacing: .12em; }
.code-in { text-transform: uppercase; letter-spacing: .12em; text-align: center; font-family: var(--mono); }
.panel.narrow { max-width: 460px; }
#l-note { min-width: 260px; }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1000px) {
  .hub-grid { grid-template-columns: 1fr; grid-template-areas: "agent" "missions" "weekly"; }
  .agent-card { position: static; }
  .mission-grid { grid-template-columns: repeat(2, 1fr); }
  .res-wrap, .shop-wrap, .file-wrap, .t-two { grid-template-columns: 1fr; }
  .shop-preview { position: static; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: .5rem .8rem; }
  .logo { font-size: .85rem; }
  .topnav { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .topnav button { padding: .4em .6em; font-size: .9rem; }
  .wallet { margin-inline-start: auto; }
  .hub-grid, .res-wrap, .shop-wrap, .file-wrap { padding: .8rem; }
  .mission-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .mission { padding: .9rem; }
  .m-icon { font-size: 1.8rem; }
  .role-cards { grid-template-columns: 1fr; }
  .hud-title small, .hud-title b { display: none; }
  .game-hud { gap: .5rem; padding: .5rem; }
  .word-review li, .mastery-list li { grid-template-columns: auto minmax(70px, 1fr) minmax(70px, 1fr) 3em; }
  .word-review .mini-bar, .word-review .chg, .word-review .mark { display: none; }
  .mastery-list .m-bar { display: none; }
  .mastery-list.compact li { grid-template-columns: 1fr 1fr 3em 3.4em; }
  .wr-opts { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .dossier-body { flex-direction: column; align-items: center; }
  .wire { grid-template-columns: minmax(96px, 40%) 10px 1fr 10px; }
  .tile { width: 44px; height: 50px; font-size: 1.35rem; }
  .slot { width: 38px; height: 48px; font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
