/* Take her to New Brighton: the steering game (scoped to #helm) */
#helm .helm { background: var(--night); border-color: #24313a; color: var(--paper); padding-bottom: 16px; gap: 0; }
#helm .helm .instrument__head { border-bottom-color: rgba(230,201,127,.25); }
#helm .helm__stage {
  position: relative; aspect-ratio: 16 / 9; min-height: 300px; overflow: hidden;
  background: #dcebea; outline: none; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  border-bottom: 1px solid rgba(230,201,127,.25);
}
#helm .helm__stage:focus-visible { box-shadow: inset 0 0 0 3px var(--brass-hi); }
#helm .helm__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
@media (max-width: 700px) { #helm .helm__stage { aspect-ratio: 1 / 1; min-height: 0; } }

/* message pill */
#helm .helm__msg {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; margin: 0;
  max-width: min(92%, 560px); padding: 7px 14px; border-radius: 3px;
  background: rgba(11, 20, 30, .86); color: var(--paper); border: 1px solid rgba(230,201,127,.35);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.35; letter-spacing: .03em; text-align: center;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
#helm .helm__msg.is-on { opacity: 1; }
#helm .helm__msg.is-warn { border-color: #ff8b7c; color: #ffd2cb; }
#helm .helm__msg.is-good { border-color: var(--phosphor); color: #d6ffe6; }

/* brief and end panels */
#helm .helm__panel {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 28px)); max-height: calc(100% - 20px); overflow: auto;
  padding: 18px 20px 16px; display: grid; gap: 10px;
  background: rgba(11, 20, 30, .9); color: var(--paper);
  border: 1px solid rgba(230,201,127,.45); box-shadow: 0 18px 40px rgba(0,0,0,.35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
#helm .helm__panel[hidden] { display: none; }
@media (min-width: 701px) { #helm .helm__panel { left: 22px; transform: translateY(-50%); width: min(400px, 44%); } }
@media (max-width: 700px) { #helm .helm__panel { top: auto; bottom: 10px; transform: translateX(-50%); padding: 14px 14px 12px; gap: 8px; } #helm .helm__panel h3 { font-size: 1.5rem; } #helm .helm__keys { display: none; } }
#helm .helm__panel::before, #helm .helm__panel::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--brass); pointer-events: none; }
#helm .helm__panel::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
#helm .helm__panel::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
#helm .helm__kicker { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-hi); }
#helm .helm__panel h3 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); line-height: .95; text-transform: uppercase; letter-spacing: .01em; }
#helm .helm__endtext { margin: 0; font-size: var(--step--1); line-height: 1.45; color: #d9e1e3; }
#helm .helm__tides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#helm .helm__tides button {
  display: grid; gap: 2px; text-align: left; padding: 9px 11px; cursor: pointer;
  background: #13212d; color: var(--paper); border: 1px solid rgba(242,244,239,.25);
}
#helm .helm__tides button b { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; }
#helm .helm__tides button span { font-size: 13px; line-height: 1.3; color: #b9c6cb; }
#helm .helm__tides button[aria-checked="true"] { border-color: var(--brass); background: #1d2c37; box-shadow: inset 0 0 0 1px var(--brass); }
#helm .helm__tides button[aria-checked="true"] b { color: var(--brass-hi); }
#helm .helm__go {
  justify-self: start; min-height: 44px; padding: 8px 22px; cursor: pointer; border: 0; border-radius: 22px;
  background: var(--brass); color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: .08em; text-transform: uppercase;
}
#helm .helm__go:hover { background: var(--brass-hi); }
#helm .helm__ghost { min-height: 44px; padding: 8px 16px; cursor: pointer; border-radius: 22px; background: transparent; color: var(--paper); border: 1px solid rgba(242,244,239,.4); font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; }
#helm .helm__ghost:hover { border-color: var(--brass-hi); color: var(--brass-hi); }
#helm .helm__link { align-self: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: var(--brass-hi); }
#helm .helm__endbtns { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
#helm .helm__keys { margin: 0; font-family: var(--font-mono); font-size: 11px; line-height: 1.45; color: #9fb4bf; }

/* deck */
#helm .helm__deck { display: grid; gap: 14px; padding: 16px 16px 4px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  #helm .helm__deck { grid-template-columns: 360px minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "wheel tg" "wheel read"; align-items: start; column-gap: 20px; }
  #helm .helm__wheelbox { grid-area: wheel; }
  #helm .helm__tg { grid-area: tg; }
  #helm .helm__readout { grid-area: read; }
}
#helm .helm__tg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
#helm .helm__tg button {
  position: relative; min-height: 54px; padding: 4px 2px; cursor: pointer;
  border: 1px solid rgba(242,244,239,.28); background: #172532; color: var(--paper);
  font-family: var(--font-mono); font-size: 11px; line-height: 1.15; letter-spacing: .04em; text-transform: uppercase;
}
#helm .helm__tg button.o-astern { color: #ffaa9e; }
#helm .helm__tg button.o-stop { color: var(--brass-hi); }
#helm .helm__tg button:hover { border-color: rgba(230,201,127,.7); }
#helm .helm__tg button.is-on { background: var(--brass); color: var(--ink); border-color: var(--brass); }
#helm .helm__tg button.is-asked { background: #3a3220; border-color: var(--brass); animation: helmAsk .5s steps(2) infinite; }
@keyframes helmAsk { 50% { background: #172532; } }
@media (max-width: 600px) { #helm .helm__tg { grid-template-columns: repeat(4, minmax(0, 1fr)); } #helm .helm__tg button { min-height: 46px; } }

#helm .helm__wheelbox { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
#helm .helm__wheel { width: 168px; height: 168px; touch-action: none; cursor: grab; border-radius: 50%; outline: none; }
#helm .helm__wheel:focus-visible { box-shadow: 0 0 0 3px var(--brass-hi); }
#helm .helm__wheel.is-drag { cursor: grabbing; }
#helm .helm__wheel svg { width: 100%; height: 100%; overflow: visible; }
@media (max-width: 600px) { #helm .helm__wheel { width: 150px; height: 150px; } }
/* on a phone the wheel sits straight under the chart, so you can steer and watch her at once */
@media (max-width: 899px) { #helm .helm__deck { padding-top: 12px; gap: 12px; } #helm .helm__wheelbox { order: -1; } }
#helm .helm__rudder { display: grid; gap: 4px; justify-items: center; }
#helm .helm__rudder svg { width: 100%; max-width: 200px; height: auto; }
#helm .helm__rudder p { margin: 0; display: grid; justify-items: center; }
#helm .helm__rudder span, #helm .helm__readout span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #9fb4bf; }
#helm .helm__rudder b { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: .06em; text-transform: uppercase; }
#helm .helm__mid { min-height: 30px; padding: 2px 12px; border-radius: 15px; cursor: pointer; background: transparent; color: var(--paper); border: 1px solid rgba(242,244,239,.4); font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
#helm .helm__mid:hover { border-color: var(--brass-hi); color: var(--brass-hi); }

#helm .helm__readout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
#helm .helm__readout p { margin: 0; padding: 6px 10px; border: 1px solid rgba(242,244,239,.16); background: rgba(19,33,45,.6); display: grid; min-width: 0; }
#helm .helm__readout b { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: .04em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#helm .helm__readout b.is-warn { color: #ff8b7c; }
#helm .helm__readout b.is-good { color: var(--phosphor); }
@media (max-width: 600px) { #helm .helm__readout { grid-template-columns: repeat(2, minmax(0, 1fr)); } #helm .helm__readout b { font-size: 19px; } }
#helm .helm figcaption { color: #9fb4bf; padding-top: 12px; }
#helm .helm.is-nochart .helm__deck { display: none; }
