:root {
  --bg: #f3ecdf;
  --glow-a: #ffe1c4;
  --glow-b: #f8d4d0;
  --ink: #241c18;
  --on-ink: #fff;
  --muted: #6d625b;
  --card: #fffdf8;
  --paper: #fff;
  --line: #e6d9c8;
  --line-strong: #d9c9b4;
  --track: #f0e6d8;
  --mix: #fff;
  --accent: #e23d3d;
  --accent-dark: #b4232c;
  --good: #1f8a4c;
  --good-dark: #146636;
  --good-soft: #e7f6ec;
  --bad-soft: #fde8e6;
  --gold: #e6a317;
  --gold-ink: #3a2a08;
  --gold-soft: #fff8e8;
  --me: #fff4ee;
  --heart-off: #e4d9c8;
  --shadow: 0 18px 50px rgba(70, 42, 24, 0.07);
  --radius: 20px;
  color-scheme: light;
  font-family: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

html[data-theme="dark"] {
  --bg: #171210;
  --glow-a: #3a241c;
  --glow-b: #2c1a22;
  --ink: #f6efe8;
  --on-ink: #171210;
  --muted: #c4b4a8;
  --card: #241c19;
  --paper: #2c2320;
  --line: #3e332e;
  --line-strong: #53463e;
  --track: #3a302b;
  --mix: #171210;
  --accent: #ff6a62;
  --accent-dark: #c83b36;
  --good: #3dbe72;
  --good-dark: #9be4b8;
  --good-soft: #173528;
  --bad-soft: #3c2220;
  --gold: #f0b429;
  --gold-ink: #2a1c08;
  --gold-soft: #3a2e18;
  --me: #3a2824;
  --heart-off: #4d4038;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 380px at 0% -10%, var(--glow-a) 0%, transparent 55%),
    radial-gradient(700px 360px at 100% 0%, var(--glow-b) 0%, transparent 46%),
    var(--bg);
}
body.is-lesson { background: var(--bg); }
body.is-lesson .topbar,
body.is-lesson .footer,
body.is-lesson .messages { display: none; }
a { color: inherit; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 560; letter-spacing: -0.03em; }
h1 { font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 1.02; margin: 0; }
h2 { font-size: 1.7rem; margin: 0; }
p { line-height: 1.5; }
button, input { font: inherit; }
code { font-family: "IBM Plex Mono", ui-monospace, monospace; background: var(--paper); padding: 0.1rem 0.35rem; border-radius: 6px; }

.topbar, .shell, .footer { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
}
.brand, .nav, .hero-actions, .course-actions, .picker-tools { display: flex; align-items: center; gap: 0.55rem; }
.brand { text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.nav { flex-wrap: wrap; justify-content: flex-end; }
.nav a, .text-btn { text-decoration: none; color: var(--ink); background: transparent; border: 0; cursor: pointer; }
.mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.mark:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}
.mark-lg { width: 72px; height: 72px; border-radius: 20px; }
.mark-svg { width: 88%; height: 88%; display: block; }
.shell { padding-bottom: 3rem; }
.footer { color: var(--muted); padding: 1rem 0 2rem; font-size: 0.92rem; }

.btn, .option, .node-card, .tile {
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.8rem 1.2rem;
  border-radius: 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  border-bottom: 3px solid var(--accent-dark);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 22%, transparent);
}
.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.btn-small { min-height: 40px; padding: 0.45rem 0.8rem; }
.btn-ghost, .node-card, .option, .tile, .lang-card, .course, .side, .auth, .hero-card, .mix-banner, .unit {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.btn-ghost { box-shadow: none; }
.theme-toggle { white-space: nowrap; }
.btn.is-good { background: var(--good); border-bottom-color: var(--good-dark); color: white; }
.kicker { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin: 0 0 0.4rem; }
.lede, .muted, .note, .meta, .hint, .sub, .given { color: var(--muted); }
.lede { font-size: 1.15rem; max-width: 40rem; }

.hero, .layout, .steps, .cards, .picker { display: grid; gap: 1rem; }
.hero { grid-template-columns: 1.3fr 0.9fr; align-items: center; padding: 1rem 0 2rem; }
.hero-card, .auth, .mix-banner, .side, .course, .unit, .result { border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.flag-row, .rank, .review, .breakdown, .nodes { list-style: none; margin: 0; padding: 0; }
.flag-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.flag-row li, .lang-pill, .mix-flags span {
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: color-mix(in srgb, var(--lang, var(--accent)) 16%, var(--mix));
  border: 1px solid color-mix(in srgb, var(--lang, var(--accent)) 42%, var(--mix));
}
.steps { grid-template-columns: repeat(3, 1fr); margin-top: 0.5rem; }
.steps article {
  padding: 1.05rem 1.1rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.steps span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-weight: 700; }

.messages { width: min(1120px, calc(100% - 2rem)); margin: 0 auto 1rem; padding: 0; list-style: none; }
.message { background: var(--card); border-radius: 14px; padding: 0.8rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--accent); box-shadow: var(--shadow); }
.message.success { border-left-color: var(--good); }
.message.info { border-left-color: var(--gold); }
.auth { width: min(460px, 100%); margin: 1rem auto; }
.auth-link { overflow-wrap: anywhere; }
.stack, .stack-lg { display: grid; gap: 0.9rem; }
.stack-lg { gap: 1.2rem; }
.field { display: grid; gap: 0.35rem; font-weight: 600; }
.search-row { display: flex; gap: 0.6rem; align-items: end; flex-wrap: wrap; }
.search-row .field { flex: 1; min-width: 12rem; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.person {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.85rem 1rem;
}
.person .meta { margin: 0.2rem 0 0; }
.person strong { overflow-wrap: anywhere; }
.person-body { min-width: 0; }
.person .meter { margin: 0.55rem 0 0; }
.google-btn { width: 100%; }
.boards { display: grid; gap: 1rem; }
@media (min-width: 980px) {
  .boards { grid-template-columns: repeat(3, 1fr); align-items: start; }
}
.input, .input-lg {
  width: 100%;
  border: 2px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  color: var(--ink);
}
.input-lg { font-size: 1.3rem; }
.input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 35%, var(--mix)); border-color: var(--accent); }
.errorlist { color: var(--accent-dark); list-style: none; margin: 0.2rem 0 0; padding: 0; font-weight: 600; }
.switch { color: var(--muted); }

