:root {
  --color-ink: #182033;
  --color-muted: #647087;
  --color-paper: #ffffff;
  --color-soft: #f6f8fc;
  --color-line: #e5eaf3;
  --color-green: #35c976;
  --color-green-dark: #149c54;
  --color-blue: #3f8cff;
  --color-coral: #ff705d;
  --color-yellow: #ffc84a;
  --color-orange: #ff9f1c;
  --color-teal: #14b8a6;
  --color-purple: #7c5cff;
  --color-warm-ink: #513700;

  --adventure-ink: #172033;
  --adventure-muted: #627089;
  --adventure-sky: #8fdcff;
  --adventure-blue: #3f8cff;
  --adventure-ocean: #0ea5e9;
  --adventure-mint: #7be7b2;
  --adventure-green: #35c976;
  --adventure-sun: #ffd75e;
  --adventure-tortilla: #ffb84d;
  --adventure-coral: #ff705d;
  --adventure-grape: #8b5cf6;
  --adventure-berry: #ef476f;
  --adventure-paper: rgba(255, 255, 255, 0.92);
  --adventure-glass: rgba(255, 255, 255, 0.74);
  --adventure-line: rgba(63, 140, 255, 0.18);
  --adventure-map-line: rgba(47, 67, 104, 0.06);
  --adventure-shadow: 0 24px 60px rgba(31, 47, 79, 0.15);
  --adventure-pop-shadow: 0 16px 34px rgba(31, 47, 79, 0.14);
  --adventure-button-shadow: 0 14px 24px rgba(20, 184, 166, 0.24);
  --gradient-world: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58));
  --gradient-mission: linear-gradient(135deg, #fff2b8 0%, #fff8df 42%, #e8fff3 100%);
  --gradient-world-card: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 255, 0.92));
  --gradient-reward: linear-gradient(135deg, var(--adventure-sun), var(--adventure-green));
  --gradient-start: linear-gradient(135deg, var(--adventure-green), var(--adventure-ocean));

  --ink: var(--color-ink);
  --muted: var(--color-muted);
  --paper: var(--color-paper);
  --soft: var(--color-soft);
  --line: var(--color-line);
  --green: var(--color-green);
  --green-dark: var(--color-green-dark);
  --blue: var(--color-blue);
  --coral: var(--color-coral);
  --yellow: var(--color-yellow);
  --orange: var(--color-orange);
  --teal: var(--color-teal);
  --purple: var(--color-purple);
  --surface: var(--color-paper);
  --surface-soft: var(--color-soft);
  --surface-tint: #edf7ff;
  --surface-raised: rgba(255, 255, 255, 0.84);
  --border-soft: rgba(63, 140, 255, 0.16);

  --gradient-accent: linear-gradient(135deg, var(--blue), var(--teal));
  --gradient-success: linear-gradient(135deg, var(--green), var(--teal));
  --gradient-warm: linear-gradient(135deg, var(--yellow), var(--coral));
  --gradient-sunrise: linear-gradient(135deg, var(--yellow), var(--orange));
  --gradient-playful: linear-gradient(135deg, var(--purple), var(--blue));
  --gradient-gold-green: linear-gradient(135deg, #ffe27a, var(--green));
  --accent: var(--gradient-accent);

  --card-color: var(--blue);
  --next-color: var(--blue);
  --program-color: var(--blue);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --radius-pill: 999px;
  --shadow: 0 18px 45px rgba(31, 47, 79, 0.13);
  --small-shadow: 0 10px 25px rgba(31, 47, 79, 0.1);
  --focus-ring: 0 0 0 4px rgba(63, 140, 255, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 200, 74, 0.28), transparent 28rem),
    linear-gradient(180deg, #edf7ff 0%, #f8fbff 42%, #ffffff 100%);
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.is-playing {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 14px 16px 36px;
}

.hero {
  display: grid;
  gap: 14px;
  padding-bottom: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-menu {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.nav-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 3px solid white;
  border-radius: 50%;
  background: white;
  box-shadow: var(--small-shadow);
  object-fit: cover;
}

.user-menu .pill {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.change-avatar {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: #2367c7;
  background: rgba(233, 242, 255, 0.9);
  box-shadow: 0 8px 20px rgba(31, 47, 79, 0.06);
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.logout-button {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #2a3a56;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(31, 47, 79, 0.08);
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.brand-logo {
  display: block;
  width: min(168px, 42vw);
  height: auto;
  object-fit: contain;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--coral), var(--yellow));
  box-shadow: var(--small-shadow);
  font-size: 1.6rem;
  line-height: 1;
}

.pill,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid rgba(63, 140, 255, 0.18);
  border-radius: 999px;
  color: #2367c7;
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
}

.welcome {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(1.95rem, 10vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 7vw, 2.45rem);
  line-height: 1;
  letter-spacing: 0;
}

.intro {
  max-width: 36rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.selected-program {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 36px;
  align-items: center;
  margin: 2px 0 0;
  padding: 7px 13px;
  border-radius: 999px;
  color: #2367c7;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(31, 47, 79, 0.08);
  font-size: 0.86rem;
  font-weight: 900;
}

main {
  display: grid;
  gap: 14px;
  padding-top: 12px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.assignments-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 176, 32, 0.32);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 247, 214, 0.92), rgba(255, 255, 255, 0.96) 58%),
    var(--paper);
  box-shadow: var(--small-shadow);
}

.assignments-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.assignments-heading h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.7rem);
}

.assignments-list {
  display: grid;
  gap: 10px;
}

.assignments-summary-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(63, 140, 255, 0.14);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(31, 47, 79, 0.08);
}

.assignments-summary-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.assignments-summary-body h3,
.assignments-summary-body p {
  margin: 0;
}

.assignments-summary-body h3 {
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.1;
}

.assignments-summary-body p,
.assignments-summary-body small {
  display: block;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.25;
}

.assignments-summary-body p {
  margin-top: 4px;
}

.assignments-summary-body small {
  margin-top: 2px;
  font-size: 0.84rem;
}

.assignment-toggle-button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 10px 20px rgba(63, 140, 255, 0.18);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.assignment-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(63, 140, 255, 0.14);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(31, 47, 79, 0.08);
}

.assignment-card.is-unresolved {
  opacity: 0.78;
}

.assignment-card.is-completed {
  background: rgba(255, 255, 255, 0.74);
  border-color: rgba(53, 201, 118, 0.2);
}

.assignment-card-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: var(--color-warm-ink);
  background: var(--gradient-gold-green);
  font-size: 1.35rem;
  font-weight: 900;
}

.assignment-card-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.assignment-card h3,
.assignment-card p {
  margin: 0;
}

.assignment-card h3 {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.15;
}

.assignment-card p {
  color: var(--muted);
  font-weight: 800;
}

.assignment-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.assignment-status-chip,
.assignment-mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border-radius: 999px;
  padding: 4px 9px;
  color: #6f5500;
  background: #fff4bc;
  font-size: 0.78rem;
  font-weight: 900;
}

.assignment-open-button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--yellow), var(--green));
  box-shadow: 0 10px 20px rgba(53, 201, 118, 0.22);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.assignment-unavailable {
  color: var(--muted);
  font-weight: 900;
}

.assignment-empty {
  display: grid;
  gap: 4px;
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.completed-assignments-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(63, 140, 255, 0.14);
}

.completed-games-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 88px;
  padding: 16px;
  border: 1px solid rgba(53, 201, 118, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(229, 249, 239, 0.84), rgba(255, 255, 255, 0.95)),
    var(--paper);
  box-shadow: var(--small-shadow);
}

.completed-games-panel.is-expanded {
  margin-top: 2px;
}

.completed-games-copy {
  display: grid;
  gap: 3px;
}

.completed-games-copy strong {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 1000;
}

.completed-games-copy span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.completed-games-toggle {
  min-width: 178px;
}

.patatas-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 10px 20px rgba(20, 184, 166, 0.2);
  font-size: 1rem;
  font-weight: 900;
}

.patatas-back {
  justify-self: start;
}

.vocabulary-topic-back {
  margin-bottom: 2px;
}

.vocabulary-module-locked {
  opacity: 0.72;
}

.vocabulary-status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #2a3a56;
  background: #eef4ff;
  font-size: 0.78rem;
  font-weight: 900;
}

.vocabulary-status-locked {
  color: #64748b;
  background: #eef2f7;
}

.vocabulary-status-assigned {
  color: #6f5500;
  background: #fff4bc;
}

.vocabulary-status-in-progress {
  color: #92400e;
  background: #fff7d6;
}

.vocabulary-status-minimum-completed {
  color: #0d7d49;
  background: #e5f9ef;
}

.vocabulary-status-fully-completed {
  color: white;
  background: var(--green);
}

.vocabulary-progress-lines,
.vocabulary-progress-panel {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.25;
}

.vocabulary-progress-panel {
  padding: 13px 14px;
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 20px;
  color: #2367c7;
  background: rgba(233, 242, 255, 0.82);
}

.vocabulary-progress-panel strong {
  color: var(--ink);
}

.vocabulary-activity-card .module-title {
  overflow-wrap: anywhere;
}

.vocabulary-unlock-message {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 32, 51, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.vocabulary-unlock-message.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.vocabulary-unlock-panel {
  display: grid;
  gap: 13px;
  width: min(100%, 480px);
  padding: 18px;
  border-radius: 24px;
  background: white;
  box-shadow: var(--shadow);
}

.vocabulary-unlock-panel strong {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.08;
}

.vocabulary-unlock-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.35;
}

.vocabulary-unlock-actions {
  display: grid;
  gap: 9px;
}

.status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 18px;
  border: 1px dashed #cad5e6;
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.status-box.is-hidden {
  display: none;
}

.progress-sync-status {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(63, 140, 255, 0.18);
  border-radius: 14px;
  color: #245173;
  background: rgba(237, 247, 255, 0.82);
  font-size: 0.92rem;
  font-weight: 900;
}

.progress-sync-status.is-hidden {
  display: none;
}

.progress-sync-status.is-error {
  border-color: rgba(239, 68, 68, 0.25);
  color: #991b1b;
  background: rgba(254, 242, 242, 0.9);
}

.progress-sync-status.is-saving {
  color: #3f2d83;
  background: rgba(239, 232, 255, 0.85);
}

.loader {
  width: 22px;
  height: 22px;
  border: 3px solid #dce5f4;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.modules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.module-card {
  position: relative;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  min-height: 142px;
  padding: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--small-shadow);
  animation: riseIn 420ms ease both;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.module-card.is-completed {
  border-color: rgba(53, 201, 118, 0.45);
  background:
    linear-gradient(135deg, rgba(229, 249, 239, 0.72), rgba(255, 255, 255, 0.94) 44%),
    var(--paper);
}

.module-card.is-completed::after {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: white;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(53, 201, 118, 0.3);
  content: "✓";
  font-weight: 900;
}

.video-card {
  border-color: rgba(139, 92, 246, 0.22);
}

.video-art {
  background: linear-gradient(135deg, #8b5cf6, #3f8cff);
}

.video-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #5b21b6;
  background: #f1eaff;
  font-size: 0.78rem;
  font-weight: 900;
}

.video-play {
  background: linear-gradient(135deg, #8b5cf6, #3f8cff) !important;
  box-shadow: 0 10px 20px rgba(63, 140, 255, 0.22) !important;
}

.module-card:active {
  transform: scale(0.985);
}

.module-art {
  display: grid;
  place-items: center;
  align-self: start;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border-radius: 22px;
  color: white;
  background: var(--card-color, var(--blue));
  font-size: 2rem;
  font-weight: 900;
  box-shadow: inset 0 -18px 30px rgba(0, 0, 0, 0.08);
}

.module-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-body {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #2a3a56;
  background: #eef4ff;
  font-size: 0.78rem;
  font-weight: 900;
}

.tag.level {
  color: #0d7d49;
  background: #e5f9ef;
}

.done-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.done-badge:empty {
  display: none;
}

.module-title {
  margin: 0;
  font-size: 1.17rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.module-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 17px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 900;
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.module-action.play {
  color: white;
  background: linear-gradient(135deg, var(--green), var(--teal));
  box-shadow: 0 10px 20px rgba(20, 184, 166, 0.24);
}

.module-action.done {
  color: var(--green-dark);
  background: #e5f9ef;
}

.module-action:disabled {
  cursor: not-allowed;
  color: #7b8798;
  background: #eef2f7;
  box-shadow: none;
  opacity: 0.76;
}

.is-completed .module-action.done {
  color: white;
  background: var(--green);
}

.module-action:focus-visible,
.brand:focus-visible,
.logout-button:focus-visible,
.auth-button:focus-visible,
.avatar-option:focus-visible,
.change-avatar:focus-visible,
.patatas-back:focus-visible,
.icon-button:focus-visible,
.player-button:focus-visible {
  outline: 4px solid rgba(63, 140, 255, 0.28);
  outline-offset: 3px;
}

.module-action:active {
  transform: translateY(1px);
}

.grammar-dashboard {
  display: grid;
  gap: 14px;
}

.grammar-shell {
  display: grid;
  gap: 14px;
}

.grammar-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 176, 32, 0.28);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 246, 216, 0.82), rgba(255, 255, 255, 0.95) 52%),
    var(--paper);
  box-shadow: var(--small-shadow);
}

.grammar-overview-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.grammar-kicker {
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.grammar-title,
.grammar-stage-title,
.grammar-roadmap-title {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.08;
}

.grammar-title {
  font-size: clamp(1.45rem, 7vw, 2.25rem);
}

.grammar-stage-title,
.grammar-roadmap-title {
  font-size: 1.25rem;
}

.grammar-goal {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.grammar-subtitle {
  margin: 0;
  color: #7a4f00;
  font-size: 1.04rem;
  font-weight: 900;
}

.grammar-score {
  display: grid;
  place-items: center;
  align-self: start;
  min-width: 86px;
  min-height: 70px;
  padding: 10px;
  border-radius: 20px;
  color: #2a3a56;
  background: white;
  box-shadow: 0 8px 18px rgba(31, 47, 79, 0.08);
  text-align: center;
}

.grammar-score strong {
  font-size: 1.35rem;
  line-height: 1;
}

.grammar-score span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.grammar-progress {
  grid-column: 1 / -1;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.grammar-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--yellow), var(--green));
  transition: width 220ms ease;
}

.grammar-selection-header {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.grammar-selection-summary {
  display: grid;
  place-items: center;
  align-self: start;
  min-width: 86px;
  min-height: 70px;
  padding: 10px;
  border-radius: 20px;
  color: #2a3a56;
  background: #fff8dc;
  box-shadow: 0 8px 18px rgba(31, 47, 79, 0.08);
  text-align: center;
}

.grammar-selection-summary strong {
  font-size: 1.35rem;
  line-height: 1;
}

.grammar-selection-summary span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.grammar-selection-grid {
  display: grid;
  gap: 12px;
}

.grammar-progress-panel,
.grammar-parent-summary {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--small-shadow);
}

