/* ============================================================
   Class2Class . GROWTH LAB
   A simple, fast 30-60s minigame: you sit in the Growth Lead seat.
   Self-contained. All styles scoped under .glab2 to avoid clashes
   with index.html. Matches the editorial / Swiss-poster system:
   Fraunces for big numbers + headlines, Open Sans body, warm paper
   surfaces, purple + multicultural accents, warm hairlines.
   ============================================================ */

.glab2 {
  /* local handles that fall back to the page tokens, then to literals
     so the widget looks right even if dropped somewhere without them */
  --g-paper: var(--paper, #f6f1ea);
  --g-paper2: var(--paper-2, #efe7f7);
  --g-ink: var(--c2c-ink, #3d3a40);
  --g-soft: var(--ink-soft, #5b565f);
  --g-purple: var(--c2c-purple, #8157d9);
  --g-deep: var(--c2c-deep-purple, #53389e);
  --g-lpurple: var(--c2c-light-purple, #f4ebff);
  --g-cyan: var(--c2c-cyan, #5cb2ff);
  --g-pink: var(--c2c-pink, #ee46bc);
  --g-indigo: var(--c2c-indigo, #5a70f2);
  --g-green: var(--c2c-green, #78c142);
  --g-orange: var(--c2c-orange, #f68d39);
  --g-red: var(--c2c-red, #e8002d);
  --g-success: var(--c2c-success, #12b76a);
  --g-line: var(--line, #d8cfc2);
  --g-strong: var(--line-strong, #2c2930);
  --g-display: var(--display, 'Fraunces', Georgia, 'Times New Roman', serif);
  --g-body: var(--c2c-font, 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif);
  --g-ease: var(--ease, cubic-bezier(0.16, 1, 0.3, 1));

  position: relative;
  font-family: var(--g-body);
  color: var(--g-ink);
  background: var(--g-paper2);
  border: 1.5px solid var(--g-line);
  border-radius: 20px;
  padding: 18px 18px 16px;
  box-shadow: 0 26px 64px -36px rgba(83, 56, 158, 0.55);
  overflow: hidden;
  line-height: 1.5;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.glab2 * {
  box-sizing: border-box;
}
.glab2::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(129, 87, 217, 0.13), transparent 58%),
    radial-gradient(90% 70% at -10% 110%, rgba(92, 178, 255, 0.1), transparent 60%);
}
.glab2 > * {
  position: relative;
  z-index: 1;
}

/* ---------- top bar (stable across every step) ---------- */
.glab2-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.glab2-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g-deep);
}
.glab2-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--g-green);
  flex: none;
  animation: glab2Pulse 1.9s ease-in-out infinite;
}
@keyframes glab2Pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.2);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(18, 183, 106, 0.04);
  }
}
.glab2-step {
  font-family: var(--g-display);
  font-feature-settings: 'tnum';
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--g-soft);
  white-space: nowrap;
}
.glab2-step b {
  color: var(--g-deep);
  font-weight: 700;
}

/* progress ticks (stable) */
.glab2-ticks {
  display: flex;
  gap: 5px;
  margin-top: 11px;
}
.glab2-ticks i {
  height: 3px;
  flex: 1 1 0;
  border-radius: 3px;
  background: var(--g-line);
  transition: background 0.4s var(--g-ease);
}
.glab2-ticks i.on {
  background: linear-gradient(90deg, var(--g-purple), var(--g-indigo));
}

/* ---------- swappable body: fixed min-height so the card never
   jumps in size or position between steps. Only the inner content
   transitions. ---------- */
.glab2-body {
  margin-top: 13px;
  min-height: 392px;
  display: flex;
}
.glab2-screen {
  width: 100%;
}
.glab2-anim {
  animation: glab2In 0.4s var(--g-ease) both;
}
@keyframes glab2In {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.glab2-lead {
  font-family: var(--g-display);
  font-weight: 560;
  font-variation-settings: 'opsz' 90;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--g-ink);
  text-wrap: balance;
  margin: 0;
}
.glab2-lead em {
  font-style: italic;
  font-weight: 420;
  color: var(--g-purple);
}
.glab2-note {
  margin-top: 8px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--g-soft);
}
.glab2-note b {
  color: var(--g-ink);
  font-weight: 700;
}

/* ---------- credits meter (X / 100) ---------- */
.glab2-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--g-line);
}
.glab2-meter .mnum {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--g-display);
  font-feature-settings: 'tnum';
  letter-spacing: -0.02em;
}
.glab2-meter .mnum b {
  font-weight: 600;
  font-variation-settings: 'opsz' 144;
  font-size: clamp(1.9rem, 3.6vw, 2.3rem);
  line-height: 0.9;
  color: var(--g-ink);
}
.glab2-meter .mnum b.over {
  color: var(--g-red);
}
.glab2-meter .mden {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--g-soft);
}
.glab2-meter .mlab {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--g-soft);
  font-feature-settings: 'tnum';
  white-space: nowrap;
}
.glab2-meter .mlab.ready {
  color: var(--g-success);
}
.glab2-meter .mlab.over {
  color: var(--g-red);
}
.glab2-meter .mbar {
  flex: 1 1 auto;
  min-width: 0;
  height: 7px;
  border-radius: 7px;
  background: var(--g-line);
  overflow: hidden;
  margin-left: auto;
}
.glab2-meter .mbar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--g-purple), var(--g-indigo));
  border-radius: 7px;
  transition:
    width 0.35s var(--g-ease),
    background 0.25s var(--g-ease);
}
.glab2-meter .mbar i.over {
  background: var(--g-red);
}
.glab2-meter.ready .mbar i {
  background: linear-gradient(90deg, var(--g-purple), var(--g-success));
}