.page-head { display: flex; justify-content: space-between; gap: 1.2rem; align-items: end; margin-bottom: 1.3rem; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3.15rem); }
.stats { display: flex; gap: 0.6rem; margin: 0; flex-wrap: wrap; }
.stats div, .breakdown li, .review li {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.7rem 0.9rem;
  box-shadow: var(--shadow);
}
.stats dt { color: var(--muted); font-size: 0.8rem; }
.stats dd { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 1.7rem; letter-spacing: -0.03em; }
.stats dd.stat-name { font-size: 1.15rem; line-height: 1.2; padding-top: 0.4rem; }
.layout { grid-template-columns: 1.6fr 0.8fr; align-items: start; }
.mix-banner { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; }
.cards, .picker { grid-template-columns: 1fr 1fr; }
.course header, .lang-card { display: flex; gap: 0.8rem; align-items: center; }
.flag { font-size: 1.8rem; }
.course p, .lang-card small { margin: 0.15rem 0 0; color: var(--muted); }
.meter { height: 10px; background: var(--track); border-radius: 99px; overflow: hidden; margin: 0.8rem 0; }
.meter span, .bar span { display: block; height: 100%; background: var(--lang, var(--accent)); }
.course-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.course-actions .btn { flex: 1; }
.side h2, .result h2 { margin-bottom: 0.7rem; }
.rank { display: grid; gap: 0.45rem; }
.breakdown li { display: flex; justify-content: space-between; gap: 0.6rem; }
.note { font-size: 0.92rem; }

.lang-card { position: relative; border-radius: 18px; padding: 0.9rem; cursor: pointer; }
.lang-card input { position: absolute; opacity: 0; }
.lang-card:has(input:checked) { box-shadow: inset 0 0 0 2px var(--lang); border-color: var(--lang); }
.lang-card.is-disabled { opacity: 0.45; cursor: not-allowed; }
.picker-block { display: grid; gap: 0.8rem; }
.picker-tools { margin-bottom: -0.3rem; }

