/* 3D view of the effort section (terrain3d.js): a full-screen layer over the page. */
.t3d { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: #1d2320;
  font: 14px/1.4 var(--sans, system-ui, sans-serif); color: var(--ink, #23301f); }
.t3d [hidden] { display: none !important; }
.t3d-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 10px 16px; background: var(--panel, #f8f4ea); border-bottom: 1px solid var(--line, #ddd4bf); }
.t3d-title { display: flex; flex-direction: column; min-width: 0; }
.t3d-title b { font: 600 18px/1.25 var(--head-font, Georgia, serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t3d-title span { color: var(--muted, #6d7362); font-size: 13px; }
.t3d-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.t3d-btn { font: inherit; font-weight: 600; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line, #ddd4bf);
  background: var(--panel, #f8f4ea); color: var(--ink, #23301f); cursor: pointer; }
.t3d-btn:hover { background: var(--raised, #efe8d8); }
.t3d-btn:disabled { opacity: 0.5; cursor: default; }
.t3d-btn.primary { background: var(--accent, #2f6b45); border-color: var(--accent, #2f6b45); color: var(--accent-ink, #fff); }
.t3d-btn.primary:hover { filter: brightness(1.06); }
.t3d-btn.close { margin-left: 4px; width: 36px; padding: 7px 0; font-size: 16px; line-height: 1.2; }
.t3d-hills { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; font-weight: 600; color: var(--muted, #6d7362); white-space: nowrap; }
.t3d-hills input { width: 90px; accent-color: var(--accent, #2f6b45); margin: 0; padding: 0; }
.t3d-hills span { min-width: 2.6em; font-variant-numeric: tabular-nums; }
.t3d-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.t3d-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.t3d-labels { position: absolute; inset: 0; pointer-events: none; }
.t3d-label { position: absolute; left: 0; top: 0; padding: 3px 8px; border-radius: 6px; background: rgb(35 48 31 / 0.88);
  color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.t3d-hud { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); padding: 8px 14px; border-radius: 10px;
  background: rgb(35 48 31 / 0.88); color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t3d-status { position: absolute; inset: 0; display: grid; place-items: center; color: #e8ebe8; font-size: 15px; padding: 16px; text-align: center; }
.t3d-legend { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px;
  border-radius: 10px; background: rgb(248 244 234 / 0.92); font-size: 12px; box-shadow: var(--shadow, none); }
.t3d-legend:empty { display: none; }
.t3d-legend span { display: flex; align-items: center; gap: 6px; }
.t3d-legend i { width: 18px; height: 6px; border-radius: 3px; }
.t3d-credit { position: absolute; left: 8px; bottom: 6px; right: 8px; color: rgba(29, 35, 32, 0.75); font-size: 11px; pointer-events: none; }
.t3d-credit a { color: inherit; pointer-events: auto; }
@media (max-width: 760px) {
  .t3d-bar { padding: 8px 12px; }
  .t3d-hills input { width: 70px; }
  .t3d-bar { position: relative; padding-right: 56px; }
  .t3d-btn.close { position: absolute; top: 8px; right: 12px; }
  .t3d-legend { flex-direction: row; flex-wrap: wrap; gap: 4px 10px; left: 8px; right: 8px; top: 8px; }
  .t3d-legend b { width: 100%; }
}

/* wind panel and the gradient/wind colour switch */
.t3d-wind { position: absolute; left: 12px; top: 12px; width: 250px; padding: 10px 12px; border-radius: 12px;
  background: rgb(248 244 234 / 0.94); box-shadow: var(--shadow, none); font-size: 13px; }
.t3d-wind-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.t3d-wind-head b { font: 600 15px/1.2 var(--head-font, Georgia, serif); }
.t3d-wind select { font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--line, #ddd4bf); border-radius: 7px;
  background: var(--panel, #f8f4ea); color: var(--ink, #23301f); max-width: 160px; }
.t3d-wind-body { display: flex; align-items: center; gap: 12px; }
.t3d-dial { position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--line, #ddd4bf);
  background: radial-gradient(circle, #fff 0 55%, var(--raised, #efe8d8) 56%); }
.t3d-dial .n { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; font-size: 10px; font-weight: 700;
  line-height: 14px; text-align: center; color: var(--muted, #6d7362); }
.t3d-dial i { position: absolute; inset: 10px; transition: transform .15s linear; }
.t3d-dial i::before { content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 4px; margin-left: -2px; border-radius: 2px;
  background: #1f4f78; }
.t3d-dial i::after { content: ""; position: absolute; left: 50%; top: -2px; margin-left: -8px; border: 8px solid transparent;
  border-bottom: 12px solid #1f4f78; border-top: 0; }
.t3d-wind-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.t3d-wind-text .speed { font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.t3d-wind-text .from { color: var(--muted, #6d7362); }
.t3d-wind-text .effect { font-weight: 600; }
.t3d-wind.none .t3d-dial { opacity: 0.35; }
.t3d-switch { display: flex; gap: 2px; padding: 2px; margin-bottom: 4px; border-radius: 8px; background: var(--raised, #efe8d8); }
.t3d-switch button { flex: 1; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted, #6d7362); cursor: pointer; }
.t3d-switch button.on { background: #fff; color: var(--ink, #23301f); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
@media (max-width: 760px) {
  .t3d-wind { left: 8px; right: 8px; top: auto; bottom: 40px; width: auto; padding: 8px 10px; }
  .t3d-dial { width: 48px; height: 48px; }
  .t3d-dial .n { display: none; }
  .t3d-legend .t3d-switch { width: 100%; }
  .t3d-hud { bottom: 138px; }
}
.t3d-hour { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; font-size: 12px; color: var(--muted, #6d7362); }
.t3d-hour[hidden] { display: none; }
.t3d-hour input { width: 100%; height: auto; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; accent-color: #1f4f78; }
.t3d-hour span { font-weight: 600; font-variant-numeric: tabular-nums; }
.t3d-hour span.best { color: var(--accent, #2f6b45); }
