:root {
  color-scheme: dark;
  --bg: #090916;
  --surface: #141428;
  --surface-strong: #1b1b34;
  --text: #f8f7ff;
  --muted: #a4a1bd;
  --purple: #8b5cf6;
  --purple-light: #bca5ff;
  --cyan: #2dd4bf;
  --orange: #ff9b52;
  --green: #39d98a;
  --red: #ff647c;
  --accent-rgb: 139, 92, 246;
  --secondary-rgb: 45, 212, 191;
  --border: rgba(255, 255, 255, 0.08);
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  --ui-font-family: Tahoma, Arial, sans-serif;
  --ui-font-scale: 100%;
  font-family: var(--ui-font-family);
  -webkit-text-size-adjust: var(--ui-font-scale);
  text-size-adjust: var(--ui-font-scale);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% 4%, rgba(var(--accent-rgb), 0.14), transparent 32%),
    linear-gradient(180deg, #0d0d20 0%, var(--bg) 72%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

body[data-ui-theme="cyan"],
[data-ui-theme="cyan"] {
  --purple: #22c7b8;
  --purple-light: #9af4eb;
  --cyan: #60a5fa;
  --accent-rgb: 34, 199, 184;
  --secondary-rgb: 96, 165, 250;
}

body[data-ui-theme="violet"],
[data-ui-theme="violet"] {
  --purple: #8b5cf6;
  --purple-light: #bca5ff;
  --cyan: #2dd4bf;
  --accent-rgb: 139, 92, 246;
  --secondary-rgb: 45, 212, 191;
}

body[data-ui-theme="gold"],
[data-ui-theme="gold"] {
  --purple: #f0aa3c;
  --purple-light: #ffe09a;
  --cyan: #f7cc5c;
  --accent-rgb: 240, 170, 60;
  --secondary-rgb: 247, 204, 92;
}

body[data-ui-theme="rose"],
[data-ui-theme="rose"] {
  --purple: #ec5f9c;
  --purple-light: #ffb7d7;
  --cyan: #fb7185;
  --accent-rgb: 236, 95, 156;
  --secondary-rgb: 251, 113, 133;
}

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

button:disabled {
  cursor: default;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  pointer-events: none;
}

.ambient-one {
  top: 20%;
  right: -140px;
  background: var(--purple);
}

.ambient-two {
  bottom: 10%;
  left: -150px;
  background: var(--cyan);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: var(--safe-top) 20px calc(106px + var(--safe-bottom));
}

.screen {
  display: none;
  animation: screen-in 0.35s ease both;
}

.screen.active {
  display: block;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar,
.quiz-header,
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

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

.brand-mark,
.loader-logo {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--purple-light), var(--purple));
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.3);
  font: 900 25px/1 Arial, sans-serif;
  transform: rotate(-5deg);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--purple-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

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

.brand h1 {
  margin: 0;
  font-size: 20px;
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  overflow: hidden;
  place-items: center;
  border: 2px solid rgba(188, 165, 255, 0.42);
  border-radius: 50%;
  background: #2d2453 center/cover;
  color: #ddd2ff;
  font-weight: 800;
}

.profile-trigger {
  display: flex;
  min-width: 72px;
  height: 50px;
  padding: 3px 4px 3px 9px;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  border: 1px solid rgba(var(--accent-rgb), .26);
  border-radius: 999px;
  background: rgba(20, 20, 40, .72);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
  backdrop-filter: blur(14px);
  transition: border-color .2s ease, transform .16s ease, background .2s ease;
}
.profile-trigger:active { transform: scale(.97); }
.profile-trigger[aria-expanded="true"] { border-color: rgba(var(--accent-rgb), .58); background: rgba(35, 29, 65, .94); }
.profile-trigger .avatar { width: 42px; height: 42px; flex: 0 0 auto; pointer-events: none; }
.profile-hamburger { display: grid; width: 14px; gap: 3px; pointer-events: none; }
.profile-hamburger i { display: block; width: 100%; height: 2px; border-radius: 99px; background: var(--purple-light); transition: transform .2s ease, opacity .2s ease; }
.profile-trigger[aria-expanded="true"] .profile-hamburger i:first-child { transform: translateY(5px) rotate(45deg); }
.profile-trigger[aria-expanded="true"] .profile-hamburger i:nth-child(2) { opacity: 0; }
.profile-trigger[aria-expanded="true"] .profile-hamburger i:last-child { transform: translateY(-5px) rotate(-45deg); }

body.profile-menu-open { overflow: hidden; }
.profile-menu-backdrop {
  position: fixed;
  z-index: 14;
  inset: 0;
  background: rgba(4, 4, 13, .68);
  backdrop-filter: blur(4px);
  animation: profile-backdrop-in .22s ease both;
}
.profile-drawer {
  position: fixed;
  z-index: 15;
  top: 0;
  bottom: 0;
  left: max(0px, calc((100vw - 520px) / 2));
  width: min(88vw, 360px);
  overflow-y: auto;
  padding: max(24px, var(--safe-top)) 18px max(30px, var(--safe-bottom));
  border-right: 1px solid rgba(var(--accent-rgb), .3);
  border-radius: 0 28px 28px 0;
  background:
    radial-gradient(circle at 10% 12%, rgba(var(--accent-rgb), .22), transparent 34%),
    linear-gradient(165deg, rgba(24, 23, 48, .99), rgba(9, 9, 22, .995));
  box-shadow: 24px 0 70px rgba(0, 0, 0, .46);
  animation: profile-drawer-in .32s cubic-bezier(.2, .78, .2, 1) both;
}
.profile-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 25px; }
.profile-drawer-head h2 { margin: 0; font-size: 20px; }
.profile-drawer-head button {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255,255,255,.05);
  color: #d9d3eb;
  font: 300 25px/1 Arial, sans-serif;
}
.profile-identity {
  display: grid;
  padding: 16px;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(var(--accent-rgb), .2);
  border-radius: 21px;
  background: rgba(255,255,255,.045);
}
.profile-drawer-avatar { width: 58px; height: 58px; font-size: 20px; }
.profile-identity strong,
.profile-identity small { display: block; }
.profile-identity strong { margin-bottom: 5px; font-size: 15px; }
.profile-identity small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.profile-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 13px 0 9px; }
.profile-metric {
  display: grid;
  min-height: 101px;
  padding: 13px;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: rgba(18, 18, 38, .78);
}
.profile-metric.gem { border-color: rgba(45, 212, 191, .18); }
.profile-metric.xp { border-color: rgba(var(--accent-rgb), .24); }
.profile-metric-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: rgba(255,255,255,.055); font-size: 20px; }
.profile-metric small,
.profile-metric strong,
.profile-metric em { display: block; }
.profile-metric small { margin-bottom: 5px; color: var(--muted); font-size: 8px; }
.profile-metric strong { font-size: 17px; }
.profile-metric em { margin-top: 4px; color: var(--purple-light); font-size: 8px; font-style: normal; }
.profile-metric b { font: inherit; }
.profile-progress-card {
  margin-top: 9px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(18, 18, 38, .68);
}
.profile-progress-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 10px; }
.profile-progress-card small { color: var(--muted); font-size: 8px; }
.profile-progress-card.daily { border-color: rgba(45,212,191,.17); }
.profile-progress-card.daily strong { color: #aef5e9; font-size: 9px; }
.profile-tasks-link {
  display: grid;
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 151, 74, .22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(77, 39, 31, .82), rgba(28, 23, 43, .9));
  text-align: right;
}
.profile-tasks-link > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: rgba(255,151,74,.12); font-size: 22px; }
.profile-tasks-link strong,
.profile-tasks-link small { display: block; }
.profile-tasks-link strong { margin-bottom: 4px; font-size: 10px; }
.profile-tasks-link small { color: #c69d87; font-size: 8px; }
.profile-tasks-link > b { color: #ffbd88; font-size: 18px; }
@keyframes profile-drawer-in { from { opacity: .4; transform: translateX(-105%); } to { opacity: 1; transform: none; } }
@keyframes profile-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

.hero-card {
  position: relative;
  min-height: 302px;
  overflow: hidden;
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 255, 255, 0.13), transparent 24%),
    linear-gradient(145deg, #5d35c8 0%, #8b5cf6 50%, #663bd0 100%);
  box-shadow: 0 22px 60px rgba(61, 33, 128, 0.32);
}

.compact-hero {
  min-height: 236px;
}

.compact-hero .trophy {
  bottom: 20px;
}

.hero-card::after {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.13) 1px, transparent 1px);
  background-size: 18px 18px;
  content: "";
  mask-image: linear-gradient(90deg, transparent, black);
}

.hero-copy,
.hero-button {
  position: relative;
  z-index: 2;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: rgba(11, 8, 35, 0.22);
  font-size: 11px;
  font-weight: 700;
}

.live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #81ffd3;
  box-shadow: 0 0 0 4px rgba(129,255,211,0.14);
}

.hero-copy h2 {
  max-width: 290px;
  margin-bottom: 9px;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.35;
}

.hero-copy p {
  max-width: 250px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
}

.trophy {
  position: absolute;
  z-index: 1;
  bottom: 42px;
  left: 12px;
  display: grid;
  width: 130px;
  height: 155px;
  place-items: center;
  transform: rotate(-8deg);
}

.trophy::before {
  position: absolute;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 18px rgba(255,255,255,0.04);
  content: "";
}

.trophy-cup {
  color: #ffe499;
  font-size: 88px;
  filter: drop-shadow(0 14px 14px rgba(52,26,102,0.35));
}

.trophy-star {
  position: absolute;
  z-index: 2;
  color: white;
  font-size: 20px;
}

.primary-button,
.secondary-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  border-radius: 17px;
  font-weight: 800;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.primary-button:active,
.secondary-button:active,
.answer-button:active {
  transform: scale(0.98);
}

.primary-button {
  background: linear-gradient(135deg, #9d72ff, #7c4fe5);
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.25);
}

.hero-button {
  position: absolute;
  right: 25px;
  bottom: 22px;
  width: calc(100% - 50px);
  justify-content: space-between;
  background: white;
  box-shadow: 0 12px 28px rgba(58, 32, 114, 0.3);
  color: #42228f;
}

.button-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: #ece4ff;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 27px;
}

.stat-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(20, 20, 40, 0.72);
  backdrop-filter: blur(12px);
}

.stat-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
}

.stat-card.purple .stat-icon { background: rgba(139, 92, 246, 0.18); }
.stat-card.orange .stat-icon { background: rgba(255, 155, 82, 0.18); }
.stat-card.cyan .stat-icon { background: rgba(45, 212, 191, 0.15); }

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  margin-bottom: 3px;
  font-size: 18px;
}

.stat-card div > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card div > span b,
.stat-card strong b {
  display: inline;
}

.level-card {
  margin: -10px 0 27px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(20, 20, 40, 0.58);
}

.level-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
}

.level-card small { color: var(--muted); }

.level-track,
.cap-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #25253d;
}

.level-track i,
.cap-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  transition: width 0.4s ease;
}

.daily-games { margin-bottom: 27px; }

