/**
 * Estilos para Ecuación Matemática Oculta
 * fijate.com/tools/ecuacion-matematica-oculta
 */

:root,
[data-theme="dark"] {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema oscuro corporativo por defecto */
  --bg-page: #090d16;
  --bg-card: #111827;
  --bg-subtle: #1a243b;
  --bg-input: #131b2a;
  --border-color: #273549;
  --border-focus: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --primary: #38bdf8;
  --primary-light: rgba(56, 189, 248, 0.12);

  /* Colores de estado del juego (estándar oscuro) */
  --color-correct: #10b981;
  --color-correct-border: #059669;
  --color-present: #8b5cf6;
  --color-present-border: #7c3aed;
  --color-absent: #334155;
  --color-absent-border: #1e293b;
  --color-tile-empty: #131b2a;
  --color-tile-border: #273549;
  --color-tile-filled-border: #60a5fa;

  /* Teclado virtual oscuro */
  --key-bg: #273549;
  --key-text: #f8fafc;
  --key-bg-hover: #334155;
  --key-bg-active: #475569;

  /* Sombras y radios */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* Modo claro corporativo */
[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --primary: #0284c7;
  --primary-light: rgba(2, 132, 199, 0.08);

  --color-correct: #059669;
  --color-correct-border: #047857;
  --color-present: #7c3aed;
  --color-present-border: #6d28d9;
  --color-absent: #64748b;
  --color-absent-border: #475569;
  --color-tile-empty: #ffffff;
  --color-tile-border: #cbd5e1;
  --color-tile-filled-border: #3b82f6;

  --key-bg: #e2e8f0;
  --key-text: #0f172a;
  --key-bg-hover: #cbd5e1;
  --key-bg-active: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Modo alto contraste (daltónico) */
body.high-contrast {
  --color-correct: #f97316;
  --color-correct-border: #ea580c;
  --color-present: #38bdf8;
  --color-present-border: #0284c7;
}

[data-theme="light"] body.high-contrast {
  --color-correct: #ea580c;
  --color-correct-border: #c2410c;
  --color-present: #0284c7;
  --color-present-border: #0369a1;
}

/* Reseteo y layout global conforme a reglas canónicas */
html {
  overflow-x: clip;
  max-width: 100%;
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: border-box;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.main-wrapper.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.brand-info {
  min-width: 0;
  max-width: 100%;
}

.brand-title,
.brand-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* TARJETA PRINCIPAL DEL JUEGO */
.game-container-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Barra de herramientas superior */
.game-toolbar {
  width: 100%;
  max-width: 580px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toolbar-pill-group {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.btn-tool-tab,
.btn-length-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-tool-tab:hover,
.btn-length-toggle:hover {
  color: var(--text-main);
}

.btn-tool-tab.active,
.btn-length-toggle.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn-icon-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-tool:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--text-muted);
}

/* Indicador de estado */
.game-status-bar {
  margin-bottom: 1.25rem;
  text-align: center;
}

.game-status-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
}

/* TABLERO DE CASILLAS */
.board-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 1.5rem;
}

.game-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  box-sizing: border-box;
}

.board-row {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 8), 1fr);
  gap: 6px;
}

.board-tile {
  width: clamp(32px, 5.5vw, 54px);
  height: clamp(32px, 5.5vw, 54px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: clamp(1.2rem, 3.2vw, 1.85rem);
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--color-tile-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-tile-empty);
  color: var(--text-main);
  user-select: none;
  box-sizing: border-box;
  transition: transform 0.1s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.board-tile[data-state="filled"] {
  border-color: var(--color-tile-filled-border);
  background-color: var(--bg-subtle);
  animation: pop 0.1s ease-in-out;
}

.board-tile[data-state="correct"] {
  background-color: var(--color-correct);
  border-color: var(--color-correct-border);
  color: #ffffff;
}

.board-tile[data-state="present"] {
  background-color: var(--color-present);
  border-color: var(--color-present-border);
  color: #ffffff;
}

.board-tile[data-state="absent"] {
  background-color: var(--color-absent);
  border-color: var(--color-absent-border);
  color: rgba(255, 255, 255, 0.7);
}

/* Animaciones */
@keyframes pop {
  0% {
    transform: scale(0.92);
  }

  50% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-5px);
  }

  40%,
  80% {
    transform: translateX(5px);
  }
}

.board-row.shake {
  animation: shake 0.35s ease-in-out;
}

.board-tile.flip {
  animation: flipTile 0.44s ease-in-out;
}

@keyframes flipTile {
  0% {
    transform: rotateX(0deg);
  }

  50% {
    transform: rotateX(90deg);
  }

  100% {
    transform: rotateX(0deg);
  }
}

/* TECLADO VIRTUAL */
.keyboard-container {
  width: 100%;
  max-width: 580px;
  display: flex;
  justify-content: center;
}

.virtual-keyboard {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  touch-action: manipulation;
}

.keyboard-key {
  flex: 1 1 0%;
  min-width: 0;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background-color: var(--key-bg);
  color: var(--key-text);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, transform 0.08s ease, color 0.15s ease;
  box-sizing: border-box;
  padding: 0;
}

.keyboard-key:hover {
  background-color: var(--key-bg-hover);
}

.keyboard-key:active {
  transform: translateY(2px);
  background-color: var(--key-bg-active);
}

