:root {
  color-scheme: light;
  --ink: #14212b;
  --muted: #637280;
  --line: #dce3e8;
  --paper: #f3f6f7;
  --panel: #ffffff;
  --navy: #18283a;
  --teal: #0c7c74;
  --gold: #d99b2b;
  --red: #b43b4f;
  --green: #16825d;
  --blue: #2f6f9f;
  --violet: #6f5aa6;
  --shadow: 0 18px 48px rgba(26, 42, 57, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(12, 124, 116, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(217, 155, 43, 0.1), transparent 32%),
    var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

button:disabled {
  cursor: default;
}

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

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  min-height: 100vh;
  padding: 18px 18px 96px;
}

.app-shell.ranked-mode {
  background:
    radial-gradient(circle at 18% 0%, rgba(12, 124, 116, 0.16), transparent 30%),
    linear-gradient(180deg, #111b24, #15202a 52%, #18222b);
  color: #edf4f7;
}

.app-shell.ranked-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 0%, rgba(12, 124, 116, 0.16), transparent 30%),
    linear-gradient(180deg, #111b24, #15202a 52%, #18222b);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(12, 124, 116, 0.1), transparent 34%),
    linear-gradient(315deg, rgba(217, 155, 43, 0.12), transparent 30%),
    var(--paper);
}

.auth-shell.ranked-mode {
  background:
    radial-gradient(circle at 18% 0%, rgba(12, 124, 116, 0.18), transparent 32%),
    linear-gradient(180deg, #101922, #17212b);
  color: #edf4f7;
}

.auth-card {
  display: grid;
  gap: 22px;
  width: min(430px, 100%);
  border: 1px solid rgba(220, 227, 232, 0.95);
  border-radius: 10px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.auth-shell.ranked-mode .auth-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(21, 32, 42, 0.96);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.28);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-weight: 950;
}

.auth-brand strong,
.auth-copy h1 {
  display: block;
  color: var(--ink);
}

.auth-shell.ranked-mode .auth-brand strong,
.auth-shell.ranked-mode .auth-copy h1 {
  color: #f6fbfd;
}

.auth-brand small,
.auth-copy p,
.auth-form span {
  color: var(--muted);
  font-weight: 800;
}

.auth-shell.ranked-mode .auth-brand small,
.auth-shell.ranked-mode .auth-copy p,
.auth-shell.ranked-mode .auth-form span {
  color: #aebdca;
}

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

.auth-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 0.95;
}

.auth-copy p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.3;
}

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

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: #edf4f6;
}

.auth-switch button {
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-switch button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(36, 54, 69, 0.12);
}

.auth-shell.ranked-mode .auth-switch {
  background: rgba(255, 255, 255, 0.08);
}

.auth-shell.ranked-mode .auth-switch button {
  color: rgba(246, 251, 253, 0.72);
}

.auth-shell.ranked-mode .auth-switch button.active {
  background: rgba(255, 255, 255, 0.14);
  color: #f6fbfd;
}

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

.auth-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #dce5ea;
  border-radius: 8px;
  padding: 0 14px;
  background: #f8fbfc;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.auth-form input:focus,
.auth-form input:focus-visible,
.account-form input:focus,
.dev-username-form input:focus,
.dev-question-form input:focus,
.dev-question-form select:focus,
.dev-question-form textarea:focus,
.dev-email-form input:focus {
  border-color: #2f6f9f;
  outline: 3px solid rgba(47, 111, 159, 0.18);
  outline-offset: 0;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(47, 111, 159, 0.12);
}

.password-hint {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.25;
}

.auth-shell.ranked-mode .auth-form input {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #f6fbfd;
}

.auth-shell.ranked-mode .auth-form input:focus,
.auth-shell.ranked-mode .auth-form input:focus-visible,
.app-shell.ranked-mode .account-form input:focus,
.app-shell.ranked-mode .dev-username-form input:focus,
.app-shell.ranked-mode .dev-question-form input:focus,
.app-shell.ranked-mode .dev-question-form select:focus,
.app-shell.ranked-mode .dev-question-form textarea:focus,
.app-shell.ranked-mode .dev-email-form input:focus {
  border-color: #7fb7dc;
  outline-color: rgba(127, 183, 220, 0.24);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(127, 183, 220, 0.16);
}

.auth-shell.ranked-mode .password-hint {
  color: #9fb0bd;
}

.auth-form button {
  min-height: 52px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 950;
}

.auth-form button:disabled {
  opacity: 0.6;
}

.auth-form .auth-link {
  min-height: 36px;
  background: transparent;
  color: var(--teal);
}

.auth-message,
.auth-error,
.auth-dev-code {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 850;
}

.auth-message {
  background: #e9f6f3;
  color: #0b5f58;
}

.auth-error {
  background: #f9e8eb;
  color: #9b2c40;
}

.auth-dev-code {
  background: #fff6df;
  color: #78520a;
}

.auth-dev-code strong {
  letter-spacing: 3px;
}

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 0;
}

.player-zone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-card,
.avatar-button {
  padding: 0;
  background: transparent;
  text-align: left;
}

.avatar-button {
  flex: 0 0 auto;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-weight: 900;
}

.photo-avatar {
  overflow: hidden;
  padding: 0;
}

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

.avatar-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(430px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 54px rgba(26, 42, 57, 0.18);
}

.avatar-menu button,
.avatar-photo-option {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 94px;
  border: 1px solid #e0e8ed;
  border-radius: 8px;
  padding: 8px 6px;
  background: #fbfcfd;
  color: #132434;
  text-align: center;
}

.avatar-menu button.active {
  border-color: rgba(12, 124, 116, 0.38);
  background: #e9f6f3;
}

