:root {
  --primary: #6d4aff;
  --primary-dark: #4c2fd1;
  --accent: #8b5cf6;
  --success: #15966a;
  --danger: #d84058;
  --warning: #b7791f;
  --info: #2775d7;
  --text-primary: #19182b;
  --text-secondary: #69677d;
  --background: #f5f6fa;
  --surface: #ffffff;
  --border: #e6e5ee;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 6px 18px rgba(34, 28, 70, 0.06);
  --shadow-md: 0 18px 50px rgba(40, 31, 86, 0.1);
  --space-1: 0.375rem;
  --space-2: 0.625rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --transition: 160ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  color: var(--text-primary);
  background: var(--background);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.35; }

:focus-visible {
  outline: 3px solid rgba(109, 74, 255, 0.28);
  outline-offset: 3px;
}

.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 800;
  white-space: nowrap;
}

.brand:hover { color: var(--text-primary); }
.brand--light, .brand--light:hover { color: #fff; }

.brand__mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 20px rgba(26, 18, 67, 0.2);
  font-size: 1.4rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.6rem;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.eyebrow--light { color: #ded7ff; }

.auth-body { min-height: 100vh; }

.auth-shell {
  display: grid;
  min-height: 100vh;
}

.auth-brand-panel { display: none; }

.auth-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 1.25rem 1rem 2rem;
}

.auth-mobile-brand { margin: 0 auto 1.5rem; }

.auth-card {
  width: min(100%, 640px);
  margin-inline: auto;
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.auth-card--compact { max-width: 480px; }
.auth-card__heading { margin-bottom: 1.4rem; }
.auth-card__heading h2 { margin-bottom: 0.45rem; font-size: clamp(1.55rem, 5vw, 2rem); }
.auth-card__heading p { margin-bottom: 0; color: var(--text-secondary); }

.form-stack { display: grid; gap: 1rem; }
.form-grid { display: grid; gap: 1rem; }
.form-field { display: grid; gap: 0.4rem; min-width: 0; }
.form-field label { font-size: 0.88rem; font-weight: 700; }

.text-input, .select-input {
  width: 100%;
  min-height: 3.15rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  background: #fbfbfd;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.text-input:hover, .select-input:hover { border-color: #cbc8db; }
.text-input:focus, .select-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(109, 74, 255, 0.12);
}

.text-input.input-validation-error, .select-input.input-validation-error { border-color: var(--danger); }
.ltr-input { direction: ltr; text-align: left; }
.helper-text { margin: -0.35rem 0 0; color: var(--text-secondary); font-size: 0.78rem; }
.field-error { min-height: 0; color: var(--danger); font-size: 0.78rem; }
.field-error:empty { display: none; }

.check-field { display: flex; align-items: center; gap: 0.6rem; color: var(--text-secondary); cursor: pointer; }
.check-field input { width: 1.15rem; height: 1.15rem; accent-color: var(--primary); }

.button {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.button--primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 10px 22px rgba(91, 60, 220, 0.24); }
.button--primary:hover { color: #fff; box-shadow: 0 13px 26px rgba(91, 60, 220, 0.3); }
.button--secondary { color: var(--primary-dark); border: 1px solid #d9d2ff; background: #f5f2ff; }
.button--secondary:hover { color: var(--primary-dark); background: #ece7ff; }
.button--block { width: 100%; min-height: 3.25rem; }
.button--quiet { color: var(--text-secondary); background: transparent; }
.button--quiet:hover { color: var(--danger); background: rgba(216, 64, 88, 0.07); }
.button--small { min-height: 2.4rem; padding: 0.4rem 0.8rem; font-size: 0.85rem; }

.alert {
  padding: 0.8rem 0.9rem;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
}

.alert:empty, .validation-summary-valid { display: none; }
.alert ul { margin: 0; padding-right: 1.1rem; }
.alert--danger { color: #a52a40; border-color: #f1bdc7; background: #fff2f5; }
.auth-switch { margin: 1.25rem 0 0; color: var(--text-secondary); text-align: center; }
.auth-switch a { font-weight: 800; }

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(230, 229, 238, 0.85);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.app-header__inner { display: flex; min-height: 4.5rem; align-items: center; justify-content: space-between; gap: 1rem; }
.desktop-nav { display: none; }
.header-user { display: flex; align-items: center; gap: 0.5rem; }
.app-main { padding: 2rem 0 calc(6.5rem + env(safe-area-inset-bottom)); }

.avatar {
  position: relative;
  display: grid;
  overflow: hidden;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #ddd8fa;
  border-radius: 50%;
  color: var(--primary-dark);
  background: #f0edff;
  font-weight: 800;
}
.avatar__initial { position: relative; z-index: 0; }
.avatar__image { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

.avatar--small { width: 2.35rem; height: 2.35rem; }
.avatar--large { width: 4.5rem; height: 4.5rem; font-size: 1.55rem; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading h1 { margin-bottom: 0.35rem; font-size: clamp(1.65rem, 6vw, 2.35rem); }
.page-heading p, .section-heading p { margin-bottom: 0; color: var(--text-secondary); }

.status-badge, .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: max-content;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-badge { color: #08744f; background: #e8f8f1; white-space: nowrap; }
.status-badge span { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--success); }
.badge { color: var(--primary-dark); background: #efecff; }
.badge--muted { color: var(--text-secondary); background: #f0f0f4; }

.profile-grid { display: grid; gap: 1.25rem; }
.card, .stats-section { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.profile-card { align-self: start; padding: 1.35rem; }
.profile-card__top { display: flex; align-items: center; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.profile-card__top h2 { margin-bottom: 0.4rem; font-size: 1.25rem; }
.profile-details { margin: 0; }
.profile-details div { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.profile-details div:last-child { padding-bottom: 0; border-bottom: 0; }
.profile-details dt { color: var(--text-secondary); font-size: 0.85rem; }
.profile-details dd { margin: 0; font-weight: 700; }
.ltr-value { direction: ltr; unicode-bidi: isolate; }

.stats-section { min-width: 0; padding: 1.35rem; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
.section-heading h2 { margin-bottom: 0.25rem; font-size: 1.2rem; }
.stats-grid { display: grid; gap: 0.8rem; }

.stat-card {
  display: grid;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fcfcfe;
}

.stat-card span { color: var(--text-secondary); font-size: 0.82rem; }
.stat-card strong { margin: 0.35rem 0; font-size: 2rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-card small { overflow-wrap: anywhere; color: var(--text-secondary); }
.stat-card--primary { border-color: #dcd6ff; background: linear-gradient(145deg, #f7f5ff, #fff); }
.stat-card--primary strong { color: var(--primary); }

.empty-state { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; padding: 1rem; border-radius: var(--radius-md); background: #f7f7fa; }
.empty-state__mark { display: grid; flex: 0 0 auto; width: 2.8rem; height: 2.8rem; place-items: center; border-radius: 12px; color: var(--warning); background: #fff4dc; font-size: 1.3rem; font-weight: 800; }
.empty-state h3 { margin-bottom: 0.15rem; font-size: 0.95rem; }
.empty-state p { margin-bottom: 0; color: var(--text-secondary); font-size: 0.8rem; }

.error-page { display: grid; min-height: clamp(28rem, calc(100vh - 9rem), 42rem); place-items: center; padding-block: 1.5rem; }
.error-card { width: min(100%, 42rem); padding: 2.6rem 3rem; border: 1px solid #e3def8; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); text-align: center; }
.error-card__icon { display: grid; width: 4rem; height: 4rem; margin: 0 auto 1.25rem; place-items: center; border: 1px solid #ded5ff; border-radius: 1.25rem; color: var(--primary); background: #f5f2ff; }
.error-card__icon svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.error-card__copy h1 { margin-bottom: 0.55rem; font-size: clamp(1.45rem, 2.5vw, 1.85rem); }
.error-card__copy p { margin-bottom: 1.7rem; color: var(--text-secondary); font-size: 0.92rem; line-height: 2; }
.tracking-panel { padding: 1rem 1.1rem; border: 1px solid #e5e0f8; border-radius: var(--radius-md); background: #faf9ff; text-align: start; }
.tracking-panel__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.55rem; color: var(--text-secondary); font-size: 0.76rem; font-weight: 700; }
.tracking-panel__copy { padding: 0.25rem 0.65rem; border: 1px solid #d9d1ff; border-radius: 0.55rem; color: var(--primary-dark); background: #fff; font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer; transition: border-color var(--transition), background var(--transition); }
.tracking-panel__copy:hover { border-color: #bdb0ff; background: #f3efff; }
.tracking-panel__code { display: block; max-width: 100%; overflow-wrap: anywhere; color: #37305c; font-family: Consolas, "Courier New", monospace; font-size: 0.88rem; line-height: 1.65; text-align: left; unicode-bidi: isolate; }
.tracking-panel p { margin: 0.55rem 0 0; color: var(--text-secondary); font-size: 0.72rem; }
.error-card__home { min-width: 10.5rem; margin-top: 1.6rem; }

.mobile-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 28px rgba(31, 27, 57, 0.08);
  backdrop-filter: blur(14px);
}

.mobile-nav__item { display: flex; min-width: 0; min-height: 3.3rem; align-items: center; justify-content: center; flex-direction: column; gap: 0.08rem; border-radius: 12px; color: var(--text-secondary); font-size: 0.64rem; white-space: nowrap; }
.mobile-nav__item.is-active { color: var(--primary-dark); background: #f0edff; font-weight: 800; }
.is-disabled { cursor: default; opacity: 0.58; }
.nav-symbol { font-family: Tahoma, sans-serif; font-size: 1.05rem; font-weight: 800; line-height: 1.2; }

.game-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  width: min(100%, 940px);
  margin: 0 auto 1.4rem;
}

.game-heading h1 { margin-bottom: 0; font-size: clamp(1.6rem, 5vw, 2.2rem); }
.live-badge { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.75rem; border-radius: 999px; color: #08744f; background: #e8f8f1; font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.live-badge span { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(21, 150, 106, 0.12); }
.game-layout { display: grid; width: min(100%, 940px); margin-inline: auto; gap: 1rem; }
.question-card { position: relative; overflow: hidden; min-width: 0; padding: 1.25rem; }
.question-card::before { position: absolute; top: 0; right: 0; left: 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); content: ""; }
.question-card__number { display: grid; width: 2.8rem; height: 2.8rem; margin-bottom: 1rem; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); font-size: 1.4rem; font-weight: 800; box-shadow: 0 8px 20px rgba(91, 60, 220, 0.2); }
.question-card > h2 { max-width: 700px; margin-bottom: 1.5rem; font-size: clamp(1.3rem, 4vw, 1.8rem); }
.answer-form { display: grid; gap: 1.5rem; }
.option-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.option-fieldset legend { margin-bottom: 0.7rem; font-size: 0.85rem; font-weight: 700; }
.option-grid { display: grid; gap: 0.75rem; }
.option-grid input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.option-choice { position: relative; display: flex; min-height: 4.4rem; align-items: center; gap: 0.8rem; padding: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fcfcfe; cursor: pointer; transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition); }
.option-choice:hover { border-color: #cfc7ff; transform: translateY(-1px); }
.option-choice__key { display: grid; width: 2.45rem; height: 2.45rem; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--primary-dark); background: #efecff; direction: ltr; font-weight: 800; }
.option-choice__check { margin-right: auto; display: grid; width: 1.45rem; height: 1.45rem; place-items: center; border: 1px solid #d7d4e2; border-radius: 50%; color: transparent; font-size: 0.75rem; }
.option-grid input:focus-visible + .option-choice { outline: 3px solid rgba(109, 74, 255, 0.25); outline-offset: 3px; }
.option-grid input:checked + .option-choice { border-color: var(--primary); background: #f6f3ff; box-shadow: 0 8px 24px rgba(91, 60, 220, 0.12); }
.option-grid input:checked + .option-choice .option-choice__key { color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.option-grid input:checked + .option-choice .option-choice__check { color: #fff; border-color: var(--primary); background: var(--primary); }
.prediction-control { padding: 1rem; border-radius: var(--radius-md); background: #f7f6fb; }
.prediction-control__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.prediction-control__heading div { display: grid; }
.prediction-control__heading div span { color: var(--text-secondary); font-size: 0.76rem; }
.prediction-control output { min-width: 4.8rem; color: var(--primary-dark); font-size: 2rem; font-weight: 800; direction: ltr; text-align: center; font-variant-numeric: tabular-nums; }
.percentage-slider { --slider-progress: 50%; width: 100%; height: 0.55rem; margin: 0.65rem 0; border-radius: 99px; outline: none; appearance: none; background: linear-gradient(to left, var(--primary) var(--slider-progress), #dedce7 var(--slider-progress)); cursor: pointer; }
.percentage-slider::-webkit-slider-thumb { width: 1.55rem; height: 1.55rem; border: 4px solid #fff; border-radius: 50%; appearance: none; background: var(--primary); box-shadow: 0 2px 9px rgba(58, 41, 135, 0.34); }
.percentage-slider::-moz-range-thumb { width: 1.15rem; height: 1.15rem; border: 4px solid #fff; border-radius: 50%; background: var(--primary); box-shadow: 0 2px 9px rgba(58, 41, 135, 0.34); }
.slider-labels { display: flex; justify-content: space-between; color: var(--text-secondary); font-size: 0.7rem; }
.answer-submit { margin-top: -0.25rem; }
.participation-gate { padding: 1.3rem; border: 1px solid #ded8ff; border-radius: var(--radius-md); background: #f8f6ff; text-align: center; }
.participation-gate__icon { display: grid; width: 3rem; height: 3rem; margin: 0 auto 0.8rem; place-items: center; border-radius: 13px; color: var(--primary-dark); background: #eae5ff; font-size: 1.35rem; font-weight: 800; }
.participation-gate h3 { margin-bottom: 0.35rem; }
.participation-gate p { max-width: 480px; margin: 0 auto 1rem; color: var(--text-secondary); font-size: 0.85rem; }
.participation-gate__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.65rem; }
.participation-gate__actions .button { min-width: 7rem; }
.game-context { display: grid; align-content: start; gap: 0.8rem; }
.context-card { display: flex; align-items: center; gap: 0.8rem; padding: 1rem; }
.context-card__icon { display: grid; width: 2.5rem; height: 2.5rem; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--success); background: #e8f8f1; font-family: Tahoma, sans-serif; font-weight: 800; }
.context-card__icon--gold { color: var(--warning); background: #fff4dc; }
.context-card div { display: grid; }
.context-card div span { color: var(--text-secondary); font-size: 0.72rem; }
.context-card div strong { font-size: 0.88rem; }
.context-card--question { display: none; }
.context-card__question .context-card__timer-label { margin-top: 0.7rem; }
.context-card__timer { color: var(--text-primary); font-family: Tahoma, sans-serif; font-size: 1rem; font-weight: 800; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.context-card__timer.is-expired { color: var(--text-secondary); font-family: inherit; font-size: 0.75rem; direction: rtl; }
.scoring-note { padding: 1rem; }
.scoring-note h3 { margin-bottom: 0.35rem; font-size: 1rem; }
.scoring-note p { margin-bottom: 0; color: var(--text-secondary); font-size: 0.8rem; }
.score-hero { display: grid; justify-items: center; margin-bottom: 1.25rem; padding: 1.3rem; border-radius: var(--radius-lg); color: #fff; background: linear-gradient(145deg, #7250ff, #4824c5); box-shadow: 0 16px 35px rgba(76, 47, 209, 0.22); animation: score-enter 360ms ease-out both; }
.score-hero__label { color: #e6e0ff; font-size: 0.78rem; font-weight: 700; }
.score-hero strong { font-size: clamp(4rem, 16vw, 6.2rem); line-height: 1.05; direction: ltr; font-variant-numeric: tabular-nums; }
.score-hero > span:last-child { color: #dcd4ff; font-size: 0.78rem; }
.result-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; margin-bottom: 1rem; }
.result-summary div { display: grid; padding: 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fcfcfe; }
.result-summary span { color: var(--text-secondary); font-size: 0.72rem; }
.result-summary strong { overflow-wrap: anywhere; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.live-note { display: flex; align-items: flex-start; gap: 0.65rem; margin-bottom: 1.25rem; padding: 0.75rem; border-radius: var(--radius-sm); color: #205f9c; background: #edf6ff; font-size: 0.78rem; }
.live-note > span { width: 0.5rem; height: 0.5rem; flex: 0 0 auto; margin-top: 0.45rem; border-radius: 50%; background: var(--info); }
.live-note p { margin: 0; }
.distribution { display: grid; gap: 1.2rem; }
.distribution__label { display: flex; justify-content: space-between; gap: 0.7rem; margin-bottom: 0.45rem; }
.distribution__label strong { overflow-wrap: anywhere; }
.distribution__label b { display: inline-grid; width: 1.45rem; height: 1.45rem; margin-left: 0.3rem; place-items: center; border-radius: 6px; color: var(--primary-dark); background: #efecff; font-size: 0.7rem; direction: ltr; }
.distribution__label span { font-weight: 800; direction: ltr; font-variant-numeric: tabular-nums; }
.progress-track { overflow: hidden; height: 0.7rem; border-radius: 99px; background: #ebe9f1; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary-dark), var(--accent)); transition: width 350ms ease-out; }
.distribution__row--secondary .progress-track span { background: #a7a3b8; }
.distribution__row small { color: var(--text-secondary); }
.question-empty { width: min(100%, 680px); margin: 5vh auto 0; padding: 2rem 1.25rem; text-align: center; }
.question-empty__mark { display: grid; width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem; place-items: center; border-radius: 15px; color: var(--primary-dark); background: #efecff; font-size: 1.5rem; font-weight: 800; }
.question-empty h1 { margin-bottom: 0.5rem; }
.question-empty p { margin: 0; color: var(--text-secondary); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; margin: -1px; border: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.player-body { background: #f3f3f8; }
.player-shell { min-height: 100vh; }
.player-sidebar { display: none; }
.player-workspace { min-width: 0; }
.workspace-utility { position: sticky; z-index: 20; top: 0; display: flex; min-height: 4.25rem; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0 1rem; border-bottom: 1px solid rgba(230, 229, 238, 0.9); background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(14px); }
.workspace-mobile-brand { font-size: 1.05rem; }
.workspace-utility__label { display: none; color: var(--text-secondary); font-size: 0.78rem; font-weight: 700; }
.workspace-utility__label span { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--success); }
.workspace-utility__account { display: flex; align-items: center; gap: 0.35rem; }
.workspace-utility__account .avatar { color: var(--primary-dark); }
.workspace-container { width: min(100% - 1.25rem, 1080px); margin-inline: auto; }
.app-page-heading { width: min(100%, 980px); margin-inline: auto; }
.badge--live { color: #08744f; background: #e8f8f1; }
.profile-action { display: flex; min-height: 3rem; align-items: center; justify-content: space-between; margin-top: 1rem; padding: 0.65rem 0.9rem; border-radius: var(--radius-sm); color: var(--primary-dark); background: #f3f0ff; font-weight: 700; }
.profile-action:hover { background: #ebe6ff; }
.home-page { display: grid; width: min(100%,1040px); gap: 1.35rem; margin-inline: auto; }
.home-hero { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.25fr); align-items: center; gap: 1.25rem; padding: 1.5rem 2rem .5rem; border: 1px solid #ece6ff; border-radius: 1.5rem; background: linear-gradient(115deg,#faf8ff,#fdfcff); box-shadow: 0 5px 22px #34216b06; overflow: hidden; }
.home-hero__copy { min-width: 0; }
.home-hero h1 { margin-bottom: .8rem; font-size: clamp(1.8rem,2.8vw,2.65rem); letter-spacing: -.035em; line-height: 1.45; }
.home-hero h1 span { color: var(--primary); }
.home-hero p { max-width: 34rem; margin: 0; color: var(--text-secondary); font-size: .9rem; line-height: 1.9; }
.home-hero__actions { display: flex; gap: .5rem; margin-top: 1.15rem; }
.home-hero__actions .button { min-width: 8.5rem; }
.home-hero__visual { position: relative; min-width: 0; width: 100%; height: clamp(16rem,27vw,22rem); }
.home-hero__lottie { position: absolute; inset: 0; }
.home-hero__lottie, .home-hero__fallback { display: block; width: 100%; height: 100%; }
.home-hero__lottie[hidden], .home-hero__fallback[hidden] { display: none; }
.home-hero__fallback { object-fit: contain; }
.home-today { display: grid; grid-template-columns: 3.5rem minmax(0,1fr) auto; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; border-color: #dcd5ff; background: linear-gradient(120deg,#fff,#f4f1ff); }
.home-today.is-complete { border-color: #cce9df; background: linear-gradient(120deg,#fff,#effaf6); }
.home-today__icon { display: grid; width: 3.5rem; height: 3.5rem; place-items: center; border-radius: 14px; color: var(--primary-dark); background: #e8e3ff; }
.home-today.is-complete .home-today__icon { color: #08744f; background: #daf3ea; }
.home-today__icon svg, .home-step__icon svg { width: 1.55rem; height: 1.55rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-today__copy { min-width: 0; }
.home-today__copy > span { color: var(--primary); font-size: .68rem; font-weight: 800; }
.home-today.is-complete .home-today__copy > span { color: #08744f; }
.home-today h2 { margin: .05rem 0 .15rem; font-size: 1.05rem; }
.home-today p { margin: 0; color: var(--text-secondary); font-size: .74rem; }
.home-today__action { min-width: 9.5rem; }
.home-how { padding: .2rem 0; }
.home-how > h2 { margin-bottom: .65rem; font-size: 1rem; }
.home-steps { position: relative; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; }
.home-steps::before { position: absolute; z-index: 0; top: 2rem; right: 16%; left: 16%; height: 1px; background: #ddd8f4; content: ""; }
.home-step { position: relative; z-index: 1; display: grid; grid-template-columns: auto 2.8rem minmax(0,1fr); min-height: 4.1rem; align-items: center; gap: .55rem; padding: .65rem .7rem; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.home-step__number { color: #aaa5bf; font-size: .65rem; font-weight: 800; }
.home-step__icon { display: grid; width: 2.8rem; height: 2.8rem; place-items: center; border-radius: 11px; color: var(--primary-dark); background: #efecff; }
.home-step strong { font-size: .75rem; line-height: 1.65; }
.home-why { padding: .15rem 0 .35rem; }
.home-why h2 { margin-bottom: .55rem; font-size: 1rem; }
.home-why > div { display: flex; flex-wrap: wrap; gap: .45rem; }
.home-why span { padding: .45rem .7rem; border: 1px solid #e4e0f3; border-radius: 999px; color: #5c5472; background: rgba(255,255,255,.72); font-size: .7rem; }
.profile-action--submission { width: min(100%,980px); justify-content: flex-start; gap: .7rem; margin: -0.3rem auto 1.3rem; border: 1px solid #e2ddff; }
.profile-action__icon { display: grid; width: 2.25rem; height: 2.25rem; flex: 0 0 auto; place-items: center; border-radius: 10px; background: #e8e3ff; }
.profile-action__icon svg, .result-suggestion__icon svg, .submission-success__icon svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-action__copy { display: grid; min-width: 0; }
.profile-action__copy strong { color: var(--text-primary); font-size: .8rem; }
.profile-action__copy small { color: var(--text-secondary); font-size: .66rem; font-weight: 500; }
.profile-action__arrow { margin-inline-start: auto; }

.submission-heading, .submission-card, .submission-success { width: min(100%,720px); margin-inline: auto; }
.submission-heading { margin-bottom: .75rem; }
.submission-heading h1 { margin-bottom: .15rem; font-size: 1.55rem; }
.submission-heading p { margin: 0; color: var(--text-secondary); font-size: .78rem; }
.submission-card { padding: 1.25rem; }
.submission-card form { display: grid; gap: 1rem; }
.submission-textarea { min-height: 7.5rem; resize: vertical; line-height: 1.8; }
.submission-options { display: grid; gap: .8rem; }
.submission-note { margin: -.2rem 0 0; color: var(--text-secondary); font-size: .7rem; }
.submission-success { display: grid; min-height: 19rem; place-content: center; justify-items: center; padding: 2rem 1rem; text-align: center; }
.submission-success__icon { display: grid; width: 3.5rem; height: 3.5rem; margin-bottom: .6rem; place-items: center; border-radius: 50%; color: #08744f; background: #e3f7ef; }
.submission-success__icon svg { width: 1.65rem; height: 1.65rem; }
.submission-success h2 { margin-bottom: .35rem; font-size: 1.2rem; }
.submission-success p { max-width: 29rem; margin-bottom: 1.15rem; color: var(--text-secondary); font-size: .8rem; }
.submission-success__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; }
.result-suggestion { display: flex; align-items: center; gap: .7rem; margin-top: 1rem; padding: .8rem; border: 1px solid #e1dcfa; border-radius: 13px; background: #f8f6ff; }
.result-suggestion__icon { display: grid; width: 2.35rem; height: 2.35rem; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--primary-dark); background: #e9e4ff; }
.result-suggestion > div { min-width: 0; }
.result-suggestion strong { display: block; font-size: .78rem; }
.result-suggestion p { margin: .1rem 0 0; color: var(--text-secondary); font-size: .66rem; }
.result-suggestion .button { flex: 0 0 auto; margin-inline-start: auto; }
.post-answer-ad { margin-top: 1rem; scroll-margin-top: 4.5rem; animation: sponsored-reveal 320ms ease both; }
.sponsored-card { display: grid; min-width: 0; grid-template-columns: minmax(0,1.45fr) minmax(11rem,.8fr); overflow: hidden; border: 1px solid #e2ddf3; border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(42,31,88,.08); }
.sponsored-card__image-wrap { min-height: 9.25rem; overflow: hidden; background: #eeebfb; }
.sponsored-card__image { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.sponsored-card:hover .sponsored-card__image { transform: scale(1.015); }
.sponsored-card__content { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; justify-content: center; padding: 1rem 1.1rem; }
.sponsored-card__label { margin-bottom: .3rem; padding: .15rem .45rem; border-radius: 999px; color: var(--primary-dark); background: #f0edff; font-size: .58rem; font-weight: 700; }
.sponsored-card h2 { width: 100%; overflow: hidden; margin: 0 0 .3rem; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.sponsored-card p { display: -webkit-box; overflow: hidden; margin: 0 0 .75rem; color: var(--text-secondary); font-size: .7rem; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.sponsored-card__cta { transition: color 220ms ease, background 220ms ease, border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease; }
.sponsored-card__cta:hover { box-shadow: 0 7px 16px rgba(76,47,209,.12); transform: translateY(-1px); }
.sponsored-card__cta:focus-visible { outline: 3px solid rgba(109,74,255,.22); outline-offset: 2px; }
@keyframes sponsored-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.workspace-header-actions { display: flex; align-items: center; gap: 0.4rem; margin-inline-start: auto; }
.header-user-link { display: flex; min-width: 0; align-items: center; gap: 0.55rem; padding: 0.3rem 0.45rem; border: 1px solid transparent; border-radius: 12px; color: var(--text-primary); cursor: pointer; transition: background 180ms ease, border-color 180ms ease, color 180ms ease; }
.header-user-link:hover { border-color: #e4dfff; color: var(--text-primary); background: #f3f1fb; }
.header-user-link strong { display: none; max-width: 10rem; overflow: hidden; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.header-notifications { position: relative; }
.header-icon-button { position: relative; display: grid; width: 2.45rem; height: 2.45rem; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--text-secondary); background: transparent; cursor: pointer; transition: color 180ms ease, background 180ms ease; }
.header-icon-button:hover, .header-icon-button[aria-expanded="true"] { color: var(--primary-dark); background: #f1eefc; }
.header-icon-button svg, .logout-button svg, .sidebar-nav__icon svg, .nav-symbol svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-unread { position: absolute; inset-block-start: 0.35rem; inset-inline-start: 0.38rem; width: 0.48rem; height: 0.48rem; border: 2px solid #fff; border-radius: 50%; background: var(--primary); }
.notification-unread[hidden] { display: none; }
.notification-popover { position: absolute; z-index: 50; inset-block-start: calc(100% + 0.55rem); inset-inline-start: 0; width: min(21rem, calc(100vw - 1.5rem)); overflow: hidden; border: 1px solid #e7e4ef; border-radius: 16px; background: #fff; box-shadow: 0 18px 50px rgba(34, 28, 70, 0.16); direction: rtl; text-align: start; }
.notification-popover[hidden] { display: none; }
.notification-popover header { padding: 0.8rem 1rem; border-block-end: 1px solid var(--border); }
.notification-popover h2 { margin: 0; font-size: 0.95rem; }
.welcome-notification { display: flex; gap: 0.75rem; padding: 1rem; background: #fbfaff; }
.welcome-notification__mark { display: grid; width: 2.5rem; height: 2.5rem; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--primary-dark); background: #ece8ff; }
.welcome-notification__mark svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.welcome-notification p { margin: 0 0 0.25rem; font-size: 0.8rem; line-height: 1.7; }
.welcome-notification time { color: var(--text-secondary); font-size: 0.67rem; }
.mobile-header-logout { margin: 0; }
.avatar__fallback { width: 55%; height: 55%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.profile-hero { position: relative; display: flex; min-height: 9rem; overflow: hidden; align-items: center; justify-content: space-between; gap: 1.25rem; margin: 0 auto 1.3rem; padding: 1.35rem; border-color: #e3def8; background: linear-gradient(135deg, #fff 15%, #f8f6ff 62%, #eeeaff); isolation: isolate; }
.profile-hero::before { position: absolute; z-index: -1; inset-block-start: -4rem; inset-inline-end: -2rem; width: 13rem; height: 13rem; border: 1px solid rgba(109,74,255,.09); border-radius: 50%; content: ""; }
.profile-hero__identity-wrap { display: flex; min-width: 0; align-items: center; gap: 1rem; }
.avatar--profile { width: 5rem; height: 5rem; border: 4px solid rgba(255,255,255,.9); font-size: 1.65rem; box-shadow: 0 10px 25px rgba(76,47,209,.15); }
.profile-avatar-trigger { position: relative; display: grid; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%; color: inherit; background: transparent; cursor: pointer; transition: transform 240ms ease, filter 240ms ease; }
.profile-avatar-trigger:hover { filter: brightness(1.03); transform: translateY(-2px); }
.profile-avatar-trigger:focus-visible { outline: 3px solid rgba(109,74,255,.25); outline-offset: 4px; }
.profile-avatar-trigger__edit { position: absolute; z-index: 2; inset-inline-start: -.15rem; inset-block-end: -.1rem; display: grid; width: 1.75rem; height: 1.75rem; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--primary); box-shadow: 0 5px 12px rgba(76,47,209,.28); transition: background 220ms ease, transform 220ms ease, box-shadow 220ms ease; }
.profile-avatar-trigger__edit svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.profile-avatar-trigger:hover .profile-avatar-trigger__edit { background: var(--primary-dark); box-shadow: 0 7px 16px rgba(76,47,209,.34); transform: rotate(-4deg); }
.profile-hero__identity { min-width: 0; }
.profile-hero__identity .eyebrow { margin-bottom: 0.2rem; }
.profile-hero__identity h1 { margin-bottom: 0.25rem; font-size: 1.45rem; }
.profile-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .75rem; color: var(--text-secondary); font-size: 0.74rem; }
.profile-hero__inviter { display: flex; min-width: 0; align-items: center; gap: .45rem; margin-top: .55rem; }
.profile-hero__inviter {    box-shadow: 0 0 1px 0px #6c4de6;    padding: 3px 8px;    border-radius: 5px;    background-color: rgb(240 237 255);}
.profile-hero__inviter > div {    display: grid;    min-width: 0;    gap: .02rem;}
.profile-hero__inviter small { color: var(--text-secondary); font-size: .58rem; line-height: 1.4; }
.profile-hero__inviter strong { overflow: hidden; max-width: 10rem; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.avatar--hero-inviter { width: 1.8rem; height: 1.8rem; flex: 0 0 auto; font-size: .58rem; }
.profile-status { display: inline-flex; align-items: center; gap: .35rem; }
.profile-status i { width: .42rem; height: .42rem; border-radius: 50%; background: var(--success); }
.profile-hero__motif { position: relative; display: grid; width: 9rem; height: 6.5rem; flex: 0 0 auto; place-items: center; }
.profile-hero__motif::before, .profile-hero__motif::after { position: absolute; border-radius: 50%; content: ""; }
.profile-hero__motif::before { width: 6.25rem; height: 6.25rem; border: 1px solid rgba(109,74,255,.18); box-shadow: inset 0 0 0 6px rgba(255,255,255,.28); }
.profile-hero__motif::after { inset-block-start: .35rem; inset-inline-start: 1rem; width: .5rem; height: .5rem; background: linear-gradient(135deg,#967dff,#5f3ee8); box-shadow: 6.6rem 4.7rem 0 -.08rem rgba(109,74,255,.32); }
.profile-hero__percent { position: relative; z-index: 1; display: grid; width: 5.25rem; height: 5.25rem; place-items: center; border: 1px solid rgba(255,255,255,.78); border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 28%,#a893ff 0,#7657ed 45%,#4c2fd1 100%); font-family: Tahoma,sans-serif; font-size: 2.2rem; font-weight: 800; text-shadow: 0 2px 8px rgba(38,21,113,.28); box-shadow: 0 14px 32px rgba(76,47,209,.2),inset 0 1px 0 rgba(255,255,255,.45); }
.profile-hero__bar { position: absolute; inset-block-end: .3rem; width: .5rem; border-radius: 1rem; background: rgba(109,74,255,.22); }
.profile-hero__bar--1 { inset-inline-end: .4rem; height: 1.6rem; }
.profile-hero__bar--2 { inset-inline-end: 1.2rem; height: 2.5rem; background: rgba(109,74,255,.38); }
.profile-hero__bar--3 { inset-inline-end: 2rem; height: 1rem; background: rgba(109,74,255,.15); }
.profile-referral-grid { display: grid; width: min(100%,980px); gap: .75rem; margin: 0 auto 1.3rem; }
.profile-referral-card { display: grid; min-width: 0; height: 100%; align-content: start; gap: .85rem; padding: 1rem; }
.profile-referral-card__heading { display: flex; min-width: 0; align-items: center; gap: .7rem; }
.profile-referral-card__heading h2 { margin: 0 0 .12rem; font-size: .9rem; }
.profile-referral-card__heading p { margin: 0; color: var(--text-secondary); font-size: .68rem; }
.profile-referral-card__icon { display: grid; width: 2.35rem; height: 2.35rem; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--primary-dark); background: #ede9ff; }
.profile-referral-card__icon svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-invite-code { display: block; overflow-wrap: anywhere; padding: .65rem .8rem; border: 1px dashed #d7cffb; border-radius: 11px; color: var(--primary-dark); background: #f8f6ff; font-family: Consolas,"Courier New",monospace; font-size: 1.05rem; font-weight: 800; letter-spacing: .12em; text-align: center; }
.profile-referral-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.profile-referral-actions .button { flex: 1 1 8rem; transition: color var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition); }
.profile-referral-actions .button:hover { transform: translateY(-1px); }
.direct-referrals { min-width: 0; height: 100%; padding: .9rem 1rem; }
.direct-referrals__header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .7rem; }
.direct-referrals__header h2 { margin: 0; font-size: .9rem; }
.direct-referrals__header > span { flex: 0 0 auto; padding: .25rem .55rem; border-radius: 999px; color: var(--primary-dark); background: #efecff; font-size: .67rem; font-weight: 700; }
.direct-referrals__empty { display: grid; min-height: 6.7rem; place-content: center; justify-items: center; gap: .45rem; color: var(--text-secondary); text-align: center; }
.direct-referrals__empty > span { display: grid; width: 2.3rem; height: 2.3rem; place-items: center; border-radius: 11px; color: var(--primary); background: #f0edff; }
.direct-referrals__empty svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.direct-referrals__empty p { margin: 0; font-size: .7rem; }
.direct-referrals__list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .35rem; }
.direct-referral-row { display: grid; min-width: 0; justify-items: center; gap: .35rem; padding: .5rem .3rem; border-radius: 11px; text-align: center; transition: background 220ms ease, transform 220ms ease; }
.direct-referral-row:hover { background: #f7f5fc; transform: translateY(-1px); }
.direct-referral-row strong { overflow: hidden; width: 100%; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.avatar--direct-referral { width: 2.65rem; height: 2.65rem; flex: 0 0 auto; font-size: .82rem; }
.direct-referrals__view-all { display: inline-flex; margin-top: .55rem; padding: .35rem .5rem; border: 0; border-radius: 8px; color: var(--primary-dark); background: transparent; font: inherit; font-size: .7rem; font-weight: 700; cursor: pointer; transition: color 220ms ease, background 220ms ease, transform 220ms ease; }
.direct-referrals__view-all:hover { color: var(--primary); background: #f0edff; transform: translateX(-2px); }
.direct-referrals__view-all:focus-visible { outline: 3px solid rgba(109,74,255,.2); outline-offset: 2px; }
.referral-list-modal__dialog { width: min(100%,28rem); overflow: hidden; }
.referral-list-modal__body { display: grid; max-height: min(60vh,28rem); overflow-y: auto; gap: .2rem; padding-inline-end: .15rem; overscroll-behavior: contain; }
.direct-referral-row--modal { display: flex; min-height: 3.25rem; justify-items: initial; gap: .6rem; padding: .45rem .6rem; border-bottom: 1px solid #f0edf7; border-radius: 9px; text-align: start; }
.direct-referral-row--modal strong { width: auto; }
.direct-referral-row--modal:last-child { border-bottom: 0; }
.invite-code-input { text-transform: uppercase; letter-spacing: .08em; }
.avatar-modal { position: fixed; z-index: 120; inset: 0; display: grid; padding: 1.25rem; place-items: center; visibility: hidden; opacity: 0; pointer-events: none; transition: visibility 0s linear 280ms, opacity 260ms ease; }
.avatar-modal.is-open { visibility: visible; opacity: 1; pointer-events: auto; transition-delay: 0s; }
.avatar-modal__backdrop { position: absolute; inset: 0; background: rgba(24,18,50,.52); opacity: 0; backdrop-filter: blur(2px); transition: opacity 260ms ease, backdrop-filter 260ms ease; }
.avatar-modal.is-open .avatar-modal__backdrop { opacity: 1; }
.avatar-modal__dialog { position: relative; width: min(100%,46rem); max-height: min(90vh,44rem); overflow: auto; padding: 1.35rem; border: 1px solid rgba(225,219,247,.95); border-radius: 24px; background: #fff; box-shadow: 0 28px 80px rgba(31,22,70,.24); opacity: 0; transform: translateY(14px) scale(.985); transition: opacity 240ms ease, transform 280ms cubic-bezier(.2,.75,.25,1); }
.avatar-modal.is-open .avatar-modal__dialog { opacity: 1; transform: translateY(0) scale(1); }
.avatar-modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
.avatar-modal__header h2 { margin: .12rem 0 .2rem; font-size: 1.25rem; }
.avatar-modal__header p { margin: 0; color: var(--text-secondary); font-size: .76rem; }
.avatar-modal__close, .app-toast__close { display: grid; flex: 0 0 auto; place-items: center; border: 0; color: var(--text-secondary); background: transparent; cursor: pointer; transition: color 200ms ease, background 200ms ease, transform 200ms ease; }
.avatar-modal__close { width: 2.35rem; height: 2.35rem; border-radius: 10px; background: #f6f4fb; }
.avatar-modal__close:hover { color: var(--primary-dark); background: #eeeaff; transform: rotate(-3deg); }
.avatar-modal__close:focus-visible, .app-toast__close:focus-visible { outline: 3px solid rgba(109,74,255,.22); outline-offset: 2px; }
.avatar-modal__close svg, .app-toast__close svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.avatar-modal__actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.avatar-modal__save { min-width: 9rem; }
body.has-open-modal { overflow: hidden; }
.avatar-picker { display: grid; grid-template-columns: repeat(10,minmax(0,1fr)); gap: .75rem; }
.avatar-choice { position: relative; display: grid; place-items: center; cursor: pointer; }
.avatar-choice__input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.avatar-choice__preview { position: relative; display: block; width: min(100%,4.75rem); aspect-ratio: 1; padding: .18rem; border: 2px solid transparent; border-radius: 50%; background: #f0edfa; box-shadow: 0 2px 8px rgba(45,32,99,.07); transition: border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease; }
.avatar-choice__preview > img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-choice:hover .avatar-choice__preview { border-color: #cfc5fb; box-shadow: 0 6px 16px rgba(76,47,209,.12); transform: translateY(-2px); }
.avatar-choice__input:focus-visible + .avatar-choice__preview { outline: 3px solid rgba(109,74,255,.22); outline-offset: 2px; }
.avatar-choice__input:checked + .avatar-choice__preview { border-color: var(--primary); box-shadow: 0 0 0 3px #ebe7ff,0 7px 18px rgba(76,47,209,.16); }
.avatar-choice__check { position: absolute; z-index: 2; inset-inline-start: -.15rem; inset-block-end: -.05rem; display: grid; width: 1.35rem; height: 1.35rem; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--primary); opacity: 0; transform: scale(.75); transition: opacity 220ms ease, transform 220ms ease; }
.avatar-choice__check svg { width: .8rem; height: .8rem; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.avatar-choice__input:checked + .avatar-choice__preview .avatar-choice__check { opacity: 1; transform: scale(1); }
.app-toast { position: fixed; z-index: 150; top: 4.5rem; left: 1.25rem; display: grid; width: min(24rem,calc(100vw - 1.5rem)); grid-template-columns: 2.35rem minmax(0,1fr) 2rem; align-items: center; gap: .7rem; overflow: hidden; padding: .8rem .85rem .9rem; border: 1px solid #ddd7f4; border-radius: 16px; background: rgba(255,255,255,.97); box-shadow: 0 18px 44px rgba(31,22,70,.18); opacity: 0; transform: translateY(-12px) scale(.98); pointer-events: none; transition: opacity 240ms ease, transform 280ms cubic-bezier(.2,.75,.25,1); }
.app-toast.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.app-toast.is-leaving { opacity: 0; transform: translateY(-8px) scale(.985); pointer-events: none; }
.app-toast__icon { display: grid; width: 2.35rem; height: 2.35rem; place-items: center; border-radius: 11px; }
.app-toast__icon svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.app-toast--success .app-toast__icon { color: #08765c; background: #e2f7ef; }
.app-toast--error .app-toast__icon { color: #a4333f; background: #fff0f1; }
.app-toast__copy { display: grid; min-width: 0; gap: .08rem; }
.app-toast__copy strong { font-size: .79rem; }
.app-toast__copy span { overflow-wrap: anywhere; color: var(--text-secondary); font-size: .7rem; line-height: 1.65; }
.app-toast__close { width: 2rem; height: 2rem; border-radius: 8px; }
.app-toast__close:hover { color: var(--text-primary); background: #f4f2f8; transform: rotate(-3deg); }
.app-toast__progress { position: absolute; inset-inline: 0; inset-block-end: 0; height: 3px; background: var(--primary); transform: scaleX(0); transform-origin: right; }
.app-toast.is-visible .app-toast__progress { animation: toast-progress 6s linear forwards; }
.app-toast:hover .app-toast__progress, .app-toast:focus-within .app-toast__progress { animation-play-state: paused; }
.app-toast--error .app-toast__progress { background: #d56573; }
@keyframes toast-progress { to { transform: scaleX(1); } }
.profile-performance { margin: 0 auto 1.3rem; }
.profile-section-heading { margin-bottom: 0.75rem; }
.profile-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0.65rem; }
.metric-card { position: relative; display: grid; min-width: 0; padding: 0.9rem; border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.metric-card__icon { display: grid; width: 2rem; height: 2rem; margin-bottom: .65rem; place-items: center; border-radius: 9px; }
.metric-card__icon svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.metric-card--rank { border-color: #f0dfb0; background: linear-gradient(145deg,#fffaf0,#fff); }
.metric-card--rank .metric-card__icon, .metric-card--rank strong { color: #9b6900; }
.metric-card--rank .metric-card__icon { background: #fff0c4; }
.metric-card--score { border-color: #ded8ff; background: linear-gradient(145deg,#f7f5ff,#fff); }
.metric-card--score .metric-card__icon, .metric-card--score strong { color: var(--primary-dark); }
.metric-card--score .metric-card__icon { background: #ebe7ff; }
.metric-card--answers { border-color: #cfece3; background: linear-gradient(145deg,#f2fbf8,#fff); }
.metric-card--answers .metric-card__icon, .metric-card--answers strong { color: #08765c; }
.metric-card--answers .metric-card__icon { background: #dcf5ec; }
.metric-card--average { border-color: #d7ddfb; background: linear-gradient(145deg,#f4f6ff,#fff); }
.metric-card--average .metric-card__icon, .metric-card--average strong { color: #4052a8; }
.metric-card--average .metric-card__icon { background: #e6eaff; }
.metric-card span { color: var(--text-secondary); font-size: 0.72rem; }
.metric-card strong { margin-top: 0.3rem; color: var(--text-primary); font-size: 1.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.profile-dashboard-grid { display: grid; gap: 1rem; margin-inline: auto; }
.profile-overall, .recent-performance { min-width: 0; padding: 1rem; }
.profile-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; margin-bottom: 0.8rem; }
.profile-card-heading h2 { margin: 0; font-size: 1rem; }
.profile-card-heading a { padding: 0.25rem 0.4rem; border-radius: 7px; font-size: 0.7rem; font-weight: 700; transition: background var(--transition); }
.profile-card-heading a:hover { background: #f0edff; }
.overall-rank { display: flex; min-height: 6.2rem; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; padding: 1rem; border: 1px solid #ddd7ff; border-radius: 16px; color: var(--primary-dark); background: radial-gradient(circle at 80% 20%,rgba(255,255,255,.95),transparent 38%),linear-gradient(135deg,#eeeaff,#faf9ff); }
.overall-rank span { font-size: 0.75rem; }
.overall-rank strong { display: grid; width: 3.6rem; height: 3.6rem; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg,var(--primary),var(--primary-dark)); font-size: 1.7rem; line-height: 1; box-shadow: 0 8px 18px rgba(76,47,209,.2); }
.overall-details { margin: 0; }
.overall-details div { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0; border-block-end: 1px solid var(--border); }
.overall-details div:last-child { border: 0; }
.overall-details dt { color: var(--text-secondary); font-size: 0.72rem; }
.overall-details dd { margin: 0; font-size: 0.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.compact-empty { padding: 1rem; border-radius: 11px; color: var(--text-secondary); background: #f7f7fa; font-size: 0.78rem; text-align: center; }
.recent-list { display: grid; gap: 0.35rem; }
.recent-item { display: grid; grid-template-columns: 2rem minmax(0,1fr) auto; align-items: center; gap: 0.55rem; padding: 0.55rem; border-radius: 10px; background: #fafafd; }
.recent-item__mark { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 8px; color: var(--primary-dark); background: #efecff; font-weight: 800; }
.recent-item > div { display: grid; min-width: 0; }
.recent-item > div strong { overflow: hidden; font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.recent-item time { color: var(--text-secondary); font-size: 0.62rem; }
.recent-item__score { display: grid; justify-items: end; font-size: 0.85rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.recent-item__score.is-live { color: var(--success); }
.recent-item__score small { color: var(--text-secondary); font-size: 0.58rem; font-weight: 600; }

.history-heading, .history-filters, .history-list, .history-empty, .history-pagination { width: min(100%, 900px); margin-inline: auto; }
.history-heading { margin-bottom: .7rem; }
.history-heading h1 { margin-bottom: .15rem; font-size: 1.55rem; }
.history-heading p { margin: 0; color: var(--text-secondary); font-size: .78rem; }
.history-filters { display: flex; gap: .35rem; margin-bottom: .85rem; padding: .28rem; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.history-filter { min-width: 5.5rem; padding: .48rem .8rem; border-radius: 9px; color: var(--text-secondary); font-size: .76rem; font-weight: 700; text-align: center; transition: color var(--transition), background var(--transition); }
.history-filter:hover { color: var(--primary-dark); background: #f6f4ff; }
.history-filter.is-active { color: #fff; background: linear-gradient(135deg,var(--primary),var(--primary-dark)); box-shadow: 0 4px 12px rgba(76,47,209,.16); }
.history-list { display: grid; gap: .65rem; }
.history-item { position: relative; overflow: hidden; padding: 0; border-radius: 16px; transition: border-color 300ms ease, box-shadow 300ms ease, background-color 300ms ease; }
.history-item__summary { display: grid; width: 100%; grid-template-columns: minmax(0,1fr) auto 5.5rem 1.5rem; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border: 0; color: inherit; background: transparent; font: inherit; text-align: start; cursor: pointer; }
.history-item__summary:hover { background: rgba(248,247,253,.62); }
.history-item.is-missed { border-color: #efdfbd; background: linear-gradient(105deg,#fffdf8,#fff8eb); }
.history-item.is-pending { border-color: #ddd7ef; background: linear-gradient(105deg,#fff,#f9f7ff); }
.history-item.is-missed .history-item__main, .history-item.is-pending .history-item__main { grid-column: 1 / 4; }
.history-item__main { min-width: 0; }
.history-item__topline { display: flex; align-items: center; gap: .55rem; margin-bottom: .35rem; }
.history-item__topline time { color: var(--text-secondary); font-size: .65rem; font-variant-numeric: tabular-nums; }
.history-status { padding: .18rem .48rem; border-radius: 999px; color: #5c4c80; background: #f0edfb; font-size: .62rem; font-weight: 800; }
.history-item.is-missed .history-status { color: #926018; background: #fff0ce; }
.history-item.is-pending .history-status { color: #5c4c80; background: #eeeafb; }
.history-item h2 { margin: 0 0 .4rem; overflow: hidden; font-size: .92rem; line-height: 1.65; text-overflow: ellipsis; white-space: nowrap; }
.history-selection { display: flex; min-width: 0; align-items: center; gap: .45rem; color: var(--text-secondary); font-size: .72rem; }
.history-selection strong { color: var(--text-primary); }
.history-selection img { width: 2.2rem; height: 1.7rem; flex: 0 0 auto; border-radius: 6px; object-fit: contain; background: #f7f6fb; }
.history-pending-note { margin: .4rem 0 0; color: #675b82; font-size: .68rem; font-weight: 650; }
.history-missed-message { display: flex; align-items: center; gap: .5rem; color: #8a5c1d; font-size: .74rem; font-weight: 650; }
.history-missed-message svg { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.history-comparison { display: grid; grid-template-columns: repeat(3, minmax(4.3rem,auto)); gap: .35rem; }
.history-comparison div { display: grid; justify-items: center; padding: .5rem .55rem; border-radius: 10px; background: #f7f6fa; }
.history-comparison span { color: var(--text-secondary); font-size: .6rem; }
.history-comparison strong { margin-top: .1rem; font-size: .78rem; font-variant-numeric: tabular-nums; }
.history-score { display: grid; min-height: 4.5rem; place-content: center; justify-items: center; border-inline-start: 1px solid var(--border); color: var(--primary-dark); }
.history-score strong { font-size: 1.55rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.history-score span { margin-top: .15rem; color: var(--text-secondary); font-size: .62rem; }
.history-item__chevron { display: grid; width: 1.5rem; height: 1.5rem; place-items: center; color: #77708c; transition: transform 300ms ease; }
.history-item__chevron svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.history-item.is-expanded { border-color: #d8cffd; box-shadow: 0 8px 24px rgba(76,47,209,.08); }
.history-item.is-expanded .history-item__chevron { transform: rotate(180deg); }
.history-item__details { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; border-top: 0 solid transparent; background: #f9f8fd; text-align: start; transition: grid-template-rows 350ms ease, opacity 250ms ease, border-top-width 350ms ease, border-top-color 350ms ease, visibility 0s linear 350ms; }
.history-item__details-inner { display: grid; min-height: 0; overflow: hidden; grid-template-columns: minmax(0,3fr) minmax(9.5rem,1fr); gap: 0; padding: 0 1.25rem; transform: translateY(-6px); transition: padding 350ms ease, transform 350ms ease; }
.history-item.is-expanded .history-item__details { grid-template-rows: 1fr; opacity: 1; visibility: visible; border-top-width: 1px; border-top-color: #ded9ec; transition: grid-template-rows 350ms ease, opacity 250ms ease 60ms, border-top-width 350ms ease, border-top-color 350ms ease, visibility 0s; }
.history-item.is-expanded .history-item__details-inner { padding: 1.15rem 1.25rem 1.25rem; transform: translateY(0); }
.history-item__details h3 { margin: 0 0 .85rem; color: var(--text-primary); font-size: .8rem; text-align: right; }
.history-results { min-width: 0; padding-inline-end: 1.5rem; }
.history-results:only-child { grid-column: 1 / -1; padding-inline-end: 0; }
.history-result-row + .history-result-row { margin-top: .9rem; }
.history-result-row > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .4rem; color: var(--text-secondary); font-size: .74rem; }
.history-result-row strong { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.history-result-row span { font-variant-numeric: tabular-nums; }
.history-result-row.is-selected > div { color: var(--primary-dark); }
.history-result-row.is-selected strong { font-weight: 850; }
.history-result-track { display: block; height: .52rem; overflow: hidden; border-radius: 999px; background: #e9e7ef; }
.history-result-track > span { display: block; height: 100%; border-radius: inherit; background: #c4bfd2; transform: scaleX(0); transform-origin: right center; transition: transform 450ms ease 40ms; }
.history-item.is-expanded .history-result-track > span { transform: scaleX(1); }
.history-result-row.is-selected .history-result-track > span { background: var(--primary); }
.history-answer-time { padding-inline-start: 1.35rem; border-inline-start: 1px solid #ded9ec; }
.history-answer-time time { display: grid; gap: .15rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.history-answer-time strong { color: var(--text-primary); font-size: 1.15rem; line-height: 1.4; }
.history-answer-time span { font-size: .7rem; }
.history-empty { display: grid; min-height: 17rem; place-content: center; justify-items: center; gap: .65rem; padding: 2rem 1rem; text-align: center; }
.history-empty > span { display: grid; width: 3rem; height: 3rem; place-items: center; border-radius: 13px; color: var(--primary-dark); background: #eeeaff; font-size: 1.35rem; font-weight: 800; }
.history-empty h2 { margin: 0; font-size: .95rem; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1rem; }
.history-pagination a, .history-pagination span { padding: .48rem .7rem; border: 1px solid var(--border); border-radius: 9px; color: var(--primary-dark); background: #fff; font-size: .72rem; }
.history-pagination a:hover { background: #f4f1ff; }
.history-pagination span { color: #aaa7b2; background: #f7f7fa; }
.history-pagination strong { font-size: .7rem; }

.leaderboard-heading { margin-bottom: .55rem; }
.leaderboard-heading h1 { margin-bottom: .15rem; }
.leaderboard-heading p { margin: 0; font-size: .78rem; }
.period-tabs { display: flex; overflow-x: auto; gap: 0.35rem; margin-bottom: 0.8rem; padding: 0.3rem; border: 1px solid var(--border); border-radius: 14px; background: #fff; scrollbar-width: thin; }
.period-tab { min-width: max-content; flex: 1 0 auto; padding: 0.55rem 0.85rem; border-radius: 10px; color: var(--text-secondary); text-align: center; font-size: 0.82rem; font-weight: 700; }
.period-tab:hover { color: var(--primary-dark); background: #f7f5ff; }
.period-tab.is-active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 5px 14px rgba(91, 60, 220, 0.2); }
.leaderboard-status { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1rem; padding: 0.7rem 0.9rem; border-radius: 12px; }
.leaderboard-status.is-live { color: #08744f; background: #e8f8f1; }
.leaderboard-status.is-final { color: #5c4c80; background: #f1eefb; }
.leaderboard-status__badge { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; font-size: 0.78rem; font-weight: 800; }
.leaderboard-status__badge i { font-style: normal; font-size: 0.65rem; }
.leaderboard-status p { margin: 0; color: inherit; font-size: 0.78rem; }
.leaderboard-layout { display: grid; gap: 1rem; }
.leaderboard-board { min-width: 0; overflow: hidden; padding: 0.5rem; }
.leaderboard-podium { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0.55rem; padding: 0.35rem 0.2rem 1rem; }
.podium-card { position: relative; display: grid; min-width: 0; justify-items: center; padding: 0.9rem 0.5rem; border: 1px solid; border-radius: 17px; text-align: center; }
.podium-card--1 { grid-column: 1 / -1; grid-row: 1; width: min(68%,13rem); justify-self: center; border-color: #e4bd55; background: linear-gradient(155deg,#fff9e6,#fff); box-shadow: 0 10px 25px rgba(165,116,14,.12); }
.podium-card--2 { border-color: #cdd2dc; background: linear-gradient(155deg,#f3f5f8,#fff); }
.podium-card--3 { border-color: #dfb08f; background: linear-gradient(155deg,#fff0e7,#fff); }
.podium-card.is-current-user { box-shadow: 0 0 0 2px var(--primary), 0 10px 25px rgba(76,47,209,.12); }
.podium-trophy { display: block; width: 4.2rem; height: 4rem; margin: -.15rem auto .35rem; object-fit: contain; }
.podium-card--1 .podium-trophy { width: 5.6rem; height: 5.2rem; margin-top: -.35rem; }
.podium-rank { color: var(--text-secondary); font-size: 0.65rem; font-weight: 800; }
.podium-card .leaderboard-avatar { margin: 0.35rem 0; }
.podium-card--1 .leaderboard-avatar { width: 3rem; height: 3rem; color: #765000; background: #ffecb3; font-size: 1.1rem; }
.podium-name { width: 100%; overflow: hidden; font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.podium-card--1 .podium-name { font-size: 0.95rem; }
.podium-you { color: var(--primary); font-size: 0.6rem; font-weight: 800; }
.podium-score { margin-top: 0.3rem; color: var(--primary-dark); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.podium-card--1 .podium-score { color: #8b6100; font-size: 1.45rem; }
.podium-meta { color: var(--text-secondary); font-size: 0.62rem; }
.ranking-list-title { margin: 0.25rem 0 0.65rem; padding-inline: 0.35rem; font-size: 0.86rem; }
.outside-rank-separator { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.8rem; color: var(--text-secondary); }
.outside-rank-separator::before, .outside-rank-separator::after { height: 1px; flex: 1; background: var(--border); content: ""; }
.leaderboard-row--outside { margin-top: 0.15rem; border-style: dashed; }
.leaderboard-table { display: grid; gap: 0.4rem; }
.leaderboard-table__head { display: none; }
.leaderboard-row { position: relative; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; align-items: center; gap: 0.65rem; min-width: 0; padding: 0.8rem; border: 1px solid transparent; border-radius: 13px; background: #fafafd; }
.leaderboard-row.is-current-user { border-color: #cfc6ff; background: #f5f2ff; box-shadow: inset 3px 0 0 var(--primary); }
.leaderboard-rank { display: grid; width: 2.25rem; height: 2.25rem; place-items: center; border-radius: 10px; color: var(--text-secondary); background: #efeff4; font-variant-numeric: tabular-nums; }
.leaderboard-row.is-top-1 .leaderboard-rank { color: #7b5500; background: #fff0bd; }
.leaderboard-row.is-top-2 .leaderboard-rank { color: #555a66; background: #e8ebf0; }
.leaderboard-row.is-top-3 .leaderboard-rank { color: #774222; background: #f4d8c5; }
.leaderboard-user { display: flex; min-width: 0; align-items: center; gap: 0.55rem; }
.leaderboard-avatar { position: relative; display: grid; width: 2.35rem; height: 2.35rem; overflow: hidden; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--primary-dark); background: #ebe7ff; font-weight: 800; }
.leaderboard-user > div { display: grid; min-width: 0; }
.leaderboard-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.87rem; }
.leaderboard-user small { width: max-content; color: var(--primary); font-size: 0.65rem; font-weight: 800; }
.leaderboard-score { display: grid; justify-items: end; }
.leaderboard-score strong { color: var(--primary-dark); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.leaderboard-score small, .leaderboard-answers small, .leaderboard-average small { color: var(--text-secondary); font-size: 0.62rem; }
.leaderboard-answers, .leaderboard-average { display: none; }
.leaderboard-empty { display: grid; min-height: 20rem; place-content: center; justify-items: center; padding: 2rem 1rem; text-align: center; }
.leaderboard-empty > span { display: grid; width: 3.25rem; height: 3.25rem; margin-bottom: 0.8rem; place-items: center; border-radius: 14px; color: var(--primary-dark); background: #efecff; font-size: 1.45rem; font-weight: 800; }
.leaderboard-empty h2 { margin-bottom: 0.35rem; font-size: 1.05rem; }
.leaderboard-empty p { margin: 0; color: var(--text-secondary); font-size: 0.82rem; }
.leaderboard-context { min-width: 0; }
.personal-rank { padding: 1rem; }
.personal-rank h2 { margin-bottom: 0.4rem; font-size: 1rem; }
.personal-rank > p { color: var(--text-secondary); font-size: 0.78rem; }
.personal-rank__position { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.8rem; padding: 0.8rem; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.personal-rank__position span { font-size: 0.75rem; }
.personal-rank__position strong { font-size: 2rem; line-height: 1; }
.personal-rank dl { margin: 0; }
.personal-rank dl div { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.personal-rank dl div:last-child { border-bottom: 0; }
.personal-rank dt { color: var(--text-secondary); font-size: 0.72rem; }
.personal-rank dd { margin: 0; font-size: 0.82rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.share-rank-trigger { display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; gap: .45rem; margin-top: .85rem; transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease; }
.share-rank-trigger svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.share-rank-modal { position: fixed; z-index: 140; inset: 0; display: grid; padding: 1.25rem; place-items: center; visibility: hidden; opacity: 0; pointer-events: none; transition: visibility 0s linear 280ms, opacity 260ms ease; }
.share-rank-modal.is-open { visibility: visible; opacity: 1; pointer-events: auto; transition-delay: 0s; }
.share-rank-modal__backdrop { position: absolute; inset: 0; background: rgba(20,16,47,.62); opacity: 0; backdrop-filter: blur(3px); transition: opacity 260ms ease, backdrop-filter 260ms ease; }
.share-rank-modal.is-open .share-rank-modal__backdrop { opacity: 1; }
.share-rank-modal__dialog { position: relative; display: grid; width: min(100%,34rem); max-height: min(94vh,54rem); overflow: hidden; padding: 1rem; border: 1px solid rgba(225,219,247,.95); border-radius: 24px; background: #fff; box-shadow: 0 28px 80px rgba(20,14,54,.28); opacity: 0; transform: translateY(14px) scale(.985); transition: opacity 240ms ease, transform 280ms cubic-bezier(.2,.75,.25,1); }
.share-rank-modal.is-open .share-rank-modal__dialog { opacity: 1; transform: translateY(0) scale(1); }
.share-rank-modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .1rem .15rem .8rem; }
.share-rank-modal__header .eyebrow { margin-bottom: .1rem; }
.share-rank-modal__header h2 { margin: 0 0 .1rem; font-size: 1.12rem; }
.share-rank-modal__header p { margin: 0; color: var(--text-secondary); font-size: .72rem; }
.share-rank-modal__close { display: grid; width: 2.35rem; height: 2.35rem; flex: 0 0 auto; place-items: center; border: 0; border-radius: 10px; color: var(--text-secondary); background: #f6f4fb; cursor: pointer; transition: color 200ms ease, background-color 200ms ease, transform 200ms ease; }
.share-rank-modal__close:hover { color: var(--primary-dark); background: #eeeaff; transform: rotate(-3deg); }
.share-rank-modal__close svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.share-rank-preview { position: relative; display: grid; min-height: 24rem; overflow: auto; place-items: center; border: 1px solid #e9e5f6; border-radius: 18px; background: #f5f4f9; overscroll-behavior: contain; }
.share-rank-preview canvas { display: block; width: min(100%,20rem); height: auto; margin: .75rem; border-radius: 16px; box-shadow: 0 14px 38px rgba(31,22,70,.16); opacity: 0; transform: translateY(7px); transition: opacity 250ms ease, transform 280ms ease; }
.share-rank-preview canvas.is-ready { opacity: 1; transform: translateY(0); }
.share-rank-loading { position: absolute; z-index: 1; inset: 0; display: grid; place-content: center; justify-items: center; gap: .65rem; color: var(--text-secondary); font-size: .78rem; }
.share-rank-loading[hidden] { display: none; }
.share-rank-loading span { width: 2rem; height: 2rem; border: 3px solid #dcd6f5; border-top-color: var(--primary); border-radius: 50%; animation: share-rank-spin .8s linear infinite; }
@keyframes share-rank-spin { to { transform: rotate(360deg); } }
.share-rank-modal__actions { display: flex; justify-content: center; gap: .65rem; padding: .85rem .1rem .05rem; }
.share-rank-modal__actions .button { min-width: 9rem; transition: opacity 200ms ease, color 200ms ease, background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease; }
.share-rank-toast[aria-hidden="true"] { pointer-events: none; }

.question-card { padding: 0 1rem 1rem; }
.question-card::before { display: none; }
.question-hero { position: relative; overflow: hidden; margin: 0 -1rem 1rem; padding: 1rem 1rem 1.05rem; border-bottom: 1px solid #e7e2f7; background: linear-gradient(145deg, #fbfaff, #f2efff); isolation: isolate; }
.question-hero::before, .question-hero::after { position: absolute; z-index: -1; border-radius: 50%; content: ""; }
.question-hero::before { width: 8rem; height: 8rem; top: -5rem; left: 14%; border: 1px solid rgba(109, 74, 255, 0.09); box-shadow: 0 0 0 1.4rem rgba(109, 74, 255, 0.025); }
.question-hero::after { width: 5rem; height: 5rem; right: -2rem; bottom: -3.4rem; background: rgba(109, 74, 255, 0.045); }
.question-hero__decoration { position: absolute; z-index: -1; left: 0.6rem; bottom: -2.8rem; color: rgba(109, 74, 255, 0.07); font-family: Tahoma, sans-serif; font-size: 9rem; font-weight: 800; line-height: 1; transform: rotate(-8deg); }
.question-hero__status { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.55rem; }
.question-hero__status .eyebrow { margin: 0; }
.question-hero h1 { max-width: 720px; margin-bottom: 0.4rem; font-size: 1.22rem; line-height: 1.6; }
.question-hero > p { margin: 0; color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; }
.live-badge b { font: inherit; }
.mobile-countdown-separator, .mobile-countdown { color: inherit; font-size: 0.72rem; }
.mobile-countdown { direction: ltr; font-variant-numeric: tabular-nums; }
.mobile-countdown.is-expired { direction: rtl; }
.live-badge.is-expired { color: #7a4c12; background: #fff4dc; }
.live-badge.is-expired > span:first-child { background: var(--warning); box-shadow: 0 0 0 4px rgba(218, 143, 28, 0.12); }
.option-grid--preview { margin-bottom: 1rem; }
.option-choice { min-height: 6.6rem; padding: 0.9rem 1rem; gap: 1rem; }
.option-choice__copy { display: flex; min-width: 0; align-items: center; gap: 0.65rem; }
.option-choice__copy strong { overflow-wrap: anywhere; font-size: 1rem; }
.option-choice__key { width: 2.7rem; height: 2.7rem; font-size: 0.95rem; }
.option-choice__image { width: 7.2rem; height: 5rem; margin-right: auto; flex: 0 0 auto; object-fit: contain; border-radius: 13px; }
.option-choice__check { position: absolute; top: 0.55rem; left: 0.55rem; margin: 0; background: #fff; }
.option-grid--preview .option-choice { cursor: default; }
.option-grid--preview .option-choice:hover { border-color: var(--border); transform: none; }
.prediction-control { border: 1px solid #e9e5f6; background: #f8f6ff; }
.prediction-control__heading div span b { color: var(--primary-dark); }
.percentage-slider:disabled { opacity: .42; cursor: not-allowed; filter: grayscale(.25); }
.prediction-helper { display: block; margin-top: .35rem; color: #766f88; font-size: .72rem; transition: color .2s ease; }
.prediction-helper.is-ready { color: var(--primary-dark); }
.live-indicator { position: relative; display: inline-block; width: .48rem; height: .48rem; margin-inline-start: .28rem; border-radius: 50%; background: var(--success); vertical-align: middle; }
.live-indicator::after { position: absolute; inset: -.22rem; border: 1px solid rgba(21,150,106,.42); border-radius: inherit; content: ""; animation: live-pulse 1.8s ease-out infinite; }
.live-indicator[hidden] { display: none; }
@keyframes live-pulse { 0% { opacity: .7; transform: scale(.65); } 70%,100% { opacity: 0; transform: scale(1.55); } }
.score-ring { --score: 0; position: relative; display: grid; width: 10.25rem; height: 10.25rem; margin: 0 auto 1.35rem; padding: 0.58rem; place-items: center; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--score) * 1%), #ebe8f4 0); box-shadow: 0 10px 28px rgba(62, 43, 138, 0.12); animation: score-enter 360ms ease-out both; }
.score-ring::after { position: absolute; inset: 0.58rem; border-radius: 50%; background: var(--surface); content: ""; box-shadow: inset 0 0 0 1px rgba(109, 74, 255, 0.06); }
.score-ring > div { position: relative; z-index: 1; display: grid; justify-items: center; }
.score-ring strong { color: var(--text-primary); font-size: 2.8rem; line-height: 1; direction: ltr; font-variant-numeric: tabular-nums; }
.score-ring span { margin-top: 0.28rem; color: var(--primary-dark); font-size: 0.8rem; font-weight: 800; }
.score-ring small { color: var(--text-secondary); font-size: 0.65rem; }
.result-topline { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.result-topline p { margin: 0; color: var(--text-secondary); font-size: 0.72rem; }
.distribution__label strong { display: flex; align-items: center; gap: 0.35rem; }
.distribution__label strong img { width: 2.6rem; height: 2rem; object-fit: contain; border-radius: 7px; }

@keyframes score-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 640px) {
  .auth-content { padding: 2rem; }
  .auth-card { padding: 2rem; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-card { padding: 1.75rem; }
  .question-hero { margin: -1.75rem -1.75rem 1.35rem; padding: 1.3rem 1.75rem 1.35rem; }
  .question-hero h1 { font-size: 1.4rem; line-height: 1.55; }
  .result-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .submission-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 899px) {
  .leaderboard-board { padding: .4rem; }
  .leaderboard-podium { gap: .45rem; padding: .2rem 0 .75rem; }
  .podium-card { padding: .65rem .4rem; }
  .podium-card--1 { display: grid; width: 100%; min-height: 7rem; grid-template-columns: 3.75rem 2.7rem minmax(0,1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: .55rem; padding: .75rem; text-align: start; }
  .podium-card--1 .podium-trophy { grid-column: 1; grid-row: 1 / 3; width: 3.75rem; height: 3.75rem; margin: 0; }
  .podium-card--1 .leaderboard-avatar { grid-column: 2; grid-row: 1 / 3; width: 2.6rem; height: 2.6rem; margin: 0; font-size: .95rem; }
  .podium-card--1 .podium-rank { grid-column: 3; grid-row: 1; align-self: end; }
  .podium-card--1 .podium-name { grid-column: 3; grid-row: 2; align-self: start; font-size: .86rem; }
  .podium-card--1 .podium-you { position: absolute; inset-block-start: .45rem; inset-inline-end: .5rem; }
  .podium-card--1 .podium-score { grid-column: 4; grid-row: 1; align-self: end; margin: 0; font-size: 1.2rem; }
  .podium-card--1 .podium-meta { grid-column: 4; grid-row: 2; align-self: start; white-space: nowrap; }
  .podium-card--2, .podium-card--3 { min-height: 8.5rem; }
  .podium-card--2 .podium-trophy, .podium-card--3 .podium-trophy { width: 2.75rem; height: 2.75rem; margin: -.1rem auto .15rem; }
  .podium-card--2 .leaderboard-avatar, .podium-card--3 .leaderboard-avatar { width: 2.05rem; height: 2.05rem; margin: .2rem 0; font-size: .75rem; }
  .podium-card--2 .podium-score, .podium-card--3 .podium-score { margin-top: .15rem; font-size: 1rem; }
}

@media (max-width: 639px) {
  .app-main { padding-top: 1rem; }
  .leaderboard-heading { margin-bottom: .4rem; }
  .leaderboard-heading h1 { font-size: 1.35rem; }
  .leaderboard-heading p { font-size: .72rem; }
  .leaderboard-podium { grid-template-columns: minmax(0,1fr); }
  .podium-card--1, .podium-card--2, .podium-card--3 { display: grid; width: 100%; min-height: 6.5rem; grid-column: 1; grid-template-columns: 3.35rem 2.5rem minmax(0,1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: .5rem; margin: 0; padding: .65rem .7rem; text-align: start; }
  .podium-card--1 { grid-row: 1; }
  .podium-card--2 { grid-row: 2; }
  .podium-card--3 { grid-row: 3; }
  .podium-card--1 .podium-trophy, .podium-card--2 .podium-trophy, .podium-card--3 .podium-trophy { grid-column: 1; grid-row: 1 / 3; width: 3.25rem; height: 3.25rem; margin: 0; }
  .podium-card--1 .leaderboard-avatar, .podium-card--2 .leaderboard-avatar, .podium-card--3 .leaderboard-avatar { grid-column: 2; grid-row: 1 / 3; width: 2.35rem; height: 2.35rem; margin: 0; font-size: .82rem; }
  .podium-card .podium-rank { grid-column: 3; grid-row: 1; align-self: end; }
  .podium-card .podium-name { grid-column: 3; grid-row: 2; align-self: start; font-size: .8rem; }
  .podium-card .podium-you { position: absolute; inset-block-start: .35rem; inset-inline-end: .45rem; }
  .podium-card--1 .podium-score, .podium-card--2 .podium-score, .podium-card--3 .podium-score { grid-column: 4; grid-row: 1; align-self: end; margin: 0; font-size: 1.05rem; }
  .podium-card .podium-meta { grid-column: 4; grid-row: 2; align-self: start; white-space: nowrap; }
  .history-heading { margin-bottom: .5rem; }
  .history-heading h1 { font-size: 1.3rem; }
  .history-heading p { font-size: .7rem; }
  .history-filters { overflow-x: auto; margin-bottom: .65rem; }
  .history-filter { min-width: max-content; flex: 1; }
  .history-item__summary { position: relative; grid-template-columns: minmax(0,1fr) 4.5rem; gap: .7rem; padding: .8rem 2.5rem .8rem .8rem; }
  .history-item__main { grid-column: 1 / -1; }
  .history-item h2 { font-size: .85rem; white-space: normal; }
  .history-comparison { grid-column: 1; grid-row: 2; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .history-comparison div { min-width: 0; padding: .42rem .25rem; }
  .history-score { grid-column: 2; grid-row: 2; min-height: 3.7rem; }
  .history-score strong { font-size: 1.3rem; }
  .history-item__chevron { position: absolute; inset-block-start: .72rem; inset-inline-end: .65rem; }
  .history-item__details-inner { grid-template-columns: 1fr; gap: .9rem; padding-inline: .85rem; }
  .history-item.is-expanded .history-item__details-inner { padding: .9rem .85rem 1rem; }
  .history-item__details h3 { margin-bottom: .6rem; }
  .history-results, .history-results:only-child { padding-inline-end: 0; }
  .history-result-row + .history-result-row { margin-top: .7rem; }
  .history-result-track { height: .45rem; }
  .history-answer-time { padding: .75rem 0 0; border-inline-start: 0; border-top: 1px solid var(--border); }
  .history-answer-time h3 { display: inline; margin-inline-end: .35rem; }
  .history-answer-time time { display: inline-flex; align-items: baseline; gap: .45rem; }
  .history-answer-time strong { font-size: .82rem; }
  .history-answer-time span { font-size: .65rem; }
  .history-pending-note { line-height: 1.65; }
  .history-pagination { gap: .35rem; }
  .history-pagination a, .history-pagination span { padding-inline: .48rem; }
  .submission-heading { margin-bottom: .55rem; }
  .submission-heading h1 { font-size: 1.3rem; }
  .submission-card { padding: .9rem; }
  .submission-success { min-height: 16rem; }
  .submission-success__actions { width: 100%; }
  .submission-success__actions .button { width: 100%; }
  .result-suggestion { align-items: flex-start; flex-wrap: wrap; }
  .result-suggestion > div { flex: 1; }
  .result-suggestion .button { width: 100%; margin: .15rem 0 0; }
  .post-answer-ad { margin-bottom: calc(5rem + env(safe-area-inset-bottom)); scroll-margin-top: 1rem; }
  .sponsored-card { grid-template-columns: minmax(0,1fr); }
  .sponsored-card__image-wrap { min-height: 0; aspect-ratio: 16/7; }
  .sponsored-card__content { padding: .85rem; }
  .sponsored-card__cta { width: 100%; }
  .home-page { gap: 1rem; }
  .home-hero { min-height: auto; grid-template-columns: minmax(0,1fr); gap: .3rem; padding: 1.25rem 1.1rem .25rem; border-radius: 1.15rem; }
  .home-hero h1 { margin-bottom: .45rem; font-size: 1.85rem; }
  .home-hero p { font-size: .76rem; line-height: 1.85; }
  .home-hero__actions { width: 100%; }
  .home-hero__actions .button { flex: 1; }
  .home-hero__visual { grid-row: 2; height: 12.5rem; margin-top: -.2rem; }
  .home-today { grid-template-columns: 3rem minmax(0,1fr); gap: .75rem; padding: .9rem; }
  .home-today__icon { width: 3rem; height: 3rem; border-radius: 12px; }
  .home-today h2 { font-size: .9rem; }
  .home-today p { font-size: .68rem; }
  .home-today__action { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .home-steps { grid-template-columns: minmax(0,1fr); gap: .4rem; }
  .home-steps::before { top: 1.5rem; right: 1.9rem; bottom: 1.5rem; left: auto; width: 1px; height: auto; }
  .home-step { min-height: 3.65rem; grid-template-columns: auto 2.5rem minmax(0,1fr); padding: .5rem .6rem; }
  .home-step__icon { width: 2.5rem; height: 2.5rem; }
  .home-why > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-why span { display: grid; min-height: 2.4rem; place-items: center; padding: .35rem .45rem; border-radius: 10px; text-align: center; }
  .home-why span:last-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .history-item,
  .history-item__details,
  .history-item__details-inner,
  .history-item__chevron,
  .history-result-track > span { transition: none !important; }
}

@media (min-width: 900px) {
  .auth-shell { grid-template-columns: minmax(390px, 0.85fr) minmax(540px, 1.15fr); }
  .auth-brand-panel {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    color: #fff;
    background: #241852;
  }
  .auth-brand-panel::after { position: absolute; width: 24rem; height: 24rem; bottom: -9rem; left: -8rem; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; content: ""; box-shadow: 0 0 0 4rem rgba(255,255,255,.025), 0 0 0 8rem rgba(255,255,255,.018); }
  .auth-brand-panel__content { position: relative; z-index: 1; max-width: 470px; }
  .auth-brand-panel__content h1 { margin-bottom: 1rem; font-size: clamp(2.2rem, 4vw, 3.4rem); }
  .auth-brand-panel__content p { color: #c9c2e8; font-size: 1.05rem; }
  .brand-meter { position: relative; z-index: 1; display: flex; gap: 0.45rem; }
  .brand-meter span { width: 2.2rem; height: 0.35rem; border-radius: 99px; background: rgba(255,255,255,.22); }
  .brand-meter span:first-child { width: 5rem; background: linear-gradient(90deg, #a98dff, #fff); }
  .auth-mobile-brand { display: none; }
  .desktop-nav { display: flex; align-items: center; gap: 0.25rem; }
  .nav-item { padding: 0.55rem 0.9rem; border-radius: 10px; color: var(--text-secondary); font-size: 0.88rem; font-weight: 600; }
  .nav-item.is-active { color: var(--primary-dark); background: #f0edff; }
  .mobile-nav { display: none; }
  .player-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
  .player-sidebar { position: sticky; top: 0; display: flex; height: 100vh; min-height: 620px; flex-direction: column; padding: 1.5rem 1rem 1rem; border-left: 1px solid var(--border); background: #fff; }
  .sidebar-brand { padding: 0 0.55rem 1.5rem; }
  .sidebar-nav { display: grid; gap: 0.3rem; }
  .sidebar-nav__item { display: grid; grid-template-columns: 2.15rem 1fr auto; min-height: 3rem; align-items: center; gap: 0.55rem; padding: 0.45rem 0.55rem; border-radius: 12px; color: var(--text-secondary); font-size: 0.86rem; font-weight: 650; }
  .sidebar-nav__item:hover { color: var(--text-primary); background: #f7f6fa; }
  .sidebar-nav__item.is-active { color: var(--primary-dark); background: #f0edff; }
  .sidebar-nav__item.is-disabled:hover { color: var(--text-secondary); background: transparent; }
  .sidebar-nav__item small { font-size: 0.58rem; font-weight: 600; }
  .sidebar-nav__icon { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 9px; color: #797589; background: #f4f3f7; font-family: Tahoma, sans-serif; font-weight: 800; }
  .sidebar-nav__item.is-active .sidebar-nav__icon { color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }
  .sidebar-account { margin-top: auto; padding: 0.9rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fafafd; }
  .sidebar-account > p { margin-bottom: 0.75rem; color: var(--text-secondary); font-size: 0.73rem; }
  .sidebar-logout { margin: auto 0 0; }
  .sidebar-logout__button { display: grid; width: 100%; min-height: 3rem; grid-template-columns: 2.15rem 1fr; align-items: center; gap: .55rem; padding: .45rem .55rem; border: 0; border-radius: 12px; color: var(--text-secondary); background: transparent; font: inherit; font-size: .82rem; font-weight: 500; text-align: start; cursor: pointer; transition: color 180ms ease, background 180ms ease; }
  .sidebar-logout__button:hover { color: #a4333f; background: #fff0f1; }
  .sidebar-logout__button .sidebar-nav__icon { transition: color 180ms ease, background 180ms ease; }
  .sidebar-logout__button:hover .sidebar-nav__icon { color: #a4333f; background: #ffe3e6; }
  .workspace-utility { position: relative; min-height: 3.6rem; padding: 0 1.5rem; background: rgba(255,255,255,.7); }
  .workspace-header-actions { margin-inline-start: 0; margin-inline-end: auto; }
  .workspace-mobile-brand, .mobile-logout { display: none; }
  .mobile-header-logout { display: none; }
  .header-user-link strong { display: block; }
  .workspace-utility__label { display: flex; align-items: center; gap: 0.45rem; }
  .app-main { padding: 2.25rem 0; }
  .profile-grid { grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.7fr); gap: 1.5rem; }
  .game-layout { grid-template-columns: minmax(0, 1fr) 220px; align-items: start; gap: 1.25rem; }
  .context-card--question { display: flex; }
  .question-hero h1 { font-size: 1.45rem; }
  .mobile-countdown-separator, .mobile-countdown { display: none; }
  .option-choice { min-height: 8rem; padding: 1.15rem 1.2rem; }
  .option-choice__copy { gap: 0.8rem; }
  .option-choice__copy strong { font-size: 1.08rem; }
  .option-choice__key { width: 3rem; height: 3rem; border-radius: 12px; font-size: 1.05rem; }
  .option-choice__image { width: 8.5rem; height: 6.2rem; }
  .leaderboard-heading, .period-tabs, .leaderboard-status, .leaderboard-layout { width: min(100%, 980px); margin-inline: auto; }
  .period-tabs { margin-bottom: 0.8rem; }
  .leaderboard-status { margin-bottom: 1rem; }
  .leaderboard-layout { grid-template-columns: minmax(0, 1fr) 220px; align-items: start; gap: 1.25rem; }
  .leaderboard-board { padding: 0.7rem; }
  .profile-hero, .profile-performance, .profile-dashboard-grid { width: min(100%,980px); }
  .profile-referral-grid { grid-template-areas: "invite referrals"; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; }
  .direct-referrals { grid-area: referrals; }
  .profile-referral-card { grid-area: invite; }
  .profile-hero { padding: 1.5rem 1.7rem; }
  .profile-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .profile-dashboard-grid { grid-template-columns: minmax(220px,.72fr) minmax(0,1.55fr); align-items: start; }
  .leaderboard-podium { grid-template-columns: repeat(3,minmax(0,1fr)); align-items: end; gap: 0.8rem; padding: 0.5rem 0.7rem 1.3rem; }
  .podium-card--2 { grid-column: 3; grid-row: 1; min-height: 12rem; margin-inline: .45rem; }
  .podium-card--1 { grid-column: 2; grid-row: 1; width: auto; min-height: 15rem; padding-top: 1.1rem; justify-self: stretch; }
  .podium-card--3 { grid-column: 1; grid-row: 1; min-height: 11.5rem; margin-inline: .45rem; }
  .leaderboard-table__head, .leaderboard-row { display: grid; grid-template-columns: 4rem minmax(170px, 1.5fr) minmax(90px, .8fr) minmax(110px, .9fr) minmax(100px, .8fr); gap: 0.65rem; }
  .leaderboard-table__head { padding: 0.55rem 0.8rem; color: var(--text-secondary); font-size: 0.68rem; font-weight: 700; }
  .leaderboard-row { min-height: 4.3rem; padding: 0.65rem 0.8rem; }
  .leaderboard-rank { justify-self: start; }
  .leaderboard-score, .leaderboard-answers, .leaderboard-average { display: grid; justify-items: start; }
  .leaderboard-score strong, .leaderboard-answers strong, .leaderboard-average strong { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
  .leaderboard-score small, .leaderboard-answers small, .leaderboard-average small { display: none; }
}

@media (max-width: 420px) {
  .container { width: min(100% - 1.25rem, 1120px); }
  .app-header__inner { min-height: 4rem; }
  .brand { font-size: 1.05rem; }
  .brand__mark { width: 2.15rem; height: 2.15rem; }
  .header-user .avatar { display: none; }
  .header-register { display: none; }
  .mobile-nav { padding-inline: .25rem; }
  .mobile-nav__item { font-size: .59rem; }
  .nav-symbol svg { width: 1.1rem; height: 1.1rem; }
  .notification-popover { inset-inline-start: auto; inset-inline-end: -2.9rem; width: calc(100vw - 1.5rem); max-width: 21rem; }
  .profile-hero { min-height: auto; padding: 1rem; }
  .avatar--profile { width: 4rem; height: 4rem; border-width: 3px; font-size: 1.35rem; }
  .avatar-modal { align-items: end; padding: .5rem 0 0; }
  .avatar-modal__dialog { width: 100%; max-height: 86vh; padding: 1rem .8rem calc(1rem + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; transform: translateY(1.5rem); }
  .avatar-modal__header { margin-bottom: .9rem; padding-inline: .15rem; }
  .avatar-modal__header h2 { font-size: 1.1rem; }
  .avatar-picker { grid-template-columns: repeat(5,minmax(0,1fr)); gap: .65rem .5rem; }
  .avatar-choice__preview { width: min(100%,3.8rem); }
  .avatar-modal__actions { position: sticky; bottom: -.9rem; margin: 1rem -.1rem 0; padding: .8rem .1rem .1rem; background: linear-gradient(0deg,#fff 75%,rgba(255,255,255,0)); }
  .avatar-modal__actions .button { flex: 1; }
  .app-toast { top: .75rem; left: .75rem; width: calc(100vw - 1.5rem); }
  .profile-referral-card { padding: .9rem; }
  .direct-referrals { padding: .7rem .8rem; }
  .referral-list-modal { align-items: end; padding: .5rem 0 0; }
  .referral-list-modal__dialog { width: 100%; max-height: 82vh; border-radius: 22px 22px 0 0; transform: translateY(1.5rem); }
  .referral-list-modal__body { max-height: 58vh; padding-bottom: calc(.5rem + env(safe-area-inset-bottom)); }
  .profile-hero__identity-wrap { gap: .7rem; }
  .profile-hero__identity h1 { font-size: 1.2rem; }
  .profile-hero__motif { width: 4.5rem; height: 4.5rem; }
  .profile-hero__percent { width: 3.6rem; height: 3.6rem; font-size: 1.5rem; }
  .profile-hero__bar { display: none; }
  .metric-card { padding: .75rem; }
  .metric-card__icon { width: 1.75rem; height: 1.75rem; margin-bottom: .45rem; }
  .metric-card strong { font-size: 1.35rem; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .auth-content { padding-inline: 0.65rem; }
  .auth-card { padding: 1.15rem; border-radius: 20px; }
  .empty-state { align-items: flex-start; }
  .error-page { min-height: calc(100vh - 10rem); padding-block: 0.75rem 1.5rem; }
  .error-card { padding: 1.6rem 1rem; border-radius: 20px; }
  .error-card__icon { width: 3.4rem; height: 3.4rem; margin-bottom: 1rem; border-radius: 1rem; }
  .error-card__copy h1 { font-size: 1.4rem; }
  .error-card__copy p { margin-bottom: 1.25rem; font-size: 0.84rem; line-height: 1.9; }
  .tracking-panel { padding: 0.85rem; }
  .tracking-panel__code { font-size: 0.76rem; }
  .error-card__home { width: 100%; margin-top: 1.25rem; }
  .game-heading { align-items: flex-start; flex-direction: column; }
  .question-card { border-radius: 20px; }
  .prediction-control__heading { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .app-toast__progress { animation: none !important; }
  .share-rank-loading span { animation: none !important; }
  .post-answer-ad { animation: none !important; }
  .home-hero__lottie { display: none !important; }
  .home-hero__fallback { display: block !important; }
  .live-indicator::after { display: none; animation: none; }
}

@media (max-width: 639px) {
  .share-rank-modal { align-items: end; padding: .5rem 0 0; }
  .share-rank-modal__dialog { width: 100%; max-height: 91vh; padding: .8rem .75rem calc(.8rem + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; transform: translateY(1.5rem); }
  .share-rank-modal__header { padding-inline: .1rem; }
  .share-rank-modal__header p { font-size: .67rem; }
  .share-rank-preview { min-height: 0; }
  .share-rank-preview canvas { width: min(72vw,17.5rem); margin: .55rem; }
  .share-rank-modal__actions { gap: .45rem; padding-top: .7rem; }
  .share-rank-modal__actions .button { min-width: 0; flex: 1; padding-inline: .55rem; }
}
