/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: #1a1a2e;
  background-image: radial-gradient(circle at 30% 70%, #16213e 0%, #1a1a2e 60%);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: #fff;
  user-select: none;
  overflow-x: hidden;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, #ff6b35, #e85d2a);
  color: #fff; font-family: 'Nunito', sans-serif; flex-shrink: 0;
}
.btn-back {
  color: #fff; text-decoration: none; font-weight: 700; font-size: 0.85rem;
  background: rgba(255,255,255,0.2); padding: 0.3rem 0.7rem; border-radius: 999px;
  transition: background 0.2s; white-space: nowrap;
}
.btn-back:hover { background: rgba(255,255,255,0.35); }
.game-title { font-size: 1.1rem; font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; }
.stats { display: flex; gap: 0.8rem; font-size: 0.9rem; font-weight: 700; opacity: 0.95; white-space: nowrap; }

.btn {
  padding: 0.35rem 1rem; border: none; border-radius: 999px; font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.96); }
.btn-orange { background: #e94560; color: #fff; padding: 0.5rem 1.5rem; font-size: 1rem; border: none; border-radius: 999px; font-family: 'Nunito', sans-serif; font-weight: 700; cursor: pointer; }
.btn-orange:hover { opacity: 0.88; }

.game-container {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; padding: 0.8rem; gap: 0.5rem;
}

.board-area { flex: 1; display: flex; align-items: center; justify-content: center; }

/* ===== BOARD ===== */
.numble-board {
  display: flex; flex-direction: column; gap: 6px;
  max-width: 400px; width: 100%;
}

.numble-row {
  display: flex; gap: 4px; justify-content: center;
}

.numble-cell {
  width: 42px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  transition: all 0.3s;
}
.numble-cell.active {
  border-color: rgba(255,255,255,0.6);
}
.numble-cell.correct {
  background: #538d4e; border-color: #538d4e; color: #fff;
  animation: flip 0.4s ease;
}
.numble-cell.present {
  background: #b59f3b; border-color: #b59f3b; color: #fff;
  animation: flip 0.4s ease;
}
.numble-cell.absent {
  background: #3a3a5c; border-color: #3a3a5c; color: rgba(255,255,255,0.6);
  animation: flip 0.4s ease;
}
.numble-cell.filled {
  border-color: rgba(255,255,255,0.5);
  animation: pop 0.1s ease;
}

@keyframes flip {
  0% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* ===== KEYBOARD ===== */
.numble-keyboard {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  padding-bottom: 0.5rem; width: 100%; max-width: 420px;
}

.kb-row {
  display: flex; gap: 4px; justify-content: center;
}

.kb-key {
  min-width: 34px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; font-family: 'Nunito', sans-serif;
  background: rgba(255,255,255,0.2); color: #fff;
  border: none; border-radius: 6px; cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.kb-key:hover { background: rgba(255,255,255,0.3); }
.kb-key:active { transform: scale(0.95); }
.kb-key.wide { min-width: 60px; font-size: 0.75rem; }
.kb-key.correct { background: #538d4e; }
.kb-key.present { background: #b59f3b; }
.kb-key.absent { background: #3a3a5c; color: rgba(255,255,255,0.4); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal-content {
  background: #1e1e3a; border-radius: 16px; padding: 2rem 2.5rem; text-align: center;
  animation: popIn 0.3s ease; border: 2px solid rgba(255,255,255,0.1); max-width: 90vw;
}
@keyframes popIn { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icon { font-size: 3.5rem; margin-bottom: 0.5rem; }
.modal-content h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.3rem; }
.modal-content p { font-size: 0.95rem; color: rgba(255,255,255,0.7); margin-bottom: 0.3rem; }
.modal-stats { font-size: 1.1rem; font-weight: 700; color: #fff; }
.modal-content .btn { margin-top: 1rem; }

@media (max-width: 480px) {
  .topbar { padding: 0.4rem 0.6rem; }
  .game-title { font-size: 0.9rem; }
  .stats { font-size: 0.8rem; gap: 0.5rem; }
  .numble-cell { width: 36px; height: 42px; font-size: 1rem; }
  .kb-key { min-width: 28px; height: 40px; font-size: 0.9rem; }
  .kb-key.wide { min-width: 50px; font-size: 0.7rem; }
}

/* ===== SEO GAME INFO SECTION ===== */
.game-info {
  max-width: 780px;
  margin: 1rem auto;
  padding: 1rem 1.2rem;
  background: rgba(0,0,0,0.15);
  border-radius: 12px;
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  line-height: 1.6;
}
.game-info h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.5rem; }
.game-info h3 { font-size: 0.95rem; font-weight: 700; margin: 0.8rem 0 0.3rem; }
.game-info ul { padding-left: 1.2rem; }
.game-info li { margin-bottom: 0.2rem; }