.avatar-menu button span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--navy);
  font-size: 1.15rem;
}

.avatar-photo-option input {
  display: none;
}

.avatar-photo-option {
  cursor: pointer;
}

.avatar-menu button strong,
.avatar-photo-option strong {
  max-width: 100%;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.player-card strong {
  display: block;
  font-size: 1.25rem;
}

.player-card small,
.rank-hero span,
.quiz-status span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.secondary,
.primary,
.ghost-button {
  min-height: 40px;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 900;
}

.mode-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 154px;
  min-height: 38px;
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: #edf2f4;
}

.mode-toggle button {
  position: relative;
  z-index: 1;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.mode-toggle button.active {
  color: var(--ink);
}

.mode-toggle span {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: white;
  box-shadow: 0 8px 18px rgba(25, 40, 58, 0.12);
  transition: transform 160ms ease;
}

.mode-toggle span.ranked {
  transform: translateX(100%);
}

.bottom-nav {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 10;
  display: grid;
  gap: 8px;
  width: min(520px, calc(100vw - 36px));
  margin: 0 auto;
  border: 1px solid rgba(220, 227, 232, 0.92);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(26, 42, 57, 0.16);
}

.bottom-nav.user-nav {
  grid-template-columns: repeat(4, 1fr);
}

.bottom-nav.admin-nav {
  grid-template-columns: repeat(5, 1fr);
}

.bottom-nav button {
  display: grid;
  gap: 3px;
  place-items: center;
  min-height: 48px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.bottom-nav button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #edf2f4;
  color: var(--ink);
  font-size: 0.74rem;
}

.bottom-nav button.active {
  background: #e9f6f3;
  color: #075e58;
}

.bottom-nav button.active span {
  background: var(--teal);
  color: white;
}

.rank-meter {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(237, 244, 247, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.rank-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  box-shadow: 0 0 18px rgba(55, 130, 184, 0.2);
}

.rank-meter.warm span {
  background: linear-gradient(90deg, var(--teal), var(--gold));
  box-shadow: 0 0 22px rgba(217, 155, 43, 0.28);
}

.rank-meter.hot span {
  background: linear-gradient(90deg, var(--gold), #f26d4f);
  box-shadow: 0 0 26px rgba(242, 109, 79, 0.36);
}

.rank-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
}

.main-surface {
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 44px;
  margin-bottom: 12px;
}

.page-header h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3.5vw, 2.7rem);
  line-height: 1;
  letter-spacing: 0;
}

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

.daily-zone {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

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

.daily-zone header span {
  color: var(--ink);
  font-size: clamp(1.7rem, 3.5vw, 2.7rem);
  line-height: 1;
  font-weight: 950;
}

.daily-zone header strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.daily-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.daily-card {
  min-height: 112px;
  border: 1px solid rgba(220, 227, 232, 0.95);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(26, 42, 57, 0.07);
  cursor: pointer;
  text-align: left;
}

.daily-card span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #edf6f4;
  font-size: 1.05rem;
}

.daily-card strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.15;
}

.daily-card:hover {
  transform: translateY(-1px);
}

.daily-card.completed {
  opacity: 0.72;
}

.daily-card.completed span {
  background: #eef1f3;
  filter: grayscale(1);
}

.market-strip {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.market-strip > div {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.market-strip > div::-webkit-scrollbar {
  display: none;
}

.market-strip header {
  color: var(--ink);
  font-size: clamp(1.7rem, 3.5vw, 2.7rem);
  line-height: 1;
  font-weight: 950;
}

.market-strip a {
  flex: 0 0 154px;
  overflow: hidden;
  border: 1px solid rgba(220, 227, 232, 0.95);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(26, 42, 57, 0.06);
  text-decoration: none;
}

.market-ticker-content {
  display: block;
  will-change: transform, opacity;
  animation: market-ticker-in 320ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.market-strip.is-rolling .market-ticker-content {
  animation: market-ticker-out 230ms cubic-bezier(0.56, 0, 0.7, 0.22) both;
}

.market-strip a:nth-child(2) .market-ticker-content {
  animation-delay: 35ms;
}

.market-strip a:nth-child(3) .market-ticker-content {
  animation-delay: 70ms;
}

.market-strip a:nth-child(4) .market-ticker-content {
  animation-delay: 105ms;
}

.market-strip a:nth-child(5) .market-ticker-content {
  animation-delay: 140ms;
}

.market-strip a:nth-child(6) .market-ticker-content {
  animation-delay: 175ms;
}

.market-strip.is-rolling a:nth-child(n) .market-ticker-content {
  animation-delay: 0ms;
}

@keyframes market-ticker-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@keyframes market-ticker-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-18px);
  }
}

.market-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
}

.market-line {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.market-line span {
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.market-change {
  flex: 0 0 auto;
  color: #16825d;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}

.market-change.down {
  color: #b43b4f;
}

.market-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1;
}

.market-strip a.up strong {
  color: #16825d;
}

.market-strip a.down strong {
  color: #b43b4f;
}

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

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 252px;
  border: 1px solid rgba(220, 227, 232, 0.95);
  border-top: 5px solid var(--teal);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.09);
}

.app-shell.ranked-mode .page-header h1,
.app-shell.ranked-mode .player-card strong {
  color: #edf4f7;
}

.app-shell.ranked-mode .player-card small,
.app-shell.ranked-mode .theme-copy small,
.app-shell.ranked-mode .theme-copy em,
.app-shell.ranked-mode .card-stats {
  color: #94a7b3;
}

