/* Pampero — dark, high-contrast, Wiphala accents */
:root {
  --bg: #0a0a0a;
  --fg: #e8e8e8;
  --dim: #8a8a8a;
  --qori: #FCDD09;   /* accent/active */
  --puka: #DA121A;   /* warn/error */
  --chux: #078930;   /* ok */
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body.live {
  display: grid;
  grid-template-rows: 48px 1fr 1fr 1fr;
  height: 100vh;
  height: 100dvh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #222;
}
#sail-badge {
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--qori);
}
#menu-btn {
  background: transparent;
  border: 1px solid #333;
  color: var(--fg);
  font-size: 22px;
  line-height: 1;
  width: 40px; height: 32px;
  border-radius: 6px;
}

.zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.zone canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.zone-compass .overlay { font-size: 56px; }
.zone-heel .overlay    { font-size: 40px; }
.unit {
  font-size: 0.55em;
  color: var(--dim);
  margin-left: 4px;
  font-weight: 500;
}
.side {
  font-size: 0.55em;
  color: var(--qori);
  margin-left: 10px;
}
.src {
  position: absolute;
  top: 6px; right: 10px;
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.zone-speed {
  flex-direction: column;
  gap: 8px;
}
.speed-big {
  font-size: 96px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.speed-big .unit { font-size: 28px; }

#status-line {
  font-size: 13px;
  color: var(--chux);
}
#status-line.warn  { color: var(--qori); }
#status-line.error { color: var(--puka); }

/* Menu dialog */
dialog#menu {
  position: fixed;
  inset: auto 12px 12px 12px;
  top: auto;
  width: calc(100% - 24px);
  margin: 0;
  padding: 12px;
  background: #161616;
  color: var(--fg);
  border: 1px solid #333;
  border-radius: 12px;
}
dialog#menu::backdrop { background: rgba(0,0,0,0.6); }
dialog#menu button {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 6px 0;
  font-size: 18px;
  background: #1f1f1f;
  color: var(--fg);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
}
dialog#menu button.secondary { background: transparent; color: var(--dim); }

/* Setup page */
body.setup {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
}
body.setup main {
  width: 100%;
  max-width: 420px;
}
body.setup h1 {
  margin: 0 0 4px;
  font-size: 40px;
  letter-spacing: -0.02em;
  color: var(--qori);
}
body.setup .sub { margin: 0 0 24px; color: var(--dim); }
body.setup label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
body.setup input {
  width: 100%;
  padding: 16px;
  font-size: 28px;
  font-weight: 700;
  background: #161616;
  color: var(--fg);
  border: 1px solid #333;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
body.setup .hint {
  margin: 8px 0 16px;
  color: var(--dim);
  font-size: 13px;
}
body.setup button {
  width: 100%;
  padding: 18px;
  font-size: 22px;
  font-weight: 700;
  background: var(--qori);
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  margin-top: 8px;
}
code { color: var(--qori); }