.path { display: grid; gap: 1rem; }
.unit header p { margin: 0; color: var(--muted); }
.nodes { display: grid; gap: 0.7rem; margin-top: 0.8rem; }
.node-card { width: 100%; display: flex; gap: 0.8rem; align-items: center; text-align: left; border-radius: 18px; padding: 0.85rem; }
.node-card strong, .node-card em { display: block; }
.node-card em { color: var(--muted); font-style: normal; }
.node-index { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); font-weight: 700; flex: none; }
.node.is-done .node-index,
.node.is-current .node-index { color: white; }
.node.is-done .node-index { background: var(--good); }
.node.is-current .node-index { background: var(--accent); }
.node.is-locked { opacity: 0.62; }

.player { width: min(680px, 100%); margin: 0 auto; padding: 1rem 0 2rem; display: grid; gap: 0.8rem; }
.player-top { display: grid; grid-template-columns: auto 1fr auto auto; gap: 0.7rem; align-items: center; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; text-decoration: none; background: var(--paper); color: var(--ink); border: 2px solid var(--line); font-weight: 700; cursor: pointer; }
.player-tools { display: flex; align-items: center; gap: 0.35rem; }
.bar { height: 14px; background: var(--track); border-radius: 99px; overflow: hidden; }
.count { margin: 0; color: var(--muted); font-weight: 700; }
.hearts { letter-spacing: 0.05em; color: var(--heart-off); }
.hearts .is-on { color: var(--accent); }
.lang-pill, .mix-flags { margin: 0; font-weight: 700; }
.mix-flags { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; color: var(--muted); }
.prompt-block { padding: 0.4rem 0 0.2rem; }
.stimulus { font-family: "Fraunces", "Noto Sans CJK KR", "Noto Sans CJK JP", "Noto Sans", sans-serif; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.2; margin: 0.2rem 0; text-wrap: balance; }
.speak { border: 0; background: var(--paper); color: var(--ink); border-radius: 999px; padding: 0.35rem 0.75rem; cursor: pointer; border: 2px solid var(--line); }
.options, .bank-pool, .bank-answer { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.options { display: grid; }
.option, .tile { border-radius: 16px; padding: 0.9rem 1rem; text-align: left; }
.option { min-height: 64px; }
.option span, .option small { display: block; }
.option small, .sub { color: var(--muted); }
.bank-answer { min-height: 64px; border: 2px dashed var(--line-strong); border-radius: 16px; padding: 0.5rem; background: var(--paper); }
.feedback { border-radius: 18px; padding: 1rem; }
.feedback.is-good { background: var(--good-soft); color: var(--ink); }
.feedback.is-bad { background: var(--bad-soft); color: var(--ink); }
.feedback h2 { margin-bottom: 0.3rem; }
.result { width: min(720px, 100%); margin: 0 auto; display: grid; gap: 0.9rem; }
.review { display: grid; gap: 0.5rem; }
.review li { display: grid; }
.bonus { color: var(--good-dark); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 860px) {
  .hero, .layout, .steps, .cards, .picker, .page-head, .mix-banner { grid-template-columns: 1fr; display: grid; }
  .page-head, .mix-banner { align-items: start; }
  .stats { flex-wrap: wrap; }
  .player-top { grid-template-columns: auto 1fr auto; }
  .count { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.levels { border: 0; margin: 0.4rem 0 0.6rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.levels legend { font-weight: 700; width: 100%; }
.levels label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 700;
}
.levels label.is-locked { opacity: 0.55; }
.levels small { color: var(--muted); font-weight: 500; }
.badge-strip, .badge-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.45rem 0.7rem;
  min-height: 48px;
}
.badge.is-on { border-color: var(--gold); background: var(--gold-soft); }
.badge.is-off { opacity: 0.78; border-style: dashed; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.badge > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
  flex: none;
}
.badge.is-on > span { background: var(--gold); color: var(--gold-ink); }
.badge strong, .badge em { display: block; }
.badge em { color: var(--muted); font-style: normal; font-weight: 500; font-size: 0.85rem; }
.rank-card { display: grid; gap: 0.35rem; margin-bottom: 1.1rem; padding-bottom: 0.3rem; }
.rank-card h2 { font-size: 1.55rem; }
.rank-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.level-pill {
  margin: 0;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
}
.answer-row { display: grid; gap: 0.6rem; }
.mic.is-on { background: var(--accent); color: white; border-color: var(--accent-dark); }
.level-block { display: grid; gap: 0.8rem; }
.level-block > header { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.level-block > header p { margin: 0; color: var(--muted); }
.level-block.is-locked .unit { opacity: 0.72; }
.xp-parts { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.xp-parts li { background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 0.25rem 0.7rem; font-weight: 700; }
.avatar { overflow: hidden; }
img.avatar { object-fit: cover; display: block; }
.avatar-sm { width: 28px; height: 28px; font-size: 0.75rem; }
.avatar-lg { width: 96px; height: 96px; font-size: 2rem; }
.profile-id { display: flex; align-items: center; gap: 1rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 650; }
.badge.is-on { --lang: var(--gold); }
.badge-strip .badge { flex-wrap: wrap; }
.badge-strip .badge .meter { flex-basis: 100%; margin: 0.15rem 0 0; }
.badge-grid .badge {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  align-content: start;
}
.badge-grid .badge .meter,
.badge-grid .badge > .meta { grid-column: 1 / -1; margin: 0; }
.theme-mark::before { content: "☾"; }
html[data-theme="dark"] .theme-mark::before { content: "☀"; }

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
}
.nav a.is-current {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 700;
}
.nav-count {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.8rem;
}
.panel h2 { font-size: 1.35rem; }
.panel-alert { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow); }
.friend-grid { display: grid; gap: 1rem; }
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 16%, var(--paper));
  color: var(--accent-dark);
  flex: none;
}
html[data-theme="dark"] .avatar { color: var(--accent); }
.chip, .you {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-style: normal;
  font-weight: 700;
}
.chip {
  padding: 0.12rem 0.5rem;
  font-size: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip.is-ok { color: var(--good-dark); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); background: var(--good-soft); }