.app-shell.ranked-mode .category-card {
  border-color: rgba(185, 203, 213, 0.2);
  border-top-color: var(--teal);
  border-top-width: 5px;
  background: rgba(8, 14, 20, 0.9);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.app-shell.ranked-mode .category-card.gold {
  border-top-color: var(--gold);
}

.app-shell.ranked-mode .category-card.red {
  border-top-color: var(--red);
}

.app-shell.ranked-mode .category-card.green {
  border-top-color: var(--green);
}

.app-shell.ranked-mode .category-card.blue {
  border-top-color: var(--blue);
}

.app-shell.ranked-mode .category-card.violet {
  border-top-color: var(--violet);
}

.app-shell.ranked-mode .theme-copy strong {
  color: #edf4f7;
}

.app-shell.ranked-mode .theme-icon {
  background: #edf4f7;
  color: #101820;
}

.app-shell.ranked-mode .daily-zone header span,
.app-shell.ranked-mode .market-strip header,
.app-shell.ranked-mode .daily-card strong,
.app-shell.ranked-mode .market-strip strong {
  color: #edf4f7;
}

.app-shell.ranked-mode .daily-zone header strong,
.app-shell.ranked-mode .market-strip span {
  color: #94a7b3;
}

.app-shell.ranked-mode .daily-card,
.app-shell.ranked-mode .market-strip a {
  border-color: rgba(185, 203, 213, 0.2);
  background: rgba(8, 14, 20, 0.9);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.18);
}

.app-shell.ranked-mode .market-strip a.up strong {
  color: #57d49d;
}

.app-shell.ranked-mode .market-strip a.down strong {
  color: #ff7d91;
}

.app-shell.ranked-mode .market-change.up {
  color: #57d49d;
}

.app-shell.ranked-mode .market-change.down {
  color: #ff7d91;
}

.app-shell.ranked-mode .daily-card span {
  background: #edf4f7;
}

.app-shell.ranked-mode .category-card p {
  color: #94a7b3;
}

.category-card.gold {
  border-top-color: var(--gold);
}

.category-card.red {
  border-top-color: var(--red);
}

.category-card.green {
  border-top-color: var(--green);
}

.category-card.blue {
  border-top-color: var(--blue);
}

.category-card.violet {
  border-top-color: var(--violet);
}

.card-stats,
.question-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.theme-main {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  background: transparent;
  text-align: left;
}

.theme-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-size: 1.35rem;
  font-weight: 900;
}

.theme-copy {
  min-width: 0;
}

.theme-copy small,
.theme-copy em {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.theme-copy strong {
  display: block;
  margin: 4px 0;
  font-size: 1.42rem;
  line-height: 1.08;
}

.category-card h2 {
  margin: 24px 0 10px;
  font-size: 1.45rem;
}

.category-card p {
  min-height: 58px;
  color: var(--muted);
  line-height: 1.45;
}

.promo-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  border: 1px solid rgba(12, 124, 116, 0.18);
  border-radius: 999px;
  padding: 5px 8px;
  background: #e9f6f3;
  color: #075e58;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.lock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(19, 36, 52, 0.1);
  border-radius: 8px;
  background: #fff8e7;
  font-size: 0.92rem;
}

.category-card.locked {
  overflow: hidden;
}

.category-card.locked .theme-main {
  cursor: not-allowed;
}

.category-card.locked .theme-icon,
.category-card.locked .theme-copy,
.category-card.locked p {
  opacity: 0.62;
}

.app-shell.ranked-mode .promo-badge {
  border-color: rgba(237, 244, 247, 0.16);
  background: rgba(237, 244, 247, 0.92);
  color: #101820;
}

.app-shell.ranked-mode .lock-badge {
  border-color: rgba(237, 244, 247, 0.12);
  background: rgba(237, 244, 247, 0.92);
}

.card-stats {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.daily-page-header {
  align-items: center;
}

.back-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 950;
}

.market-board,
.geo-brief {
  display: grid;
  gap: 14px;
}

.market-lead,
.geo-brief article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.08);
}

.article-card {
  overflow: hidden;
  padding: 0;
}

.article-card img {
  display: block;
  width: 100%;
  max-height: 360px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  background: #dfe8eb;
}

.article-card div {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.market-lead span,
.geo-brief article span {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.market-lead strong,
.geo-brief article strong {
  display: block;
  margin: 6px 0 8px;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.05;
}

.market-lead p,
.geo-brief article p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.5;
}

.geo-brief article small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.market-card {
  display: grid;
  gap: 8px;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.08);
}

.market-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.market-card strong {
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.market-card em {
  color: #0c7c74;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 950;
}

.market-card em.down {
  color: var(--red);
}

.market-card a,
.geo-brief a,
.article-open {
  align-self: end;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 950;
  text-decoration: none;
  text-align: left;
}

.geo-brief div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.geo-brief div a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.08);
}

.article-view iframe {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.app-shell.ranked-mode .back-chip,
.app-shell.ranked-mode .market-lead,
.app-shell.ranked-mode .market-card,
.app-shell.ranked-mode .geo-brief article,
.app-shell.ranked-mode .geo-brief div a,
.app-shell.ranked-mode .article-view iframe {
  border-color: rgba(185, 203, 213, 0.2);
  background: rgba(8, 14, 20, 0.9);
  color: #edf4f7;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.18);
}

.app-shell.ranked-mode .market-lead strong,
.app-shell.ranked-mode .market-card strong,
.app-shell.ranked-mode .geo-brief article strong {
  color: #edf4f7;
}

.app-shell.ranked-mode .market-lead p,
.app-shell.ranked-mode .market-card span,
.app-shell.ranked-mode .geo-brief article p,
.app-shell.ranked-mode .geo-brief article small {
  color: #94a7b3;
}

.pill.daily {
  background: #e9f6f3;
  color: #075e58;
}

.daily-finished {
  width: min(560px, 100%);
  margin: 14px auto 0;
  border: 1px solid rgba(12, 124, 116, 0.16);
  border-radius: 8px;
  padding: 18px;
  background: #f2fbf8;
  text-align: center;
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.08);
}

