/* ===================================================
   LEXO v2.0 — Estilos completos
   =================================================== */

/* ===== VARIABLES ===== */
:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface2: #242424;
  --surface3: #2c2c2c;
  --border: #333;
  --border2: #444;
  --text: #f0f0f0;
  --text-dim: #888;
  --text-dimmer: #555;
  --accent: #e8ff00;
  --accent-dim: rgba(232,255,0,0.12);
  --accent2: #ff4d6d;
  --accent3: #00d4ff;
  --correct: #4caf50;
  --correct-dim: rgba(76,175,80,0.15);
  --present: #ff9800;
  --present-dim: rgba(255,152,0,0.15);
  --absent: #2e2e2e;
  --absent-text: #666;
  --radius: 8px;
  --radius-lg: 14px;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --shadow-accent: 0 0 40px rgba(232,255,0,0.18);
  --shadow-correct: 0 0 24px rgba(76,175,80,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== PANTALLAS ===== */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow-y: auto;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ===== BIENVENIDA ===== */
.welcome-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 55%, rgba(232,255,0,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(0,212,255,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255,77,109,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.welcome-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 32px 20px 28px;
  max-width: 460px;
  width: 100%;
}

.logo-wrap { text-align: center; position: relative; }

.logo-badge {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.logo {
  font-family: var(--font-display);
  font-size: clamp(64px, 16vw, 108px);
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -4px;
  text-shadow: 0 0 80px rgba(232,255,0,0.25), 0 0 160px rgba(232,255,0,0.1);
}

.tagline {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 6px;
}

/* Rules box */
.rules-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.rule-tile {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}
.correct-demo { background: var(--correct); }
.present-demo { background: var(--present); }
.absent-demo  { background: var(--absent); color: var(--absent-text); }

/* Difficulty */
.difficulty-wrap { width: 100%; }
.label {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.diff-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.diff-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius);
  padding: 12px 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.7;
  text-align: center;
  transition: all 0.2s;
}
.diff-btn small { font-weight: 400; font-size: 8px; color: var(--text-dimmer); display: block; }
.diff-btn:hover { border-color: var(--accent); color: var(--text); }
.diff-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.diff-btn.active small { color: rgba(232,255,0,0.6); }

/* Botones bienvenida */
.welcome-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; }

.btn-start {
  width: 100%;
  padding: 17px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-accent);
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 8px 48px rgba(232,255,0,0.4); }
.btn-start:active { transform: translateY(0); }

.btn-records-welcome {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-records-welcome:hover { border-color: var(--text-dim); color: var(--text); }

/* ===== HEADER JUEGO ===== */
.game-header {
  width: 100%;
  max-width: 500px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0;
  flex-shrink: 0;
}
.header-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.game-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 3px;
}
.stats-inline {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.sep { margin: 0 4px; }
.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: var(--radius);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--accent); background: var(--accent-dim); }

/* ===== ÁREA DE JUEGO ===== */
#screen-game { justify-content: flex-start; gap: 0; padding-bottom: 12px; }

.game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 500px;
  padding: 10px 16px 0;
  gap: 10px;
}

#attempts-left-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.attempt-dots { display: flex; gap: 5px; }
.attempt-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transition: background 0.3s, transform 0.2s;
}
.attempt-dot.used {
  background: var(--absent);
  transform: scale(0.8);
}