/* ---------- channels ---------- */
.glab2-chs {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 13px;
}
.glab2-ch {
  border: 1.5px solid var(--g-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  padding: 10px 12px 11px;
  transition:
    border-color 0.25s var(--g-ease),
    box-shadow 0.25s var(--g-ease),
    background 0.25s var(--g-ease);
}
.glab2-ch.live {
  border-color: var(--ch);
  box-shadow: 0 10px 24px -16px var(--ch);
  background: #fff;
}
.glab2-ch-head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.glab2-ch-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ch);
  flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ch) 22%, transparent);
}
.glab2-ch-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--g-ink);
  letter-spacing: -0.01em;
}
.glab2-ch-alloc {
  margin-left: auto;
  font-family: var(--g-display);
  font-feature-settings: 'tnum';
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--g-ink);
  min-width: 2.2em;
  text-align: right;
}
.glab2-ch-hint {
  margin-top: 3px;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--g-soft);
}

/* slider + step buttons */
.glab2-ch-ctrl {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.glab2-step-btn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1.5px solid var(--g-line);
  background: #fff;
  color: var(--g-deep);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s,
    transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.glab2-step-btn:hover {
  border-color: var(--g-purple);
}
.glab2-step-btn:active {
  transform: scale(0.9);
}
.glab2-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.glab2-range {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  height: 6px;
  border-radius: 6px;
  background: var(--g-line);
  cursor: pointer;
  margin: 0;
}
.glab2-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: transparent;
}
.glab2-range::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: transparent;
}
.glab2-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ch);
  cursor: pointer;
  box-shadow: 0 3px 8px -2px rgba(61, 58, 64, 0.4);
  transition: transform 0.12s;
}
.glab2-range::-webkit-slider-thumb:active {
  transform: scale(1.15);
}
.glab2-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ch);
  cursor: pointer;
  box-shadow: 0 3px 8px -2px rgba(61, 58, 64, 0.4);
}

/* ---------- run screen ---------- */
.glab2-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.glab2-kpi {
  border: 1.5px solid var(--g-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
  padding: 12px 13px;
}
.glab2-kpi.act {
  border-color: color-mix(in srgb, var(--g-deep) 28%, var(--g-line));
  background: #fff;
}
.glab2-kpi .klab {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--g-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.glab2-kpi .klab .kd {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.glab2-kpi .knum {
  font-family: var(--g-display);
  font-weight: 600;
  font-variation-settings: 'opsz' 144;
  font-size: clamp(1.9rem, 3.8vw, 2.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--g-ink);
  font-feature-settings: 'tnum';
  margin-top: 5px;
}
.glab2-kpi.act .knum {
  color: var(--g-deep);
}

/* simple week ticker (text only) */
.glab2-ticker {
  margin-top: 18px;
}
.glab2-ticker-bar {
  height: 7px;
  border-radius: 7px;
  background: var(--g-line);
  overflow: hidden;
}
.glab2-ticker-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--g-purple), var(--g-indigo));
  transition: width 0.25s linear;
}
.glab2-ticker-lab {
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g-soft);
  font-feature-settings: 'tnum';
}

/* ---------- scenario screen ---------- */
.glab2-event {
  margin-top: 16px;
  border: 1.5px solid var(--g-purple);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--g-lpurple), rgba(255, 255, 255, 0.55));
  padding: 14px 14px 15px;
}
.glab2-event-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g-deep);
  margin-bottom: 7px;
}
.glab2-event-tag .blip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--g-pink);
  animation: glab2Pulse 1.4s ease-in-out infinite;
}
.glab2-event-title {
  font-family: var(--g-display);
  font-weight: 560;
  font-size: 1.18rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--g-ink);
  text-wrap: balance;
}
.glab2-event-body {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--g-soft);
  margin-top: 6px;
}
.glab2-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.glab2-opt {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--g-line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 13px;
  cursor: pointer;
  font-family: var(--g-body);
  transition:
    border-color 0.2s var(--g-ease),
    box-shadow 0.2s var(--g-ease),
    transform 0.15s var(--g-ease);
  -webkit-tap-highlight-color: transparent;
}
.glab2-opt:hover {
  border-color: var(--g-purple);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -16px rgba(83, 56, 158, 0.5);
}
.glab2-opt .oic {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--g-lpurple);
  color: var(--g-deep);
  font-size: 1.1rem;
}
.glab2-opt .otx {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.glab2-opt .ot {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--g-ink);
  line-height: 1.2;
}
.glab2-opt .os {
  font-size: 0.74rem;
  color: var(--g-soft);
  line-height: 1.3;
}
.glab2-opt .oarr {
  margin-left: auto;
  color: var(--g-purple);
  font-weight: 800;
  transition: transform 0.2s var(--g-ease);
}
.glab2-opt:hover .oarr {
  transform: translateX(3px);
}

