/* ================================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ================================================================ */
:root {
  --bg:        #080c18;
  --card:      rgba(15, 23, 42, 0.85);
  --card-solid:#0f172a;
  --border:    rgba(0, 229, 199, 0.15);
  --accent:    #00e5c7;
  --accent-dim:rgba(0, 229, 199, 0.12);
  --gold:      #f59e0b;
  --gold-dim:  rgba(245, 158, 11, 0.12);
  --success:   #10b981;
  --error:     #ef4444;
  --text:      #f1f5f9;
  --text2:     #94a3b8;
  --text3:     #475569;
}

/* ================================================================
   RESET & BASE
   ================================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  touch-action: manipulation;
}

body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}
body::before {
  top: -15%; left: -10%; width: 45%; height: 45%;
  background: radial-gradient(circle, rgba(0,229,199,0.05), transparent 60%);
}
body::after {
  bottom: -20%; right: -10%; width: 55%; height: 55%;
  background: radial-gradient(circle, rgba(245,158,11,0.03), transparent 60%);
}

#star-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

#app {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1rem;
}

.font-d { font-family: 'Orbitron', monospace; }

/* ================================================================
   SCREEN TRANSITIONS
   ================================================================ */
.screen {
  width: 100%; max-width: 800px;
  transition: opacity .4s, transform .4s;
}
.screen.hidden    { display: none !important; }
.screen.fade-out  { opacity: 0; transform: scale(.96); }

/* ================================================================
   KEYFRAME ANIMATIONS
   ================================================================ */
@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(0,229,199,0.3); }
  50%      { text-shadow: 0 0 40px rgba(0,229,199,0.5),
                         0 0 80px rgba(0,229,199,0.15); }
}
.title-glow { animation: titleGlow 3s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%  { transform: translateX(-7px); }
  40%  { transform: translateX(7px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
}
@keyframes popIn {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes mergeFlash {
  0%   { box-shadow: 0 0 0 0 rgba(0,229,199,0.6); }
  50%  { box-shadow: 0 0 20px 8px rgba(0,229,199,0.3); }
  100% { box-shadow: 0 0 0 0 rgba(0,229,199,0); }
}
@keyframes crossGlow {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.5); }
}
@keyframes starPop {
  0%   { transform: scale(0) rotate(-30deg); }
  60%  { transform: scale(1.3) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes fireGlow {
  from { box-shadow: 0 0 8px rgba(239,68,68,0.2); }
  to   { box-shadow: 0 0 18px rgba(245,158,11,0.4); }
}
@keyframes timerPulse {
  from { opacity: .6; }
  to   { opacity: 1; }
}
@keyframes choiceIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scoreFloat {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-55px) scale(1.15); }
}

/* ================================================================
   MENU: PLANET CARDS
   ================================================================ */
.planet-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.15rem;
  cursor: pointer;
  transition: all .3s;
  position: relative;
  overflow: hidden;
}
.planet-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%,
    rgba(255,255,255,0.04), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.planet-card:hover {
  border-color: rgba(0,229,199,0.35);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,229,199,0.1);
}
.planet-card:hover::before { opacity: 1; }
.planet-card:hover .play-hint {
  opacity: 1; transform: translateY(0);
}

.planet-card:nth-child(1) { animation: float 4s ease-in-out infinite; }
.planet-card:nth-child(2) { animation: float 4s ease-in-out infinite .5s; }
.planet-card:nth-child(3) { animation: float 4s ease-in-out infinite 1s; }
.planet-card:nth-child(4) { animation: float 4s ease-in-out infinite 1.5s; }
.planet-card:nth-child(5) { animation: float 4s ease-in-out infinite 2s; }
.planet-card:nth-child(6) { animation: float 4s ease-in-out infinite 2.5s; }

.planet-icon {
  width: 44px; height: 44px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; margin-bottom: .65rem;
}
.play-hint {
  font-size: .65rem; font-weight: 700; color: var(--accent);
  opacity: 0; transform: translateY(4px);
  transition: all .25s; margin-top: .35rem;
  display: flex; align-items: center; gap: 3px;
}
.mini-stars i { font-size: .65rem; color: var(--text3); }
.mini-stars i.earned { color: var(--gold); }

