/* =================================================================
   MedType Academy — Styles
   Brand: South Texas Training Center — teal/navy + vibrant green
   Type: Barlow Condensed (headings), Barlow (body), JetBrains Mono (typing)
   ================================================================= */

:root {
  /* Brand colors from South Texas Training Center */
  --brand-navy: #1a4a5e;       /* deep teal/navy - primary */
  --brand-navy-dark: #123846;
  --brand-navy-deep: #0c2833;
  --brand-teal: #2a7189;        /* medium teal */
  --brand-green: #40c474;       /* vibrant action green */
  --brand-green-dark: #2fa85f;
  --brand-green-bright: #5bd88b;

  /* Neutrals */
  --white: #ffffff;
  --off-white: #fafbfc;
  --cream: #f4f6f8;
  --line: #e2e7ec;
  --line-dark: #cbd3dc;
  --ink: #0f2430;
  --ink-soft: #3b4a54;
  --muted: #6b7a84;

  /* Feedback */
  --error: #e04747;
  --error-bg: #fdecec;
  --success: var(--brand-green);
  --gold: #f1b947;

  /* Layout */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(15, 36, 48, 0.06);
  --shadow: 0 6px 24px rgba(15, 36, 48, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 36, 48, 0.16);

  --container: 1180px;
  --font-head: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--off-white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: var(--brand-navy);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* =============== BUTTONS =============== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand-green);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(64, 196, 116, 0.35);
}
.btn-primary:hover {
  background: var(--brand-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(64, 196, 116, 0.45);
}
.btn-ghost {
  background: transparent;
  color: var(--brand-navy);
  border: 2px solid var(--brand-navy);
}
.btn-ghost:hover { background: var(--brand-navy); color: var(--white); }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* =============== HEADER =============== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.logo-mark { width: 44px; height: 44px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name {
  font-family: var(--font-head);
  font-weight: 800; font-size: 1.15rem;
  color: var(--brand-navy);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.logo-sub {
  font-family: var(--font-head);
  font-weight: 600; font-size: 0.72rem;
  color: var(--brand-green);
  letter-spacing: 0.22em;
  margin-top: 3px;
}

.main-nav { display: flex; gap: 4px; }
.nav-btn {
  background: transparent; border: none;
  padding: 10px 16px;
  font-family: var(--font-head);
  font-size: 0.95rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-btn:hover { color: var(--brand-green); background: rgba(64, 196, 116, 0.08); }

.profile-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--brand-navy);
  color: var(--white);
  border-radius: 100px;
  font-family: var(--font-head);
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.05em;
}
.chip-divider { opacity: 0.4; }
.chip-label { opacity: 0.7; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.15em; }
.chip-icon { font-size: 1rem; }

/* =============== SCREENS =============== */
.screen { display: none; min-height: calc(100vh - 76px - 60px); }
.screen.active { display: block; }

.screen-head {
  padding: 56px 0 32px;
  text-align: center;
}
.screen-head h1 { margin-bottom: 12px; }
.screen-head p { color: var(--muted); font-size: 1.1rem; }

/* =============== HERO =============== */
.hero {
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-deep) 100%);
  color: var(--white);
  padding: 72px 0 88px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(64, 196, 116, 0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: 64px; align-items: center;
  position: relative;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: var(--brand-green);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  color: var(--white);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  margin-bottom: 24px;
}
.accent { color: var(--brand-green); }
.lead {
  font-size: 1.15rem; line-height: 1.6;
  color: rgba(255,255,255,0.85);
  max-width: 540px;
  margin-bottom: 32px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-ctas .btn-ghost {
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
}
.hero-ctas .btn-ghost:hover {
  background: var(--white);
  color: var(--brand-navy);
  border-color: var(--white);
}

/* ============ INTRO CARD (in hero) ============ */
.intro-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(64, 196, 116, 0.35);
  border-left: 4px solid var(--brand-green);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  max-width: 560px;
  backdrop-filter: blur(6px);
}
.intro-card-eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-green-bright);
  margin-bottom: 10px;
}
.intro-card-text {
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 14px 0;
}
.intro-card-text strong { color: var(--white); font-weight: 600; }
.intro-card-signin {
  font-size: 0.92rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 16px 0;
}
.intro-card-signin strong { color: var(--brand-green-bright); font-weight: 600; }
.intro-card-step {
  display: inline-block;
  min-width: 1.4em;
  font-weight: 700;
  color: var(--brand-green);
  margin-right: 2px;
}
.intro-card-ctas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.intro-card-ctas .btn-primary {
  padding: 10px 18px;
  font-size: 0.95rem;
}
.intro-card-ctas .btn-ghost {
  padding: 10px 18px;
  font-size: 0.95rem;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}
