* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050914;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#river-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
  touch-action: manipulation;
}

#river-canvas:focus-visible {
  outline: 2px solid rgba(191, 227, 255, 0.7);
  outline-offset: -3px;
}

.hint {
  position: fixed;
  top: clamp(18px, 5vh, 40px);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-align: center;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.hint.hidden {
  opacity: 0;
}

.mark {
  position: fixed;
  left: clamp(14px, 3vw, 28px);
  bottom: clamp(12px, 3vh, 24px);
  color: rgba(255,255,255,0.28);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: none;
  border: none;
  padding: 6px;
  margin: -6px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.3s ease;
}

.mark:hover,
.mark:focus-visible,
.mark[aria-expanded="true"] {
  color: rgba(255,255,255,0.6);
}

.mark:focus-visible {
  outline: 1px solid rgba(191, 227, 255, 0.6);
  outline-offset: 2px;
}

.river-info-panel {
  position: fixed;
  left: clamp(14px, 3vw, 28px);
  bottom: clamp(42px, 8vh, 58px);
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  background: rgba(5, 9, 20, 0.55);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 10px 14px;
  max-width: min(260px, calc(100vw - 28px));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.river-info-panel:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
}

.river-info-panel p {
  margin: 0;
  line-height: 1.5;
}

.site-credit {
  position: fixed;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(12px, 3vh, 24px);
  color: rgba(255,255,255,0.24);
  font-size: 11px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.site-credit a {
  color: inherit;
  pointer-events: auto;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.site-credit a:hover {
  color: rgba(255,255,255,0.6);
}

@media (prefers-reduced-motion: reduce) {
  .hint,
  .mark,
  .river-info-panel,
  .site-credit a {
    transition: none;
  }
}
