:root {
  color-scheme: dark;
  --navy: #16232E;
  --navy-deep: #0F1A22;
  --foam: #EFF3F1;
  --foam-dim: #A9B8B9;
  --teal: #4C8C93;
  --sand: #D9B57C;
  --coral: #C97458;
  --rule: rgba(239, 243, 241, 0.14);
}
 
* { box-sizing: border-box; }
 
html, body {
  margin: 0;
  padding: 0;
  background: var(--navy-deep);
}
 
body {
  color: var(--foam);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  padding: 12px 20px 40px;
  max-width: 1700px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 700px) {
  body {
    grid-template-columns: repeat(2, 1fr);
  }
}
 
.panel {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 28px 30px 24px;
}
 
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px;
  margin-bottom: 22px;
}
 
.station-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0.2px;
}
 
.status {
  font-size: 12px;
  color: var(--foam-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.battery-indicator {
  margin-left: 4px;
  color: var(--foam-dim);
}

.battery-indicator.battery-low {
  color: var(--coral);
  font-weight: 600;
}
 
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6FBF8B;
  display: inline-block;
}
 
.status-dot.offline { background: var(--coral); }
 
.hero {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 26px;
}
 
/* --- UPDATED COMPASS & NEEDLE STYLES --- */
 
.compass-large {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  position: relative;
  flex-shrink: 0;
  /* REMOVED: transform: rotate(180deg); so North stays at top */
}
 
.needle-large {
  position: absolute;
  top: 8px; /* Offset from outer edge */
  left: 50%;
  width: 3px;
  height: 34px; /* Extends inward toward the center (34px + 8px = 42px center point) */
  background: var(--sand);
  box-shadow: 0 0 0 1px rgba(15, 26, 34, 0.8);
  margin-left: -1.5px;
  
  /* Rotates around the exact center of the dial */
  transform-origin: 50% 34px; 
}
 
/* Arrowhead pointing INWARD to the center of the dial */
.needle-large::after {
  content: "";
  position: absolute;
  bottom: -6px; /* Positioned at the inner tip */
  left: -4px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--sand); /* Points downward into center */
  filter: drop-shadow(0 0 1px rgba(15, 26, 34, 0.9));
}
 
.needle-large.dir-0   { transform: rotate(0deg); }
.needle-large.dir-1   { transform: rotate(22.5deg); }
.needle-large.dir-2   { transform: rotate(45deg); }
.needle-large.dir-3   { transform: rotate(67.5deg); }
.needle-large.dir-4   { transform: rotate(90deg); }
.needle-large.dir-5   { transform: rotate(112.5deg); }
.needle-large.dir-6   { transform: rotate(135deg); }
.needle-large.dir-7   { transform: rotate(157.5deg); }
.needle-large.dir-8   { transform: rotate(180deg); }
.needle-large.dir-9   { transform: rotate(202.5deg); }
.needle-large.dir-10  { transform: rotate(225deg); }
.needle-large.dir-11  { transform: rotate(247.5deg); }
.needle-large.dir-12  { transform: rotate(270deg); }
.needle-large.dir-13  { transform: rotate(292.5deg); }
.needle-large.dir-14  { transform: rotate(315deg); }
.needle-large.dir-15  { transform: rotate(337.5deg); }

/* Erratic spin while the station is offline — steps() gives it a jittery,
   glitchy jump rather than a smooth spin. Overrides whatever dir-N rotation
   is set, since an active animation takes precedence over a static value. */
@keyframes glitchSpin {
  0%   { transform: rotate(23deg); }
  10%  { transform: rotate(187deg); }
  20%  { transform: rotate(45deg); }
  30%  { transform: rotate(310deg); }
  40%  { transform: rotate(98deg); }
  50%  { transform: rotate(275deg); }
  60%  { transform: rotate(12deg); }
  70%  { transform: rotate(200deg); }
  80%  { transform: rotate(150deg); }
  90%  { transform: rotate(330deg); }
  100% { transform: rotate(70deg); }
}

.needle-large.glitching {
  animation: glitchSpin 0.6s steps(1) infinite;
}
 
.wind-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
 
.wind-speed {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 56px;
  line-height: 1;
}
 
.wind-speed .unit {
  font-size: 22px;
  color: var(--foam-dim);
  margin-left: 6px;
}
 
.wind-sub {
  font-size: 13px;
  color: var(--foam-dim);
}
 
.wind-sub strong {
  color: var(--foam);
  font-weight: 600;
}
 
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--rule);
}
 
.grid-secondary {
  border-top: none;
}
 
.stat {
  padding: 16px 4px;
  border-right: 1px solid var(--rule);
  text-align: center;
}
 
.stat:last-child { border-right: none; }
 
.stat-wide {
  grid-column: 1 / -1;
  border-right: none;
}
 
.stat .value {
  font-size: 19px;
  color: var(--foam);
}
 
.stat .label {
  font-size: 11px;
  color: var(--foam-dim);
  margin-top: 4px;
}
 
.uv-flag .value { color: var(--sand); }
 
.sunset-flag .value { color: var(--coral); }
 
.grid-two {
  grid-template-columns: 1fr 1fr;
}
 
.footer {
  margin-top: 20px;
  font-size: 12px;
  color: var(--foam-dim);
  text-align: right;
}
 
.forecast-panel {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 18px 20px 20px;
}
 
.forecast-label {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  color: var(--foam);
  margin-bottom: 12px;
}
 
.forecast-svg {
  width: 100%;
  height: auto;
  display: block;
}

.forecast-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--foam-dim);
}

.swatch-speed { background: var(--foam); }
.swatch-gust { background: var(--sand); }

.legend-arrow {
  color: var(--teal);
  font-weight: 600;
}

.forecast-title-arrow {
  display: inline-block;
  color: var(--teal);
  font-weight: 600;
  font-size: 25px;
  margin-left: 10px;
}
 
.tide-panel {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 18px 20px 16px;
}
 
.tide-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
 
.tide-label {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  color: var(--foam);
}
 
.tide-updated {
  font-size: 11px;
  color: var(--foam-dim);
}
 
.tide-svg {
  width: 100%;
  height: auto;
  display: block;
}
 
.tide-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--foam-dim);
}
 
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
 
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
 
.swatch-band { background: rgba(201, 116, 88, 0.35); }
.swatch-falling { background: var(--coral); }
.swatch-rising { background: var(--teal); }
.swatch-warn { background: var(--sand); }
 
 
.wave-panel {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 18px 20px 16px;
}
 
.wave-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
 
.wave-label {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  color: var(--foam);
}
 
.wave-current {
  font-size: 12px;
  color: var(--teal);
}
 
.wave-svg {
  width: 100%;
  height: auto;
  display: block;
}
 
.wave-footer {
  margin-top: 10px;
  font-size: 11px;
  color: var(--foam-dim);
  text-align: right;
}

.tide-simple-panel {
  width: 100%;
  background: var(--navy);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 18px 20px 16px;
}

.tide-simple-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.tide-simple-label {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  color: var(--foam);
}

.tide-simple-updated {
  font-size: 11px;
  color: var(--foam-dim);
}

.tide-simple-svg {
  width: 100%;
  height: auto;
  display: block;
}
