/* VocabTower scene — all selectors scoped under .vocab-tower-scene
 * so this stylesheet is safe to include in any host page. The HTML
 * skeleton (skyCanvas, gameCanvas, ui, hud, …) lives inside a
 * <section class="vocab-tower-scene"> wrapper. */

.vocab-tower-scene *,
.vocab-tower-scene *::before,
.vocab-tower-scene *::after { box-sizing: border-box; margin: 0; padding: 0; }

.vocab-tower-scene {
  --p: #6651a1;
  --p6: #533f88;
  --p7: #3f2f6e;
  --green: #16a34a;
  --red: #c93e3e;
}

/* Full-bleed background only when scene is active (visible). */
.vocab-tower-scene.is-active {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Nunito Sans', sans-serif;
  background: #6651a1;
}

/* Sky canvas — fixed background, starts below topbar */
.vocab-tower-scene #skyCanvas { position: fixed; top: var(--bar-h, 56px); left: 0; right: 0; bottom: 0; z-index: 0; }

/* Physics/game canvas — fixed on top of sky */
.vocab-tower-scene #gameCanvas { position: fixed; top: var(--bar-h, 56px); left: 0; right: 0; bottom: 0; z-index: 1; pointer-events: none; }

/* All HTML UI sits above both canvases */
.vocab-tower-scene #ui { position: fixed; top: var(--bar-h, 56px); left: 0; right: 0; bottom: 0; z-index: 10; pointer-events: none; }
.vocab-tower-scene #ui * { pointer-events: auto; }

/* ── SWING GUIDE LINE ──
 * Kept in the DOM for debugging / future tuning; hidden during play. */
.vocab-tower-scene #guideLine {
  position: fixed; left: 50%; top: var(--bar-h, 56px); bottom: 0; width: 2px;
  background: rgba(255, 255, 255, .10); transform: translateX(-50%);
  pointer-events: none; z-index: 2;
  visibility: hidden;
}

