/* ================= 全民脑力擂台 · app styles ================= */

:root {
  --bg: #070a16;
  --bg-soft: #0c1226;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef2ff;
  --muted: #93a1c1;
  --dim: #667391;
  --cyan: #2ee6d6;
  --violet: #8b5cf6;
  --pink: #f472b6;
  --amber: #fbbf24;
  --green: #34d399;
  --red: #fb7185;
  --radius: 22px;
  --shadow: 0 18px 44px rgba(3, 6, 18, 0.55);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}

.bg-orbs span:nth-child(1) {
  width: 340px;
  height: 340px;
  left: -90px;
  top: -70px;
  background: radial-gradient(circle, rgba(46, 230, 214, 0.55), transparent 70%);
}

.bg-orbs span:nth-child(2) {
  width: 380px;
  height: 380px;
  right: -120px;
  top: 18%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.5), transparent 70%);
}

.bg-orbs span:nth-child(3) {
  width: 320px;
  height: 320px;
  left: 20%;
  bottom: -140px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.38), transparent 70%);
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 16px 96px;
  display: flex;
  flex-direction: column;
}

/* ---------------- topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 12px;
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(7, 10, 22, 0.92), rgba(7, 10, 22, 0.55));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: #04121a;
  background: linear-gradient(135deg, var(--cyan), #7dd3fc 45%, var(--violet));
  box-shadow: 0 8px 20px rgba(46, 230, 214, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text small {
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.28);
  font-size: 13px;
  font-weight: 700;
  color: #fde68a;
  flex: 0 0 auto;
}

.wallet b {
  font-variant-numeric: tabular-nums;
}

/* ---------------- layout ---------------- */

.view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
  animation: fadeUp 0.32s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-title h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.card-title .hint {
  font-size: 11.5px;
  color: var(--dim);
}

.hero {
  padding: 22px 20px 20px;
  background:
    radial-gradient(120% 120% at 85% 0%, rgba(139, 92, 246, 0.34), transparent 55%),
    radial-gradient(100% 100% at 0% 100%, rgba(46, 230, 214, 0.18), transparent 60%),
    var(--panel-strong);
  border-color: rgba(255, 255, 255, 0.12);
}