.intro-card-ctas .btn-ghost:hover {
  background: var(--white);
  color: var(--brand-navy);
  border-color: var(--white);
}
@media (max-width: 640px) {
  .intro-card { padding: 16px 18px; margin-bottom: 24px; }
  .intro-card-signin { font-size: 0.88rem; }
  .intro-card-ctas .btn-primary,
  .intro-card-ctas .btn-ghost { width: 100%; }
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 540px;
}
.hero-stats.hero-stats-3 {
  grid-template-columns: repeat(3, 1fr);
  max-width: 640px;
  gap: 14px;
}
.hero-stats > div {
  display: flex; flex-direction: column;
  border-left: 2px solid var(--brand-green);
  padding-left: 14px;
}
.hero-stats strong {
  font-family: var(--font-head);
  font-size: 2rem; font-weight: 700;
  color: var(--white);
  line-height: 1;
}
.hero-stats span {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}
/* Hero stat cards (typing test / simulation charts / study notes) */
.hero-stat-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-md, 12px);
  padding: 16px 16px 14px;
  display: flex; flex-direction: column; align-items: flex-start;
  text-align: left;
  color: var(--white);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  font: inherit;
}
.hero-stat-card:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.10);
  border-color: var(--brand-green);
}
.hero-stat-card .hero-stat-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
  line-height: 1;
}
.hero-stat-card strong {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 4px;
}
.hero-stat-card span:not(.hero-stat-icon) {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.35;
}

.hero-visual { display: flex; justify-content: center; }
.visual-card {
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  transform: rotate(-1.5deg);
}
.visual-header {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.visual-header .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-dark); }
.visual-header .red { background: #ff6159; }
.visual-header .amber { background: #ffbd2e; }
.visual-header .green { background: var(--brand-green); }
.visual-title {
  margin-left: 8px;
  font-family: var(--font-head);
  font-size: 0.85rem; font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.visual-body { padding: 28px 24px; }
.typed-line {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  line-height: 1.7;
  margin-bottom: 24px;
}
.typed { color: var(--brand-green); font-weight: 500; }
.untyped { color: var(--muted); }
.cursor-block {
  display: inline-block;
  width: 2px; height: 1.3rem;
  background: var(--brand-navy);
  animation: blink 1s infinite;
  vertical-align: middle;
  margin: 0 1px;
}
@keyframes blink { 50% { opacity: 0; } }

.visual-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.visual-meta > div { display: flex; flex-direction: column; }
.meta-label {
  font-family: var(--font-head);
  font-size: 0.7rem; font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.meta-value {
  font-family: var(--font-head);
  font-size: 1.5rem; font-weight: 700;
  color: var(--brand-navy);
  margin-top: 2px;
}

/* =============== TIERS PREVIEW =============== */
.tiers-preview, .how-it-works { padding: 80px 0; }
.section-title {
  text-align: center;
  margin-bottom: 12px;
}
.section-title.small { font-size: 1.5rem; text-align: left; margin-top: 48px; }
.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 48px;
}

.tiers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.tier-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.tier-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--brand-green);
}
.tier-number {
  font-family: var(--font-head);
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--brand-green);
}
.tier-card h3 { margin: 8px 0 4px; }
.tier-card .tier-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.tier-card ul {
  list-style: none; padding: 0; margin: 0;
}
.tier-card li {
  padding: 6px 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
}
.tier-card li:first-child { border-top: none; }
.tier-card .tier-goal {
  margin-top: 18px; padding-top: 14px;
  border-top: 2px solid var(--brand-navy);
  font-family: var(--font-head);
  font-size: 0.95rem; font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: 0.05em;
}