.grammar-progress-panel-copy {
  display: grid;
  gap: 5px;
}

.grammar-progress-panel-copy p,
.grammar-parent-summary p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.grammar-parent-stats {
  display: grid;
  gap: 8px;
}

.grammar-parent-stats span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  color: var(--muted);
  background: #f8fafc;
  font-weight: 900;
}

.grammar-parent-stats strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.grammar-parent-completed {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grammar-parent-completed span {
  padding: 7px 10px;
  border-radius: 999px;
  color: #2a3a56;
  background: #e9f2ff;
  font-size: 0.82rem;
  font-weight: 900;
}

.grammar-activity-back {
  justify-self: start;
}

.grammar-module-card {
  display: grid;
  gap: 12px;
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 252, 239, 0.9)),
    var(--paper);
  box-shadow: var(--small-shadow);
}

.grammar-module-card-complete {
  border-color: rgba(20, 184, 166, 0.42);
  background:
    linear-gradient(180deg, rgba(234, 250, 241, 0.96), rgba(255, 255, 255, 0.95)),
    var(--paper);
}

.grammar-module-card-locked {
  opacity: 0.76;
}

.grammar-module-topline,
.grammar-module-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.grammar-module-number {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 36px;
  padding-inline: 10px;
  border-radius: 14px;
  color: #2367c7;
  background: #e9f2ff;
  font-weight: 900;
}

.grammar-module-status {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.grammar-module-status-complete {
  color: #0d7d49;
  background: #dff7e9;
}

.grammar-module-status-available {
  color: #7a4f00;
  background: #fff0bd;
}

.grammar-module-status-locked {
  color: #64748b;
  background: #edf2f7;
}

.grammar-module-copy {
  display: grid;
  align-content: start;
  gap: 6px;
}

.grammar-module-title,
.grammar-module-polish,
.grammar-module-description {
  margin: 0;
}

.grammar-module-title {
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.08;
}

.grammar-module-polish {
  color: #7a4f00;
  font-weight: 900;
}

.grammar-module-description {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.grammar-module-progress {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.grammar-module-progress-track {
  flex: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.92);
}

.grammar-module-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--yellow), var(--green));
  transition: width 220ms ease;
}

.grammar-module-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.grammar-module-state strong {
  color: #7a4f00;
}

.grammar-module-button {
  align-self: end;
  width: 100%;
}

.grammar-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.grammar-steps::-webkit-scrollbar {
  display: none;
}

.grammar-step {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 78px;
  min-width: 76px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(31, 47, 79, 0.07);
  font-weight: 900;
}

.grammar-step-active {
  border-color: rgba(20, 184, 166, 0.45);
  color: var(--ink);
  background: #eafaf1;
}

.grammar-step-done .grammar-step-number {
  color: white;
  background: var(--green);
}

.grammar-step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  color: #2367c7;
  background: #e9f2ff;
  font-size: 0.9rem;
}

.grammar-step-label {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grammar-stage,
.grammar-card,
.grammar-roadmap {
  display: grid;
  gap: 14px;
}

.grammar-card,
.grammar-roadmap {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--small-shadow);
}

.grammar-learn-grid,
.grammar-fmu-grid,
.grammar-color-grid,
.grammar-number-grid,
.grammar-animal-grid,
.grammar-food-grid,
.grammar-body-grid,
.grammar-emotion-grid,
.grammar-weather-grid,
.grammar-family-grid,
.grammar-ability-grid,
.grammar-choice-list,
.grammar-word-bank,
.grammar-name-list,
.grammar-chip-list,
.grammar-vocab-list,
.grammar-roadmap-list {
  display: grid;
  gap: 10px;
}

.grammar-learn-card,
.grammar-color-card,
.grammar-number-card,
.grammar-animal-card,
.grammar-food-card,
.grammar-body-card,
.grammar-emotion-card,
.grammar-weather-card,
.grammar-family-card,
.grammar-ability-card,
.grammar-fmu-card,
.grammar-roadmap-item {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 13px;
  border: 1px solid rgba(229, 234, 243, 0.9);
  border-radius: 18px;
  background: #f8fbff;
}

.grammar-learn-card strong {
  font-size: 1.2rem;
}

.grammar-number-card {
  justify-items: center;
  min-height: 128px;
  text-align: center;
}

.grammar-animal-card,
.grammar-food-card,
.grammar-body-card,
.grammar-emotion-card,
.grammar-weather-card,
.grammar-family-card,
.grammar-ability-card {
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  min-height: 112px;
}

.grammar-animal-card strong,
.grammar-food-card strong,
.grammar-body-card strong,
.grammar-emotion-card strong,
.grammar-weather-card strong,
.grammar-family-card strong,
.grammar-ability-card strong,
.grammar-animal-card span:not(.grammar-animal-emoji),
.grammar-food-card span:not(.grammar-food-emoji),
.grammar-body-card span:not(.grammar-body-emoji),
.grammar-emotion-card span:not(.grammar-emotion-emoji),
.grammar-weather-card span:not(.grammar-weather-emoji),
.grammar-family-card span:not(.grammar-family-emoji),
.grammar-ability-card span:not(.grammar-ability-emoji),
.grammar-animal-card small,
.grammar-food-card small,
.grammar-body-card small,
.grammar-emotion-card small,
.grammar-weather-card small,
.grammar-family-card small,
.grammar-ability-card small {
  grid-column: 2;
}

.grammar-animal-emoji,
.grammar-food-emoji,
.grammar-body-emoji,
.grammar-emotion-emoji,
.grammar-weather-emoji,
.grammar-family-emoji,
.grammar-ability-emoji {
  grid-row: 1 / span 3;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 17px;
  background: linear-gradient(135deg, #fff6d8, #eafaf1);
  box-shadow: inset 0 -10px 18px rgba(31, 47, 79, 0.06);
  font-size: 2rem;
}

.grammar-number-digit {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  box-shadow: 0 10px 20px rgba(63, 140, 255, 0.18);
  font-size: 1.75rem;
  font-weight: 900;
}

.grammar-number-card strong {
  font-size: 1.08rem;
}

.grammar-animal-card strong,
.grammar-food-card strong,
.grammar-body-card strong,
.grammar-emotion-card strong,
.grammar-weather-card strong,
.grammar-family-card strong,
.grammar-ability-card strong {
  font-size: 1.1rem;
}

.grammar-learn-card span,
.grammar-color-card span,
.grammar-number-card span,
.grammar-animal-card span:not(.grammar-animal-emoji),
.grammar-food-card span:not(.grammar-food-emoji),
.grammar-body-card span:not(.grammar-body-emoji),
.grammar-emotion-card span:not(.grammar-emotion-emoji),
.grammar-weather-card span:not(.grammar-weather-emoji),
.grammar-family-card span:not(.grammar-family-emoji),
.grammar-ability-card span:not(.grammar-ability-emoji),
.grammar-fmu-card span,
.grammar-roadmap-item strong {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.grammar-color-card {
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
}

.grammar-color-card strong,
.grammar-color-card span,
.grammar-color-card small {
  grid-column: 2;
}

.grammar-color-card small,
.grammar-animal-card small,
.grammar-food-card small,
.grammar-body-card small,
.grammar-emotion-card small,
.grammar-weather-card small,
.grammar-family-card small,
.grammar-ability-card small,
.grammar-fmu-card small {
  color: #2a3a56;
  font-size: 0.86rem;
  font-weight: 900;
}

.grammar-weather-section,
.grammar-family-section,
.grammar-ability-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.grammar-weather-section h4,
.grammar-family-section h4,
.grammar-ability-section h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.grammar-color-swatch {
  grid-row: 1 / span 3;
  display: block;
  width: 44px;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 15px;
  box-shadow: inset 0 -12px 20px rgba(0, 0, 0, 0.08);
}

.grammar-fmu-card strong {
  font-size: 1.02rem;
  line-height: 1.18;
}

.grammar-tip,
.grammar-note-list p,
.grammar-feedback,
.grammar-built-sentence {
  margin: 0;
  font-weight: 900;
  line-height: 1.35;
}

.grammar-tip {
  padding: 13px;
  border-radius: 18px;
  color: #7a4f00;
  background: #fff6d8;
}

.grammar-note-list {
  display: grid;
  gap: 8px;
}

.grammar-note-list p {
  color: var(--muted);
}

.grammar-prompt,
.grammar-answer {
  display: grid;
  place-items: center;
  min-height: 76px;
  margin: 0;
  padding: 14px;
  border-radius: 20px;
  color: var(--ink);
  background: #eef4ff;
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
}

.grammar-question {
  margin: 0;
  color: #2a3a56;
  font-weight: 900;
  line-height: 1.35;
}

.grammar-chip-list,
.grammar-vocab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grammar-chip,
.grammar-vocab-list span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 900;
}

.grammar-chip {
  color: #2367c7;
  background: #e9f2ff;
}

.grammar-vocab-list span {
  color: #2a3a56;
  background: #f8fbff;
  border: 1px solid var(--line);
}

.grammar-color-display {
  width: min(100%, 220px);
  min-height: 110px;
  border: 2px solid rgba(31, 47, 79, 0.08);
  border-radius: 24px;
  box-shadow: inset 0 -22px 35px rgba(0, 0, 0, 0.08), var(--small-shadow);
}

.grammar-color-dot {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid rgba(31, 47, 79, 0.12);
  border-radius: 50%;
  box-shadow: inset 0 -5px 8px rgba(0, 0, 0, 0.08);
}

.grammar-count-display {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 84px;
  padding: 13px;
  border-radius: 20px;
  background: #eef4ff;
  font-size: 2rem;
}

.grammar-animal-display,
.grammar-food-display,
.grammar-body-display,
.grammar-emotion-display,
.grammar-weather-display,
.grammar-family-display,
.grammar-ability-display {
  display: grid;
  place-items: center;
  width: min(100%, 180px);
  min-height: 112px;
  border-radius: 24px;
  background: #eef4ff;
  box-shadow: inset 0 -18px 28px rgba(31, 47, 79, 0.06), var(--small-shadow);
  font-size: 4rem;
}

.grammar-choice,
.grammar-word,
.grammar-name,
.grammar-button {
  min-height: 46px;
  border-radius: 16px;
  font-weight: 900;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    opacity 180ms ease;
}

.grammar-choice {
  padding: 11px 13px;
  color: #2a3a56;
  background: #f8fbff;
  border: 1px solid var(--line);
  text-align: left;
}

.grammar-word,
.grammar-name {
  padding: 10px 15px;
  color: #2367c7;
  background: #e9f2ff;
}

.grammar-color-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.grammar-animal-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.grammar-word:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.grammar-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.grammar-word-bank,
.grammar-name-list,
.grammar-actions,
.grammar-final-actions,
.grammar-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.grammar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  text-align: center;
}

.grammar-button-primary {
  color: white;
  background: linear-gradient(135deg, var(--green), var(--teal));
  box-shadow: 0 10px 20px rgba(20, 184, 166, 0.22);
}

.grammar-button-secondary {
  color: #2367c7;
  background: #e9f2ff;
}

.grammar-feedback {
  padding: 12px 13px;
  border-radius: 18px;
}

.grammar-feedback-correct {
  color: #0d7d49;
  background: #e5f9ef;
}

.grammar-feedback-incorrect {
  color: #b42318;
  background: #fff0ee;
}

.grammar-feedback-neutral {
  color: #2a3a56;
  background: #eef4ff;
}

.grammar-built-sentence {
  padding: 13px;
  border-radius: 18px;
  color: #2a3a56;
  background: #f8fbff;
  font-size: 1.08rem;
}

.grammar-final {
  border-color: rgba(53, 201, 118, 0.4);
  background:
    linear-gradient(135deg, rgba(229, 249, 239, 0.86), rgba(255, 255, 255, 0.96) 58%),
    var(--paper);
}

.grammar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #7a4f00;
  background: #fff6d8;
  box-shadow: 0 8px 18px rgba(255, 200, 74, 0.2);
  font-weight: 900;
}

.grammar-stars {
  color: var(--yellow);
  font-size: 1.55rem;
  line-height: 1;
  text-shadow: 0 3px 8px rgba(255, 200, 74, 0.3);
}

.grammar-preview-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(63, 140, 255, 0.16);
  border-radius: 20px;
  background: #f8fbff;
}

.grammar-preview-card p {
  margin: 0;
  color: #2a3a56;
  font-size: 1.08rem;
  font-weight: 900;
}

.grammar-production-group {
  display: grid;
  gap: 8px;
}

.grammar-production-group strong {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.grammar-production-selected {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.grammar-roadmap-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 56px;
  text-align: left;
}

.grammar-roadmap-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.grammar-unit-tile {
  cursor: pointer;
}

.grammar-unit-active {
  border-color: rgba(20, 184, 166, 0.45);
  background: #eafaf1;
}

.grammar-unit-completed strong {
  color: #0d7d49;
}

.grammar-unit-tile:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.grammar-match-grid {
  display: grid;
  gap: 10px;
}

.grammar-match-column {
  display: grid;
  gap: 8px;
}

.grammar-match-color {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #2a3a56;
  background: #f8fbff;
  font-weight: 900;
  text-align: left;
}

.grammar-match-selected {
  border-color: rgba(63, 140, 255, 0.55);
  background: #e9f2ff;
}

.grammar-match-done {
  border-color: rgba(53, 201, 118, 0.38);
  background: #e5f9ef;
}

.grammar-number-match {
  justify-content: center;
}

.grammar-animal-match,
.grammar-food-match,
.grammar-body-match,
.grammar-emotion-match,
.grammar-weather-match,
.grammar-family-match,
.grammar-ability-match {
  justify-content: flex-start;
}

.grammar-number-mini {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  font-weight: 900;
}

.grammar-animal-mini,
.grammar-food-mini,
.grammar-body-mini,
.grammar-emotion-mini,
.grammar-weather-mini,
.grammar-family-mini,
.grammar-ability-mini {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #eef4ff;
  font-size: 1.55rem;
}

.grammar-choice:focus-visible,
.grammar-word:focus-visible,
.grammar-name:focus-visible,
.grammar-button:focus-visible,
.grammar-step:focus-visible,
.grammar-match-color:focus-visible {
  outline: 4px solid rgba(63, 140, 255, 0.28);
  outline-offset: 3px;
}

.grammar-choice:active,
.grammar-word:active,
.grammar-name:active,
.grammar-button:active,
.grammar-step:active,
.grammar-match-color:active {
  transform: scale(0.98);
}

.empty-state {
  padding: 22px;
  border-radius: 24px;
  color: var(--muted);
  background: var(--paper);
  font-weight: 800;
  text-align: center;
}

.player-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(237, 247, 255, 0.98), rgba(255, 255, 255, 0.98)),
    var(--soft);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
  transform: translateY(14px);
}

