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

body {
  background: #0a1628;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

#game-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#shoreline-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: rgba(10, 22, 40, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.1s;
}

#shoreline-link:hover {
  background: rgba(10, 22, 40, 0.85);
  transform: scale(1.03);
}

#shoreline-link:active {
  transform: scale(0.98);
}

canvas {
  display: block;
  background: linear-gradient(180deg, #87ceeb 0%, #b8dff5 45%, #6bb8d9 75%, #2e7fa8 100%);
}

#overlay,
#game-over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 22, 40, 0.75);
  color: #fff;
  text-align: center;
  gap: 12px;
}

#overlay h1,
#game-over h2 {
  font-size: 2.5rem;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

#overlay p {
  font-size: 1.1rem;
  opacity: 0.9;
}

#overlay .hint {
  font-size: 0.95rem;
  opacity: 0.7;
}

kbd {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

button {
  margin-top: 8px;
  padding: 12px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #0a1628;
  background: #ffd54f;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

button:hover {
  background: #ffca28;
  transform: scale(1.05);
}

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

.hidden {
  display: none !important;
}

#hud {
  position: absolute;
  top: 16px;
  right: 16px;
  pointer-events: none;
}

#score-box {
  display: inline-block;
  padding: 8px 18px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  background: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  backdrop-filter: blur(4px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