/* ── HUD (height + streak stats — lives inside the powers pill) ── */
.vocab-tower-scene #hud { display: inline-flex; align-items: center; gap: 8px; }
.vocab-tower-scene .hv { color: #1a1a2e; }
.vocab-tower-scene .ht { color: var(--p); }
.vocab-tower-scene .hdiv { width: 1.5px; height: 22px; background: #d4cce9; }
.vocab-tower-scene .hlbl { font-size: 10px; font-weight: 700; color: #a1a1aa; text-transform: uppercase; letter-spacing: 1px; }
.vocab-tower-scene .hnum { font-size: 19px; font-weight: 900; color: var(--p); }
.vocab-tower-scene .hfire { font-size: 14px; }
.vocab-tower-scene .hstrk { font-size: 19px; font-weight: 900; color: #d97706; }

/* ── POWERS + STATS (top-left menu, below the page topbar so it never
 * overlaps it; overlays everything in the scene, incl. #startScreen) ── */
.vocab-tower-scene #powersWrap { position: fixed; top: calc(var(--bar-h, 56px) + 18px); left: 18px; z-index: 150; pointer-events: auto; }
/* Poof notification */
.vocab-tower-scene .power-poof {
  position: absolute; top: calc(100% + 8px); left: 0;
  display: flex; align-items: center; gap: 8px;
  pointer-events: none; z-index: 200;
  opacity: 0;
  animation: poof-in .15s ease-out forwards;
}
/* Individual pill inside the poof row */
.vocab-tower-scene .power-poof .ppoof-pill {
  display: flex; align-items: center; gap: 6px;
  background: #fff; border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px; font-weight: 800;
  font-family: 'Nunito Sans', sans-serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .13);
  white-space: nowrap;
}
.vocab-tower-scene .power-poof .ppoof-pill.ppoof-streak { color: #14532d; border: 2px solid #bbf7d0; }
.vocab-tower-scene .power-poof .ppoof-pill.ppoof-reward { color: var(--p700, #3f2f6e); border: 2px solid #d4cce9; }
.vocab-tower-scene .power-poof .ppoof-pill.ppoof-used   { color: #52525b; border: 2px solid #e4e4e7; }
.vocab-tower-scene .power-poof .ppoof-pill img {
  width: 18px; height: 18px; display: block;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
@keyframes poof-in {
  0%   { opacity: 0; transform: translateY(-6px) scale(.88); }
  60%  { opacity: 1; transform: translateY(0) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.vocab-tower-scene .power-poof.poof-out { animation: poof-out .3s ease-in forwards; }
@keyframes poof-out {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(8px) scale(.88); }
}
.vocab-tower-scene .ppill {
  background: rgba(255, 255, 255, .93); backdrop-filter: blur(10px);
  border: 2.5px solid rgba(255, 255, 255, .85); border-radius: 999px;
  padding: 8px 16px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .14);
}
.vocab-tower-scene .plbl { font-size: 10px; font-weight: 700; color: #a1a1aa; text-transform: uppercase; letter-spacing: 1px; margin-right: 2px; }
.vocab-tower-scene .pitem {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--p50, #f5f2fb); border: 2px solid var(--border2, #d4cce9);
  font-size: 18px; cursor: pointer; position: relative;
  transition: transform .12s, border-color .12s, background .12s;
  user-select: none; -webkit-user-select: none;
}
.vocab-tower-scene .pitem img {
  width: 22px; height: 22px; display: block;
  pointer-events: none; user-select: none; -webkit-user-select: none;
  -webkit-user-drag: none;
}
.vocab-tower-scene .pitem:hover { transform: scale(1.12); border-color: var(--p, #6651a1); background: var(--p200, #ebe7f5); }
.vocab-tower-scene .pitem:active { transform: scale(.95); }
.vocab-tower-scene .pitem.used {
  opacity: .32; pointer-events: none; filter: grayscale(1);
  background: none !important; outline: none !important; box-shadow: none !important;
}
.vocab-tower-scene .pitem-count {
  position: absolute; top: -5px; right: -5px;
  background: var(--p, #6651a1); color: #fff;
  font-size: 9px; font-weight: 800; line-height: 1;
  padding: 2px 4px; border-radius: 999px;
  min-width: 15px; text-align: center;
  display: none; pointer-events: none;
}
.vocab-tower-scene .pitem.has-count .pitem-count { display: block; }
/* Custom tooltip */
.vocab-tower-scene .pitem .ptip {
  display: none; position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); white-space: nowrap;
  background: #1a1a1a; color: #fff;
  font-size: 12px; font-weight: 600; font-family: 'Nunito Sans', sans-serif;
  padding: 4px 9px; border-radius: 6px;
  pointer-events: none; z-index: 100;
}
.vocab-tower-scene .pitem .ptip::after {
  content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: #1a1a1a;
}
.vocab-tower-scene .pitem:hover .ptip { display: block; }
.vocab-tower-scene .pdiv { width: 1.5px; height: 22px; background: #d4cce9; }

/* ── TIMER (top layer — overlays everything in the scene, incl. #startScreen;
 * sits below the page topbar so it never overlaps it) ── */
.vocab-tower-scene #timerWrap { position: fixed; top: calc(var(--bar-h, 56px) + 18px); right: 18px; z-index: 150; pointer-events: auto; }
.vocab-tower-scene .tpill {
  background: rgba(255, 255, 255, .93); backdrop-filter: blur(10px);
  border: 2.5px solid rgba(255, 255, 255, .85); border-radius: 16px;
  padding: 9px 18px; min-width: 86px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .14);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.vocab-tower-scene .tlbl { font-size: 10px; font-weight: 700; color: #a1a1aa; text-transform: uppercase; letter-spacing: 1px; }
.vocab-tower-scene .tval { font-size: 30px; font-weight: 900; color: var(--p); line-height: 1; font-variant-numeric: tabular-nums; }
.vocab-tower-scene .tval.urgent { color: var(--red); animation: tpulse 1s ease-in-out infinite; }
@keyframes tpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.vocab-tower-scene .tbar-bg { width: 100%; height: 5px; background: rgba(102, 81, 161, .15); border-radius: 3px; overflow: hidden; }
.vocab-tower-scene .tbar { height: 100%; background: var(--p); border-radius: 3px; transition: width 1s linear, background .5s; }
.vocab-tower-scene .tbar.urgent { background: var(--red); }

/* ── SWING TRACK ── */
.vocab-tower-scene #magnetTurnsBar {
  display: none;
  align-items: center; gap: 8px;
  margin-top: 6px;
  font-family: 'Nunito Sans', sans-serif;
  pointer-events: auto;
}
.vocab-tower-scene #magnetTurnsBar .mt-label {
  font-size: 12px; font-weight: 700; color: #0369a1;
  display: flex; align-items: center; gap: 5px;
  background: #e0f2fe; border: 1.5px solid #7dd3fc;
  border-radius: 999px; padding: 4px 10px;
  white-space: nowrap;
  position: relative;
}
.vocab-tower-scene #magnetTurnsBar .mt-dots { display: flex; gap: 5px; }
.vocab-tower-scene #magnetTurnsBar .mt-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #0ea5e9;
  transition: background .2s;
}
.vocab-tower-scene #magnetTurnsBar .mt-dot.used { background: #bae6fd; }
.vocab-tower-scene #magnetDestroyBtn {
  display: none;
  cursor: pointer;
  width: 16px; height: 16px;
  font-size: 11px; font-weight: 900; line-height: 16px; text-align: center;
  font-family: 'Nunito Sans', sans-serif;
  color: #dc2626; background: none;
  border: none; border-radius: 50%;
  padding: 0; margin-left: 2px;
  transition: background .12s;
  position: relative;
}
.vocab-tower-scene #magnetDestroyBtn:hover { background: rgba(220, 38, 38, .15); }
.vocab-tower-scene #magnetDestroyBtn .mt-tip {
  display: none;
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: #fff; font-size: 11px; font-weight: 600;
  border-radius: 5px; padding: 3px 8px; white-space: nowrap; pointer-events: none;
}
.vocab-tower-scene #magnetDestroyBtn:hover .mt-tip { display: block; }
.vocab-tower-scene #swingWrap {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  transition: opacity .3s;
  pointer-events: none;
}
.vocab-tower-scene .swing-track { width: 300px; height: 8px; background: rgba(255, 255, 255, .2); border-radius: 4px; position: relative; }
.vocab-tower-scene .swing-knob {
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  position: absolute; top: 50%; transform: translate(-50%, -50%);
}
.vocab-tower-scene .swing-knob-magnet {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -145%) rotate(180deg);
  font-size: 32px; line-height: 1;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .4));
  display: none;
}
.vocab-tower-scene .swing-knob-sparkle {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  pointer-events: none;
  width: 0; height: 0;
}
.vocab-tower-scene .swing-knob-sparkle span {
  position: absolute;
  font-size: 20px;
  color: #f6c90e;
  text-shadow: 0 0 5px rgba(246, 201, 14, .8), 0 0 10px rgba(255, 160, 0, .4);
  opacity: 0;
  pointer-events: none;
  user-select: none;
}
@keyframes sp1  { 0%{opacity:0;transform:translate(-3px,4px) scale(.7)} 10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(-105px,-200px) scale(.5)} }
@keyframes sp2  { 0%{opacity:0;transform:translate(-1px,4px) scale(.7)} 10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(-62px,-205px) scale(.5)} }
@keyframes sp3  { 0%{opacity:0;transform:translate(0,4px) scale(.7)}    10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(-24px,-208px) scale(.5)} }
@keyframes sp4  { 0%{opacity:0;transform:translate(0,4px) scale(.7)}    10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(0,-210px) scale(.5)} }
@keyframes sp5  { 0%{opacity:0;transform:translate(0,4px) scale(.7)}    10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(24px,-208px) scale(.5)} }
@keyframes sp6  { 0%{opacity:0;transform:translate(1px,4px) scale(.7)}  10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(62px,-205px) scale(.5)} }
@keyframes sp7  { 0%{opacity:0;transform:translate(3px,4px) scale(.7)}  10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(105px,-200px) scale(.5)} }
@keyframes sp8  { 0%{opacity:0;transform:translate(-2px,4px) scale(.7)} 10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(-85px,-195px) scale(.5)} }
@keyframes sp9  { 0%{opacity:0;transform:translate(2px,4px) scale(.7)}  10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(85px,-195px) scale(.5)} }
@keyframes sp10 { 0%{opacity:0;transform:translate(-1px,4px) scale(.7)} 10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(-44px,-202px) scale(.5)} }
@keyframes sp11 { 0%{opacity:0;transform:translate(1px,4px) scale(.7)}  10%{opacity:.9} 80%{opacity:.5} 100%{opacity:0;transform:translate(44px,-202px) scale(.5)} }
.vocab-tower-scene .spark-1  { animation: sp1  2.8s linear infinite 0s;    }
.vocab-tower-scene .spark-2  { animation: sp2  3.0s linear infinite 0.5s;  }
.vocab-tower-scene .spark-3  { animation: sp3  2.6s linear infinite 1.1s;  }
.vocab-tower-scene .spark-4  { animation: sp4  3.2s linear infinite 0.8s;  }
.vocab-tower-scene .spark-5  { animation: sp5  2.6s linear infinite 1.5s;  }
.vocab-tower-scene .spark-6  { animation: sp6  3.0s linear infinite 0.3s;  }
.vocab-tower-scene .spark-7  { animation: sp7  2.8s linear infinite 1.9s;  }
.vocab-tower-scene .spark-8  { animation: sp8  2.9s linear infinite 0.65s; }
.vocab-tower-scene .spark-9  { animation: sp9  2.9s linear infinite 1.3s;  }
.vocab-tower-scene .spark-10 { animation: sp10 3.1s linear infinite 2.1s;  }
.vocab-tower-scene .spark-11 { animation: sp11 3.1s linear infinite 0.95s; }
.vocab-tower-scene .magnet-active .swing-knob-magnet { display: block; }
.vocab-tower-scene .magnet-active .swing-knob-sparkle { display: block; }

