@import url('./tokens.css');

@font-face {
  font-family: 'Readex Pro';
  src: url('../fonts/ReadexPro-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}
@font-face {
  font-family: 'Readex Pro';
  src: url('../fonts/ReadexPro-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'Readex Pro';
  src: url('../fonts/ReadexPro-bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
  height: 100%;
}
body {
  min-height: 100%;
  display: flex;
  justify-content: center;
  background: var(--color-bg-3);
  font-family: 'Readex Pro', sans-serif;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { text-decoration: none; color: inherit; }
input { font-family: inherit; }
ul { list-style: none; }
/* --- SCROLLBAR --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.25); }
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
/* --- SCROLLBAR --- */
#app {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  height: calc(100vh - 36px);
  width: 390px;
  background-color: var(--color-bg);
  border-radius: 60px;
  border: 3px solid #000;
  overflow: hidden;
}
#top-bar {
  width: 100%;
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline: 32px;
  padding-top: 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--color-border);
}
.icon { opacity: .5; }
#nav-bar {
  position: absolute;
  bottom: 18px;
  width: calc(100% - 36px);
  height: 70px;
  margin-inline: 18px;
  border-radius: 100px;
  background-color: var(--color-bg-2);
  border: 2px solid var(--color-border);
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}
#nav-bar .nav-item {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  opacity: .45;
}
#nav-bar span {
  color: var(--color-text-primary);
  font-size: 12px;
  text-align: center;
}
#nav-bar .nav-item.active { opacity: 1; }
#main {
  overflow-y: scroll;
  height: 81.9%;
  width: 100%;          /* explicit — ensures translateX(100%) = full container width */
  display: flex;
  flex-direction: column;
  align-items: center;
}
.title {
  position: relative;
  width: calc(100% - 36px);
  padding-block: 24px;
  margin-inline: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.line {
  width: 100%;
  height: 2px;
  border-radius: 10px;
  background-color: var(--color-text-muted);
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}
.title h2 {
  background-color: var(--color-bg);
  padding-inline: 11px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 16px;
  color: var(--color-text-muted);
  z-index: 5;
}
#sector-1 {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 50%;
}
.wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
}
.left, .right, .center { margin-bottom: 20px; }
.left { margin-left: -42%; }
.right { margin-right: -42%; }
.base {
  position: absolute;
  inset: 0;
  background: #a5a5a5;
  transform: rotate(45deg) translate(7px, 7px);
  border-radius: 20px;
  z-index: 0;
}
.btn-3d {
  position: absolute;
  inset: 0;
  border: none;
  background: #cfcfcf;
  cursor: pointer;
  transform: rotate(45deg);
  border-radius: 20px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.btn-3d img { transform: rotate(-45deg); }
.wrapper.active .btn-3d { transform: rotate(45deg) translate(7px, 7px); }
.card-readyforclass {
  position: fixed;
  width: 100%;
  max-width: calc(390px - 36px - 6px);

  padding: 24px 18px 18px;
  border-radius: 24px;
  background-color: #A4A4A4;
  margin-left: -4px;

  z-index: 100;

  opacity: 0;
  transform: translate(-50%, 0) translateX(100px);
  pointer-events: none;

  transition: all 0.35s cubic-bezier(.2,.8,.2,1);
}
.card-readyforclass.active {
  opacity: 1;
  transform: translate(-50%, 0) translateX(0);
  pointer-events: auto;
}
.card-readyforclass h3 {
  font-size: 18px;
  color: #111;
}
.card-readyforclass p {
  font-size: 12px;
  color: #000;
  opacity: .5;
  margin-bottom: 11px;
}
.card-readyforclass .flex{
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
}
.flex .button-primary, .flex .button-secondary{
  width: 100%;
  height: 40px;
  border-radius: calc(24px - 18px);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.button-primary {
  background-color: var(--color-brand);
  color: #fff;
}
.button-secondary {
  border: 2px solid var(--color-text-primary);
  color: var(--color-text-primary);
}
.arrow-icon {
  width: 20px;
  height: 10px;
  position: absolute;
  top: -10px;
}
.left-arrow .arrow-icon {
  left: 50%;
  transform: translateX(-50%);
  margin-left: -23%;
}
.right-arrow .arrow-icon {
  right: 50%;
  transform: translateX(-50%);
  margin-right: -28%;
}
.center-arrow .arrow-icon {
  left: 50%;
  transform: translateX(-50%);
}
@media (max-width: 768px) {
  #app {
    width: 100%;
    border-radius: 0px;
    border: none;
    top: 0;
    height: 100vh;
  }
  .card-readyforclass { max-width: calc(100% - 36px - 6px); } 
  .left { margin-left: -25%; }
  .right { margin-right: -25%; }
  .left-arrow .arrow-icon { margin-left: -13.5%; }
  .right-arrow .arrow-icon { margin-right: -16%; }
}
@media (max-width: 480px) {
  .left { margin-left: -36%; }
  .right { margin-right: -36%; }
  .left-arrow .arrow-icon { margin-left: -20%; }
  .right-arrow .arrow-icon { margin-right: -24%; }
}
@media (max-width: 400px) {
  .left { margin-left: -40%; }
  .right { margin-right: -40%; }
  .left-arrow .arrow-icon { margin-left: -22.25%; }
  .right-arrow .arrow-icon { margin-right: -27.5%; }
}

#top-bar.act-top-bar {
  gap: 18px;
  height: 80px;
  padding-top: 38px;
}
.progress-bar {
  width: 100%;
  height: 11px;
  border-radius: 11px;
  background-color: var(--color-bg-3);
}
.thumb-bar {
  width: 36px;
  height: 11px;
  border-radius: 11px;
  background-color: var(--color-brand);
}

#act-sector {
  width: 100%;
  height: calc(100vh - 128px);
  overflow-y: auto;
}

.type { padding-block: 18px; color: var(--color-text-primary); }
.type h4 { color: var(--color-text-primary); padding-bottom: 18px; }
.type img { width: 125px; }
.type .flex {
  display: flex;
  align-items: center;
  gap: 18px;
}
.type .flex .content {
  padding: 0px 6px 6px 0px;
  border-bottom: 3px dashed var(--color-text-primary);
}
.type .flex .content p {
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: bold;
}
.options {
  margin-top: 100px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.type-2 .options {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.btn-option {
  width: 100%;
  padding-block: 18px;
  border-radius: 18px;
  background-color: var(--color-bg-card);
  color: var(--color-text-primary);
  text-align: center;
  font-size: 15px;
  font-weight: 500;
}
.center-img {
  width: 100%;
  height: 170px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-block: 36px;
}
.center-img img { height: 100%; width: auto; }
.type-3 .options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}
.btn-option.active, .btn-option:active, .btn-option:focus { outline: 3px solid var(--color-success); }
.btn-option.disabled { outline: 3px solid var(--color-error); }
.lines {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--color-text-primary);
}
.lines p span {
  width: 60px;
  color: var(--color-text-dark);
  border-bottom: 2px solid var(--color-text-primary);
  height: 18px;
  margin-inline: 6px;
}