.daily-finished.standalone {
  margin-top: 0;
}

.daily-finished strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
}

.daily-finished p {
  margin: 8px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.app-shell.ranked-mode .daily-finished {
  border-color: rgba(185, 203, 213, 0.2);
  background: rgba(8, 14, 20, 0.9);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.18);
}

.app-shell.ranked-mode .daily-finished strong {
  color: #edf4f7;
}

.app-shell.ranked-mode .daily-finished p {
  color: #94a7b3;
}

.secondary {
  border: 1px solid var(--line);
  background: white;
}

.primary {
  background: var(--navy);
  color: white;
}

.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 16px;
}

.question-board {
  position: relative;
  overflow: hidden;
  min-height: 590px;
  border: 1px solid rgba(220, 227, 232, 0.9);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 50px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.question-board > * {
  position: relative;
}

.app-shell.ranked-mode .question-board,
.app-shell.ranked-mode .quiz-status div {
  border-color: rgba(132, 154, 166, 0.18);
  background: rgba(16, 24, 31, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.app-shell.ranked-mode .question-board h2,
.app-shell.ranked-mode .quiz-status strong,
.app-shell.ranked-mode .question-topline {
  color: #edf4f7;
}

.app-shell.ranked-mode .global-question-number {
  border-color: rgba(55, 130, 184, 0.32);
  background: rgba(55, 130, 184, 0.16);
  color: #b8ddf7;
}

.app-shell.ranked-mode .quiz-header .eyebrow,
.app-shell.ranked-mode .quiz-status span {
  color: #94a7b3;
}

.app-shell.ranked-mode .answer {
  border-color: rgba(132, 154, 166, 0.24);
  background: #151f28;
  color: #edf4f7;
}

.app-shell.ranked-mode .answer-visual {
  border-color: rgba(185, 203, 213, 0.18);
  background: rgba(237, 244, 247, 0.94);
}

.app-shell.ranked-mode .riddle-form input,
.app-shell.ranked-mode .riddle-actions .secondary-riddle,
.app-shell.ranked-mode .riddle-hint,
.app-shell.ranked-mode .riddle-solution {
  border-color: rgba(132, 154, 166, 0.24);
  background: rgba(21, 31, 40, 0.96);
  color: #edf4f7;
}

.app-shell.ranked-mode .riddle-hint strong,
.app-shell.ranked-mode .riddle-title,
.app-shell.ranked-mode .riddle-solution strong {
  color: #edf4f7;
}

.app-shell.ranked-mode .riddle-hint p,
.app-shell.ranked-mode .riddle-solution p,
.app-shell.ranked-mode .riddle-form label,
.app-shell.ranked-mode .riddle-field-grid legend,
.app-shell.ranked-mode .riddle-field-help,
.app-shell.ranked-mode .riddle-prompt p {
  color: #d9e6ec;
}

.app-shell.ranked-mode .riddle-field-grid label span {
  border-color: rgba(237, 244, 247, 0.2);
  background: #edf4f7;
  color: #101820;
}

.app-shell.ranked-mode .answer span {
  background: #edf4f7;
  color: #101820;
}

.app-shell.ranked-mode .bottom-nav {
  border-color: rgba(132, 154, 166, 0.2);
  background: rgba(16, 24, 31, 0.96);
}

.app-shell.ranked-mode .bottom-nav button {
  color: #94a7b3;
}

.app-shell.ranked-mode .bottom-nav button.active {
  background: rgba(12, 124, 116, 0.28);
  color: #edf4f7;
}

.pill {
  border-radius: 999px;
  padding: 8px 12px;
  background: #edf2f4;
  color: var(--ink);
}

.pill.facile {
  background: #dff4ef;
  color: #096055;
}

.pill.moyen {
  background: #fff0d2;
  color: #8a5a09;
}

.pill.difficile {
  background: #f7dfe5;
  color: #8f2638;
}

.pill.neutral {
  background: #edf2f4;
  color: #445666;
}

.pill.success {
  background: #e6f5ee;
  color: #0f684b;
}

.pill.danger {
  background: #f9e8eb;
  color: #9b2c40;
}

.pill.score-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  justify-self: start;
  width: max-content;
  min-height: 28px;
  padding: 4px 9px;
  font-size: 0.78rem;
  line-height: 1;
}

.pill.score-pill.danger {
  background: #f8d7de;
  color: #8f2638;
}

.question-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.global-question-number {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(55, 130, 184, 0.18);
  border-radius: 999px;
  padding: 0 10px;
  background: #edf6fb;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 950;
}

.back-chevron {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
}

.app-shell.ranked-mode .back-chevron {
  border-color: rgba(132, 154, 166, 0.28);
  background: #edf4f7;
  color: #101820;
}

.question-board h2 {
  max-width: 980px;
  margin: 34px 0;
  font-size: clamp(1.7rem, 3.2vw, 3.55rem);
  line-height: 1.08;
}

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

.question-visual {
  display: grid;
  gap: 8px;
  margin: -12px 0 22px;
}

.question-visual-frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(185, 203, 213, 0.68);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 251, 0.94)),
    #f8fafb;
}

.question-visual svg {
  display: block;
  width: min(100%, 560px);
  height: auto;
  max-height: 320px;
}

.question-visual figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.riddle-layout {
  grid-template-columns: minmax(0, 1fr);
}

.riddle-board {
  min-height: 560px;
}

.riddle-title {
  margin: 22px 0 14px;
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 2.8rem);
  line-height: 1.08;
}