/* =============== HOW IT WORKS =============== */
.how-it-works { background: var(--cream); }
.steps-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.step {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.step-num {
  font-family: var(--font-head);
  font-size: 2.4rem; font-weight: 800;
  color: var(--brand-green);
  line-height: 1; margin-bottom: 12px;
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* =============== LESSON MAP =============== */
.lesson-map {
  display: flex; flex-direction: column; gap: 40px;
  padding-bottom: 80px;
}
.tier-row { position: relative; }
.tier-row-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
}
.tier-row-head .tier-num {
  font-family: var(--font-head);
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--brand-green);
}
.tier-row-head h2 {
  margin: 0;
  font-size: 1.8rem;
}
.tier-row-head .tier-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.95rem;
}

.lesson-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.lesson-card {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  display: flex; flex-direction: column;
  min-height: 160px;
}
.lesson-card.unlocked:hover {
  border-color: var(--brand-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.lesson-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--cream);
}
.lesson-card.completed {
  border-color: var(--brand-green);
  background: linear-gradient(180deg, var(--white) 0%, rgba(64, 196, 116, 0.04) 100%);
}
.lesson-card.boss {
  border-style: dashed;
  border-color: var(--brand-navy);
}
.lesson-card.boss.completed {
  border-style: solid;
  background: linear-gradient(180deg, var(--white) 0%, rgba(26, 74, 94, 0.05) 100%);
}
.lesson-num {
  font-family: var(--font-head);
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}
.lesson-card.boss .lesson-num { color: var(--brand-green); }
.lesson-card h3 {
  font-size: 1.1rem;
  margin: 6px 0 4px;
}
.lesson-card .lesson-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: auto;
}
.lesson-stars {
  display: flex; gap: 2px;
  margin-top: 14px;
  font-size: 1.1rem;
  color: var(--line-dark);
}
.lesson-stars .filled { color: var(--gold); }
.lock-icon {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 1rem;
  color: var(--muted);
}
.boss-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--brand-navy);
  color: var(--white);
  padding: 2px 10px;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  border-radius: 100px;
}
.lesson-card.final .boss-badge { background: var(--brand-green); }

/* =============== PLAYER =============== */
.player-container { padding: 32px 0 80px; }
.player-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.player-title { text-align: center; }
.player-eyebrow {
  display: block;
  font-family: var(--font-head);
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--brand-green);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.player-title h2 { margin: 0 0 4px; font-size: 1.7rem; }
.player-title p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.player-targets { display: flex; gap: 16px; }
.player-targets > div {
  display: flex; flex-direction: column;
  padding: 8px 14px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  min-width: 90px;
}
.player-targets span {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}
.player-targets strong {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--brand-navy);
}

.player-brief {
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-teal) 100%);
  color: var(--white);
  padding: 18px 24px;
  border-radius: var(--radius);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.player-stage {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stage-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.stage-tab {
  flex: 1;
  padding: 16px;
  background: transparent;
  border: none; border-bottom: 3px solid transparent;
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: all 0.15s;
}
.stage-tab.active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-green);
  background: var(--white);
}
.stage-tab.complete::after {
  content: ' ✓';
  color: var(--brand-green);
}

.typing-area { padding: 32px; }

.live-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
  padding: 20px;
  background: var(--brand-navy);
  border-radius: var(--radius);
  color: var(--white);
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-label {
  font-family: var(--font-head);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
}
.stat-value {
  font-family: var(--font-head);
  font-size: 2.2rem; font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  margin-top: 2px;
}

.text-display {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  line-height: 2;
  letter-spacing: 0.02em;
  background: var(--cream);
  padding: 28px 32px;
  border-radius: var(--radius);
  min-height: 160px;
  max-height: 260px;
  overflow-y: auto;
  color: var(--muted);
  outline: none;
  cursor: text;
  user-select: none;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  /* allow text to wrap naturally at word boundaries */
  white-space: normal;
  word-spacing: 0.1em;
  overflow-wrap: break-word;
  text-align: left;
}
.text-display:focus { border-color: var(--brand-green); }
.text-display .char {
  position: relative;
  transition: color 0.08s, background 0.08s;
  display: inline;
}
.text-display .char.space { white-space: pre; }
.text-display .char.space.current,
.text-display .char.space.incorrect { padding: 0 0.25em; }
.text-display .char.correct { color: var(--ink); }
.text-display .char.incorrect {
  color: var(--error);
  background: var(--error-bg);
  border-radius: 2px;
}
.text-display .char.current {
  color: var(--ink);
  background: var(--brand-green);
  color: white;
  border-radius: 2px;
  animation: pulse-current 0.8s ease-in-out infinite;
}
@keyframes pulse-current {
  0%, 100% { background: var(--brand-green); }
  50% { background: var(--brand-green-bright); }
}
.text-display .char.space.incorrect {
  background: var(--error);
}

