:root {
  --ink: #172033;
  --muted: #667085;
  --line: #e5e7eb;
  --paper: #ffffff;
  --bg: #f5f7fb;
  --pink: #ec4899;
  --violet: #7c3aed;
  --cyan: #06b6d4;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f97316;
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(236, 72, 153, .18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(6, 182, 212, .18), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.is-app {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden;
}

body.is-auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px;
}

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

.app-shell {
  width: min(100%, 390px);
  height: min(800px, calc(100dvh - 40px));
  margin: 0 auto;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 38px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .2);
  overflow: hidden;
  display: grid;
}

.app-shell.with-nav {
  grid-template-rows: 74px 1fr 64px;
}

.app-shell.without-nav {
  grid-template-rows: 1fr;
}

.is-auth .topbar { display: none; }

.topbar {
  z-index: 10;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px 10px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  min-width: 0;
}

.brand {
  font-size: 30px;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand span { color: var(--pink); }

.brand-block {
  display: grid;
  gap: 2px;
}

.brand-block p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
}

.level-mini {
  width: 92px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.level-mini div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 10px;
}

.level-mini strong { color: var(--violet); }
.level-mini span { color: var(--pink); font-weight: 950; }
.level-mini i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.level-mini b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
}

.avatar-badge,
.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--pink);
  border: 3px solid #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .16);
  font-weight: 950;
  overflow: hidden;
}

.avatar-badge img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.main {
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 22px;
  scrollbar-width: none;
}

.main::-webkit-scrollbar { width: 0; height: 0; }

.bottom-nav {
  height: 64px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
}

.bottom-nav a {
  height: 64px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: #667085;
  font-size: 10px;
  font-weight: 850;
}

.bottom-nav a.active {
  color: var(--pink);
}

.nav-emoji {
  display: block;
  font-size: 21px;
  line-height: 1;
  filter: saturate(1.15);
}

.hero,
.auth-card,
.panel,
.play-card,
.feedback,
.empty-state {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}

.hero { padding: 22px; display: grid; gap: 20px; align-content: center; min-height: 100%; }
.hero h1, .auth-card h1, .panel h1, .feedback h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.08; }
.hero p, .muted, .panel p { color: var(--muted); line-height: 1.5; }

.choice-card, .form-stack { display: grid; gap: 12px; }

.auth-card, .panel, .feedback, .empty-state { padding: 18px; }
.auth-card {
  align-self: center;
  text-align: center;
  border-radius: 34px;
  padding: 30px 20px;
}

.auth-card h1 {
  font-size: 32px;
  font-weight: 950;
}
.auth-card.wide { padding: 20px; }

label { display: grid; gap: 7px; color: #344054; font-size: 13px; font-weight: 850; }
input, textarea, select {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 16px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(236, 72, 153, .14); }

.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hidden { display: none !important; }

.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.role-picker label, .check {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check.compact { padding: 8px 10px; }
.role-picker input, .check input { width: auto; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.btn.small { min-height: 38px; padding: 9px 12px; font-size: 13px; }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--violet)); }
.btn.secondary { background: linear-gradient(135deg, #475467, #101828); }
.btn.fake { background: linear-gradient(135deg, var(--red), var(--orange)); }
.btn.real { background: linear-gradient(135deg, var(--green), var(--cyan)); }

.link { display: inline-block; margin-top: 14px; color: var(--pink); font-weight: 850; }

.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 99;
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 430px);
  padding: 13px 16px;
  border-radius: 16px;
  color: #fff;
  background: #101828;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
  font-weight: 850;
}