.riddle-prompt {
  display: grid;
  gap: 8px;
  max-width: 980px;
  margin: 0 0 24px;
}

.riddle-prompt p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 750;
  line-height: 1.35;
}

.riddle-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.riddle-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.riddle-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 260px);
  justify-content: start;
  gap: 6px;
  border: 0;
  margin: 0;
  padding: 0;
}

.riddle-field-grid legend {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.riddle-field-help {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.25;
}

.riddle-field-grid label {
  display: grid;
  grid-template-columns: 64px 72px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.riddle-field-grid label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(16, 24, 32, 0.1);
  border-radius: 8px;
  background: #eaf3f1;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

.riddle-field-grid input {
  min-height: 36px;
  padding: 0 8px;
  text-align: center;
}

.riddle-form input {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #f8fafb;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}

.riddle-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.riddle-actions button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--teal);
  color: white;
  font-weight: 950;
}

.riddle-actions .secondary-riddle {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.riddle-actions .dev-skip-riddle {
  border: 1px solid rgba(217, 155, 43, 0.35);
  background: #fff6df;
  color: #78520a;
}

.riddle-hint,
.riddle-solution {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  border: 1px solid rgba(12, 124, 116, 0.16);
  border-radius: 8px;
  padding: 14px;
  background: #f2fbf8;
}

.riddle-solution.wrong {
  border-color: rgba(180, 59, 79, 0.16);
  background: #fff2f4;
}

.riddle-hint strong,
.riddle-solution strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.riddle-solution span {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.riddle-solution.wrong span {
  color: var(--red);
}

.riddle-hint p,
.riddle-solution p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.riddle-text {
  display: grid;
  gap: 6px;
}

.riddle-text p:first-child {
  color: inherit;
  font-weight: inherit;
}

.answer {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 108px;
  padding: 16px;
  border: 1px solid #cfd9df;
  border-radius: 8px;
  background: #f9fbfc;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.answer:hover:not(:disabled) {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.answer span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-weight: 900;
}

.answer strong {
  line-height: 1.3;
}

.answer.has-visual {
  align-items: start;
}

.answer-visual {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(185, 203, 213, 0.62);
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.answer-visual svg {
  display: block;
  width: min(100%, 260px);
  height: auto;
  max-height: 210px;
}

.answer em {
  justify-self: end;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.answer.correct {
  border-color: #16825d;
  background: #dff6ed;
  box-shadow: inset 0 0 0 2px rgba(22, 130, 93, 0.28);
}

.answer.correct span,
.answer.correct em {
  background: #16825d;
  color: white;
}

.answer.wrong {
  border-color: #b43b4f;
  background: #fae1e6;
  box-shadow: inset 0 0 0 2px rgba(180, 59, 79, 0.24);
}

.answer.wrong span,
.answer.wrong em {
  background: #b43b4f;
  color: white;
}

.quiz-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.quiz-nav {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 950;
  cursor: pointer;
}

.quiz-nav.primary {
  background: var(--navy);
  color: white;
}

.quiz-nav.top-next {
  margin-left: auto;
  min-height: 40px;
}

.quiz-nav.secondary {
  border: 1px solid #cfd9df;
  background: white;
  color: var(--navy);
}

.quiz-nav:hover {
  transform: translateY(-1px);
}

.review-controls {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.review-controls small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.review-controls div {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.review-decision {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: white;
  font-weight: 950;
  cursor: pointer;
}

.review-decision.keep {
  background: var(--teal);
}

.review-decision.reject {
  background: var(--red);
}

.review-decision.review {
  background: var(--blue);
}

.empty-review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.review-choice {
  cursor: default;
}

.review-choice.correct {
  border-color: rgba(12, 124, 116, 0.38);
  background: #e9f6f3;
}

.review-choice small {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(12, 124, 116, 0.12);
  color: #075e58;
  font-size: 0.72rem;
  font-weight: 950;
}

.review-answer {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid rgba(12, 124, 116, 0.22);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f1faf7;
}

.review-answer span {
  color: #075e58;
  font-size: 0.76rem;
  font-weight: 950;
}

.review-correction {
  display: grid;
  gap: 6px;
}

.review-correction p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.45;
}

.empty-review-board p {
  max-width: 620px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.question-solution {
  position: relative;
  margin-top: 16px;
  border: 1px solid #cfd9df;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 14px 44px 14px 16px;
  background: #f6fbfa;
  color: var(--ink);
}

.question-solution span {
  display: block;
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.question-solution.wrong span {
  color: var(--red);
}

.question-solution p {
  margin: 0;
  color: #445666;
  font-weight: 700;
  line-height: 1.45;
}

.solution-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #cfd9df;
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.app-shell.ranked-mode .answer.correct {
  background: rgba(22, 130, 93, 0.28);
  color: #edf4f7;
}

.app-shell.ranked-mode .answer.wrong {
  background: rgba(180, 59, 79, 0.28);
  color: #edf4f7;
}

.app-shell.ranked-mode .question-solution {
  border-color: rgba(132, 154, 166, 0.24);
  border-left-color: var(--teal);
  background: rgba(21, 31, 40, 0.96);
  color: #edf4f7;
}

.app-shell.ranked-mode .question-visual-frame {
  border-color: rgba(185, 203, 213, 0.18);
  background:
    linear-gradient(180deg, rgba(237, 244, 247, 0.08), rgba(237, 244, 247, 0.04)),
    rgba(8, 14, 20, 0.76);
}

.app-shell.ranked-mode .question-solution p {
  color: #cbd8df;
}

.quiz-status {
  display: grid;
  gap: 10px;
  align-content: start;
}

.rank-hero,
.quiz-status div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.quiz-status div {
  min-height: 108px;
  padding: 15px;
}

.quiz-status strong {
  display: block;
  margin-top: 12px;
  font-size: 1.75rem;
}

.profile-page {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.profile-title {
  justify-content: flex-start;
}

.profile-identity {
  display: grid;
  position: relative;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: white;
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.08);
}

.profile-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.profile-copy {
  min-width: 0;
}

.profile-copy > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.profile-identity strong {
  display: block;
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-meta em {
  display: inline-grid;
  min-height: 28px;
  align-items: center;
  border-radius: 8px;
  padding: 0 10px;
  background: #edf7f5;
  color: #075e58;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 950;
}

.profile-rank-progress {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafb;
}

.points-chart {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.08);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.chart-header span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
}

.chart-header strong {
  font-size: 1.2rem;
}

.points-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.points-chart .chart-grid {
  fill: none;
  stroke: #e6edf1;
  stroke-width: 2;
}

.points-chart text {
  fill: #718294;
  font-size: 18px;
  font-weight: 900;
}

.points-chart .chart-x-label {
  text-anchor: middle;
}

.points-chart .chart-y-label {
  text-anchor: end;
}

.points-chart polyline {
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 9;
}

.points-chart circle {
  fill: #0c7c74;
  stroke: white;
  stroke-width: 4;
}

.account-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.08);
}

.account-panel h2 {
  margin-bottom: 14px;
  font-size: 1.25rem;
}

.account-panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.account-panel-title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.account-panel-title strong {
  min-height: 28px;
  border-radius: 8px;
  padding: 6px 10px;
  background: #eef4f6;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 950;
}

.account-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.account-row strong {
  color: var(--ink);
  text-align: right;
}

.account-logout {
  justify-self: start;
  min-height: 34px;
  border-radius: 7px;
  padding: 0 12px;
  background: #eef4f6;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.account-form,
.dev-username-form,
.subscription-box {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.account-form label,
.dev-username-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
}

.account-form input,
.dev-username-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #f8fafb;
  color: var(--ink);
  font: inherit;
}

.account-form button,
.dev-username-form button,
.subscription-box button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--teal);
  color: white;
  font-size: 0.9rem;
  font-weight: 950;
}

.subscription-box button:disabled {
  opacity: 0.45;
}

.account-form small,
.dev-username-form small,
.subscription-box small,
.subscription-box p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.subscription-box span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
}

.subscription-box strong {
  color: var(--ink);
  font-size: 1.15rem;
}

.subscription-box .billing-notice {
  border: 1px solid rgba(12, 124, 116, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  background: #e9f6f3;
  color: #075e58;
  font-weight: 900;
}

.plan-select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #f6f9fa;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

.rank-hero {
  min-height: 290px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(24, 40, 58, 0.96), rgba(12, 124, 116, 0.9)),
    var(--navy);
  color: white;
  box-shadow: var(--shadow);
}

.rank-hero span,
.rank-hero p {
  color: rgba(255, 255, 255, 0.78);
}

.rank-hero strong {
  display: block;
  margin: 14px 0 28px;
  font-size: clamp(3rem, 6vw, 5.7rem);
  line-height: 0.95;
}

.stats-page {
  display: grid;
  gap: 16px;
}

.profile-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.profile-insights div {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.08);
}

.profile-insights strong {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.05;
}

.streak-flame {
  display: inline-block;
  margin-left: 2px;
  font-size: 1.15em;
  line-height: 1;
}

.profile-insights span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 950;
}

.world-leaderboard {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.08);
}