/* ===== GRILLA ===== */
.grid { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.grid-row { display: flex; gap: 5px; }

.tile {
  width: 56px; height: 56px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  text-transform: uppercase;
  transition: border-color 0.1s, transform 0.1s;
  position: relative;
  overflow: hidden;
}

.tile.size-4 { width: 62px; height: 62px; font-size: 28px; }
.tile.size-5 { width: 54px; height: 54px; font-size: 25px; }
.tile.size-6 { width: 48px; height: 48px; font-size: 21px; }
.tile.size-7 { width: 42px; height: 42px; font-size: 18px; }

.tile.filled { border-color: #666; }
.tile.active-row { border-color: var(--text-dim); }

.tile.correct {
  background: var(--correct);
  border-color: var(--correct);
  color: #fff;
  animation: flip 0.5s ease forwards;
  box-shadow: var(--shadow-correct);
}
.tile.present {
  background: var(--present);
  border-color: var(--present);
  color: #fff;
  animation: flip 0.5s ease forwards;
}
.tile.absent {
  background: var(--absent);
  border-color: var(--absent);
  color: var(--absent-text);
  animation: flip 0.5s ease forwards;
}

.tile.pop { animation: pop 0.15s ease; }
.tile.shake { animation: shake 0.4s ease; }
.tile.win-dance { animation: win-dance 0.6s ease forwards; }

/* ===== ANIMACIONES TILES ===== */
@keyframes flip {
  0%   { transform: rotateX(0deg); }
  50%  { transform: rotateX(-90deg); opacity: 0.5; }
  100% { transform: rotateX(0deg); }
}
@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.13); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%  { transform: translateX(-7px); }
  40%  { transform: translateX(7px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
}
@keyframes win-dance {
  0%   { transform: translateY(0) scale(1); }
  25%  { transform: translateY(-12px) scale(1.05); }
  50%  { transform: translateY(0) scale(1); }
  75%  { transform: translateY(-6px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

/* ===== MENSAJE ===== */
.message {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 12px;
  letter-spacing: 1px;
  text-align: center;
  transition: opacity 0.3s;
  min-height: 38px;
  width: 100%;
  max-width: 380px;
}
.message.hidden { opacity: 0; pointer-events: none; }
.message.error   { border-color: var(--accent2); color: var(--accent2); }
.message.success { border-color: var(--correct); color: var(--correct); }
.message.info    { border-color: var(--present); color: var(--present); }

/* ===== TECLADO ===== */
.keyboard { width: 100%; display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.kb-row { display: flex; justify-content: center; gap: 4px; }

.key {
  min-width: 32px; height: 50px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  letter-spacing: 0.5px;
}
.key:active { transform: scale(0.92); }
.key.wide { min-width: 50px; font-size: 10px; }

.key.correct { background: var(--correct); border-color: var(--correct); color: #fff; }
.key.present { background: var(--present); border-color: var(--present); color: #fff; }
.key.absent  { background: var(--absent);  border-color: var(--absent);  color: var(--absent-text); }

/* ===== RESULTADO ===== */
#screen-result {
  background: radial-gradient(ellipse at center top, rgba(232,255,0,0.04) 0%, transparent 60%);
  justify-content: flex-start;
  overflow-y: auto;
  padding-bottom: 20px;
}

.result-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px 20px 24px;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

.result-emoji {
  font-size: 58px;
  animation: bounce-in 0.5s ease;
}
@keyframes bounce-in {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.result-level-badge {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 5px 14px;
  border-radius: 20px;
  text-transform: uppercase;
}

#result-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 10vw, 52px);
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -1px;
  line-height: 1;
}
#result-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: -8px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--accent);
}
.stat-label { font-size: 8px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }

.word-reveal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 12px;
  color: var(--text-dim);
  width: 100%;
  letter-spacing: 1px;
}
.word-reveal span {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}

/* ===== COMPARTIR ===== */
.share-section { width: 100%; }
.share-label {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text-dimmer);
  text-transform: uppercase;
  margin-bottom: 10px;
  text-align: left;
}

.share-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}
.share-btn .share-icon { font-size: 18px; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.share-wa:hover { border-color: #25D366; color: #25D366; }
.share-tw:hover { border-color: #1DA1F2; color: #1DA1F2; }
.share-tg:hover { border-color: #0088cc; color: #0088cc; }
.share-cp:hover { border-color: var(--accent); color: var(--accent); }

/* ===== BOTONES RESULTADO ===== */
.result-btns { display: flex; flex-direction: column; gap: 8px; width: 100%; }

.btn-next {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 24px rgba(232,255,0,0.25);
}
.btn-next:hover { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(232,255,0,0.35); }
.btn-menu {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-menu:hover { border-color: var(--text-dim); color: var(--text); }

/* ===== PISTA (hint) ===== */
.hint-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.hint-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 16px 16px 12px 12px;
  padding: 28px 24px 32px;
  max-width: 460px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slide-up 0.25s ease;
}
@keyframes slide-up {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.hint-title { font-family: var(--font-display); font-size: 19px; font-weight: 800; color: var(--accent); }
.hint-text  { font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.hint-cost  { font-size: 10px; color: var(--accent2); letter-spacing: 1px; }
.hint-close {
  width: 100%;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.hint-close:hover { border-color: var(--accent); }

/* ===== MODAL (base) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}

.modal-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 460px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 2px;
}

.modal-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.modal-close:hover { border-color: var(--accent2); color: var(--accent2); }

/* ===== RÉCORDS ===== */
.records-content { display: flex; flex-direction: column; gap: 16px; }

.rec-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.rec-diff-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.rec-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.rec-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--surface2);
  border-radius: 6px;
  padding: 10px 6px;
}
.rec-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}
.rec-lbl { font-size: 7px; color: var(--text-dimmer); letter-spacing: 0.5px; text-transform: uppercase; text-align: center; }

.btn-clear-records {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dimmer);
  padding: 10px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-transform: uppercase;
}
.btn-clear-records:hover { border-color: var(--accent2); color: var(--accent2); }

/* ===== TUTORIAL ===== */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 16px;
}

.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(2px);
}

.tutorial-card {
  position: relative;
  z-index: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 20px 20px 14px 14px;
  padding: 24px 24px 28px;
  max-width: 460px;
  width: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.tutorial-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tut-emoji {
  font-size: 32px;
  flex-shrink: 0;
  animation: tut-pop 0.4s ease;
}
@keyframes tut-pop {
  0%  { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  80% { transform: scale(1.1) rotate(3deg); }
  100%{ transform: scale(1) rotate(0deg); opacity: 1; }
}

.tut-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tut-progress-track {
  width: 100%;
  height: 3px;
  background: var(--surface3);
  border-radius: 3px;
  overflow: hidden;
}

.tut-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tut-step-count {
  font-size: 9px;
  color: var(--text-dimmer);
  letter-spacing: 1px;
}

.tut-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.tut-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Demo de tiles en tutorial */
.tut-demo {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 10px 0 4px;
  min-height: 52px;
  flex-wrap: wrap;
}

.tut-tile {
  width: 44px; height: 44px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  animation: tut-reveal 0.4s ease both;
}
.tut-tile.correct  { background: var(--correct); box-shadow: 0 0 16px rgba(76,175,80,0.4); }
.tut-tile.present  { background: var(--present); box-shadow: 0 0 16px rgba(255,152,0,0.4); }
.tut-tile.absent   { background: var(--absent); color: var(--absent-text); }
.tut-tile.empty    { background: var(--surface3); border: 2px solid var(--border2); }

.tut-tile:nth-child(1) { animation-delay: 0.05s; }
.tut-tile:nth-child(2) { animation-delay: 0.12s; }
.tut-tile:nth-child(3) { animation-delay: 0.19s; }
.tut-tile:nth-child(4) { animation-delay: 0.26s; }
.tut-tile:nth-child(5) { animation-delay: 0.33s; }

@keyframes tut-reveal {
  0%   { transform: scale(0.7) rotateX(-30deg); opacity: 0; }
  100% { transform: scale(1) rotateX(0deg);     opacity: 1; }
}

/* Botones tutorial */
.tut-actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.tut-skip {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dimmer);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.tut-skip:hover { border-color: var(--text-dim); color: var(--text-dim); }

.tut-next {
  flex: 2;
  padding: 13px;
  background: var(--accent);
  border: none;
  color: #000;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(232,255,0,0.25);
}
.tut-next:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(232,255,0,0.35); }

/* ===== MANO FANTASMA ===== */
.ghost-hand {
  position: fixed;
  z-index: 600;
  font-size: 28px;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(232,255,0,0.6));
  transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              top  0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease;
}

/* ===== HIGHLIGHT DE TECLADO (tutorial) ===== */
.kb-highlight {
  position: relative;
}
.kb-highlight::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px rgba(232,255,0,0.4);
  animation: pulse-border 1s ease infinite;
  pointer-events: none;
}
@keyframes pulse-border {
  0%,100% { box-shadow: 0 0 12px rgba(232,255,0,0.3); }
  50%      { box-shadow: 0 0 28px rgba(232,255,0,0.6); }
}

/* ===== BADGE TRENDING ===== */
.trending-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--accent2);
  color: #fff;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  z-index: 2;
}

/* ===== RESPONSIVE ===== */
@media (max-height: 700px) {
  .tile.size-4, .tile.size-5 { width: 46px; height: 46px; font-size: 20px; }
  .tile.size-6 { width: 42px; height: 42px; font-size: 18px; }
  .tile.size-7 { width: 38px; height: 38px; font-size: 15px; }
  .key { height: 44px; }
  .game-area { gap: 7px; }
  .welcome-content { gap: 16px; padding: 20px 16px; }
  .logo { font-size: clamp(52px, 14vw, 88px); }
}

@media (max-width: 380px) {
  .diff-btns { grid-template-columns: repeat(2, 1fr); }
  .tile.size-4 { width: 56px; height: 56px; }
  .tile.size-5 { width: 48px; height: 48px; }
  .tile.size-6 { width: 42px; height: 42px; }
  .tile.size-7 { width: 37px; height: 37px; font-size: 15px; }
  .key { min-width: 28px; font-size: 10px; }
  .key.wide { min-width: 44px; }
  .share-btns { grid-template-columns: repeat(2, 1fr); }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
  .rec-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