.options-word {
  margin-top: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

.word {
  background-color: var(--color-bg-card);
  border-radius: 11px;
  padding: 6px 11px;
  color: var(--color-text-primary);
  border: 2px solid var(--color-border);
}

.options-big {
  margin-top: 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}
.btn-big {
  width: 100%;
  height: 125px;
  border-radius: 18px;
  background-color: var(--color-bg-card);
  color: var(--color-text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  padding: 10px;
  line-height: 1.35;
}
.outline {
  padding: 0px 2px 2px 0px;
  border-bottom: 2px dashed var(--color-text-primary);
  width: fit-content;
  height: 28px;
}
.type-6 .options-big {
  margin-top: 18px;
  height: 564px;
}
.type-6 .options-big .btn-big { height: 100%; }
.type-6 .btn-big {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  gap: 11px;
  font-size: 16px;
  font-weight: medium;
  flex: 1;
}
.type-6 .btn-big .img {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 2;
}

.type-7 {
  height: calc(100vh - 330px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.type-8 {
  height: calc(100vh - 300px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.type-8 .full-content {
  background-color: #95be33;
  border-radius: 200px;
  border: 24px solid #00000050;
}

.full-content {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 350px;
  background-color: var(--color-bg-card);
  border-radius: 42px;
  padding: 18px;
}
.full-content img { 
  width: 100%;
  height: auto;
}

.options-block {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.slider-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  color: var(--color-text-primary);
  padding-block: 11px;
}
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--color-bg-card);
  outline: none;
  transition: all 0.3s ease;
}
.slider { background: linear-gradient(to right, var(--color-brand) 50%, var(--color-bg-card) 50%); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-text-primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.slider::-webkit-slider-thumb:active { transform: scale(1.2); }
.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
}

.type-9 p {
  font-size: 14px;
  margin-top: 6px;
  opacity: .5;
}
#resetBtn {
  position: absolute;
  top: calc(80px + 18px);
  right: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 18px;
  background-color: var(--color-bg-2);
  color: var(--color-text-primary);
  border-radius: 18px;
  font-size: 14px;
  font-weight: bold;
}
.words {
  width: 100%;
  height: calc(100vh - 400px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  cursor: default;
}
.words span {
  font-size: 64px;
  color: white;
  user-select: none;
  position: relative;
  transition: transform 0.2s ease;
  cursor: grab;
}
.words span:active { cursor: grabbing; }

.sector-confirm {
  position: absolute;
  width: 100%;
  background-color: var(--color-bg-3);
  color: var(--color-text-primary);
  bottom: 0px;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
}
.sector-confirm span {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 6px;
}
.sector-confirm p {
  max-width: 90%;
  font-size: 12px;
  opacity: .5;
  margin-bottom: 11px;
}
.btn-confirm {
  width: 100%;
  border-radius: 100px;
  padding-block: 18px;
  text-align: center;
  color: #fff;
  background-color: var(--color-brand);
}

/* ============================================================
   NEW STYLES — Auth, Onboarding, Profile, Activity updates
   ============================================================ */

/* ── Global form elements ─────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.form-group label {
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 500;
}
.form-input {
  background: var(--color-bg-2);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--color-text-primary);
  font-size: 16px;
  font-family: 'Readex Pro', sans-serif;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
}
.form-input:focus { border-color: var(--color-brand); }
.input-wrapper { position: relative; }
.input-wrapper .form-input { padding-right: 48px; }
.toggle-pass {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
}
.toggle-pass svg { width: 20px; height: 20px; }
.forgot-link {
  color: var(--color-text-muted);
  font-size: 13px;
  text-align: right;
  display: block;
  margin-bottom: 20px;
  text-decoration: none;
}
.forgot-link:hover { color: var(--color-text-primary); }

.button-primary, .button-secondary {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Readex Pro', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.button-primary  { background: var(--color-brand); color: #fff; border: none; }
.button-secondary { background: transparent; color: var(--color-text-primary); border: 2px solid var(--color-text-primary); padding: 8px; }
.button-primary:hover, .button-secondary:hover { opacity: 0.85; }
.btn-full { width: 100%; border-radius: 12px; height: 50px; font-size: 16px; font-weight: 500; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.alert-error { background: #2A0D0D; border: 1px solid var(--color-error); color: #FF8080; }

/* ── Auth pages ───────────────────────────────────────────── */
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 32px 24px;
  gap: 20px;
  overflow-y: auto;
}
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.auth-mascot { width: 80px; }
.auth-logo-title {
  color: var(--color-text-primary);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
}
.auth-card {
  background: var(--color-bg-card-2);
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  border: 1px solid var(--color-border);
}
.auth-title    { color: var(--color-text-primary); font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-subtitle { color: var(--color-text-muted); font-size: 14px; margin-bottom: 20px; }
.auth-form     { display: flex; flex-direction: column; }
.auth-footer {
  color: var(--color-text-muted);
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.auth-link { color: var(--color-brand-light); font-weight: 500; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.auth-success { text-align: center; padding: 16px 0; }
.auth-success .success-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #0D2820;
  border: 2px solid var(--color-success);
  color: var(--color-success);
  font-size: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 16px;
}

/* ── Onboarding ───────────────────────────────────────────── */
.onboarding-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: 32px 24px;
  overflow-y: auto;
}
.ob-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}
.ob-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background 0.2s ease, transform 0.2s ease;
}
.ob-dot.active { background: var(--color-brand); transform: scale(1.3); }
.ob-dot.done   { background: var(--color-success); }

.ob-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
}
.ob-mascot   { width: 90px; }
.ob-title    { color: var(--color-text-primary); font-size: 22px; font-weight: 700; text-align: center; }
.ob-subtitle { color: var(--color-text-muted); font-size: 14px; text-align: center; }
.ob-form     { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.ob-btn      { margin-top: 8px; }

.ob-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.ob-option-card {
  display: flex;
  align-items: center;
  background: var(--color-bg-card-2);
  border: 2px solid var(--color-border);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.ob-option-card input[type="radio"] { display: none; }
.ob-option-card.selected,
.ob-option-card:has(input:checked) { border-color: var(--color-brand); background: var(--color-brand-dim); }
.ob-option-inner { display: flex; flex-direction: column; gap: 3px; }
.ob-option-label { color: var(--color-text-primary); font-size: 15px; font-weight: 500; }
.ob-option-desc  { color: var(--color-text-muted); font-size: 12px; }

.ob-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.ob-goal-chip {
  background: var(--color-bg-card-2);
  border: 2px solid var(--color-border);
  border-radius: 100px;
  padding: 10px 18px;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 14px;
  transition: all 0.2s ease;
}
.ob-goal-chip input[type="checkbox"] { display: none; }
.ob-goal-chip.selected { border-color: var(--color-brand); color: var(--color-brand-light); background: var(--color-brand-dim); }

/* ── Profile ──────────────────────────────────────────────── */
.profile-main { padding: 0 0 90px; }
.topbar-title {
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 500;
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}
.topbar-logout img { opacity: 0.6; }
.topbar-logout:hover img { opacity: 1; }

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px 20px;
  gap: 8px;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-brand-dim);
  border: 3px solid var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--color-text-primary);
  font-weight: 700;
  margin-bottom: 6px;
}
.profile-name  { color: var(--color-text-primary); font-size: 20px; font-weight: 700; }
.profile-email { color: var(--color-text-muted); font-size: 13px; }

