* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #f8fafc;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.game-shell {
  width: 100%;
  max-width: 460px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.hud { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
h1 { margin: 0; font-size: 22px; }
.sub { font-size: 12.5px; color: #94a3b8; margin-top: 2px; }
.stats { display: flex; gap: 12px; font-size: 14px; color: #cbd5e1; }
.mode-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 10px; }
.mode-btn, .action-btn {
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.mode-btn.active { background: #2563eb; border-color: #3b82f6; color: #fff; }
.instructions { font-size: 12.5px; color: #94a3b8; margin: 0 0 14px; text-align: center; }
.board-area { display: flex; justify-content: center; }
.grid-stage {
  display: grid;
  grid-template-columns: 34px repeat(4, 58px) 34px;
  grid-template-rows: 34px repeat(4, 58px) 34px;
  gap: 6px;
  align-items: center;
  justify-items: center;
  touch-action: none;
}
@media (max-width: 400px) {
  .grid-stage {
    grid-template-columns: 28px repeat(4, 48px) 28px;
    grid-template-rows: 28px repeat(4, 48px) 28px;
    gap: 5px;
  }
}
.arrow-btn {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #93c5fd;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.arrow-btn:hover { background: #334155; }
.tile {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #0f172a;
  user-select: none;
  transition: transform 0.12s ease;
}
.tile-0 { background: #38bdf8; }
.tile-1 { background: #34d399; }
.tile-2 { background: #fbbf24; }
.tile-3 { background: #fb7185; }
.status-banner {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid #10b981;
  color: #a7f3d0;
  font-size: 13.5px;
  text-align: center;
}
.actions { margin-top: 10px; display: flex; justify-content: center; }
.action-btn { padding: 10px 16px; font-size: 13.5px; background: #10b981; color: #052e16; border-color: #34d399; }
