/* Kitesurf Wind Trainer.
   Every rule is scoped under .kwt-root so nothing leaks into the theme and
   nothing from the theme is relied on. The root is a size container, so the
   layout follows the column the shortcode sits in, not the viewport. */

.kwt-root {
  --kwt-panel: #ffffff;
  --kwt-panel-2: #f1ebdf;
  --kwt-line: #e3dbc9;
  --kwt-ink: #062a3f;
  --kwt-muted: #4f6675;
  --kwt-accent: #f0902c;
  --kwt-min: #2f6fd0;
  --kwt-med: #2fa860;
  --kwt-max: #f0902c;
  --kwt-full: #e0334a;

  box-sizing: border-box;
  max-width: 100%;
  container-type: inline-size;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--kwt-ink);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.kwt-root *,
.kwt-root *::before,
.kwt-root *::after { box-sizing: border-box; }

/* ---------- layout ---------- */
.kwt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.kwt-readouts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.kwt-lessons { grid-column: 1 / -1; }

@container (max-width: 430px) {
  .kwt-readouts { grid-template-columns: 1fr; }
}

@container (min-width: 880px) {
  .kwt-row { grid-template-columns: minmax(0, 1fr) 272px; gap: 18px; }
  .kwt-readouts { grid-template-columns: 1fr; }
  .kwt-lessons { grid-column: auto; }
}

.kwt-panel {
  background: var(--kwt-panel);
  border: 1px solid var(--kwt-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(6, 42, 63, 0.05);
}

/* ---------- stage ---------- */
.kwt-stage {
  position: relative;
  touch-action: none;
  cursor: grab;
  overflow: hidden;
}

.kwt-stage.kwt-dragging { cursor: grabbing; }
.kwt-stage:focus-visible { outline: 3px solid rgba(240, 144, 44, 0.85); outline-offset: 2px; }

.kwt-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px 16px 0 0;
}

.kwt-hint {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  color: var(--kwt-ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--kwt-line);
  border-left: 4px solid var(--kwt-accent);
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(6, 42, 63, 0.08);
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100% - 24px);
}

.kwt-hint small {
  display: block;
  font-weight: 400;
  color: var(--kwt-muted);
  font-size: 12px;
}

.kwt-hint.kwt-gone { opacity: 0; transition: opacity 0.4s ease; }

/* ---------- legend ---------- */
.kwt-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--kwt-line);
  font-size: 13px;
  font-weight: 600;
  color: var(--kwt-ink);
}

.kwt-legend div { display: flex; align-items: center; gap: 8px; }

.kwt-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

/* ---------- readout cards ---------- */
.kwt-card {
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.kwt-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kwt-muted);
}

.kwt-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.kwt-stat b {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--kwt-ink);
}

.kwt-stat span { font-size: 13.5px; color: var(--kwt-muted); }

/* ---------- pull gauge ---------- */
.kwt-gauge {
  position: relative;
  height: 14px;
  background: var(--kwt-panel-2);
  border-radius: 999px;
  overflow: hidden;
}

.kwt-fill {
  position: absolute;
  inset: 0 100% 0 0;
  background: var(--kwt-min);
  border-radius: 999px;
  transition: background 0.15s linear;
}

.kwt-mark {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 2px;
  left: 78%;
  background: var(--kwt-full);
  opacity: 0.55;
}

/* ---------- wind slider ---------- */
.kwt-wind {
  width: 100%;
  accent-color: var(--kwt-accent);
  margin: 2px 0 0;
}

.kwt-wind:focus-visible { outline: 3px solid rgba(240, 144, 44, 0.85); outline-offset: 4px; }

.kwt-range-ends {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--kwt-muted);
}

.kwt-wind-val {
  font-weight: 700;
  color: var(--kwt-ink);
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
}

/* ---------- mini lessons ---------- */
.kwt-drill-row { display: flex; flex-wrap: wrap; gap: 6px; }

.kwt-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--kwt-ink);
  background: var(--kwt-panel-2);
  border: 1px solid var(--kwt-line);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: normal;
}

.kwt-btn:hover { border-color: var(--kwt-muted); background: var(--kwt-panel-2); }
.kwt-btn:focus-visible { outline: 3px solid rgba(240, 144, 44, 0.85); outline-offset: 2px; }

.kwt-btn[aria-pressed="true"] {
  background: var(--kwt-ink);
  border-color: var(--kwt-ink);
  color: #ffffff;
}

.kwt-verdict {
  font-size: 13.5px;
  min-height: 4.2em;
  color: var(--kwt-muted);
  background: var(--kwt-panel-2);
  border-radius: 10px;
  padding: 9px 12px;
}

.kwt-verdict.kwt-win { color: #1d5c3d; background: #e5efe7; }
.kwt-verdict.kwt-fail { color: #8a4a12; background: #f7ecd9; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .kwt-root *,
  .kwt-root *::before,
  .kwt-root *::after { transition: none !important; }
}