.player-view[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.player-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: min(100%, 1180px);
  min-height: calc(100vh - 20px);
  min-height: calc(100dvh - 20px);
  margin: 0 auto;
}

.player-topbar {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 6px 2px 2px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--small-shadow);
  font-size: 1.4rem;
  font-weight: 900;
}

.player-title-wrap {
  min-width: 0;
}

.player-category {
  display: block;
  margin-bottom: 2px;
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.player-title-wrap h2 {
  overflow: hidden;
  margin: 0;
  font-size: clamp(1.2rem, 6vw, 2rem);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-frame-wrap {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(63, 140, 255, 0.09), rgba(53, 201, 118, 0.1)),
    white;
  box-shadow: var(--shadow);
}

.frame-status {
  position: absolute;
  inset: auto 14px 14px;
  z-index: 2;
  display: grid;
  justify-items: start;
  gap: 5px;
  max-width: 340px;
  padding: 14px;
  border: 1px solid rgba(202, 213, 230, 0.8);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(31, 47, 79, 0.12);
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.frame-status strong {
  color: var(--ink);
}

.frame-status p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.25;
}

.game-frame-wrap.is-loading .frame-status,
.video-frame-wrap.is-loading .frame-status,
.game-frame-wrap.is-error .frame-status,
.video-frame-wrap.is-error .frame-status {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.game-frame-wrap.is-ready .frame-status,
.video-frame-wrap.is-ready .frame-status {
  opacity: 0;
  pointer-events: none;
}

.game-frame-wrap.is-error .frame-status,
.video-frame-wrap.is-error .frame-status {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(255, 247, 247, 0.96);
}

.frame-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
}

.game-frame {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
  background: white;
}

.video-frame-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #101827;
  box-shadow: var(--shadow);
}

.video-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 230px;
  border: 0;
  background: #101827;
}

.player-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

.video-actions .player-button.primary {
  grid-column: 1 / -1;
}

.player-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 0.98rem;
  font-weight: 900;
  text-align: center;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    opacity 180ms ease;
}

.player-button.primary {
  color: white;
  background: linear-gradient(135deg, var(--green), var(--teal));
  box-shadow: 0 12px 24px rgba(20, 184, 166, 0.22);
}

.player-button.secondary {
  color: #2367c7;
  background: #e9f2ff;
}

.player-button.quiet {
  grid-column: 1 / -1;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
}

.player-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.player-button:active,
.icon-button:active {
  transform: scale(0.98);
}

.celebration {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 30;
  min-width: 190px;
  padding: 14px 18px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--coral), var(--yellow));
  box-shadow: var(--shadow);
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px) scale(0.96);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.celebration.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.auth-page {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
}

.auth-shell {
  display: grid;
  width: min(100%, 520px);
  padding: 18px;
}

.avatar-shell {
  display: grid;
  width: min(100%, 980px);
  padding: 18px;
}

.program-shell {
  display: grid;
  width: min(100%, 860px);
  padding: 18px;
}

.auth-card {
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.avatar-card {
  display: grid;
  gap: 20px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.program-card {
  display: grid;
  gap: 22px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.program-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.program-top .auth-logo-link {
  justify-self: auto;
}

.program-top .auth-logo {
  width: min(168px, 42vw);
}

.program-user {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.profile-greeting-link {
  display: block;
  min-width: 0;
  max-width: 100%;
  border-radius: 999px;
  text-decoration: none;
}

.profile-greeting-link .pill::after {
  content: " ›";
}

.profile-greeting-link .pill {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-greeting-link:hover .pill,
.profile-greeting-link:focus-visible .pill {
  color: #2367c7;
}

.auth-logo-link {
  display: grid;
  justify-items: center;
  gap: 10px;
  justify-self: center;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.auth-logo {
  display: block;
  width: min(190px, 56vw);
  height: auto;
  object-fit: contain;
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.auth-copy h1 {
  font-size: clamp(2rem, 10vw, 3.4rem);
}

.auth-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #2a3a56;
  font-weight: 900;
}

.auth-form input {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: #f8fbff;
  font: inherit;
  font-weight: 800;
  outline: 0;
}

.auth-form input:focus {
  border-color: rgba(63, 140, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(63, 140, 255, 0.16);
}

.auth-button {
  min-height: 54px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, var(--green), var(--teal));
  box-shadow: 0 12px 24px rgba(20, 184, 166, 0.22);
  font-size: 1rem;
  font-weight: 900;
}

.auth-message {
  min-height: 22px;
  margin: 0;
  color: #b42318;
  font-weight: 900;
}

.auth-link {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.auth-link a {
  color: #2367c7;
}

.student-dashboard,
.dashboard-section {
  display: grid;
  gap: 14px;
}

.student-dashboard.is-hidden {
  display: none;
}

.dashboard-section {
  padding: 16px;
  border: 1px solid rgba(63, 140, 255, 0.14);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--small-shadow);
}

.dashboard-assignments {
  border-color: rgba(255, 176, 32, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 247, 214, 0.92), rgba(255, 255, 255, 0.96) 58%),
    var(--paper);
}

.dashboard-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-section-heading h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.program-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.avatar-option {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-height: 176px;
  padding: 12px;
  border: 3px solid transparent;
  border-radius: 24px;
  color: var(--ink);
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(31, 47, 79, 0.08);
  font-weight: 900;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.avatar-option img {
  width: 100%;
  max-width: 128px;
  aspect-ratio: 1;
  border-radius: 22px;
  object-fit: contain;
  background: white;
}

.avatar-option.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 5px rgba(53, 201, 118, 0.18), var(--shadow);
}

.avatar-option:active {
  transform: scale(0.98);
}

.avatar-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  padding-top: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95) 30%);
}

@media (hover: hover) {
  .module-card:hover {
    transform: translateY(-4px);
    border-color: rgba(63, 140, 255, 0.32);
    box-shadow: var(--shadow);
  }

  .module-action:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
  }

  .auth-button:hover,
  .avatar-option:hover,
  .change-avatar:hover,
  .logout-button:hover,
  .player-button:not(:disabled):hover,
  .icon-button:hover,
  .grammar-choice:hover,
  .grammar-word:not(:disabled):hover,
  .grammar-name:hover,
  .grammar-button:hover,
  .grammar-step:hover,
  .grammar-match-color:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
  }
}

@media (min-width: 680px) {
  .app-shell {
    padding: 26px 28px 48px;
  }

  .hero {
    gap: 24px;
  }

  .modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grammar-selection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grammar-progress-panel {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr);
    align-items: center;
  }

  .grammar-progress-panel .grammar-progress {
    grid-column: auto;
  }

  .grammar-parent-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .avatar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grammar-learn-grid,
  .grammar-color-grid,
  .grammar-number-grid,
  .grammar-animal-grid,
  .grammar-food-grid,
  .grammar-body-grid,
  .grammar-emotion-grid,
  .grammar-weather-grid,
  .grammar-family-grid,
  .grammar-ability-grid,
  .grammar-fmu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grammar-match-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grammar-roadmap-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .player-view {
    padding: 18px;
  }

  .player-panel {
    min-height: calc(100vh - 36px);
    min-height: calc(100dvh - 36px);
  }

  .player-actions {
    grid-template-columns: minmax(160px, 0.8fr) minmax(170px, 0.8fr) minmax(180px, 1fr);
  }

  .video-actions {
    grid-template-columns: minmax(240px, 1.2fr) minmax(170px, 0.8fr) minmax(180px, 0.8fr);
  }

  .video-actions .player-button.primary {
    grid-column: auto;
  }

  .player-button.quiet {
    grid-column: auto;
  }
}

@media (max-width: 420px) {
  .assignments-summary-card {
    grid-template-columns: 1fr;
  }

  .assignments-summary-body {
    display: grid;
  }

  .assignment-toggle-button {
    width: 100%;
  }

  .grammar-selection-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .grammar-selection-summary,
  .grammar-score {
    width: 100%;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand {
    font-size: 0.98rem;
  }

  .user-menu {
    display: grid;
    justify-items: end;
    gap: 6px;
  }

  .nav-avatar {
    width: 38px;
    height: 38px;
  }

  .pill,
  .count-badge {
    font-size: 0.8rem;
    padding-inline: 10px;
  }

  .module-card {
    grid-template-columns: 70px 1fr;
    gap: 12px;
  }

  .module-art {
    width: 70px;
    height: 70px;
    border-radius: 20px;
  }

  .module-actions {
    gap: 7px;
  }

  .grammar-overview {
    grid-template-columns: 1fr;
  }

  .grammar-score {
    justify-self: start;
  }

  .grammar-final-actions .grammar-button {
    width: 100%;
  }

  .game-frame-wrap,
  .game-frame,
  .video-frame-wrap {
    min-height: 360px;
  }

  .player-actions {
    gap: 8px;
  }

  .player-button {
    min-height: 48px;
    border-radius: 16px;
  }

  .program-top {
    align-items: flex-start;
  }

  .program-user {
    display: grid;
    justify-items: end;
  }
}

@media (min-width: 1024px) {
  .grammar-selection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell {
    padding-top: 34px;
  }

  .hero {
    grid-template-columns: 1fr minmax(320px, 420px);
    align-items: end;
  }

  .topbar,
  .welcome {
    grid-column: 1 / -1;
  }

  .modules-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .module-card {
    grid-template-columns: 1fr;
    min-height: 260px;
  }

  .module-art {
    width: 88px;
    height: 88px;
  }

  .avatar-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tortilla Adventure World skin */
body {
  color: var(--adventure-ink);
  background-color: #f7fbff;
  background-image:
    repeating-linear-gradient(90deg, var(--adventure-map-line) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, var(--adventure-map-line) 0 1px, transparent 1px 42px),
    linear-gradient(130deg, rgba(255, 215, 94, 0.36) 0%, rgba(255, 255, 255, 0) 32%),
    linear-gradient(220deg, rgba(143, 220, 255, 0.36) 0%, rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, #f3fbff 0%, #fff8e8 48%, #f0fff8 100%);
}

.app-shell {
  width: min(100%, 1220px);
  padding: 18px 16px 42px;
}

.hero {
  position: relative;
  isolation: isolate;
  gap: 18px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.58)),
    linear-gradient(125deg, rgba(255, 215, 94, 0.35), rgba(143, 220, 255, 0.28) 48%, rgba(139, 92, 246, 0.18));
  box-shadow: var(--adventure-shadow);
  backdrop-filter: blur(16px);
}

.hero::before {
  position: absolute;
  right: -42px;
  bottom: -84px;
  z-index: 0;
  width: min(56vw, 520px);
  height: 210px;
  border: 3px dashed rgba(63, 140, 255, 0.2);
  border-left: 0;
  border-bottom: 0;
  border-radius: 50%;
  content: "";
  transform: rotate(-7deg);
}

.hero::after {
  position: absolute;
  right: 26px;
  bottom: 24px;
  z-index: 0;
  display: none;
  width: 250px;
  height: 178px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.22)),
    linear-gradient(135deg, rgba(255, 112, 93, 0.24), rgba(139, 92, 246, 0.18) 54%, rgba(53, 201, 118, 0.22));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 22px 45px rgba(31, 47, 79, 0.1);
  content: "";
}

.hero > * {
  position: relative;
  z-index: 1;
}

.topbar {
  flex-wrap: wrap;
  align-items: center;
}

.brand-logo,
.auth-logo {
  filter: drop-shadow(0 10px 16px rgba(31, 47, 79, 0.1));
}

.user-menu,
.program-user {
  flex-wrap: wrap;
}

.nav-avatar {
  width: 48px;
  height: 48px;
  border: 4px solid #fff;
  box-shadow:
    0 0 0 4px rgba(255, 215, 94, 0.32),
    var(--adventure-pop-shadow);
}

.pill,
.count-badge {
  gap: 7px;
  min-height: 40px;
  border-color: rgba(63, 140, 255, 0.16);
  color: #205fc8;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(31, 47, 79, 0.08);
}

.pill::before,
.count-badge::before {
  color: #d89400;
  content: "★";
  font-size: 0.82em;
}

.change-avatar,
.logout-button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(31, 47, 79, 0.08);
}

.change-avatar {
  color: #205fc8;
  background: rgba(233, 244, 255, 0.94);
}

.logout-button {
  color: #42526d;
  background: rgba(255, 255, 255, 0.88);
}

.welcome {
  max-width: 780px;
  gap: 10px;
  padding: clamp(16px, 4vw, 34px) 2px 10px;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  padding: 5px 10px;
  border: 1px solid rgba(20, 184, 166, 0.16);
  border-radius: var(--radius-pill);
  color: #08785f;
  background: rgba(230, 255, 243, 0.8);
  box-shadow: 0 8px 18px rgba(20, 184, 166, 0.08);
  font-size: 0.73rem;
}

h1 {
  color: var(--adventure-ink);
  font-size: clamp(2.2rem, 8vw, 4.55rem);
  line-height: 0.98;
  text-wrap: balance;
}

h2 {
  color: var(--adventure-ink);
  text-wrap: balance;
}

.selected-program {
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid rgba(63, 140, 255, 0.16);
  color: #205fc8;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 26px rgba(31, 47, 79, 0.08);
}

.selected-program::before {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--adventure-sun), var(--adventure-green));
  box-shadow: 0 0 0 4px rgba(255, 215, 94, 0.22);
  content: "";
}

main {
  gap: 18px;
  padding-top: 18px;
}

.section-heading,
.dashboard-section-heading,
.assignments-heading {
  align-items: center;
}

.section-heading {
  margin-top: 2px;
  padding: 2px 4px;
}

.assignments-panel,
.dashboard-assignments {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  gap: 16px;
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid rgba(255, 184, 77, 0.36);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.92)),
    var(--gradient-mission);
  box-shadow: var(--adventure-shadow);
}

.assignments-panel::before,
.dashboard-assignments::before {
  position: absolute;
  top: 0;
  right: 20px;
  left: 20px;
  z-index: 0;
  height: 8px;
  border-radius: 0 0 999px 999px;
  background:
    linear-gradient(90deg, var(--adventure-sun), var(--adventure-coral), var(--adventure-sky), var(--adventure-green));
  content: "";
}

.assignments-panel > *,
.dashboard-assignments > * {
  position: relative;
  z-index: 1;
}

.assignments-heading h2,
.dashboard-section-heading h2 {
  font-size: clamp(1.45rem, 4vw, 2.05rem);
}

.assignments-list {
  gap: 14px;
}

