/* The sea chart: admiralty-style paper chart, a night chart in dark mode, yacht marks, month dial. */

.chart-frame {
  --ch-deep: #f1f6f8; --ch-shallow: #a9d3ea; --ch-land: #f0e2b6; --ch-coast: #7a6a44;
  --ch-grid: rgb(40 80 100 / .16); --ch-label: #4c6372;
  position: relative; width: 100%; overflow: hidden; border: 1px solid #b9c4c9; outline: 6px solid #f7f9fa; outline-offset: -7px;
  background: var(--ch-deep);
}
@media (prefers-color-scheme: dark) {
  .chart-frame { --ch-deep: #0c1b26; --ch-shallow: #1b4258; --ch-land: #2b3237; --ch-coast: #8fa1ae; --ch-grid: rgb(170 200 220 / .12); --ch-label: #8fa1ae; border-color: #2a4458; outline-color: #0f222f; }
}
.chart-sea { position: absolute; inset: 0; transition: opacity .2s ease; }
.chart-frame.is-fading .chart-sea { opacity: .3; }
.chart-marks { position: absolute; inset: 0; overflow: visible; }

/* yacht marks */
.ym { fill: #0670b4; stroke: #fff; stroke-width: 1; transition: transform 1.1s cubic-bezier(.45, 0, .25, 1), fill .3s ease; }
.ym.is-sr { fill: #049af1; }
.ym.is-between { fill: #fff; stroke: #0670b4; stroke-width: 1.6; }
@media (prefers-color-scheme: dark) { .ym { fill: #3aa8ec; stroke: #0c1b26; } .ym.is-sr { fill: #8fd3ff; } .ym.is-between { fill: #0c1b26; stroke: #8fd3ff; } }
@media (prefers-reduced-motion: reduce) { .ym { transition: none; } }
.mig-route { fill: none; stroke: #0670b4; stroke-width: 1.2; stroke-dasharray: 4 5; opacity: .7; }
@media (prefers-color-scheme: dark) { .mig-route { stroke: #8fd3ff; } }
.mig-hit { cursor: pointer; outline: none; }
.mig-hit-area { fill: transparent; stroke: transparent; stroke-width: 2; }
.mig-hit:hover .mig-hit-area, .mig-hit:focus-visible .mig-hit-area { fill: rgb(4 154 241 / .08); stroke: #049af1; }
.mig-label { font: 600 11px var(--sans); fill: #24323b; paint-order: stroke; stroke: var(--ch-deep, #f1f6f8); stroke-width: 3px; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .mig-label { fill: #dfe7ec; stroke: #0c1b26; } }

/* home section */
.mig-head { display: grid; gap: 14px; max-width: 64ch; margin-bottom: 32px; }
.mig-countdown { font-size: 1.05rem; color: var(--ink-2); }
.mig-countdown strong { color: var(--ink); font-weight: 700; }
.mig-body { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }
.mig-stage { position: relative; min-width: 0; }
.mig-side { display: grid; gap: 18px; justify-items: center; position: sticky; top: calc(var(--header-h) + 20px); }
.mig-live { text-align: center; color: var(--ink-2); font-size: 0.95rem; min-height: 4.5em; }
.mig-live strong { display: block; font-family: var(--serif); font-size: 1.8rem; font-weight: 400; color: var(--ink); line-height: 1.1; margin-bottom: 4px; }
.mig-note { margin-top: 14px; font-size: 0.875rem; color: var(--muted); }

/* the dial: a brass-free ship's clock ring */
.mig-dial { display: grid; justify-items: center; gap: 12px; }
.dial-svg { width: 230px; height: 230px; overflow: visible; }
.dial-rim { fill: var(--paper-raised); stroke: var(--line-strong); stroke-width: 1; }
.dial-face { fill: var(--wash); stroke: var(--line); }
.dial-seg { cursor: pointer; outline: none; }
.dial-seg path { fill: transparent; stroke: var(--line); stroke-width: 1; transition: fill .25s ease; }
.dial-seg text { font: 600 11px var(--sans); fill: var(--ink-2); text-anchor: middle; pointer-events: none; }
.dial-seg:hover path { fill: var(--wash); }
.dial-seg:focus-visible path { stroke: var(--sky); stroke-width: 2; }
.dial-seg.is-on path { fill: var(--sky-ink); stroke: var(--sky-ink); }
.dial-seg.is-on text { fill: var(--on-sky); }
.dial-seg.is-now text { text-decoration: underline; }
.dial-hand { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.dial-pin { fill: var(--ink); }
.dial-play { min-height: 40px; }
.mig-side .segmented button { padding: 0 10px; }

/* card over the chart */
.chart-card {
  position: absolute; z-index: 5; display: grid; gap: 8px; padding: 14px 16px; background: var(--paper-raised);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.chart-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chart-card-head strong { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.chart-card-x { border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); }
.chart-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chart-card li a { display: grid; text-decoration: none; }
.chart-card li a span { font-weight: 600; }
.chart-card li a small { color: var(--muted); }
.chart-card .small a { color: var(--sky-ink); font-weight: 600; }

@media (max-width: 960px) {
  .mig-body { grid-template-columns: minmax(0, 1fr); }
  .mig-side { position: static; grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; }
  .mig-side .segmented { grid-column: 1 / -1; }
  .dial-svg { width: 180px; height: 180px; }
  .mig-live { text-align: left; }
}
@media (max-width: 700px) {
  .chart-card { position: static; margin-top: 12px; width: auto !important; }
  .mig-side { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .mig-live { text-align: center; }
}