/* ================================================================
   MENU: LEVEL CARDS
   ================================================================ */
.level-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all .3s;
  text-align: center;
}
.level-card:not(.locked):hover {
  border-color: rgba(0,229,199,0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,229,199,0.1);
}
.level-card.locked {
  opacity: .4; cursor: not-allowed; filter: grayscale(.5);
}
.level-card.locked:hover {
  transform: none; border-color: var(--border); box-shadow: none;
}
.level-num {
  font-family: 'Orbitron', monospace;
  font-weight: 900; font-size: 2rem;
  color: var(--accent); margin-bottom: .5rem;
}
.level-card.locked .level-num { color: var(--text3); }
.level-stars i { font-size: 1.2rem; color: var(--text3); margin: 0 2px; }
.level-stars i.earned { color: var(--gold); }
.level-label { font-weight: 800; font-size: .9rem; margin-bottom: .25rem; }
.level-desc  { font-size: .75rem; color: var(--text3); font-weight: 600; }

/* ================================================================
   LANGUAGE TOGGLE
   ================================================================ */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 0;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
}
.lang-btn {
  padding: .4rem .75rem; font-size: .78rem; font-weight: 700;
  border: none; cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: all .2s;
  background: transparent; color: var(--text2);
}
.lang-btn.active {
  background: var(--accent); color: #080c18;
}
.lang-btn:hover:not(.active) {
  background: var(--accent-dim);
}

/* ================================================================
   GAME HUD: PROGRESS BAR, TIMER, COMBO, LIVES
   ================================================================ */
.progress-track {
  width: 100%; height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #00ffc8);
  border-radius: 3px;
  transition: width .4s ease;
}

.timer-ring {
  width: 52px; height: 52px;
  position: relative; flex-shrink: 0;
}
.timer-ring svg { transform: rotate(-90deg); }
.ring-bg {
  fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 4;
}
.ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke .3s;
}
.ring-fill.warning { stroke: var(--gold); }
.ring-fill.danger {
  stroke: var(--error);
  animation: timerPulse .5s ease infinite alternate;
}
.timer-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', monospace;
  font-weight: 700; font-size: .85rem;
}

.combo-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg,
    rgba(245,158,11,0.15), rgba(239,68,68,0.15));
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 20px; padding: 3px 12px;
  font-size: .8rem; font-weight: 800; color: var(--gold);
  transition: all .3s;
  opacity: 0; transform: scale(.8);
}
.combo-badge.active  { opacity: 1; transform: scale(1); }
.combo-badge.fire {
  background: linear-gradient(135deg,
    rgba(239,68,68,0.25), rgba(245,158,11,0.25));
  border-color: rgba(239,68,68,0.4);
  animation: fireGlow .7s ease infinite alternate;
}

.heart {
  color: var(--error); font-size: 1rem; transition: all .3s;
}
.heart.lost {
  color: var(--text3); transform: scale(.75); opacity: .5;
}

/* ================================================================
   WORKSPACE CONTAINER & EQUATION ELEMENTS
   ================================================================ */
.ws-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.ws-container::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%,
    rgba(0,229,199,0.04), transparent 70%);
  pointer-events: none;
}
.ws-container.danger-state {
  border-color: rgba(239,68,68,0.3);
}

.ws-equation {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; flex-wrap: wrap;
  padding: 1rem .5rem;
  position: relative; z-index: 1;
  min-height: 70px; overflow-x: auto;
}
.ws-side {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}

.ws-equals {
  font-family: 'Orbitron', monospace;
  font-weight: 900; font-size: 1.6rem;
  color: var(--gold); padding: 0 10px; flex-shrink: 0;
  text-shadow: 0 0 12px rgba(245,158,11,0.3);
}

.ws-token {
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .25s; position: relative; flex-shrink: 0;
}