.chip.is-wait { color: var(--gold-ink); border-color: var(--gold); background: var(--gold-soft); }
html[data-theme="dark"] .chip.is-wait { color: var(--gold); }
.you {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent);
  color: white;
  padding: 0.12rem 0.42rem;
}
.ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
}
.ladder li {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.ladder li.is-done { color: var(--ink); background: var(--paper); }
.ladder li.is-current { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); }
.rank-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.rank-row.is-me { background: var(--me); border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }
.rank-who { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; min-width: 0; }
.rank-who strong { overflow-wrap: anywhere; }
.rank-xp { font-variant-numeric: tabular-nums; white-space: nowrap; }
.medal {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--track);
  color: var(--ink);
}
.rank-row.is-gold .medal, .podium-1 .medal { background: #e6b325; color: #3a2a08; }
.rank-row.is-silver .medal, .podium-2 .medal { background: #c5c9d1; color: #2c3138; }
.rank-row.is-bronze .medal, .podium-3 .medal { background: #d08a56; color: #3a220f; }
.podium {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin: 0 0 1.2rem;
  padding: 0;
}
.podium li {
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.95rem 0.7rem 0.85rem;
  box-shadow: var(--shadow);
}
.podium li strong { overflow-wrap: anywhere; }
.podium b { font-variant-numeric: tabular-nums; }
.podium .podium-1 { order: 2; padding-top: 1.35rem; padding-bottom: 1.15rem; border-color: #e6b325; }
.podium .podium-2 { order: 1; }
.podium .podium-3 { order: 3; }
.podium li.is-me { background: var(--me); }
.topic-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.8rem 0 1rem; padding: 0; list-style: none; }
.topic-chips li { border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.75rem; background: var(--card); }
.topic-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; }
.topic-actions form { margin: 0; }
.course, .lang-card { transition: transform 0.16s ease, border-color 0.16s ease; }
.course:hover, .lang-card:hover { transform: translateY(-2px); }

@media (min-width: 860px) {
  .friend-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 700px) {
  .podium { grid-template-columns: 1fr; }
  .podium .podium-1, .podium .podium-2, .podium .podium-3 { order: unset; padding-top: 0.95rem; padding-bottom: 0.85rem; }
  .person { grid-template-columns: auto 1fr; }
  .person form, .person .course-actions { grid-column: 1 / -1; }
}

/* ==========================================================================
   Topbar Quick Stats & Indicadores Rápidos
   ========================================================================== */
.topbar-quick-stats {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  margin-right: 0.5rem;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.stat-pill b {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* ==========================================================================
   Tarefas & Metas Periódicas (Diárias, Semanais, Mensais)
   ========================================================================== */
.quest-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
}
.quest-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.quest-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: color-mix(in srgb, var(--accent) 18%, var(--paper));
  color: var(--accent-dark);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  animation: pulse-glow 2.4s infinite ease-in-out;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(224, 76, 56, 0); }
  50% { transform: scale(1.02); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent); }
}