/* ---------- results ---------- */
.glab2-verdict {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.glab2-verdict .vd {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.glab2-result-head {
  font-family: var(--g-display);
  font-weight: 560;
  font-size: clamp(1.4rem, 2.7vw, 1.85rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--g-ink);
  margin-top: 8px;
  text-wrap: balance;
}
.glab2-result-sub {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--g-soft);
  margin-top: 8px;
}
.glab2-result-sub b {
  color: var(--g-deep);
  font-weight: 700;
}

.glab2-result-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.glab2-rk {
  text-align: left;
}
.glab2-rk .rlab {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g-soft);
  line-height: 1.25;
  min-height: 1.5em;
}
.glab2-rk .rnum {
  font-family: var(--g-display);
  font-weight: 600;
  font-variation-settings: 'opsz' 144;
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--g-ink);
  font-feature-settings: 'tnum';
  margin-top: 3px;
}
.glab2-rk.hl .rnum {
  color: var(--g-deep);
}

/* viz row: donut + legend */
.glab2-viz {
  display: flex;
  gap: 16px;
  margin-top: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.glab2-donut {
  flex: none;
  width: 108px;
}
.glab2-donut svg {
  width: 108px;
  height: 108px;
  display: block;
}
.glab2-legend {
  flex: 1 1 130px;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.glab2-legend .lr {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--g-ink);
  font-weight: 600;
}
.glab2-legend .lr i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}
.glab2-legend .lr b {
  margin-left: auto;
  font-weight: 700;
  font-feature-settings: 'tnum';
  color: var(--g-soft);
}

/* ---------- buttons ---------- */
.glab2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}
.glab2-replay-wrap {
  margin-top: 10px;
  justify-content: center;
}
.glab2-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--g-body);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  padding: 0.78em 1.3em;
  border-radius: 100px;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  border: none;
  color: #fff;
  background: var(--g-purple);
  transition:
    transform 0.3s var(--g-ease),
    box-shadow 0.3s var(--g-ease),
    opacity 0.25s var(--g-ease);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.glab2-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--g-deep);
  transform: translateY(101%);
  transition: transform 0.4s var(--g-ease);
}
.glab2-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -12px rgba(83, 56, 158, 0.55);
}
.glab2-btn:hover::after {
  transform: translateY(0);
}
.glab2-btn:active {
  transform: translateY(0);
}
.glab2-btn .ar {
  transition: transform 0.3s var(--g-ease);
}
.glab2-btn:hover .ar {
  transform: translate(3px, -3px);
}
.glab2-btn.full {
  width: 100%;
}
.glab2-btn:disabled {
  cursor: not-allowed;
  background: var(--g-line);
  color: var(--g-soft);
  transform: none;
  box-shadow: none;
}
.glab2-btn:disabled::after {
  display: none;
}
.glab2-replay {
  background: none;
  border: none;
  color: var(--g-deep);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: var(--g-body);
  padding: 6px 10px;
  border-radius: 100px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s var(--g-ease);
}
.glab2-replay:hover {
  background: rgba(83, 56, 158, 0.08);
}
.glab2-replay .ar {
  display: inline-block;
}

.glab2 :focus-visible {
  outline: 2.5px solid var(--g-purple);
  outline-offset: 2px;
  border-radius: 6px;
}

/* count-up pop on big numbers */
.glab2-pop {
  animation: glab2Pop 0.5s var(--g-ease);
}
@keyframes glab2Pop {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

/* sr-only */
.glab2-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- responsive: full width + tidy on small screens ---------- */
@media (max-width: 560px) {
  .glab2 {
    padding: 15px 14px 14px;
  }
  .glab2-body {
    min-height: 0;
  }
  .glab2-result-kpis {
    gap: 8px;
  }
  .glab2-viz {
    gap: 12px;
  }
  .glab2-donut,
  .glab2-donut svg {
    width: 96px;
  }
  .glab2-donut svg {
    height: 96px;
  }
}

/* ---------- reduced motion: kill optional motion, keep content ---------- */
@media (prefers-reduced-motion: reduce) {
  .glab2-dot,
  .glab2-event-tag .blip {
    animation: none !important;
  }
  .glab2-anim,
  .glab2-pop {
    animation: none !important;
  }
  .glab2-btn,
  .glab2-opt,
  .glab2-step-btn,
  .glab2-ch,
  .glab2-meter .mbar i,
  .glab2-ticker-bar i {
    transition: none !important;
  }
}