/* ── QUESTION CARD ── */
.vocab-tower-scene #qcard {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  width: min(580px, calc(100vw - 20px));
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(14px);
  border-radius: 22px; border: 2.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 10px 50px rgba(0, 0, 0, .18); padding: 18px;
  transition: opacity .22s, transform .28s cubic-bezier(.4, 0, .2, 1);
}
.vocab-tower-scene #qcard.out { opacity: 0; transform: translateX(-50%) translateY(14px); pointer-events: none; }
.vocab-tower-scene .qprompt { font-size: 11px; font-weight: 800; color: #a1a1aa; text-transform: uppercase; letter-spacing: 1.2px; text-align: center; margin-bottom: 13px; }
.vocab-tower-scene .cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.vocab-tower-scene .cbtn {
  padding: 14px 15px; border: 2.5px solid #e4e4e7; border-radius: 13px;
  background: #fff; cursor: pointer;
  font-family: 'Nunito Sans', sans-serif; font-size: 16px; font-weight: 800; color: #333;
  display: flex; align-items: center; gap: 11px;
  transition: background .1s, border-color .1s, transform .1s; outline: none; text-align: left;
}
.vocab-tower-scene .cbtn:hover:not(:disabled) { background: #f5f2fb; border-color: var(--p); transform: translateY(-2px); }
.vocab-tower-scene .cbtn:focus-visible { box-shadow: 0 0 0 3px rgba(102, 81, 161, .3); border-color: var(--p); }
.vocab-tower-scene .cltr {
  width: 30px; height: 30px; border-radius: 50%; background: #f0edfb; color: var(--p7);
  font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .1s, color .1s;
}
.vocab-tower-scene .cbtn.correct { background: #f0fdf4; border-color: var(--green); color: #14532d; animation: cpop .42s cubic-bezier(.34, 1.56, .64, 1); }
.vocab-tower-scene .cbtn.correct .cltr { background: var(--green); color: #fff; }
.vocab-tower-scene .cbtn.wrong { background: #fef2f2; border-color: var(--red); color: #7f1d1d; animation: cshake .35s ease; }
.vocab-tower-scene .cbtn.wrong .cltr { background: var(--red); color: #fff; }
.vocab-tower-scene .cbtn.rcorrect { background: #f0fdf4; border-color: var(--green); color: #14532d; }
.vocab-tower-scene .cbtn.rcorrect .cltr { background: var(--green); color: #fff; }
.vocab-tower-scene .cbtn.dim { opacity: .35; }
.vocab-tower-scene .cbtn:disabled { cursor: default; transform: none !important; }
@keyframes cpop { 0% { transform: scale(1); } 45% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes cshake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ── RELEASE BUTTON ── */
.vocab-tower-scene #releaseBtn {
  display: none;
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  width: min(320px, 80vw); height: 64px;
  border-radius: 20px; border: none;
  background: var(--green); color: #fff;
  font-family: 'Nunito Sans', sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 0 #0e7a30, 0 10px 30px rgba(22, 163, 74, .4);
  transition: transform .1s, box-shadow .1s;
  animation: relPop .35s cubic-bezier(.34, 1.56, .64, 1);
  padding: 0;
  overflow: hidden;
}
.vocab-tower-scene #releaseBtn:hover { transform: translateX(-50%) translateY(-3px); box-shadow: 0 11px 0 #0e7a30, 0 14px 35px rgba(22, 163, 74, .4); }
.vocab-tower-scene #releaseBtn:active { transform: translateX(-50%) translateY(2px); box-shadow: 0 5px 0 #0e7a30; }

/* Fill bar that shrinks from right to left as timer counts down */
.vocab-tower-scene #dropTimerFill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 100%;
  background: rgba(255, 255, 255, .18);
  border-radius: 20px;
  transition: width 0.05s linear;
  pointer-events: none;
}

/* Label row inside button */
.vocab-tower-scene #dropBtnLabel {
  position: relative; z-index: 1;
  font-size: 22px; font-weight: 900; letter-spacing: .5px;
  vertical-align: middle;
}
.vocab-tower-scene #dropBtnCount {
  position: relative; z-index: 1;
  font-size: 28px; font-weight: 900;
  margin-left: 14px;
  min-width: 32px; display: inline-block;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  opacity: .92;
}
.vocab-tower-scene #releaseBtn.urgent {
  background: var(--red);
  box-shadow: 0 8px 0 #991f1f, 0 10px 30px rgba(201, 62, 62, .4);
}

@keyframes relPop {
  0%   { transform: translateX(-50%) scale(.7) translateY(20px); opacity: 0; }
  100% { transform: translateX(-50%) scale(1) translateY(0); opacity: 1; }
}

/* ── CONTINUE BUTTON (wrong answer) ── */
.vocab-tower-scene #continueBtn {
  display: none;
  position: absolute; bottom: calc(14px + var(--qcard-h, 220px) + 24px); left: 50%; transform: translateX(-50%);
  padding: 16px 48px; border-radius: 20px; border: none;
  background: #52525b; color: #fff;
  font-family: 'Nunito Sans', sans-serif; font-size: 18px; font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 #3f3f46, 0 8px 24px rgba(0, 0, 0, .25);
  transition: transform .1s, box-shadow .1s;
  animation: relPop .3s cubic-bezier(.34, 1.56, .64, 1);
  z-index: 210;
  white-space: nowrap;
}
.vocab-tower-scene #continueBtn:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 8px 0 #3f3f46, 0 10px 28px rgba(0, 0, 0, .25); }
.vocab-tower-scene #continueBtn:active { transform: translateX(-50%) translateY(2px); box-shadow: 0 3px 0 #3f3f46; }
.vocab-tower-scene #continueBtn:focus-visible { outline: 3px solid #a1a1aa; outline-offset: 3px; }

/* ── TOAST ── */
.vocab-tower-scene #toast {
  position: absolute; top: 82px; left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 11px 24px; border-radius: 999px; font-size: 15px; font-weight: 800;
  box-shadow: 0 5px 22px rgba(0, 0, 0, .14); opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.vocab-tower-scene #toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.vocab-tower-scene #toast.poof-exit { animation: toast-poof .4s ease-in forwards; }
@keyframes toast-poof {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  40%  { opacity: 1; transform: translateX(-50%) translateY(-6px) scale(1.08); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(.7); }
}
.vocab-tower-scene #toast img.toast-icon { width: 20px; height: 20px; display: block; flex-shrink: 0; }
.vocab-tower-scene .tok    { background: #fff; color: #14532d; border: 2px solid #bbf7d0; }
.vocab-tower-scene .tbad   { background: #fff; color: #7f1d1d; border: 2px solid #fecaca; }
.vocab-tower-scene .ttime  { background: #fff; color: var(--p7); border: 2px solid #d4cce9; }
.vocab-tower-scene .titem  { background: #fff; color: var(--text1, #333); border: 2px solid #e4e4e7; }

/* ── Shield flash ── */
.vocab-tower-scene #shield-flash {
  position: absolute; left: 50%;
  top: 154px;
  transform: translateX(-50%);
  width: 200px; height: 200px;
  pointer-events: none;
  opacity: 0;
  z-index: 60;
}
.vocab-tower-scene #shield-flash img { width: 100%; height: 100%; display: block; }
.vocab-tower-scene #shield-flash.show    { animation: shield-pop 2.5s ease-out forwards; }
.vocab-tower-scene #shield-flash.dismiss { animation: shield-fade-out 0.35s ease-in forwards; }
@keyframes shield-fade-out {
  0%   { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(.85); }
}
@keyframes shield-pop {
  0%   { opacity: 0; transform: translateX(-50%) scale(.6); }
  18%  { opacity: 1; transform: translateX(-50%) scale(1.08); }
  35%  { opacity: 1; transform: translateX(-50%) scale(1); }
  75%  { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(.85); }
}

/* ── END ── */
.vocab-tower-scene #endOverlay {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  background: rgba(18, 10, 50, .6); backdrop-filter: blur(5px);
}
.vocab-tower-scene #endOverlay.on { display: flex; }

.vocab-tower-scene .ecard {
  background: #fff; border-radius: 28px; padding: 38px 44px; text-align: center;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .32);
  display: flex; flex-direction: column; align-items: center; gap: 15px;
  max-width: 380px; width: calc(100vw - 32px);
  animation: epop .6s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes epop { from { transform: scale(.72) translateY(28px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.vocab-tower-scene .etitle { font-size: 28px; font-weight: 900; color: #1a1a2e; }
.vocab-tower-scene .esub { font-size: 15px; font-weight: 700; color: #52525b; }
.vocab-tower-scene .estats { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.vocab-tower-scene .estat { background: #f5f2fb; border: 2px solid #d4cce9; border-radius: 14px; padding: 14px 22px; text-align: center; min-width: 92px; }
.vocab-tower-scene .tower-stat { background: #f0edfb; border-color: var(--p); }
.vocab-tower-scene .pbtn-close { background: #fff; color: var(--p); border: 2px solid var(--p); margin-top: -6px; }
.vocab-tower-scene .pbtn-close:hover { background: #f5f2fb; transform: translateY(-2px); }
.vocab-tower-scene .esv { font-size: 28px; font-weight: 900; color: var(--p); }
.vocab-tower-scene .esl { font-size: 10px; font-weight: 800; color: #a1a1aa; text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.vocab-tower-scene .pbtn {
  padding: 15px 40px; border-radius: 14px; border: none; background: var(--p); color: #fff;
  font-family: 'Nunito Sans', sans-serif; font-size: 17px; font-weight: 900;
  cursor: pointer; transition: background .12s, transform .1s; margin-top: 4px;
}
.vocab-tower-scene .pbtn:hover { background: var(--p6); transform: translateY(-2px); }

/* ── BONUS STAT ANIMATIONS ── */
.vocab-tower-scene .esv.counting { color: var(--p); }
@keyframes bonusPop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.vocab-tower-scene .estat.bonus-reveal { animation: bonusPop .5s cubic-bezier(.34,1.56,.64,1) both; }

/* ── START SCREEN ── */
.vocab-tower-scene #startScreen {
  position: absolute; inset: 0; z-index: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: transparent;
}
.vocab-tower-scene #startScreen.gone { display: none; }
.vocab-tower-scene .start-card {
  background: #fff; border-radius: 28px;
  padding: 40px 44px 36px; text-align: center;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  max-width: 460px; width: calc(100vw - 32px);
  animation: epop .5s cubic-bezier(.34, 1.56, .64, 1);
}
.vocab-tower-scene .start-logo { font-size: 36px; font-weight: 900; line-height: 1; }
.vocab-tower-scene .start-logo .hv { color: #1a1a2e; }
.vocab-tower-scene .start-logo .ht { color: var(--p); }
.vocab-tower-scene .start-divider { width: 48px; height: 3px; background: var(--p); border-radius: 2px; opacity: .3; }
.vocab-tower-scene .start-how {
  background: #f5f2fb; border-radius: 14px;
  padding: 16px 20px; text-align: left; width: 100%;
}
.vocab-tower-scene .start-how h3 {
  font-size: 11px; font-weight: 800; color: #a1a1aa;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.vocab-tower-scene .start-steps { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.vocab-tower-scene .start-steps li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; font-weight: 700; color: #333; line-height: 1.4;
}
.vocab-tower-scene .step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--p); color: #fff;
  font-size: 11px; font-weight: 900; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.vocab-tower-scene .start-meta { font-size: 13px; font-weight: 700; color: #a1a1aa; }
.vocab-tower-scene .start-meta span { color: var(--p); font-weight: 800; }
.vocab-tower-scene .start-powers {
  background: #f5f2fb; border-radius: 14px;
  padding: 14px 18px; text-align: left; width: 100%;
}
.vocab-tower-scene .start-powers-lbl {
  font-size: 11px; font-weight: 800; color: var(--p);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.vocab-tower-scene .start-power-list { display: flex; flex-direction: column; gap: 8px; }
.vocab-tower-scene .start-power-item { display: flex; align-items: center; gap: 10px; }
.vocab-tower-scene .start-power-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.vocab-tower-scene .start-power-icon img { width: 26px; height: 26px; display: block; }
.vocab-tower-scene .start-power-text { display: flex; flex-direction: column; gap: 1px; }
.vocab-tower-scene .start-power-name { font-size: 13px; font-weight: 800; color: #333; }
.vocab-tower-scene .start-power-desc { font-size: 11px; font-weight: 600; color: #71717a; }
.vocab-tower-scene .start-timer-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; gap: 12px;
}
.vocab-tower-scene .start-timer-lbl {
  font-size: 13px; font-weight: 800; color: #52525b; white-space: nowrap;
}
.vocab-tower-scene .start-timer-opts { display: flex; gap: 6px; }
.vocab-tower-scene .topt {
  padding: 8px 14px; border-radius: 10px; border: 2px solid #e4e4e7;
  background: #fff; color: #52525b;
  font-family: 'Nunito Sans', sans-serif; font-size: 13px; font-weight: 800;
  cursor: pointer; transition: all .12s;
}
.vocab-tower-scene .topt:hover { border-color: var(--p); color: var(--p); background: #f5f2fb; }
.vocab-tower-scene .topt.active { border-color: var(--p); background: var(--p); color: #fff; }
.vocab-tower-scene .start-btn {
  padding: 16px 52px; border-radius: 16px; border: none;
  background: var(--p); color: #fff;
  font-family: 'Nunito Sans', sans-serif; font-size: 20px; font-weight: 900;
  cursor: pointer; width: 100%;
  box-shadow: 0 7px 0 var(--p6), 0 10px 28px rgba(102, 81, 161, .35);
  transition: transform .1s, box-shadow .1s;
}
.vocab-tower-scene .start-btn:hover { transform: translateY(-2px); box-shadow: 0 9px 0 var(--p6), 0 12px 32px rgba(102, 81, 161, .35); }
.vocab-tower-scene .start-btn:active { transform: translateY(2px); box-shadow: 0 4px 0 var(--p6); }

/* ── LOADING ── */
.vocab-tower-scene #loading {
  position: absolute; inset: 0; background: rgba(50, 80, 160, .85); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.vocab-tower-scene #loading.gone { display: none; }
.vocab-tower-scene .ldots { display: flex; gap: 9px; }
.vocab-tower-scene .ldots span { width: 12px; height: 12px; border-radius: 50%; background: #fff; animation: pd 1.2s ease-in-out infinite; }
.vocab-tower-scene .ldots span:nth-child(2) { animation-delay: .2s; }
.vocab-tower-scene .ldots span:nth-child(3) { animation-delay: .4s; }
@keyframes pd { 0%, 100% { transform: scale(.75); opacity: .3; } 50% { transform: scale(1); opacity: 1; } }
.vocab-tower-scene .ltxt { font-size: 16px; font-weight: 800; color: #fff; }

/* ── CONFETTI ──
 * Confetti elements are appended to document.body with class .vt-cp so they
 * can fly across the whole viewport without being clipped by the scene
 * container. They're not scoped under .vocab-tower-scene on purpose. */
.vt-cp { position: fixed; border-radius: 3px; pointer-events: none; z-index: 600; animation: cfall linear forwards; }
@keyframes cfall { 0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(.2); opacity: 0; } }

/* ── MOBILE < 600px ── */
@media (max-width: 600px) {
  .vocab-tower-scene #powersWrap { left: 18px; top: calc(var(--bar-h, 56px) + 18px); }
  .vocab-tower-scene #timerWrap { top: auto; bottom: 18px; right: 18px; }
  .vocab-tower-scene.is-student-waiting #timerWrap {
    top: calc(var(--bar-h, 56px) + 18px);
    right: 18px;
    bottom: auto;
  }
}