.assignment-card,
.assignments-summary-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 252, 255, 0.88)),
    var(--paper);
  box-shadow: var(--adventure-pop-shadow);
}

.assignment-card {
  grid-template-columns: 72px 1fr;
  gap: 16px;
  min-height: 146px;
  padding: 16px;
}

.assignment-card::before,
.assignments-summary-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--adventure-sun), var(--adventure-coral), var(--adventure-green));
  content: "";
}

.assignment-card-icon {
  width: 66px;
  height: 66px;
  border: 4px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  color: #654900;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0)),
    var(--gradient-reward);
  box-shadow: 0 14px 26px rgba(255, 184, 77, 0.28);
  font-size: 1.55rem;
}

.assignment-card-body {
  gap: 9px;
}

.assignment-card h3 {
  font-size: clamp(1.16rem, 3vw, 1.45rem);
  line-height: 1.08;
}

.assignment-card p {
  color: var(--adventure-muted);
  font-size: 0.96rem;
  line-height: 1.35;
}

.assignment-card-meta {
  gap: 8px;
  color: #667085;
}

.assignment-status-chip,
.assignment-mini-badge,
.vocabulary-status,
.video-badge,
.tag {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 16px rgba(31, 47, 79, 0.06);
}

.assignment-status-chip,
.assignment-mini-badge {
  color: #725100;
  background: #fff1b8;
}

.assignment-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.assignment-open-button,
.assignment-toggle-button,
.module-action.play,
.player-button.primary,
.auth-button,
.patatas-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    var(--gradient-start);
  box-shadow: var(--adventure-button-shadow);
}

.assignment-open-button {
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  font-size: 1rem;
}

.assignment-open-button::before {
  color: #fff7c7;
  content: "★";
}

.assignment-unavailable,
.assignment-empty {
  color: var(--adventure-muted);
}

.module-card,
.grammar-module-card,
.dashboard-section {
  border: 1px solid rgba(255, 255, 255, 0.8);
  background:
    var(--gradient-world-card),
    var(--paper);
  box-shadow: var(--adventure-pop-shadow);
}

.modules-grid {
  gap: 18px;
}

.module-card {
  isolation: isolate;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  min-height: 156px;
  padding: 16px;
  border-radius: 30px;
}

.module-card::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: 10px;
  background: linear-gradient(90deg, var(--card-color, var(--adventure-blue)), rgba(143, 220, 255, 0.52));
  content: "";
}

.module-card > * {
  position: relative;
  z-index: 1;
}

.module-card.is-completed {
  border-color: rgba(53, 201, 118, 0.42);
  background:
    linear-gradient(135deg, rgba(230, 255, 243, 0.9), rgba(255, 255, 255, 0.94) 52%),
    var(--paper);
}

.module-card.is-completed::before {
  background: linear-gradient(90deg, var(--adventure-green), var(--adventure-sun));
}

.module-card.is-completed::after {
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  background: linear-gradient(135deg, var(--adventure-green), var(--adventure-ocean));
  box-shadow: 0 12px 24px rgba(53, 201, 118, 0.28);
}

.video-card::before {
  background: linear-gradient(90deg, var(--adventure-grape), var(--adventure-blue));
}

.module-art {
  width: 84px;
  height: 84px;
  border: 4px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, var(--card-color, var(--adventure-blue)), #8fdcff);
  box-shadow:
    inset 0 -20px 30px rgba(24, 32, 51, 0.12),
    0 14px 28px rgba(31, 47, 79, 0.14);
}

.module-art span {
  text-shadow: 0 2px 8px rgba(24, 32, 51, 0.16);
}

.module-body {
  gap: 12px;
}

.module-meta {
  align-items: center;
  gap: 8px;
}

.tag {
  color: #33506e;
  background: #edf7ff;
}

.tag.level {
  color: #08785f;
  background: #e6fff3;
}

.done-badge {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #08785f;
  background: #e6fff3;
}

.done-badge:empty {
  display: none;
}

.module-title {
  color: var(--adventure-ink);
  font-size: clamp(1.15rem, 2.4vw, 1.34rem);
  line-height: 1.1;
}

.module-actions {
  gap: 9px;
}

.module-action {
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 999px;
}

.module-action.play::before {
  content: "▶";
  font-size: 0.82em;
}

.module-action.done {
  color: #08785f;
  background: #e6fff3;
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.14);
}

.module-action.done::before {
  content: "✓";
}

.module-action:disabled {
  color: #718096;
  background: #eef3f8;
  box-shadow: inset 0 0 0 1px rgba(100, 112, 135, 0.08);
}

.vocabulary-module-locked,
.grammar-module-card-locked {
  opacity: 0.68;
  filter: saturate(0.72);
}

.vocabulary-module-locked .module-art,
.grammar-module-card-locked .grammar-module-number {
  filter: grayscale(0.2);
}

.vocabulary-status-locked,
.grammar-module-status-locked {
  color: #647087;
  background: #eef3f8;
}

.vocabulary-status-assigned,
.vocabulary-status-in-progress,
.grammar-module-status-available {
  color: #725100;
  background: #fff1b8;
}

.vocabulary-status-minimum-completed,
.vocabulary-status-fully-completed,
.grammar-module-status-complete {
  color: #08785f;
  background: #e6fff3;
}

.vocabulary-status-fully-completed {
  color: #fff;
  background: linear-gradient(135deg, var(--adventure-green), var(--adventure-ocean));
}

.vocabulary-progress-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vocabulary-progress-lines span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #5a677d;
  background: rgba(237, 247, 255, 0.92);
}

.vocabulary-progress-panel {
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(63, 140, 255, 0.16);
  border-radius: 26px;
  color: #205fc8;
  background:
    linear-gradient(135deg, rgba(237, 247, 255, 0.92), rgba(255, 255, 255, 0.94)),
    var(--paper);
  box-shadow: var(--adventure-pop-shadow);
}

.status-box,
.empty-state {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--adventure-pop-shadow);
}

.loader {
  border-color: rgba(63, 140, 255, 0.18);
  border-top-color: var(--adventure-coral);
}

.grammar-overview,
.grammar-progress-panel,
.grammar-parent-summary {
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 247, 216, 0.82), rgba(237, 247, 255, 0.88)),
    var(--paper);
  box-shadow: var(--adventure-pop-shadow);
}

.grammar-score,
.grammar-selection-summary {
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 24px rgba(31, 47, 79, 0.08);
}

.grammar-progress,
.grammar-module-progress-track {
  background: rgba(222, 232, 244, 0.72);
}

.grammar-progress-fill,
.grammar-module-progress-fill {
  background: linear-gradient(90deg, var(--adventure-sun), var(--adventure-green), var(--adventure-ocean));
}

.grammar-module-card {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
}

.grammar-module-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background: linear-gradient(90deg, var(--adventure-grape), var(--adventure-blue), var(--adventure-green));
  content: "";
}

.grammar-module-number {
  color: #205fc8;
  background: #edf7ff;
}

.grammar-module-button,
.grammar-button-primary {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    var(--gradient-start);
}

.player-view {
  background:
    linear-gradient(135deg, rgba(255, 247, 216, 0.96), rgba(237, 247, 255, 0.96)),
    var(--soft);
}

.player-panel {
  gap: 14px;
}

.icon-button,
.player-button.secondary,
.player-button.quiet {
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 24px rgba(31, 47, 79, 0.1);
}

.icon-button {
  background: rgba(255, 255, 255, 0.9);
}

.player-category {
  color: #08785f;
}

.game-frame-wrap,
.video-frame-wrap {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  box-shadow: var(--adventure-shadow);
}

.game-frame-wrap {
  background:
    linear-gradient(135deg, rgba(63, 140, 255, 0.1), rgba(53, 201, 118, 0.12)),
    white;
}

.frame-status {
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
}

.celebration {
  color: #513700;
  background: linear-gradient(135deg, var(--adventure-sun), var(--adventure-tortilla));
  box-shadow: 0 18px 36px rgba(255, 159, 28, 0.28);
}

.auth-page {
  background:
    linear-gradient(130deg, rgba(255, 215, 94, 0.34) 0%, rgba(255, 255, 255, 0) 34%),
    linear-gradient(220deg, rgba(139, 92, 246, 0.18) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #f3fbff 0%, #fff8e8 48%, #f0fff8 100%);
}

.auth-card,
.avatar-card,
.program-card {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.66)),
    rgba(255, 255, 255, 0.88);
  box-shadow: var(--adventure-shadow);
}

.program-card {
  position: relative;
  overflow: hidden;
}

.program-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background: linear-gradient(90deg, var(--adventure-sun), var(--adventure-coral), var(--adventure-blue), var(--adventure-green));
  content: "";
}

.auth-form input {
  border-color: rgba(63, 140, 255, 0.16);
  background: rgba(248, 251, 255, 0.94);
}

.avatar-option {
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(237, 247, 255, 0.86)),
    #f8fbff;
}

.avatar-option img {
  border: 1px solid rgba(63, 140, 255, 0.1);
}

@media (hover: hover) {
  .assignment-card:hover,
  .assignments-summary-card:hover,
  .module-card:hover,
  .grammar-module-card:hover,
  .avatar-option:hover {
    transform: translateY(-4px);
    box-shadow: var(--adventure-shadow);
  }
}

@media (min-width: 680px) {
  .app-shell {
    padding: 28px 28px 54px;
  }

  .assignments-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assignments-list .assignment-card:first-child {
    grid-column: 1 / -1;
    grid-template-columns: 84px minmax(0, 1fr);
  }
}

@media (min-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
    min-height: 320px;
    padding: 22px 26px 26px;
  }

  .hero::after {
    display: block;
  }

  .topbar {
    grid-column: 1 / -1;
  }

  .welcome {
    grid-column: 1 / 2;
    align-self: end;
  }

  .modules-grid {
    gap: 20px;
  }

  .module-card {
    grid-template-columns: 1fr;
    min-height: 282px;
    padding: 18px;
  }

  .module-art {
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px 12px 34px;
  }

  .hero {
    border-radius: 28px;
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .user-menu,
  .program-user {
    justify-content: flex-start;
  }

  .assignments-panel,
  .dashboard-assignments {
    border-radius: 28px;
  }

  .assignment-card {
    grid-template-columns: 64px 1fr;
    gap: 13px;
  }

  .assignment-card-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
  }

  .module-card {
    grid-template-columns: 76px 1fr;
    gap: 13px;
    border-radius: 26px;
  }

  .module-art {
    width: 76px;
    height: 76px;
    border-radius: 23px;
  }
}

@media (max-width: 460px) {
  .brand-logo {
    width: min(150px, 48vw);
  }

  .user-menu,
  .program-user {
    width: 100%;
    gap: 7px;
  }

  .pill,
  .change-avatar,
  .logout-button {
    min-height: 38px;
  }

  .welcome {
    padding-top: 12px;
  }

  .assignment-card,
  .assignments-summary-card {
    grid-template-columns: 1fr;
  }

  .assignment-card::before,
  .assignments-summary-card::before {
    inset: 0 0 auto;
    width: auto;
    height: 7px;
  }

  .assignment-open-button {
    width: 100%;
  }

  .module-card {
    grid-template-columns: 68px 1fr;
    padding: 13px;
  }

  .module-art {
    width: 68px;
    height: 68px;
    border-radius: 20px;
  }
}

/* Parent-facing student activation lives in the Student App, never in the staff portal. */
.activation-shell {
  width: min(100%, 680px);
}

.activation-card {
  gap: 18px;
}

.activation-card [hidden] {
  display: none !important;
}

.activation-parent-note,
.activation-account {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid rgba(85, 223, 255, 0.34);
  border-radius: 20px;
  color: var(--teacher-navy);
  background: var(--teacher-cyan-soft);
}

.activation-parent-note span,
.activation-account small {
  color: #53637d;
  font-weight: 800;
  line-height: 1.4;
}

.activation-account-label {
  font-weight: 900;
}