.hero h1 {
  margin: 14px 0 6px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: 0.5px;
  background: linear-gradient(100deg, #ffffff, #b8f5ee 45%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.hero-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: #a5f3fc;
  background: rgba(46, 230, 214, 0.12);
  border: 1px solid rgba(46, 230, 214, 0.24);
}

.pill.ghost {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

.hero-foot {
  margin-top: 14px;
  font-size: 12px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-foot b {
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  color: #04121a;
  background: linear-gradient(120deg, var(--cyan), #86efac 50%, #a5b4fc);
  border: none;
  box-shadow: 0 12px 28px rgba(46, 230, 214, 0.28);
}

.btn.big {
  width: 100%;
  padding: 15px 20px;
  font-size: 16px;
  border-radius: 16px;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.btn.amber {
  color: #2b1a00;
  background: linear-gradient(120deg, #fbbf24, #fcd34d);
  border: none;
  box-shadow: 0 10px 24px rgba(251, 191, 36, 0.24);
}

.btn.block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn em {
  font-style: normal;
  font-size: 17px;
}

/* ---------------- quick grid ---------------- */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 6px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.16s ease, background 0.16s ease;
}

.quick:active {
  transform: scale(0.96);
  background: var(--panel-strong);
}

.quick i {
  font-style: normal;
  font-size: 22px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.quick b {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
}

.quick .dot {
  position: absolute;
  transform: translate(18px, -16px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.18);
}

/* ---------------- checkin ---------------- */

.checkin-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day {
  position: relative;
  padding: 9px 2px 8px;
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--dim);
}

.day span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.2px;
}

.day b {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.day.done {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

.day.done b {
  color: #a7f3d0;
}

.day.today {
  background: rgba(46, 230, 214, 0.14);
  border-color: rgba(46, 230, 214, 0.42);
  color: #99f6e4;
  box-shadow: 0 0 0 1px rgba(46, 230, 214, 0.18) inset;
}

.day.today b {
  color: #ccfbf1;
}

/* ---------------- rank list ---------------- */

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 8px;
  border-radius: 14px;
}

.rank-row + .rank-row {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.rank-row.me {
  background: rgba(46, 230, 214, 0.1);
  border: 1px solid rgba(46, 230, 214, 0.24);
}

.rank-no {
  width: 26px;
  flex: 0 0 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.rank-no.top1 {
  color: #fbbf24;
}

.rank-no.top2 {
  color: #e2e8f0;
}

.rank-no.top3 {
  color: #f9a8a8;
}

.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--line);
}

.rank-meta {
  flex: 1;
  min-width: 0;
}

.rank-meta b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-meta small {
  font-size: 11px;
  color: var(--dim);
}

.rank-score {
  font-size: 15px;
  font-weight: 800;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 26px 10px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}

/* ---------------- tabs ---------------- */

.seg {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.seg button {
  flex: 1;
  padding: 8px 0;
  border-radius: 11px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  transition: all 0.18s ease;
}

.seg button.active {
  color: #04121a;
  background: linear-gradient(120deg, var(--cyan), #a5b4fc);
}

/* ---------------- ad ---------------- */

.ad-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(139, 92, 246, 0.16), rgba(46, 230, 214, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.24);
}

.ad-card .ad-tag {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 0 18px 0 10px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.1);
}

.ad-card .ad-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.09);
}

.ad-card .ad-body {
  flex: 1;
  min-width: 0;
}

.ad-card .ad-body b {
  display: block;
  font-size: 13.5px;
}

.ad-card .ad-body small {
  display: block;
  font-size: 11.5px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-cta {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 9px;
  color: #04121a;
  background: #a5f3fc;
}

/* ---------------- notice ---------------- */

.notice {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.notice strong {
  color: var(--cyan);
  font-size: 11px;
  flex: 0 0 auto;
}

/* ---------------- profile ---------------- */

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: linear-gradient(145deg, rgba(46, 230, 214, 0.24), rgba(139, 92, 246, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.profile-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.profile-head .rank-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--amber);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.24);
  padding: 3px 9px;
  border-radius: 999px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.stat-grid > div {
  padding: 12px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.stat-grid b {
  display: block;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.stat-grid span {
  font-size: 10.5px;
  color: var(--dim);
}

.progressbar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progressbar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 0.6s ease;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.avatar-picker button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 19px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.avatar-picker button.on {
  background: rgba(46, 230, 214, 0.16);
  border-color: rgba(46, 230, 214, 0.42);
}

/* ---------------- tabbar ---------------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  z-index: 30;
  display: flex;
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom));
  gap: 6px;
  background: linear-gradient(to top, rgba(7, 10, 22, 0.98) 55%, rgba(7, 10, 22, 0.72));
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0 5px;
  border-radius: 14px;
  font-size: 10.5px;
  color: var(--dim);
  transition: all 0.18s ease;
}

.tabbar button i {
  font-style: normal;
  font-size: 19px;
  line-height: 1;
  filter: grayscale(0.55) opacity(0.7);
  transition: all 0.18s ease;
}

.tabbar button.active {
  color: var(--cyan);
  background: rgba(46, 230, 214, 0.08);
}

.tabbar button.active i {
  filter: none;
  transform: translateY(-1px);
}

/* ---------------- overlay ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: rgba(4, 7, 16, 0.82);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.22s ease both;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.overlay-inner {
  width: 100%;
  max-width: 460px;
  padding: 16px 16px 30px;
  min-height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.3s ease both;
}

.overlay-inner > * {
  flex-shrink: 0;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 14px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 17px;
}

.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 17px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

/* ---------------- quiz ---------------- */

.quiz {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.quiz-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-progress {
  flex: 1;
}

.quiz-progress .labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--dim);
  margin-bottom: 6px;
}

.timer-ring {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.timer-ring svg {
  transform: rotate(-90deg);
}

.timer-ring text {
  font-size: 16px;
  font-weight: 800;
  fill: var(--text);
  text-anchor: middle;
  dominant-baseline: central;
  font-variant-numeric: tabular-nums;
}

.q-cat {
  display: inline-block;
  font-size: 11px;
  color: var(--cyan);
  background: rgba(46, 230, 214, 0.1);
  border: 1px solid rgba(46, 230, 214, 0.22);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.q-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: 0.2px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 16px;
  text-align: left;
  font-size: 14.5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  transition: all 0.16s ease;
}

.option:active {
  transform: scale(0.985);
}

.option .key {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}

.option.correct {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.5);
}

.option.correct .key {
  background: rgba(52, 211, 153, 0.28);
  color: #a7f3d0;
}

.option.wrong {
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.45);
}

.option.wrong .key {
  background: rgba(251, 113, 133, 0.28);
  color: #fecdd3;
}

.option.dim {
  opacity: 0.45;
}

.combo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.combo .streak {
  color: var(--amber);
  font-weight: 700;
}

/* ---------------- result ---------------- */

.result {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
}

.result-score {
  text-align: center;
  padding: 24px 16px 18px;
  border-radius: 26px;
  background:
    radial-gradient(120% 110% at 50% 0%, rgba(46, 230, 214, 0.2), transparent 60%),
    radial-gradient(100% 120% at 100% 100%, rgba(139, 92, 246, 0.24), transparent 55%),
    var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.result-score .num {
  font-size: 60px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  background: linear-gradient(100deg, #ffffff, #99f6e4 50%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.result-score .unit {
  font-size: 13px;
  color: var(--dim);
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.result-stats div {
  text-align: center;
  padding: 12px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.result-stats b {
  display: block;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.result-stats span {
  font-size: 10.5px;
  color: var(--dim);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-item {
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.review-item .rq {
  font-weight: 600;
  margin-bottom: 4px;
}

.review-item .ra {
  color: var(--dim);
  font-size: 11.5px;
}

.review-item .ra b {
  color: var(--green);
}

.review-item.bad .ra b {
  color: var(--green);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ---------------- wheel ---------------- */

.wheel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 16px 18px;
}

.wheel-stage {
  position: relative;
  width: 250px;
  height: 250px;
  display: grid;
  place-items: center;
}

.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 18px solid var(--amber);
  z-index: 4;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.wheel-stage.big .wheel-pointer {
  top: -2px;
  border-left-width: 11px;
  border-right-width: 11px;
  border-top-width: 22px;
}

.wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform 4.4s cubic-bezier(0.16, 0.84, 0.14, 1);
  will-change: transform;
}

.wheel-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.07), 0 0 0 12px rgba(255, 255, 255, 0.03),
    0 24px 50px rgba(0, 0, 0, 0.5);
}

.wheel-slot {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;
}

.wheel-slot-inner {
  margin-top: 14px;
  width: 66px;
  height: auto;
  align-self: flex-start;
  text-align: center;
  color: #f8fafc;
  line-height: 1.2;
  transform-origin: center center;
}

.wheel-slot-inner span {
  display: block;
  font-size: 16px;
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.wheel-slot-inner b {
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74px;
  height: 74px;
  margin: -37px 0 0 -37px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: #04121a;
  background: linear-gradient(145deg, #fef3c7, #fbbf24);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), 0 0 0 5px rgba(7, 10, 22, 0.85);
  z-index: 3;
}

.wheel-hub:disabled {
  opacity: 0.6;
}

.wheel-meta {
  font-size: 12px;
  color: var(--dim);
  text-align: center;
  line-height: 1.7;
}

.wheel-meta b {
  color: var(--amber);
}

/* ---------------- toast + sheet ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translate(-50%, 14px);
  z-index: 90;
  max-width: 86vw;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 13px;
  color: var(--text);
  background: rgba(18, 24, 44, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.24s ease;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sheet {
  margin-top: auto;
  padding: 20px 18px 24px;
  border-radius: 24px 24px 0 0;
  background: #0d1328;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: sheetUp 0.28s ease both;
}

@keyframes sheetUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.sheet h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.sheet p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  outline: none;
}

.field input:focus {
  border-color: rgba(46, 230, 214, 0.45);
}

/* ---------------- ad modal ---------------- */

.ad-modal {
  position: relative;
  margin: 40px auto;
  width: 100%;
  max-width: 380px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(160deg, #101a35, #0b1022);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  box-shadow: var(--shadow);
}

.ad-modal .ad-tag {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--dim);
}

.ad-visual {
  height: 150px;
  margin: 18px 0;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 42px;
  background:
    radial-gradient(circle at 30% 25%, rgba(46, 230, 214, 0.3), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(139, 92, 246, 0.35), transparent 55%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-modal h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.ad-modal p {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--muted);
}

.ad-count {
  font-size: 12px;
  color: var(--amber);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}

.footer-note {
  text-align: center;
  font-size: 11px;
  color: #3f4a63;
  padding: 6px 0 2px;
  line-height: 1.8;
}

.loading {
  display: grid;
  place-items: center;
  padding: 60px 0;
  color: var(--dim);
  font-size: 13px;
  gap: 12px;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 23px;
  }
  .wheel-stage {
    width: 220px;
    height: 220px;
  }
  .quick {
    padding: 12px 4px;
  }
}

/* ---------------- card game (anime) ---------------- */

.game-hero {
  position: relative;
  overflow: hidden;
}

.game-hero::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--c, #67e8f9);
  opacity: 0.18;
  filter: blur(30px);
  pointer-events: none;
}

.game-hero-top {
  display: flex;
  gap: 14px;
  align-items: center;
  position: relative;
}

.game-avatar {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--c, var(--line));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), inset 0 0 22px rgba(255, 255, 255, 0.04);
}

.game-name {
  font-size: 19px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-title {
  font-size: 12px;
  color: var(--dim);
  margin-top: 2px;
}

.game-stats {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.game-stats b {
  color: var(--text);
  font-size: 13px;
}

.rarity-chip {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}

.rarity-chip.r-N {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.18);
}
.rarity-chip.r-R {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.16);
}
.rarity-chip.r-SR {
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.18);
}
.rarity-chip.r-SSR {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.18);
}

.skill-line {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.skill-line b {
  color: var(--amber);
  margin-right: 4px;
}

.game-hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.game-hero-actions .btn {
  flex: 1;
  padding: 11px;
  font-size: 13px;
}

.game-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.game-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 4px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.game-action i {
  font-style: normal;
  font-size: 22px;
}

.game-action b {
  font-size: 12.5px;
}

.game-action small {
  font-size: 10px;
  color: var(--dim);
}

.game-tip {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--dim);
}

.card-scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 4px;
}

.mini-card {
  flex: 0 0 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.mini-card.active {
  border-color: var(--c, var(--cyan));
  box-shadow: 0 0 0 1px var(--c, var(--cyan)), 0 10px 24px rgba(0, 0, 0, 0.35);
}

.mini-card.r-SSR {
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.16), rgba(255, 255, 255, 0.03));
}
.mini-card.r-SR {
  background: linear-gradient(160deg, rgba(167, 139, 250, 0.16), rgba(255, 255, 255, 0.03));
}
.mini-card.r-R {
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.13), rgba(255, 255, 255, 0.03));
}

.mini-avatar {
  font-size: 26px;
}

.mini-card b {
  font-size: 11.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-card small {
  font-size: 9.5px;
  color: var(--dim);
}

.flow-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.flow-list > div {
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
}

.flow-list i {
  font-style: normal;
  font-size: 19px;
  grid-row: span 2;
}

.flow-list b {
  font-size: 13px;
}

.flow-list small {
  font-size: 11px;
  color: var(--dim);
}

/* gacha */

.gacha-banner {
  text-align: center;
  padding: 16px 10px 12px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 0%, rgba(167, 139, 250, 0.28), rgba(255, 255, 255, 0.03) 70%);
  border: 1px solid var(--line);
}

.gacha-star {
  font-size: 28px;
}

.gacha-banner h3 {
  margin: 6px 0 2px;
  font-size: 17px;
}

.gacha-banner p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.gacha-pity {
  margin-top: 8px;
  font-size: 11px;
  color: var(--dim);
}

.gacha-pity b {
  color: var(--amber);
}

.gacha-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.gacha-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.gacha-item.r-SSR {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.25);
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.18), rgba(255, 255, 255, 0.03));
}
.gacha-item.r-SR {
  border-color: rgba(167, 139, 250, 0.5);
  background: linear-gradient(160deg, rgba(167, 139, 250, 0.16), rgba(255, 255, 255, 0.03));
}