.keyboard-key.key-wide {
  flex: 1.7 1 0%;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
}

.keyboard-key.key-action-enter {
  flex: 2.1 1 0%;
  background-color: #3b82f6;
  color: #ffffff;
}

.keyboard-key.key-action-enter:hover {
  background-color: #2563eb;
}

.keyboard-key[data-state="correct"] {
  background-color: var(--color-correct) !important;
  color: #ffffff !important;
}

.keyboard-key[data-state="present"] {
  background-color: var(--color-present) !important;
  color: #ffffff !important;
}

.keyboard-key[data-state="absent"] {
  background-color: var(--color-absent) !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

/* NOTIFICACIONES TOAST */
.toast-container {
  position: fixed;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  z-index: 9999;
  pointer-events: none;
}

.game-toast {
  background: #1e293b;
  color: #f8fafc;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease, transform 0.25s ease;
  border: 1px solid var(--border-color);
}

.game-toast.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* CANVAS CONFETI */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
  display: none;
}

/* MODALES ACCESIBLES */
.app-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.app-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.app-modal.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-icon-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.btn-icon-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-modal-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
  width: 100%;
}

.btn-modal-action:hover {
  background: #2563eb;
}

.btn-modal-action:active {
  transform: translateY(1px);
}

/* Detalles específicos de modales */
.help-example-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
}

.help-example-label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.help-example-row {
  display: flex;
  gap: 4px;
  margin-bottom: 1rem;
  justify-content: center;
}

.help-example-row .board-tile {
  width: 36px;
  height: 36px;
  font-size: 1.15rem;
}

.help-legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.legend-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.78rem;
  margin-right: 6px;
}

.legend-badge.state-correct {
  background-color: var(--color-correct);
}

.legend-badge.state-present {
  background-color: var(--color-present);
}

.legend-badge.state-absent {
  background-color: var(--color-absent);
}

.help-rules-box {
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.help-rules-box h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--text-main);
}

.help-rules-list {
  padding-left: 1.25rem;
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Estadísticas KPIs */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-kpi-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.stat-kpi-box .kpi-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-kpi-box .kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.stat-dist-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-dist-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.dist-num {
  width: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.dist-bar-wrapper {
  flex: 1;
  background: var(--bg-subtle);
  border-radius: 4px;
  height: 22px;
  display: flex;
  overflow: hidden;
}

.dist-bar {
  background: #3b82f6;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  border-radius: 4px;
  min-width: 24px;
  transition: width 0.3s ease;
}

.stat-dist-row.current-attempt .dist-bar {
  background: var(--color-correct);
}

.dist-val {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Modal fin de partida */
.modal-gameover-card .gameover-desc {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: var(--text-main);
}

.gameover-solution-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.solution-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.solution-text {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-correct);
  letter-spacing: 0.05em;
}

/* Configuración switches */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
}

.setting-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.setting-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.switch-control {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.2s;
  border-radius: 26px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.switch-control input:checked+.switch-slider {
  background-color: #3b82f6;
}

.switch-control input:checked+.switch-slider:before {
  transform: translateX(20px);
}

/* Formatos de texto SEO / Fórmulas y FAQs */
.seo-faq-heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.75rem 0 1rem 0;
}

.seo-faq-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.seo-faq-item[open] {
  border-color: var(--primary);
  background: var(--bg-input);
}

.seo-faq-question {
  padding: 1rem 1.25rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  user-select: none;
  min-height: 48px;
  list-style: none;
}

.seo-faq-question::-webkit-details-marker {
  display: none;
}

.seo-faq-icon {
  color: var(--text-muted);
  transition: transform 0.25s ease, color 0.2s ease;
  flex-shrink: 0;
}

.seo-faq-item[open] .seo-faq-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.seo-faq-answer {
  padding: 0 1.25rem 1.2rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

.seo-faq-answer p {
  margin: 0;
}

[data-theme="light"] .seo-faq-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .seo-faq-item[open] {
  background: #ffffff;
  border-color: #0284c7;
}

[data-theme="light"] .seo-faq-question {
  color: #0f172a;
}

[data-theme="light"] .seo-faq-answer {
  color: #475569;
  border-top-color: #f1f5f9;
}

.formula-box {
  background: var(--bg-subtle);
  border-left: 3px solid #3b82f6;
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.75rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-main);
}

.text-mono {
  font-family: var(--font-mono);
}

/* RESPONSIVE */
@media (max-width: 640px) {
  .main-wrapper.tool-layout {
    margin: 1rem auto 2rem;
    padding: 0 0.5rem;
  }

  .game-container-card {
    padding: 1rem 0.5rem;
    border-radius: var(--radius-md);
  }

  .game-toolbar {
    gap: 0.5rem;
  }

  .toolbar-left {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .board-row {
    gap: 4px;
  }

  .game-board {
    gap: 4px;
    padding: 2px;
  }

  .board-tile {
    width: clamp(28px, 9.6vw, 44px);
    height: clamp(28px, 9.6vw, 44px);
    font-size: clamp(1.1rem, 4.5vw, 1.45rem);
    border-width: 1.5px;
  }

  .keyboard-row {
    gap: 3px;
  }

  .keyboard-key {
    height: 44px;
    font-size: 1.05rem;
  }

  .keyboard-key.key-wide {
    font-size: 0.78rem;
  }

  .stats-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}