.ws-num {
  background: linear-gradient(145deg,
    rgba(0,229,199,0.18), rgba(0,229,199,0.06));
  border: 2px solid rgba(0,229,199,0.35);
  border-radius: 12px;
  padding: 8px 14px;
  font-family: 'Orbitron', monospace;
  font-weight: 700; font-size: 1.05rem;
  color: var(--accent);
  cursor: grab; user-select: none; touch-action: none;
  min-width: 40px; min-height: 40px;
  position: relative;
}
.ws-num:hover {
  border-color: rgba(0,229,199,0.6);
  background: linear-gradient(145deg,
    rgba(0,229,199,0.25), rgba(0,229,199,0.1));
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,229,199,0.15);
}
.ws-num:active    { cursor: grabbing; }
.ws-num.dragging   { opacity: .35; transform: scale(.9); }
.ws-num.drag-over {
  border-color: var(--gold);
  background: linear-gradient(145deg,
    rgba(245,158,11,0.25), rgba(245,158,11,0.1));
  box-shadow: 0 0 20px rgba(245,158,11,0.3);
  transform: scale(1.08);
}
.ws-num.merged-in {
  animation: popIn .35s ease, mergeFlash .5s ease;
}
.ws-num.crossed-in {
  animation: popIn .35s ease, crossGlow .5s ease;
}
.ws-num.result-num {
  border-color: var(--success);
  background: linear-gradient(145deg,
    rgba(16,185,129,0.2), rgba(16,185,129,0.06));
  color: var(--success);
  box-shadow: 0 0 15px rgba(16,185,129,0.2);
}

.ws-op {
  font-size: 1.3rem; font-weight: 800;
  color: var(--text2); padding: 0 4px;
  min-width: 28px; text-align: center;
}
.ws-paren {
  font-size: 1.5rem; font-weight: 300;
  color: var(--text3); padding: 0 2px;
  min-width: 16px; text-align: center;
}
.ws-var {
  font-family: 'Orbitron', monospace;
  font-weight: 900; font-size: 1.3rem;
  color: #f87171;
  padding: 8px 12px;
  border: 2px solid rgba(248,113,113,0.3);
  border-radius: 12px;
  background: rgba(248,113,113,0.06);
}
.ws-empty {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 8px 18px;
  min-width: 50px; min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text3); font-weight: 700; font-size: 1.1rem;
}
.ws-text {
  font-size: .85rem; color: var(--text3);
  font-weight: 600; padding: 0 4px;
}

.ws-frac {
  display: inline-flex; flex-direction: column;
  align-items: center; line-height: 1.1; gap: 0;
}
.ws-frac-n   { padding: 0 5px 2px; }
.ws-frac-bar {
  width: 100%; min-width: 16px; height: 2px;
  background: var(--accent); border-radius: 1px;
}
.ws-frac-d   { padding: 2px 5px 0; }

.ws-factor-group {
  display: flex; align-items: center; gap: 3px;
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 10px; padding: 6px 10px;
  touch-action: none;
}
.ws-factor {
  background: rgba(167,139,250,0.15);
  border: 1.5px solid rgba(167,139,250,0.3);
  border-radius: 8px;
  padding: 5px 10px;
  font-family: 'Orbitron', monospace;
  font-weight: 700; font-size: .95rem;
  color: #a78bfa;
  cursor: grab; user-select: none; touch-action: none;
  min-width: 34px; min-height: 34px;
  text-align: center; transition: all .2s;
}
.ws-factor:hover {
  border-color: rgba(167,139,250,0.6);
  transform: translateY(-1px);
}
.ws-factor.dragging { opacity: .35; }

.ws-eliminate-zone {
  border: 2px dashed rgba(239,68,68,0.3);
  border-radius: 14px;
  padding: 12px 20px;
  min-width: 80px; min-height: 50px;
  display: flex; align-items: center; justify-content: center;
  color: var(--error); font-size: .8rem; font-weight: 700;
  transition: all .2s; opacity: .6;
}
.ws-eliminate-zone.active {
  border-color: var(--error);
  background: rgba(239,68,68,0.08);
  opacity: 1;
  box-shadow: 0 0 20px rgba(239,68,68,0.15);
}