.activation-account-value {
  display: block;
  padding: 4px 0;
  color: var(--teacher-navy);
  font-size: clamp(1rem, 3.2vw, 1.16rem);
  font-weight: 1000;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.activation-status {
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #334155;
  background: #eef2ff;
  font-weight: 900;
  line-height: 1.4;
}

.activation-status[data-state="success"],
.auth-message[data-state="success"] {
  color: #11603c;
  background: #e6ffe0;
}

.activation-status[data-state="error"] {
  color: #9b1c31;
  background: #fff0f3;
}

.activation-login-link {
  display: grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
}

.activation-help {
  margin: 0;
  color: #667085;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 520px) {
  .activation-shell {
    padding: 10px;
  }

  .activation-card {
    padding: 20px 16px;
    border-radius: 24px;
  }

  .activation-card .auth-copy h1 {
    font-size: clamp(2rem, 12vw, 3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

/* Teacher portal inspired student refresh */
:root {
  --teacher-navy: #26107a;
  --teacher-navy-2: #32138f;
  --teacher-purple: #7b5cff;
  --teacher-purple-strong: #4b2fbd;
  --teacher-lilac: #eeeaff;
  --teacher-lime: #95f482;
  --teacher-lime-soft: #e6ffe0;
  --teacher-yellow: #ffeb3f;
  --teacher-yellow-soft: #fff7be;
  --teacher-coral: #ff6d61;
  --teacher-coral-soft: #ffe8e3;
  --teacher-orange: #ffb63d;
  --teacher-text: #2e2b36;
  --teacher-muted: #625d7a;
  --teacher-page: #2b1287;
  --teacher-line: rgba(74, 47, 186, 0.18);
  --teacher-panel-line: rgba(74, 47, 186, 0.2);
  --teacher-shadow-card: 0 12px 30px rgba(36, 16, 111, 0.08);
  --teacher-shadow-panel: 0 18px 0 rgba(36, 16, 111, 0.055), 0 24px 60px rgba(53, 36, 148, 0.16), 0 5px 0 rgba(255, 255, 255, 0.76) inset;
  --teacher-shadow-button: 0 8px 0 rgba(36, 16, 111, 0.18), 0 18px 30px rgba(74, 47, 186, 0.18);
  --teacher-radius-panel: 38px;
  --teacher-radius-card: 30px;
  --teacher-radius-control: 22px;
}

body {
  color: var(--teacher-text);
  background: var(--teacher-page);
}

.app-shell {
  width: min(100%, 1640px);
  margin: 0 auto;
  padding: 28px 32px 54px;
}

.hero,
.assignments-panel,
.dashboard-assignments,
.program-card,
.auth-card,
.avatar-card,
.grammar-overview,
.grammar-progress-panel,
.grammar-parent-summary,
.player-panel {
  border-color: var(--teacher-panel-line);
  background: #fff;
  box-shadow: var(--teacher-shadow-card);
  backdrop-filter: none;
}

.hero {
  min-height: 0;
  margin-bottom: 6px;
  border-radius: var(--teacher-radius-panel);
  padding: clamp(20px, 3vw, 32px);
}

.hero::before,
.hero::after {
  display: none;
}

.welcome {
  max-width: none;
  padding: 0;
}

.eyebrow {
  border: 0;
  padding: 0;
  color: var(--teacher-purple-strong);
  background: transparent;
  box-shadow: none;
  font-size: 0.76rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
}

h1,
h2,
.module-title,
.assignment-card h3,
.grammar-title,
.grammar-stage-title,
.grammar-roadmap-title {
  color: var(--teacher-text);
  font-weight: 1000;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.96;
}

h2 {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.selected-program,
.pill,
.count-badge,
.tag,
.done-badge,
.assignment-status-chip,
.assignment-mini-badge,
.vocabulary-status,
.video-badge,
.grammar-module-number,
.grammar-module-status,
.review-badge {
  border: 1px solid var(--teacher-line);
  color: var(--teacher-navy);
  background: linear-gradient(135deg, #fff, var(--teacher-lilac));
  box-shadow: 0 7px 15px rgba(53, 36, 148, 0.08);
  font-weight: 1000;
}

.pill::before,
.count-badge::before,
.selected-program::before,
.assignment-open-button::before,
.module-action.play::before,
.module-action.done::before {
  content: none;
}

.tag.level,
.done-badge,
.vocabulary-status-minimum-completed,
.vocabulary-status-fully-completed,
.grammar-module-status-complete {
  color: #16764a;
  background: var(--teacher-lime-soft);
}

.assignment-status-chip,
.assignment-mini-badge,
.vocabulary-status-assigned,
.vocabulary-status-in-progress,
.grammar-module-status-available {
  color: var(--teacher-navy);
  background: var(--teacher-yellow-soft);
}

.change-avatar,
.logout-button,
.patatas-back,
.player-button,
.icon-button,
.assignment-open-button,
.assignment-toggle-button,
.module-action,
.auth-button,
.grammar-button,
.grammar-module-button,
.grammar-button-primary {
  border-radius: 999px;
  font-weight: 1000;
}

.assignment-open-button,
.assignment-toggle-button,
.module-action.play,
.player-button.primary,
.auth-button,
.patatas-back,
.grammar-module-button,
.grammar-button-primary {
  color: var(--teacher-navy);
  background: linear-gradient(135deg, var(--teacher-lime), #a8ff8f 52%, var(--teacher-yellow));
  box-shadow: var(--teacher-shadow-button);
}

.change-avatar,
.logout-button,
.player-button.secondary,
.player-button.quiet,
.icon-button,
.module-action.done,
.grammar-button:not(.grammar-button-primary) {
  border: 1px solid var(--teacher-line);
  color: var(--teacher-navy);
  background: linear-gradient(135deg, #fff, #f6f2ff);
  box-shadow: 0 7px 0 rgba(36, 16, 111, 0.08), 0 12px 24px rgba(53, 36, 148, 0.08);
}

.modules-grid {
  gap: 22px;
}

.module-card,
.grammar-module-card,
.assignment-card,
.assignments-summary-card,
.dashboard-section,
.status-box,
.empty-state,
.vocabulary-progress-panel,
.grammar-progress-panel,
.grammar-parent-summary,
.grammar-score,
.grammar-selection-summary,
.avatar-option {
  border: 2px solid rgba(74, 47, 186, 0.16);
  border-radius: var(--teacher-radius-card);
  background: #fff;
  box-shadow: var(--teacher-shadow-card);
}

.module-card,
.grammar-module-card,
.assignment-card,
.assignments-summary-card {
  overflow: hidden;
}

.module-card::before,
.grammar-module-card::before,
.assignment-card::before,
.assignments-summary-card::before,
.program-card::before {
  inset: 0 0 auto;
  width: auto;
  height: 8px;
  opacity: 0.9;
  background: linear-gradient(90deg, var(--teacher-lime), var(--teacher-yellow), var(--teacher-purple));
}

.module-card.is-completed::before,
.vocabulary-module-card::before {
  background: linear-gradient(90deg, var(--teacher-lime), var(--teacher-yellow));
}

.video-card::before {
  background: linear-gradient(90deg, var(--teacher-coral), var(--teacher-purple));
}

.module-art,
.assignment-card-icon,
.grammar-module-number,
.avatar-option img {
  border: 2px solid rgba(36, 16, 111, 0.08);
  border-radius: 28px;
  color: var(--teacher-navy);
  background: linear-gradient(135deg, var(--card-color, var(--teacher-yellow)), #fffbd6);
  box-shadow: 0 10px 0 rgba(36, 16, 111, 0.14), 0 20px 30px rgba(53, 36, 148, 0.14);
}

.module-art {
  width: 76px;
  height: 76px;
  color: var(--teacher-navy);
}

.video-art {
  background: linear-gradient(135deg, var(--teacher-coral), #fff0cc);
}

.assignment-card-icon {
  background: linear-gradient(135deg, var(--teacher-yellow), var(--teacher-lime));
}

.assignment-card {
  grid-template-columns: 68px 1fr;
}

.assignments-panel,
.dashboard-assignments {
  border-width: 2px;
  border-color: rgba(74, 47, 186, 0.16);
  border-radius: var(--teacher-radius-panel);
  background: #fff;
}

.assignments-panel::before,
.dashboard-assignments::before {
  right: 0;
  left: 0;
  height: 8px;
  border-radius: 0;
  background: linear-gradient(90deg, var(--teacher-lime), var(--teacher-yellow), var(--teacher-purple));
}

.section-heading,
.dashboard-section-heading,
.assignments-heading {
  align-items: center;
}

.auth-page {
  background: var(--teacher-page);
}

.auth-card,
.avatar-card,
.program-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--teacher-radius-panel);
  border-color: var(--teacher-panel-line);
  box-shadow: var(--teacher-shadow-panel);
}

.auth-card::before,
.avatar-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background: linear-gradient(90deg, var(--teacher-lime), var(--teacher-yellow), var(--teacher-purple), var(--teacher-navy));
  content: "";
}

.auth-card > *,
.avatar-card > *,
.program-card > * {
  position: relative;
  z-index: 1;
}

.auth-logo {
  width: min(220px, 58vw);
  filter: drop-shadow(0 12px 20px rgba(36, 16, 111, 0.12));
}

.auth-form label {
  color: var(--teacher-text);
}

.auth-form input {
  min-height: 58px;
  border-color: var(--teacher-line);
  border-radius: var(--teacher-radius-control);
  color: var(--teacher-text);
  background: #fff;
}

.auth-form input:focus {
  border-color: rgba(123, 92, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(123, 92, 255, 0.14);
}

.program-footer {
  justify-content: flex-end;
}

.avatar-option {
  border-color: rgba(74, 47, 186, 0.14);
  background: #fff;
}

.avatar-option.is-selected {
  border-color: var(--teacher-lime);
  box-shadow: 0 0 0 5px rgba(149, 244, 130, 0.18), var(--teacher-shadow-card);
}

.player-view {
  background: rgba(46, 43, 54, 0.42);
}

.player-panel {
  border: 2px solid var(--teacher-panel-line);
  border-radius: var(--teacher-radius-panel);
  background: #fff;
}

.game-frame-wrap,
.video-frame-wrap {
  border: 2px solid var(--teacher-line);
  border-radius: var(--teacher-radius-card);
  box-shadow: var(--teacher-shadow-card);
}

.grammar-progress-fill,
.grammar-module-progress-fill {
  background: linear-gradient(90deg, var(--teacher-purple), var(--teacher-lime), var(--teacher-yellow));
}

@media (hover: hover) {
  .assignment-card:hover,
  .assignments-summary-card:hover,
  .module-card:hover,
  .grammar-module-card:hover,
  .avatar-option:hover {
    border-color: rgba(123, 92, 255, 0.4);
    box-shadow: 0 16px 36px rgba(36, 16, 111, 0.12);
    transform: translateY(-4px);
  }
}

@media (min-width: 1024px) {
  body:not(.auth-page) {
    padding-left: 286px;
  }

  .app-shell {
    padding: 32px clamp(28px, 3vw, 48px) 56px;
  }

  .topbar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: flex;
    width: 286px;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 22px 18px;
    color: #fff;
    background:
      radial-gradient(circle at 18% 8%, rgba(149, 244, 130, 0.16), transparent 22%),
      radial-gradient(circle at 86% 20%, rgba(255, 235, 63, 0.13), transparent 20%),
      linear-gradient(160deg, #3f22b8 0%, #2b1287 54%, #1b0b5e 100%);
    box-shadow: 20px 0 46px rgba(36, 16, 111, 0.28);
  }

  .topbar .brand {
    justify-content: center;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 30px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 34px rgba(16, 5, 62, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }

  .topbar .brand-logo {
    width: min(170px, 100%);
    max-height: 116px;
    object-fit: contain;
  }

  .topbar .user-menu {
    display: grid;
    gap: 12px;
    width: 100%;
    margin-top: auto;
  }

  .topbar .user-menu .pill,
  .topbar .change-avatar,
  .topbar .logout-button {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 56px;
    border-radius: 999px;
    padding: 0 16px;
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    box-shadow: none;
  }

  .topbar .change-avatar {
    border-color: transparent;
    font-size: 1rem;
  }

  .topbar .user-menu .pill::before,
  .topbar .change-avatar::before,
  .topbar .logout-button::before {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 999px;
    color: var(--teacher-navy);
    background: var(--teacher-yellow-soft);
    font-size: 1rem;
    font-weight: 1000;
  }

  .topbar .user-menu .pill::before {
    content: "U";
  }

  .topbar .change-avatar[href="programs.html"]::before {
    content: "M";
  }

  .topbar .change-avatar[href="profile.html"]::before {
    content: "A";
  }

  .topbar .logout-button::before {
    content: "↗";
  }

  .topbar .change-avatar:hover,
  .topbar .logout-button:hover,
  .topbar .user-menu .pill {
    color: var(--teacher-navy);
    background: #fff;
    box-shadow: 0 10px 0 rgba(18, 6, 80, 0.16), 0 18px 34px rgba(18, 6, 80, 0.2);
  }

  .topbar .nav-avatar {
    width: 58px;
    height: 58px;
    margin-top: auto;
    border-radius: 20px;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 0 rgba(36, 16, 111, 0.14), 0 20px 30px rgba(53, 36, 148, 0.14);
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 28px 34px;
  }

  .welcome {
    grid-column: auto;
  }

  .modules-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
  }

  .module-card {
    grid-template-columns: 1fr;
    min-height: 248px;
    padding: 22px;
  }

  .module-art {
    width: 72px;
    height: 72px;
  }

  .assignment-card,
  .assignments-summary-card {
    min-height: 152px;
    padding: 18px;
  }
}

@media (min-width: 1280px) {
  .modules-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .app-shell {
    padding: 16px 12px 110px;
  }

  .hero {
    border-radius: 28px;
  }

  .topbar {
    gap: 10px;
  }

  .user-menu {
    align-items: center;
  }

  .modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .modules-grid,
  .assignments-list {
    grid-template-columns: 1fr;
  }

  .module-card,
  .assignment-card,
  .assignments-summary-card {
    border-radius: 24px;
  }

  .module-card {
    grid-template-columns: 68px 1fr;
    min-height: 0;
    padding: 16px;
  }

  .module-art {
    width: 58px;
    height: 58px;
    border-radius: 22px;
  }

  .assignment-card {
    grid-template-columns: 58px 1fr;
  }

  .assignment-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 20px;
  }
}

@media (max-width: 460px) {
  .app-shell {
    padding-inline: 8px;
  }

  .hero,
  .assignments-panel,
  .dashboard-assignments,
  .auth-card,
  .avatar-card,
  .program-card {
    border-radius: 22px;
  }

  h1 {
    font-size: clamp(1.9rem, 11vw, 2.55rem);
  }

  .module-card,
  .assignment-card,
  .assignments-summary-card {
    grid-template-columns: 1fr;
  }

  .module-art,
  .assignment-card-icon {
    width: 54px;
    height: 54px;
  }

  .module-action,
  .assignment-open-button,
  .assignment-toggle-button {
    width: 100%;
  }
}

/* Flat color pass: remove remaining gradients from the teacher-inspired skin. */
.assignment-open-button,
.assignment-toggle-button,
.module-action.play,
.player-button.primary,
.auth-button,
.patatas-back,
.grammar-module-button,
.grammar-button-primary,
.filter-chip.is-active,
.focus-mode-button,
.workspace-resource-action.is-active {
  background: var(--teacher-lime) !important;
  color: var(--teacher-navy) !important;
}

.change-avatar,
.logout-button,
.player-button.secondary,
.player-button.quiet,
.icon-button,
.module-action.done,
.grammar-button:not(.grammar-button-primary),
.selected-program,
.pill,
.count-badge,
.tag,
.done-badge,
.assignment-status-chip,
.assignment-mini-badge,
.vocabulary-status,
.video-badge,
.grammar-module-number,
.grammar-module-status,
.review-badge {
  background: #fff !important;
}

.tag.level,
.done-badge,
.vocabulary-status-minimum-completed,
.vocabulary-status-fully-completed,
.grammar-module-status-complete {
  background: var(--teacher-lime-soft) !important;
}

.assignment-status-chip,
.assignment-mini-badge,
.vocabulary-status-assigned,
.vocabulary-status-in-progress,
.grammar-module-status-available {
  background: var(--teacher-yellow-soft) !important;
}

.module-card::before,
.grammar-module-card::before,
.assignment-card::before,
.assignments-summary-card::before,
.program-card::before,
.auth-card::before,
.avatar-card::before,
.assignments-panel::before,
.dashboard-assignments::before,
.tool-card::before {
  background: var(--teacher-lime) !important;
}

.video-card::before {
  background: var(--teacher-coral) !important;
}

.module-art,
.assignment-card-icon,
.grammar-module-number,
.avatar-option img,
.avatar,
.brand-mark,
.auth-mark,
.material-placeholder-icon,
.empty-icon {
  background: var(--card-color, var(--teacher-lime)) !important;
}

.assignment-card-icon,
.empty-icon,
.material-placeholder-icon {
  background: var(--teacher-lime) !important;
}

.video-art {
  background: var(--teacher-coral) !important;
}

.avatar-option,
.auth-card,
.avatar-card,
.program-card,
.hero,
.assignments-panel,
.dashboard-assignments,
.module-card,
.grammar-module-card,
.assignment-card,
.assignments-summary-card,
.dashboard-section,
.status-box,
.empty-state,
.vocabulary-progress-panel,
.grammar-overview,
.grammar-progress-panel,
.grammar-parent-summary,
.player-panel {
  background: #fff !important;
}

.grammar-progress-fill,
.grammar-module-progress-fill,
.student-progress-meter span {
  background: var(--teacher-lime) !important;
}

/* Student assignment portal */
.student-portal {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.adventure-page {
  overflow-x: clip;
}

.adventure-page .program-card {
  overflow: clip;
}

.adventure-page .program-shell,
.adventure-page .student-dashboard,
.adventure-page .adventure-board {
  min-width: 0;
}

.portal-status-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 2px solid var(--teacher-line);
  border-radius: var(--teacher-radius-card);
  background: #fff;
  box-shadow: var(--teacher-shadow-card);
}

.portal-status-row h2,
.portal-practice-heading h3 {
  margin: 0;
  color: var(--teacher-text);
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 1000;
}

.portal-bell {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 2px solid var(--teacher-line);
  border-radius: 24px;
  color: var(--teacher-navy);
  background: #fff;
  box-shadow: 0 10px 0 rgba(36, 16, 111, 0.14), var(--teacher-shadow-card);
  font: inherit;
  cursor: pointer;
}

.portal-bell img {
  display: block;
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 2px 0 rgba(18, 6, 80, 0.12));
}

.portal-bell strong {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--teacher-coral);
  font-size: 0.85rem;
  font-weight: 1000;
}

.portal-bell:not(.has-new) strong {
  background: var(--teacher-muted);
}

.portal-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.portal-option {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  min-height: 170px;
  align-items: center;
  justify-items: start;
  gap: 22px;
  border: 2px solid var(--teacher-line);
  border-radius: var(--teacher-radius-card);
  padding: 22px;
  color: var(--teacher-navy);
  background: #fff;
  box-shadow: 0 14px 0 rgba(36, 16, 111, 0.1), var(--teacher-shadow-card);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.portal-option-games {
  border-color: rgba(149, 244, 130, 0.72);
  background: var(--teacher-lime-soft);
}

.portal-option-videos {
  border-color: rgba(255, 109, 97, 0.5);
  background: var(--teacher-coral-soft);
}

.portal-option-icon {
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 2px solid rgba(36, 16, 111, 0.12);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 9px 0 rgba(36, 16, 111, 0.12);
  font-size: 2rem;
  font-weight: 1000;
}

.portal-option > span:not(.portal-option-icon) {
  min-width: 0;
}

.portal-option-icon img {
  display: block;
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.portal-option-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--teacher-coral);
  box-shadow: 0 6px 0 rgba(36, 16, 111, 0.2), 0 12px 24px rgba(36, 16, 111, 0.2);
  font-size: 0.95rem;
  font-weight: 1000;
  line-height: 1;
}

.portal-option-badge[hidden] {
  display: none;
}

.portal-option strong {
  display: block;
  color: var(--teacher-text);
  font-size: clamp(1.7rem, 6vw, 2.45rem);
  font-weight: 1000;
  line-height: 0.95;
}

.portal-option small {
  display: block;
  margin-top: 8px;
  color: var(--teacher-muted);
  font-size: 1rem;
  font-weight: 1000;
}

.portal-option-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.portal-option-stats span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(74, 47, 186, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--teacher-navy);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 1000;
}

.portal-practice,
.portal-assignment-list {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--teacher-line);
  border-radius: var(--teacher-radius-card);
  background: #fff;
  box-shadow: var(--teacher-shadow-card);
}

.portal-practice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (hover: hover) {
  .portal-bell:hover,
  .portal-option:hover {
    border-color: rgba(123, 92, 255, 0.45);
    box-shadow: 0 16px 36px rgba(36, 16, 111, 0.14);
    transform: translateY(-3px);
  }
}

@media (max-width: 680px) {
  .portal-options {
    grid-template-columns: 1fr;
  }

  .portal-option {
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 138px;
    gap: 16px;
    padding: 18px;
  }

  .portal-option-icon {
    width: 78px;
    height: 78px;
  }

  .portal-status-row {
    grid-template-columns: 1fr;
  }

  .portal-bell {
    width: 66px;
    height: 66px;
  }
}

/* Contrast fixes for the student workspace after the flat color pass. */
body:not(.auth-page) .section-heading .eyebrow,
body:not(.auth-page) .assignments-heading .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

body:not(.auth-page) .section-heading h2,
body:not(.auth-page) .assignments-heading h2 {
  color: #fff;
  text-shadow: 0 2px 0 rgba(18, 6, 80, 0.24);
}

body:not(.auth-page) .assignments-panel .assignments-heading .eyebrow {
  color: #08785f;
  background: rgba(230, 255, 243, 0.9);
}

body:not(.auth-page) .assignments-panel .assignments-heading h2 {
  color: var(--teacher-text);
  text-shadow: none;
}

body:not(.auth-page) .section-heading .count-badge,
body:not(.auth-page) .assignments-heading .count-badge {
  color: var(--teacher-navy) !important;
  background: #fff !important;
}

@media (min-width: 1024px) {
  .topbar .user-menu .pill,
  .topbar .change-avatar,
  .topbar .logout-button {
    overflow: hidden;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #fff !important;
    background: rgba(255, 255, 255, 0.13) !important;
    box-shadow: 0 8px 0 rgba(18, 6, 80, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .change-avatar::before,
  .topbar .logout-button::before,
  .topbar .user-menu .pill::before {
    color: var(--teacher-navy) !important;
    background: var(--teacher-yellow-soft) !important;
  }

  .topbar .user-menu .pill {
    max-width: none;
    background: #fff !important;
    color: var(--teacher-navy) !important;
    box-shadow: 0 10px 0 rgba(18, 6, 80, 0.14), 0 18px 34px rgba(18, 6, 80, 0.16);
  }

  .topbar #currentUserName {
    min-height: 68px;
    padding-block: 10px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.05;
  }

  .topbar .change-avatar:hover,
  .topbar .logout-button:hover {
    color: var(--teacher-navy) !important;
    background: var(--teacher-yellow-soft) !important;
  }
}

.portal-option-stats span {
  color: var(--teacher-navy) !important;
  background: #fff !important;
  box-shadow: 0 4px 0 rgba(36, 16, 111, 0.08);
  white-space: nowrap;
}

/* Stronger portal button contrast: the artwork has pale lettering. */
.portal-option-games {
  border-color: #7fed6f !important;
  background: #d8ffd2 !important;
}

.portal-option-videos {
  border-color: #ff8f86 !important;
  background: #ffd8d2 !important;
}

.portal-option-icon {
  border-color: rgba(255, 255, 255, 0.38) !important;
  background: #26107a !important;
  box-shadow: 0 10px 0 rgba(36, 16, 111, 0.2), 0 18px 28px rgba(36, 16, 111, 0.18) !important;
}

.portal-option-games .portal-option-icon {
  background: #1f7a43 !important;
}

.portal-option-videos .portal-option-icon {
  background: #7a245f !important;
}

.portal-option-icon img {
  width: 92%;
  height: 92%;
  filter: drop-shadow(0 2px 0 rgba(18, 6, 80, 0.16));
}

/* Assignment material contrast: games stay green, videos use the same coral family as Videos. */
.assignment-card-game::before {
  background: var(--teacher-lime) !important;
}

.assignment-card-video::before {
  background: var(--teacher-coral) !important;
}

.assignment-card-game .assignment-card-icon {
  background: var(--teacher-lime) !important;
  color: var(--teacher-navy) !important;
}

.assignment-card-video .assignment-card-icon {
  background: var(--teacher-coral) !important;
  color: #fff !important;
}

.assignment-open-button.assignment-open-game {
  background: var(--teacher-lime) !important;
  color: var(--teacher-navy) !important;
}

.assignment-open-button.assignment-open-video {
  background: var(--teacher-coral) !important;
  color: #fff !important;
}

.assignment-card-video .assignment-status-chip {
  background: var(--teacher-coral-soft) !important;
  color: #7a245f !important;
}

/* Assignment adventure map */
.adventure-hero {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  padding: clamp(22px, 4vw, 36px);
  border: 2px solid rgba(85, 223, 255, 0.5);
  border-radius: 32px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 219, 77, 0.24) 0 8%, transparent 9%),
    linear-gradient(135deg, #24106f 0%, #3f27a6 54%, #176f9c 100%);
  box-shadow: 0 16px 0 rgba(18, 6, 80, 0.18), 0 26px 50px rgba(18, 6, 80, 0.24);
}

.adventure-hero::after {
  position: absolute;
  right: 9%;
  bottom: -46px;
  width: 160px;
  height: 160px;
  border: 28px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  content: "";
}

.adventure-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 6px 12px;
  color: #102754;
  background: var(--teacher-yellow);
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.adventure-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 7vw, 3.7rem);
  font-weight: 1000;
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-shadow: 0 4px 0 rgba(18, 6, 80, 0.24);
}

.adventure-hero p {
  max-width: 620px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
  font-weight: 800;
}

.adventure-summary {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 154px;
  justify-items: center;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 26px;
  padding: 16px 18px;
  color: #102754;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 0 rgba(18, 6, 80, 0.18);
  text-align: center;
}

.adventure-summary strong {
  font-size: 1.7rem;
  font-weight: 1000;
  line-height: 1;
}

.adventure-summary span {
  margin-top: 5px;
  color: #536383;
  font-size: 0.76rem;
  font-weight: 900;
}

.adventure-navigator {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px minmax(130px, 1fr) 44px auto;
  align-items: center;
  gap: 8px;
  width: min(100%, 760px);
  margin: 2px auto 0;
  border: 2px solid rgba(74, 47, 186, 0.18);
  border-radius: 24px;
  padding: 9px;
  color: #201552;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 9px 0 rgba(36, 16, 111, 0.12), 0 18px 36px rgba(36, 16, 111, 0.16);
  backdrop-filter: blur(12px);
}

.adventure-navigator.is-hidden {
  display: none;
}

.adventure-navigator > button,
.adventure-navigator > .adventure-world-button {
  display: inline-grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border: 2px solid #ddd6f5;
  border-radius: 15px;
  color: #2b1a67;
  background: #f4f1ff;
  font: 1000 1rem/1 Nunito, sans-serif;
  cursor: pointer;
  text-decoration: none;
}

.adventure-navigator > button:hover,
.adventure-navigator > button:focus-visible,
.adventure-navigator > .adventure-world-button:hover,
.adventure-navigator > .adventure-world-button:focus-visible {
  border-color: #7653de;
  outline: none;
  background: #eae4ff;
}

.adventure-navigator .adventure-world-button {
  grid-template-columns: auto auto;
  gap: 7px;
  padding: 0 14px;
  border-color: #a7e4bf;
  color: #145b36;
  background: #e9fbf0;
  white-space: nowrap;
}

.adventure-navigator > button:disabled {
  opacity: 0.38;
  cursor: default;
}

.adventure-navigator-position {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.adventure-navigator-position strong {
  font-size: 0.82rem;
  font-weight: 1000;
}

.adventure-scene-dots {
  display: flex;
  max-width: 100%;
  gap: 5px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.adventure-scene-dots::-webkit-scrollbar {
  display: none;
}

.adventure-scene-dots button {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #c8bee9;
  cursor: pointer;
  transition: width 160ms ease, background 160ms ease;
}

.adventure-scene-dots button.is-active {
  width: 25px;
  background: #7653de;
}

.adventure-navigator .adventure-current-button {
  grid-template-columns: auto auto;
  gap: 6px;
  padding: 0 14px;
  color: #102754;
  border-color: #55dfff;
  background: #dff9ff;
  white-space: nowrap;
}

.adventure-board {
  position: relative;
  overflow: clip;
  min-height: 420px;
  border: 2px solid rgba(85, 223, 255, 0.42);
  border-radius: 36px;
  padding: clamp(22px, 5vw, 54px) clamp(10px, 4vw, 34px) 42px;
  background: linear-gradient(180deg, #edf7ff 0%, #f4f0ff 100%);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.38), 0 18px 38px rgba(18, 6, 80, 0.13);
}

.adventure-board::before,
.adventure-board::after {
  position: absolute;
  bottom: -90px;
  width: 380px;
  height: 200px;
  border-radius: 50% 50% 0 0;
  content: "";
  opacity: 0.6;
}

.adventure-board::before {
  left: -110px;
  background: #87e49a;
  transform: rotate(7deg);
}

.adventure-board::after {
  right: -150px;
  background: #65d8bc;
  transform: rotate(-8deg);
}

.adventure-cloud {
  position: absolute;
  z-index: 0;
  width: 110px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.adventure-cloud::before,
.adventure-cloud::after {
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
  content: "";
}

.adventure-cloud::before {
  left: 17px;
  width: 50px;
  height: 50px;
}

.adventure-cloud::after {
  right: 17px;
  width: 62px;
  height: 62px;
}

.adventure-cloud-one {
  top: 130px;
  left: -22px;
  transform: scale(0.72);
}

.adventure-cloud-two {
  top: 46%;
  right: -26px;
  transform: scale(0.58);
}

.adventure-spark {
  position: absolute;
  z-index: 0;
  color: rgba(255, 190, 24, 0.78);
  font-size: 2rem;
}

.adventure-spark-one {
  top: 80px;
  right: 12%;
}

.adventure-spark-two {
  top: 58%;
  left: 8%;
  color: rgba(93, 61, 196, 0.35);
  transform: scale(0.72);
}

.adventure-map {
  position: relative;
  z-index: 1;
  width: min(100%, 900px);
  margin: 0 auto;
}

.adventure-map.is-hidden {
  display: none;
}

.adventure-scenes {
  display: grid;
  gap: 0;
}

.adventure-scene {
  position: relative;
  isolation: isolate;
  overflow: clip;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 34px;
  padding: clamp(18px, 4vw, 34px) clamp(7px, 2vw, 20px) 16px;
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.22), 0 15px 30px rgba(36, 16, 111, 0.12);
  content-visibility: auto;
  contain-intrinsic-height: auto 2450px;
  scroll-margin-top: 110px;
}

.adventure-scene::before,
.adventure-scene::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.adventure-scene::before {
  top: 90px;
  right: -70px;
  width: 230px;
  height: 230px;
  border: 35px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.adventure-scene::after {
  bottom: -75px;
  left: -70px;
  width: 300px;
  height: 160px;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(8deg);
}

.adventure-scene-sky {
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.92) 0 42px, transparent 44px),
    radial-gradient(circle at 84% 30%, rgba(255, 255, 255, 0.72) 0 54px, transparent 56px),
    linear-gradient(180deg, #c9f2ff 0%, #eaf9ff 55%, #dff6e3 100%);
}

.adventure-scene-forest {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 239, 140, 0.62) 0 18px, transparent 20px),
    radial-gradient(circle at 82% 46%, rgba(40, 129, 80, 0.18) 0 70px, transparent 72px),
    linear-gradient(180deg, #dff7d3 0%, #c7efd1 48%, #a9dfc0 100%);
}

.adventure-scene-coast {
  background:
    radial-gradient(circle at 82% 10%, rgba(255, 223, 93, 0.76) 0 42px, transparent 44px),
    linear-gradient(170deg, #bcefff 0 54%, #7edee9 54% 66%, #ffe2a8 66% 100%);
}

.adventure-scene-mountain {
  background:
    linear-gradient(145deg, transparent 0 46%, rgba(111, 91, 177, 0.19) 47% 65%, transparent 66%),
    linear-gradient(215deg, transparent 0 48%, rgba(255, 255, 255, 0.62) 49% 62%, transparent 63%),
    linear-gradient(180deg, #d9e9ff 0%, #e5ddf8 52%, #cabce9 100%);
}

.adventure-scene-space {
  background:
    radial-gradient(circle at 18% 16%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 72% 11%, #ffe66e 0 3px, transparent 4px),
    radial-gradient(circle at 84% 58%, #8eeaff 0 2px, transparent 3px),
    radial-gradient(circle at 23% 72%, #fff 0 2px, transparent 3px),
    linear-gradient(180deg, #19144d 0%, #30236f 48%, #533499 100%);
}

.adventure-scene-heading {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: min(100%, 560px);
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  padding: 10px 14px;
  color: #201552;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 0 rgba(36, 16, 111, 0.11);
  backdrop-filter: blur(10px);
}

.adventure-scene-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: #7653de;
  font-size: 1.2rem;
  font-weight: 1000;
}

.adventure-scene-heading > span:nth-child(2) {
  display: grid;
}

.adventure-scene-heading small {
  color: #7653de;
  font-size: 0.65rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.adventure-scene-heading strong {
  font-size: 1.08rem;
  font-weight: 1000;
}

.adventure-scene-range {
  border-radius: 999px;
  padding: 5px 9px;
  color: #554b70;
  background: rgba(238, 233, 255, 0.88);
  font-size: 0.68rem;
  font-weight: 1000;
  white-space: nowrap;
}

.adventure-scene-space .adventure-scene-heading {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(20, 14, 68, 0.7);
}

.adventure-scene-space .adventure-scene-heading small {
  color: #8eeaff;
}

.adventure-scene-space .adventure-scene-range {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.adventure-scene-space .adventure-connector path {
  stroke: rgba(255, 255, 255, 0.38);
}

.adventure-scene-space .adventure-connector.is-travelled path {
  stroke: #55dfff;
}

.adventure-scene-bridge {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 100px;
  color: #7653de;
}

.adventure-scene-bridge span {
  height: 4px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #c4b8e8 0 9px, transparent 9px 17px);
}

.adventure-scene-bridge strong {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #e8e1ff;
  box-shadow: 0 7px 0 rgba(36, 16, 111, 0.13);
  font-size: 1.25rem;
}

.adventure-trail {
  display: grid;
  padding-top: clamp(46px, 7vw, 76px);
}

.adventure-stop {
  position: relative;
  min-height: 220px;
  scroll-margin-block: 120px;
}

.adventure-connector {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 0;
  width: 100%;
  height: 220px;
  overflow: visible;
  pointer-events: none;
}

.adventure-connector path {
  fill: none;
  stroke: rgba(76, 58, 155, 0.34);
  stroke-dasharray: 3 5;
  stroke-linecap: round;
  stroke-width: 5;
  vector-effect: non-scaling-stroke;
}

.adventure-connector.is-travelled path {
  stroke: #26b994;
  stroke-dasharray: none;
}

.adventure-stop-button {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(54%, 430px);
  min-width: 0;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 12px;
  color: #19142d;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.adventure-stop-left .adventure-stop-button {
  margin-right: auto;
}

.adventure-stop-right .adventure-stop-button {
  flex-direction: row-reverse;
  margin-left: auto;
  text-align: right;
}

.adventure-stop-marker {
  position: relative;
  display: grid;
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 7px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #7653de;
  box-shadow: 0 10px 0 #4b329f, 0 18px 30px rgba(36, 16, 111, 0.24);
  font-size: 2rem;
  font-weight: 1000;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.adventure-stop.is-in_progress .adventure-stop-marker {
  color: #102754;
  background: var(--teacher-yellow);
  box-shadow: 0 10px 0 #d69c11, 0 18px 30px rgba(108, 75, 10, 0.24);
}

.adventure-stop.is-completed .adventure-stop-marker {
  color: #102754;
  background: var(--teacher-cyan);
  box-shadow: 0 10px 0 #1aa6bf, 0 18px 30px rgba(17, 116, 143, 0.2);
}

.adventure-stop-card {
  display: grid;
  min-width: 0;
  flex: 1;
  border: 2px solid rgba(74, 47, 186, 0.17);
  border-radius: 22px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 0 rgba(36, 16, 111, 0.11), 0 14px 26px rgba(36, 16, 111, 0.12);
}

.adventure-stop-kicker {
  color: #7653de;
  font-size: 0.7rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.adventure-stop-card strong {
  overflow: hidden;
  margin-top: 2px;
  font-size: 1.08rem;
  font-weight: 1000;
  line-height: 1.05;
  text-overflow: ellipsis;
}

.adventure-stop-card small {
  overflow: hidden;
  margin-top: 4px;
  color: #66718a;
  font-size: 0.76rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adventure-materials {
  display: flex;
  flex-wrap: wrap;
  justify-content: inherit;
  gap: 5px;
  margin-top: 9px;
}

.adventure-stop-right .adventure-materials {
  justify-content: flex-end;
}

.adventure-material-chip,
.adventure-stop-status {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.66rem;
  font-weight: 1000;
}

.adventure-stop-right .adventure-stop-status {
  justify-self: end;
}

.adventure-material-chip {
  color: #40277e;
  background: #eee9ff;
}

.adventure-material-video {
  color: #713452;
  background: #ffe1e6;
}

.adventure-material-game {
  color: #17663d;
  background: #daf8dc;
}

.adventure-material-book {
  color: #40277e;
  background: #fff1c7;
}

.adventure-stop-status {
  margin-top: 8px;
  color: #fff;
  background: #7653de;
}

.adventure-stop.is-in_progress .adventure-stop-status {
  color: #102754;
  background: var(--teacher-yellow);
}

.adventure-stop.is-completed .adventure-stop-status {
  color: #0e523d;
  background: #baf4df;
}

.adventure-avatar {
  position: absolute;
  top: -64px;
  left: 50%;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 0 rgba(36, 16, 111, 0.18), 0 14px 28px rgba(36, 16, 111, 0.22);
  transform: translateX(-50%);
}

.adventure-avatar::after {
  position: absolute;
  bottom: -12px;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 14px solid #fff;
  border-right: 10px solid transparent;
  border-left: 10px solid transparent;
  content: "";
  transform: translateX(-50%);
}

.adventure-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
}

.adventure-stop.is-current .adventure-stop-marker {
  animation: adventure-current-pulse 2s ease-in-out infinite;
}

.adventure-stop-button:focus-visible {
  border-radius: 26px;
  outline: 4px solid #102754;
  outline-offset: 5px;
}

.adventure-stop-button:hover .adventure-stop-marker {
  transform: translateY(-4px) scale(1.04);
}

.adventure-stop-button:hover .adventure-stop-card {
  border-color: rgba(74, 47, 186, 0.42);
}

.adventure-trail-future {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(88%, 430px);
  justify-items: center;
  margin: 8px auto 0;
  border: 2px dashed rgba(74, 47, 186, 0.28);
  border-radius: 26px;
  padding: 18px;
  color: #4f4970;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.adventure-trail-future > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 50%;
  color: #fff;
  background: #7653de;
  font-size: 1.45rem;
  font-weight: 1000;
}

.adventure-trail-future strong {
  font-size: 0.94rem;
  font-weight: 1000;
}

.adventure-trail-future small {
  margin-top: 3px;
  font-size: 0.75rem;
  font-weight: 800;
}

.adventure-empty {
  position: relative;
  z-index: 2;
  width: min(100%, 620px);
  margin: 80px auto;
  text-align: center;
}

.adventure-dialog {
  width: min(94vw, 880px);
  max-height: min(90vh, 900px);
  overflow: auto;
  border: 0;
  border-radius: 34px;
  padding: 0;
  color: #19142d;
  background: transparent;
  box-shadow: 0 30px 80px rgba(18, 6, 80, 0.42);
}

.adventure-dialog::backdrop {
  background: rgba(18, 6, 80, 0.64);
  backdrop-filter: blur(5px);
}

.adventure-dialog-card {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 640px;
  background: #fbfbff;
}

.adventure-dialog-landscape {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 176px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 13% 30%, rgba(255, 255, 255, 0.9) 0 30px, transparent 32px),
    radial-gradient(circle at 82% 23%, rgba(255, 255, 255, 0.7) 0 44px, transparent 46px),
    linear-gradient(180deg, #bcecff, #e8f8ff);
}

.adventure-dialog-landscape::before,
.adventure-dialog-landscape::after {
  position: absolute;
  z-index: -1;
  content: "";
}

.adventure-dialog-landscape::before {
  right: -8%;
  bottom: -70px;
  width: 62%;
  height: 145px;
  border-radius: 50% 50% 0 0;
  background: rgba(58, 194, 139, 0.48);
  transform: rotate(-5deg);
}

.adventure-dialog-landscape::after {
  bottom: -88px;
  left: -10%;
  width: 68%;
  height: 155px;
  border-radius: 50% 50% 0 0;
  background: rgba(126, 222, 233, 0.62);
  transform: rotate(6deg);
}

.adventure-dialog-theme-icon {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border: 8px solid rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  color: #fff;
  background: #7653de;
  box-shadow: 0 10px 0 rgba(36, 16, 111, 0.18), 0 20px 40px rgba(36, 16, 111, 0.22);
  font-size: 2.1rem;
  font-weight: 1000;
  transform: rotate(-4deg);
}

.adventure-dialog-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 86px;
  border: 5px dashed rgba(255, 255, 255, 0.64);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
}

.adventure-dialog[data-theme="forest"] .adventure-dialog-landscape {
  background:
    radial-gradient(circle at 16% 24%, rgba(255, 235, 118, 0.82) 0 23px, transparent 25px),
    linear-gradient(180deg, #dff7d3 0%, #a9dfc0 100%);
}

.adventure-dialog[data-theme="coast"] .adventure-dialog-landscape {
  background:
    radial-gradient(circle at 82% 22%, #ffdc4d 0 31px, transparent 33px),
    linear-gradient(170deg, #bcefff 0 56%, #7edee9 56% 70%, #ffe2a8 70% 100%);
}

.adventure-dialog[data-theme="mountain"] .adventure-dialog-landscape {
  background:
    linear-gradient(145deg, transparent 0 48%, rgba(111, 91, 177, 0.25) 49% 68%, transparent 69%),
    linear-gradient(215deg, transparent 0 48%, rgba(255, 255, 255, 0.78) 49% 64%, transparent 65%),
    linear-gradient(180deg, #d9e9ff 0%, #cabce9 100%);
}

.adventure-dialog[data-theme="space"] .adventure-dialog-landscape {
  background:
    radial-gradient(circle at 18% 18%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 72% 14%, #ffe66e 0 4px, transparent 5px),
    radial-gradient(circle at 84% 64%, #8eeaff 0 3px, transparent 4px),
    linear-gradient(180deg, #19144d 0%, #533499 100%);
}

.adventure-dialog[data-theme="space"] .adventure-dialog-landscape::before,
.adventure-dialog[data-theme="space"] .adventure-dialog-landscape::after {
  border: 24px solid rgba(255, 255, 255, 0.14);
  background: transparent;
}

.adventure-dialog-content {
  position: relative;
  display: grid;
  gap: 22px;
  margin-top: -20px;
  border-radius: 30px 30px 0 0;
  padding: clamp(26px, 5vw, 42px);
  background:
    radial-gradient(circle at 94% 5%, rgba(85, 223, 255, 0.16), transparent 23%),
    #fbfbff;
}

.adventure-dialog-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 14px;
}

.adventure-dialog-close {
  position: absolute;
  z-index: 4;
  top: 16px;
  right: 16px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid #ded8f5;
  border-radius: 50%;
  color: #2b1a67;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 0 rgba(36, 16, 111, 0.12);
  font: 1000 1.45rem/1 Nunito, sans-serif;
  cursor: pointer;
}

.adventure-dialog-scene {
  width: max-content;
  max-width: 100%;
  color: #7653de;
  font-size: 0.74rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.adventure-dialog-status {
  display: inline-flex;
  justify-self: end;
  width: max-content;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: #7653de;
  font-size: 0.72rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.adventure-dialog-status[data-status="in_progress"] {
  color: #102754;
  background: var(--teacher-yellow);
}

.adventure-dialog-status[data-status="completed"] {
  color: #0e523d;
  background: #baf4df;
}

.adventure-dialog h2 {
  grid-column: 1 / -1;
  max-width: calc(100% - 44px);
  margin: 0;
  color: #201552;
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  font-weight: 1000;
  letter-spacing: -0.04em;
  line-height: 1;
}

.adventure-dialog-level {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  color: #665a89;
  font-size: 0.9rem;
  font-weight: 900;
}

.adventure-dialog-instructions {
  grid-column: 1 / -1;
  margin: 20px 0 0;
  border-left: 5px solid var(--teacher-cyan);
  border-radius: 0 15px 15px 0;
  padding: 13px 15px;
  color: #3e3a52;
  background: #eefbff;
  font-weight: 800;
  line-height: 1.45;
}

.adventure-resource-zone {
  display: grid;
  gap: 16px;
  border: 2px solid rgba(74, 47, 186, 0.14);
  border-radius: 27px;
  padding: clamp(16px, 3vw, 24px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 255, 0.88)),
    #fff;
  box-shadow: 0 12px 0 rgba(36, 16, 111, 0.08);
}

.adventure-resource-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}

.adventure-resource-heading > span:first-child {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: #7653de;
  box-shadow: 0 6px 0 #4b329f;
  font-size: 1.15rem;
}

.adventure-resource-heading > span:last-child {
  display: grid;
}

.adventure-resource-heading small {
  color: #7653de;
  font-size: 0.65rem;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.adventure-resource-heading strong {
  color: #201552;
  font-size: 1.18rem;
  font-weight: 1000;
}

.adventure-dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.adventure-action {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 72px;
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 10px 16px;
  color: #102754;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 7px 0 rgba(36, 16, 111, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.adventure-action > span:first-child {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 1.25rem;
  font-weight: 1000;
}

.adventure-action > span:last-child {
  display: grid;
}

.adventure-action small {
  font-size: 0.72rem;
  font-weight: 900;
}

.adventure-action strong {
  font-size: 1.05rem;
  font-weight: 1000;
}

.adventure-action-video {
  grid-column: 1 / -1;
  min-height: 92px;
  border-color: #ffc1cb;
  background:
    radial-gradient(circle at 92% 22%, rgba(255, 255, 255, 0.72) 0 34px, transparent 36px),
    linear-gradient(135deg, #ffe1e6, #fff2d8);
}

.adventure-action-game {
  border-color: #9de8ad;
  background: linear-gradient(135deg, #daf8dc, #e3fbff);
}

.adventure-action-book {
  border-color: #c9bdfb;
  background: linear-gradient(135deg, #eee9ff, #fff6dc);
  text-decoration: none;
}

.adventure-action-practice[data-book-practice-status="completed"] {
  border-color: #9de8ad;
}

.adventure-action:hover,
.adventure-action:focus-visible {
  border-color: #4a2fba;
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 0 rgba(36, 16, 111, 0.12);
}

.adventure-action-unavailable {
  border: 2px dashed #d4cceb;
  border-radius: 18px;
  padding: 18px;
  color: #675f7b;
  background: #f7f5fc;
  font-weight: 900;
  text-align: center;
}

.adventure-dialog-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.adventure-dialog-navigation button {
  min-height: 46px;
  border: 2px solid #ded8f5;
  border-radius: 16px;
  padding: 9px 14px;
  color: #2b1a67;
  background: #f4f1ff;
  font-weight: 1000;
}

.adventure-dialog-navigation button:nth-child(2) {
  color: #102754;
  border-color: #55dfff;
  background: #dff9ff;
}

.adventure-dialog-navigation button:last-child {
  justify-self: stretch;
}

.adventure-dialog-navigation button:disabled {
  opacity: 0.38;
  cursor: default;
}

@keyframes adventure-current-pulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@media (max-width: 680px) {
  .adventure-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    border-radius: 26px;
    padding: 22px;
  }

  .adventure-summary {
    grid-template-columns: auto auto;
    justify-content: start;
    justify-items: start;
    gap: 8px;
    min-width: 0;
    width: max-content;
    max-width: 100%;
    padding: 12px 15px;
    text-align: left;
  }

  .adventure-summary span {
    margin-top: 0;
  }

  .adventure-navigator {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    border-radius: 20px;
    padding: 7px;
  }

  .adventure-navigator > button,
  .adventure-navigator > .adventure-world-button {
    min-width: 40px;
    min-height: 40px;
    border-radius: 13px;
  }

  .adventure-navigator .adventure-scene-previous {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .adventure-navigator-position {
    grid-column: 2 / 6;
    grid-row: 1;
  }

  .adventure-navigator .adventure-scene-next {
    grid-column: 6 / 7;
    grid-row: 1;
  }

  .adventure-navigator .adventure-current-button {
    grid-column: 1 / 7;
    grid-row: 2;
    min-height: 38px;
  }

  .adventure-navigator-position strong {
    font-size: 0.75rem;
  }

  .adventure-board {
    border-radius: 28px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .adventure-scene {
    border-radius: 25px;
    padding: 14px 3px 12px;
    contain-intrinsic-height: auto 2200px;
    scroll-margin-top: 126px;
  }

  .adventure-scene-heading {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
    width: calc(100% - 18px);
    border-radius: 18px;
    padding: 9px 11px;
  }

  .adventure-scene-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .adventure-scene-range {
    grid-column: 2;
    width: max-content;
  }

  .adventure-scene-bridge {
    grid-template-columns: 1fr 44px 1fr;
    min-height: 78px;
  }

  .adventure-scene-bridge strong {
    width: 44px;
    height: 44px;
  }

  .adventure-stop {
    min-height: 198px;
  }

  .adventure-connector {
    height: 198px;
  }

  .adventure-stop-button {
    width: 78%;
    gap: 8px;
    padding: 8px;
  }

  .adventure-stop-right .adventure-stop-button {
    text-align: left;
  }

  .adventure-stop-marker {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
    border-width: 5px;
    box-shadow: 0 8px 0 #4b329f, 0 15px 24px rgba(36, 16, 111, 0.2);
    font-size: 1.55rem;
  }

  .adventure-stop-card {
    border-radius: 18px;
    padding: 12px;
  }

  .adventure-stop-card strong {
    font-size: 0.93rem;
  }

  .adventure-stop-card small {
    font-size: 0.68rem;
  }

  .adventure-stop-right .adventure-materials {
    justify-content: flex-start;
  }

  .adventure-stop-right .adventure-stop-status {
    justify-self: start;
  }

  .adventure-avatar {
    top: -54px;
    width: 56px;
    height: 56px;
  }

  .adventure-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 25px;
  }

  .adventure-dialog-landscape {
    min-height: 110px;
  }

  .adventure-dialog-theme-icon {
    width: 68px;
    height: 68px;
    border-width: 6px;
    border-radius: 23px;
    font-size: 1.65rem;
  }

  .adventure-dialog-content {
    gap: 13px;
    padding: 20px 14px 16px;
  }

  .adventure-dialog-heading {
    gap: 6px 9px;
  }

  .adventure-dialog-scene {
    font-size: 0.65rem;
  }

  .adventure-dialog h2 {
    max-width: 100%;
    font-size: clamp(1.7rem, 10vw, 2.35rem);
  }

  .adventure-dialog-instructions {
    margin-top: 12px;
    padding: 11px 13px;
  }

  .adventure-resource-zone {
    border-radius: 22px;
    gap: 12px;
    padding: 13px;
  }

  .adventure-dialog-actions {
    grid-template-columns: 1fr;
  }

  .adventure-action-video {
    grid-column: auto;
    min-height: 80px;
  }

  .adventure-action {
    min-height: 64px;
    padding: 8px 12px;
  }

  .adventure-dialog-navigation {
    grid-template-columns: 1fr 1fr;
  }

  .adventure-dialog-navigation button:first-child {
    grid-row: 2;
    grid-column: 1;
  }

  .adventure-dialog-navigation button:nth-child(2) {
    grid-row: 1;
    grid-column: 1 / -1;
  }

  .adventure-dialog-navigation button:last-child {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .adventure-stop.is-current .adventure-stop-marker {
    animation: none;
  }

  .adventure-stop-button,
  .adventure-stop-marker,
  .adventure-action {
    transition: none;
  }
}

/* Student brand palette: deep indigo foundation with logo cyan and yellow accents. */
:root {
  --teacher-navy: #102754;
  --teacher-navy-2: #183a72;
  --teacher-purple: #6256d9;
  --teacher-purple-strong: #4536b9;
  --teacher-lilac: #eeefff;
  --teacher-cyan: #55dfff;
  --teacher-cyan-dark: #0b7197;
  --teacher-cyan-soft: #e4faff;
  --teacher-lime: #95f482;
  --teacher-lime-soft: #e6ffe0;
  --teacher-yellow: #ffdb4d;
  --teacher-yellow-soft: #fff6c6;
  --teacher-page: #17104a;
  --teacher-line: rgba(39, 75, 151, 0.2);
  --teacher-panel-line: rgba(39, 75, 151, 0.22);
  --teacher-shadow-card: 0 14px 34px rgba(8, 27, 66, 0.12);
  --teacher-shadow-panel: 0 18px 0 rgba(8, 27, 66, 0.08), 0 26px 64px rgba(8, 27, 66, 0.2), 0 5px 0 rgba(255, 255, 255, 0.76) inset;
  --teacher-shadow-button: 0 8px 0 rgba(8, 27, 66, 0.2), 0 18px 30px rgba(20, 166, 204, 0.22);
}

body,
.auth-page {
  background:
    radial-gradient(circle at 14% 10%, rgba(85, 223, 255, 0.2), transparent 25rem),
    radial-gradient(circle at 88% 8%, rgba(255, 219, 77, 0.16), transparent 22rem),
    linear-gradient(155deg, #2b177c 0%, var(--teacher-page) 54%, #0d2c57 100%);
  background-attachment: fixed;
}

.auth-logo {
  width: min(320px, 78vw);
  max-height: 180px;
  border-radius: 18px;
  filter: drop-shadow(0 14px 24px rgba(8, 27, 66, 0.16));
}

.program-top .auth-logo {
  width: min(260px, 52vw);
  max-height: 146px;
}

.auth-form input:focus {
  border-color: rgba(85, 223, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(85, 223, 255, 0.2);
}

.auth-link a {
  color: var(--teacher-cyan-dark);
}

.assignment-toggle-button,
.module-action.play,
.player-button.primary,
.auth-button,
.patatas-back,
.grammar-module-button,
.grammar-button-primary,
.filter-chip.is-active,
.focus-mode-button,
.workspace-resource-action.is-active {
  color: var(--teacher-navy) !important;
  background: var(--teacher-cyan) !important;
  box-shadow: var(--teacher-shadow-button);
}

.module-card::before,
.grammar-module-card::before,
.assignment-card::before,
.assignments-summary-card::before,
.program-card::before,
.auth-card::before,
.avatar-card::before,
.assignments-panel::before,
.dashboard-assignments::before,
.tool-card::before {
  background: var(--teacher-cyan) !important;
}

.module-card.is-completed::before,
.vocabulary-module-card::before,
.assignment-card-game::before {
  background: var(--teacher-lime) !important;
}

.video-card::before,
.assignment-card-video::before {
  background: var(--teacher-coral) !important;
}

.eyebrow {
  color: var(--teacher-purple-strong);
}

@media (min-width: 1024px) {
  .topbar {
    background:
      radial-gradient(circle at 18% 8%, rgba(85, 223, 255, 0.2), transparent 24%),
      radial-gradient(circle at 86% 20%, rgba(255, 219, 77, 0.16), transparent 22%),
      linear-gradient(160deg, #362197 0%, #17104a 56%, #0d2c57 100%);
    box-shadow: 20px 0 46px rgba(8, 27, 66, 0.32);
  }

  .topbar .brand {
    padding: 12px;
    border-color: rgba(85, 223, 255, 0.36);
    background: #fff;
    box-shadow: 0 12px 0 rgba(8, 27, 66, 0.16), 0 22px 38px rgba(8, 27, 66, 0.24);
  }

  .topbar .brand-logo {
    width: min(215px, 100%);
    max-height: 122px;
    border-radius: 16px;
  }
}

@media (max-width: 460px) {
  .adventure-page .program-shell {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
  }

  .adventure-page .program-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .adventure-page .program-top .auth-logo-link {
    width: 100%;
    min-width: 0;
    justify-items: start;
  }

  .adventure-page .program-top .auth-logo {
    width: min(220px, 100%);
  }

  .adventure-page .program-user {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: stretch;
    justify-items: stretch;
    width: 100%;
    min-width: 0;
  }

  .adventure-page .program-user .pill {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Compact learning-map introduction; scoped away from login and other pages. */
.adventure-page .program-top .auth-logo { width: min(164px, 34vw); max-height: 94px; }
.adventure-page .adventure-hero { padding: 18px 22px; gap: 16px; }
.adventure-page .adventure-hero h1 { font-size: clamp(1.65rem, 4vw, 2.45rem); line-height: 1.1; }
.adventure-page .adventure-hero p { margin-top: 8px; font-size: .95rem; }
.adventure-page .adventure-summary { padding: 10px 14px; }
@media (max-width: 460px) {
  .adventure-page .program-top { grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
  /* Logo and style picker share row 1; the user pill takes the full row below. */
  .adventure-page .program-top > .program-user { grid-column: 1 / -1; }
  .adventure-page .program-top > .student-style-picker { justify-self: end; min-width: 0; }
  .adventure-page .program-top .auth-logo-link { width: auto; }
  .adventure-page .program-top .auth-logo { width: 110px; }
  .adventure-page .program-user { gap: 5px; }
  .adventure-page .program-user .nav-avatar { width: 38px; height: 38px; }
  .adventure-page .program-user .pill { padding: 8px; font-size: .8rem; }
  .adventure-page .adventure-hero { padding: 16px; gap: 10px; }
}

/* "Nuevo de tu clase": unopened work from the teacher (student-new-from-class.js). */
.new-from-class {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 18px 20px;
  border: 1px solid var(--student-line, #dce4ef);
  border-radius: 22px;
  background: white;
  color: var(--student-ink, #102754);
  box-shadow: var(--student-shadow, 0 6px 22px rgb(16 39 84 / 6%));
}

.new-from-class-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.new-from-class-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--student-primary, #ffdb4d);
  color: var(--student-ink, #102754);
  font-size: 1.15rem;
  font-weight: 900;
}

.new-from-class-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.new-from-class-heading h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2.6vw, 1.35rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.new-from-class-heading p {
  margin: 0;
  color: var(--student-muted, #647087);
  font-size: 0.9rem;
  font-weight: 700;
}

.new-from-class-close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--student-line, #dce4ef);
  border-radius: 14px;
  background: white;
  color: var(--student-ink, #102754);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.new-from-class-close:hover { background: var(--student-page, #f7f9fc); }

.new-from-class-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.new-from-class-list li { display: flex; }

.new-from-class-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--student-line, #dce4ef);
  border-radius: 16px;
  background: var(--student-page, #f7f9fc);
  color: var(--student-ink, #102754);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.new-from-class-item:hover {
  border-color: #b9c6d8;
  background: white;
}

.new-from-class-item-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--student-soft, #e4faff);
  color: var(--student-ink, #102754);
  font-size: 0.95rem;
}

.new-from-class-item-icon[data-place="scenario"] { background: #fff3c4; }
.new-from-class-item-icon[data-place="backpack"] { background: #ece6ff; }

.new-from-class-item-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.new-from-class-item-copy strong {
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.new-from-class-item-copy small {
  color: var(--student-muted, #647087);
  font-size: 0.8rem;
  font-weight: 700;
}

.new-from-class-item-arrow {
  flex: 0 0 auto;
  color: var(--student-muted, #647087);
  font-weight: 900;
}

.new-from-class-more {
  margin: 0;
  color: var(--student-muted, #647087);
  font-size: 0.9rem;
  font-weight: 800;
}

.new-from-class-more summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--student-line, #dce4ef);
  border-radius: 14px;
  background: white;
  color: var(--student-ink, #102754);
  cursor: pointer;
  list-style: none;
}

.new-from-class-more summary::-webkit-details-marker { display: none; }
.new-from-class-more summary::after { content: "▾"; }
.new-from-class-more[open] summary::after { content: "▴"; }
.new-from-class-more summary:hover { background: var(--student-page, #f7f9fc); }
.new-from-class-more[open] summary { margin-bottom: 10px; }

@media (max-width: 560px) {
  .new-from-class { padding: 14px; }
  .new-from-class-icon { width: 40px; height: 40px; }
}
