.game-main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.hud-item span {
  font-size: 1.1rem;
  color: var(--text);
  font-weight: 700;
}

.stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  touch-action: none;
}

.layout-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: center;
}

.board-wrap {
  position: relative;
  flex: 1 1 280px;
  max-width: 280px;
  aspect-ratio: 1 / 2;
  background: #10142a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#game {
  width: 100%;
  height: 100%;
  display: block;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 96px;
  flex-shrink: 0;
}

.panel-box {
  background: var(--panel);
  border-radius: 10px;
  padding: 0.5rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: opacity 0.15s ease;
}

.panel-box.disabled {
  opacity: 0.4;
}

.panel-box h3 {
  margin: 0 0 0.35rem;
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.panel-box canvas {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 24, 0.85);
  backdrop-filter: blur(2px);
}

.overlay.hidden {
  display: none;
}

.overlay-panel {
  text-align: center;
  padding: 1.5rem;
  max-width: 340px;
}

.overlay-panel h2 {
  margin: 0 0 0.75rem;
}

.overlay-panel p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
}

.overlay-panel button {
  background: var(--accent);
  color: #1a1200;
  border: none;
  padding: 0.7rem 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.overlay-panel button:active {
  transform: scale(0.97);
}

.touch-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  max-width: 280px;
  margin: 0.85rem 0 0;
}

.touch-controls button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.85rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  touch-action: manipulation;
  user-select: none;
}

.touch-controls button:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.08);
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.75rem 0 0;
  text-align: center;
}

.how-to-play {
  max-width: 420px;
  width: 100%;
  margin-top: 1rem;
}

.how-to-play h2 {
  font-size: 1.1rem;
}

.how-to-play ul {
  color: var(--muted);
  line-height: 1.7;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}
