:root {
  --bg: #eef3fb;
  --card: #ffffff;
  --line: #d7e1ef;
  --text: #11203a;
  --muted: #61708b;
  --brand: #ff5f3a;
  --brand-deep: #254170;
  --accent: #11a98f;
  --ok: #10b77e;
  --danger: #d94848;
  --sp-color: #6a3cc3;
  --sp-bg: #efe8ff;
  --sp-line: #cbb9f6;
  --top-h: 128px;
  --bottom-h: 70px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 15% 8%, #dff4ff 0%, transparent 26%),
    radial-gradient(circle at 86% 95%, #ffe3da 0%, transparent 30%),
    var(--bg);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.page-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone-frame {
  width: min(430px, 100%);
  height: min(860px, calc(100dvh - 36px));
  border-radius: 34px;
  border: 8px solid #1a1f2d;
  background: #0f1320;
  box-shadow: 0 26px 55px rgba(9, 17, 32, 0.36);
  padding: 8px;
}

.auth-wrap,
.game-shell {
  height: 100%;
  border-radius: 26px;
  overflow: hidden;
  background: var(--bg);
}

.auth-wrap {
  display: grid;
  place-items: center;
  padding: 16px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 12px 28px rgba(19, 35, 67, 0.1);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.auth-card h1 {
  font-size: 1.45rem;
  letter-spacing: 0.2px;
}

.auth-card p {
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-tab,
.menu-tab,
.btn,
.mission-card,
.video-card,
.booster-card {
  border: none;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-tab {
  background: #edf2fb;
  color: #3a4f77;
  padding: 9px;
}

.auth-tab.active {
  background: var(--brand-deep);
  color: #fff;
}

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

.auth-form label {
  display: grid;
  gap: 5px;
  font-size: 0.9rem;
}

input {
  width: 100%;
  border: 1px solid #ccd9ec;
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
}

.captcha {
  border: 1px dashed #bfd0e8;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 7px;
  background: #f5f9ff;
}

.btn {
  background: linear-gradient(95deg, var(--brand), #ff9150);
  color: #fff;
  padding: 9px 12px;
}

.btn-inline {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.btn-dark {
  background: linear-gradient(95deg, #3a5079, #243654);
}

.btn-claim {
  background: linear-gradient(95deg, var(--ok), #0d8e66);
}

.game-shell {
  position: relative;
}

.game-shell.profile-open .top-fixed {
  display: none;
}

.game-shell.profile-open .content-scroll {
  display: none;
}

.top-fixed {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--top-h);
  z-index: 5;
  background: rgba(238, 243, 251, 0.98);
  backdrop-filter: blur(5px);
  border-bottom: 1px solid #d6e0ef;
  padding: 8px 10px 9px;
  display: grid;
  gap: 7px;
}

.mini-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cl-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6f46, #ff4f7a);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
  letter-spacing: 0.2px;
}

.logo-btn {
  border: none;
  cursor: pointer;
}

.name-link {
  cursor: pointer;
}

.mini-head h2 {
  font-size: 1.08rem;
  line-height: 1.2;
  font-weight: 900;
}

.mini-head p {
  color: var(--muted);
  font-size: 0.72rem;
}

#playerEmail {
  display: none;
}

.head-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-wrap {
  position: relative;
  z-index: 20;
}

.icon-btn {
  border: 1px solid #cfdbec;
  background: #fff;
  color: #30466d;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.settings-menu {
  position: absolute;
  right: 0;
  top: 46px;
  width: 220px;
  z-index: 40;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(17, 30, 55, 0.2);
  padding: 6px;
  display: grid;
  gap: 4px;
}

.settings-menu button {
  border: none;
  border-radius: 8px;
  background: #f3f7ff;
  color: #1f3356;
  text-align: left;
  padding: 8px 9px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.settings-menu button:hover {
  background: #e8effd;
}

.currency-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.currency-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  display: grid;
  gap: 2px;
}

.currency-card span,
.currency-card small {
  color: var(--muted);
  font-size: 0.66rem;
}

.currency-card strong {
  font-size: 0.8rem;
}

.level-card {
  position: relative;
  overflow: hidden;
  --level-pct: 0%;
}

.level-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #d9e0eb var(--level-pct), #ffffff var(--level-pct));
  z-index: 0;
}

.level-card > * {
  position: relative;
  z-index: 1;
}

.timer-mini {
  margin-top: 1px;
}

.timer-quick {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px 7px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.timer-progress-wrap {
  position: relative;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
}

.timer-progress-bg {
  position: absolute;
  inset: 0;
  background: #e9f0fb;
}

.timer-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #0f8977);
  transition: width 0.25s ease;
}

.timer-inline-text {
  position: absolute;
  inset: 0;
  padding: 0 8px;
  display: grid;
  align-items: center;
  text-align: left;
  font-size: 0.66rem;
  font-weight: 700;
  color: #10314f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timer-mini-time {
  min-width: 48px;
  text-align: right;
  font-size: 0.74rem;
  font-weight: 800;
  color: #203f61;
}

.content-scroll {
  height: 100%;
  overflow-y: auto;
  padding: calc(var(--top-h) + 4px) 10px calc(var(--bottom-h) + var(--safe-bottom) + 8px);
  display: grid;
  align-content: start;
  gap: 10px;
}

.profile-fullscreen {
  position: absolute;
  inset: 0 0 calc(var(--bottom-h) + var(--safe-bottom) + 12px) 0;
  z-index: 7;
  overflow-y: auto;
  background: var(--bg);
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.profile-full-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-panel {
  display: grid;
  gap: 10px;
}

.shop-grid {
  display: grid;
  gap: 10px;
}

.shop-back-overlay {
  position: absolute;
  top: calc(var(--top-h) + 18px);
  right: 18px;
  z-index: 12;
  padding: 7px 10px;
  font-size: 0.74rem;
}

.shop-card {
  border: 1px solid #d2dfef;
  border-radius: 14px;
  background: #f7fbff;
  padding: 13px 12px;
  display: grid;
  gap: 8px;
  min-height: 132px;
  box-shadow: 0 6px 16px rgba(20, 48, 86, 0.06);
}

.shop-card h5 {
  margin: 0;
  font-size: 0.95rem;
}

.shop-clickable {
  cursor: pointer;
}

.shop-clickable:active {
  transform: translateY(1px);
}

.shop-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.shop-meta {
  margin: 0;
  color: #566b89;
  font-size: 0.8rem;
  line-height: 1.35;
}

.shop-highlight {
  margin: 0;
  color: #1a3156;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

.shop-status-badge {
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 4px 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.shop-status-badge.is-available {
  background: #e4f6eb;
  color: #17663f;
  border-color: #b7e4c7;
}

.shop-status-badge.is-owned {
  background: #e6efff;
  color: #1d4f9b;
  border-color: #bad0f5;
}

.shop-status-badge.is-locked {
  background: #f4f4f6;
  color: #4f5866;
  border-color: #d0d4db;
}

.shop-status-badge.is-feature {
  background: #fff5dc;
  color: #7c5c12;
  border-color: #f0dcaa;
}

.shop-status-badge.is-danger {
  background: #ffe5e5;
  color: #7e1e1e;
  border-color: #efb9b9;
}

.shop-type-feature {
  background: linear-gradient(180deg, #eef6ff 0%, #f8fbff 100%);
}

.shop-type-livestream {
  background: #ffe4e4;
}

.shop-type-consumable {
  background: linear-gradient(180deg, #f1fbff 0%, #f8fcff 100%);
}

.shop-type-category {
  background: linear-gradient(180deg, #f5f8ff 0%, #fbfdff 100%);
}

.shop-card-dim {
  opacity: 0.62;
  filter: saturate(0.72);
}

.shop-card .btn {
  margin-top: 2px;
}

.shop-category-compact {
  min-height: 0;
  text-align: center;
  padding-top: 12px;
  padding-bottom: 12px;
}

.shop-category-compact h5 {
  font-size: 1rem;
}

.shop-category-compact .shop-meta {
  font-size: 0.76rem;
  line-height: 1.35;
}

.group-wrap {
  display: grid;
  gap: 8px;
}

.group-card {
  border: 1px solid #d5e2f4;
  border-radius: 11px;
  background: #f7fbff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.group-card h5 {
  margin: 0;
  font-size: 0.9rem;
}

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

.group-stats-grid article {
  border: 1px solid #d8e4f4;
  border-radius: 9px;
  padding: 7px 6px;
  background: #fff;
  display: grid;
  gap: 2px;
}

.group-stats-grid span {
  font-size: 0.66rem;
  color: #5c6f8d;
}

.group-stats-grid strong {
  font-size: 0.78rem;
}

.group-form-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.group-list,
.group-upgrade-list {
  display: grid;
  gap: 6px;
}

.group-row {
  border: 1px solid #dbe6f6;
  border-radius: 9px;
  background: #fff;
  padding: 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.group-row small {
  display: block;
  color: #5f7392;
  font-size: 0.68rem;
  margin-top: 2px;
}

.group-members-list,
.group-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.group-members-list li,
.group-chat-list li {
  border: 1px solid #dce6f4;
  border-radius: 8px;
  background: #fff;
  padding: 6px 7px;
  font-size: 0.76rem;
}

.group-chat-list li {
  display: grid;
  gap: 2px;
}

.profile-hero {
  background: linear-gradient(125deg, #eaf2ff, #fff0e8);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #ff7048, #ff4f7b);
}

.level-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  align-content: center;
  justify-items: center;
  gap: 1px;
}

.level-avatar small {
  font-size: 0.62rem;
  opacity: 0.9;
}

.level-avatar strong {
  font-size: 1rem;
  line-height: 1;
}

.profile-hero h3 {
  font-size: 0.98rem;
}

.profile-hero p {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-group-btn {
  margin-top: 5px;
  border: 1px solid #d6e2f3;
  border-radius: 999px;
  background: #f4f8ff;
  color: #415d86;
  padding: 4px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: left;
  justify-self: start;
  cursor: default;
}

.profile-group-btn.is-link {
  cursor: pointer;
  color: #1c4f98;
  border-color: #b8cef1;
  background: #eaf2ff;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.profile-stats article {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  padding: 9px;
  display: grid;
  gap: 2px;
}

.profile-stats span {
  color: var(--muted);
  font-size: 0.7rem;
}

.profile-stats strong {
  font-size: 0.95rem;
}

.profile-rank-btn {
  border: 1px solid #d4deef;
  border-radius: 10px;
  background: #f3f7ff;
  color: #27466f;
  padding: 9px;
  display: grid;
  gap: 2px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  min-height: 56px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.panel h4 {
  font-size: 0.96rem;
}

.btn-small {
  padding: 6px 10px;
  font-size: 0.72rem;
}

.btn-xs {
  padding: 5px 8px;
  font-size: 0.68rem;
}

.subhead {
  margin-top: 4px;
  font-size: 0.86rem;
  color: #334f78;
}

.home-panel {
  gap: 10px;
}

.trend-grid {
  display: grid;
  gap: 8px;
}

.trend-card {
  border: 1px solid #d7e3f4;
  border-radius: 11px;
  background: #f8fbff;
  padding: 10px;
  display: grid;
  gap: 2px;
}

.trend-card strong {
  font-size: 0.9rem;
}

.trend-card small {
  color: #345277;
  font-size: 0.72rem;
}

.trend-stable {
  background: linear-gradient(145deg, #ebf7ff, #f7fcff);
}

.trend-balanced {
  background: linear-gradient(145deg, #eef3ff, #f8f9ff);
}

.trend-risky {
  background: linear-gradient(145deg, #fff0ed, #fff8f7);
}

.leaderboard-dock {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(var(--bottom-h) + var(--safe-bottom) + 18px);
  z-index: 12;
  gap: 7px;
  padding: 8px;
  border: 1px solid #d9e4f4;
  border-radius: 10px;
  background: #f9fbff;
}

.lb-mode-toggle {
  display: flex;
  gap: 6px;
}

.lb-mode-btn {
  padding: 5px 8px;
  font-size: 0.68rem;
  opacity: 0.75;
}

.lb-mode-btn.active {
  opacity: 1;
}

.lb-sort-trigger {
  display: inline-block;
  color: #334b72;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.lb-sort-trigger.active {
  color: #183c72;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lb-head-static {
  cursor: default;
  text-decoration: none !important;
}

.lb-table-wrap {
  border: 1px solid #d9e4f4;
  border-radius: 10px;
  overflow: hidden;
  background: #f9fbff;
  margin-bottom: 70px;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.lb-table th,
.lb-table td {
  font-size: 0.78rem;
  padding: 8px 7px;
  border-bottom: 1px solid #dce6f4;
  text-align: left;
}

.lb-table th:nth-child(1),
.lb-table td:nth-child(1) {
  width: 12%;
}

.lb-table th:nth-child(2),
.lb-table td:nth-child(2) {
  width: 54%;
}

.lb-table th:nth-child(3),
.lb-table td:nth-child(3),
.lb-table th:nth-child(4),
.lb-table td:nth-child(4) {
  width: 17%;
}

.lb-table td:nth-child(2),
.lb-table th:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.lb-table th {
  background: #edf3ff;
  color: #334b72;
}

.lb-table tr:last-child td {
  border-bottom: none;
}

.lb-row-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.lb-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.lb-search input {
  padding: 9px 10px;
}

.lb-search .btn {
  padding: 8px 10px;
  font-size: 0.74rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.inline-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prep-head {
  align-items: flex-start;
}

.studio-head {
  align-items: flex-start;
}

.studio-head-left {
  display: grid;
  gap: 7px;
  justify-items: start;
}

.studio-art-head {
  margin-top: -1px;
}

.prep-head-left {
  display: grid;
  gap: 7px;
  justify-items: start;
}

.prep-head-right {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.studio-head-right {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.prep-head-right .badge-strong {
  font-size: 0.76rem;
  padding: 5px 9px;
  background: #e8f8ef;
  border-color: #9dd9b3;
  color: #1d6d3f;
  font-weight: 800;
}

.prep-refresh-btn {
  width: auto;
  justify-self: start;
  padding: 8px 12px;
  font-size: 0.76rem;
  margin-bottom: 16px;
}

#refreshStudioBtn {
  margin-bottom: 0;
}

#openPrepBoostsBtn {
  background: linear-gradient(95deg, #1f985f, #16794a);
  font-size: 0.68rem;
  padding: 5px 8px;
}

#openStudioBoostsBtn {
  background: linear-gradient(95deg, #7a49d6, #5f30ba);
  color: #f8f3ff;
  font-size: 0.68rem;
  padding: 5px 8px;
}

.badge {
  border: 1px solid #c8d7ee;
  border-radius: 999px;
  background: #f2f7ff;
  color: #304970;
  font-size: 0.7rem;
  padding: 4px 8px;
}

.badge-strong {
  background: #e6f4ff;
  border-color: #b6d8ff;
  color: #1e4f82;
  font-weight: 800;
}

.badge-sp {
  background: var(--sp-bg);
  border-color: var(--sp-line);
  color: var(--sp-color);
  font-size: 0.76rem;
  padding: 5px 9px;
  font-weight: 800;
}

.mission-status {
  border: 1px solid #b9d5fb;
  background: linear-gradient(120deg, #f8fcff, #eef6ff);
  text-align: center;
  padding: 14px;
}

#videoStatusCard {
  padding: 22px 16px 18px;
  display: grid;
  gap: 24px;
}

#sprintStatusCard {
  padding: 22px 16px 18px;
  display: grid;
  gap: 24px;
}

.story-text {
  color: #364c73;
  font-size: 1rem;
  line-height: 1.45;
  max-width: 95%;
  margin: 0 auto;
}

.story-text.italic {
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.55;
  margin-top: 4px;
  max-width: 96%;
}

.video-status-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  text-align: left;
  font-size: 0.84rem;
  max-width: 96%;
  margin: 4px auto 2px;
}

#sprintMetaSp,
#videoMetaCost {
  color: var(--sp-color);
  font-weight: 800;
}

.progress-inline-time {
  position: relative;
  max-width: 98%;
  height: 34px;
  margin: 18px auto 20px;
}

.accel-inline-row {
  display: flex;
  justify-content: flex-end;
  width: 90%;
  margin: -10px auto 2px;
}

.accel-icon-btn {
  font-size: 0.74rem;
  padding: 6px 10px;
  min-width: 140px;
}

#videoStatusTimeInline,
#sprintStatusTimeInline {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.08rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.2px;
  -webkit-text-stroke: 0.35px #10243b;
  text-shadow:
    0 1px 0 #10243b,
    0 -1px 0 #10243b,
    1px 0 0 #10243b,
    -1px 0 0 #10243b;
}

.sprint-focus-bar {
  max-width: 90%;
  margin: 0 auto;
}

.bar {
  width: 100%;
  height: 30px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7eef9;
}

.bar > div {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #0f8a78);
  transition: width 0.25s ease;
}

.mission-status-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 8px;
}

.mission-actions {
  display: flex;
  gap: 7px;
}

.mission-actions-vertical {
  flex-direction: column;
  width: 100%;
  align-items: center;
}

.mission-actions-vertical .btn {
  width: min(280px, 100%);
}

.btn-cancel-small {
  width: min(190px, 100%) !important;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.mission-grid,
.video-grid,
.booster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mission-grid {
  grid-template-columns: 1fr;
}

.video-grid {
  grid-template-columns: 1fr;
}

.studio-form {
  display: grid;
  gap: 8px;
  margin-top: -2px;
}

.studio-form .subhead:first-of-type {
  margin-top: 0;
}

.studio-form label {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
}

.studio-form select {
  width: 100%;
  border: 1px solid #ccd9ec;
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}

#studioLengthHint {
  display: none;
}

.mission-card,
.video-card,
.booster-card {
  background: #f7fbff;
  border: 1px solid #d6e3f4;
  color: var(--text);
  text-align: left;
  padding: 10px;
  display: grid;
  gap: 7px;
  min-height: 124px;
}

.mission-card {
  text-align: center;
  gap: 8px;
}

.mission-title {
  font-size: 0.94rem;
  line-height: 1.2;
}

.mission-story {
  font-size: 0.76rem;
  line-height: 1.42;
  max-width: 92%;
  margin: 0 auto;
}

.mission-meta-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 0.78rem;
  color: #425a82;
}

.mission-duration-boost {
  color: #1d8a51;
  font-weight: 700;
}

.mission-vp-green {
  color: #1d8a51;
  font-weight: 700;
}

.mission-reward {
  font-size: 0.86rem;
  color: #1f4272;
}

.video-card.active {
  border-color: #6d95c7;
  box-shadow: inset 0 0 0 1px #6d95c7;
}

.btn-claim:disabled {
  background: #9ba8bc;
  cursor: not-allowed;
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  filter: grayscale(0.18);
}

.mission-card:hover,
.video-card:hover,
.booster-card:hover {
  border-color: #9fbde4;
}

.mission-card:disabled,
.video-card:disabled,
.booster-card:disabled {
  opacity: 0.66;
  cursor: not-allowed;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.list li {
  border: 1px solid #dbe4f2;
  background: #f8fafe;
  border-radius: 9px;
  padding: 8px;
  font-size: 0.8rem;
}

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

.profile-video-tile {
  border: 1px solid #d5e2f4;
  border-radius: 10px;
  background: linear-gradient(160deg, #edf3ff, #fff4ed);
  min-height: 110px;
  display: grid;
  align-content: end;
  text-align: left;
  gap: 2px;
  padding: 9px;
  color: #1a3255;
  position: relative;
  padding-top: 24px;
}

.profile-video-tile.type-short {
  background: linear-gradient(160deg, #e8f1ff, #f5f9ff);
}

.profile-video-tile.type-video {
  background: linear-gradient(160deg, #fff7df, #fffef2);
}

.profile-video-tile.type-podcast {
  background: linear-gradient(160deg, #e7f7e8, #f2fff3);
}

.profile-video-tile.type-livestream {
  background: linear-gradient(160deg, #ffe8e8, #fff3f3);
}

.profile-video-tile strong {
  font-size: 0.8rem;
}

.profile-video-tile small {
  font-size: 0.7rem;
  color: #526789;
}

.profile-video-locked {
  cursor: default;
}

.video-art {
  position: absolute;
  top: 7px;
  right: 8px;
  font-size: 0.64rem;
  color: #3f5f8a;
  background: #e8f0ff;
  border: 1px solid #c8d8f3;
  border-radius: 999px;
  padding: 2px 7px;
}

.video-art.type-short {
  background: #dbeafe;
  border-color: #afccff;
  color: #1b5fb3;
}

.video-art.type-video {
  background: #fff3c4;
  border-color: #f1dd7e;
  color: #8f6b00;
}

.video-art.type-podcast {
  background: #dff4e2;
  border-color: #b9e7c2;
  color: #1d7f3c;
}

.video-art.type-livestream {
  background: #ffdede;
  border-color: #f1b5b5;
  color: #b33838;
}

.chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.chip-group-title {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #3c5880;
  font-size: 0.72rem;
  font-weight: 800;
}

.chip-btn {
  border: 1px solid #d2deef;
  border-radius: 10px;
  background: #f6f9ff;
  color: #26456e;
  padding: 8px;
  text-align: left;
  display: grid;
  gap: 1px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.chip-btn small {
  color: #5f7698;
  font-size: 0.68rem;
  font-weight: 700;
}

.chip-btn.active {
  border-color: #5f85b4;
  background: #eaf2ff;
}

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

.variant-btn {
  border: 1px solid #d3deee;
  border-radius: 10px;
  background: #f8fbff;
  color: #27466f;
  padding: 8px;
  text-align: left;
  display: grid;
  gap: 2px;
  font: inherit;
  cursor: pointer;
}

.variant-btn strong {
  font-size: 0.82rem;
}

.variant-btn span {
  font-size: 0.72rem;
}

.variant-btn.active {
  border-color: #648dbf;
  background: #eaf2ff;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px 26px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 20, 35, 0.48);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(340px, calc(100vw - 52px));
  max-height: min(82dvh, 760px);
  border-radius: 16px;
  border: 1px solid #d4e0ef;
  background: #fff;
  box-shadow: 0 20px 42px rgba(13, 24, 43, 0.34);
  padding: 14px 14px 16px;
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head .icon-btn {
  width: 30px;
  height: 30px;
  font-size: 0.95rem;
}

.modal-body {
  display: grid;
  gap: 11px;
  overflow-y: auto;
  padding-right: 2px;
}

.modal-body p {
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal-form {
  display: grid;
  gap: 11px;
}

.modal-form label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  line-height: 1.35;
}

.modal-form .btn {
  margin-top: 4px;
}

.sp-tone {
  color: var(--sp-color);
}

.bottom-nav {
  position: absolute;
  inset: auto 0 calc(var(--safe-bottom) + 18px) 0;
  height: calc(var(--bottom-h) + var(--safe-bottom));
  z-index: 6;
  border-top: 1px solid #d6e0ef;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(7px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 6px 7px calc(6px + var(--safe-bottom));
}

.game-shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--safe-bottom) + 24px);
  background: #fff;
  z-index: 5;
}

.studio-type-grid {
  display: grid;
  gap: 8px;
}

.studio-type-card {
  border: 1px solid #d3dfef;
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(90px, 120px) 1fr;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.studio-type-card.active {
  border-color: #5b84b7;
  box-shadow: inset 0 0 0 1px #5b84b7;
}

.studio-type-row {
  display: none;
}

.studio-type-left h4 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 900;
}

.studio-type-card.type-short .studio-type-left h4 {
  color: #1b5fb3;
}

.studio-type-card.type-video .studio-type-left h4 {
  color: #8f6b00;
}

.studio-type-card.type-podcast .studio-type-left h4 {
  color: #1d7f3c;
}

.studio-type-card.type-livestream .studio-type-left h4 {
  color: #b33838;
}

.studio-type-right {
  display: grid;
  gap: 4px;
  font-size: 0.74rem;
  color: var(--sp-color);
  justify-items: end;
}

.studio-metric-row {
  display: grid;
  grid-template-columns: 40px 66px 56px;
  gap: 4px;
  justify-content: end;
  align-items: center;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.studio-metric-row span {
  -webkit-text-stroke: 0.45px #ffffff;
  text-shadow:
    0 1px 0 #ffffff,
    0 -1px 0 #ffffff,
    1px 0 0 #ffffff,
    -1px 0 0 #ffffff;
}

.studio-metric-row .k {
  color: var(--sp-color);
  font-weight: 800;
}

.studio-metric-row.insufficient {
  color: #1f2430;
  font-style: normal;
  font-weight: 400;
}

.studio-metric-row.insufficient .k {
  color: #1f2430;
  font-style: normal;
  font-weight: 400;
}

.studio-metric-row.insufficient span {
  -webkit-text-stroke: 0.45px #ffffff;
  text-shadow:
    0 1px 0 #ffffff,
    0 -1px 0 #ffffff,
    1px 0 0 #ffffff,
    -1px 0 0 #ffffff;
}

.length-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.length-toggle .btn.active {
  background: linear-gradient(95deg, #355687, #28426a);
}

.length-toggle .btn.inactive {
  background: #9ca6b5;
}

#studioStartBtn {
  display: grid;
  gap: 2px;
  text-align: center;
}

#studioStartBtn small {
  font-size: 0.67rem;
  opacity: 0.96;
  font-weight: 700;
}

.studio-type-card.type-short {
  background: #eaf2ff;
}

.studio-type-card.type-video {
  background: #fff5cf;
}

.studio-type-card.type-podcast {
  background: #e3f6e5;
}

.studio-type-card.type-livestream {
  background: #ffe4e4;
}

.menu-tab {
  border-radius: 11px;
  background: #edf2fb;
  color: #3d5179;
  padding: 6px 3px;
  display: grid;
  gap: 2px;
  justify-items: center;
  align-content: center;
  line-height: 1;
  position: relative;
  overflow: hidden;
  --tab-progress: 0%;
}

.menu-tab::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(35, 171, 143, 0.28) var(--tab-progress), transparent var(--tab-progress));
  z-index: 0;
}

.menu-tab > * {
  position: relative;
  z-index: 1;
}

.menu-tab.task-ready-blink {
  animation: tab-blink 1s steps(2, end) infinite;
}

@keyframes tab-blink {
  50% {
    box-shadow: inset 0 0 0 2px #15b887;
  }
}

.menu-tab span {
  font-size: 1rem;
}

.menu-tab small {
  font-size: 0.62rem;
  font-weight: 700;
}

.menu-tab.active {
  background: var(--brand-deep);
  color: #fff;
}

/* Dark theme overrides (layout unchanged) */
:root {
  --bg: #0f131b;
  --card: #161d28;
  --line: #293244;
  --text: #e8edf7;
  --muted: #9aa6ba;
  --brand: #ff6b4a;
  --brand-deep: #233a63;
  --accent: #1ec7a4;
  --ok: #1abf88;
  --danger: #e05a5a;
  --sp-color: #b48dff;
  --sp-bg: #241a3f;
  --sp-line: #4b3a7b;
}

body {
  background:
    radial-gradient(circle at 15% 8%, #1b2638 0%, transparent 30%),
    radial-gradient(circle at 86% 95%, #2a1f24 0%, transparent 34%),
    var(--bg);
}

.auth-wrap,
.game-shell,
.profile-fullscreen {
  background: var(--bg);
}

.top-fixed {
  background: rgba(15, 19, 27, 0.96);
  border-bottom-color: var(--line);
}

.auth-card,
.panel,
.currency-card,
.group-stats-grid article,
.group-row,
.group-members-list li,
.group-chat-list li,
.list li,
.lb-table-wrap,
.leaderboard-dock,
.modal-card,
.shop-card,
.group-card,
.mission-card,
.video-card,
.booster-card {
  background: var(--card);
  border-color: var(--line);
  color: var(--text);
}

.profile-hero,
.trend-card,
.profile-video-tile,
.studio-type-card,
.chip-btn,
.variant-btn,
.menu-tab,
.profile-rank-btn,
.profile-group-btn,
.timer-quick,
.icon-btn,
.settings-menu,
.settings-menu button,
.lb-table th,
.bar {
  background: #1a2331;
  border-color: var(--line);
  color: var(--text);
}

.timer-progress-bg {
  background: #2a3549;
}

.timer-inline-text,
.timer-mini-time,
.shop-meta,
.group-row small,
.profile-video-tile small,
.chip-btn small,
.mission-meta-row,
.trend-card small,
.lb-sort-trigger,
.subhead,
.chip-group-title {
  color: var(--muted);
}

input,
select,
.studio-form select {
  background: #111825;
  border-color: var(--line);
  color: var(--text);
}

input::placeholder {
  color: #7f8ca2;
}

.captcha {
  background: #121b2a;
  border-color: #3a4660;
}

.auth-tab {
  background: #1b2534;
  color: #b8c4d9;
}

.auth-tab.active,
.menu-tab.active {
  background: var(--brand-deep);
  color: #fff;
}

.settings-menu {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.settings-menu button {
  background: #182131;
  color: #d2dced;
}

.settings-menu button:hover {
  background: #202c40;
}

.level-card::before {
  background: linear-gradient(90deg, #3a465b var(--level-pct), #1a2331 var(--level-pct));
}

.lb-table td,
.lb-table th {
  border-bottom-color: var(--line);
}

.lb-table th {
  color: #c6d2e8;
}

.btn-dark {
  background: linear-gradient(95deg, #445c84, #2f4263);
}

.length-toggle .btn.inactive {
  background: #3f4d62;
}

.btn-claim:disabled {
  background: #5f6b7f;
}

.bottom-nav {
  background: rgba(16, 21, 31, 0.98);
  border-top-color: var(--line);
}

.game-shell::after {
  background: #10151f;
}

.studio-type-card.type-short {
  background: #1c2b42;
}

.studio-type-card.type-video {
  background: #3b341f;
}

.studio-type-card.type-podcast {
  background: #1f3528;
}

.studio-type-card.type-livestream {
  background: #3f2125;
}

.video-art {
  background: #23324b;
  border-color: #3b4b66;
  color: #c8d5ea;
}

.video-art.type-short {
  background: #1f3a62;
  border-color: #2f4f82;
  color: #9fc7ff;
}

.video-art.type-video {
  background: #5a4a1d;
  border-color: #776125;
  color: #ffe28b;
}

.video-art.type-podcast {
  background: #214b2f;
  border-color: #2f6842;
  color: #aee6be;
}

.video-art.type-livestream {
  background: #5f252b;
  border-color: #7f323a;
  color: #ffb0b0;
}

.mission-status {
  border-color: #32538d;
  background: linear-gradient(120deg, #162233, #1a2a40);
}

/* Dark mode readability typography overrides */
body {
  color: var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
th,
strong,
.btn,
.menu-tab small,
.menu-tab span {
  color: var(--text);
}

p,
span,
small,
td,
label,
li,
input,
select,
button {
  color: var(--text);
}

.muted,
.shop-meta,
.group-row small,
.profile-video-tile small,
.chip-btn small,
.mission-meta-row,
.trend-card small,
.lb-sort-trigger,
.subhead,
.chip-group-title,
.profile-hero p,
.currency-card span,
.currency-card small {
  color: #b4bfd2;
}

.mini-head h2 {
  color: #f2f6ff;
  font-size: 1.14rem;
}

.mini-head p {
  color: #b7c3d8;
  font-size: 0.78rem;
}

.panel h4 {
  font-size: 1rem;
  color: #eaf0fd;
}

.subhead {
  font-size: 0.9rem;
  font-weight: 800;
}

.currency-card strong {
  font-size: 0.84rem;
}

.currency-card span,
.currency-card small {
  font-size: 0.7rem;
}

.timer-inline-text {
  color: #f4f7ff;
  font-size: 0.7rem;
  font-weight: 800;
}

.timer-mini-time {
  color: #f0f5ff;
  font-size: 0.78rem;
}

.lb-table th,
.lb-table td {
  font-size: 0.82rem;
}

.lb-table th {
  color: #d8e3f8;
}

.lb-sort-trigger {
  font-size: 0.8rem;
  font-weight: 800;
}

.profile-hero h3 {
  font-size: 1.02rem;
  color: #f1f5ff;
}

.profile-stats span {
  color: #b7c3d8;
  font-size: 0.74rem;
}

.profile-stats strong {
  font-size: 0.98rem;
  color: #f2f6ff;
}

.profile-video-tile strong {
  font-size: 0.82rem;
  color: #edf3ff;
}

.video-art {
  font-size: 0.66rem;
  font-weight: 800;
}

.mission-title {
  font-size: 0.98rem;
  color: #edf3ff;
}

.mission-story,
.story-text {
  color: #d2dced;
  line-height: 1.5;
}

.story-text.italic {
  color: #bec9dc;
}

.mission-reward {
  color: #dce6f8;
  font-size: 0.88rem;
}

.studio-type-left h4 {
  font-size: 1.08rem;
  font-weight: 900;
}

.studio-type-right {
  font-size: 0.76rem;
}

.studio-metric-row {
  font-size: 0.78rem;
}

.studio-metric-row span {
  -webkit-text-stroke: 0.3px #0c1119;
  text-shadow:
    0 1px 0 #0c1119,
    0 -1px 0 #0c1119,
    1px 0 0 #0c1119,
    -1px 0 0 #0c1119;
}

.modal-head h4,
.modal-head h3 {
  color: #eff4ff;
}

.modal-body p,
.modal-form label,
.modal-form p {
  color: #d7e1f3;
  line-height: 1.55;
}

.btn {
  font-weight: 800;
  letter-spacing: 0.1px;
}

.btn-dark,
.btn-claim {
  color: #fff;
}

input,
select,
.studio-form select {
  font-size: 0.9rem;
}

@media (max-width: 760px) and (orientation: portrait) {
  .page-wrap {
    padding: 0;
  }

  .phone-frame {
    width: 100%;
    max-width: none;
    height: 100dvh;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: var(--bg);
  }

  .auth-wrap,
  .game-shell {
    border-radius: 0;
  }
}

@media (max-height: 760px) {
  :root {
    --top-h: 122px;
    --bottom-h: 66px;
  }

  .currency-card strong {
    font-size: 0.76rem;
  }

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

  .booster-grid {
    grid-template-columns: 1fr;
  }
}