/* =============== KEYBOARD =============== */
.keyboard {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--cream);
  border-radius: var(--radius);
  position: sticky;
  top: 84px;
  z-index: 10;
}
.kbd-row { display: flex; gap: 6px; justify-content: center; }
.key {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem; font-weight: 500;
  color: var(--ink-soft);
  transition: all 0.1s;
  position: relative;
}
.key.wide { width: 64px; }
.key.space { width: 220px; }
.key.active {
  background: var(--brand-green);
  color: var(--white);
  border-color: var(--brand-green-dark);
  transform: translateY(1px);
  box-shadow: 0 0 0 3px rgba(64, 196, 116, 0.25);
}
.key.highlight {
  background: rgba(64, 196, 116, 0.12);
  border-color: var(--brand-green);
  color: var(--brand-navy);
  font-weight: 700;
}

/* Finger color coding */
.key.finger-pinky-l { border-top: 3px solid #e07dc4; }
.key.finger-ring-l { border-top: 3px solid #9b8bd9; }
.key.finger-middle-l { border-top: 3px solid #5aa3e0; }
.key.finger-index-l { border-top: 3px solid var(--brand-green); }
.key.finger-index-r { border-top: 3px solid #f2a93d; }
.key.finger-middle-r { border-top: 3px solid #e87d5a; }
.key.finger-ring-r { border-top: 3px solid #c56b9e; }
.key.finger-pinky-r { border-top: 3px solid #d95f5f; }

.player-controls {
  display: flex; align-items: center; gap: 16px;
  margin-top: 20px;
}
.phase-hint {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* =============== PROGRESS =============== */
.progress-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 48px;
}
.progress-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.progress-card.big {
  grid-row: span 1;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-teal) 100%);
  color: var(--white);
  border: none;
}
.progress-card.big .progress-label,
.progress-card.big .progress-sub,
.progress-card.big .big-number { color: var(--white); }
.progress-label {
  font-family: var(--font-head);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--muted);
  text-transform: uppercase;
}
.big-number {
  font-family: var(--font-head);
  font-size: 2.4rem; font-weight: 800;
  color: var(--brand-navy);
  line-height: 1.2; margin: 8px 0 4px;
}
.progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 100px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-fill {
  height: 100%;
  background: var(--brand-green);
  transition: width 0.4s;
}
.progress-sub { font-size: 0.85rem; color: var(--muted); }

.scores-table {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
}
.score-row {
  display: grid;
  grid-template-columns: 60px 1fr 80px 80px 80px 100px;
  gap: 16px;
  padding: 14px 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.score-row.header {
  background: var(--cream);
  font-family: var(--font-head);
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.score-row:last-child { border-bottom: none; }
.score-row strong { color: var(--brand-navy); }

.danger-zone { text-align: center; padding: 20px 0 60px; }

/* =============== BADGES =============== */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding-bottom: 80px;
}
.badge {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: all 0.2s;
}
.badge.earned {
  border-color: var(--brand-green);
  background: linear-gradient(180deg, var(--white) 0%, rgba(64, 196, 116, 0.05) 100%);
  box-shadow: 0 8px 24px rgba(64, 196, 116, 0.1);
}
.badge-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
  filter: grayscale(1);
  opacity: 0.4;
  transition: all 0.3s;
}
.badge.earned .badge-icon {
  filter: none;
  opacity: 1;
  transform: scale(1.1);
}
.badge-name {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 6px;
}
.badge.earned .badge-name { color: var(--brand-green-dark); }
.badge-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

/* =============== MODALS =============== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 36, 48, 0.75);
  z-index: 100;
  align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 520px;
  width: 100%;
  position: relative;
  animation: modal-in 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.2);
  text-align: center;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-eyebrow {
  font-family: var(--font-head);
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--brand-green);
  text-transform: uppercase;
}
.modal h2 { margin: 8px 0 24px; }
.modal-stars {
  font-size: 3.5rem;
  margin: 16px 0 24px;
  letter-spacing: 0.1em;
}
.modal-stars .filled { color: var(--gold); }
.modal-stars .empty { color: var(--line-dark); }
.modal-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px;
  background: var(--cream);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.modal-stats > div { display: flex; flex-direction: column; }
.modal-stats span {
  font-family: var(--font-head);
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}
.modal-stats strong {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--brand-navy);
  margin-top: 2px;
}
.modal-badges {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
  min-height: 0;
}
.modal-badge-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--brand-green);
  color: var(--white);
  border-radius: 100px;
  font-family: var(--font-head);
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.05em;
  animation: badge-pop 0.5s;
}
@keyframes badge-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* =============== CERTIFICATE =============== */
.cert {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  padding: 16px;
  animation: modal-in 0.5s;
}
.cert-border {
  border: 3px double var(--brand-navy);
  padding: 12px;
  border-radius: var(--radius);
}
.cert-inner {
  border: 1px solid var(--brand-green);
  padding: 48px 40px;
  text-align: center;
  border-radius: var(--radius-sm);
}
.cert-logo { width: 60px; height: 60px; margin-bottom: 16px; }
.cert-eyebrow {
  font-family: var(--font-head);
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--brand-green);
}
.cert-title {
  font-family: var(--font-head);
  font-size: 2.2rem;
  color: var(--brand-navy);
  margin: 12px 0 8px;
}
.cert-sub { color: var(--muted); font-style: italic; margin-bottom: 12px; }
.cert-name {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--brand-navy);
  font-weight: 700;
  padding: 12px 0;
  border-bottom: 2px solid var(--brand-green);
  display: inline-block;
  min-width: 60%;
  margin-bottom: 20px;
}
.cert-body {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 500px;
  margin: 0 auto 24px;
}
.cert-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px;
  background: var(--cream);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.cert-stats > div { display: flex; flex-direction: column; }
.cert-stats span {
  font-family: var(--font-head);
  font-size: 0.75rem; color: var(--muted);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.cert-stats strong {
  font-family: var(--font-head);
  font-size: 1.4rem; color: var(--brand-navy);
}
.cert-sig { display: flex; flex-direction: column; align-items: center; }
.sig-line { width: 200px; border-top: 1px solid var(--ink); margin-bottom: 6px; }
.cert-sig span {
  font-family: var(--font-head);
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.cert-actions {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 20px;
}

@media print {
  body > *:not(#certModal) { display: none !important; }
  .cert-actions, .modal-overlay { display: none !important; }
  #certModal { position: static; background: white; padding: 40px; }
  .cert { box-shadow: none; }
}

/* =============== FOOTER =============== */
.site-footer {
  background: var(--brand-navy-deep);
  color: rgba(255,255,255,0.6);
  padding: 24px 0;
  text-align: center;
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }

/* =============== RESPONSIVE =============== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .tiers-grid, .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .lesson-row { grid-template-columns: repeat(2, 1fr); }
  .progress-grid { grid-template-columns: repeat(2, 1fr); }
  .player-head { grid-template-columns: 1fr; text-align: center; }
  .player-targets { justify-content: center; flex-wrap: wrap; }
  .main-nav { display: none; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats.hero-stats-3 { grid-template-columns: 1fr; max-width: 100%; }
  .key { width: 32px; height: 32px; font-size: 0.75rem; }
  .key.wide { width: 48px; }
  .key.space { width: 140px; }
  .text-display { font-size: 1.1rem; padding: 20px; }
  .live-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 1.6rem; }
}
@media (max-width: 560px) {
  .tiers-grid, .steps-grid, .lesson-row { grid-template-columns: 1fr; }
  .progress-grid { grid-template-columns: 1fr; }
  .logo-sub { display: none; }
  .profile-chip { font-size: 0.75rem; padding: 6px 10px; }
}

/* =============== TRACK SELECTION — HERO CHIPS =============== */
.track-chips {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 32px;
}
.track-chip {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.track-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}
.track-chip.active {
  background: var(--brand-green);
  color: var(--white);
  border-color: var(--brand-green);
  box-shadow: 0 4px 14px rgba(64, 196, 116, 0.35);
}
.track-chip.active:hover {
  background: var(--brand-green-dark);
  border-color: var(--brand-green-dark);
}

/* =============== TRACK SWITCHER — LESSONS SCREEN =============== */
.track-switcher {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-deep) 100%);
  color: var(--white);
  padding: 24px 28px;
  border-radius: var(--radius);
  margin-bottom: 36px;
  box-shadow: var(--shadow);
}
.track-switcher-head { flex: 1; min-width: 260px; }
.track-switcher-label {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-green-bright);
  margin-bottom: 6px;
}
.track-switcher-head h3 {
  color: var(--white);
  font-size: 1.4rem;
  margin: 0 0 6px;
}
.track-switcher-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  line-height: 1.5;
}
.track-switcher-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.track-switcher-actions .btn-ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.4);
}
.track-switcher-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