.gacha-avatar {
  font-size: 26px;
}

.gacha-item b {
  font-size: 11.5px;
}

.gacha-item small {
  font-size: 9.5px;
  color: var(--dim);
}

/* collection */

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

.collection-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 11px 6px 9px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  min-width: 0;
  overflow: hidden;
}

.collection-item span {
  font-size: 25px;
  line-height: 1.2;
}

.collection-item b {
  font-size: 11px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-item .c-title {
  font-style: normal;
  font-size: 9.5px;
  color: var(--dim);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-item small {
  font-size: 9.5px;
  color: var(--dim);
  white-space: nowrap;
}

.collection-item.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.collection-item.r-SSR {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.14), rgba(255, 255, 255, 0.03));
}

.collection-item.r-SR {
  border-color: rgba(167, 139, 250, 0.38);
  background: linear-gradient(160deg, rgba(167, 139, 250, 0.13), rgba(255, 255, 255, 0.03));
}

.collection-item.r-R {
  border-color: rgba(52, 211, 153, 0.32);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.1), rgba(255, 255, 255, 0.03));
}

.info-block {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row b {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

/* market */

.market-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.market-tabs button {
  flex: 1;
  padding: 9px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.market-tabs button.active {
  color: var(--text);
  border-color: var(--cyan);
  background: rgba(46, 230, 214, 0.1);
}

.market-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.market-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.market-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--c, var(--line));
}

.market-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.market-meta b {
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.market-meta small {
  font-size: 10.5px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.market-side b {
  color: var(--amber);
  font-size: 14px;
}

.market-side .btn {
  padding: 5px 12px;
  font-size: 11px;
}

/* inventory / detail */

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.inventory-grid .mini-card {
  flex: none;
}

.detail-head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.detail-avatar {
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--c, var(--line));
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

.detail-actions .btn {
  padding: 10px;
  font-size: 12px;
}

.detail-actions .btn:first-child {
  grid-column: span 2;
}

/* battle */

.battle-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
}

.fighter {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.fighter-face {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--c, var(--line));
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

.fighter b {
  font-size: 12.5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fighter small {
  font-size: 10px;
  color: var(--dim);
}

.hpbar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.hpbar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #2ee6d6);
  transition: width 0.45s ease;
}

.fighter.ai .hpbar i {
  background: linear-gradient(90deg, #fb7185, #f472b6);
}

.battle-vs {
  flex: 0 0 34px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--amber);
}

.battle-turn {
  text-align: center;
  font-size: 11.5px;
  color: var(--dim);
  margin-bottom: 10px;
}

.battle-question p {
  margin: 8px 0 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.battle-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.battle-options button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 13px;
  font-size: 13px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.battle-options button:disabled {
  opacity: 0.55;
}

.battle-options button i {
  font-style: normal;
  flex: 0 0 22px;
  height: 22px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(46, 230, 214, 0.14);
  color: var(--cyan);
}

.battle-feed {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 20px;
}

.feed-line {
  font-size: 12px;
  padding: 8px 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--cyan);
}

.feed-line.ai {
  border-left-color: var(--pink);
}

.feed-line em {
  display: block;
  font-style: normal;
  color: var(--dim);
  font-size: 11px;
  margin-top: 2px;
}

.battle-result {
  text-align: center;
}

.result-emoji {
  font-size: 46px;
  margin-top: 4px;
}

.battle-result h3 {
  margin: 8px 0 14px;
  font-size: 17px;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.result-list > div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.result-list b {
  color: var(--amber);
}

@media (max-width: 380px) {
  .inventory-grid,
  .collection-grid,
  .gacha-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* growth tasks & battle stance */

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}

.task-row:last-of-type {
  border-bottom: none;
}

.task-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-main b {
  font-size: 12.5px;
}

.task-main small {
  font-size: 10.5px;
  color: var(--dim);
}

.task-sub {
  margin: 14px 0 2px;
  font-size: 11px;
  color: var(--dim);
}

.stance-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.stance-row button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.stance-row button small {
  font-size: 9.5px;
  color: var(--dim);
}

.stance-row button.active {
  color: var(--text);
  border-color: var(--cyan);
  background: rgba(46, 230, 214, 0.12);
}

.stance-row button.active small {
  color: var(--cyan);
}

.deck-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.deck-dots span {
  font-size: 10.5px;
  color: var(--dim);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.deck-dots span.active {
  color: var(--cyan);
  border-color: var(--cyan);
}

.id-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--dim);
  flex-wrap: wrap;
}

.id-line b {
  color: var(--text);
  font-family: monospace;
}

button.collection-item {
  color: inherit;
  cursor: pointer;
}

/* anime portraits */

.card-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.card-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
}

.card-face em {
  font-style: normal;
  line-height: 1;
}

.mini-card .mini-avatar {
  width: 58px;
  height: 70px;
  display: block;
  border-radius: 10px;
}

.mini-card .mini-avatar em {
  font-size: 24px;
}

.gacha-avatar {
  width: 58px;
  height: 72px;
  display: block;
  border-radius: 10px;
}

.gacha-avatar em {
  font-size: 24px;
}

.collection-item > span {
  width: 100%;
  height: 86px;
  display: block;
  border-radius: 10px;
}

.collection-item > span em {
  font-size: 26px;
}

/* ---------- layout completeness pass ---------- */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

.market-meta {
  flex: 1;
  min-width: 0;
}

.market-meta b,
.market-meta small,
.game-name,
.task-main b,
.task-main small,
.rank-row b,
.rank-row small,
.notice,
.hero p {
  overflow-wrap: anywhere;
}

.rank-row > * {
  min-width: 0;
}

.overlay-inner {
  padding-bottom: calc(34px + env(safe-area-inset-bottom));
}

.app {
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

@media (max-width: 360px) {
  .game-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stance-row {
    flex-wrap: wrap;
  }

  .stance-row button {
    flex: 1 1 30%;
  }

  .market-row {
    flex-wrap: wrap;
  }

  .market-side {
    flex-direction: row;
    width: 100%;
    align-items: center;
    justify-content: space-between;
  }

  .battle-stage {
    gap: 6px;
  }

  .fighter-name {
    font-size: 11px;
  }
}

.detail-actions .btn,
.result-actions .btn,
.market-tabs button,
.stance-row button {
  white-space: normal;
  line-height: 1.35;
  text-align: center;
}

/* ---------------- 今日概览 / 双倍金币时段 ---------------- */

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.hero-pills span {
  font-size: 10.5px;
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.hero-pills b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.event-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.26);
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
}

.event-strip.on {
  background: linear-gradient(100deg, rgba(251, 191, 36, 0.2), rgba(244, 114, 182, 0.14));
  border-color: rgba(251, 191, 36, 0.42);
}

.event-strip .es-icon {
  font-size: 15px;
  flex: 0 0 auto;
}

.event-strip b {
  font-size: 11.5px;
  color: var(--text);
  white-space: nowrap;
}

.event-strip small {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-strip em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--amber);
  flex: 0 0 auto;
}

.double-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(100deg, rgba(139, 92, 246, 0.18), rgba(46, 230, 214, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.double-banner.on {
  background: linear-gradient(100deg, rgba(251, 191, 36, 0.22), rgba(244, 114, 182, 0.16));
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.18);
}

.db-icon {
  font-size: 20px;
}

.db-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.db-text b {
  font-size: 12.5px;
}

.db-text small {
  font-size: 10.5px;
  color: var(--muted);
}

.db-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--amber);
}