.quest-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.8rem 0 1.1rem;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quest-tabs::-webkit-scrollbar { display: none; }
.quest-tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.quest-tab:hover {
  color: var(--ink);
  background: var(--paper);
}
.quest-tab.is-active {
  color: var(--on-ink);
  background: var(--ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
html[data-theme="dark"] .quest-tab.is-active {
  color: #171210;
  background: var(--ink);
}

.quest-content {
  display: none;
  animation: fadeIn 0.22s ease-in-out;
}
.quest-content.is-active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.quest-congrats {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: color-mix(in srgb, var(--good) 14%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--good) 40%, transparent);
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.1rem;
}
.congrats-icon { font-size: 1.8rem; }
.quest-congrats strong { color: var(--good); display: block; margin-bottom: 0.2rem; }
.quest-congrats p { margin: 0; font-size: 0.88rem; color: var(--ink); }

.quest-grid {
  display: grid;
  gap: 0.85rem;
}
.quest-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem 1.1rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.quest-card:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}
.quest-card.is-completed {
  border-color: color-mix(in srgb, var(--good) 45%, var(--line));
  background: color-mix(in srgb, var(--good) 5%, var(--paper));
}
.quest-card.is-claimed {
  opacity: 0.75;
}

.quest-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  flex-shrink: 0;
}
.quest-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.quest-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.quest-title-row h3 {
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.quest-reward {
  font-size: 0.78rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--gold) 22%, var(--paper));
  color: var(--gold-ink);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
}
html[data-theme="dark"] .quest-reward {
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 18%, var(--card));
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
}
html[data-theme="dark"] .quest-alert-badge {
  color: var(--accent);
}
.quest-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.35;
}
.quest-meter-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.25rem;
}
.quest-meter-wrap .meter {
  flex: 1;
  max-width: 140px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  overflow: hidden;
}
.quest-meter-wrap .meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--good);
  transition: width 0.3s ease;
}
.quest-progress-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.quest-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.quest-claim-btn {
  background: var(--good) !important;
  border-bottom-color: var(--good-dark) !important;
  white-space: nowrap;
  animation: pulse-btn 2s infinite ease-in-out;
}
@keyframes pulse-btn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.badge-claimed {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-pending {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* ==========================================================================
   Mobile Bottom Navigation Bar (App Experience)
   ========================================================================== */
.bottom-nav {
  display: none;
}

@media (max-width: 860px) {
  /* Oculta links horizontais do header que poluem em mobile */
  .topbar .nav > a,
  .topbar .nav > form {
    display: none !important;
  }
  .topbar .nav {
    gap: 0.4rem;
  }

  /* Exibe a Bottom Navigation Bar fixa no rodapé do celular/tablet */
  .bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: color-mix(in srgb, var(--bg) 92%, var(--card));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1.5px solid var(--line);
    padding: 0.35rem 0.2rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.2rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 12px;
    transition: color 0.15s ease, transform 0.12s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav-item:active {
    transform: scale(0.92);
  }
  .bottom-nav-item.is-active {
    color: var(--accent);
    font-weight: 700;
  }
  .bottom-nav-item.is-active .bottom-nav-icon {
    transform: translateY(-1px);
  }
  .bottom-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .bottom-nav-label {
    letter-spacing: -0.01em;
  }
  .bottom-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border: 2px solid var(--bg);
  }

  /* Garante espaçamento na base da página para a bottom bar não cobrir nada */
  body:not(.is-lesson) .shell {
    padding-bottom: 6.5rem !important;
  }
  body:not(.is-lesson) .footer {
    padding-bottom: 6rem !important;
    text-align: center;
  }

  /* Durante a lição, esconde completamente a bottom bar */
  body.is-lesson .bottom-nav {
    display: none !important;
  }

  /* Ajuste no layout e cabeçalho de páginas */
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  .page-head h1 {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
  }

  /* Grid de estatísticas limpo e simétrico em celular/tablet */
  .stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
    width: 100%;
  }
  .stats div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 0.9rem;
  }
  .stats dd {
    font-size: 1.45rem;
  }

  /* Cartão de tarefas em mobile */
  .quest-card {
    grid-template-columns: auto 1fr;
    gap: 0.8rem;
  }
  .quest-action {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-top: 0.35rem;
    padding-top: 0.45rem;
    border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
  }
  .quest-action .btn,
  .quest-action form {
    width: 100%;
  }
  .quest-action .btn {
    width: 100%;
    justify-content: center;
  }

  /* Banner de mix e formulários em telas menores */
  .mix-banner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
  }
  .mix-banner .btn {
    width: 100%;
  }

  /* Ajustes da tela de lição em celulares e tablets */
  .player {
    max-width: 100%;
    padding: 0.5rem 0.25rem 2rem;
  }
  .player-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
  }
  .player-tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .hearts {
    letter-spacing: 0.15em;
    font-size: 1.15rem;
  }
  .prompt-block {
    padding: 1.25rem 1rem;
  }
  .stimulus {
    font-size: clamp(1.4rem, 5.5vw, 2.1rem);
    line-height: 1.2;
  }

  /* Múltipla escolha (options) com altura e toque perfeito */
  .options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .option {
    min-height: 54px;
    padding: 0.9rem 1.1rem;
    font-size: 1.05rem;
    border-radius: 18px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Banco de palavras (tiles) */
  .bank-pool, .bank-answer {
    min-height: 56px;
    gap: 0.55rem;
  }
  .tile {
    min-height: 44px;
    padding: 0.55rem 0.9rem;
    font-size: 1rem;
    border-radius: 14px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Linha de resposta por voz/texto */
  .answer-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  .answer-row .btn.mic {
    width: 100%;
    min-height: 52px;
  }

  /* Inputs evitam zoom involuntário no iOS com 16px */
  .input, .input-lg {
    font-size: 16px !important;
    padding: 0.85rem 1rem;
  }

  /* Trilhas e nós */
  .unit {
    padding: 1.1rem 0.95rem;
  }
  .node-card {
    min-height: 56px;
    padding: 0.75rem 0.9rem;
    -webkit-tap-highlight-color: transparent;
  }

  /* Cartões de temas e idiomas */
  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 0.65rem 0;
  }
  .brand {
    font-size: 1.05rem;
  }
  .mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .stat-pill {
    padding: 0.2rem 0.45rem;
    font-size: 0.78rem;
  }
  .quest-tabs {
    gap: 0.35rem;
  }
  .quest-tab {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }
  .bottom-nav-item {
    font-size: 0.64rem;
  }
  .bottom-nav-icon {
    font-size: 1.2rem;
  }
}