/* =============== TIER CHOICE CARD =============== */
.tier-card.tier-choice {
  background: linear-gradient(180deg, var(--white) 0%, rgba(64, 196, 116, 0.06) 100%);
  border: 1.5px dashed var(--brand-green);
}
.tier-card.tier-choice:hover {
  border-style: solid;
  border-color: var(--brand-green-dark);
}
.tier-card.tier-choice li strong {
  color: var(--brand-navy);
  font-family: var(--font-head);
  font-weight: 700;
}

/* =============== PROGRESS TRACK NOTE =============== */
.progress-track-note {
  background: rgba(64, 196, 116, 0.1);
  border-left: 3px solid var(--brand-green);
  padding: 12px 18px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.progress-track-note strong { color: var(--brand-navy); }
.progress-track-note a {
  color: var(--brand-green-dark);
  font-weight: 600;
  text-decoration: none;
  margin-left: 8px;
  white-space: nowrap;
}
.progress-track-note a:hover { text-decoration: underline; }

/* =============== HEADER CHIP — TRACK INDICATOR =============== */
.chip-track {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--brand-green-bright);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .track-switcher { padding: 18px 20px; }
  .track-switcher-head h3 { font-size: 1.2rem; }
  .track-switcher-actions { width: 100%; }
  .track-switcher-actions .btn { flex: 1; min-width: 0; }
  .track-chip { font-size: 0.82rem; padding: 8px 14px; }
  .chip-track { display: none; }
}