.toast-success { background: #15803d; }
.toast-error { background: #b42318; }

.score-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.score-strip div,
.metric,
.row-card,
.profile-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.score-strip strong,
.metric strong {
  display: block;
  font-size: 28px;
  color: var(--pink);
}

.score-strip span,
.metric span,
.row-card p {
  color: var(--muted);
  font-size: 13px;
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 12px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.post-author strong {
  display: block;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-author p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.score-pill {
  border: 1px solid #f9a8d4;
  background: #fdf2f8;
  color: #be185d;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.content-image {
  width: 100%;
  height: clamp(260px, 44dvh, 345px);
  object-fit: cover;
  display: block;
  border-radius: 0;
  background: #e0f2fe;
}

.content-image.placeholder {
  display: grid;
  place-items: center;
  font-size: 84px;
  font-weight: 950;
  color: var(--cyan);
}

.play-card { overflow: hidden; border-radius: 28px; }
.play-body { padding: 18px 16px 16px; }
.play-body h1 { margin: 0 0 16px; font-size: 17px; line-height: 1.45; font-weight: 500; }
.eyebrow { margin: 0 0 8px; color: var(--pink); font-weight: 950; }
.vote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.feedback { text-align: center; overflow: hidden; position: relative; }
.feedback .effect {
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 70px;
  font-weight: 950;
}

.feedback.success .effect {
  background: conic-gradient(from 20deg, #facc15, var(--green), var(--cyan), var(--pink), #facc15);
  animation: pop .8s ease both, spin 5s linear infinite;
}

.feedback.wrong .effect {
  background: radial-gradient(circle, #fb7185, var(--red));
  animation: boom .55s ease both;
}

.feedback-actions { display: grid; gap: 10px; margin-top: 16px; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.table-list { display: grid; gap: 10px; }
.row-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.user-form { grid-template-columns: 1fr 120px 82px 76px; }
.result-row { grid-template-columns: 1fr 72px; }
.result-score { text-align: right; }
.result-score strong { display: block; color: var(--pink); font-size: 26px; }

.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips span { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 12px; font-weight: 850; }

.back-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0 0 14px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.profile-panel {
  background: #fff;
  border-radius: 34px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .09);
}

.profile-panel h1 {
  margin: 0 0 18px;
  font-size: 31px;
  line-height: 1.1;
}

.profile-panel h2 {
  margin: 22px 0 12px;
  font-size: 22px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f9fafb;
  margin-bottom: 14px;
}

.profile-avatar {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--pink);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .15);
  font-size: 31px;
  font-weight: 950;
  overflow: hidden;
}

.profile-hero strong {
  display: block;
  font-size: 20px;
}

.profile-hero p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.file-label {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  color: #344054;
  font-size: 18px;
  font-weight: 950;
  margin-bottom: 14px;
}

.file-label input { display: none; }

.profile-edit-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

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

.info-list div {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f9fafb;
}

.info-list span {
  color: var(--muted);
  font-size: 16px;
}

.info-list strong {
  text-align: right;
  font-size: 17px;
}

.password-form {
  display: grid;
  gap: 0;
}

.password-form input {
  min-height: 58px;
  border-radius: 20px;
  font-size: 17px;
}

.password-form input + input {
  margin-top: -1px;
}

.profile-save {
  justify-self: start;
  min-width: 190px;
  margin-top: 10px;
}

.admin-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.admin-tiles a {
  min-height: 96px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  text-align: center;
}

.admin-tiles span {
  font-size: 28px;
}

.admin-tiles strong {
  font-size: 16px;
}

.logout-wide {
  display: grid;
  place-items: center;
  min-height: 54px;
  margin-top: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #64748b, #334155);
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.score-panel {
  background: #fff;
  border-radius: 34px;
  padding: 24px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .09);
}

.score-panel h1 {
  margin: 0 0 18px;
  font-size: 32px;
  line-height: 1.1;
}

.score-panel h2 {
  margin: 24px 0 12px;
  font-size: 22px;
}

.score-hero,
.level-card,
.trend-card,
.accuracy-card,
.bar-row,
.level-list div {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f9fafb;
}

.score-hero {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 12px;
  align-items: center;
  padding: 18px;
}

.score-hero span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
}

.score-hero strong {
  display: block;
  color: var(--pink);
  font-size: 58px;
  line-height: .95;
}

.level-orb {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  color: #fff;
  background: conic-gradient(from 20deg, var(--pink), var(--violet), var(--cyan), var(--pink));
  box-shadow: 0 18px 38px rgba(124, 58, 237, .22);
}

.level-orb strong {
  color: #fff;
  font-size: 30px;
}

.level-orb span {
  color: #fff;
  font-size: 14px;
  letter-spacing: 0;
}

.level-card,
.trend-card,
.accuracy-card {
  padding: 16px;
  margin-top: 14px;
  background: #fff;
}

.level-title,
.bar-row div,
.trend-head,
.trend-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.level-title strong,
.level-title span,
.bar-row strong,
.bar-row span {
  font-size: 16px;
}

.level-card p,
.trend-head p,
.accuracy-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.score-bar,
.bar-row i {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  margin-top: 12px;
}

.score-bar b,
.bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--cyan));
}

.score-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.score-stats div {
  min-height: 94px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f9fafb;
}

.score-stats strong {
  color: var(--pink);
  font-size: 34px;
  line-height: 1;
}

.score-stats span {
  color: var(--muted);
  font-weight: 900;
}

.trend-head span {
  padding: 9px 13px;
  border-radius: 999px;
  background: #e5e7eb;
  font-weight: 950;
  white-space: nowrap;
}