.plan-badge {
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}
.plan-free { background: var(--color-border-2); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.plan-pro  { background: #0E2A30; color: var(--color-pro); border: 1px solid var(--color-pro); }

.profile-stats {
  display: flex;
  justify-content: space-evenly;
  width: 100%;
  padding: 20px 12px;
  border-top: 1px solid var(--color-border-2);
  border-bottom: 1px solid var(--color-border-2);
  margin-bottom: 16px;
}
.stat-card { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-value { color: var(--color-text-primary); font-size: 22px; font-weight: 700; }
.stat-label { color: var(--color-text-muted); font-size: 12px; }

.profile-progress-wrap { padding: 0 24px 20px; }
.profile-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--color-bg-3);
  border-radius: 100px;
  overflow: hidden;
}
.profile-progress-fill {
  height: 100%;
  background: var(--color-brand);
  border-radius: 100px;
  transition: width 0.4s ease;
}

.profile-section { padding: 16px 24px; border-top: 1px solid var(--color-border-2); }
.section-title { color: var(--color-text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.profile-level { color: var(--color-text-primary); font-size: 15px; }

.achievements-grid { display: flex; flex-direction: column; gap: 10px; }
.achievement-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-bg-card-2);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--color-border-2);
  transition: opacity 0.2s ease;
}
.achievement-card.locked { opacity: 0.4; filter: grayscale(1); }
.achievement-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.achievement-icon img { width: 22px; opacity: 0.8; }
.achievement-card.earned .achievement-icon { background: #1a2e1a; }
.achievement-card.earned .achievement-icon img { filter: none; }
.achievement-info { display: flex; flex-direction: column; gap: 2px; }
.achievement-name { color: var(--color-text-primary); font-size: 14px; font-weight: 500; }
.achievement-desc { color: var(--color-text-muted); font-size: 12px; }
.achievement-date { color: var(--color-success); font-size: 11px; margin-top: 2px; }

/* ── Home page extras ─────────────────────────────────────── */
.top-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 0 12px;
}
.top-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--color-bg-3);
  border-radius: 100px;
  overflow: hidden;
}
.top-progress-fill {
  height: 100%;
  background: var(--color-brand);
  border-radius: 100px;
  transition: width 0.4s ease;
}
.top-progress-label { color: var(--color-text-muted); font-size: 12px; white-space: nowrap; }
.icon-btn { background: none; border: none; cursor: pointer; padding: 4px; }
.icon-btn img { width: 24px; opacity: 0.5; }
.icon-btn:hover img { opacity: 1; }

.course-title-row {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-block: 32px 32px;
}
.course-title-row h2 {
  color: var(--color-text-muted);
  font-size: 16px;
  font-weight: 500;
  background: var(--color-bg);
  padding: 0 12px;
  position: relative;
  z-index: 1;
}

/* Chapter labels */
.chapter-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 16px 0 8px;
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: 500;
}
.chapter-label small { color: var(--color-text-muted); font-size: 11px; font-weight: 400; }
.chapter-label.locked { opacity: 0.5; }
.chapter-lock-icon { width: 16px; opacity: 0.5; }

/* Wrapper locked/done states */
.wrapper.is-locked .btn-3d { filter: grayscale(1); background-color: #666; cursor: not-allowed; }
.wrapper.is-locked .btn-3d img { opacity: .25; }
.wrapper.is-done .btn-3d   { filter: brightness(1.2); }
.lock-overlay, .done-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 18px;
  pointer-events: none;
}

/* Modal extras */
.modal-meta { margin-block: 6px; }
.modal-chip {
  display: inline-block;
  background: rgba(0,0,0,0.15);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 11px;
  color: #111;
}
.modal-btns { display: flex; flex-direction: column; gap: 11px; margin-top: 11px; }

/* ── Activity (act.php) ───────────────────────────────────── */
#act-top-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 80px;
  padding: 38px 18px 14px;
  border-bottom: 2px solid var(--color-border);
}
.act-back-btn {
  display: flex;
  align-items: center;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.act-back-btn img { width: 20px; opacity: 0.7; }
.act-progress-wrap { flex: 1; }
.act-progress-track {
  width: 100%;
  height: 11px;
  border-radius: 11px;
  background: var(--color-bg-3);
  overflow: hidden;
}
.act-progress-fill {
  height: 100%;
  background: var(--color-brand);
  border-radius: 11px;
  transition: width 0.4s ease;
}
.hearts-counter {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 500;
}
.hearts-counter img { width: 20px; }

.activity-slide {
  display: none;
  flex-direction: column;
  padding: 24px 18px 180px;
  color: var(--color-text-primary);
  min-height: calc(100vh - 122px);
  position: relative;
}
.activity-slide.active { display: flex; }
.activity-slide h4 {
  color: var(--color-text-primary);
  font-size: 18px;
  margin-bottom: 18px;
  align-self: flex-start;
  text-align: left;
}
.activity-slide h4.outline {
  border-bottom: 2px dashed var(--color-text-primary);
  padding-bottom: 6px;
  width: fit-content;
}

@media (max-width: 768px) { .activity-slide { min-height: calc(100vh - 80px); } }

/* act-1 layout */
.act1-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}
.act1-image-col img { width: 110px; }
.act1-concept {
  border-bottom: 3px dashed var(--color-text-primary);
  padding-bottom: 8px;
}
.act1-concept p { color: var(--color-text-primary); font-size: 16px; font-weight: bold; margin-top: -18px; }

/* Grid options */
.options-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 16px;
}