.profile-avatar-zone {
  position: relative;
  flex: 0 0 auto;
}

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

.leaderboard-row {
  display: grid;
  grid-template-columns: 44px 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 8px 12px;
  background: #f8fafb;
}

.leaderboard-row.current {
  border-color: rgba(12, 124, 116, 0.28);
  background: #e9f6f3;
}

.leaderboard-row.muted {
  opacity: 0.72;
}

.leaderboard-self {
  margin-top: 6px;
  border-width: 2px;
}

.leaderboard-rank {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
}

.leaderboard-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-weight: 950;
}

.leaderboard-row strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row strong small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.leaderboard-row em {
  color: var(--teal);
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 950;
}

.app-shell.ranked-mode .profile-identity,
.app-shell.ranked-mode .account-panel,
.app-shell.ranked-mode .points-chart,
.app-shell.ranked-mode .profile-rank-progress,
.app-shell.ranked-mode .profile-insights div,
.app-shell.ranked-mode .world-leaderboard {
  border-color: rgba(185, 203, 213, 0.2);
  background: rgba(8, 14, 20, 0.9);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.18);
}

.app-shell.ranked-mode .profile-identity strong,
.app-shell.ranked-mode .account-panel h2,
.app-shell.ranked-mode .account-panel-title strong,
.app-shell.ranked-mode .account-row strong,
.app-shell.ranked-mode .profile-insights strong,
.app-shell.ranked-mode .chart-header strong,
.app-shell.ranked-mode .leaderboard-row strong {
  color: #edf4f7;
}

.app-shell.ranked-mode .profile-copy > span,
.app-shell.ranked-mode .account-row,
.app-shell.ranked-mode .account-panel-title span,
.app-shell.ranked-mode .profile-insights span,
.app-shell.ranked-mode .chart-header span,
.app-shell.ranked-mode .leaderboard-rank,
.app-shell.ranked-mode .account-form label,
.app-shell.ranked-mode .account-form small,
.app-shell.ranked-mode .subscription-box span,
.app-shell.ranked-mode .subscription-box small,
.app-shell.ranked-mode .subscription-box p {
  color: #94a7b3;
}

.app-shell.ranked-mode .profile-meta em {
  background: rgba(12, 124, 116, 0.18);
  color: #9de3dc;
}