.trend-chart {
  position: relative;
  height: 180px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f9fafb;
}

.trend-chart i {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 54%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--pink));
}

.trend-chart b {
  position: absolute;
  top: calc(54% - 4px);
  width: 14px;
  height: 8px;
  border-radius: 999px;
  background: var(--pink);
}

.trend-chart em {
  position: absolute;
  bottom: 24px;
  width: 22px;
  height: 38px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, var(--pink), var(--violet));
  transform: translateX(-50%);
}

.trend-chart em span {
  position: absolute;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-style: normal;
  font-weight: 950;
}

.trend-foot {
  color: var(--muted);
  font-weight: 800;
}

.trend-foot strong {
  color: var(--ink);
}

.bar-row {
  padding: 14px;
  margin-bottom: 12px;
}

.accuracy-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  align-items: center;
}

.donut {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.donut span {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  font-size: 20px;
  font-weight: 950;
}

.accuracy-card strong {
  display: block;
  font-size: 19px;
}

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

.level-list div {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 12px;
}

.level-list div.done {
  border-color: #f9a8d4;
  background: #fdf2f8;
}

.level-list strong,
.level-list b {
  font-size: 18px;
}

.level-list span {
  color: var(--muted);
  white-space: nowrap;
}

.score-note {
  margin-top: 18px;
  font-size: 17px;
}

.profile-avatar.small {
  width: 58px;
  height: 58px;
  font-size: 22px;
  flex: 0 0 auto;
}

.user-manage-list {
  display: grid;
  gap: 14px;
}

.user-manage-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f9fafb;
}

.user-manage-card strong {
  display: block;
  font-size: 21px;
}

.user-manage-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.birth-grid {
  display: grid;
  grid-template-columns: .8fr .9fr 1.1fr;
  gap: 10px;
}

.promote-btn,
.activate-btn {
  margin-top: 12px;
  border: 0;
  border-radius: 16px;
  min-height: 42px;
  padding: 10px 16px;
  background: #3b82f6;
  color: #fff;
  font-weight: 950;
  font-size: 15px;
  cursor: pointer;
}

.activate-btn {
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.student-class-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.student-class-row select {
  min-height: 42px;
  border-radius: 14px;
  padding: 8px 10px;
}

.class-save-btn {
  border: 0;
  border-radius: 14px;
  padding: 8px 12px;
  background: #64748b;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.class-form {
  display: grid;
  gap: 0;
  margin-bottom: 24px;
}

.class-form input {
  min-height: 62px;
  border-radius: 20px;
  font-size: 17px;
}

.class-form .btn {
  justify-self: start;
  min-width: 178px;
  margin-top: -1px;
}

.class-list {
  display: grid;
  gap: 12px;
}

.class-list div {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f9fafb;
  font-size: 20px;
}

.content-manage-list {
  display: grid;
  gap: 16px;
}

.content-manage-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f9fafb;
}

.content-manage-card img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 14px;
}

.content-manage-card strong {
  display: block;
  font-size: 20px;
}

.content-manage-card p {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.3;
}

.content-manage-card span {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  background: #dbeafe;
  color: #2563eb;
  font-weight: 950;
}

.content-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.edit-btn,
.delete-btn {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 16px;
  padding: 10px 16px;
  color: #fff;
  font-weight: 950;
}