/* fill-blank */
.lines {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--color-text-primary);
  margin-bottom: 24px;
  line-height: 2;
}
.blank-slot {
  display: inline-block;
  min-width: 70px;
  border-bottom: 2px solid var(--color-text-primary);
  text-align: center;
  color: transparent;
  margin-inline: 4px;
  padding: 0 8px;
  cursor: default;
}
.blank-slot.filled       { color: var(--color-text-primary); }
.blank-slot.correct      { border-color: var(--color-success); color: var(--color-success); }
.blank-slot.wrong        { border-color: var(--color-error); color: var(--color-error); }
.options-word { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.word.used { opacity: 0.3; }

/* image grid (act-6) */
.options-image-grid { margin-top: 18px; height: 460px; }
.btn-image {
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  height: 100%;
}
.btn-img-wrap {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}
.btn-img-wrap img { max-height: 100%; max-width: 100%; object-fit: contain; }

/* btn states in activities */
.btn-option.active, .btn-big.active { outline: 3px solid var(--color-success); }
.btn-option.disabled, .btn-big.disabled { outline: 3px solid var(--color-error); }
.btn-option:disabled, .btn-big:disabled { cursor: not-allowed; }

/* sector-confirm updated */
.sector-confirm {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--color-bg-3);
  padding: 20px 18px;
  display: none;
  border-top: 2px solid var(--color-border-2);
}
.sector-confirm.active { display: block; }
.sector-confirm.confirm-correct { border-top-color: var(--color-success); }
.sector-confirm.confirm-wrong   { border-top-color: var(--color-error); }
.confirm-inner { display: flex; flex-direction: column; gap: 8px; }
.confirm-emoji { font-size: 18px; font-weight: 700; color: var(--color-text-primary); }
.confirm-text  { font-size: 13px; color: var(--color-text-muted); line-height: 1.5; }
.btn-confirm {
  width: 100%;
  padding: 16px;
  border-radius: 100px;
  background: var(--color-brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.btn-confirm:hover { background: var(--color-brand-light); }

/* slider check btn */
.slider-check-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: var(--color-brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.slider-check-btn:hover  { background: var(--color-brand-light); }
.slider-check-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* act-7 nav preview */
.nav-bar-preview {
  background: var(--color-bg-2);
  border-radius: 18px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  width: 100%;
}
.nav-bar-preview .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: default;
  padding: 6px;
  opacity: 0.5;
  color: var(--color-text-primary);
  font-size: 11px;
}
.nav-bar-preview .nav-item.active { opacity: 1; }

/* act-8 color preview */
.act8-preview {
  border-radius: 200px;
  border: 24px solid rgba(0,0,0,0.3);
  height: 280px;
  flex-direction: column;
  gap: 8px;
}
.act8-preview h1 { color: rgba(255,255,255,0.8); font-size: 20px; }
.act8-target-label { color: rgba(255,255,255,0.5); font-size: 12px; }
.slider-label-rgb { font-weight: 700; min-width: 16px; }

/* act-9 kerning */
.kerning-subtitle { font-size: 14px; opacity: 0.5; margin-bottom: 12px; }
.kerning-reset-btn {
  position: absolute;
  top: 64px;
  right: 18px;
  background: var(--color-bg-2);
  color: var(--color-text-primary);
  border-radius: 18px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.kerning-letter {
  font-size: 56px;
  color: var(--color-text-primary);
  position: relative;
  user-select: none;
  cursor: grab;
  transition: transform 0.2s ease;
}
.kerning-letter.locked { opacity: 0.7; cursor: default; }
.kerning-letter:active { cursor: grabbing; }

/* act-empty */
.act-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  color: var(--color-text-muted);
  text-align: center;
}

/* Completion screen */
#completion-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 24px;
}
.completion-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.completion-content h2 { color: var(--color-text-primary); font-size: 26px; font-weight: 700; }
.completion-content p  { color: var(--color-text-muted); font-size: 15px; }
.completion-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 8px 0;
}
.completion-score span:first-child { font-size: 64px; font-weight: 700; color: var(--color-success); }
.completion-score span:last-child  { font-size: 24px; color: var(--color-text-muted); }

/* input[type=range] — reuse slider style for act-7/8 */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--color-brand) 50%, var(--color-bg-3) 50%);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-text-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-text-primary);
  border: none;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
   RACHA
   ══════════════════════════════════════════════════════════ */
.racha-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 0 8px;
}
.racha-count {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.racha-number {
  font-size: 52px;
  font-weight: 700;
  color: var(--color-xp);
  line-height: 1;
}
.racha-label {
  font-size: 14px;
  color: var(--color-text-muted);
}
.racha-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 8px 0 16px;
}

/* ── Racha visual stats ── */
.racha-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.racha-stat-pill {
  flex: 1;
  background: var(--color-bg-2);
  border-radius: 16px;
  padding: 14px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.racha-stat-icon { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.racha-stat-val  { font-size: 22px; font-weight: 700; color: var(--color-text-primary); line-height: 1.1; }
.racha-stat-lbl  { font-size: 11px; color: var(--color-text-muted); text-align: center; margin-top: 2px; }

/* ── Calendar ── */
.racha-calendar {
  background: var(--color-bg-2);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 20px;
}
.racha-month-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: 12px;
  text-transform: capitalize;
}
.racha-day-names {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}
.racha-day-names span {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
}
.racha-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.racha-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--color-bg-3);
  position: relative;
  gap: 2px;
}
.racha-cell--empty {
  background: transparent;
}
.racha-active {
  background: #0D2A1C;
}
.racha-today {
  border: 2px solid var(--color-text-primary);
}
.racha-day-num {
  font-size: 10px;
  color: var(--color-text-muted);
}
.racha-active .racha-day-num {
  color: var(--color-success);
}
.racha-flame {
  font-size: 11px;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════
   REPASAR
   ══════════════════════════════════════════════════════════ */
.repasar-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 0 20px;
  text-align: center;
}
.repasar-hero h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
}
.repasar-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.repasar-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-bg-2);
  border: 1px solid var(--color-border-2);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color var(--t-fast);
  text-decoration: none;
  color: inherit;
}
.repasar-card:hover {
  border-color: var(--color-border);
}
.repasar-card.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.repasar-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  background: var(--color-bg-3);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.repasar-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.repasar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.repasar-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}
.repasar-arrow {
  font-size: 18px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   PLAN
   ══════════════════════════════════════════════════════════ */
.plan-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 0 20px;
  text-align: center;
}
.plan-hero h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
}
.plan-card {
  background: var(--color-bg-2);
  border: 1px solid var(--color-border-2);
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}
.plan-card.plan-current {
  border-color: var(--color-text-muted);
}
.plan-card-pro {
  border-color: var(--color-pro);
}
.plan-badge-pro {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-pro);
  color: #111;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.plan-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.plan-card-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
}
.plan-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
}
.plan-price small {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 400;
}
.plan-current-badge {
  background: #1a3a1a;
  color: var(--color-success);
  border: 1px solid var(--color-success);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-weight: 600;
}
.plan-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.plan-features li {
  font-size: 14px;
  color: var(--color-text-primary);
}
.plan-feat-no {
  color: var(--color-text-muted) !important;
}
.plan-differentials,
.plan-coming {
  background: var(--color-bg-3);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 12px;
}
.plan-differentials h4,
.plan-coming h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}
.plan-differentials p,
.plan-coming p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   SETTINGS
   ══════════════════════════════════════════════════════════ */