.engagement-teaser {
  display: grid;
  width: 100%;
  margin: -11px 0 18px;
  padding: 13px 14px;
  grid-template-columns: 43px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 151, 74, 0.24);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(82, 39, 31, 0.8), rgba(25, 21, 39, 0.92));
  color: white;
  text-align: right;
}
.engagement-teaser-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: rgba(255,151,74,0.13); font-size: 23px; }
.engagement-teaser small,
.engagement-teaser strong { display: block; }
.engagement-teaser small { margin-bottom: 4px; color: #d1a68e; font-size: 8px; }
.engagement-teaser strong { font-size: 12px; }
.engagement-teaser-action { padding: 8px 9px; border-radius: 10px; background: rgba(255,151,74,0.14); color: #ffbe8a; font-size: 8px; font-weight: 800; }

.picker-screen,
.engagement-screen { padding-bottom: 120px; }
.picker-intro { margin: -7px 0 20px; color: var(--muted); font-size: 10px; line-height: 1.9; }
.picker-step { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; }
.picker-step span { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 7px; background: rgba(139,92,246,0.15); color: #c6b5fa; font-size: 9px; font-weight: 900; }
.picker-step strong { font-size: 11px; }
.picker-groups { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.picker-group-card {
  display: grid;
  min-height: 104px;
  padding: 14px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: rgba(20,20,40,0.7);
  color: white;
}
.picker-group-card span { font-size: 29px; }
.picker-group-card strong { margin: 7px 0 3px; font-size: 12px; }
.picker-group-card small { color: var(--muted); font-size: 8px; }
.picker-group-card.selected { border-color: rgba(139,92,246,0.68); background: linear-gradient(145deg, rgba(94,58,170,0.3), rgba(20,20,40,0.92)); box-shadow: 0 10px 28px rgba(84,52,153,0.18); }
.picker-games { display: grid; gap: 8px; }
.picker-game-card {
  display: grid;
  min-height: 70px;
  padding: 11px 13px;
  grid-template-columns: 42px minmax(0,1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(18,18,38,0.72);
  color: white;
  text-align: right;
}
.picker-game-card > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: rgba(255,255,255,0.04); font-size: 23px; }
.picker-game-card strong,
.picker-game-card small { display: block; }
.picker-game-card strong { margin-bottom: 5px; font-size: 11px; }
.picker-game-card small { color: var(--muted); font-size: 8px; }
.picker-game-card i { color: #6e6885; font: normal 22px/1 Arial; }
.picker-game-card.selected { border-color: rgba(45,212,191,0.46); background: linear-gradient(145deg, rgba(24,83,80,0.24), rgba(18,18,38,0.9)); }
.picker-topics { display: flex; overflow-x: auto; gap: 7px; padding-bottom: 4px; scrollbar-width: none; }
.picker-topics::-webkit-scrollbar { display: none; }
.picker-topic { flex: 0 0 auto; min-width: 106px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: rgba(20,20,40,0.68); color: #ddd9ea; }
.picker-topic strong,
.picker-topic small { display: block; }
.picker-topic strong { margin-bottom: 4px; font-size: 9px; }
.picker-topic small { color: var(--muted); font-size: 7px; }
.picker-topic.selected { border-color: rgba(255,199,93,0.5); background: rgba(255,199,93,0.1); color: #ffe3a9; }
.picker-summary { display: grid; margin: 18px 0 11px; padding: 14px; grid-template-columns: 52px minmax(0,1fr); gap: 12px; border: 1px solid rgba(139,92,246,0.2); border-radius: 19px; background: linear-gradient(145deg, rgba(38,30,69,0.82), rgba(16,16,34,0.92)); }
.picker-summary-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 16px; background: rgba(139,92,246,0.12); font-size: 28px; }
.picker-summary small,
.picker-summary strong,
.picker-summary b { display: block; }
.picker-summary small { color: #b7a5ed; font-size: 8px; }
.picker-summary strong { margin: 4px 0; font-size: 13px; }
.picker-summary p { margin: 0 0 6px; color: var(--muted); font-size: 8px; line-height: 1.7; }
.picker-summary b { color: #aef5e9; font-size: 8px; }
.thought-room-entry {
  display: grid;
  margin: 12px 0;
  padding: 16px;
  grid-template-columns: 58px minmax(0,1fr);
  align-items: center;
  gap: 13px;
  overflow: hidden;
  border: 1px solid rgba(84,239,216,.28);
  border-radius: 23px;
  background:
    radial-gradient(circle at 5% 10%, rgba(76,231,213,.16), transparent 32%),
    linear-gradient(145deg, rgba(17,48,54,.94), rgba(20,17,46,.96));
  box-shadow: 0 18px 44px rgba(0,0,0,.22);
}
.thought-room-entry-icon {
  display: grid; width: 58px; height: 58px; place-items: center;
  border: 1px solid rgba(94,241,221,.34); border-radius: 19px;
  background: rgba(43,211,191,.1); color: #8ff8ea; font-size: 28px;
  box-shadow: 0 0 28px rgba(52,222,201,.12) inset;
}
.thought-room-entry small,
.thought-room-entry strong,
.thought-room-entry b { display: block; }
.thought-room-entry small { color: #69ddcf; font-size: 7px; letter-spacing: .7px; }
.thought-room-entry strong { margin: 5px 0; font-size: 15px; }
.thought-room-entry p { margin: 0 0 7px; color: #aaa8bd; font-size: 8px; line-height: 1.75; }
.thought-room-entry b { color: #c9fff8; font-size: 8px; }
.thought-room-entry button {
  min-height: 54px; grid-column: 1 / -1; border-radius: 16px;
  background: linear-gradient(115deg,#1fb6a2,#6650dd); color: white;
  font-size: 11px; font-weight: 900; box-shadow: 0 14px 30px rgba(29,176,157,.2);
}
.thought-room-entry button span { margin-right: 8px; }
.thought-room-lock {
  display: flex;
  min-height: 42px;
  padding: 9px 12px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255,155,178,.16);
  border-radius: 14px;
  background: rgba(77,35,61,.18);
  color: #d6a9b5;
  font-size: 8px;
}
.thought-room-entry.locked {
  border-color: rgba(147,145,170,.16);
  background:
    radial-gradient(circle at 5% 10%, rgba(124,131,145,.08), transparent 32%),
    linear-gradient(145deg,rgba(29,34,43,.96),rgba(20,18,38,.96));
}
.thought-room-entry.locked .thought-room-entry-icon {
  border-color: rgba(177,182,197,.16);
  background: rgba(140,145,160,.07);
  color: #8b8f9c;
  filter: grayscale(1);
}
.thought-room-entry.locked button {
  background: rgba(117,119,139,.12);
  color: #747486;
  box-shadow: none;
}
.thought-room-entry.unlocked {
  animation: thought-room-unlock .75s cubic-bezier(.2,.8,.2,1) both;
}
.classic-quiz-entry.mission-active {
  border-color: rgba(185,139,255,.7);
  box-shadow: 0 0 0 1px rgba(171,116,255,.12), 0 20px 54px rgba(102,60,189,.28);
  animation: calibration-pulse 1.8s ease-in-out infinite alternate;
}
.classic-quiz-entry.mission-active .sdg-mode-icon { animation: calibration-icon 1.3s ease-in-out infinite alternate; }
.classic-quiz-entry.locked { opacity: .62; filter: saturate(.55); }
.classic-quiz-entry.locked button:disabled { background: rgba(255,255,255,.05); color: #797586; cursor: not-allowed; }
@keyframes thought-room-unlock {
  0% { opacity: .35; filter: saturate(0); transform: translateY(10px) scale(.98); }
  45% { filter: saturate(1.8) brightness(1.25); }
  100% { opacity: 1; filter: none; transform: none; }
}
@keyframes calibration-pulse { to { box-shadow: 0 0 0 1px rgba(171,116,255,.24), 0 22px 64px rgba(102,60,189,.4); } }
@keyframes calibration-icon { to { color: white; transform: scale(1.07) rotate(-3deg); } }

.sdg-quiz-hub {
  display: grid;
  gap: 14px;
}
.sdg-quiz-mode-card,
.sdg-quiz-hub .thought-room-entry {
  display: grid;
  min-height: 235px;
  margin: 0;
  padding: 18px;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 14px;
  overflow: hidden;
  border-radius: 25px;
  box-shadow: 0 18px 48px rgba(0,0,0,.24);
}
.classic-quiz-entry {
  border: 1px solid rgba(168,128,255,.3);
  background:
    radial-gradient(circle at 90% 5%, rgba(143,94,244,.2), transparent 35%),
    linear-gradient(145deg,rgba(41,27,76,.96),rgba(17,19,40,.97));
}
.sdg-mode-head {
  display: flex;
  align-items: center;
  gap: 13px;
}
.sdg-mode-head small,
.sdg-mode-head strong { display: block; }
.sdg-mode-head small { margin-bottom: 5px; color: #aa96e9; font-size: 7px; letter-spacing: .7px; }
.sdg-mode-head strong { font-size: 18px; }
.sdg-mode-icon {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(179,145,255,.3);
  border-radius: 19px;
  background: rgba(136,91,232,.14);
  font-size: 28px;
}
.sdg-quiz-mode-card > p,
.sdg-quiz-hub .thought-room-entry > p {
  min-height: 40px;
  margin: 0;
  color: #aaa8bd;
  font-size: 9px;
  line-height: 1.9;
}
.sdg-mode-features {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.sdg-mode-features span {
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: #c4bfd3;
  font-size: 8px;
  font-weight: 800;
}
.classic-quiz-entry button,
.sdg-quiz-hub .thought-room-entry button {
  width: 100%;
  min-height: 55px;
  margin-top: auto;
  border-radius: 17px;
  color: white;
  font-size: 11px;
  font-weight: 900;
}
.classic-quiz-entry button {
  background: linear-gradient(115deg,#7450d7,#9d68ed);
  box-shadow: 0 14px 30px rgba(105,67,198,.24);
}
.classic-quiz-entry button span,
.sdg-quiz-hub .thought-room-entry button span { margin-right: 8px; }
.classic-picker { animation: picker-core-in .32s ease both; }
.classic-picker-return {
  display: flex;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid rgba(153,116,239,.18);
  border-radius: 14px;
  background: rgba(112,76,190,.08);
  color: #c9baef;
  font-size: 9px;
  font-weight: 800;
}
.classic-picker-return span { color: #8c6fd6; font-size: 16px; }
.classic-start-button { width: 100%; min-height: 57px; border-radius: 17px; }
@keyframes picker-core-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 760px) {
  .sdg-quiz-hub { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; }
  .sdg-quiz-mode-card,
  .sdg-quiz-hub .thought-room-entry { min-height: 275px; }
}

.checkin-card { display: grid; padding: 17px; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 12px; border: 1px solid rgba(255,151,74,0.25); border-radius: 22px; background: linear-gradient(145deg, rgba(81,39,31,0.84), rgba(27,22,42,0.94)); }
.checkin-flame { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 17px; background: rgba(255,151,74,0.13); font-size: 29px; }
.checkin-card small,
.checkin-card strong,
.checkin-card span { display: block; }
.checkin-card small { color: #d8a486; font-size: 8px; }
.checkin-card strong { margin: 4px 0; font-size: 16px; }
.checkin-card span { color: var(--muted); font-size: 8px; }
.checkin-card button { max-width: 94px; padding: 9px; border-radius: 11px; background: #ef7d43; color: #fff; font-size: 8px; font-weight: 900; }
.checkin-card button:disabled { background: rgba(255,255,255,0.07); color: #918a9f; }
.checkin-cycle { display: grid; overflow-x: auto; margin: 11px 0 24px; padding-bottom: 3px; grid-template-columns: repeat(7, minmax(58px,1fr)); gap: 6px; scrollbar-width: none; }
.checkin-cycle span { min-width: 58px; padding: 9px 4px; border: 1px solid var(--border); border-radius: 12px; background: rgba(20,20,40,0.66); text-align: center; }
.checkin-cycle small,
.checkin-cycle b { display: block; }
.checkin-cycle small { margin-bottom: 4px; color: var(--muted); font-size: 7px; }
.checkin-cycle b { font-size: 8px; }
.checkin-cycle span.next,
.checkin-cycle span.today { border-color: rgba(255,151,74,0.5); background: rgba(255,151,74,0.1); color: #ffc092; }
.mission-list { display: grid; gap: 8px; }
.mission-card { display: grid; padding: 12px; grid-template-columns: 39px minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 17px; background: rgba(19,19,39,0.72); }
.mission-card.completed { border-color: rgba(57,217,138,0.18); }
.mission-icon { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; background: rgba(139,92,246,0.1); font-size: 20px; }
.mission-card strong,
.mission-card small { display: block; }
.mission-card strong { margin-bottom: 4px; font-size: 9px; }
.mission-card small { color: var(--muted); font-size: 7px; }
.mission-card i { position: relative; display: block; height: 4px; margin-top: 8px; overflow: visible; border-radius: 99px; background: #29283d; }
.mission-card i::before { content: ""; display: block; width: var(--progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--green)); }
.mission-card i b { position: absolute; top: -10px; left: 0; color: #777287; font: normal 6px/1 Tahoma, sans-serif; }
.mission-card button { min-width: 66px; padding: 9px 7px; border-radius: 10px; background: rgba(57,217,138,0.13); color: #91edbd; font-size: 7px; font-weight: 900; }
.mission-card button:disabled { background: rgba(255,255,255,0.04); color: #716d82; }
.engagement-achievement-head { margin-top: 24px; }

.game-catalog {
  display: flex;
  overflow-x: auto;
  gap: 9px;
  margin-bottom: 14px;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.game-catalog::-webkit-scrollbar { display: none; }

.game-choice {
  display: grid;
  min-width: 138px;
  padding: 12px;
  grid-template-columns: 38px 1fr;
  gap: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(20,20,40,0.72);
  text-align: right;
  transition: 0.2s ease;
}

.game-choice.selected {
  border-color: rgba(139,92,246,0.65);
  background: linear-gradient(145deg, rgba(139,92,246,0.2), rgba(20,20,40,0.88));
  box-shadow: 0 8px 24px rgba(82,54,160,0.18);
}

.game-choice[data-game-type="capital_quiz"].selected {
  border-color: rgba(45,212,191,0.58);
  background: linear-gradient(145deg, rgba(28,92,85,0.28), rgba(20,20,40,0.88));
  box-shadow: 0 8px 24px rgba(17,110,98,0.16);
}

.game-choice[data-game-type="capital_quiz"] .game-choice-icon {
  filter: drop-shadow(0 5px 10px rgba(45,212,191,0.2));
}

.game-choice-icon { grid-row: 1 / 3; align-self: center; font-size: 27px; }
.game-choice strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.game-choice small { color: var(--muted); font-size: 8px; }

.mode-card {
  display: grid;
  min-height: 94px;
  margin-bottom: 11px;
  padding: 14px;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: linear-gradient(145deg, rgba(27,27,52,0.94), rgba(16,16,34,0.94));
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.mode-card.tournament-mode {
  border-color: rgba(255, 199, 93, 0.18);
  background: linear-gradient(145deg, rgba(54,40,39,0.74), rgba(20,18,34,0.96));
}

.mode-card.online-mode {
  border-color: rgba(45, 212, 191, 0.2);
  background: linear-gradient(145deg, rgba(21,55,59,0.72), rgba(17,18,35,0.96));
}

.mode-card.scheduled-mode {
  border-color: rgba(246, 119, 255, 0.2);
  background: linear-gradient(145deg, rgba(54,27,65,0.74), rgba(18,18,36,0.96));
}

.mode-card.used { opacity: 0.55; }

.mode-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.14);
  font-size: 24px;
}

.tournament-mode .mode-icon { background: rgba(255, 199, 93, 0.12); }
.online-mode .mode-icon { background: rgba(45,212,191,0.12); }
.scheduled-mode .mode-icon { background: rgba(246,119,255,0.12); }

.mode-copy { min-width: 0; }
.mode-copy strong,
.mode-copy small,
.mode-kicker { display: block; }
.mode-copy strong { margin: 3px 0 5px; font-size: 14px; }
.mode-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mode-kicker { color: var(--purple-light); font-size: 9px; font-weight: 800; }
.tournament-mode .mode-kicker { color: #f3c874; }
.online-mode .mode-kicker { color: #8ceee1; }
.scheduled-mode .mode-kicker { color: #f2a8ff; }

.mode-button {
  min-width: 57px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(139,92,246,0.2);
  color: #d6c8ff;
  font-size: 11px;
  font-weight: 800;
}

.mode-button.gold { background: rgba(255,199,93,0.15); color: #ffd98c; }
.mode-button.online { background: rgba(45,212,191,0.14); color: #9ff4e8; font-size: 9px; }
.mode-button.scheduled { background: rgba(246,119,255,0.13); color: #f6c8ff; font-size: 9px; }
.mode-button:disabled { background: rgba(255,255,255,0.05); color: #77738c; }

.daily-cap {
  display: grid;
  padding: 10px 3px 0;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.daily-cap b { color: #aef5e9; font-size: 10px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.section-heading span {
  color: var(--muted);
  font-size: 10px;
}

.category-row {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-row::-webkit-scrollbar { display: none; }

.category-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(20, 20, 40, 0.65);
  color: #cfccde;
  font-size: 11px;
}

.category-chip b { font-size: 16px; }

.bottom-nav {
  position: fixed;
  z-index: 8;
  right: 50%;
  bottom: 0;
  display: grid;
  width: min(100%, 520px);
  min-height: calc(76px + var(--safe-bottom));
  padding: 10px 18px var(--safe-bottom);
  transform: translateX(50%);
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  align-items: center;
  border-top: 1px solid var(--border);
  background: rgba(12, 12, 27, 0.92);
  backdrop-filter: blur(22px);
  transition: transform 0.25s ease;
}

.bottom-nav.hidden { transform: translate(50%, 120%); }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  justify-content: center;
  background: transparent;
  color: #716e88;
  font-size: 10px;
}

.nav-item span { font-size: 22px; }
.nav-item.active { color: var(--purple-light); }

.quiz-screen {
  padding-top: 3px;
}

.question-media {
  display: grid;
  min-height: 112px;
  margin: 0 0 18px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,0.035);
  font-size: 78px;
}

.question-media img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.question-media.visual-media {
  position: relative;
  min-height: 210px;
  isolation: isolate;
  background:
    linear-gradient(rgba(67,230,211,.035) 1px, transparent 1px),
    linear-gradient(90deg,rgba(67,230,211,.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 48%,rgba(72,218,204,.13),rgba(11,14,28,.96) 72%);
  background-size: 22px 22px,22px 22px,auto;
}
.question-media.visual-media::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 34px rgba(5,8,20,.68);
}
.question-media.visual-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 230px;
  max-height: none;
  object-fit: contain;
  transition: opacity .35s ease, filter .35s ease, transform .35s ease;
  animation: visual-signal-in .55s cubic-bezier(.18,.82,.2,1) both;
}
.question-media.visual-zoom img { transform: scale(1.65); }
.question-media.visual-silhouette img { filter: grayscale(1) brightness(.18) contrast(2.2) drop-shadow(0 0 14px rgba(97,239,222,.28)); }
.question-media.visual-split img { object-fit: cover; transform: scale(1.13); }
.question-media.visual-split.seat-a img { object-position: 25% center; clip-path: inset(0 49% 0 0 round 12px); transform: translateX(24%) scale(1.42); }
.question-media.visual-split.seat-b img { object-position: 75% center; clip-path: inset(0 0 0 49% round 12px); transform: translateX(-24%) scale(1.42); }
.question-media.visual-corrupted.seat-a img { filter: hue-rotate(-14deg) saturate(1.15) contrast(1.08); }
.question-media.visual-corrupted.seat-b img { filter: hue-rotate(118deg) saturate(.75) contrast(1.35); transform: scaleX(-1); }
.question-media.visual-corrupted::before {
  content: "CORRUPTED COPY";
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 10px;
  padding: 5px 7px;
  border: 1px solid rgba(255,100,124,.35);
  border-radius: 7px;
  background: rgba(45,8,23,.7);
  color: #ff91a6;
  font: 700 7px/1 Arial,sans-serif;
  letter-spacing: 1px;
  animation: corrupted-jitter .9s steps(2,end) infinite;
}
.question-media.visual-alignment img { filter: saturate(1.2) contrast(1.08); }
.visual-seat-badge {
  position: absolute;
  z-index: 5;
  right: 10px;
  bottom: 10px;
  padding: 6px 9px;
  border: 1px solid rgba(91,235,220,.38);
  border-radius: 999px;
  background: rgba(7,20,31,.82);
  color: #9ff8ed;
  font: 800 8px/1 Arial,sans-serif;
  letter-spacing: .8px;
}
.memory-erased-message {
  display: none;
  position: absolute;
  z-index: 4;
  inset: 0;
  place-content: center;
  text-align: center;
  background: radial-gradient(circle,rgba(52,74,93,.22),rgba(10,12,25,.97) 64%);
}
.memory-erased-message span,
.memory-erased-message strong,
.memory-erased-message small { display: block; }
.memory-erased-message span { color: #8ff4e7; font-size: 45px; animation: memory-ring 1.1s ease-in-out infinite alternate; }
.memory-erased-message strong { margin: 9px 0 5px; color: #d9fffa; font-size: 12px; }
.memory-erased-message small { color: #85889a; font-size: 8px; }
.question-media.visual-memory.memory-concealed img { opacity: 0; filter: blur(20px); transform: scale(1.08); }
.question-media.visual-memory.memory-concealed .memory-erased-message { display: grid; animation: memory-erase .35s ease both; }
@keyframes visual-signal-in {
  from { opacity: 0; filter: blur(12px) brightness(1.6); transform: scale(1.06); }
}
@keyframes corrupted-jitter {
  35% { transform: translate(2px,-1px); opacity: .7; }
  70% { transform: translate(-2px,1px); }
}
@keyframes memory-ring { to { transform: scale(1.12); opacity: .6; } }
@keyframes memory-erase { from { opacity: 0; filter: blur(10px); } }

.question-media.story-media {
  display: grid;
  min-height: 0;
  padding: 18px;
  grid-template-columns: 42px 1fr;
  align-items: start;
  gap: 12px;
  background: linear-gradient(145deg, rgba(240,170,60,0.1), rgba(139,92,246,0.07));
  font-size: inherit;
}
.story-media > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: rgba(240,170,60,0.12);
  font-size: 22px;
}
.story-media > p {
  margin: 0;
  color: #ded9ef;
  font-size: 12px;
  line-height: 2.05;
  text-align: right;
}

.question-media.audio-media {
  min-height: 0;
  padding: 16px;
  font-size: inherit;
}
.audio-challenge { width: 100%; text-align: center; }
.audio-play-button {
  display: inline-grid;
  min-height: 48px;
  padding: 0 18px;
  grid-template-columns: 24px auto;
  place-items: center;
  gap: 8px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--purple), #6553df);
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.2);
  font-size: 11px;
  font-weight: 800;
}
.audio-play-button:disabled { opacity: 0.82; }
.audio-play-button > span { font-size: 16px; }
.audio-progress {
  height: 5px;
  overflow: hidden;
  margin: 13px 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}
.audio-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  transition: width 0.08s linear;
}
.audio-challenge small { display: block; color: var(--muted); font-size: 8px; line-height: 1.8; }

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: #d3d0e4;
  font-size: 26px;
}

.question-counter {
  color: var(--muted);
  font-size: 13px;
}

.question-counter strong {
  color: white;
  font-size: 18px;
}

.score-pill {
  display: flex;
  min-width: 74px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 204, 106, 0.16);
  border-radius: 13px;
  background: rgba(255, 155, 82, 0.1);
  color: #ffd189;
}

.progress-track {
  height: 5px;
  margin: -8px 0 24px;
  overflow: hidden;
  border-radius: 10px;
  background: #22223b;
}

.progress-track i {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), #c4a9ff);
  transition: width 0.35s ease;
}

.question-card {
  padding: 22px 0 0;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.question-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-label {
  padding: 7px 10px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--purple-light);
  font-size: 11px;
  font-weight: 700;
}

.category-label.subtle {
  border-color: var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.timer {
  position: relative;
  display: grid;
  width: 51px;
  height: 51px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--cyan) 360deg, #25253e 0);
  transition: background 0.1s linear;
}

.timer::before {
  position: absolute;
  width: 41px;
  height: 41px;
  border-radius: 50%;
  background: var(--bg);
  content: "";
}

.timer span {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 800;
}

.timer.danger { color: var(--red); }

.question-card h2 {
  min-height: 92px;
  margin: 22px 0 24px;
  font-size: clamp(21px, 5.5vw, 27px);
  line-height: 1.65;
}

.answers {
  display: grid;
  gap: 11px;
}

.answer-button {
  display: grid;
  min-height: 62px;
  padding: 10px 13px;
  grid-template-columns: 38px 1fr 24px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(20, 20, 40, 0.86);
  text-align: right;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}

.answer-button:hover:not(:disabled) {
  border-color: rgba(188, 165, 255, 0.36);
}

.answer-letter {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: #22223b;
  color: #bab6ce;
  font-weight: 800;
}

.answer-text {
  font-size: 14px;
  font-weight: 700;
}

.answer-status {
  color: transparent;
  font-size: 20px;
  text-align: center;
}

.answer-button.correct {
  border-color: rgba(57, 217, 138, 0.7);
  background: rgba(57, 217, 138, 0.1);
}

.answer-button.correct .answer-letter { background: var(--green); color: #092919; }
.answer-button.correct .answer-status { color: var(--green); }

.answer-button.wrong {
  border-color: rgba(255, 100, 124, 0.65);
  background: rgba(255, 100, 124, 0.09);
}

.answer-button.wrong .answer-letter { background: var(--red); color: #360811; }
.answer-button.wrong .answer-status { color: var(--red); }
.answer-button.selected {
  border-color: rgba(139,92,246,0.7);
  background: rgba(139,92,246,0.11);
}
.answer-button.selected .answer-letter { background: rgba(139,92,246,0.35); color: white; }

.answer-button.dimmed { opacity: 0.46; }

.answer-feedback {
  display: none;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(20, 20, 40, 0.92);
  animation: screen-in 0.25s ease both;
}

.answer-feedback.visible { display: block; }

.feedback-copy strong {
  display: block;
  margin-bottom: 5px;
  color: var(--green);
}

.answer-feedback.wrong .feedback-copy strong { color: var(--red); }

.feedback-copy p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.feedback-copy #feedback-reward {
  margin-bottom: 5px;
  color: #aef5e9;
  font-weight: 800;
}

.answer-feedback .primary-button {
  width: 100%;
  min-height: 48px;
}

.result-screen {
  padding-top: 42px;
  text-align: center;
}

.result-medal {
  display: grid;
  width: 102px;
  height: 102px;
  margin: 0 auto 26px;
  place-items: center;
  border: 10px solid rgba(255, 215, 111, 0.15);
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe29a, #f5a83d);
  box-shadow: 0 0 50px rgba(255, 190, 80, 0.23);
  color: #8f5213;
  font-size: 49px;
}

.result-screen h2 {
  margin-bottom: 8px;
  font-size: 29px;
}

.result-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.result-score-card {
  margin: 27px 0 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 25px;
  background: linear-gradient(160deg, rgba(34, 29, 64, 0.95), rgba(18, 18, 37, 0.95));
}

.result-score-card > span {
  color: var(--muted);
  font-size: 12px;
}

.result-score-card > strong {
  display: block;
  margin: 7px 0 19px;
  color: #d8caff;
  font-size: 46px;
}

.result-details {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.result-details p { margin: 0; }
.result-details b,
.result-details span { display: block; }
.result-details b { margin-bottom: 3px; font-size: 18px; }
.result-details span { color: var(--muted); font-size: 10px; }
.result-details i { width: 1px; height: 35px; background: var(--border); }

.result-details.result-four {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.result-four p {
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
}

.wide { width: 100%; margin-top: 10px; }

.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: #d8d5e5;
}

.confetti i {
  position: absolute;
  top: 80px;
  right: calc(10% + (var(--i, 1) * 12%));
  width: 7px;
  height: 16px;
  border-radius: 2px;
  background: var(--purple);
  transform: rotate(25deg);
}

.confetti i:nth-child(2) { top: 140px; right: 12%; background: var(--cyan); transform: rotate(-30deg); }
.confetti i:nth-child(3) { top: 65px; right: 28%; background: var(--orange); transform: rotate(55deg); }
.confetti i:nth-child(4) { top: 105px; right: auto; left: 14%; background: var(--red); transform: rotate(12deg); }
.confetti i:nth-child(5) { top: 180px; right: auto; left: 8%; background: var(--cyan); transform: rotate(-45deg); }
.confetti i:nth-child(6) { top: 54px; right: auto; left: 31%; background: #ffe278; transform: rotate(65deg); }

.page-header {
  justify-content: flex-start;
  margin-bottom: 30px;
}

.page-header h2 { margin: 0; font-size: 25px; }

.split-header { justify-content: space-between; }

.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  border: 1px solid rgba(45,212,191,0.18);
  border-radius: 14px;
  background: rgba(45,212,191,0.08);
  color: #aef5e9;
}

.tab-switcher {
  display: grid;
  margin-bottom: 18px;
  padding: 4px;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(20,20,40,0.78);
}

.tab-switcher.two-tabs { grid-template-columns: repeat(2, 1fr); }

.tab-switcher button {
  min-height: 39px;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tab-switcher button.active {
  background: linear-gradient(135deg, rgba(157,114,255,0.28), rgba(124,79,229,0.18));
  color: white;
}

.reward-grid,
.owned-list,
.transaction-list {
  display: grid;
  gap: 11px;
}

.reward-card {
  display: grid;
  padding: 15px;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(27,27,52,0.92), rgba(15,15,32,0.92));
}

.reward-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 17px;
  background: rgba(139,92,246,0.13);
  font-size: 25px;
}

.reward-copy { min-width: 0; }
.reward-copy strong { display: block; margin: 2px 0 6px; font-size: 14px; }
.reward-copy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.reward-copy small { display: block; margin-top: 6px; color: var(--cyan); font-size: 9px; }

.reward-footer {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

.reward-footer span { color: #b8f6ed; font-size: 13px; font-weight: 800; }
.reward-footer button,
.owned-card button {
  min-height: 37px;
  padding: 0 13px;
  border-radius: 11px;
  background: rgba(139,92,246,0.18);
  color: #d8ccff;
  font-size: 10px;
  font-weight: 800;
}

.reward-footer button:disabled { background: rgba(255,255,255,0.05); color: #77738c; }

.owned-card,
.transaction-row {
  display: grid;
  padding: 13px;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(20,20,40,0.76);
}

.owned-card { display: block; }
.owned-summary {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 11px;
}
.owned-card .reward-icon { width: 48px; height: 48px; font-size: 22px; }
.owned-card strong,
.owned-card span { display: block; }
.owned-card strong { margin-bottom: 4px; font-size: 12px; }
.owned-card span { color: var(--muted); font-size: 9px; }

.prize-content {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
}

.prize-text-box,
.prize-image-box {
  display: grid;
  gap: 9px;
}

.prize-text-box + .prize-image-box { margin-top: 14px; }
.prize-text-box pre {
  margin: 0;
  padding: 14px;
  overflow-wrap: anywhere;
  border: 1px dashed rgba(45,212,191,0.28);
  border-radius: 13px;
  background: rgba(45,212,191,0.06);
  color: #d9fff9;
  font: 12px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  user-select: all;
}

.prize-image-box img {
  display: block;
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  border-radius: 15px;
  background: rgba(255,255,255,0.03);
}

.prize-content button { justify-self: start; }

.transaction-row { grid-template-columns: 38px 1fr auto; }
.transaction-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: rgba(45,212,191,0.1);
  color: var(--cyan);
}
.transaction-row strong,
.transaction-row small { display: block; }
.transaction-row strong { margin-bottom: 4px; font-size: 11px; }
.transaction-row small { color: var(--muted); font-size: 9px; }
.transaction-row b { direction: ltr; font-size: 11px; }
.transaction-row b.positive { color: var(--green); }
.transaction-row b.negative { color: var(--red); }

.owned-list[data-empty="true"],
.transaction-list[data-empty="true"] { display: none; }

.podium {
  display: flex;
  min-height: 184px;
  align-items: end;
  justify-content: center;
  gap: 10px;
  margin: 0 0 18px;
}

.podium-player {
  display: flex;
  width: 30%;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  order: var(--order);
}

.podium-avatar,
.rank-avatar {
  display: grid;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  background: #302759 center/cover;
  color: #e1d9ff;
  font-weight: 800;
}

.podium-avatar {
  position: relative;
  width: 58px;
  height: 58px;
  margin-bottom: 8px;
  border: 3px solid var(--podium-color);
}

.podium-player.first .podium-avatar { width: 70px; height: 70px; }

.podium-player strong {
  width: 100%;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-player > span { margin-top: 3px; color: var(--muted); font-size: 10px; }

.podium-step {
  display: grid;
  width: 100%;
  height: var(--height);
  margin-top: 10px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--podium-color), transparent 70%);
  border-radius: 16px 16px 5px 5px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--podium-color), transparent 78%), transparent);
  color: var(--podium-color);
  font-size: 24px;
  font-weight: 900;
}

.ranking-list {
  display: grid;
  gap: 9px;
}

.rank-row {
  display: grid;
  padding: 12px;
  grid-template-columns: 27px 43px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(20, 20, 40, 0.75);
}

.rank-number { color: var(--muted); font-size: 12px; font-weight: 800; }
.rank-avatar { width: 42px; height: 42px; }
.rank-name { min-width: 0; }
.rank-name strong,
.rank-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name strong { font-size: 13px; }
.rank-name span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.rank-score { color: #c7b3ff; font-size: 13px; font-weight: 800; }
.rank-row.my-rank { border-color: rgba(45,212,191,0.5); background: rgba(45,212,191,0.08); }

.empty-state {
  padding: 50px 20px;
  text-align: center;
}

.empty-state span,
.empty-state strong { display: block; }
.empty-state span { margin-bottom: 14px; font-size: 44px; }
.empty-state p { margin-top: 8px; color: var(--muted); font-size: 12px; }

.tournaments-screen { padding-bottom: 115px; }
.tournaments-back { direction: ltr; font-size: 20px; }
.tournament-hub-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 15px;
  padding: 14px;
  border: 1px solid rgba(255,199,93,0.2);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(55,42,28,0.48), rgba(20,20,40,0.76));
}
.tournament-hub-note > span {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,199,93,0.12);
  font-size: 23px;
}
.tournament-hub-note strong,
.tournament-hub-note small { display: block; }
.tournament-hub-note strong { margin-bottom: 4px; font-size: 12px; }
.tournament-hub-note small { color: var(--muted); font-size: 9px; line-height: 1.8; }
.tournament-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tournament-tabs button { padding: 0 4px; font-size: 8px; }
.tournament-event-list { display: grid; gap: 12px; }
.tournament-event-card {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: linear-gradient(150deg, rgba(27,27,52,0.94), rgba(14,14,30,0.94));
}
.tournament-event-card.live { border-color: rgba(45,212,191,0.38); box-shadow: 0 12px 35px rgba(12,93,83,0.12); }
.tournament-event-card.upcoming { border-color: rgba(139,92,246,0.3); }
.tournament-event-card.finished { opacity: 0.86; }
.tournament-event-head {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
}
.tournament-event-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: rgba(139,92,246,0.13);
  font-size: 23px;
}
.tournament-status {
  display: inline-block;
  margin-bottom: 3px;
  color: #b6a1f5;
  font-size: 8px;
  font-weight: 800;
}
.tournament-event-card.live .tournament-status { color: var(--cyan); }
.tournament-event-head h3 { margin: 0 0 4px; font-size: 14px; }
.tournament-game { color: var(--muted); font-size: 9px; }
.tournament-event-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin: 13px 0 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.035);
  font-size: 9px;
}
.tournament-event-time span { color: #d8ccff; }
.tournament-event-time strong { color: var(--muted); font-size: 8px; text-align: left; }
.tournament-prizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tournament-prizes span {
  padding: 9px 5px;
  border: 1px solid rgba(255,199,93,0.12);
  border-radius: 11px;
  background: rgba(255,199,93,0.05);
  text-align: center;
  font-size: 9px;
}
.tournament-prizes b { display: block; margin-top: 4px; color: #f3d28c; font-size: 10px; }
.tournament-event-meta { display: flex; gap: 13px; margin: 11px 1px; color: var(--muted); font-size: 9px; }
.tournament-my-result { margin: 10px 0; padding: 10px; border-radius: 11px; background: rgba(45,212,191,0.08); color: #aef5e9; font-size: 9px; line-height: 1.8; }
.tournament-event-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tournament-event-actions button { min-height: 40px; font-size: 10px; }
.tournament-ranking-panel {
  margin-top: 17px;
  padding: 14px;
  border: 1px solid rgba(139,92,246,0.28);
  border-radius: 21px;
  background: rgba(15,15,32,0.9);
}
.tournament-ranking-panel .admin-panel-head small { display: block; margin-bottom: 3px; color: var(--cyan); font-size: 8px; }
.tournament-ranking-list { margin-top: 12px; }

.online-screen {
  padding-bottom: 110px;
  background:
    radial-gradient(circle at 20% 5%, rgba(43,219,199,.1), transparent 25%),
    radial-gradient(circle at 85% 35%, rgba(126,93,238,.1), transparent 28%);
}
.online-back { direction: ltr; font-size: 20px; }
.thought-room-header { align-items: center; }
.thought-room-title-line { display: flex; align-items: center; gap: 11px; }
.thought-room-title-line > span {
  display: grid; width: 48px; height: 48px; place-items: center;
  border: 1px solid rgba(81,234,215,.3); border-radius: 16px;
  background: rgba(45,212,191,.09); color: #8cf4e7; font-size: 23px;
}
.thought-room-title-line .eyebrow { color: #65d9cb; letter-spacing: .8px; }
.online-tabs { border-color: rgba(76,224,207,.14); border-radius: 18px; background: rgba(12,22,32,.78); }
.online-tabs button { min-height: 48px; border-radius: 14px; }
.online-tabs button.active { background: linear-gradient(135deg,rgba(36,195,176,.24),rgba(109,80,221,.2)); }
.online-form,
.online-lobby {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(25,25,49,0.94), rgba(13,13,29,0.94));
}
.thought-room-create,
.thought-room-join { gap: 16px; padding: 17px; border-color: rgba(62,225,206,.2); border-radius: 26px; }
.thought-room-hero {
  display: grid; padding: 14px; grid-template-columns: 54px minmax(0,1fr); align-items: center; gap: 12px;
  border: 1px solid rgba(70,228,210,.18); border-radius: 19px;
  background: linear-gradient(135deg,rgba(31,117,112,.16),rgba(81,54,153,.14));
}
.thought-room-hero > span {
  display: grid; width: 54px; height: 54px; place-items: center; border-radius: 17px;
  background: rgba(47,214,195,.1); color: #86f5e8; font-size: 27px;
}
.thought-room-hero small,
.thought-room-hero strong { display: block; }
.thought-room-hero small { color: #65d9cb; font-size: 8px; }
.thought-room-hero strong { margin: 4px 0; font-size: 13px; }
.thought-room-hero p { margin: 0; color: #aaa8bb; font-size: 8px; line-height: 1.75; }
.thought-room-hero.compact { margin-bottom: 6px; }
.thought-story-prologue {
  display: grid;
  margin-bottom: 13px;
  padding: 15px;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(86,228,212,.2);
  border-radius: 24px;
  background:
    linear-gradient(135deg,rgba(20,68,69,.2),rgba(58,34,103,.22)),
    rgba(11,14,28,.92);
  animation: protocol-file-in .55s cubic-bezier(.18,.82,.2,1) both;
}
.thought-story-file {
  display: grid;
  padding: 12px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.thought-story-file span { grid-row: 1 / 3; color: #80f0e3; font: 900 19px/1 Arial,sans-serif; }
.thought-story-file strong { font-size: 12px; }
.thought-story-file small { color: #817f93; font: 700 7px/1 Arial,sans-serif; letter-spacing: .8px; }
.thought-story-prologue article {
  display: grid;
  padding: 11px;
  grid-template-columns: 35px minmax(0,1fr);
  align-items: start;
  gap: 9px;
  border-radius: 15px;
  background: rgba(255,255,255,.025);
  animation: protocol-line-in .45s ease both;
}
.thought-story-prologue article.null { animation-delay: .16s; }
.thought-story-prologue article > span { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 12px; background: rgba(52,208,192,.1); }
.thought-story-prologue article.null > span { background: rgba(139,92,246,.12); }
.thought-story-prologue article small { color: #76e9db; font-size: 8px; }
.thought-story-prologue article.null small { color: #bb9cff; }
.thought-story-prologue article p { margin: 4px 0 0; color: #c5c2d2; font-size: 9px; line-height: 1.9; }
@keyframes protocol-file-in { from { opacity: 0; transform: translateY(12px); filter: blur(5px); } }
@keyframes protocol-line-in { from { opacity: 0; transform: translateX(12px); } }
.thought-profile-note {
  display: flex; min-height: 50px; padding: 10px 12px; align-items: center; gap: 10px;
  border: 1px solid rgba(167,126,255,.17); border-radius: 16px;
  background: rgba(114,73,198,.08); color: #c8b7ee;
}
.thought-profile-note > span { font-size: 20px; }
.thought-profile-note p { margin: 0; font-size: 8px; line-height: 1.8; }
.thought-profile-note strong { color: #eadfff; }
.thought-category-heading { display: flex; align-items: center; justify-content: space-between; }
.thought-category-heading strong { font-size: 11px; }
.thought-category-heading small { color: var(--muted); font-size: 8px; }
.thought-category-list { display: grid; gap: 9px; }
.thought-category-button {
  display: grid; width: 100%; min-height: 66px; padding: 10px 12px;
  grid-template-columns: 44px minmax(0,1fr) 22px; align-items: center; gap: 10px;
  border: 1px solid rgba(255,255,255,.075); border-radius: 18px;
  background: linear-gradient(135deg,rgba(28,28,53,.94),rgba(17,20,37,.94));
  color: var(--text); text-align: right; transition: .18s ease;
}
.thought-category-button > span {
  display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px;
  background: rgba(138,99,230,.1); color: #d9ccff; font-size: 19px;
}
.thought-category-button strong,
.thought-category-button small { display: block; }
.thought-category-button strong { margin-bottom: 5px; font-size: 11px; }
.thought-category-button small { color: #8b889d; font-size: 8px; }
.thought-category-button > i { color: #686579; direction: ltr; font-style: normal; font-size: 16px; }
.thought-category-button.selected {
  border-color: rgba(63,229,209,.48); background: linear-gradient(135deg,rgba(26,112,106,.28),rgba(63,42,123,.3));
  box-shadow: 0 12px 30px rgba(27,135,124,.12); transform: translateY(-1px);
}
.thought-category-button.selected > span { background: rgba(56,220,201,.16); color: #94fff2; }
.thought-category-button.selected > i { color: #79eddf; }
.thought-category-button.personalized small { color: #bba5f2; }
.thought-fixed-rules { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.thought-fixed-rules span {
  padding: 11px 5px; border: 1px solid rgba(255,255,255,.07); border-radius: 15px;
  background: rgba(255,255,255,.025); color: #9b98aa; text-align: center; font-size: 8px;
}
.thought-fixed-rules b { display: block; margin-bottom: 4px; color: #96f5ea; font-size: 17px; }
.thought-primary-action { min-height: 59px; border-radius: 17px; font-size: 12px; }
.thought-primary-action span { margin-right: 7px; }
.online-form {
  display: grid;
  gap: 13px;
}
.online-form-intro,
.lobby-status {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 3px;
}
.online-form-intro > span,
.lobby-status > span {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background: rgba(45,212,191,0.1);
  font-size: 22px;
}
.online-form-intro strong,
.online-form-intro small,
.lobby-status strong,
.lobby-status small { display: block; }
.online-form-intro strong,
.lobby-status strong { margin-bottom: 4px; font-size: 13px; }
.online-form-intro small,
.lobby-status small { color: var(--muted); font-size: 9px; line-height: 1.7; }
.online-form label {
  display: grid;
  gap: 6px;
  color: #bab6ce;
  font-size: 9px;
}
.online-form input,
.online-form select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: 0;
  background: #17172d;
  color: var(--text);
  font: 11px/1.7 var(--ui-font-family);
}
.online-form input:focus,
.online-form select:focus { border-color: rgba(45,212,191,0.55); }
.online-form option:disabled { color: #59576b; }
.online-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(45,212,191,0.06);
  color: #9fc9c4;
  font-size: 9px;
  line-height: 1.9;
}
.online-history { display: grid; gap: 12px; }
.online-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 7px;
}
.online-history-summary article {
  min-width: 0;
  padding: 12px 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(20,20,40,0.76);
  text-align: center;
}
.online-history-summary b,
.online-history-summary span { display: block; }
.online-history-summary b { margin-bottom: 5px; color: #c9b8ff; font-size: 16px; }
.online-history-summary span { color: var(--muted); font-size: 8px; }
.online-history-list { display: grid; gap: 8px; }
.online-history-card {
  display: grid;
  padding: 12px;
  grid-template-columns: 42px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(18,18,36,0.78);
}
.online-history-card.win { border-color: rgba(57,217,138,0.2); }
.online-history-card.loss { border-color: rgba(255,100,124,0.16); }
.online-history-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: rgba(139,92,246,0.11);
  font-size: 21px;
}
.online-history-main { min-width: 0; }
.online-history-main strong,
.online-history-main span,
.online-history-main small { display: block; }
.online-history-main strong { margin-bottom: 4px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.online-history-main span { color: #c9c5d8; font-size: 9px; }
.online-history-main small { margin-top: 5px; color: var(--muted); font-size: 7px; }
.online-history-result { text-align: left; }
.online-history-result b,
.online-history-result small { display: block; }
.online-history-result b { font-size: 9px; }
.online-history-card.win .online-history-result b { color: var(--green); }
.online-history-card.loss .online-history-result b { color: var(--red); }
.online-history-card.draw .online-history-result b { color: #f3c874; }
.online-history-result small { margin-top: 5px; color: #aef5e9; font-size: 8px; }
.online-history-empty { padding: 32px 15px; }
.online-history-empty span { font-size: 36px; }
.room-code-input {
  direction: ltr;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 7px;
  font: 800 21px/1 ui-monospace, SFMono-Regular, Menlo, monospace !important;
}
.online-lobby { display: grid; gap: 14px; }
.online-lobby { border-color: rgba(58,225,205,.2); border-radius: 27px; }
.room-code-card {
  display: grid;
  padding: 16px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px 12px;
  border: 1px dashed rgba(45,212,191,0.35);
  border-radius: 17px;
  background: rgba(45,212,191,0.06);
}
.room-code-card > span { color: var(--muted); font-size: 9px; }
.room-code-card > strong {
  direction: ltr;
  grid-row: 1 / 3;
  grid-column: 2;
  color: #cafff7;
  font: 900 27px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 4px;
}
.room-code-card > button {
  justify-self: start;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(45,212,191,0.14);
  color: #9ff4e8;
  font-size: 9px;
  font-weight: 800;
}
.online-settings { display: flex; flex-wrap: wrap; gap: 7px; }
.online-settings span {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: #c9c5d8;
  font-size: 9px;
}
.online-players { display: grid; gap: 8px; }
.online-players article {
  display: grid;
  padding: 11px;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
}
.online-players article > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: rgba(139,92,246,0.1);
}
.online-players small,
.online-players strong { display: block; }
.online-players small { margin-bottom: 3px; color: var(--muted); font-size: 8px; }
.online-players strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.online-players b {
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255,199,93,0.08);
  color: #e8c67e;
  font-size: 8px;
}
.online-players b.confirmed { background: rgba(57,217,138,0.09); color: #8ceeb8; }
.thought-session-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.thought-session-summary article {
  display: grid; padding: 10px; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.06); border-radius: 14px; background: rgba(255,255,255,.025);
}
.thought-session-summary span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: rgba(45,212,191,.09); color: #86eee1; font-size: 8px; }
.thought-session-summary strong,
.thought-session-summary small { display: block; grid-column: 2; }
.thought-session-summary strong { font-size: 8px; }
.thought-session-summary small { margin-top: -5px; color: var(--muted); font-size: 6px; line-height: 1.6; }
.online-new-room {
  justify-self: center;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.online-start-button {
  background: linear-gradient(135deg, #28bda9, #178d80);
  box-shadow: 0 12px 28px rgba(45,212,191,0.2);
}
.online-match { display: grid; gap: 14px; }
.duel-scoreboard {
  display: grid;
  padding: 13px;
  grid-template-columns: minmax(0,1fr) 66px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(32,31,62,0.95), rgba(15,15,32,0.95));
}
.duel-scoreboard article { min-width: 0; text-align: center; }
.duel-scoreboard article small,
.duel-scoreboard article strong,
.duel-scoreboard article b { display: block; }
.duel-scoreboard article small { color: var(--muted); font-size: 8px; }
.duel-scoreboard article strong { margin: 5px 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.duel-scoreboard article b { color: #bba6ff; font-size: 22px; }
.duel-versus { text-align: center; }
.duel-versus > span {
  display: grid;
  width: 43px;
  height: 43px;
  margin: 0 auto 5px;
  place-items: center;
  border: 1px solid rgba(45,212,191,0.25);
  border-radius: 50%;
  background: rgba(45,212,191,0.08);
  color: #9ff4e8;
  font: 900 12px/1 Arial, sans-serif;
}
.duel-versus small { color: var(--muted); font-size: 7px; }
.duel-countdown {
  min-height: 330px;
  padding: 60px 20px;
  border: 1px solid rgba(45,212,191,0.18);
  border-radius: 26px;
  background: radial-gradient(circle at 50% 42%, rgba(45,212,191,0.15), transparent 36%), rgba(15,15,32,0.84);
  text-align: center;
}
.duel-countdown span,
.duel-countdown strong,
.duel-countdown small { display: block; }
.duel-countdown span { color: #a8e9e1; font-size: 13px; font-weight: 800; }
.duel-countdown strong {
  margin: 22px 0;
  color: white;
  font: 900 92px/1 Arial, sans-serif;
  text-shadow: 0 0 42px rgba(45,212,191,0.45);
  animation: duel-pulse 0.9s ease-in-out infinite alternate;
}
.duel-countdown small { color: var(--muted); font-size: 9px; }
@keyframes duel-pulse { to { transform: scale(1.08); } }
.thought-sync {
  margin: 11px 0;
  padding: 11px 13px;
  border: 1px solid rgba(108,104,143,.18);
  border-radius: 16px;
  background: rgba(15,17,34,.78);
}
.thought-sync > div { display: flex; align-items: center; justify-content: space-between; }
.thought-sync span { color: #918da4; font: 800 8px/1 Arial,sans-serif; letter-spacing: .9px; }
.thought-sync strong { color: #c8b8ff; font-size: 13px; }
.thought-sync > i { display: block; height: 7px; overflow: hidden; margin: 9px 0 7px; border-radius: 999px; background: rgba(255,255,255,.06); }
.thought-sync > i b { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#7961dc,#4fd7c8); box-shadow: 0 0 16px rgba(79,215,200,.35); transition: width .42s cubic-bezier(.2,.8,.2,1); }
.thought-sync > small { display: block; color: #777587; font-size: 7px; line-height: 1.6; }
.thought-sync.passed { border-color: rgba(76,231,211,.33); background: rgba(29,103,96,.12); }
.thought-sync.passed strong { color: #8affef; }
.thought-sync.passed > i b { background: linear-gradient(90deg,#37bfae,#9affef); animation: sync-glow 1.1s ease-in-out infinite alternate; }
@keyframes sync-glow { to { filter: brightness(1.35); box-shadow: 0 0 24px rgba(91,241,222,.7); } }
.duel-question {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 23px;
  background: rgba(13,13,29,0.86);
}
.duel-question h2 {
  min-height: 76px;
  margin: 20px 0;
  font-size: clamp(19px, 5vw, 24px);
  line-height: 1.7;
}
.duel-question .answers { display: grid; grid-template-columns: 1fr; gap: 10px; }
.duel-question .answer-button { min-height: 64px; border-radius: 18px; font-size: 11px; }
.duel-timer { width: 48px; height: 48px; }
.duel-waiting,
.duel-round-feedback {
  margin-top: 13px;
  padding: 13px;
  border: 1px solid rgba(45,212,191,0.18);
  border-radius: 15px;
  background: rgba(45,212,191,0.07);
  text-align: center;
}
.duel-waiting span {
  display: grid;
  width: 28px;
  height: 28px;
  margin: 0 auto 7px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #082b19;
  font-weight: 900;
}
.duel-waiting p,
.duel-round-feedback p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.8; }
.duel-round-feedback strong { display: block; margin-bottom: 5px; color: var(--green); font-size: 12px; }
.duel-round-feedback.wrong strong { color: var(--red); }
.duel-final {
  padding: 25px 17px;
  border: 1px solid var(--border);
  border-radius: 25px;
  background: linear-gradient(155deg, rgba(43,34,79,0.96), rgba(14,14,30,0.96));
  text-align: center;
}
.duel-final-medal { margin-bottom: 15px; font-size: 64px; filter: drop-shadow(0 12px 24px rgba(255,199,93,0.25)); }
.duel-final h2 { margin-bottom: 7px; font-size: 25px; }
.duel-final > p:not(.eyebrow):not(.online-note) { color: var(--muted); font-size: 10px; }
.duel-final-grid { display: grid; margin: 20px 0 14px; grid-template-columns: 1fr 1fr; gap: 9px; }
.duel-final-grid article {
  min-width: 0;
  padding: 15px 9px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
}
.duel-final-grid span,
.duel-final-grid strong,
.duel-final-grid small { display: block; }
.duel-final-grid span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.duel-final-grid strong { margin: 8px 0; color: #cbbaff; font-size: 29px; }
.duel-final-grid small { color: #c8c4d8; font-size: 8px; }
.duel-reward-note.rewarded { border-color: rgba(57,217,138,0.22); background: rgba(57,217,138,0.08); color: #aef3ce; }
.thought-story-result {
  display: grid;
  margin: 14px 0;
  padding: 14px;
  grid-template-columns: 45px minmax(0,1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(76,228,210,.25);
  border-radius: 18px;
  background: linear-gradient(135deg,rgba(23,99,91,.19),rgba(91,55,158,.2));
  text-align: right;
  animation: protocol-result-in .65s cubic-bezier(.18,.82,.2,1) both;
}
.thought-story-result > span { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 15px; background: rgba(59,221,202,.12); color: #9bfff3; font-size: 25px; }
.thought-story-result small,
.thought-story-result strong { display: block; }
.thought-story-result small { color: #6cded1; font: 700 7px/1 Arial,sans-serif; letter-spacing: .6px; }
.thought-story-result strong { margin: 5px 0; color: #f0ebff; font-size: 12px; }
.thought-story-result p { margin: 0; color: #aaa8bb; font-size: 8px; line-height: 1.85; }
@keyframes protocol-result-in { from { opacity: 0; transform: scale(.96) translateY(8px); filter: blur(8px); } }
.thought-next-panel {
  display: grid; margin: 15px 0 10px; padding: 14px; gap: 12px;
  border: 1px solid rgba(66,228,208,.2); border-radius: 20px;
  background: linear-gradient(145deg,rgba(21,83,81,.15),rgba(65,42,124,.16)); text-align: right;
}
.thought-next-panel small,
.thought-next-panel strong { display: block; }
.thought-next-panel small { color: #6ce4d5; font-size: 7px; letter-spacing: .8px; }
.thought-next-panel strong { margin: 5px 0; font-size: 12px; }
.thought-next-panel p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.75; }
.thought-category-list.compact { max-height: 260px; overflow-y: auto; padding-left: 2px; }
.thought-category-list.compact .thought-category-button { min-height: 58px; }

.admin-screen { padding-bottom: 115px; }
.admin-badge {
  padding: 7px 11px;
  border: 1px solid rgba(45,212,191,0.28);
  border-radius: 999px;
  background: rgba(45,212,191,0.09);
  color: #9ff4e8;
  font-size: 10px;
  font-weight: 800;
}

.admin-stats {
  display: grid;
  margin: 17px 0;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.admin-stats article {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(20,20,40,0.76);
}

.admin-stats b,
.admin-stats span { display: block; }
.admin-stats b { margin-bottom: 4px; color: #d8ccff; font-size: 18px; }
.admin-stats span { color: var(--muted); font-size: 9px; }
.admin-tabs { margin-bottom: 16px; }
.admin-tabs button { min-height: 36px; font-size: 9px; }

.admin-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: rgba(15,15,32,0.68);
}

.admin-panel-head,
.form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-panel-head { margin-bottom: 12px; }
.admin-panel-head h3 { margin: 0; font-size: 14px; }
.admin-panel-head > button,
.admin-item button,
.form-close {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  background: rgba(139,92,246,0.16);
  color: #d6c9ff;
  font-size: 9px;
  font-weight: 800;
}

.admin-list { display: grid; gap: 8px; }
.admin-empty-note {
  margin: 0;
  padding: 15px;
  border: 1px dashed var(--border);
  border-radius: 13px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.9;
}
.admin-item {
  display: grid;
  padding: 10px;
  grid-template-columns: 39px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(25,25,48,0.72);
}

.admin-item.inactive { opacity: 0.52; }
.admin-item-icon {
  display: grid;
  width: 38px;
  height: 38px;
  overflow: hidden;
  place-items: center;
  border-radius: 11px;
  background: rgba(139,92,246,0.12);
  font-size: 20px;
}
.admin-item-icon img { width: 100%; height: 100%; object-fit: cover; }
.admin-item strong,
.admin-item small { display: block; }
.admin-item strong { margin-bottom: 4px; font-size: 10px; line-height: 1.5; }
.admin-item small { color: var(--muted); font-size: 8px; }
.admin-item-actions { display: flex; gap: 5px; }
.admin-item-actions .archive { background: rgba(255,100,124,0.1); color: #ff9aaa; }
.question-admin-item { grid-template-columns: 39px minmax(0,1fr) auto; }
.difficulty-badge {
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255,199,93,0.1);
  color: #f3c874;
  font-size: 8px;
  font-weight: 800;
}

.admin-panel-head > div > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.7;
}

.admin-user-search {
  display: grid;
  margin-bottom: 12px;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.admin-user-search input {
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: 0;
  background: #17172d;
  color: var(--text);
  font: 10px/1.6 var(--ui-font-family);
}
.admin-user-search input:focus { border-color: rgba(139,92,246,0.65); }
.admin-user-search button {
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(139,92,246,0.18);
  color: #d8ccff;
  font-size: 9px;
  font-weight: 800;
}
.admin-user-list { max-height: 430px; overflow-y: auto; padding-left: 2px; }
.admin-user-item { grid-template-columns: 42px minmax(0,1fr) auto; }
.admin-user-list-avatar,
.admin-user-avatar {
  display: grid;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  background: #302759 center/cover;
  color: #e1d9ff;
  font-weight: 800;
}
.admin-user-list-avatar { width: 41px; height: 41px; }
.admin-user-id-line { display: block; margin-top: 3px; color: #716d87; direction: ltr; font-size: 7px; text-align: right; }
.admin-user-detail {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid rgba(45,212,191,0.25);
  border-radius: 18px;
  background: rgba(12,31,33,0.32);
}
.admin-user-detail-head {
  display: grid;
  grid-template-columns: 52px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
}
.admin-user-avatar { width: 51px; height: 51px; font-size: 18px; }
.admin-user-detail-head small { display: block; margin-bottom: 3px; color: var(--cyan); font-size: 8px; }
.admin-user-detail-head h3 { margin: 0 0 4px; font-size: 13px; }
.copy-user-id { padding: 0; background: transparent; color: var(--muted); direction: rtl; font-size: 8px; }
.copy-user-id b { direction: ltr; font-size: 8px; }
.admin-user-stats {
  display: grid;
  margin: 13px 0;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 6px;
}
.admin-user-stats article { padding: 10px 4px; border-radius: 11px; background: rgba(255,255,255,0.035); text-align: center; }
.admin-user-stats b,
.admin-user-stats span { display: block; }
.admin-user-stats b { margin-bottom: 4px; color: #cfc1ff; font-size: 13px; }
.admin-user-stats span { color: var(--muted); font-size: 7px; }
.admin-adjust-form { margin-top: 0; border-color: rgba(139,92,246,0.18); background: rgba(20,20,40,0.58); }
.admin-adjust-form .form-heading small { color: var(--muted); font-size: 8px; }
.admin-user-reset-zone {
  display: grid;
  margin-top: 10px;
  padding: 11px;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(248,113,113,0.28);
  border-radius: 13px;
  background: rgba(127,29,29,0.13);
}
.admin-user-reset-zone strong,
.admin-user-reset-zone small { display: block; }
.admin-user-reset-zone strong { color: #fecaca; font-size: 9px; }
.admin-user-reset-zone small { margin-top: 4px; color: #bda3aa; font-size: 7px; line-height: 1.7; }
.admin-user-reset-zone button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(248,113,113,0.36);
  border-radius: 11px;
  background: rgba(220,38,38,0.2);
  color: #fecaca;
  font-size: 8px;
  font-weight: 800;
}
.admin-user-reset-zone button:hover { background: rgba(220,38,38,0.3); }
.admin-user-history-grid { display: grid; margin-top: 14px; grid-template-columns: 1fr 1fr; gap: 9px; }
.admin-user-history-grid > section { min-width: 0; }
.admin-user-history-grid h4 { margin: 0 0 8px; font-size: 10px; }
.admin-compact-list { display: grid; gap: 6px; }
.admin-compact-row {
  display: grid;
  padding: 8px;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(20,20,40,0.6);
}
.admin-compact-row .compact-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: rgba(45,212,191,0.08); color: var(--cyan); }
.admin-compact-row strong,
.admin-compact-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-compact-row strong { font-size: 8px; }
.admin-compact-row small { margin-top: 3px; color: var(--muted); font-size: 7px; }
.admin-compact-row b { direction: ltr; font-size: 8px; }
.admin-compact-row b.positive { color: var(--green); }
.admin-compact-row b.negative { color: var(--red); }
.admin-compact-empty { margin: 0; padding: 12px; border: 1px dashed var(--border); border-radius: 11px; color: var(--muted); font-size: 8px; }

.admin-audit-list { display: grid; gap: 8px; }
.admin-audit-card {
  display: grid;
  padding: 11px;
  grid-template-columns: 36px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(25,25,48,0.68);
}
.audit-icon { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; background: rgba(139,92,246,0.1); }
.admin-audit-card strong,
.admin-audit-card small { display: block; }
.admin-audit-card strong { font-size: 10px; }
.admin-audit-card p { margin: 4px 0; color: #bbb7cd; font-size: 8px; line-height: 1.7; }
.admin-audit-card small { color: var(--muted); font-size: 7px; }
.admin-audit-card code { max-width: 78px; overflow: hidden; color: #8f88a8; direction: ltr; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.admin-audit-empty { padding: 35px 15px; }

.admin-form {
  display: grid;
  gap: 11px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(139,92,246,0.22);
  border-radius: 17px;
  background: rgba(9,9,22,0.9);
}

.form-heading { margin-bottom: 2px; }
.form-heading strong { font-size: 13px; }
.form-close { min-width: 34px; padding: 0; font-size: 19px; }
.admin-form label,
.admin-select-label {
  display: grid;
  gap: 6px;
  color: #bab6ce;
  font-size: 9px;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-select-label select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: 0;
  background: #17172d;
  color: var(--text);
  font: 11px/1.7 var(--ui-font-family);
}

.admin-form textarea { min-height: 74px; resize: vertical; }
.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus { border-color: rgba(139,92,246,0.65); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.form-grid.thirds { grid-template-columns: repeat(3, minmax(0,1fr)); }
.check-row { display: flex; flex-wrap: wrap; gap: 15px; }
.check-row label,
.single-check { display: flex; align-items: center; gap: 7px; }
.check-row input,
.single-check input { width: 16px; min-height: 16px; accent-color: var(--purple); }
.admin-select-label { margin-bottom: 11px; }
.admin-image-preview { padding: 8px; border: 1px dashed var(--border); border-radius: 13px; }
.admin-image-preview img { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: 9px; }
.admin-image-preview audio { display: block; width: 100%; }
.admin-image-preview > small { display: block; margin: 2px 2px 8px; color: #8fece0; font-size: 8px; }

@media (prefers-reduced-motion: reduce) {
  .thought-room-entry.unlocked,
  .classic-quiz-entry.mission-active,
  .classic-quiz-entry.mission-active .sdg-mode-icon,
  .thought-story-prologue,
  .thought-story-prologue article,
  .question-media.visual-media img,
  .question-media.visual-corrupted::before,
  .memory-erased-message span,
  .thought-sync.passed > i b,
  .thought-story-result { animation: none; }
}
.admin-media-story-preview { margin: 0; padding: 10px; color: #d8d3e8; font-size: 9px; line-height: 1.9; }

.ui-preview {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 10%, rgba(var(--accent-rgb), 0.2), transparent 38%),
    linear-gradient(145deg, rgba(27, 27, 52, 0.97), rgba(12, 12, 28, 0.97));
  box-shadow: 0 18px 45px rgba(var(--accent-rgb), 0.1);
}

.ui-preview-brand {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
}

.ui-preview-brand > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--purple), var(--cyan));
  color: #fff;
  font-size: calc(16px * var(--ui-preview-scale, 1));
  font-weight: 900;
}

.ui-preview-brand small,
.ui-preview-brand strong { display: block; }
.ui-preview-brand small { color: var(--purple-light); font-size: calc(7px * var(--ui-preview-scale, 1)); letter-spacing: 1.3px; }
.ui-preview-brand strong { margin-top: 3px; font-size: calc(13px * var(--ui-preview-scale, 1)); }
.ui-preview-brand b { color: var(--purple-light); font-size: calc(25px * var(--ui-preview-scale, 1)); }
.ui-preview-badge {
  display: inline-flex;
  margin-top: 18px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--purple-light);
  font-size: calc(8px * var(--ui-preview-scale, 1));
  font-weight: 800;
}
.ui-preview h4 { margin: 11px 0 6px; font-size: calc(15px * var(--ui-preview-scale, 1)); line-height: 1.8; }
.ui-preview p { margin: 0; color: var(--muted); font-size: calc(9px * var(--ui-preview-scale, 1)); line-height: 1.9; }
.ui-settings-form { margin-top: 0; }
.ui-settings-form .form-heading { margin-top: 8px; }
.ui-settings-form .form-heading small { color: var(--muted); font-size: 7px; }

.ui-preview[data-corner-style="soft"] { border-radius: 15px; }
.ui-preview[data-corner-style="soft"] .ui-preview-brand > span { border-radius: 9px; }
.ui-preview[data-corner-style="square"] { border-radius: 7px; }
.ui-preview[data-corner-style="square"] .ui-preview-brand > span,
.ui-preview[data-corner-style="square"] .ui-preview-badge { border-radius: 5px; }

body[data-corner-style="soft"] :is(
  .hero-card, .stat-card, .level-card, .mode-card, .game-choice, .question-card,
  .reward-card, .owned-card, .transaction-row, .rank-row, .online-form, .online-lobby,
  .admin-panel, .admin-item, .tournament-event-card, .profile-metric, .profile-progress-card, .profile-tasks-link
) { border-radius: 15px; }

body[data-corner-style="square"] :is(
  .hero-card, .stat-card, .level-card, .mode-card, .game-choice, .question-card,
  .reward-card, .owned-card, .transaction-row, .rank-row, .online-form, .online-lobby,
  .admin-panel, .admin-item, .tournament-event-card, .profile-metric, .profile-progress-card, .profile-tasks-link
) { border-radius: 7px; }

body[data-corner-style="square"] :is(button, input, textarea, select, .brand-mark, .mode-icon, .stat-icon) {
  border-radius: 5px;
}

.startup-overlay {
  position: fixed;
  z-index: 19;
  inset: 0;
  display: grid;
  min-height: 100dvh;
  overflow-y: auto;
  padding: max(28px, var(--safe-top)) 20px max(28px, var(--safe-bottom));
  place-items: center;
  background:
    radial-gradient(circle at 50% 15%, rgba(var(--accent-rgb), 0.25), transparent 34%),
    linear-gradient(165deg, #11112a 0%, #090916 70%);
}

.startup-glow { position: fixed; width: 190px; height: 190px; border-radius: 50%; filter: blur(80px); opacity: 0.18; pointer-events: none; }
.startup-glow-one { top: -80px; right: -70px; background: var(--purple); }
.startup-glow-two { bottom: -90px; left: -65px; background: var(--cyan); }
.startup-card {
  position: relative;
  width: min(100%, 430px);
  padding: 30px 22px 24px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px;
  background: linear-gradient(150deg, rgba(31,31,61,0.96), rgba(13,13,29,0.98));
  box-shadow: 0 28px 70px rgba(0,0,0,0.42);
  text-align: center;
  animation: startup-in 0.42s ease both;
}
@keyframes startup-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.startup-logo { display: grid; width: 67px; height: 67px; margin: 0 auto 18px; place-items: center; border-radius: 21px; background: linear-gradient(145deg, var(--purple-light), var(--purple)); box-shadow: 0 15px 38px rgba(var(--accent-rgb),0.34); font: 900 36px/1 Arial,sans-serif; transform: rotate(-5deg); }
.startup-card h2 { margin: 9px 0 10px; font-size: clamp(25px,7vw,34px); }
.startup-card > p:not(.eyebrow) { max-width: 340px; margin: 0 auto 23px; color: var(--muted); font-size: 11px; line-height: 2; }
.startup-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.startup-button { min-height: 55px; border-radius: 16px; font-size: 16px; font-weight: 900; }
.startup-button.primary { background: linear-gradient(135deg, var(--purple), #7041df); box-shadow: 0 13px 28px rgba(var(--accent-rgb),0.27); }
.startup-button.secondary { border: 1px solid rgba(45,212,191,0.24); background: rgba(45,212,191,0.09); color: #a9f5eb; }
.startup-media-stage { position: fixed; z-index: 2; inset: 0; overflow: hidden; background: #000; }
.startup-media-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.startup-playback-loading { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; background: #090916; }
.startup-playback-loading span { font-size: clamp(52px, 18vw, 82px); }
.startup-playback-loading i { position: absolute; width: 108px; height: 108px; border: 3px solid rgba(255,255,255,0.08); border-top-color: var(--purple-light); border-radius: 50%; animation: loading-ring 1s linear infinite; }
.startup-fallback-animation { position: absolute; inset: 0; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 44%, rgba(var(--accent-rgb),0.2), transparent 35%), #090916; }
.startup-fallback-animation:not([hidden]) { display: grid; }
.startup-fallback-word { display: flex; max-width: 92vw; flex-wrap: wrap; align-items: center; justify-content: center; color: #fff; font-weight: 900; line-height: 1.16; text-align: center; filter: drop-shadow(0 18px 40px rgba(var(--accent-rgb),0.42)); transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease; }
.startup-fallback-letter { display: inline-block; opacity: 0; color: #fff; transform: translateX(-110vw) scale(0.72); }
.startup-fallback-animation.running .startup-fallback-letter { animation: fallback-letter-arrive 0.72s cubic-bezier(.2,.85,.25,1.12) forwards; animation-delay: calc(var(--letter-index) * var(--letter-step)); }
.startup-fallback-word.exiting { opacity: 0; transform: scale(1.08); filter: blur(8px); }
@keyframes fallback-letter-arrive { to { opacity: 1; transform: translateX(0) scale(1); } }

.startup-button-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.startup-button-editor-head strong { font-size: 10px; }
.startup-button-editor-head button { padding: 8px 11px; border: 1px solid rgba(var(--accent-rgb),0.3); border-radius: 10px; background: rgba(var(--accent-rgb),0.1); color: var(--purple-light); font-size: 8px; font-weight: 800; }
.startup-button-editor { display: grid; gap: 8px; }
.startup-button-editor-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 7px; align-items: end; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.025); }
.startup-button-editor-row label { margin: 0; }
.startup-button-delete { min-width: 39px; height: 39px; border-radius: 11px; background: rgba(255,100,124,0.11); color: #ff9bad; font-size: 16px; }
.fallback-scene-editor { display: grid; gap: 9px; }
.fallback-scene-row { padding: 11px; border: 1px solid rgba(var(--accent-rgb),0.18); border-radius: 15px; background: rgba(var(--accent-rgb),0.035); }
.fallback-scene-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.fallback-scene-row-head strong { color: var(--purple-light); font-size: 9px; }
.fallback-scene-actions { display: flex; gap: 5px; }
.fallback-scene-actions button { width: 32px; height: 32px; padding: 0; border-radius: 9px; background: rgba(255,255,255,0.055); color: var(--muted); font-size: 12px; }
.fallback-scene-actions .fallback-scene-delete { background: rgba(255,100,124,0.11); color: #ff9bad; }
.fallback-scene-config { display: grid; grid-template-columns: minmax(0,1fr) minmax(95px,.55fr) minmax(75px,.4fr); gap: 7px; }
.fallback-scene-config label { margin: 0; }
.startup-track-editor { display: grid; gap: 8px; }
.startup-track-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid rgba(45,212,191,0.14); border-radius: 14px; background: rgba(45,212,191,0.035); }
.startup-track-row input { min-width: 0; }
.startup-track-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 7px; }
.startup-track-actions { display: flex; gap: 5px; }
.startup-track-actions button { width: 32px; height: 32px; padding: 0; border-radius: 9px; background: rgba(255,255,255,0.055); color: var(--muted); font-size: 12px; }
.startup-track-actions .startup-track-delete { background: rgba(255,100,124,0.11); color: #ff9bad; }
.startup-upload-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 9px; }
.admin-form .startup-upload-card { display: block; padding: 14px; border: 1px dashed rgba(139,92,246,0.3); border-radius: 16px; background: rgba(139,92,246,0.06); cursor: pointer; }
.startup-upload-card span,
.startup-upload-card strong,
.startup-upload-card small { display: block; }
.startup-upload-card span { color: var(--purple-light); font-size: 8px; }
.startup-upload-card strong { margin: 5px 0; color: white; font-size: 10px; }
.startup-upload-card small { min-height: 23px; color: var(--muted); font-size: 7px; line-height: 1.6; }
.startup-upload-card input { margin-top: 9px; padding: 8px; font-size: 7px; }
.startup-admin-preview { display: grid; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 16px; background: rgba(0,0,0,0.18); }
.startup-admin-preview video,
.startup-admin-preview audio { display: block; width: 100%; border-radius: 11px; }

.loading-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden { opacity: 0; visibility: hidden; }

.loading-visual { position: relative; display: grid; width: 128px; height: 128px; place-items: center; }
.loading-visual span { position: relative; z-index: 1; font-size: 62px; filter: drop-shadow(0 14px 30px rgba(var(--accent-rgb),0.42)); }
.loading-visual i { position: absolute; inset: 5px; border: 3px solid rgba(255,255,255,0.07); border-top-color: var(--purple-light); border-radius: 50%; animation: loading-ring 1s linear infinite; }
.loading-visual[data-animation="pulse"] span,
.startup-playback-loading[data-animation="pulse"] span { animation: loading-pulse 0.85s ease-in-out infinite alternate; }
.loading-visual[data-animation="spin"] span,
.startup-playback-loading[data-animation="spin"] span { animation: loading-spin 1.25s linear infinite; }
.loading-visual[data-animation="bounce"] span,
.startup-playback-loading[data-animation="bounce"] span { animation: loading-bounce 0.72s ease-in-out infinite alternate; }
@keyframes loading-ring { to { transform: rotate(360deg); } }
@keyframes loading-pulse { to { transform: scale(1.16); } }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@keyframes loading-bounce { to { transform: translateY(-16px) scale(1.05); } }

.toast {
  position: fixed;
  z-index: 30;
  right: 50%;
  bottom: calc(96px + var(--safe-bottom));
  width: min(calc(100% - 40px), 440px);
  padding: 13px 16px;
  transform: translate(50%, 20px);
  border: 1px solid rgba(255, 100, 124, 0.3);
  border-radius: 14px;
  background: #321925;
  box-shadow: 0 14px 35px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  color: #ffd6dc;
  font-size: 12px;
  line-height: 1.7;
  transition: 0.25s ease;
}

.toast.visible { opacity: 1; visibility: visible; transform: translate(50%, 0); }
.toast.success { border-color: rgba(57,217,138,0.3); background: #123125; color: #cdfde3; }

@media (min-width: 700px) {
  body { padding: 25px 0; }
  .app-shell {
    min-height: calc(100vh - 50px);
    border: 1px solid var(--border);
    border-radius: 34px;
    background: rgba(9, 9, 22, 0.82);
    box-shadow: 0 28px 90px rgba(0,0,0,0.4);
  }
  .bottom-nav { bottom: 25px; border: 1px solid var(--border); border-radius: 0 0 34px 34px; }
  .profile-drawer { top: 25px; bottom: 25px; left: calc((100vw - 520px) / 2); }
}

@media (min-width: 900px) {
  .profile-menu-backdrop {
    background: rgba(4, 4, 13, .54);
    backdrop-filter: blur(7px);
  }

  .profile-drawer {
    top: 78px;
    right: auto;
    bottom: auto;
    left: 50%;
    display: grid;
    width: min(760px, calc(100vw - 64px));
    max-height: calc(100vh - 120px);
    padding: 23px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    border: 1px solid rgba(var(--accent-rgb), .3);
    border-radius: 28px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .52);
    transform: translateX(-50%);
    animation: profile-desktop-in .3s cubic-bezier(.2, .78, .2, 1) both;
  }

  .profile-drawer-head,
  .profile-tasks-link {
    grid-column: 1 / -1;
  }

  .profile-drawer-head {
    margin-bottom: 4px;
  }

  .profile-identity {
    min-height: 112px;
    padding: 20px;
  }

  .profile-drawer-avatar {
    width: 66px;
    height: 66px;
    font-size: 23px;
  }

  .profile-identity strong { font-size: 17px; }
  .profile-identity small { font-size: 10px; }

  .profile-metrics {
    margin: 0;
    gap: 12px;
  }

  .profile-metric {
    min-height: 112px;
    align-content: center;
  }

  .profile-progress-card {
    margin-top: 0;
    padding: 16px;
  }

  .profile-tasks-link {
    margin-top: 2px;
    padding: 15px 17px;
  }
}

@keyframes profile-desktop-in {
  from { opacity: .35; transform: translate(-50%, -14px) scale(.97); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@media (max-width: 380px) {
  .app-shell { padding-right: 15px; padding-left: 15px; }
  .hero-card { padding: 21px; }
  .hero-copy h2 { font-size: 25px; }
  .trophy { left: -6px; transform: scale(0.86) rotate(-8deg); }
  .stat-card { padding: 12px; }
  .stat-icon { width: 34px; height: 34px; }
  .form-grid,
  .form-grid.thirds { grid-template-columns: 1fr; }
  .fallback-scene-config { grid-template-columns: 1fr; }
  .startup-upload-grid { grid-template-columns: 1fr; }
  .admin-item { grid-template-columns: 36px minmax(0,1fr); }
  .admin-item > button,
  .admin-item-actions { grid-column: 1 / -1; justify-self: stretch; }
  .admin-item-actions button { flex: 1; }
  .owned-summary { grid-template-columns: 44px 1fr; }
  .owned-summary > button { grid-column: 1 / -1; }
  .admin-user-history-grid { grid-template-columns: 1fr; }
  .admin-user-reset-zone { grid-template-columns: 1fr; }
  .admin-user-reset-zone button { width: 100%; }
  .admin-audit-card { grid-template-columns: 32px minmax(0,1fr); }
  .admin-audit-card code { grid-column: 2; max-width: none; }
}

.story-teaser {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  margin: 14px 0 20px; padding: 15px; color: var(--text); text-align: right;
  border: 1px solid rgba(80,230,255,.25); border-radius: 24px;
  background: linear-gradient(125deg, rgba(20,46,68,.92), rgba(31,19,66,.92));
  box-shadow: 0 14px 36px rgba(0,0,0,.22);
}
.story-teaser[hidden] { display: none; }
.story-teaser-signal, .story-hero-icon {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px;
  font-size: 24px; background: rgba(75,224,255,.12); box-shadow: inset 0 0 0 1px rgba(75,224,255,.18);
}
.story-teaser-copy { min-width: 0; }
.story-teaser-copy small, .story-teaser-copy strong { display: block; }
.story-teaser-copy small { color: var(--cyan); margin-bottom: 3px; }
.story-teaser-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-teaser-copy i, .story-progress {
  display: block; height: 5px; margin-top: 9px; overflow: hidden; border-radius: 99px;
  background: rgba(255,255,255,.1);
}
.story-teaser-copy i b, .story-progress i {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--purple)); transition: width .35s ease;
}
.story-memory { text-align: center; }
.story-memory b { display: block; color: var(--cyan); font-size: 20px; }
.story-memory small { color: var(--muted); font-size: 10px; }
.story-hero {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 18px;
  border: 1px solid rgba(75,224,255,.2); border-radius: 24px;
  background: radial-gradient(circle at 15% 10%, rgba(75,224,255,.16), transparent 42%), #111529;
}
.story-hero p { margin: 6px 0 0; color: var(--muted); line-height: 1.8; }
.story-hero > b { grid-column: 1 / -1; color: var(--cyan); }
.story-characters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.story-characters article {
  display: flex; align-items: center; gap: 10px; padding: 13px; border-radius: 18px;
  background: rgba(29,33,60,.82); border: 1px solid rgba(75,224,255,.13);
}
.story-characters article.rival { border-color: rgba(166,102,255,.24); }
.story-characters article > span { font-size: 22px; }
.story-characters small, .story-characters strong { display: block; }
.story-characters small { color: var(--muted); font-size: 10px; }
.story-scene {
  padding: 18px; margin: 12px 0; border-radius: 22px; border: 1px solid rgba(167,104,255,.35);
  background: linear-gradient(145deg, rgba(60,31,94,.92), rgba(18,22,44,.96));
}
.story-speaker { display: flex; align-items: center; gap: 8px; }
.story-speaker span { font-size: 22px; }
.story-speaker small { margin-right: auto; color: var(--cyan); }
.story-scene p { line-height: 1.95; }
.story-scene button {
  width: 100%; padding: 11px; color: var(--text); border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px; background: rgba(255,255,255,.06);
}
.story-current { margin-top: 18px; }
.story-mission-card { padding: 17px; border-radius: 22px; background: rgba(18,22,43,.94); border: 1px solid rgba(255,255,255,.09); }
.story-mission-card.active { border-color: rgba(75,224,255,.32); }
.story-mission-head { display: flex; align-items: center; gap: 10px; }
.story-mission-head > span { font-size: 26px; }
.story-mission-head div { min-width: 0; }
.story-mission-head small, .story-mission-head strong { display: block; }
.story-mission-head small { color: var(--muted); }
.story-mission-head > b { margin-right: auto; color: var(--cyan); font-size: 12px; }
.story-mission-card > p { color: var(--muted); line-height: 1.85; }
.story-objectives { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.story-objectives span { padding: 10px; border-radius: 13px; background: rgba(255,255,255,.05); font-size: 11px; }
.story-objectives b { display: block; margin-bottom: 3px; color: var(--cyan); }
.story-mission-card .primary-button { margin-top: 14px; }
.story-archive-heading { margin-top: 22px; }
.story-chapter-card { padding: 15px; margin-bottom: 10px; border-radius: 20px; background: rgba(17,20,39,.88); }
.story-chapter-title { display: flex; align-items: center; gap: 9px; }
.story-chapter-title > div { min-width: 0; }
.story-chapter-future-badge { margin-right: auto; padding: 6px 8px; border-radius: 9px; background: rgba(139,92,246,.1); color: #a99acb; font-size: 7px; white-space: nowrap; }
.story-chapter-card.future { opacity: .62; border: 1px dashed rgba(139,92,246,.18); background: rgba(17,20,39,.55); }
.story-chapter-title span { font-size: 22px; }
.story-chapter-title small { display: block; color: var(--muted); margin-top: 3px; }
.story-file-list { display: grid; gap: 7px; margin-top: 12px; }
.story-file {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 10px;
  border-radius: 14px; background: rgba(255,255,255,.04);
}
.story-file.locked { opacity: .5; }
.story-file.completed { background: rgba(63,220,161,.08); }
.story-file small { color: var(--muted); }
.story-file > b { color: var(--cyan); font-size: 11px; }
.story-admin-section { margin-top: 22px; }

.story-event-overlay {
  position: fixed;
  z-index: 24;
  inset: 0;
  display: grid;
  min-height: 100dvh;
  overflow: hidden;
  padding: max(24px, var(--safe-top)) 20px max(24px, var(--safe-bottom));
  place-items: center;
  background:
    radial-gradient(circle at 50% 46%, rgba(142, 57, 255, .2), transparent 42%),
    rgba(5, 5, 15, .96);
  isolation: isolate;
  animation: story-event-arrive .42s cubic-bezier(.2, .85, .2, 1) both;
}
.story-event-static,
.story-event-scanline { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.story-event-static {
  opacity: .23;
  background-image:
    repeating-radial-gradient(circle at 12% 25%, transparent 0 1px, rgba(255,255,255,.22) 1px 2px),
    repeating-linear-gradient(90deg, rgba(128,48,255,.08) 0 1px, transparent 1px 4px);
  background-size: 6px 5px, 9px 100%;
  animation: story-static .16s steps(2) infinite;
}
.story-event-scanline {
  opacity: .33;
  background: linear-gradient(transparent 0 46%, rgba(92, 232, 255, .24) 49%, transparent 52% 100%);
  background-size: 100% 150px;
  animation: story-scan 2.1s linear infinite;
}
.story-event-dialog {
  position: relative;
  width: min(100%, 440px);
  overflow: hidden;
  padding: 26px 22px 22px;
  border: 1px solid rgba(176, 113, 255, .46);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(38, 18, 68, .96), rgba(10, 14, 31, .98));
  box-shadow: 0 0 0 1px rgba(75, 224, 255, .06) inset, 0 28px 80px rgba(0, 0, 0, .58), 0 0 56px rgba(135, 57, 255, .15);
  text-align: center;
  animation: story-dialog-glitch .55s steps(2) both;
}
.story-event-dialog::before,
.story-event-dialog::after {
  position: absolute;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c66cff, #56ebff, transparent);
  content: "";
}
.story-event-dialog::before { top: 0; }
.story-event-dialog::after { bottom: 0; opacity: .44; }
.story-event-channel { display: flex; align-items: center; gap: 7px; color: #69e8ff; font-size: 9px; letter-spacing: .6px; }
.story-event-channel i { width: 7px; height: 7px; border-radius: 50%; background: #69e8ff; box-shadow: 0 0 12px #69e8ff; animation: story-signal-pulse .65s ease-in-out infinite alternate; }
.story-event-channel b { margin-right: auto; color: #cfa6ff; font-size: 7px; letter-spacing: 1.4px; }
.story-event-icon {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 24px auto 10px;
  place-items: center;
  border: 1px solid rgba(195, 124, 255, .42);
  border-radius: 23px;
  background: rgba(139, 65, 255, .14);
  box-shadow: 0 0 34px rgba(139, 65, 255, .22);
  font-size: 35px;
}
.story-event-speaker { display: block; color: #68e9ff; font-size: 11px; font-weight: 900; }
.story-event-dialog h2 { margin: 8px 0 14px; font-size: clamp(24px, 7vw, 32px); line-height: 1.5; text-shadow: 2px 0 rgba(255, 65, 158, .42), -2px 0 rgba(64, 228, 255, .42); }
.story-event-dialog p { min-height: 92px; margin: 0; color: #ddd8ef; font-size: 14px; line-height: 2.05; }
.story-event-continue { margin-top: 23px; background: linear-gradient(115deg, #7136d8, #176779); box-shadow: 0 12px 30px rgba(67, 45, 180, .28); }
.story-event-overlay[data-effect="signal"] { background: radial-gradient(circle, rgba(28, 139, 161, .2), transparent 45%), rgba(5, 10, 17, .97); }
.story-event-overlay[data-effect="signal"] .story-event-dialog { border-color: rgba(75, 224, 255, .46); background: linear-gradient(145deg, rgba(12, 52, 65, .97), rgba(10, 14, 31, .98)); }
.story-event-overlay[data-effect="warning"] { background: radial-gradient(circle, rgba(255, 82, 108, .2), transparent 45%), rgba(12, 5, 10, .97); }
.story-event-overlay[data-effect="warning"] .story-event-dialog { border-color: rgba(255, 100, 124, .55); background: linear-gradient(145deg, rgba(69, 19, 34, .97), rgba(20, 9, 18, .98)); }
.question-card.story-interrupted { animation: story-question-return .5s ease-out both; }

@keyframes story-event-arrive { from { opacity: 0; } 35% { opacity: .38; } 45% { opacity: .1; } to { opacity: 1; } }
@keyframes story-dialog-glitch { 0% { opacity: 0; transform: translate(14px, -4px) skewX(4deg) scale(.96); } 32% { opacity: 1; transform: translate(-8px, 3px) skewX(-3deg); } 58% { transform: translate(5px, 0) skewX(1deg); } 100% { transform: none; } }
@keyframes story-static { 0% { transform: translate(0); } 50% { transform: translate(3px, -2px); } 100% { transform: translate(-2px, 3px); } }
@keyframes story-scan { from { background-position-y: -150px; } to { background-position-y: calc(100vh + 150px); } }
@keyframes story-signal-pulse { to { opacity: .35; transform: scale(.72); } }
@keyframes story-question-return { from { opacity: .35; filter: blur(5px); transform: scale(.985); } to { opacity: 1; filter: none; transform: none; } }

@media (max-width: 390px) { .story-characters, .story-objectives { grid-template-columns: 1fr; } }

/* Archive 0 command center */
.archive-header { align-items: flex-start; }
.archive-header > div:first-child small { display: block; margin-top: 5px; color: #7f7b91; font-size: 9px; }
.archive-header-actions { display: flex; align-items: center; gap: 8px; }
.archive-memory-pill { padding: 8px 10px; border: 1px solid rgba(75,224,255,.18); border-radius: 12px; background: rgba(75,224,255,.07); color: #8a8798; font-size: 8px; white-space: nowrap; }
.archive-memory-pill b { margin-left: 3px; color: var(--cyan); font-size: 13px; }
.archive-hub-nav { position: sticky; z-index: 7; top: 7px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 18px; padding: 6px; border: 1px solid rgba(255,255,255,.08); border-radius: 20px; background: rgba(11,13,27,.92); box-shadow: 0 14px 38px rgba(0,0,0,.24); backdrop-filter: blur(16px); }
.archive-hub-nav button { position: relative; display: grid; min-width: 0; padding: 9px 3px 8px; place-items: center; gap: 5px; border-radius: 14px; color: #777389; background: transparent; }
.archive-hub-nav button span { font: 900 15px/1 Arial,sans-serif; }
.archive-hub-nav button b { font-size: 8px; white-space: nowrap; }
.archive-hub-nav button i { position: absolute; top: 4px; right: calc(50% - 21px); display: grid; min-width: 15px; height: 15px; padding: 0 3px; place-items: center; border: 2px solid #111424; border-radius: 99px; background: #ff5f7b; color: white; font: normal 700 7px/1 Tahoma,sans-serif; }
.archive-hub-nav button i:empty,
.archive-hub-nav button i[data-empty="true"] { display: none; }
.archive-hub-nav button.active { color: #e8fbff; background: linear-gradient(145deg, rgba(46,207,212,.18), rgba(115,74,219,.17)); box-shadow: inset 0 0 0 1px rgba(102,226,236,.17); }
.archive-hub-panel { animation: archive-panel-in .34s cubic-bezier(.2,.8,.2,1) both; }
.archive-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 6px 2px 14px; }
.archive-panel-heading small { color: #5edfd7; font: 700 7px/1 Arial,sans-serif; letter-spacing: 1px; }
.archive-panel-heading h3 { margin: 5px 0 0; font-size: 16px; }
.archive-panel-heading > span { color: #817d91; font-size: 8px; }
.archive-character-filter { display: flex; gap: 7px; margin: 12px 0; overflow-x: auto; scrollbar-width: none; }
.archive-character-filter button { min-width: 64px; padding: 8px 13px; border: 1px solid rgba(255,255,255,.07); border-radius: 99px; background: rgba(255,255,255,.035); color: #817d90; font-size: 8px; }
.archive-character-filter button.active { border-color: rgba(80,225,217,.28); background: rgba(80,225,217,.1); color: #9ff8f0; }
.archive-message-list { display: grid; gap: 9px; }
.archive-message-card { position: relative; display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 10px; padding: 13px; overflow: hidden; border: 1px solid rgba(255,255,255,.07); border-radius: 18px; background: linear-gradient(145deg, rgba(20,23,42,.92), rgba(13,15,30,.94)); }
.archive-message-card.rival { border-color: rgba(166,102,255,.18); }
.archive-message-card.unread::after { content: ""; position: absolute; top: 12px; left: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.archive-message-avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; background: rgba(70,224,215,.1); font-size: 20px; }
.archive-message-card.rival .archive-message-avatar { background: rgba(166,102,255,.12); }
.archive-message-copy { min-width: 0; }
.archive-message-copy header { display: flex; align-items: center; gap: 7px; }
.archive-message-copy header strong { font-size: 10px; }
.archive-message-copy header small { margin-right: auto; color: #6f6b7e; font-size: 7px; }
.archive-message-copy h4 { margin: 7px 0 4px; color: #e6e2f2; font-size: 10px; }
.archive-message-copy p { margin: 0; color: #9d99aa; font-size: 9px; line-height: 1.9; }
.archive-status-strip { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 13px; border: 1px solid rgba(75,224,255,.13); border-radius: 19px; background: rgba(16,22,38,.82); }
.archive-status-strip small { color: #62ddd6; font: 700 7px/1 Arial,sans-serif; }
.archive-status-strip p { margin: 5px 0 0; color: #8f8b9d; font-size: 8px; line-height: 1.7; }
.archive-status-strip > b { color: #b5f9f2; font-size: 9px; }
.archive-season-summary { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 9px; margin-top: 9px; padding: 12px 13px; border: 1px solid rgba(255,255,255,.07); border-radius: 18px; background: rgba(255,255,255,.025); }
.archive-season-summary > div:first-child small { display: block; color: #5fe0d7; font: 800 7px/1 Arial,sans-serif; letter-spacing: 1px; }
.archive-season-summary > div:first-child strong { display: block; margin-top: 5px; font-size: 11px; }
.archive-season-summary > span { min-width: 70px; padding: 7px 9px; border-radius: 12px; background: rgba(255,255,255,.04); text-align: center; }
.archive-season-summary > span b, .archive-season-summary > span small { display: block; }
.archive-season-summary > span b { color: #9ef4ec; font-size: 11px; }
.archive-season-summary > span b.complete { color: #5cf0aa; }
.archive-season-summary > span small { margin-top: 3px; color: #777386; font-size: 7px; }
.archive-season-nodes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.archive-season-nodes i { display: grid; height: 22px; place-items: center; border-radius: 8px; background: rgba(255,255,255,.045); color: #656173; font: normal 800 8px/1 Arial,sans-serif; }
.archive-season-nodes i.active { color: #bafff8; background: rgba(58,218,205,.14); box-shadow: inset 0 0 0 1px rgba(75,225,215,.22); }
.archive-season-nodes i.done { color: #071513; background: #55dfca; }
.story-objectives em { display: block; color: #8e8a9c; font-style: normal; }
.archive-character-files { display: grid; gap: 10px; }
.archive-character-file { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 12px; padding: 15px; border: 1px solid rgba(255,255,255,.08); border-radius: 20px; background: rgba(17,20,38,.9); }
.archive-character-file.locked { opacity: .58; filter: grayscale(.4); }
.archive-character-file > span { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 17px; background: linear-gradient(145deg, rgba(63,221,202,.15), rgba(107,76,211,.14)); font-size: 25px; }
.archive-character-file header { display: flex; align-items: center; gap: 7px; }
.archive-character-file header small { margin-right: auto; color: #66dcd4; font-size: 7px; }
.archive-character-file p { margin: 7px 0 0; color: #a09cad; font-size: 9px; line-height: 1.9; }
.archive-character-file footer { margin-top: 8px; color: #817c91; font-size: 7px; }
.archive-lore-card { margin-bottom: 18px; }
.archive-help-card { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 13px; padding: 17px; border: 1px solid rgba(75,224,255,.18); border-radius: 22px; background: linear-gradient(145deg, rgba(21,50,58,.45), rgba(17,18,37,.92)); }
.archive-help-card > span { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 18px; background: rgba(75,224,255,.12); color: var(--cyan); font: 900 26px/1 Arial,sans-serif; }
.archive-help-card small { color: #62ddd6; font: 700 7px/1 Arial,sans-serif; }
.archive-help-card h3 { margin: 5px 0 6px; }
.archive-help-card p { margin: 0; color: #aaa6b7; font-size: 9px; line-height: 1.95; }
.archive-help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.archive-help-grid article { padding: 13px; border: 1px solid rgba(255,255,255,.07); border-radius: 17px; background: rgba(255,255,255,.035); }
.archive-help-grid b { color: #5fe0d7; font: 900 13px/1 Arial,sans-serif; }
.archive-help-grid strong { display: block; margin: 8px 0 5px; font-size: 9px; }
.archive-help-grid p { margin: 0; color: #858192; font-size: 8px; line-height: 1.75; }

/* Timed Archive missions and cinematics */
.archive-task-screen { min-height: 100vh; background: radial-gradient(circle at 50% 20%, rgba(34,171,174,.12), transparent 36%); }
.archive-task-stage { width: min(100%, 560px); margin: 0 auto; padding-bottom: 25px; }
.archive-task-visual { position: relative; display: grid; width: min(190px, 55vw); aspect-ratio: 1; margin: 7px auto 18px; place-items: center; }
.archive-task-visual::before,
.archive-task-visual::after,
.archive-task-visual i { content: ""; position: absolute; border: 1px solid rgba(74,232,222,.2); border-radius: 50%; inset: 10%; animation: archive-orbit 9s linear infinite; }
.archive-task-visual::after { inset: 24%; border-style: dashed; border-color: rgba(170,108,255,.28); animation-direction: reverse; animation-duration: 6s; }
.archive-task-visual i:nth-child(1) { inset: 2%; border-color: rgba(74,232,222,.1); animation-duration: 13s; }
.archive-task-visual i:nth-child(2) { inset: 34%; background: rgba(67,217,207,.06); animation-duration: 4s; }
.archive-task-visual i:nth-child(3) { inset: 44%; border: 0; background: rgba(150,100,255,.2); box-shadow: 0 0 45px rgba(86,218,219,.22); animation: archive-core 1.8s ease-in-out infinite alternate; }
.archive-task-visual span { z-index: 2; color: #b8fff8; font: 900 24px/1 Arial,sans-serif; letter-spacing: 3px; text-shadow: 0 0 20px rgba(69,231,219,.5); }
.archive-cinematic { position: relative; min-height: 220px; margin: 7px 0 18px; overflow: hidden; border: 1px solid rgba(97,226,220,.2); border-radius: 24px; background: #050811; }
.archive-cinematic video { display: block; width: 100%; min-height: 220px; max-height: 55vh; object-fit: cover; }
.archive-cinematic-fallback { position: absolute; display: grid; place-items: center; inset: 0; background: radial-gradient(circle, rgba(45,182,184,.19), transparent 38%), repeating-linear-gradient(0deg, transparent 0 5px, rgba(255,255,255,.02) 5px 6px), #070a14; }
.archive-cinematic-fallback span { color: #7cf4e9; font-size: 54px; animation: archive-core 1.5s ease-in-out infinite alternate; }
.archive-cinematic-fallback b { color: #aea8c2; font: 800 8px/1 Arial,sans-serif; letter-spacing: 1.6px; }
.archive-cinematic-fallback i { position: absolute; width: 2px; height: 100%; background: linear-gradient(transparent, #62ddd6, transparent); animation: cinematic-scan 3s linear infinite; }
.archive-task-meta { display: flex; align-items: center; justify-content: space-between; color: #817d91; font-size: 8px; }
.archive-task-meta b { display: flex; align-items: center; gap: 5px; color: #72ded6; font-size: 8px; }
.archive-task-meta b i { width: 6px; height: 6px; border-radius: 50%; background: #45dfbd; box-shadow: 0 0 10px #45dfbd; animation: story-signal-pulse .7s ease-in-out infinite alternate; }
.archive-task-meta b.danger { color: #ff6d87; }
.archive-task-meta b.danger i { background: #ff5d78; box-shadow: 0 0 10px #ff5d78; }
.archive-task-track { height: 5px; margin: 9px 0; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.06); }
.archive-task-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #35d9c9, #8b5cf6); transition: width .45s ease; }
.archive-task-checkpoints { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 13px; }
.archive-task-checkpoints i { flex: 1; height: 3px; border-radius: 99px; background: rgba(255,255,255,.07); transition: .3s ease; }
.archive-task-checkpoints i.done { background: #48ddc8; box-shadow: 0 0 8px rgba(72,221,200,.35); }
.archive-task-checkpoints i.current { background: rgba(139,92,246,.48); animation: story-signal-pulse .8s ease-in-out infinite alternate; }
.archive-task-card { padding: 18px 15px 15px; border: 1px solid rgba(74,229,219,.16); border-radius: 22px; background: linear-gradient(155deg, rgba(18,27,42,.98), rgba(12,13,28,.98)); box-shadow: 0 14px 38px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.03); }
.archive-task-card > small { color: #63ded5; font: 800 8px/1 Arial,sans-serif; letter-spacing: 1px; }
.archive-task-card h2 { margin: 9px 0 7px; color: #8bebe2; font-size: 10px; line-height: 1.4; }
.archive-task-card > p { min-height: 42px; margin: 8px 0 13px; color: #eeeaf5; font-size: clamp(15px, 4.2vw, 19px); font-weight: 800; line-height: 1.8; }
.archive-task-media { min-height: 0; max-height: min(34vh, 240px); margin: 10px 0 6px; overflow: hidden; border-radius: 17px; }
.archive-task-media.visual-media img { width: 100%; max-height: min(34vh, 240px); object-fit: cover; }
.archive-task-media.story-media { padding: 11px; }
.archive-task-media.story-media p { font-size: 10px; }
.archive-task-media.audio-media { max-height: none; }
.archive-question-clock { height: 4px; margin: 0 0 12px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.06); }
.archive-question-clock i { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3bd8c9, #8f63ed); transition: width .08s linear; }
.archive-task-choices { display: grid; gap: 9px; }
.archive-task-choice { position: relative; display: flex; min-height: 64px; align-items: center; gap: 12px; padding: 12px 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 17px; background: rgba(255,255,255,.045); color: #e2deeb; text-align: right; font-size: clamp(13px, 3.7vw, 16px); font-weight: 800; line-height: 1.65; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .1s ease, border-color .16s ease, background .16s ease, color .16s ease; }
.archive-task-choice::before { content: attr(data-option-label); display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(111,224,215,.16); border-radius: 12px; background: rgba(80,214,206,.065); color: #77dcd5; font: 800 11px/1 Arial,sans-serif; }
.archive-task-choice:active { transform: scale(.985); }
.archive-task-choice.selected { border-color: rgba(67,221,205,.55); background: linear-gradient(145deg, rgba(67,221,205,.18), rgba(93,74,201,.09)); color: #dcfffb; box-shadow: 0 10px 28px rgba(41,198,187,.09), inset 0 0 0 1px rgba(75,227,215,.08); transform: translateX(-3px); }
.archive-task-choice.selected::before { border-color: rgba(101,239,227,.5); background: rgba(75,225,212,.18); color: #d8fffb; box-shadow: 0 0 18px rgba(65,219,208,.16); }
.archive-task-choice:disabled { cursor: default; opacity: .43; }
.archive-task-stage.answer-correct .archive-task-card { animation: archive-answer-correct .34s ease both; }
.archive-task-stage.answer-wrong .archive-task-card { animation: archive-answer-wrong .34s ease both; }
.archive-task-card .primary-button { margin-top: 13px; }
.archive-task-card > em { display: block; margin-top: 10px; color: #777386; font-size: 8px; font-style: normal; text-align: center; }
.admin-story-cinematic-upload { padding: 12px; border: 1px dashed rgba(128,105,211,.28); border-radius: 16px; background: rgba(128,105,211,.05); }
.admin-story-cinematic-upload small { display: block; margin-top: 5px; color: #8a8598; }
@keyframes archive-panel-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes archive-orbit { to { transform: rotate(360deg); } }
@keyframes archive-core { to { opacity: .45; transform: scale(.86); } }
@keyframes cinematic-scan { from { left: -5%; } to { left: 105%; } }
@keyframes archive-answer-correct { 45% { border-color: rgba(74,239,174,.72); box-shadow: 0 0 32px rgba(51,220,161,.16); } }
@keyframes archive-answer-wrong { 32% { transform: translateX(3px); border-color: rgba(255,87,120,.68); } 65% { transform: translateX(-3px); } }
@media (max-width: 390px) { .archive-help-grid { grid-template-columns: 1fr; } .archive-status-strip { grid-template-columns: 40px minmax(0,1fr); } .archive-status-strip > b { grid-column: 1 / -1; } .archive-season-summary { grid-template-columns: 1fr 1fr; } .archive-season-summary > div:first-child { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .archive-hub-panel, .archive-task-visual::before, .archive-task-visual::after, .archive-task-visual i, .archive-cinematic-fallback i { animation: none; } }

/* Narrative entry: AIA -> Archive 0 --------------------------------------- */
.home-awaiting-reveal .home-reveal-item { opacity: 0; visibility: hidden; }

.aia-entry-screen {
  position: relative;
  min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 40px);
  overflow: hidden;
  padding: clamp(38px, 9vh, 82px) 0 28px;
  isolation: isolate;
}
.aia-entry-screen::before {
  position: fixed; z-index: -2; inset: 0; content: ""; pointer-events: none;
  background:
    radial-gradient(circle at 50% 34%, rgba(45,212,191,.18), transparent 33%),
    radial-gradient(circle at 15% 90%, rgba(139,92,246,.13), transparent 34%),
    #070b15;
}
.aia-entry-noise {
  position: fixed; z-index: -1; inset: 0; opacity: .2; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(94,241,225,.04) 4px 5px),
    repeating-radial-gradient(circle at 20% 30%, transparent 0 2px, rgba(255,255,255,.08) 2px 3px);
  background-size: 100% 100%, 8px 7px;
  animation: aia-entry-static .18s steps(2) infinite;
}
.aia-entry-terminal {
  position: relative; overflow: hidden; width: min(100%, 440px); min-height: 600px; padding: 22px 20px 24px;
  margin: 0 auto; border: 1px solid rgba(71,236,219,.34); border-radius: 28px;
  background: linear-gradient(155deg, rgba(12,43,49,.97), rgba(9,13,27,.98) 58%, rgba(25,15,48,.98));
  box-shadow: 0 28px 80px rgba(0,0,0,.5), 0 0 52px rgba(45,212,191,.08) inset;
  text-align: center;
}
.aia-entry-terminal::before,
.aia-entry-terminal::after {
  position: absolute; right: 0; left: 0; height: 2px; content: "";
  background: linear-gradient(90deg, transparent, rgba(45,212,191,.92), rgba(175,112,255,.8), transparent);
}
.aia-entry-terminal::before { top: 0; }
.aia-entry-terminal::after { bottom: 0; opacity: .42; }
.aia-entry-channel { display: flex; align-items: center; gap: 7px; color: #64ecdc; font-size: 8px; letter-spacing: 1.2px; }
.aia-entry-channel i { width: 7px; height: 7px; border-radius: 50%; background: #54efd8; box-shadow: 0 0 14px #54efd8; animation: recovery-pulse .7s ease-in-out infinite alternate; }
.aia-entry-channel b { margin-right: auto; color: #c7a7ff; font-size: 7px; letter-spacing: 1.4px; }
.aia-entry-core { position: relative; display: grid; width: 116px; height: 116px; margin: 48px auto 29px; place-items: center; }
.aia-entry-core span {
  position: relative; z-index: 2; display: grid; width: 70px; height: 70px; place-items: center;
  border: 1px solid rgba(78,238,219,.5); border-radius: 23px; color: #7af3e4;
  background: rgba(45,212,191,.08); box-shadow: 0 0 34px rgba(45,212,191,.18); font: 900 17px/1 Arial,sans-serif;
  letter-spacing: 2px;
}
.aia-entry-core i { position: absolute; inset: 7px; border: 1px solid rgba(77,238,220,.22); border-radius: 50%; animation: aia-ring 3.3s linear infinite; }
.aia-entry-core i:nth-of-type(2) { inset: 0; border-style: dashed; animation-duration: 5.5s; animation-direction: reverse; }
.aia-entry-core i:nth-of-type(3) { inset: 18px; border-color: rgba(177,111,255,.25); animation-duration: 2.4s; }
.aia-entry-terminal > .eyebrow { color: #67ebdd; }
.aia-entry-terminal h2 { margin: 8px 0 20px; font-size: clamp(25px,7vw,34px); }
.aia-entry-message {
  min-height: 142px; margin: 0; padding: 17px 15px; border: 1px solid rgba(255,255,255,.07);
  border-radius: 18px; color: #e3f5f3; background: rgba(0,0,0,.18); font: 700 13px/2.15 var(--ui-font-family);
  text-align: right;
}
.aia-entry-message i {
  display: inline-block; width: 2px; height: 1.25em; margin-right: 3px; vertical-align: -.18em;
  background: #69f3e1; box-shadow: 0 0 9px #69f3e1; animation: aia-cursor .58s steps(1) infinite;
}
.aia-entry-message i.finished { animation-duration: 1s; opacity: .65; }
.aia-entry-route { display: flex; align-items: center; gap: 9px; margin: 20px 3px 17px; color: #625f76; font-size: 8px; letter-spacing: 1px; }
.aia-entry-route i { flex: 1; height: 1px; overflow: visible; background: linear-gradient(90deg, #3f4050, #51e4d3); }
.aia-entry-route i::after { display: block; width: 8px; height: 8px; margin: -3.5px 100% 0 0; border-radius: 50%; background: #51e4d3; box-shadow: 0 0 12px #51e4d3; content: ""; animation: aia-route-dot 1.7s ease-in-out infinite; }
.aia-entry-route strong { color: #74eadc; }
.aia-entry-terminal .primary-button { width: 100%; background: linear-gradient(115deg, #157e7a, #6640cb); box-shadow: 0 13px 34px rgba(30,141,137,.24); }

@keyframes aia-entry-static { 50% { transform: translate(2px,-1px); } to { transform: translate(-1px,2px); } }
@keyframes aia-ring { to { transform: rotate(360deg); } }
@keyframes aia-cursor { 50% { opacity: 0; } }
@keyframes aia-route-dot { from { transform: translateX(0); opacity: .15; } 50% { opacity: 1; } to { transform: translateX(calc(-100% - 165px)); opacity: .1; } }

/* Recovery motion language ------------------------------------------------- */
.motion-item { transform-origin: center; will-change: opacity, transform, filter; }
.motion-item.motion-run[data-motion="fade"], .screen.motion-run[data-motion="fade"] { animation: motion-fade-in .44s ease-out both; }
.motion-item.motion-run[data-motion="slide"], .screen.motion-run[data-motion="slide"] { animation: motion-slide-in .52s cubic-bezier(.18,.82,.24,1) both; }
.motion-item.motion-run[data-motion="scale"], .screen.motion-run[data-motion="scale"] { animation: motion-scale-in .42s cubic-bezier(.2,.9,.25,1.15) both; }
.motion-item.motion-run[data-motion="glitch"], .screen.motion-run[data-motion="glitch"] { animation: motion-glitch-in .52s steps(2,end) both; }
.motion-item.motion-run[data-motion="signal"], .screen.motion-run[data-motion="signal"] { animation: motion-signal-in .62s cubic-bezier(.2,.8,.2,1) both; }
.motion-item.motion-leave[data-motion="fade"] { animation: motion-fade-out .26s ease-in both; }
.motion-item.motion-leave[data-motion="slide"] { animation: motion-slide-out .3s ease-in both; }
.motion-item.motion-leave[data-motion="scale"] { animation: motion-scale-out .25s ease-in both; }
.motion-item.motion-leave[data-motion="glitch"], .motion-item.motion-leave[data-motion="signal"] { animation: motion-glitch-out .28s steps(2,end) both; }

.aia-home-message {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  overflow: hidden; padding: 13px 14px; margin: 13px 0; border: 1px solid rgba(75,224,255,.22);
  border-radius: 19px; background: linear-gradient(120deg, rgba(12,53,66,.72), rgba(16,19,40,.9));
  box-shadow: 0 14px 38px rgba(0,0,0,.2);
}
.aia-home-message > span {
  display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(75,224,255,.4);
  border-radius: 14px; color: var(--cyan); background: rgba(75,224,255,.08); font-size: 11px; font-weight: 900;
  letter-spacing: 1px; box-shadow: 0 0 22px rgba(75,224,255,.14);
}
.aia-home-message small { color: var(--cyan); font-size: 8px; letter-spacing: 1.4px; }
.aia-home-message p { margin: 3px 0 0; color: #dfe8f4; font-size: 11px; line-height: 1.75; }
.aia-home-message > i { width: 6px; height: 6px; border-radius: 50%; background: #48e5bc; box-shadow: 0 0 13px #48e5bc; animation: recovery-pulse .8s ease-in-out infinite alternate; }

.recovered-home-section { margin: 18px 0 8px; }
.recovered-game-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 15px;
  border: 1px solid rgba(75,224,255,.3); border-radius: 22px;
  background: radial-gradient(circle at 0 0, rgba(75,224,255,.16), transparent 38%), rgba(17,22,42,.94);
  box-shadow: 0 18px 46px rgba(0,0,0,.27), 0 0 28px rgba(75,224,255,.06) inset;
}
.recovered-game-card > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 16px; background: rgba(75,224,255,.1); font-size: 25px; }
.recovered-game-card small, .recovered-game-card strong, .recovered-game-card p { display: block; }
.recovered-game-card small { color: var(--cyan); font-size: 9px; }
.recovered-game-card strong { margin-top: 3px; }
.recovered-game-card p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.recovered-game-card button { padding: 9px 12px; border: 1px solid rgba(75,224,255,.34); border-radius: 12px; color: var(--cyan); background: rgba(75,224,255,.08); font-weight: 900; }

.recovery-screen { padding-bottom: calc(26px + var(--safe-bottom)); }
.recovery-screen::before {
  position: fixed; z-index: -1; inset: 0; content: ""; pointer-events: none; opacity: .22;
  background: repeating-linear-gradient(0deg, transparent 0 4px, rgba(75,224,255,.025) 4px 5px);
}
.recovery-signal-card {
  position: relative; overflow: hidden; padding: 16px; margin: 6px 0 13px; border: 1px solid rgba(75,224,255,.25);
  border-radius: 21px; background: linear-gradient(135deg, rgba(13,57,70,.78), rgba(17,19,42,.96));
}
.recovery-signal-card::after { position: absolute; top: 0; bottom: 0; width: 38%; content: ""; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(75,224,255,.09), transparent); animation: recovery-scan-x 2.8s linear infinite; }
.recovery-signal-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; }
.recovery-signal-head > span { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: rgba(75,224,255,.1); font-size: 23px; }
.recovery-signal-head small, .recovery-signal-head strong { display: block; }
.recovery-signal-head small { color: var(--cyan); font-size: 8px; letter-spacing: .8px; }
.recovery-signal-head strong { margin-top: 3px; }
.recovery-signal-head > b { color: var(--cyan); font-size: 12px; }
.recovery-track { height: 5px; overflow: hidden; margin: 14px 0 11px; border-radius: 99px; background: rgba(255,255,255,.08); }
.recovery-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4be0ff, #a86bff); box-shadow: 0 0 14px rgba(75,224,255,.6); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.recovery-signal-card > p { margin: 0; color: #c9d5e1; font-size: 11px; line-height: 1.85; }

.recovery-null-interruption {
  position: relative; overflow: hidden; padding: 24px 20px; margin: 18px 0;
  border: 1px solid rgba(186,81,255,.42); border-radius: 25px;
  background: radial-gradient(circle at 50% 15%, rgba(150,45,245,.22), transparent 38%), rgba(13,8,29,.98);
  box-shadow: 0 24px 70px rgba(0,0,0,.48), inset 0 0 45px rgba(150,45,245,.06);
  text-align: center;
}
.recovery-null-interruption::after {
  position: absolute; inset: 0; z-index: 0; opacity: .11; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 4px, rgba(210,156,255,.2) 5px 6px); content: "";
  animation: aia-entry-static .2s steps(2) infinite;
}
.recovery-null-interruption > * { position: relative; z-index: 1; }
.recovery-null-channel { display: flex; align-items: center; gap: 7px; color: #d29cff; font-size: 8px; letter-spacing: 1px; }
.recovery-null-channel i { width: 7px; height: 7px; border-radius: 50%; background: #c963ff; box-shadow: 0 0 14px #c963ff; animation: recovery-pulse .55s ease-in-out infinite alternate; }
.recovery-null-channel b { margin-right: auto; color: #ff799f; }
.recovery-null-icon { display: grid; width: 72px; height: 72px; margin: 30px auto 18px; place-items: center; border: 1px dashed rgba(207,117,255,.58); border-radius: 50%; color: #e3b4ff; background: rgba(150,45,245,.1); box-shadow: 0 0 35px rgba(150,45,245,.2); font-size: 29px; font-weight: 900; }
.recovery-null-interruption h2 { margin: 8px 0 13px; color: #e9c3ff; }
.recovery-null-interruption > p:not(.eyebrow) { min-height: 75px; margin: 0; color: #d7c9e5; font-size: 12px; line-height: 1.95; }
.recovery-null-interruption > small { display: block; margin: 15px 0; color: #8e7c9d; font-size: 8px; }
.recovery-null-interruption .primary-button { width: 100%; background: linear-gradient(100deg, #592499, #a03f7f); }

.recovery-question-card {
  min-height: 360px; padding: 20px 17px; border: 1px solid rgba(255,255,255,.1); border-radius: 25px;
  background: radial-gradient(circle at 80% 0, rgba(157,91,255,.14), transparent 38%), rgba(18,21,42,.96);
  box-shadow: 0 24px 56px rgba(0,0,0,.28);
}
.recovery-question-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.recovery-question-meta > span { color: #b6a7da; font-size: 10px; }
.recovery-question-card h2 { min-height: 86px; margin: 23px 0 18px; font-size: clamp(19px,5.5vw,25px); line-height: 1.75; }
.recovery-timer { flex: 0 0 auto; }
.recovery-answers { display: grid; gap: 9px; }
.recovery-answer {
  display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; width: 100%; padding: 12px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 16px; color: var(--text); background: rgba(255,255,255,.045);
  text-align: right; transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.recovery-answer:not(:disabled):active { transform: scale(.985); }
.recovery-answer > span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; color: var(--cyan); background: rgba(75,224,255,.08); font-size: 11px; font-weight: 900; }
.recovery-answer.selected { border-color: rgba(75,224,255,.54); background: rgba(75,224,255,.09); }
.recovery-answer.correct { border-color: rgba(63,220,161,.62); background: rgba(63,220,161,.1); }
.recovery-answer.wrong { border-color: rgba(255,91,125,.6); background: rgba(255,91,125,.1); }
.recovery-answer:disabled { color: #b8b5c8; cursor: default; }
.recovery-answers.motion-run[data-motion="stagger"] .recovery-answer { animation: motion-answer-in .42s cubic-bezier(.2,.85,.2,1) both; animation-delay: calc(var(--motion-index, 0) * 70ms); }
.recovery-answers.motion-run[data-motion="fade"] .recovery-answer { animation: motion-fade-in .4s ease-out both; animation-delay: calc(var(--motion-index, 0) * 45ms); }
.recovery-answers.motion-run[data-motion="slide"] .recovery-answer { animation: motion-slide-in .45s ease-out both; animation-delay: calc(var(--motion-index, 0) * 55ms); }
.recovery-answers.motion-run[data-motion="scale"] .recovery-answer { animation: motion-scale-in .38s ease-out both; animation-delay: calc(var(--motion-index, 0) * 50ms); }
.answers.motion-run[data-motion="stagger"] .answer-button { animation: motion-answer-in .42s cubic-bezier(.2,.85,.2,1) both; animation-delay: calc(var(--motion-index, 0) * 65ms); }

.recovery-feedback {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px; padding: 14px; margin-top: 11px;
  border: 1px solid rgba(75,224,255,.2); border-radius: 19px; background: rgba(13,46,58,.88);
}
.recovery-feedback > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; background: rgba(75,224,255,.1); color: var(--cyan); font-weight: 900; }
.recovery-feedback strong, .recovery-feedback p { display: block; }
.recovery-feedback p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.recovery-feedback button { grid-column: 1 / -1; padding: 10px; border: 0; border-radius: 13px; color: #071219; background: linear-gradient(90deg, var(--cyan), #85f5dc); font-weight: 900; }
.recovery-feedback.is-wrong { border-color: rgba(255,91,125,.3); background: rgba(73,23,42,.88); }
.recovery-feedback.is-wrong > span { color: #ff7c9b; background: rgba(255,91,125,.11); }
.recovery-result { padding: 30px 20px; margin-top: 18px; border: 1px solid rgba(75,224,255,.3); border-radius: 26px; background: radial-gradient(circle at 50% 0, rgba(75,224,255,.18), transparent 40%), rgba(16,21,42,.98); text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,.38); }
.recovery-result-icon { display: grid; width: 72px; height: 72px; margin: 0 auto 14px; place-items: center; border: 1px solid rgba(75,224,255,.45); border-radius: 24px; color: var(--cyan); background: rgba(75,224,255,.08); box-shadow: 0 0 34px rgba(75,224,255,.18); font-size: 33px; animation: recovery-float 2.4s ease-in-out infinite; }
.recovery-result h2 { margin: 8px 0; color: var(--cyan); }
.recovery-result > p:not(.eyebrow) { color: var(--muted); line-height: 1.85; }
.recovery-result-rewards { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 18px 0; }
.recovery-result-rewards b { padding: 10px 5px; border-radius: 13px; color: #e9ddff; background: rgba(255,255,255,.055); font-size: 10px; }
.recovery-debrief { display: grid; gap: 10px; margin: 18px 0; text-align: right; }
.recovery-debrief-signal { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 11px; padding: 13px; border: 1px solid rgba(75,224,255,.22); border-radius: 17px; background: rgba(8,24,35,.72); }
.recovery-debrief-signal.null { border-color: rgba(190,91,255,.28); background: rgba(31,13,44,.76); }
.recovery-debrief-signal > span { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 12px; color: #8ff4e8; background: rgba(75,224,255,.1); font-weight: 900; }
.recovery-debrief-signal.null > span { color: #dfadff; background: rgba(190,91,255,.11); }
.recovery-debrief-signal small { display: block; color: #66dbd1; font-size: 7px; letter-spacing: .7px; }
.recovery-debrief-signal.null small { color: #c989f1; }
.recovery-debrief-signal p { margin: 5px 0 0; color: #d8d4e2; font-size: 10px; line-height: 1.8; }
.recovery-alignment { display: grid; gap: 8px; padding-top: 6px; }
.recovery-alignment > small { color: #888396; font-size: 8px; line-height: 1.7; text-align: center; }
.recovery-alignment button { padding: 11px 12px; border: 1px solid rgba(180,146,255,.2); border-radius: 13px; color: #ddd5ed; background: rgba(255,255,255,.045); font-size: 10px; font-weight: 800; text-align: right; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.recovery-alignment button:not(:disabled):active { transform: scale(.985); }
.recovery-alignment button.selected { border-color: rgba(91,235,216,.5); color: #aef8ee; background: rgba(54,205,188,.11); }
.recovery-alignment button:disabled:not(.selected) { opacity: .38; }
.recovery-alignment strong { padding: 10px; border-radius: 12px; color: #8ff4e8; background: rgba(54,205,188,.08); font-size: 9px; text-align: center; }

.recovery-admin-category-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.recovery-admin-category {
  position: relative; padding: 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 17px;
  background: rgba(255,255,255,.035); text-align: right;
}
.recovery-admin-category.inactive { opacity: .52; }
.recovery-admin-category > span { font-size: 24px; }
.recovery-admin-category strong, .recovery-admin-category small { display: block; }
.recovery-admin-category strong { margin: 5px 0 2px; }
.recovery-admin-category small { color: var(--muted); font-size: 9px; }
.recovery-admin-category b { position: absolute; top: 11px; left: 11px; color: var(--cyan); font-size: 10px; }
.recovery-private-answer-list { display: grid; gap: 9px; }
.recovery-trust-list { display: grid; gap: 9px; }
.recovery-trust-card { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 13px; border: 1px solid rgba(178,112,255,.18); border-radius: 16px; background: rgba(255,255,255,.035); }
.recovery-trust-card > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: linear-gradient(145deg, rgba(75,224,255,.12), rgba(181,93,255,.15)); font-size: 19px; }
.recovery-trust-card strong, .recovery-trust-card small { display: block; }
.recovery-trust-card small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.recovery-trust-meters { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.recovery-trust-meters b { padding: 8px 10px; border-radius: 11px; color: #8ff4e8; background: rgba(75,224,255,.07); font-size: 9px; }
.recovery-trust-meters b:last-child { color: #dda9ff; background: rgba(181,93,255,.08); }
.recovery-private-answer {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 13px; border: 1px solid rgba(167,104,255,.16);
  border-radius: 17px; background: rgba(255,255,255,.035);
}
.recovery-private-answer > span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 12px; background: rgba(167,104,255,.1); }
.recovery-private-answer strong, .recovery-private-answer small, .recovery-private-answer p { display: block; }
.recovery-private-answer small { color: var(--muted); font-size: 9px; }
.recovery-private-answer p { grid-column: 1 / -1; margin: 2px 0 0; color: #d9d3e8; font-size: 11px; line-height: 1.7; }

@keyframes motion-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes motion-fade-out { to { opacity: 0; } }
@keyframes motion-slide-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes motion-slide-out { to { opacity: 0; transform: translateY(-16px); } }
@keyframes motion-scale-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes motion-scale-out { to { opacity: 0; transform: scale(.94); } }
@keyframes motion-glitch-in { 0% { opacity: 0; transform: translateX(16px) skewX(5deg); filter: hue-rotate(70deg); } 25% { opacity: .85; transform: translateX(-9px) skewX(-3deg); } 50% { opacity: .38; transform: translateX(5px); filter: hue-rotate(-55deg); } 72% { opacity: 1; transform: translateX(-2px); } 100% { transform: none; filter: none; } }
@keyframes motion-glitch-out { 0% { opacity: 1; } 40% { transform: translateX(6px) skewX(3deg); filter: hue-rotate(65deg); } 100% { opacity: 0; transform: translateX(-13px); filter: blur(3px); } }
@keyframes motion-signal-in { 0% { opacity: 0; transform: scaleY(.03); filter: brightness(2.5) blur(5px); } 38% { opacity: .9; transform: scaleY(.035); } 55% { transform: scaleY(1.04); filter: brightness(1.7); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes motion-answer-in { from { opacity: 0; transform: translateX(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes recovery-pulse { to { opacity: .35; transform: scale(.68); } }
@keyframes recovery-scan-x { from { right: -45%; } to { right: 115%; } }
@keyframes recovery-float { 50% { transform: translateY(-6px) rotate(3deg); } }

@media (max-width: 390px) {
  .recovery-admin-category-grid { grid-template-columns: 1fr; }
  .recovered-game-card { grid-template-columns: auto 1fr; }
  .recovered-game-card button { grid-column: 1 / -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