.app-shell.ranked-mode .account-panel-title strong {
  background: rgba(237, 244, 247, 0.08);
}

.app-shell.ranked-mode .leaderboard-row {
  border-color: rgba(185, 203, 213, 0.18);
  background: rgba(237, 244, 247, 0.06);
}

.app-shell.ranked-mode .leaderboard-row.current {
  border-color: rgba(12, 124, 116, 0.45);
  background: rgba(12, 124, 116, 0.18);
}

.app-shell.ranked-mode .leaderboard-row strong small {
  color: #94a7b3;
}

.app-shell.ranked-mode .account-form input {
  border-color: rgba(185, 203, 213, 0.2);
  background: rgba(237, 244, 247, 0.08);
  color: #edf4f7;
}

.app-shell.ranked-mode .subscription-box .billing-notice {
  border-color: rgba(12, 124, 116, 0.34);
  background: rgba(12, 124, 116, 0.18);
  color: #dff8f4;
}

.app-shell.ranked-mode .subscription-box strong {
  color: #edf4f7;
}

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

.dev-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: 0 14px 34px rgba(26, 42, 57, 0.08);
}

.dev-card h2 {
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.dev-question-form,
.dev-email-form {
  display: grid;
  gap: 8px;
}

.dev-question-form input,
.dev-question-form select,
.dev-question-form textarea,
.dev-email-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fafb;
  color: var(--ink);
  font: inherit;
}

.dev-question-form textarea {
  min-height: 82px;
  resize: vertical;
}

.dev-card button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--teal);
  color: white;
  font-weight: 950;
}

.dev-card .secondary-admin {
  background: #e8eff2;
  color: var(--ink);
}

.admin-message {
  margin: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #e9f6f3;
  color: #0b5f58;
  font-size: 0.82rem;
  font-weight: 900;
}

.dev-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.dev-check-grid div,
.draft-list section,
.email-preview section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafb;
}

.dev-check-grid span,
.draft-list span,
.email-preview span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
}

.dev-check-grid strong,
.draft-list strong,
.email-preview strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
}

.email-preview,
.draft-list {
  display: grid;
  gap: 8px;
}

.draft-list small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-actions button {
  min-height: 34px;
  background: #e8eff2;
  color: var(--ink);
  font-size: 0.76rem;
}

.admin-actions button:last-child {
  background: #f8e8eb;
  color: #9b2c40;
}

.email-preview pre {
  overflow-x: auto;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: pre-wrap;
}

.app-shell.ranked-mode .dev-card,
.app-shell.ranked-mode .dev-check-grid div,
.app-shell.ranked-mode .draft-list section,
.app-shell.ranked-mode .email-preview section {
  border-color: rgba(185, 203, 213, 0.2);
  background: rgba(8, 14, 20, 0.9);
}

.app-shell.ranked-mode .dev-question-form input,
.app-shell.ranked-mode .dev-question-form select,
.app-shell.ranked-mode .dev-question-form textarea,
.app-shell.ranked-mode .dev-email-form input {
  border-color: rgba(185, 203, 213, 0.2);
  background: rgba(237, 244, 247, 0.08);
  color: #edf4f7;
}

.app-shell.ranked-mode .dev-card h2,
.app-shell.ranked-mode .dev-check-grid strong,
.app-shell.ranked-mode .draft-list strong,
.app-shell.ranked-mode .draft-list small,
.app-shell.ranked-mode .email-preview strong {
  color: #edf4f7;
}

