:root {
  --bg-deep: #060913;
  --card-bg: #0c1324;
  --arena-bg: #070b17;
  --text-main: #f1f5ff;
  --text-muted: #8b9dc3;

  --theme: #00f3ff;
  --theme-rgb: 0, 243, 255;
  --theme-secondary: #3b82f6;

  --correct: #00ff9d;
  --wrong: #ff3b6b;
}

/* Кольорові теми для кожної категорії */
.trainer-card[data-theme="2"]   { --theme: #00f3ff; --theme-rgb: 0, 243, 255;   --theme-secondary: #2563eb; }
.trainer-card[data-theme="3"]   { --theme: #00ff9d; --theme-rgb: 0, 255, 157;   --theme-secondary: #059669; }
.trainer-card[data-theme="4"]   { --theme: #b84dff; --theme-rgb: 184, 77, 255;  --theme-secondary: #7c3aed; }
.trainer-card[data-theme="5"]   { --theme: #ff2e93; --theme-rgb: 255, 46, 147;  --theme-secondary: #db2777; }
.trainer-card[data-theme="6"]   { --theme: #ffb800; --theme-rgb: 255, 184, 0;   --theme-secondary: #ea580c; }
.trainer-card[data-theme="7"]   { --theme: #38bdf8; --theme-rgb: 56, 189, 248;  --theme-secondary: #4f46e5; }
.trainer-card[data-theme="8"]   { --theme: #ff5757; --theme-rgb: 255, 87, 87;   --theme-secondary: #dc2626; }
.trainer-card[data-theme="9"]   { --theme: #2dd4bf; --theme-rgb: 45, 212, 191;  --theme-secondary: #0891b2; }
.trainer-card[data-theme="mix"] { --theme: #e879f9; --theme-rgb: 232, 121, 249; --theme-secondary: #00f3ff; }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100dvh;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

.cyber-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 243, 255, 0.1), transparent 42%),
    radial-gradient(circle at 85% 88%, rgba(184, 77, 255, 0.12), transparent 45%),
    linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.app-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vw, 24px);
}

.trainer-card {
  width: 100%;
  max-width: 820px;
  background: linear-gradient(170deg, #0e162b 0%, #090e1d 100%);
  border: 2px solid rgba(var(--theme-rgb), 0.6);
  border-radius: 24px;
  padding: clamp(14px, 2.8vw, 28px);
  box-shadow: 0 0 26px rgba(var(--theme-rgb), 0.22);
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.brand-block {
  flex: 1 1 auto;
  min-width: 0;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.25rem, 3.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(var(--theme-rgb), 0.5);
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.reset-btn {
  user-select: none;
  touch-action: manipulation;
  cursor: pointer;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(var(--theme-rgb), 0.45);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1rem;
  display: grid;
  place-items: center;
  transition: background-color 0.15s ease;
}
.icon-btn:active {
  transform: scale(0.94);
}

.reset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
  border-radius: 10px;
  height: 36px;
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 700;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.reset-btn:hover {
  color: #fff;
  border-color: rgba(255, 59, 107, 0.65);
}

.app-subtitle {
  margin-top: 4px;
  font-size: clamp(0.8rem, 2.2vw, 0.94rem);
  color: var(--text-muted);
}

.stats-panel {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.correct-column,
.wrong-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Яскравий неоновий бейдж рангу з обводкою */
.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #0a1124;
  border: 1.5px solid #64748b;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.25);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
  user-select: none;
}

.rank-crown {
  font-size: 0.85rem;
  line-height: 1;
}

.rank-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
}

.rank-pill.is-rank-0 { border-color: #94a3b8; box-shadow: 0 0 10px rgba(148, 163, 184, 0.3); }
.rank-pill.is-rank-1 { border-color: #00ff9d; box-shadow: 0 0 14px rgba(0, 255, 157, 0.5), inset 0 0 8px rgba(0, 255, 157, 0.16); }
.rank-pill.is-rank-2 { border-color: #00e5ff; box-shadow: 0 0 14px rgba(0, 229, 255, 0.55), inset 0 0 8px rgba(0, 229, 255, 0.18); }
.rank-pill.is-rank-3 { border-color: #c084fc; box-shadow: 0 0 16px rgba(192, 132, 252, 0.55), inset 0 0 8px rgba(192, 132, 252, 0.2); }
.rank-pill.is-rank-4 { border-color: #ff47a3; box-shadow: 0 0 16px rgba(255, 71, 163, 0.6), inset 0 0 8px rgba(255, 71, 163, 0.2); }
.rank-pill.is-rank-5 { border-color: #ffd000; box-shadow: 0 0 16px rgba(255, 208, 0, 0.6), inset 0 0 8px rgba(255, 208, 0, 0.2); }
.rank-pill.is-rank-6 { border-color: #ff5733; box-shadow: 0 0 18px rgba(255, 87, 51, 0.65), inset 0 0 8px rgba(255, 87, 51, 0.22); }
.rank-pill.is-rank-rainbow {
  border: 2px solid transparent;
  background:
    linear-gradient(#0a1124, #0a1124) padding-box,
    linear-gradient(90deg, #ff3b6b, #ffb800, #00ff9d, #00f3ff, #b84dff, #ff3b6b) border-box;
  background-size: 100% 100%, 220% 100%;
  animation: rainbowBorder 3s linear infinite;
  box-shadow: 0 0 18px rgba(0, 243, 255, 0.5), 0 0 18px rgba(255, 46, 147, 0.35);
}

@keyframes rainbowBorder {
  0% { background-position: 0 0, 0% 50%; }
  100% { background-position: 0 0, 220% 50%; }
}

.rank-0 { color: #cbd5e1; }
.rank-1 { color: #00ff9d; }
.rank-2 { color: #00e5ff; }
.rank-3 { color: #c084fc; }
.rank-4 { color: #ff47a3; }
.rank-5 { color: #ffd000; }
.rank-6 { color: #ff5733; }
.rank-rainbow {
  background: linear-gradient(90deg, #ff3b6b, #ffb800, #00ff9d, #00f3ff, #b84dff, #ff3b6b);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 2.8s linear infinite;
}

@keyframes rainbowShift {
  0% { background-position: 0% center; }
  100% { background-position: 220% center; }
}

.stat-box {
  position: relative;
  min-width: 106px;
  padding: 8px 14px;
  border-radius: 14px;
  text-align: center;
  background: #080d1a;
  user-select: none;
}

.stat-correct {
  border: 1.5px solid rgba(0, 255, 157, 0.55);
  box-shadow: 0 0 14px rgba(0, 255, 157, 0.14);
}
.stat-wrong {
  border: 1.5px solid rgba(255, 59, 107, 0.55);
  box-shadow: 0 0 14px rgba(255, 59, 107, 0.14);
}

.stat-label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin-bottom: 1px;
}
.stat-correct .stat-label { color: var(--correct); }
.stat-wrong .stat-label { color: var(--wrong); }

.stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
  color: #fff;
}

.stat-box.pulse-correct {
  animation: popGlowCorrect 0.38s ease;
}
.stat-box.shake-wrong {
  animation: cryingBox 0.5s ease;
}

@keyframes popGlowCorrect {
  0% { transform: scale(1); }
  45% { transform: scale(1.1); box-shadow: 0 0 24px rgba(0, 255, 157, 0.65); }
  100% { transform: scale(1); }
}

@keyframes cryingBox {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); box-shadow: 0 0 22px rgba(0, 200, 255, 0.7); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.rank-progress-wrap {
  margin-top: 10px;
}
.rank-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 600;
}
.rank-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.rank-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--theme), var(--theme-secondary));
  transition: width 0.3s ease;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--theme-rgb), 0.35), transparent);
  margin: 12px 0;
}

.op-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.op-btn {
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid rgba(var(--theme-rgb), 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: #cddbf5;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(0.76rem, 2.3vw, 0.9rem);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.op-btn:active {
  transform: scale(0.96);
}
.op-btn.active {
  background: rgba(var(--theme-rgb), 0.2);
  border-color: var(--theme);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(var(--theme-rgb), 0.42);
}

.selector-title {
  font-size: clamp(0.8rem, 2.2vw, 0.92rem);
  font-weight: 700;
  margin-bottom: 8px;
  color: #dbe7ff;
}

.table-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-btn {
  min-width: 44px;
  height: 42px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #dce6fa;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.1s ease, background-color 0.2s ease;
}
.cat-btn:active {
  transform: scale(0.94);
}
.cat-btn.active {
  background: linear-gradient(135deg, var(--theme), var(--theme-secondary));
  color: #050814;
  border-color: transparent;
  box-shadow: 0 0 16px rgba(var(--theme-rgb), 0.6);
}

.cat-mix {
  font-family: 'Montserrat', sans-serif;
  padding: 0 16px;
}

.arena-box {
  margin-top: 14px;
  background: var(--arena-bg);
  border: 2px solid rgba(var(--theme-rgb), 0.48);
  border-radius: 20px;
  padding: clamp(14px, 3vw, 30px) clamp(12px, 2.6vw, 24px);
  box-shadow: inset 0 0 28px rgba(var(--theme-rgb), 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: border-color 0.35s ease;
}

.mode-chip {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--theme);
  background: rgba(var(--theme-rgb), 0.12);
  border: 1px solid rgba(var(--theme-rgb), 0.4);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: clamp(12px, 2.5vw, 20px);
  text-align: center;
}

.equation-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.4vw, 22px);
  flex-wrap: nowrap;
  user-select: none;
}

.eq-num {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.5rem, 10.5vw, 5.4rem);
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 14px rgba(var(--theme-rgb), 0.3);
}

.eq-sign {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.2rem, 9vw, 4.6rem);
  font-weight: 800;
  color: var(--theme);
  text-shadow: 0 0 14px rgba(var(--theme-rgb), 0.75);
}

.eq-equals {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.2rem, 8.5vw, 4.4rem);
  font-weight: 800;
  color: #b7c8eb;
}

.input-wrap {
  display: flex;
  align-items: center;
}

.answer-input {
  width: clamp(98px, 26vw, 185px);
  height: clamp(74px, 19vw, 134px);
  border-radius: 20px;
  border: 3px solid var(--theme);
  background: #0f1830;
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.2rem, 9vw, 4.5rem);
  font-weight: 900;
  text-align: center;
  outline: none;
  box-shadow: 0 0 18px rgba(var(--theme-rgb), 0.35);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  appearance: textfield;
  -moz-appearance: textfield;
}

.answer-input::placeholder {
  color: rgba(190, 210, 245, 0.35);
}

.answer-input:focus {
  box-shadow: 0 0 26px rgba(var(--theme-rgb), 0.65);
}

.answer-input.is-correct {
  border-color: var(--correct);
  background: rgba(0, 255, 157, 0.16);
  box-shadow: 0 0 28px rgba(0, 255, 157, 0.7);
}

.answer-input.is-wrong {
  border-color: var(--wrong);
  background: rgba(255, 59, 107, 0.18);
  box-shadow: 0 0 28px rgba(255, 59, 107, 0.7);
  animation: shakeBox 0.36s ease;
}

@keyframes shakeBox {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-5px); }
}

.feedback-msg {
  min-height: 24px;
  margin-top: 10px;
  font-size: clamp(0.88rem, 2.5vw, 1.08rem);
  font-weight: 700;
  text-align: center;
}
.feedback-msg.ok { color: var(--correct); }
.feedback-msg.err { color: #ff6b8f; }

.actions-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
}

.check-btn {
  min-width: min(280px, 100%);
  height: 52px;
  padding: 0 28px;
  border: none;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--theme), var(--theme-secondary));
  color: #050914;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 0 18px rgba(var(--theme-rgb), 0.45);
  transition: transform 0.1s ease;
  touch-action: manipulation;
}
.check-btn:active {
  transform: scale(0.96);
}

.keypad-toggle-btn {
  height: 52px;
  padding: 0 16px;
  border-radius: 15px;
  border: 1.5px solid rgba(var(--theme-rgb), 0.45);
  background: rgba(255, 255, 255, 0.06);
  color: #e4eeff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.keypad-toggle-btn:active {
  transform: scale(0.96);
}
.keypad-toggle-btn.active {
  background: rgba(var(--theme-rgb), 0.2);
  border-color: var(--theme);
}

.touch-keypad {
  margin-top: 12px;
  width: 100%;
  max-width: 360px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.touch-keypad.hidden {
  display: none;
}

.kp-btn {
  height: 52px;
  border-radius: 13px;
  border: 1.5px solid rgba(var(--theme-rgb), 0.38);
  background: #111c36;
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.07s ease, background-color 0.08s ease;
}
.kp-btn:active,
.kp-btn.is-pressed {
  transform: scale(0.93);
  background: rgba(var(--theme-rgb), 0.35);
}
.kp-clear {
  color: #ffb800;
  border-color: rgba(255, 184, 0, 0.45);
}
.kp-back {
  color: #ff5c87;
  border-color: rgba(255, 59, 107, 0.45);
}

/* Надійна CSS-анімація зірочок */
.flying-star {
  position: fixed;
  font-size: 1.45rem;
  line-height: 1;
  margin-left: -0.7rem;
  margin-top: -0.7rem;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.85);
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  animation: starFly var(--dur, 620ms) cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0ms) forwards;
}

@keyframes starFly {
  0% {
    opacity: 0.3;
    transform: translate3d(0, 0, 0) scale(0.4) rotate(0deg);
  }
  45% {
    opacity: 1;
    transform: translate3d(var(--mx, 0px), var(--my, -60px), 0) scale(1.25) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), var(--dy, -120px), 0) scale(0.35) rotate(360deg);
  }
}

/* Надійна CSS-анімація сліз з лічильника */
.falling-tear {
  position: fixed;
  width: 14px;
  height: 20px;
  margin-left: -7px;
  margin-top: -10px;
  background: radial-gradient(circle at 35% 32%, #ffffff 0%, #70eeff 35%, #00b7ff 75%, #0066ff 100%);
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.9);
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  animation: tearDrop var(--dur, 900ms) cubic-bezier(0.4, 0, 0.85, 0.75) var(--delay, 0ms) forwards;
}

@keyframes tearDrop {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(135deg) scale(0.45);
  }
  18% {
    opacity: 1;
    transform: translate3d(0, 10px, 0) rotate(135deg) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), var(--dy, 135px), 0) rotate(135deg) scale(0.8);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(3, 6, 15, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(160deg, #0f1933, #080d1c);
  border: 2px solid var(--theme);
  border-radius: 24px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 0 42px rgba(var(--theme-rgb), 0.55);
  animation: modalPop 0.32s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.78); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-crown {
  font-size: 3.2rem;
  margin-bottom: 8px;
}

.modal-kicker {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--theme);
  margin-bottom: 8px;
}

.modal-rank-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  font-weight: 900;
  margin-bottom: 10px;
}

.modal-rank-desc {
  color: #c8d6f0;
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 22px;
}

.modal-close-btn {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--theme), var(--theme-secondary));
  color: #040814;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

