* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at 50% 0%, #10202e 0%, #04080c 70%);
  color: #e8f1f5;
  min-height: 100vh;
  overflow: hidden;
}

#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

.mode-label {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  font-size: 1.0rem;
  letter-spacing: 0.02em;
  color: #cfe8f2;
  text-shadow: 0 0 12px rgba(79, 214, 255, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
  font-variant-numeric: tabular-nums;
  font-family: 'Courier New', Courier, monospace;
  text-align: center;
}

.settings-btn {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 50;
  background: rgba(14, 27, 36, 0.85);
  border: 1px solid #2aa9d6;
  color: #e8f1f5;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
  min-width: 48px;
  text-align: center;
}

.settings-btn:hover {
  background: rgba(42, 169, 214, 0.35);
}

.settings-btn:active {
  background: rgba(42, 169, 214, 0.55);
}

.bob-btn {
  top: 44px;
}

.bob-btn.active {
  background: rgba(42, 169, 214, 0.55);
  border-color: #4fd6ff;
}

.datetime-display {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 25;
  font-size: 1.0rem;
  letter-spacing: 0.02em;
  color: #cfe8f2;
  text-shadow: 0 0 8px rgba(79, 214, 255, 0.4);
  pointer-events: none;
  text-align: right;
  opacity: 1;
  transition: opacity 0.3s ease;
  font-variant-numeric: tabular-nums;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.6;
}

.datetime-display.hidden {
  opacity: 0;
}

.tide-predictions {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 25;
  font-size: 1.0rem;
  letter-spacing: 0.02em;
  color: #cfe8f2;
  text-shadow: 0 0 8px rgba(79, 214, 255, 0.4);
  pointer-events: none;
  text-align: left;
  opacity: 1;
  transition: opacity 0.3s ease;
  font-variant-numeric: tabular-nums;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.6;
}

.tide-predictions.hidden {
  opacity: 0;
}

.permanent-transport {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 25;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.jump-btn {
  position: fixed;
  left: 20px;
  z-index: 25;
  background: rgba(14, 27, 36, 0.85);
  border: 1px solid #2aa9d6;
  color: #e8f1f5;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
  font-family: 'Courier New', Courier, monospace;
}

.jump-btn:hover {
  background: rgba(42, 169, 214, 0.35);
}

.jump-btn:active {
  background: rgba(42, 169, 214, 0.55);
}

.jump-btn.hidden {
  display: none;
}

#jumpToHighBtn {
  top: 100px;
}

#jumpToLowBtn {
  bottom: 20px;
}


.transport-control-btn {
  background: rgba(14, 27, 36, 0.85);
  border: 1px solid #2aa9d6;
  color: #e8f1f5;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
  min-width: 48px;
  line-height: 1;
}

.transport-control-btn:hover {
  background: rgba(42, 169, 214, 0.35);
}

.transport-control-btn:active {
  background: rgba(42, 169, 214, 0.55);
  transform: translateY(1px);
}

.transport-control-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.transport-control-btn:disabled:hover {
  background: rgba(14, 27, 36, 0.85);
  transform: none;
}

.tide-predictions.hidden {
  opacity: 0;
}

.tide-predictions-low {
  position: fixed;
  bottom: 80px;
  left: 20px;
  z-index: 25;
  font-size: 1.0rem;
  letter-spacing: 0.02em;
  color: #cfe8f2;
  text-shadow: 0 0 8px rgba(79, 214, 255, 0.4);
  pointer-events: none;
  text-align: left;
  opacity: 1;
  transition: opacity 0.3s ease;
  font-variant-numeric: tabular-nums;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.6;
}

.tide-predictions-low.hidden {
  opacity: 0;
}

.tide-marker-high {
  color: #ffd166;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.6);
}

.tide-marker-low {
  color: #ffd166;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.6);
}

.tide-marker-current {
  color: #4fd6ff;
  text-shadow: 0 0 8px rgba(79, 214, 255, 0.6);
}

.tide-height-display {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 25;
  font-size: 1.0rem;
  letter-spacing: 0.02em;
  color: #cfe8f2;
  text-shadow: 0 0 8px rgba(79, 214, 255, 0.4);
  pointer-events: none;
  text-align: right;
  opacity: 1;
  transition: opacity 0.3s ease;
  font-variant-numeric: tabular-nums;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.6;
}

.tide-height-display.hidden {
  opacity: 0;
}


.app {
  position: relative;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clock-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas {
  max-width: 100%;
  height: auto;
  background: transparent;
}

.canvas-stack {
  position: relative;
  width: min(92vw, 92vh);
  height: min(92vw, 92vh);
}

.canvas-stack canvas {
  display: block;
  width: 100%;
  height: auto;
}

.canvas-stack canvas#clockHands {
  position: absolute;
  top: 0;
  left: 0;
}

/* Tap-anywhere overlay menu: floating pill buttons, stacked vertically, centered. */
.tap-menu {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 15;
}

.tap-menu.hidden {
  display: none;
}

.tap-menu-btn {
  background: rgba(14, 27, 36, 0.85);
  border: 1px solid #2aa9d6;
  color: #e8f1f5;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.tap-menu-btn:hover {
  background: rgba(42, 169, 214, 0.35);
}

.transport-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.transport-btn {
  background: rgba(14, 27, 36, 0.85);
  border: 1px solid #2aa9d6;
  color: #e8f1f5;
  padding: 14px 20px;
  border-radius: 999px;
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  min-width: 60px;
  font-family: 'Courier New', Courier, monospace;
}

.transport-btn:hover {
  background: rgba(42, 169, 214, 0.35);
}

.settings-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 8, 12, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.settings-panel.hidden {
  display: none;
}

.settings-panel-inner {
  position: relative;
  background: #0e1b24;
  border: 1px solid #1f3b4d;
  border-radius: 12px;
  padding: 28px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.settings-panel-inner label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: #7fa8bd;
  text-align: left;
  gap: 4px;
}

.settings-panel-inner input,
.settings-panel-inner select {
  background: #10202e;
  border: 1px solid #1f3b4d;
  color: #e8f1f5;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.station-name {
  padding: 4px 2px;
  color: #cfe8f2;
  font-size: 0.9rem;
}

.settings-panel-inner button#loadBtn {
  background: linear-gradient(180deg, #2aa9d6, #1c7ba8);
  border: none;
  color: white;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.settings-panel-inner button#loadBtn:hover {
  filter: brightness(1.1);
}

.secondary-btn {
  background: rgba(42, 169, 214, 0.15);
  border: 1px solid #2aa9d6;
  color: #cfe8f2;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.secondary-btn:hover {
  background: rgba(42, 169, 214, 0.3);
}

.secondary-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.status {
  font-size: 0.8rem;
  color: #7fa8bd;
}

.icon-btn {
  background: rgba(14, 27, 36, 0.7);
  border: 1px solid #1f3b4d;
  color: #cfe8f2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.close-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  font-size: 1rem;
}
