/* ── Splash / landing screen ── */
#splash {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: opacity 0.6s ease;
}

#splash.hiding {
  opacity: 0;
  pointer-events: none;
}

#splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  font-family: 'Courier New', Courier, monospace;
}

#splash-title {
  font-size: clamp(40px, 10vw, 96px);
  font-weight: bold;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 40px rgba(80, 160, 255, 0.6), 0 2px 12px rgba(0, 0, 0, 0.9);
}

#splash-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

#go-swimming {
  background: none;
  border: 1px solid rgba(80, 160, 255, 0.45);
  color: rgba(80, 160, 255, 0.85);
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(13px, 2vw, 17px);
  letter-spacing: 0.2em;
  padding: 12px 28px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

#go-swimming:hover {
  color: rgba(80, 160, 255, 1);
  border-color: rgba(80, 160, 255, 0.8);
  background: rgba(80, 160, 255, 0.08);
  box-shadow: 0 0 20px rgba(80, 160, 255, 0.25);
}

#go-swimming:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

#splash-loader {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(11px, 1.5vw, 13px);
  letter-spacing: 0.25em;
  color: rgba(80, 160, 255, 0.5);
  min-height: 1.4em;
  margin-top: 4px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#title {
  position: absolute;
  top: clamp(36px, 7vh, 80px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(22px, 4.5vw, 54px);
  font-weight: bold;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.75);
  text-shadow: 0 0 30px rgba(80,160,255,0.5), 0 2px 8px rgba(0,0,0,0.85);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  transition: color 4s ease, text-shadow 4s ease;
}

#help-icon {
  position: fixed;
  top: 20px;
  right: 20px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 24px;
  font-weight: bold;
  color: rgba(255,255,255,0.75);
  text-shadow: 0 0 30px rgba(80,160,255,0.5), 0 2px 8px rgba(0,0,0,0.85);
  cursor: pointer;
  z-index: 100;
  transition: color 0.2s ease, text-shadow 0.2s ease;
  user-select: none;
  background: none;
  border: none;
  padding: 0;
  width: auto;
  height: auto;
}

#help-icon:hover {
  color: rgba(255,255,255,1);
  text-shadow: 0 0 40px rgba(80,160,255,0.7), 0 2px 8px rgba(0,0,0,0.85);
}

#help-icon.active {
  color: rgba(255,255,255,1);
  text-shadow: 0 0 40px rgba(80,160,255,0.8), 0 2px 8px rgba(0,0,0,0.85);
}

#help-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(2px);
}

#help-panel.open {
  opacity: 1;
  pointer-events: auto;
}

#help-content {
  background: rgba(20,20,30,0.95);
  border: 1px solid rgba(80,160,255,0.5);
  border-radius: 8px;
  padding: 30px;
  max-width: 400px;
  box-shadow: 0 0 40px rgba(80,160,255,0.3);
  font-family: 'Courier New', Courier, monospace;
  color: rgba(255,255,255,0.85);
}

#help-content h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: rgba(80,160,255,0.9);
  text-shadow: 0 0 10px rgba(80,160,255,0.3);
}

.help-section {
  margin-bottom: 20px;
}

.help-section h3 {
  font-size: 12px;
  color: rgba(80,160,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.4;
}

/* ── Time control slider ── */
#time-control {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(80, 160, 255, 0.2);
  border-radius: 20px;
  padding: 7px 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  z-index: 10;
  backdrop-filter: blur(6px);
  transition: border-color 0.4s;
}

#time-control.manual {
  border-color: rgba(255, 180, 80, 0.35);
}

#tc-live {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(80, 160, 255, 0.7);
  cursor: pointer;
  transition: color 0.2s;
}

#tc-live:hover { color: rgba(80, 160, 255, 1); }

#time-control.manual #tc-live {
  color: rgba(255, 180, 80, 0.75);
}

#time-control.manual #tc-live:hover {
  color: rgba(255, 180, 80, 1);
}

#tc-display {
  color: rgba(255, 255, 255, 0.8);
  min-width: 36px;
  text-align: center;
}

#tc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 3px;
  background: rgba(80, 160, 255, 0.18);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

#tc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(80, 160, 255, 0.9);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(80, 160, 255, 0.55);
  transition: background 0.2s, box-shadow 0.2s;
}

#time-control.manual #tc-slider::-webkit-slider-thumb {
  background: rgba(255, 180, 80, 0.9);
  box-shadow: 0 0 8px rgba(255, 180, 80, 0.55);
}

#tc-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: rgba(80, 160, 255, 0.9);
  cursor: pointer;
}

.control .key {
  background: rgba(80,160,255,0.15);
  border: 1px solid rgba(80,160,255,0.4);
  color: rgba(80,160,255,0.95);
  padding: 4px 8px;
  border-radius: 3px;
  font-weight: bold;
  white-space: nowrap;
  min-width: 70px;
  text-align: center;
}