@media (max-width: 620px) {
  .app-wrapper {
    align-items: flex-start;
    padding: 8px;
  }

  .trainer-card {
    padding: 12px;
    border-radius: 18px;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .brand-block {
    flex: none;
    width: 100%;
  }

  .app-subtitle {
    display: none;
  }

  .stats-panel {
    width: 100%;
    align-items: stretch;
    gap: 8px;
  }

  .correct-column {
    flex: 1.35;
  }

  .wrong-column {
    flex: 1;
    justify-content: flex-end;
  }

  .stat-box {
    width: 100%;
    min-width: 0;
    padding: 7px 10px;
  }

  .divider {
    margin: 10px 0;
  }

  .op-buttons {
    gap: 6px;
    margin-bottom: 10px;
  }

  .op-btn {
    height: 36px;
    font-size: 0.74rem;
    padding: 0 4px;
  }

  .selector-title {
    margin-bottom: 6px;
  }

  .table-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }

  .cat-btn {
    min-width: 0;
    height: 38px;
    padding: 0;
    font-size: 0.92rem;
  }

  .cat-mix {
    grid-column: span 2;
    font-size: 0.82rem;
  }

  .arena-box {
    margin-top: 10px;
    padding: 12px 10px;
    border-radius: 16px;
  }

  .mode-chip {
    margin-bottom: 10px;
    font-size: 0.68rem;
  }

  .feedback-msg {
    min-height: 20px;
    margin-top: 8px;
    font-size: 0.86rem;
  }

  .actions-row {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 8px;
  }

  .check-btn,
  .keypad-toggle-btn {
    min-width: 0;
    width: 100%;
    height: 46px;
    padding: 0 10px;
    font-size: 0.92rem;
  }

  .keypad-toggle-btn {
    font-size: 0.8rem;
  }

  .touch-keypad {
    margin-top: 10px;
    gap: 6px;
  }

  .kp-btn {
    height: 46px;
    font-size: 1.28rem;
  }
}