.drag-clone {
  position: fixed; z-index: 9999; pointer-events: none;
  transform: scale(1.1) rotate(-2deg); opacity: .92;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5));
  transition: none;
}

.ws-instruction {
  text-align: center; font-size: .85rem;
  font-weight: 700; color: var(--text2);
  margin-top: .6rem; min-height: 24px;
  position: relative; z-index: 1;
  animation: fadeInUp .3s ease;
}
.ws-instruction i { margin-right: 4px; }

.ws-btn-row {
  display: flex; gap: 10px;
  justify-content: center;
  margin-top: .75rem; flex-wrap: wrap;
}
.ws-btn {
  padding: .5rem 1.1rem; border-radius: 12px;
  border: none; font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: .85rem;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; gap: 6px;
}
.ws-btn:hover { transform: translateY(-2px); }
.ws-help-btn {
  background: var(--gold-dim); color: var(--gold);
  border: 1px solid rgba(245,158,11,0.25);
}
.ws-help-btn:hover {
  background: rgba(245,158,11,0.2);
  box-shadow: 0 4px 15px rgba(245,158,11,0.15);
}
.ws-help-btn.used { opacity: .5; pointer-events: none; }
.ws-skip-btn {
  background: var(--card); color: var(--text2);
  border: 1px solid var(--border);
}
.ws-skip-btn:hover {
  border-color: var(--accent); color: var(--text);
}
.ws-undo-btn {
  background: rgba(56,189,248,0.1); color: #38bdf8;
  border: 1px solid rgba(56,189,248,0.25);
}
.ws-undo-btn:hover {
  background: rgba(56,189,248,0.2);
  box-shadow: 0 4px 15px rgba(56,189,248,0.15);
}

.ws-q-text {
  text-align: center; font-size: .95rem;
  font-weight: 700; color: var(--text);
  margin-bottom: .75rem; line-height: 1.5;
  position: relative; z-index: 1;
}

.frac {
  display: inline-flex; flex-direction: column;
  align-items: center; vertical-align: middle;
  margin: 0 3px; line-height: 1.1;
}
.frac-num { padding: 0 4px 1px; }
.frac-bar {
  width: 100%; min-width: 14px; height: 2px;
  background: currentColor; border-radius: 1px;
}
.frac-den { padding: 1px 4px 0; }

/* ================================================================
   MULTIPLE CHOICE GRID
   ================================================================ */
.ws-choices {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 1rem;
  position: relative; z-index: 1;
}
.ws-choice {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
  font-family: 'Orbitron', monospace;
  font-weight: 700; font-size: 1rem;
  color: var(--text); cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; text-align: center; line-height: 1.4;
  animation: choiceIn .3s ease backwards;
}
.ws-choice:nth-child(1) { animation-delay: .05s; }
.ws-choice:nth-child(2) { animation-delay: .1s; }
.ws-choice:nth-child(3) { animation-delay: .15s; }
.ws-choice:nth-child(4) { animation-delay: .2s; }

.ws-choice:hover:not(.disabled) {
  border-color: rgba(0,229,199,0.5);
  background: rgba(0,229,199,0.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,229,199,0.1);
}
.ws-choice:active:not(.disabled) { transform: scale(.97); }
.ws-choice.correct {
  border-color: var(--success) !important;
  background: rgba(16,185,129,0.15) !important;
  color: var(--success) !important;
  animation: mergeFlash .5s ease;
}
.ws-choice.wrong {
  border-color: var(--error) !important;
  background: rgba(239,68,68,0.12) !important;
  color: var(--error) !important;
  animation: shake .4s ease;
}
.ws-choice.show-correct {
  border-color: var(--success) !important;
  background: rgba(16,185,129,0.1) !important;
  color: var(--success) !important;
}
.ws-choice.disabled { pointer-events: none; opacity: .45; }
.ws-choice.disabled.correct,
.ws-choice.disabled.wrong,
.ws-choice.disabled.show-correct { opacity: 1; }