.edit-btn { background: #3b82f6; }
.delete-btn { background: #ef4444; }

.answer-screen {
  overflow: hidden;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .09);
}

.answer-image {
  position: relative;
  height: 285px;
  overflow: hidden;
  background: #111827;
}

.answer-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.answer-screen.wrong .answer-image img {
  filter: brightness(.45) saturate(1.05);
}

.answer-screen.success .answer-image img {
  filter: brightness(.85) saturate(1.15);
}

.wrong-burst,
.correct-burst {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  text-align: center;
}

.wrong-burst i {
  position: absolute;
  top: 18px;
  width: 128px;
  height: 104px;
  background: conic-gradient(from 15deg, #ef4444, #f97316, #facc15, #fff, #facc15, #ef4444);
  clip-path: polygon(50% 0, 61% 28%, 92% 12%, 75% 42%, 100% 52%, 70% 61%, 86% 94%, 55% 72%, 42% 100%, 35% 68%, 0 82%, 25% 52%, 0 36%, 34% 33%);
  animation: boom .7s ease both;
  box-shadow: 0 18px 28px rgba(0, 0, 0, .22);
}

.wrong-burst span,
.correct-burst span {
  position: relative;
  z-index: 1;
  margin-top: 78px;
  font-size: 52px;
  font-weight: 950;
  letter-spacing: 0;
}

.wrong-burst span {
  color: #ff4b4b;
}

.correct-burst span {
  color: #22c55e;
  text-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

.answer-body {
  padding: 20px;
}

.answer-body h1 {
  margin: 0 0 18px;
  font-size: 21px;
  line-height: 1.38;
  font-weight: 500;
}

.result-box {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f9fafb;
  padding: 18px;
}

.result-box p {
  margin: 0 0 16px;
  font-size: 21px;
  line-height: 1.45;
}

.learn-more {
  display: grid;
  place-items: center;
  min-height: 56px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--cyan), #3b82f6);
  color: #fff;
  font-size: 18px;
  font-weight: 950;
}

.next-answer {
  min-width: 96px;
  justify-self: start;
}

@keyframes pop {
  0% { transform: scale(.65); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes spin {
  to { filter: hue-rotate(360deg); }
}

@keyframes boom {
  0% { transform: scale(.7) rotate(-8deg); }
  55% { transform: scale(1.16) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

@media (max-width: 560px) {
  body.is-app,
  body.is-auth {
    padding: 0;
  }

  .app-shell {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .main { padding: 16px 20px 22px; }
  .grid-two, .role-picker, .vote-grid, .metric-grid { grid-template-columns: 1fr; }
  .content-image { height: 300px; }
  .user-form, .row-card { grid-template-columns: 1fr; }
}

/* Final mobile-app fidelity overrides */
.is-app .app-shell {
  background: #f8fafc;
}

.is-app .topbar {
  height: 88px;
  padding: 14px 18px 12px;
}

.is-app .app-shell.with-nav {
  grid-template-rows: 88px minmax(0, 1fr) 64px;
}

.is-app .brand {
  font-size: 35px;
  line-height: .95;
}

.is-app .brand-block p {
  margin-top: 8px;
  font-size: 16px;
}

.is-app .level-mini {
  width: 110px;
  border-radius: 18px;
}

.is-app .avatar-badge {
  width: 50px;
  height: 50px;
  font-size: 20px;
}

.feed-screen {
  padding: 10px 0 0;
}

.feed-screen .play-card {
  width: 100%;
  border-radius: 30px;
  background: #fff;
  border: 0;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .10);
}

.feed-screen .post-head {
  min-height: 82px;
  padding: 18px 18px 12px;
}

.feed-screen .author-avatar {
  width: 50px;
  height: 50px;
  font-size: 18px;
}

.feed-screen .post-author strong {
  font-size: 19px;
  line-height: 1.1;
}

.feed-screen .post-author p {
  font-size: 14px;
}

.feed-screen .score-pill {
  padding: 10px 14px;
  font-size: 14px;
}

.feed-screen .content-image {
  height: 355px;
  border-radius: 0;
}

.feed-screen .play-body {
  padding: 22px 20px 20px;
}

.feed-screen .play-body h1 {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 650;
  margin-bottom: 18px;
}

.feed-screen .vote-grid {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.feed-screen .btn {
  min-height: 56px;
  border-radius: 18px;
  font-size: 19px;
}

.bottom-nav {
  z-index: 20;
}

.bottom-nav a {
  font-size: 12px;
}

.nav-emoji {
  font-size: 22px;
}

.profile-panel {
  width: 100%;
  border-radius: 30px;
  padding: 22px;
  background: #fff;
}

.profile-panel .profile-edit-form {
  display: grid;
  gap: 10px;
}

.profile-edit-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f9fafb;
}

.profile-edit-row span {
  color: var(--muted);
  font-size: 15px;
}

.profile-edit-row input {
  min-height: 42px;
  padding: 6px 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  text-align: right;
  font-weight: 900;
  font-size: 16px;
}

.profile-edit-row input:focus {
  box-shadow: none;
}

.profile-info-list > div {
  display: grid;
  grid-template-columns: 120px 1fr;
}

.profile-info-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-tiles {
  grid-template-columns: 1fr 1fr;
}

.admin-tiles a,
.logout-wide,
.file-label,
.password-form input {
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .is-app .topbar {
    height: 82px;
  }

  .is-app .app-shell.with-nav {
    grid-template-rows: 82px minmax(0, 1fr) 64px;
  }

  .is-app .brand {
    font-size: 32px;
  }

  .is-app .level-mini {
    width: 96px;
  }

  .feed-screen .content-image {
    height: min(330px, 42dvh);
  }

  .profile-edit-row,
  .profile-info-list > div {
    grid-template-columns: 105px 1fr;
  }
}