.settings-section {
  background: var(--color-bg-2);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
}
.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-2);
  font-size: 14px;
  color: var(--color-text-primary);
}
.settings-toggle-row:last-of-type {
  border-bottom: none;
}
.settings-danger {
  border: 1px solid rgba(212,31,31,.3);
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-bg-3);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--t-fast);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--t-fast);
}
.toggle input:checked + .toggle-slider {
  background: var(--color-success);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Slider container (avatar size) */
.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.slider-container p {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ══════════════════════════════════════════════════════════
   AVATAR EDITOR
   ══════════════════════════════════════════════════════════ */
.avatar-preview-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-preview-large img {
  object-fit: contain;
  transition: width var(--t-normal), height var(--t-normal);
}
.avatar-icons-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.avatar-icon-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-3);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  padding: 8px;
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.avatar-icon-opt input[type="radio"] { display: none; }
.avatar-icon-opt img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.avatar-icon-opt.selected,
.avatar-icon-opt:has(input:checked) {
  border-color: var(--color-text-primary);
}
.avatar-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.avatar-color-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.avatar-color-opt input[type="radio"] { display: none; }
.avatar-color-opt span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: block;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.avatar-color-opt.selected span,
.avatar-color-opt:has(input:checked) span {
  border-color: var(--color-text-primary);
  transform: scale(1.15);
}

/* ══════════════════════════════════════════════════════════
   NOTIFICATIONS (actividad.php)
   ══════════════════════════════════════════════════════════ */
.notif-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-2);
}
.notif-item:last-child { border-bottom: none; }
.notif-unread .notif-title { color: var(--color-text-primary); font-weight: 600; }
.notif-icon {
  width: 38px;
  height: 38px;
  background: var(--color-bg-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-icon img { width: 18px; opacity: 0.7; }
.notif-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.notif-title { font-size: 14px; color: var(--color-text-muted); }
.notif-msg   { font-size: 12px; color: var(--color-text-muted); line-height: 1.4; }
.notif-time  { font-size: 11px; color: var(--color-text-muted); opacity: 0.6; }
.notif-badge {
  position: absolute;
  top: 8px;
  right: 6px;
  background: var(--color-error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ══════════════════════════════════════════════════════════
   DESAFÍOS
   ══════════════════════════════════════════════════════════ */
.desafios-main {
  overflow-y: auto;
  padding: 16px;
}
.desafios-section {
  margin-bottom: 24px;
}
.desafios-section--leaderboard {
  width: 100%;
  border-bottom: 2px solid var(--color-border-2);
  margin-bottom: 24px;
}
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-bg-2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  border: 1px solid var(--color-border-2);
}
.leaderboard-top {
  border-color: var(--color-xp);
}
.lb-rank {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-muted);
  min-width: 20px;
  text-align: center;
}
.leaderboard-top .lb-rank { color: var(--color-xp); }
.lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.lb-avatar img { width: 70%; height: 70%; object-fit: contain; }
.lb-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lb-name { font-size: 13px; font-weight: 500; color: var(--color-text-primary); }
.lb-date { font-size: 11px; color: var(--color-text-muted); }
.lb-xp   {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-xp);
}
.leaderboard-empty {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 20px 0;
}
.challenges-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.challenge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg-2);
  border: 1px solid var(--color-border-2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-fast);
}
.challenge-card:hover { border-color: var(--color-border); }
.challenge-card.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: default;
}
.challenge-coming { font-size: 12px; color: var(--color-text-muted); font-style: italic; }
.challenge-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.challenge-name { font-size: 14px; font-weight: 500; color: var(--color-text-primary); }
.challenge-desc { font-size: 12px; color: var(--color-text-muted); }
.challenge-xp {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-xp);
  white-space: nowrap;
  margin-left: 12px;
}
.challenge-xp small { font-size: 10px; font-weight: 400; }
.challenge-empty {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 12px 0;
}

/* ══════════════════════════════════════════════════════════
   HOME — chapter divider + Avanzar btn
   ══════════════════════════════════════════════════════════ */
.chapter-divider .line {
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--color-border-2);
}
.chapter-divider--locked h2 { color: #444; }
.chapter-locked-hint {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: -12px;
  margin-bottom: 8px;
}
.btn-avanzar {
  display: block;
  text-align: center;
  margin: 36px auto 12px;
  padding: 14px 24px;
  background: var(--color-xp);
  color: #111;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--r-pill);
  text-decoration: none;
  width: calc(100% - 48px);
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.btn-avanzar:hover { opacity: 0.9; transform: scale(1.02); }

/* ══════════════════════════════════════════════════════════
   CHAPTER EVAL
   ══════════════════════════════════════════════════════════ */
.eval-intro-content,
.eval-result-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 32px 24px;
}
.eval-intro-content h2,
.eval-result-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
}
.eval-intro-content h3 {
  font-size: 16px;
  color: var(--color-text-muted);
  font-weight: 400;
}
.eval-intro-content p,
.eval-result-content p {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.eval-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
.eval-rule {
  background: var(--color-bg-2);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--color-text-primary);
  text-align: left;
}
.eval-counter {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  align-self: flex-start;
  position: sticky;
  top: 0;
}
.eval-score-big {
  font-size: 52px;
  font-weight: 700;
  color: var(--color-success);
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.eval-score-big span:last-child { font-size: 24px; color: var(--color-text-muted); }
.eval-practice-hint {
  background: var(--color-bg-2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-align: left;
  width: 100%;
}
.eval-practice-hint p {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.eval-class-link {
  display: block;
  padding: 10px 14px;
  background: var(--color-bg-3);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--color-text-primary);
  text-decoration: none;
  margin-bottom: 6px;
  border: 1px solid var(--color-border-2);
}

/* ══════════════════════════════════════════════════════════
   MOTIVATION OVERLAY (act.php)
   ══════════════════════════════════════════════════════════ */
.motivation-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal);
}
.motivation-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.motivation-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: popIn .3s var(--ease-out);
}
.motivation-inner img { width: 130px; }
.motivation-inner p {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
}
@keyframes popIn {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

/* ══════════════════════════════════════════════════════════
   COMPLETION SCREEN (act.php)
   ══════════════════════════════════════════════════════════ */
.completion-class-name {
  font-size: 15px;
  color: var(--color-text-muted);
}
.completion-stats {
  display: flex;
  gap: 12px;
  margin: 4px 0;
}
.stat-pill {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: var(--r-md);
}
.stat-pill-icon { font-size: 22px; }
.stat-pill > span:last-child { font-size: 26px; font-weight: 700; }
.correct-pill { background: #1a3a1a; }
.correct-pill .stat-pill-icon,
.correct-pill > span:last-child { color: var(--color-success); }
.wrong-pill   { background: #3a1a1a; }
.wrong-pill .stat-pill-icon,
.wrong-pill > span:last-child   { color: var(--color-error); }
.completion-xp {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-xp);
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.xp-label { font-size: 18px; color: var(--color-text-muted); font-weight: 400; }
.completion-time {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Modal XP tag */
.modal-xp-tag {
  display: inline-block;
  background: rgba(0,0,0,.25);
  color: var(--color-xp);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  margin-left: 8px;
  vertical-align: middle;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════ */
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}
.pop-correct { animation: popCorrect .3s var(--ease-out); }
@keyframes popCorrect {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.07); }
  100% { transform: scale(1); }
}
.shake { animation: shake .4s ease; }
.heart-lost { animation: shake .3s ease; }

/* ══════════════════════════════════════════════════════════
   PROFILE — avatar display
   ══════════════════════════════════════════════════════════ */
.profile-avatar-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.profile-avatar-wrap img {
  object-fit: contain;
}
.profile-avatar-edit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.profile-avatar-edit-label {
  font-size: 11px;
  color: var(--color-text-muted);
}
.profile-achievements-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.profile-achievements-header .section-title { margin-bottom: 0; }
.achievements-count {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   INSTALL PAGE
   ══════════════════════════════════════════════════════════ */
.install-main {
  padding: 24px 20px;
  box-sizing: border-box;
}
.install-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin-bottom: 28px;
}
.install-hero h2 { font-size: 22px; font-weight: 700; color: var(--color-text-primary); }
.install-hero p  { font-size: 14px; color: var(--color-text-muted); line-height: 1.5; }
.install-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}
.install-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--color-bg-2);
  border-radius: var(--r-lg);
  padding: 16px;
}
.install-step-num {
  width: 32px;
  height: 32px;
  background: var(--color-bg-3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  flex-shrink: 0;
}
.install-step-body {
  flex: 1;
}
.install-step-body strong {
  display: block;
  font-size: 14px;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}
.install-step-body p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.4;
}
.install-platforms {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}
.install-platform {
  flex: 1;
  background: var(--color-bg-2);
  border-radius: var(--r-md);
  padding: 14px;
  text-align: center;
  border: 1px solid var(--color-border-2);
}
.install-platform strong {
  display: block;
  font-size: 14px;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}