/* ---------------- 世界 BOSS ---------------- */

.boss-card {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(251, 113, 133, 0.18), transparent 60%),
    var(--panel);
  border-color: rgba(251, 113, 133, 0.28);
}

.boss-card.dead {
  opacity: 0.85;
}

.boss-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.boss-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: rgba(251, 113, 133, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.35);
  box-shadow: inset 0 0 20px rgba(251, 113, 133, 0.18);
}

.boss-meta {
  flex: 1;
  min-width: 0;
}

.boss-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
}

.boss-sub {
  font-size: 11px;
  color: var(--dim);
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.boss-mine {
  text-align: right;
}

.boss-mine b {
  display: block;
  font-size: 16px;
  color: #fb7185;
  font-variant-numeric: tabular-nums;
}

.boss-mine span {
  font-size: 10.5px;
  color: var(--dim);
}

.chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.chip.live {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.2);
}

.chip.off {
  color: var(--dim);
  background: rgba(255, 255, 255, 0.06);
}

.boss-hp {
  position: relative;
  margin-top: 14px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.boss-hp i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fb7185, #f97316, #fbbf24);
  transition: width 0.5s ease;
}

.boss-hp em {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.boss-hp.big {
  height: 22px;
}

.boss-hp.big em {
  font-size: 11.5px;
}

.boss-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--dim);
  flex-wrap: wrap;
}

