:root {
  color-scheme: dark;
  --panel: rgba(12, 18, 28, 0.62);
  --panel-strong: rgba(12, 18, 28, 0.82);
  --edge: rgba(255, 255, 255, 0.16);
  --text: #f2f6fb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #8fc4e8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  touch-action: none;
  cursor: crosshair;
}

/* ------------------------------------------------------------ crosshair */

#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  pointer-events: none;
  opacity: 0.35;
  transition: opacity 160ms ease;
}

#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: #fff;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

#crosshair::before {
  left: 9px;
  top: 2px;
  width: 2px;
  height: 16px;
}

#crosshair::after {
  top: 9px;
  left: 2px;
  height: 2px;
  width: 16px;
}

body.playing #crosshair {
  opacity: 0.85;
}

/* ------------------------------------------------------------------ HUD */

#hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 12px 18px;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

#hint {
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--edge);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: rgba(242, 246, 251, 0.92);
  backdrop-filter: blur(6px);
}

#hint strong {
  font-weight: 650;
  color: #fff;
}

#hotbar {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--edge);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}

.slot {
  position: relative;
  width: 62px;
  height: 62px;
  padding: 6px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.slot:hover {
  background: rgba(255, 255, 255, 0.14);
}

.slot.selected {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.85);
  transform: translateY(-2px);
}

.slot .swatch {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.35);
}

.slot .label {
  font-size: 10.5px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.88);
}

.slot .key {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.5);
}

/* -------------------------------------------------------------- overlay */

#start {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 45%, rgba(10, 20, 32, 0.35), rgba(8, 14, 22, 0.72));
  backdrop-filter: blur(3px);
  transition: opacity 200ms ease, visibility 200ms ease;
}

#start.hidden {
  opacity: 0;
  visibility: hidden;
}

#start .card {
  width: min(420px, 100%);
  padding: 28px 30px 24px;
  text-align: center;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--edge);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

#start h1 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.01em;
}

#start p {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(242, 246, 251, 0.82);
}

#start p.small {
  margin: 16px 0 0;
  font-size: 11.5px;
  color: rgba(242, 246, 251, 0.55);
}

#play {
  padding: 11px 26px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, #6fb1e6, #3f7fc0);
  color: #fff;
  font: inherit;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(24, 70, 120, 0.45);
}

#play:hover {
  background: linear-gradient(180deg, #7dbdf0, #4a8ccd);
}

#play:active {
  transform: translateY(1px);
}