.install-platform p {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ══════════════════════════════════════════════════════════
   CHALLENGE PAGE
   ══════════════════════════════════════════════════════════ */
.challenge-header {
  text-align: center;
  padding: 24px 20px 16px;
}
.challenge-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}
.challenge-header p {
  font-size: 13px;
  color: var(--color-text-muted);
}
.challenge-xp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2a2500;
  color: var(--color-xp);
  font-size: 14px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  margin-top: 10px;
}

/* REPASAR MODO page */
.repasar-modo-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 8px;
  text-align: center;
}
.repasar-modo-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
}
.repasar-modo-header p {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ══════════════════════════════════════════════════════════
   THEORY SLIDES (theory-text, podcast, reel, cuento)
   ══════════════════════════════════════════════════════════ */
.theory-slide {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--color-text-primary);
}
.theory-otto {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.theory-otto img { width: 80px; }
.theory-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
}
.theory-body {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.6;
}
.theory-annotation {
  display: flex;
  gap: 10px;
  background: var(--color-bg-2);
  border-radius: var(--r-md);
  padding: 14px;
  border-left: 3px solid var(--color-xp);
}
.annotation-icon { font-size: 18px; flex-shrink: 0; }
.theory-annotation p { font-size: 13px; color: var(--color-text-muted); line-height: 1.5; }
.btn-theory-continue {
  width: 100%;
  padding: 16px;
  border-radius: var(--r-pill);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
}
.btn-theory-continue:hover { background: var(--color-brand-light); }

/* ══════════════════════════════════════════════════════════
   THEORY — PODCAST
   ══════════════════════════════════════════════════════════ */
.theory-podcast-slide { gap: 14px; }

.pod-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pod-cover {
  position: relative;
  flex-shrink: 0;
}
.pod-cover-img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--color-bg-2);
}
.pod-cover-mic {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-bg);
}
.pod-cover-mic .material-symbols-rounded { font-size: 13px; color: #111; }
.pod-header-text { flex: 1; min-width: 0; }
.pod-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
  margin: 0 0 4px;
}
.pod-speakers { font-size: 12px; color: var(--color-text-muted); margin: 0; }
.pod-description {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}
.pod-player {
  background: var(--color-bg-2);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pod-no-audio {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  margin: 0;
}

/* Waveform (decorative, animates while playing) */
.pod-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 44px;
}
.pod-wave-bar {
  flex-shrink: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--color-border-2);
  /* Bars are frozen by default; animation only kicks in while audio plays */
  animation: none;
}
.pod-wave-playing .pod-wave-bar {
  animation: podWave 1.4s ease-in-out infinite alternate;
}
@keyframes podWave {
  from { opacity: .3; transform: scaleY(.3); }
  to   { opacity: 1;  transform: scaleY(1); }
}

/* Scrubable progress bar */
.pod-progress-wrap {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.pod-prog-track {
  position: relative;
  width: 100%;
  height: 20px; /* big touch target */
  display: flex;
  align-items: center;
}
.pod-prog-track::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: var(--color-bg-3);
  border-radius: 2px;
}
.pod-prog-fill {
  position: absolute;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(to right, var(--color-primary), var(--color-success));
  border-radius: 2px;
  transition: width .4s linear;
}
.pod-prog-thumb {
  position: absolute;
  left: 0%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  transition: left .4s linear;
}
.pod-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Controls */
.pod-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.pod-skip-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color .15s;
}
.pod-skip-btn:hover { color: var(--color-text-primary); }
.pod-skip-btn .material-symbols-rounded { font-size: 28px; }
.pod-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-text-primary);
  color: var(--color-text-dark);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s;
  flex-shrink: 0;
}
.pod-play-btn:active { transform: scale(.93); }
.pod-play-btn .material-symbols-rounded { font-size: 36px; color: var(--color-text-dark); }
.pod-speed-btn {
  background: var(--color-bg-3);
  border: none;
  border-radius: 6px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 4px 8px;
  cursor: pointer;
  transition: color .15s;
}
.pod-speed-btn:hover { color: var(--color-text-primary); }
.pod-unlock-hint { font-size: 12px; color: var(--color-text-muted); text-align: center; margin: 0; }

/* ══════════════════════════════════════════════════════════
   THEORY — REEL (vertical video)
   ══════════════════════════════════════════════════════════ */
/* Theory slides don't have a confirm panel — less bottom padding needed */
.activity-slide--theory {
  padding-bottom: 24px !important;
}

.theory-reel-slide {
  gap: 12px;
}
.reel-title-top {
  font-size: 18px;
  margin: 0;
}

.reel-wrap {
  position: relative;
  width: 100%;
  /* 9:16 portrait ratio, max height so it fits in the slide */
  aspect-ratio: 9 / 14;
  max-height: 340px;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
}
.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.reel-tap-zone {
  position: absolute;
  inset: 0;
  cursor: pointer;
  /* Let touches pass through to controls below */
  z-index: 1;
}
.reel-center-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
  transition: opacity .2s;
}
.reel-center-play .material-symbols-rounded {
  font-size: 72px;
  color: rgba(255,255,255,.85);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}

/* Bottom overlay with controls */
.reel-overlay-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 14px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
}
.reel-caption {
  font-size: 13px;
  color: rgba(255,255,255,.9);
  margin: 0;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.reel-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reel-time {
  font-size: 11px;
  color: rgba(255,255,255,.8);
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.reel-seek {
  flex: 1;
  position: relative;
  height: 20px;   /* tall touch target */
  display: flex;
  align-items: center;
  cursor: pointer;
}
.reel-seek::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,.3);
  border-radius: 2px;
}
.reel-seek-fill {
  position: absolute;
  left: 0;
  height: 3px;
  width: 0%;
  background: #fff;
  border-radius: 2px;
  transition: width .3s linear;
}
.reel-seek-thumb {
  position: absolute;
  left: 0%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
  transition: left .3s linear;
}
.reel-mute-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 4;
}
.reel-mute-btn .material-symbols-rounded { font-size: 20px; }

.reel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ══════════════════════════════════════════════════════════
   THEORY — CUENTO (dialogue / chat bubbles)
   ══════════════════════════════════════════════════════════ */
.theory-cuento-slide { gap: 12px; }
.cuento-title { font-size: 18px; margin: 0; }

.cuento-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 320px;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 4px 2px;
}

/* Individual message row */
.cuento-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: none;
}
.cuento-msg-left  { flex-direction: row; }
.cuento-msg-right { flex-direction: row-reverse; }
.cuento-msg-narrator { justify-content: center; }

@keyframes cuentoIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cuento-msg-enter { animation: cuentoIn .35s var(--ease-out) both; }

/* Avatar */
.cuento-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.cuento-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg-2);
}
.cuento-name {
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Bubble */
.cuento-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.45;
}
.cuento-bubble-left {
  background: var(--color-bg-2);
  border-bottom-left-radius: 4px;
  color: var(--color-text-primary);
}
.cuento-bubble-right {
  background: var(--color-primary);
  border-bottom-right-radius: 4px;
  color: #111;
}
.cuento-bubble-text { font-size: 14px; margin: 0; }

/* Narrator */
.cuento-narrator {
  background: rgba(255,255,255,.07);
  border: 1px solid var(--color-border-2);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
}