.app-shell.ranked-mode .dev-check-grid span,
.app-shell.ranked-mode .draft-list span,
.app-shell.ranked-mode .email-preview span,
.app-shell.ranked-mode .email-preview pre {
  color: #94a7b3;
}

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

  .app-header {
    grid-template-columns: auto 1fr auto;
  }

  .quiz-layout,
  .profile-page {
    grid-template-columns: 1fr;
  }

  .dev-page {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  body {
    overflow-x: hidden;
  }

  .auth-shell {
    padding: 12px;
  }

  .auth-card {
    gap: 18px;
    padding: 18px 14px;
  }

  .auth-copy p {
    font-size: clamp(0.62rem, 3vw, 0.84rem);
    line-height: 1.2;
    white-space: nowrap;
  }

  .password-hint {
    font-size: clamp(0.56rem, 2.5vw, 0.68rem);
    white-space: nowrap;
  }

  .app-shell {
    gap: 10px;
    min-height: 100svh;
    padding: 8px 8px 78px;
  }

  .app-header {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 0;
    box-shadow: none;
  }

  .avatar {
    width: 46px;
    height: 46px;
  }

  .player-card strong {
    font-size: 1rem;
  }

  .player-card small {
    overflow: hidden;
    max-width: 190px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-zone {
    gap: 8px;
  }

  .avatar-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: calc(100vw - 16px);
    max-height: 360px;
    overflow-y: auto;
  }

  .avatar-menu button,
  .avatar-photo-option {
    min-height: 88px;
  }

  .avatar-menu button strong,
  .avatar-photo-option strong {
    font-size: 0.88rem;
    line-height: 1.16;
  }

  .mode-toggle {
    width: 124px;
    min-height: 36px;
  }

  .mode-toggle button {
    font-size: 0.68rem;
  }

  .bottom-nav {
    position: fixed;
    right: 8px;
    bottom: 8px;
    left: 8px;
    z-index: 10;
    display: grid;
    gap: 6px;
    border: 1px solid rgba(220, 227, 232, 0.92);
    border-radius: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(26, 42, 57, 0.16);
  }

.bottom-nav.user-nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .bottom-nav.admin-nav {
    grid-template-columns: repeat(5, 1fr);
  }

  .bottom-nav button {
    display: grid;
    gap: 2px;
    place-items: center;
    min-height: 48px;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 900;
  }

  .bottom-nav button span {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 6px;
    background: #edf2f4;
    color: var(--ink);
    font-size: 0.72rem;
  }

  .bottom-nav button.active {
    background: #e9f6f3;
    color: #075e58;
  }

  .bottom-nav button.active span {
    background: var(--teal);
    color: white;
  }

  .rank-meter {
    height: 7px;
  }

  .page-header {
    min-height: auto;
    margin-bottom: 8px;
  }

  .page-header h1,
  .daily-zone header span,
  .market-strip header {
    font-size: 1.42rem;
  }

  .eyebrow {
    display: none;
  }

  .daily-zone {
    gap: 7px;
    margin-bottom: 10px;
  }

  .daily-strip {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
  }

  .daily-card {
    flex: 0 0 128px;
    min-height: 104px;
    padding: 10px;
    scroll-snap-align: start;
  }

  .daily-card span {
    width: 28px;
    height: 28px;
    font-size: 0.96rem;
  }

  .daily-card strong {
    font-size: 0.78rem;
  }

  .daily-page-header {
    align-items: flex-start;
    gap: 8px;
  }

  .back-chip {
    min-height: 34px;
    padding: 0 11px;
    font-size: 0.78rem;
  }

  .market-lead,
  .geo-brief article {
    padding: 14px;
  }

  .geo-brief article.article-card {
    padding: 0;
  }

  .article-card img {
    aspect-ratio: 16 / 9;
  }

  .article-card div {
    padding: 14px;
  }

  .market-lead strong,
  .geo-brief article strong {
    font-size: 1.08rem;
  }

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

  .market-card {
    min-height: 118px;
    padding: 12px;
  }

  .market-card strong {
    font-size: 1.18rem;
  }

  .article-view iframe {
    min-height: 420px;
  }

  .geo-brief div {
    grid-template-columns: 1fr;
  }

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

  .category-card {
    min-height: 124px;
    padding: 7px;
    border-top-width: 4px;
    box-shadow: 0 8px 18px rgba(26, 42, 57, 0.08);
  }

  .promo-badge {
    top: 5px;
    right: 5px;
    padding: 3px 5px;
    font-size: 0.5rem;
  }

  .lock-badge {
    top: 5px;
    left: 5px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.72rem;
  }

  .theme-main {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 5px;
    text-align: center;
  }

  .theme-icon {
    width: 34px;
    height: 34px;
    font-size: 1.08rem;
  }

  .category-card p,
  .card-stats,
  .theme-copy small,
  .theme-copy em {
    display: none;
  }

  .theme-copy strong {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin: 0;
    font-size: clamp(0.76rem, 3.4vw, 0.96rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .category-card {
    justify-content: center;
  }

  .quiz-header {
    align-items: stretch;
    flex-direction: column;
  }

  .question-board {
    min-height: auto;
    padding: 14px;
  }

  .question-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .question-count {
    grid-column: 1;
    grid-row: 1;
  }

  .question-topline .pill {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .quiz-nav.top-next {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-height: 36px;
    padding: 0 14px;
  }

  .question-board h2 {
    margin: 18px 0;
    font-size: 1.45rem;
  }

  .riddle-title {
    margin: 18px 0 10px;
    font-size: 1.55rem;
  }

  .riddle-prompt p {
    font-size: 0.98rem;
    line-height: 1.38;
  }

  .answer-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .question-visual {
    margin: -4px 0 16px;
  }

  .question-visual-frame {
    padding: 10px;
  }

  .riddle-field-grid {
    grid-template-columns: minmax(0, 156px);
    gap: 6px;
  }

  .riddle-field-grid legend {
    margin-bottom: 2px;
    font-size: 0.72rem;
  }

  .riddle-field-help {
    font-size: 0.76rem;
  }

  .riddle-field-grid label {
    grid-template-columns: 54px 56px;
    gap: 6px;
  }

  .riddle-field-grid label span {
    min-height: 32px;
    font-size: 0.98rem;
  }

  .riddle-field-grid input {
    min-height: 32px;
    border-radius: 5px;
    padding: 0 4px;
    font-size: 0.9rem;
  }

  .answer {
    grid-template-columns: 34px 1fr;
    min-height: 70px;
    padding: 10px;
  }

  .answer em {
    grid-column: 2;
    justify-self: start;
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .answer span {
    width: 34px;
    height: 34px;
  }

  .quiz-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .quiz-nav {
    width: 100%;
  }

  .review-controls div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .review-decision {
    width: 100%;
  }

  .question-solution {
    margin-top: 10px;
    padding: 12px 40px 12px 12px;
  }

  .question-solution p {
    font-size: 0.88rem;
  }

  .quiz-status {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .quiz-status div {
    min-height: 66px;
    padding: 8px;
  }

  .quiz-status span {
    font-size: 0.66rem;
  }

  .daily-finished {
    margin-top: 10px;
    padding: 14px;
  }

  .daily-finished strong {
    font-size: 1.08rem;
  }

  .quiz-status strong {
    margin-top: 6px;
    font-size: 1.15rem;
  }

  .profile-page {
    grid-template-columns: 1fr;
  }

  .rank-hero {
    min-height: 210px;
    padding: 18px;
  }

  .rank-hero strong {
    font-size: 3rem;
  }

  .points-chart,
  .account-panel {
    padding: 14px;
  }

  .profile-identity {
    padding: 14px;
  }

  .profile-main {
    grid-template-columns: 1fr;
  }

  .profile-insights {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-insights div {
    min-height: 78px;
    padding: 13px;
  }

  .subscription-row {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 0;
  }
}