/* ==========================================================================
   Perfil Elegante, Moderno & Responsivo + @nome-perfil (Slug Único)
   ========================================================================== */
.chip.is-handle {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}
html[data-theme="dark"] .chip.is-handle {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--paper));
}

.profile-hero-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.8rem 2rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.3rem;
  flex-wrap: wrap;
}
.profile-hero-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  min-width: 280px;
}
.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.profile-avatar-wrap .avatar-lg {
  width: 104px;
  height: 104px;
  font-size: 2.3rem;
  border: 3px solid var(--paper);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 25%, transparent);
}
.avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--accent) 65%, transparent);
  pointer-events: none;
  animation: ring-rotate 28s linear infinite;
}
@keyframes ring-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.profile-hero-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.profile-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.profile-badge-pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 14%, var(--paper));
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.profile-lang-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.profile-display-name {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.05;
  margin: 0.1rem 0;
  color: var(--ink);
}
.profile-handle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.1rem;
}
.profile-handle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--paper);
  border: 1.5px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
}
.profile-handle-pill:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 20%, transparent);
}
.handle-at {
  color: var(--accent);
}
.copy-icon {
  font-size: 0.85rem;
  opacity: 0.75;
}
.copy-feedback {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--good);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.copy-feedback.is-visible {
  opacity: 1;
}
.profile-email-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.profile-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.profile-edit-btn {
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Grid de Estatísticas do Perfil */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.4rem;
}
.profile-stat-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.05rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.profile-stat-box:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.stat-box-icon {
  font-size: 1.8rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.stat-box-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.stat-box-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-box-value {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}
.stat-box-value small {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

/* Página de Edição de Perfil (Separada) */
.profile-edit-layout {
  width: min(640px, 100%);
  margin: 0 auto 2rem;
}
.profile-edit-card {
  padding: 2rem;
  border-radius: 24px;
}
.back-link {
  text-decoration: none;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: transform 0.15s ease;
}
.back-link:hover {
  transform: translateX(-3px);
}
.avatar-preview-box {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.avatar-preview-wrap .avatar-lg {
  width: 88px;
  height: 88px;
  font-size: 2rem;
  border: 2px solid var(--line);
}
.avatar-preview-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 200px;
}
.avatar-preview-info h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ink);
}
.file-btn {
  position: relative;
  overflow: hidden;
  align-self: flex-start;
  cursor: pointer;
}
.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.delete-photo-check {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--accent-dark);
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.4rem 0;
}
.input-handle-wrap {
  display: flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-handle-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.input-prefix {
  padding: 0 0.2rem 0 0.9rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}
.input-handle-wrap .input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: 0.2rem !important;
  outline: none !important;
}
.required-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 15%, var(--paper));
  color: var(--accent);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.4rem;
}
.account-read-only {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--paper) 60%, var(--card));
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.read-only-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.read-only-item strong {
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* Responsividade de Perfil para Celular e Tablet */
@media (max-width: 860px) {
  .profile-hero-card {
    flex-direction: column;
    align-items: stretch;
    padding: 1.4rem;
    gap: 1.2rem;
  }
  .profile-hero-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-meta-row, .profile-handle-row {
    justify-content: center;
  }
  .profile-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .profile-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .profile-stat-box {
    padding: 0.85rem;
  }
  .stat-box-icon {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  .profile-edit-card {
    padding: 1.25rem;
  }
  .account-read-only {
    grid-template-columns: 1fr;
  }
  .form-actions {
    flex-direction: column;
  }
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .profile-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .stat-box-value {
    font-size: 1.35rem;
  }
  .avatar-preview-box {
    flex-direction: column;
    text-align: center;
  }
  .avatar-preview-info {
    align-items: center;
  }
}

/* ==========================================================================
   Ravio Mascote Ilustrado 2D Minimalista
   ========================================================================== */
.mascot-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.2rem 1.8rem 1.8rem;
  background: var(--card);
}
.mascot-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.8rem;
  min-height: 200px;
  justify-content: center;
}
.hero-mascot-img {
  width: 195px;
  height: 195px;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.14));
  animation: float-mascot 4s ease-in-out infinite;
  z-index: 2;
}
.mascot-shadow {
  width: 130px;
  height: 14px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 14%, transparent);
  margin-top: -6px;
  filter: blur(4px);
  animation: shadow-scale 4s ease-in-out infinite;
}
@keyframes float-mascot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes shadow-scale {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(0.85); opacity: 0.35; }
}
.mascot-speech {
  margin: 0.4rem 0 0.8rem;
}
.mascot-speech .hero-mix {
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.4;
  color: var(--ink);
}

@media (max-width: 600px) {
  .hero-mascot-img {
    width: 155px;
    height: 155px;
  }
  .mascot-shadow {
    width: 105px;
  }
}