/* Empty */
.cuento-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
  color: var(--color-text-muted);
  font-size: 13px;
  text-align: center;
}

/* Progress dots */
.cuento-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}
.cuento-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border-2);
  transition: background .2s, transform .2s;
}
.cuento-dot-active {
  background: var(--color-primary);
  transform: scale(1.3);
}

/* Nav buttons */
.cuento-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cuento-prev-btn {
  background: none;
  border: 1px solid var(--color-border-2);
  border-radius: 10px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-size: 13px;
  transition: border-color .15s, color .15s;
}
.cuento-prev-btn:hover { border-color: var(--color-text-primary); color: var(--color-text-primary); }
.cuento-next-btn {
  flex: 1;
  background: var(--color-bg-2);
  border: 1px solid var(--color-border-2);
  border-radius: 10px;
  color: var(--color-text-primary);
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s;
}
.cuento-next-btn:hover { background: var(--color-bg-3); }
.cuento-next-btn .material-symbols-rounded { font-size: 18px; }
.cuento-prev-btn .material-symbols-rounded { font-size: 18px; }

@keyframes cuentoContIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cuento-cont-enter { animation: cuentoContIn .3s var(--ease-out) both; }

/* ══════════════════════════════════════════════════════════
   MULTI-CORRECT & TRUE-FALSE activity types
   ══════════════════════════════════════════════════════════ */
.multi-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.btn-multi {
  border: 2px solid var(--color-border);
  transition: border-color var(--t-fast), background var(--t-fast);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
}
.btn-multi.multi-selected {
  border-color: var(--color-brand);
  background: var(--color-brand-dim);
}
.multi-confirm-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--r-pill);
  background: var(--color-text-primary);
  color: #111;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
}

.options-tf {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.btn-tf {
  padding: 20px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* options margin reset for activity-slide context */
.activity-slide .options {
  margin-top: 16px;
}
.activity-slide .options-big {
  margin-top: 16px;
}
.activity-slide .options-word {
  margin-top: 16px;
}
.activity-slide .lines {
  margin-bottom: 16px;
}

/* ══════════════════════════════════════════════════════════
   OTTO CHAT (coming soon)
   ══════════════════════════════════════════════════════════ */
.otto-main {
  overflow: hidden;
  height: calc(100vh - var(--topbar-h) - var(--navbar-h));
  display: flex;
  flex-direction: column;
}
.otto-chat-preview {
  flex: 1;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  filter: blur(3px);
  pointer-events: none;
  opacity: 0.5;
}
.chat-bubble {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 90%;
}
.chat-otto { align-self: flex-start; }
.chat-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg {
  background: var(--color-bg-2);
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--color-text-primary);
  line-height: 1.4;
}
.chat-user .chat-msg {
  background: #2a3a2a;
  color: #ccc;
}
.typing-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  margin: 0 2px;
  animation: typingBounce 1s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
}
.otto-coming-soon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(37,37,37,.85);
  backdrop-filter: blur(8px);
}
.coming-card {
  background: var(--color-bg-2);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--color-border-2);
  max-width: 320px;
  width: 100%;
}
.coming-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 12px 0 8px;
}
.coming-card p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
.coming-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.coming-feat {
  background: var(--color-bg-3);
  border-radius: var(--r-sm);
  padding: 10px 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.otto-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border-2);
  background: var(--color-bg);
}
.otto-fake-input {
  flex: 1;
  background: var(--color-bg-2);
  border-radius: var(--r-pill);
  padding: 12px 18px;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
}
.otto-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-card);
  color: var(--color-text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   SECTION TITLE (shared — used in profile, desafios)
   ══════════════════════════════════════════════════════════ */
.section-title {
  color: var(--color-text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   SETTINGS — nav list style
   ══════════════════════════════════════════════════════════ */
.settings-nav-list {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-2);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--color-border-2);
  margin-bottom: 20px;
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  color: var(--color-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-2);
  transition: background var(--t-fast);
  cursor: pointer;
  background: none;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
}
.settings-nav-item:last-child { border-bottom: none; }
.settings-nav-item:hover { background: var(--color-bg-card); }
.settings-nav-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.settings-nav-label {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}
.settings-nav-chevron {
  color: var(--color-text-muted);
  font-size: 18px;
  flex-shrink: 0;
}
.settings-nav-item.danger { color: var(--color-error); }
.settings-group-title {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  padding: 0 4px;
  margin-bottom: 8px;
  margin-top: 20px;
}
.settings-group-title:first-child { margin-top: 0; }
.settings-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0 16px;
  font-family: inherit;
}
.settings-back-btn:hover { color: var(--color-text-primary); }

/* ══════════════════════════════════════════════════════════
   SETTINGS — full width fix
   ══════════════════════════════════════════════════════════ */
.settings-nav-list,
.settings-group-title,
.settings-section,
.settings-form,
.settings-toggle-row,
.ob-options {
  width: 100%;
}
/* Override #main centering for settings/install/plan pages */
#main[style*="align-items:stretch"] > *,
#main[style*="align-items: stretch"] > * {
  width: 100%;
}

/* ══════════════════════════════════════════════════════════
   MATERIAL SYMBOLS shared style
   ══════════════════════════════════════════════════════════ */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  font-size: 22px;
  color: var(--color-text-primary);
  line-height: 1;
  user-select: none;
}
.settings-nav-icon .material-symbols-rounded { font-size: 20px; }
.settings-nav-chevron .material-symbols-rounded {
  font-size: 18px;
  color: var(--color-text-muted);
}

/* ══════════════════════════════════════════════════════════
   SPLASH SCREEN
   ══════════════════════════════════════════════════════════ */
#splash {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#splash img {
  border-radius: 24px;
  animation: splashPulse 0.9s ease-in-out 2;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.12); opacity: 0.85; }
}
#splash.splash-exit {
  animation: splashSlideLeft 0.45s ease-in forwards;
}
@keyframes splashSlideLeft {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(-105%); opacity: 0; }
}


/* ══════════════════════════════════════════════════════════
   RANGE INPUT (avatar size slider)
   ══════════════════════════════════════════════════════════ */
.slider-range {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 100px;
  outline: none;
  cursor: pointer;
  flex: 1;
  background: linear-gradient(to right, var(--color-brand) var(--fill, 70%), var(--color-bg-3) var(--fill, 70%));
}
.slider-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-text-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.slider-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-text-primary);
  border: none;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
   INSTALL — accordion
   ══════════════════════════════════════════════════════════ */
.install-accordion {
  border: 1px solid var(--color-border-2);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 12px;
  width: 100%;
}
.install-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--color-bg-2);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  gap: 12px;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  box-sizing: border-box;
}
.install-accordion-header .acc-icon { font-size: 20px; flex-shrink: 0; }
.install-accordion-header .acc-chevron {
  color: var(--color-text-muted);
  font-size: 20px;
  transition: transform 300ms ease;
  flex-shrink: 0;
}
.install-accordion.open .install-accordion-header .acc-chevron {
  transform: rotate(90deg);
}
.install-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease, padding 400ms ease;
  background: var(--color-bg-2);
  border-top: 1px solid var(--color-border-2);
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 18px;
  padding-right: 18px;
  width: 100%;
  box-sizing: border-box;
}
.install-accordion.open .install-accordion-body {
  /* max-height injected by JS via scrollHeight */
  padding-top: 16px;
  padding-bottom: 16px;
}