/* =============== AUTH / SIGN-IN =============== */
.auth-btn { margin-left: 12px; }

.chip-student {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--white);
  background: rgba(64, 196, 116, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guest-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: linear-gradient(90deg, rgba(64, 196, 116, 0.12), rgba(64, 196, 116, 0.04));
  border-bottom: 1px solid rgba(64, 196, 116, 0.3);
  color: var(--brand-navy);
  font-size: 0.92rem;
  flex-wrap: wrap;
  justify-content: center;
}
.guest-banner-text strong { color: var(--brand-navy-deep); }
.guest-banner-icon { font-size: 1.1rem; }

/* Modal close button (shared) */
.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--cream); color: var(--brand-navy); }

/* Sign-in card */
.signin-card {
  text-align: left;
  max-width: 440px;
  padding: 40px 36px 32px;
}
.signin-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--brand-navy);
  margin: 0 0 6px;
}
.signin-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 24px;
  line-height: 1.5;
}
.signin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-navy);
}
.field input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(64, 196, 116, 0.18);
}
.signin-error {
  color: #c0392b;
  font-size: 0.88rem;
  min-height: 1.1em;
  margin-top: -4px;
}
.signin-submit {
  margin-top: 4px;
  width: 100%;
}
.signin-fineprint {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  margin: 6px 0 0;
}

@media (max-width: 640px) {
  .auth-btn { margin-left: 6px; }
  .chip-student { display: none !important; }
  .chip-divider-student { display: none; }
  .guest-banner { font-size: 0.85rem; padding: 10px 16px; }
  .signin-card { padding: 32px 22px 24px; }
}