.boss-foot .btn {
  padding: 8px 14px;
  font-size: 12px;
}

.boss-banner {
  text-align: center;
  padding: 14px 10px 12px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 0%, rgba(251, 113, 133, 0.28), rgba(255, 255, 255, 0.03) 70%);
  border: 1px solid var(--line);
}

.boss-big-avatar {
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 8px 20px rgba(251, 113, 133, 0.4));
}

.boss-banner h3 {
  margin: 8px 0 4px;
  font-size: 19px;
}

.boss-banner p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}

.boss-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.boss-facts > div {
  text-align: center;
  padding: 9px 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.boss-facts b {
  display: block;
  font-size: 15px;
}

.boss-facts span {
  font-size: 10.5px;
  color: var(--dim);
}

.boss-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.24);
}

.boss-strip-face {
  font-size: 26px;
}

.boss-strip .boss-hp {
  flex: 1;
  margin-top: 0;
}

.battle-options button.correct {
  border-color: rgba(52, 211, 153, 0.6);
  background: rgba(52, 211, 153, 0.16);
}

.battle-options button.wrong {
  border-color: rgba(251, 113, 133, 0.6);
  background: rgba(251, 113, 133, 0.16);
}

/* ---------------- 成就 ---------------- */

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

.ach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  text-align: center;
}