/* ================================================================
   BUTTONS (PRIMARY & SECONDARY)
   ================================================================ */
.btn-p {
  background: linear-gradient(135deg, var(--accent), #00c4aa);
  color: #080c18; font-weight: 800;
  padding: .85rem 2rem; border-radius: 12px;
  border: none; font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  cursor: pointer; transition: all .2s;
}
.btn-p:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0,229,199,0.3);
}
.btn-s {
  background: var(--card); color: var(--text);
  font-weight: 700; padding: .85rem 2rem;
  border-radius: 12px; border: 1px solid var(--border);
  font-size: 1rem; font-family: 'Nunito', sans-serif;
  cursor: pointer; transition: all .2s;
}
.btn-s:hover {
  border-color: var(--accent); background: var(--accent-dim);
}

/* ================================================================
   RESULTS: STAR DISPLAY
   ================================================================ */
.star-display .star {
  font-size: 2.2rem; color: var(--text3);
  transition: all .4s;
  display: inline-block; margin: 0 .25rem;
}
.star-display .star.earned {
  color: var(--gold);
  text-shadow: 0 0 15px rgba(245,158,11,0.6);
  animation: starPop .5s ease;
}

/* ================================================================
   FLOATING EFFECTS
   ================================================================ */
.particle {
  position: fixed; pointer-events: none;
  border-radius: 50%; z-index: 100;
}
.score-popup {
  position: fixed; pointer-events: none;
  font-family: 'Orbitron', monospace;
  font-weight: 900; font-size: 1.4rem;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(245,158,11,0.5);
  z-index: 100;
  animation: scoreFloat 1s ease-out forwards;
}

.ws-correct-flash {
  animation: mergeFlash .6s ease;
  border-color: var(--success) !important;
  color: var(--success) !important;
}
.ws-wrong-flash {
  animation: shake .4s ease;
  border-color: var(--error) !important;
}

/* ================================================================
   EXIT BAR & MODAL
   ================================================================ */
#exit-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  padding: .75rem 1rem; text-align: center;
  background: rgba(15,23,42,0.95);
  border-bottom: 1px solid rgba(239,68,68,0.3);
  backdrop-filter: blur(8px);
  transform: translateY(-100%);
  transition: transform .3s;
}
#exit-bar.show { transform: translateY(0); }

.modal-ov {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 150;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.modal-ov.show { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px; width: 100%;
  max-height: 85vh; overflow-y: auto;
}
.onboard-step {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem; border-radius: 12px;
  margin-bottom: .75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
}
.onboard-step .ob-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1rem;
}

/* ================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================ */
@media (max-width: 640px) {
  .planet-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .ws-num { padding: 6px 10px; font-size: .95rem;
            min-width: 36px; min-height: 36px; }
  .ws-op  { font-size: 1.1rem; }
  .ws-equals { font-size: 1.3rem; padding: 0 6px; }
  .ws-equation { gap: 4px; padding: .75rem .25rem; }
  .ws-container { padding: 1rem; }
  .ws-var { font-size: 1.1rem; padding: 6px 10px; }
  .ws-choice { font-size: .9rem; padding: 12px 8px;
               min-height: 46px; }
}

@media (max-width: 400px) {
  .ws-equation {
    flex-wrap: wrap; justify-content: center; gap: 6px 4px;
  }
  .ws-equals {
    width: 100%; text-align: center;
    padding: 6px 0 2px; font-size: 1.2rem;
  }
  .ws-side {
    flex-wrap: wrap; justify-content: center;
    gap: 4px; width: 100%;
  }
  .ws-num   { padding: 5px 8px; font-size: .88rem;
              min-width: 32px; min-height: 32px; }
  .ws-op    { font-size: 1rem; min-width: 20px; }
  .ws-var   { font-size: 1rem; padding: 5px 8px; }
  .ws-paren { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}