* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #0f1420;
  color: #e8ecf4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: 24px 12px 48px;
}

.wrap {
  width: 100%;
  max-width: 520px;
}

header h1 {
  margin: 0 0 4px;
  font-size: 22px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tag {
  font-size: 11px;
  font-weight: 500;
  color: #8a93a8;
  border: 1px solid #2a3142;
  border-radius: 999px;
  padding: 2px 8px;
}

.sub {
  margin: 0 0 16px;
  color: #a4acbe;
  font-size: 13px;
}

.level-info {
  font-size: 12px;
  color: #7d859c;
  margin-bottom: 8px;
}

.hud {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}

.hud-item { color: #c3c9d8; }

button:hover { background: #262f45; }

#board {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: #161d2e;
  border-radius: 12px;
  touch-action: none;
  display: block;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.win-banner {
  margin-top: 14px;
  background: #163a2b;
  border: 1px solid #2c6b4a;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  animation: winPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes winPop {
  0% { transform: scale(0.85) translateY(6px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

button {
  background: #1c2436;
  color: #e8ecf4;
  border: 1px solid #2f394f;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

button:active { transform: scale(0.94); }

.win-banner button {
  background: #2c6b4a;
  border-color: #3a8a60;
}

.hidden { display: none; }

.legend {
  margin-top: 16px;
  font-size: 12px;
  color: #9aa2b4;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.dot.red { background: #e5484d; }
.dot.blue { background: #3b82f6; }
.dot.gray { background: #5a6478; }
.dot.locked { background: #3d4358; }
.dot.anchor { background: #8a6d1f; }