.ach-item.on {
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.16), rgba(255, 255, 255, 0.03));
  border-color: rgba(251, 191, 36, 0.4);
}

.ach-icon {
  font-size: 21px;
  filter: grayscale(1) opacity(0.5);
}

.ach-item.on .ach-icon {
  filter: none;
}

.ach-item b {
  font-size: 11.5px;
}

.ach-item small {
  font-size: 9.5px;
  color: var(--dim);
  line-height: 1.4;
}

.ach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.ach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.ach-row.on {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.ach-row-icon {
  font-size: 19px;
}

.ach-row-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ach-row-meta b {
  font-size: 12.5px;
}

.ach-row-meta small {
  font-size: 10.5px;
  color: var(--dim);
}

/* ---------------- BOSS 立绘 ---------------- */

.boss-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.boss-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.boss-art em {
  font-style: normal;
  font-size: 24px;
}

.boss-art.card {
  width: 72px;
  height: 96px;
}

.boss-art.hero {
  width: 156px;
  height: 208px;
  margin: 0 auto;
  border-radius: 20px;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 0 30px rgba(255, 255, 255, 0.05);
}

.boss-art.hero em {
  font-size: 46px;
}

.boss-art.strip {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.boss-art.strip em,
.boss-art.next em {
  font-size: 18px;
}

.boss-art.next {
  width: 36px;
  height: 46px;
  border-radius: 10px;
}

.boss-lore {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.boss-next-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.boss-next-row > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.boss-next-row small {
  font-size: 9.5px;
  color: var(--dim);
}

.boss-next-row b {
  font-size: 12px;
}

.boss-next-row .hint {
  font-size: 10px;
  color: var(--dim);
}

/* ---------------- 标签 ---------------- */

.tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  white-space: nowrap;
}

.tag.on {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}

.tag.off {
  background: rgba(255, 255, 255, 0.05);
  color: var(--dim);
}

@media (max-width: 360px) {
  .ach-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .boss-mine {
    display: none;
  }

  .event-strip small {
    display: none;
  }
}

/* ---------------- 新手引导 / 榜单奖励 / 战绩海报 ---------------- */

.guide-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 12px;
}

.guide-progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.guide-item.on {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.25);
}

