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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background: #0a0e27;
  color: #e0e0e0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.back-link {
  align-self: flex-start;
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 16px;
}
.back-link:hover {
  color: #ff8fab;
}

.game-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ff6b9d 0%, #ffd93d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hud {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 16px;
}

.stat {
  flex: 1;
  background: #1a1f3a;
  border: 1px solid #2d3548;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.stat .label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat span:last-child {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.board-wrap {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 5;
  touch-action: none;
}

#board {
  width: 100%;
  height: 100%;
  background: #12172e;
  border: 1px solid #2d3548;
  border-radius: 16px;
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: rgba(10, 14, 39, 0.9);
  border-radius: 16px;
  padding: 24px;
}

.overlay.hidden {
  display: none;
}

#overlay-title {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
}

#overlay-message {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 8px;
  max-width: 260px;
}

#overlay-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff6b9d 0%, #ff8fab 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.35);
}

#overlay-btn:active {
  transform: translateY(1px);
}