/* ══════════════════════════════════════════════════════════
   OPTIONS-WORD — explicit pointer
   ══════════════════════════════════════════════════════════ */
.word { cursor: pointer; }
.options-word { pointer-events: auto; }

/* ══════════════════════════════════════════════════════════
   GLOBAL CHEVRON HELPER
   ══════════════════════════════════════════════════════════ */
.chevron-icon {
  display: inline-block;
  font-style: normal;
  font-size: 1.1em;
}

/* ══════════════════════════════════════════════════════════
   ADMIN PANEL
   Fixed panel to the right of #app on desktop (≥ 1100px).
   Hidden entirely on mobile.
   ══════════════════════════════════════════════════════════ */
#admin-panel {
  display: none; /* hidden on mobile by default */
}
@media (min-width: 1100px) {
  #admin-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: calc(50% + 210px);  /* right of the 390px device frame */
    width: 340px;
    height: 100vh;
    background: var(--color-bg-2);
    border-left: 1px solid var(--color-border-2);
    overflow: hidden;
    z-index: 500;
    font-size: 13px;
    color: var(--color-text-primary);
  }
}
.adm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--color-border-2);
  background: var(--color-bg-3);
  flex-shrink: 0;
}
.adm-title {
  flex: 1;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-primary);
}
.adm-icon-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.adm-icon-btn:hover { color: var(--color-text-primary); background: var(--color-border-2); }
.adm-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border-2);
  flex-shrink: 0;
  background: var(--color-bg-3);
}
.adm-tab {
  flex: 1;
  padding: 10px 6px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: color .15s, border-color .15s;
}
.adm-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.adm-tab-panel { display: none; flex: 1; overflow-y: auto; padding: 14px 14px 24px; }
.adm-tab-panel.active { display: block; }

/* Tree */
.adm-tree, .adm-subtree {
  list-style: none;
  padding: 0;
  margin: 0;
}
.adm-subtree { padding-left: 16px; display: none; }
.adm-node.open > .adm-subtree { display: block; }
.adm-node-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.adm-node-row:hover { background: var(--color-bg); }
.adm-node-icon { font-size: 15px; color: var(--color-text-muted); flex-shrink: 0; }
.adm-node-label {
  flex: 1;
  font-size: 12px;
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-act-label { font-size: 11px; }
.adm-act-type { color: var(--color-text-muted); margin-left: 4px; }
.adm-act-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-border);
}
.adm-act-theory .adm-act-dot   { background: #6366f1; }
.adm-act-interactive .adm-act-dot { background: #10b981; }
.adm-node-edit, .adm-node-add {
  background: none; border: none; color: var(--color-border); cursor: pointer;
  padding: 2px; display: flex; align-items: center; border-radius: 4px;
  font-size: 14px; opacity: 0; transition: opacity .12s, color .12s;
}
.adm-node-row:hover .adm-node-edit,
.adm-node-row:hover .adm-node-add { opacity: 1; }
.adm-node-edit:hover { color: var(--color-primary); }
.adm-node-add:hover  { color: #10b981; }
.adm-node-edit .material-symbols-rounded,
.adm-node-add  .material-symbols-rounded { font-size: 14px; }

/* Loading */
.adm-loading {
  display: flex; align-items: center; gap: 8px;
  color: var(--color-text-muted); font-size: 13px; padding: 16px 0;
}
@keyframes adm-spin { to { transform: rotate(360deg); } }
.adm-spin { animation: adm-spin .8s linear infinite; display: inline-block; font-size: 18px; }

/* Form elements */
.adm-form-group { margin-bottom: 12px; }
.adm-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 5px;
}
.adm-input, .adm-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-bg);
  border: 1px solid var(--color-border-2);
  border-radius: 8px;
  color: var(--color-text-primary);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 10px;
  outline: none;
  transition: border-color .15s;
}
.adm-input:focus, .adm-textarea:focus { border-color: var(--color-brand); }
.adm-textarea { resize: vertical; min-height: 80px; }

/* Activity type cards */
.adm-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.adm-type-group-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-border);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 8px 0 2px;
}
.adm-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-2);
  border-radius: 10px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  transition: border-color .15s, color .15s, background .15s;
  text-align: center;
}
.adm-type-card .material-symbols-rounded { font-size: 20px; }
.adm-type-card:hover { border-color: var(--color-border); color: var(--color-text-primary); background: var(--color-border-2); }
.adm-type-card.selected { border-color: var(--color-brand); color: var(--color-brand); background: var(--color-brand-dim); }
.adm-type-label { line-height: 1.2; }

/* Otto image picker */
.adm-otto-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.adm-otto-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: border-color .15s;
}
.adm-otto-option input { display: none; }
.adm-otto-option:has(input:checked) {
  border-color: var(--color-primary);
  background: #1a1f2e;
  color: var(--color-primary);
}
.adm-otto-option img { border-radius: 6px; }

/* Options builder */
.adm-option-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.adm-option-correct-wrap {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.adm-option-correct-wrap input { display: none; }
.adm-opt-check-icon {
  font-size: 18px;
  color: var(--color-border);
  transition: color .15s;
}
.adm-option-correct-wrap:has(input:checked) .adm-opt-check-icon { color: #10b981; }
.adm-opt-text { flex: 1; }
.adm-add-option-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 10px;
  width: 100%;
  justify-content: center;
  transition: border-color .15s, color .15s;
  margin-top: 4px;
}
.adm-add-option-btn .material-symbols-rounded { font-size: 15px; }
.adm-add-option-btn:hover { border-color: var(--color-text-primary); color: var(--color-text-primary); }
.adm-save-btn { margin-top: 16px; }

/* Modal */
#admModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#admModal[style*="flex"] { display: flex !important; }
.adm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
}
.adm-modal-box {
  position: relative;
  z-index: 1;
  background: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 14px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.adm-modal-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #2e2e2e;
  font-weight: 700;
  font-size: 14px;
  gap: 10px;
}
.adm-modal-header span:first-child { flex: 1; }
#admModalBody {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}
.adm-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #2e2e2e;
}
.adm-modal-save-btn { flex: 1; }
.adm-modal-delete-btn {
  background: none !important;
  border: 1px solid var(--color-error) !important;
  color: var(--color-error) !important;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background .15s !important;
}
.adm-modal-delete-btn:hover { background: rgba(255,60,60,.1) !important; }

/* ══════════════════════════════════════════════════════════
   CLASS STARS — shown below completed class buttons
   ══════════════════════════════════════════════════════════ */
.class-stars {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 6px;
  line-height: 1;
}
.class-star {
  font-size: 11px;
}
.star-filled { color: var(--color-xp); }
.star-empty  { color: var(--color-border); }

/* ══════════════════════════════════════════════════════════
   ACT MODAL OVERLAY — exit confirm + no-hearts
   ══════════════════════════════════════════════════════════ */
.act-modal-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.act-modal-overlay.active {
  display: flex;
}
.act-modal-box {
  background: var(--color-bg-2);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 28px 22px 22px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}
.act-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 10px;
}
.act-modal-body {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}
.act-modal-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.act-modal-exit-link {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 8px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.act-modal-exit-link:hover { color: var(--color-text-primary); }
