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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  color: #e8e8e8;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
}

#hud {
  width: 100%;
  max-width: 560px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 10px 16px;
  backdrop-filter: blur(8px);
  font-size: 14px;
}

.hud-title {
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-goal {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d0d0d0;
}

.goal-swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,0.4);
  box-shadow: 0 0 6px rgba(0,0,0,0.3) inset;
}

.goal-count { font-weight: 700; color: #fff; }
.goal-count.done { color: #6dffb1; }

#hud-moves, #hud-level {
  color: #c0c0c0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#board-wrap {
  position: relative;
  border-radius: 18px;
  background: rgba(0,0,0,0.35);
  box-shadow: 0 18px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08) inset;
  padding: 10px;
  touch-action: none;
}

#board {
  display: block;
  border-radius: 10px;
  background: rgba(0,0,0,0.25);
}

#overlay {
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background: rgba(10, 15, 30, 0.86);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  text-align: center;
  padding: 20px;
}

#overlay.show { opacity: 1; pointer-events: auto; }

#overlay h2 { font-size: 26px; color: #fff; letter-spacing: 0.5px; }

#overlay p {
  font-size: 14px;
  color: #c0c0c0;
  max-width: 320px;
  line-height: 1.4;
}

#overlay button {
  margin-top: 8px;
  background: linear-gradient(180deg, #4ea8ff 0%, #2563eb 100%);
  border: none;
  color: white;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
  transition: transform 0.12s ease;
}

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

#footer {
  font-size: 12px;
  color: #8a8a9a;
  text-align: center;
  max-width: 560px;
}
