/* ---------- Lobby ---------- */

.player.empty {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
}

.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  align-items: center;
  font-size: 0.95rem;
}

kbd {
  display: inline-block;
  min-width: 1.8em;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: var(--surface);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

/* ---------- Game ---------- */

.game aside .keys {
  grid-template-columns: 1fr;
  font-size: 0.85rem;
}

.game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 760px) {
  .game {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 800;
}

.hud-timer {
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}

.hud-timer.sudden {
  color: var(--bad);
  animation: blink 0.8s steps(2, start) infinite;
}

@keyframes blink {
  to { opacity: 0.45; }
}

.board {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.board canvas {
  display: block;
  border-radius: 12px;
  box-shadow: var(--shadow);
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-align: center;
}

.overlay-text {
  padding: 14px 24px;
  border-radius: 16px;
  background: rgb(20 18 15 / 78%);
  color: #fff;
  font-size: clamp(1.3rem, 5vw, 2rem);
  font-weight: 900;
  animation: pop 0.35s ease-out;
}

.overlay-text.big {
  font-size: clamp(3rem, 14vw, 5.5rem);
  padding: 4px 32px;
  background: transparent;
  color: #fff;
  text-shadow: 0 4px 0 rgb(0 0 0 / 35%), 0 0 24px rgb(0 0 0 / 40%);
}

.overlay-text small {
  display: block;
  font-size: 0.6em;
  font-weight: 700;
  opacity: 0.85;
}

.wins {
  color: var(--warn);
  letter-spacing: 1px;
  white-space: nowrap;
}

.stats {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---------- Touch controls ---------- */

.touch {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.touch.on {
  display: flex;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 58px);
  grid-template-rows: repeat(3, 58px);
  gap: 4px;
  touch-action: none;
}

.dpad button,
.bomb-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: var(--shadow);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.dpad button {
  border-radius: 14px;
}

.dpad button.active {
  background: var(--accent);
  color: var(--accent-text);
}

.dpad [data-dir="up"] { grid-area: 1 / 2; }
.dpad [data-dir="left"] { grid-area: 2 / 1; }
.dpad [data-dir="right"] { grid-area: 2 / 3; }
.dpad [data-dir="down"] { grid-area: 3 / 2; }

.bomb-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent);
  border-color: var(--accent);
  font-size: 2.4rem;
}

.bomb-btn:active {
  transform: scale(0.94);
}