.gi-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--dim);
  margin-top: 1px;
}

.guide-item.on .gi-dot {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.gi-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.gi-text b {
  font-size: 13px;
}

.gi-text small {
  font-size: 11px;
  color: var(--dim);
}

.rr-block {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.rr-block + .rr-block {
  margin-top: 10px;
}

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

.rr-head b {
  font-size: 13.5px;
}

.rr-head small {
  font-size: 10.5px;
  color: var(--dim);
}

.rr-mine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 9px;
}

.rr-mine em {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dim);
  white-space: nowrap;
}

.rr-mine em.on {
  color: var(--amber);
}

.rr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.rr-chip {
  font-size: 10.5px;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.rr-chip b {
  color: var(--text);
  margin-left: 2px;
}

.poster-wrap {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  max-width: 320px;
  margin: 0 auto;
}

.poster-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

a.btn {
  text-decoration: none;
}

/* ---------------- 广告联盟接入 ---------------- */

.ad-network {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  padding: 26px 8px 8px;
  overflow: hidden;
}

.ad-network > .ad-tag {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 9.5px;
  letter-spacing: 0.5px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 2px 7px;
}

.ad-network-body {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.ad-frame {
  width: 100%;
  border: 0;
  display: block;
  background: transparent;
}

.ad-modal .ad-network-body {
  margin: 4px 0 12px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  min-height: 90px;
}
