:root {
  --bg: #070b14;
  --panel: #101828;
  --line: #243044;
  --text: #e8eef8;
  --muted: #8aa0b8;
  --accent: #3ee0c4;
  --warn: #ff6b6b;
}

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

html, body {
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 20% -10%, #16324a 0%, transparent 55%),
    radial-gradient(900px 500px at 90% 10%, #2a1540 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.header {
  text-align: center;
  margin-bottom: 18px;
}

.header h1 {
  letter-spacing: 0.35em;
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
}

.tagline {
  margin-top: 6px;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.layout {
  display: grid;
  grid-template-columns: 180px 300px 220px;
  gap: 18px;
  justify-content: center;
  align-items: start;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: rgba(16, 24, 40, 0.88);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.card h2 {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

#next, #game {
  display: block;
  background: #05080f;
  border-radius: 8px;
}

#next {
  margin: 0 auto;
}

.stats {
  display: grid;
  gap: 10px;
}

.stat {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
}

.label {
  color: var(--muted);
  font-size: 13px;
}

.board-wrap {
  position: relative;
  width: 300px;
  height: 600px;
  border: 2px solid #31455e;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(62, 224, 196, 0.12);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(2px);
}

.overlay.hidden {
  display: none;
}

.overlay-box {
  text-align: center;
  padding: 18px;
}

.overlay-box h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.overlay-box p {
  color: var(--muted);
  margin-bottom: 16px;
}

button {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #47ecd0, #1fb89e);
  color: #04231d;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.06);
}

.keys {
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #1b2738;
  color: var(--text);
  border: 1px solid #33465e;
  text-align: center;
}

.pad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pad button.wide {
  grid-column: 1 / -1;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .panel {
    width: min(300px, 100%);
  }
}
