:root {
  color-scheme: dark;
  --bg: #050608;
  --bg-2: #0a0d11;
  --surface: #101319;
  --surface-2: #171b22;
  --surface-3: #222731;
  --text: #f4f1ea;
  --muted: #a7adb8;
  --line: #303642;
  --accent: #f5b642;
  --accent-2: #e9edf3;
  --blue: #48b6d8;
  --violet: #6f7d8e;
  --yellow: #f8c84b;
  --success: #85d46f;
  --danger: #ff655f;
  --vk: #4c8bf5;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.46);
  --radius: 8px;
  --ease-out: cubic-bezier(0.2, 0.85, 0.22, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Segoe UI", Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

/* 2026 retention pass: activation, live club and referrals */
.welcome-panel {
  overflow: hidden;
  position: relative;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(40, 69, 111, 0.34), transparent 58%),
    #10141c;
}

.welcome-panel::after {
  content: var(--brand-monogram, "CL");
  position: absolute;
  right: -14px;
  top: -28px;
  color: rgba(255, 255, 255, 0.035);
  font-size: 124px;
  font-weight: 950;
  letter-spacing: -12px;
  pointer-events: none;
}

.welcome-panel h2,
.activation-card h2,
.live-club-card h2,
.referral-card h2,
.referral-hero h2 {
  margin: 4px 0 8px;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.invite-captured {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(133, 212, 111, 0.3);
  border-radius: 8px;
  background: rgba(133, 212, 111, 0.08);
}

.invite-captured span,
.invite-captured strong {
  font-size: 12px;
}

.inline-back {
  width: fit-content;
  box-shadow: none;
}

.activation-card,
.live-club-card,
.referral-card,
.referral-hero {
  border: 1px solid #323b4a;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
}

.activation-card {
  background:
    linear-gradient(145deg, rgba(66, 102, 159, 0.22), transparent 58%),
    #111722;
}

.progress-ring {
  --progress: 0;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(#f5b642 calc(var(--progress) * 1turn), #303846 0);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: #111722;
}

.progress-ring::before {
  z-index: 0;
}

.progress-ring b {
  position: relative;
  z-index: 1;
}

.activation-steps {
  display: grid;
  gap: 7px;
}

button.activation-step {
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  justify-items: start;
  gap: 10px;
  padding: 9px 10px;
  border-color: #3a4658;
  background: rgba(4, 7, 12, 0.48);
  text-align: left;
  box-shadow: none;
}

button.activation-step:disabled {
  opacity: 1;
}

.activation-step > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.activation-step small,
.activation-step b {
  color: #b7c0ce;
  font-size: 12px;
  font-weight: 600;
}

.activation-step b {
  color: #ffd15d;
}

.step-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #566276;
  border-radius: 50%;
  color: #0b1208;
}

.activation-step.done .step-check {
  border-color: #85d46f;
  background: #85d46f;
}

.live-club-card {
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(115deg, rgba(20, 41, 71, 0.94), rgba(10, 14, 22, 0.98)),
    #0b1018;
}

.live-club-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -92px;
  top: -94px;
  border: 30px solid rgba(245, 182, 66, 0.055);
  border-radius: 50%;
  pointer-events: none;
}

.live-club-head,
.live-club-head > div,
.club-match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-club-head {
  color: #bcc6d5;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #85d46f;
  box-shadow: 0 0 0 4px rgba(133, 212, 111, 0.11);
}

.live-club-card p {
  margin: 0;
  color: #b9c1ce;
  font-size: 13px;
}

.visit-series {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  background: rgba(4, 8, 14, 0.52);
}

.visit-series-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.visit-series-copy strong {
  color: #f4f7fc;
  font-size: 13px;
}

.visit-series-copy span {
  color: #b8c2d1;
  font-size: 11px;
}

.visit-series-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.visit-step {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: #929dad;
  font-size: 10px;
}

.visit-step i {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid #4a5565;
  border-radius: 50%;
  color: #c8d0dc;
  font-style: normal;
  font-weight: 850;
}

.visit-step b {
  font-size: 10px;
}

.visit-step.current i {
  border-color: #f5b642;
  color: #ffd36d;
  box-shadow: 0 0 0 3px rgba(245, 182, 66, 0.1);
}

.visit-step.done {
  color: #a5df93;
}

.visit-step.done i {
  border-color: #85d46f;
  background: #85d46f;
  color: #071006;
}

.daily-checkin-card {
  padding: 16px;
  border: 1px solid #344052;
  border-radius: 10px;
  background:
    radial-gradient(circle at 88% 4%, rgba(245, 182, 66, 0.1), transparent 34%),
    #10141c;
}

.checkin-heading h2 {
  margin: 4px 0 0;
  letter-spacing: -0.025em;
}

.checkin-next {
  max-width: 112px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(245, 182, 66, 0.12);
  color: #ffd36d;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.checkin-rule {
  margin: 0;
  color: #bdc5d1;
  font-size: 12px;
  line-height: 1.45;
}

.checkin-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.checkin-day {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  color: #8994a5;
}

.checkin-day i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  max-width: 100%;
  border: 1px solid #414b5b;
  border-radius: 50%;
  color: #c1c9d5;
  font-style: normal;
  font-size: 11px;
  font-weight: 850;
}

.checkin-day small {
  overflow: hidden;
  max-width: 100%;
  color: inherit;
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-day.current i {
  border-color: #f5b642;
  color: #ffd36d;
  box-shadow: 0 0 0 3px rgba(245, 182, 66, 0.1);
}

.checkin-day.done {
  color: #a5df93;
}

.checkin-day.done i {
  border-color: #85d46f;
  background: #85d46f;
  color: #071006;
}

.checkin-claim {
  width: 100%;
  min-height: 46px;
}

@media (max-width: 370px) {
  .visit-series {
    align-items: flex-start;
    flex-direction: column;
  }

  .visit-series-steps {
    width: 100%;
    justify-content: flex-start;
  }

  .checkin-day i {
    width: 28px;
    height: 28px;
  }
}

.weekly-leaderboard-card {
  overflow: hidden;
  position: relative;
  padding: 16px;
  border: 1px solid #394253;
  border-radius: 10px;
  background:
    radial-gradient(circle at 92% -8%, rgba(72, 182, 216, 0.12), transparent 36%),
    #10151e;
}

.leaderboard-heading,
.leaderboard-own,
.leaderboard-own > div,
.leaderboard-kicker,
.leaderboard-prizes,
.leaderboard-prizes > span {
  display: flex;
  align-items: center;
}

.leaderboard-heading,
.leaderboard-own {
  justify-content: space-between;
  gap: 12px;
}

.leaderboard-heading h2 {
  margin: 4px 0 0;
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.leaderboard-kicker {
  gap: 7px;
  color: #c4cbd6;
  font-size: 0.75rem;
  font-weight: 750;
}

.leaderboard-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(72, 182, 216, 0.11);
}

.leaderboard-deadline {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 6px;
  background: #202733;
  color: #d7dde6;
  font-size: 0.6875rem;
  font-weight: 750;
}

.leaderboard-rule {
  max-width: 60ch;
  margin: 0;
  color: #b9c2cf;
  font-size: 0.8125rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.leaderboard-prizes {
  gap: 7px;
}

.leaderboard-prizes > span {
  flex: 1 1 0;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid #384151;
  border-radius: 7px;
  background: rgba(4, 7, 12, 0.42);
  color: #cbd2dd;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.leaderboard-prizes b {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #313a49;
  color: #fff;
  font-size: 0.6875rem;
}

.leaderboard-prizes .place-1 strong,
.leaderboard-row.place-1 .leaderboard-place {
  color: #ffd15d;
}

.leaderboard-prizes .place-2 strong,
.leaderboard-row.place-2 .leaderboard-place {
  color: #d5dce6;
}

.leaderboard-prizes .place-3 strong,
.leaderboard-row.place-3 .leaderboard-place {
  color: #dda57a;
}

.leaderboard-list {
  display: grid;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 24px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 51px;
  padding: 7px 5px;
}

.leaderboard-row + .leaderboard-row {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-row.is-me {
  border-radius: 7px;
  background: rgba(72, 182, 216, 0.09);
}

.leaderboard-place,
.leaderboard-score {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.leaderboard-place {
  text-align: center;
}

.leaderboard-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #465269;
  border-radius: 8px;
  background: #263146;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 900;
}

.leaderboard-player {
  display: grid;
  gap: 2px;
}

.leaderboard-player strong,
.leaderboard-score {
  font-size: 0.8125rem;
}

.leaderboard-player small {
  color: #adb7c6;
  font-size: 0.6875rem;
}

.leaderboard-score {
  color: #e8edf5;
}

.leaderboard-own {
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-own > div {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.leaderboard-own span {
  color: #b9c4d3;
  font-size: 0.6875rem;
}

.leaderboard-own strong {
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.admin-leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.admin-leaderboard-network {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-leaderboard-network > .row > span {
  color: var(--muted);
  font-size: 0.75rem;
}

.admin-leaderboard-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-size: 0.8125rem;
}

.admin-leaderboard-row b {
  color: var(--accent);
  text-align: center;
}

.admin-leaderboard-row em {
  color: var(--success);
  font-style: normal;
  font-weight: 800;
}

.club-match-row {
  align-items: stretch;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.club-match-row > div {
  display: grid;
  align-content: center;
  gap: 3px;
}

.club-match-row span,
.club-match-row strong {
  font-size: 12px;
}

.club-match-row span {
  color: #9faabc;
}

.referral-card {
  background:
    linear-gradient(135deg, rgba(107, 84, 30, 0.2), transparent 50%),
    #15171c;
}

.reward-chip {
  display: grid;
  place-items: center;
  min-width: 54px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid rgba(245, 182, 66, 0.4);
  border-radius: 7px;
  background: rgba(245, 182, 66, 0.11);
  color: #ffd15d;
  font-weight: 950;
}

.referral-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #323844;
  border-radius: 8px;
}

.referral-stats > div {
  display: grid;
  gap: 2px;
  padding: 10px 8px;
  text-align: center;
  background: rgba(5, 7, 10, 0.35);
}

.referral-stats > div + div {
  border-left: 1px solid #323844;
}

.referral-stats strong {
  font-size: 19px;
}

.referral-stats span {
  color: #aeb6c3;
  font-size: 10px;
}

.referral-hero {
  background:
    radial-gradient(circle at 90% 0, rgba(245, 182, 66, 0.18), transparent 38%),
    linear-gradient(140deg, #1a2130, #10131a 68%);
}

.referral-hero > p:not(.eyebrow) {
  margin: 0;
  color: #c3cad5;
  line-height: 1.45;
}

.invite-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px dashed #647086;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.invite-code span {
  color: #aeb7c5;
  font-size: 12px;
}

.invite-code strong {
  color: #ffd15d;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.12em;
}

.referral-qr {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #3e4858;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.referral-qr img {
  display: block;
  width: 92px;
  height: 92px;
  padding: 5px;
  border-radius: 6px;
  background: white;
}

.referral-qr span {
  color: #c8d0dc;
  font-size: 13px;
  font-weight: 750;
}

.referral-rules ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.referral-rules li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.referral-rules li > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #566276;
  border-radius: 50%;
  color: #ffd15d;
  font-weight: 900;
}

.referral-rules li > div {
  display: grid;
  gap: 2px;
}

.referral-rules small,
.invitee-row small,
.empty-invites span {
  color: #aeb6c3;
  font-size: 12px;
}

.invitee-list {
  display: grid;
}

.invitee-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.invitee-row + .invitee-row {
  border-top: 1px solid #303642;
}

.invitee-row > div,
.empty-invites {
  display: grid;
  gap: 3px;
}

.avatar-mini {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #27364f;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.empty-invites {
  padding: 18px 10px;
  border: 1px dashed #414a59;
  border-radius: 8px;
  text-align: center;
}

@media (max-width: 390px) {
  .club-match-row {
    display: grid;
  }

  .club-match-row button {
    width: 100%;
  }

  .activation-card,
  .live-club-card,
  .weekly-leaderboard-card,
  .referral-card,
  .referral-hero {
    padding: 14px;
  }

  .leaderboard-heading {
    align-items: flex-start;
  }

  .leaderboard-deadline {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .activation-card,
  .live-club-card,
  .weekly-leaderboard-card,
  .referral-card,
  .referral-hero {
    animation: none;
  }
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(245, 182, 66, 0.12), transparent 34%),
    linear-gradient(180deg, #11151c 0, #07090d 42%, var(--bg) 100%);
  color: var(--text);
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  min-height: 42px;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #252a34, #171b22);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateZ(0);
  transition:
    transform 150ms var(--ease-out),
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

button.primary {
  background: linear-gradient(180deg, #ffd15d, #e8a62f);
  border-color: rgba(255, 209, 93, 0.5);
  color: #11100d;
  font-weight: 850;
  box-shadow: 0 10px 28px rgba(245, 182, 66, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

button.warn {
  background: var(--yellow);
  color: #15110a;
  font-weight: 850;
}

button.danger {
  background: var(--danger);
  color: white;
  font-weight: 850;
}

button.ghost {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.1);
}

button.small {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 13px;
}

button.icon-btn {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 22px;
}

button:disabled {
  opacity: 0.48;
  cursor: default;
}

button:not(:disabled):active {
  transform: translateY(1px) scale(0.985);
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0c1018;
  color: var(--text);
  padding: 11px 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(245, 182, 66, 0.76);
  box-shadow: 0 0 0 3px rgba(245, 182, 66, 0.14);
}

textarea {
  min-height: 104px;
  resize: vertical;
}

a {
  color: var(--blue);
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 10px 96px;
}

.topbar,
.admin-topbar,
.section-head,
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar,
.admin-topbar {
  margin-bottom: 14px;
}

.section-head {
  align-items: flex-start;
}

.section-head h2,
.section-head h3,
.panel h2,
.panel h3 {
  margin: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #05070a;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.12;
}

.brand span,
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.panel {
  background: rgba(16, 19, 25, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  animation: surface-in 180ms var(--ease-soft) both;
}

.stack {
  display: grid;
  gap: 12px;
}

.grid-2,
.metric-grid,
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action-grid button {
  width: 100%;
}

.hero-panel,
.profile-card,
.wheel-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    #11151c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
}

.hero-panel::before,
.profile-card::before,
.wheel-hero::before {
  display: none;
}

.hero-panel > *,
.profile-card > *,
.wheel-hero > * {
  position: relative;
  z-index: 1;
}

.hero-panel h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.04;
}

.hero-panel.compact h2 {
  font-size: 28px;
}

.hero-panel p {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  z-index: 120;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  width: min(calc(100% - 20px), 500px);
  transform: translateX(-50%);
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(16, 20, 30, 0.96);
  color: white;
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  animation: toast-in 240ms ease-out;
}

.toast strong {
  font-size: 12px;
  color: var(--blue);
  text-transform: uppercase;
}

.toast span {
  line-height: 1.35;
}

.toast.success {
  border-color: color-mix(in oklch, var(--success) 48%, var(--line));
  background: linear-gradient(180deg, color-mix(in oklch, var(--success) 13%, #111821), #111821);
}

.toast.warn {
  border-color: color-mix(in oklch, var(--yellow) 48%, var(--line));
  background: linear-gradient(180deg, color-mix(in oklch, var(--yellow) 13%, #111821), #111821);
}

.toast.error {
  border-color: color-mix(in oklch, var(--danger) 48%, var(--line));
  background: linear-gradient(180deg, color-mix(in oklch, var(--danger) 13%, #111821), #111821);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes soft-pulse {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(120%);
  }
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.profile-card.compact {
  padding: 13px;
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #2a303b, #11151c);
  border: 2px solid rgba(245, 182, 66, 0.36);
  color: var(--accent);
  font-weight: 900;
  overflow: hidden;
  box-shadow: 0 0 0 4px rgba(245, 182, 66, 0.08);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-main {
  display: grid;
  gap: 9px;
}

.profile-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.profile-title > div {
  min-width: 0;
}

.profile-title-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.profile-settings-button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  font-size: 19px;
  line-height: 1;
}

.profile-title h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.1;
}

.profile-title p,
.profile-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-meta span {
  border: 1px solid rgba(245, 182, 66, 0.18);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(245, 182, 66, 0.055);
}

.loyalty {
  flex: 0 1 auto;
  max-width: 120px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.loyalty.standard {
  background: rgba(255, 255, 255, 0.08);
  color: #d4d8df;
}

.loyalty.gold {
  background: rgba(255, 209, 102, 0.18);
  color: var(--yellow);
}

.loyalty.black {
  background: #05070a;
  color: #f2f3f5;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.verify-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.verify-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.verify-chip i,
.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 93, 108, 0.12);
}

.verify-chip.ok i,
.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
}

.profile-page {
  gap: 12px;
}

.profile-sections {
  display: grid;
  gap: 8px;
}

.profile-disclosure {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.profile-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  transition:
    background-color 180ms var(--ease-out),
    color 180ms var(--ease-out);
}

.profile-disclosure summary::-webkit-details-marker {
  display: none;
}

.profile-disclosure summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.profile-disclosure-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.profile-disclosure-copy strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.profile-disclosure-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-disclosure-side {
  display: grid;
  grid-template-columns: minmax(36px, auto) 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-items: end;
  gap: 9px;
}

.profile-disclosure-side b {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.profile-disclosure-side i {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  transition:
    background-color 180ms var(--ease-out),
    color 180ms var(--ease-out);
}

.profile-disclosure-side i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(-50%, -66%) rotate(45deg);
  transform-origin: 50% 50%;
  transition: transform 240ms var(--ease-soft);
}

.profile-disclosure[open] .profile-disclosure-side i {
  color: var(--text);
  background: color-mix(in oklch, var(--accent) 16%, var(--surface-2));
}

.profile-disclosure[open]:not([data-motion="closing"]) .profile-disclosure-side i::before {
  transform: translate(-50%, -28%) rotate(225deg);
}

.profile-disclosure[data-motion="closing"] .profile-disclosure-side i {
  color: var(--muted);
  background: var(--surface-2);
}

.profile-disclosure[data-motion="closing"] .profile-disclosure-side i::before {
  transform: translate(-50%, -66%) rotate(45deg);
}

.profile-disclosure-body {
  overflow: hidden;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.profile-disclosure .profile-disclosure-body > .player-progress-card.is-full,
.profile-disclosure-body > .achievements-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.profile-disclosure-body > .achievements-panel > .section-head {
  display: none;
}

.profile-inline-settings {
  gap: 12px;
}

.profile-link-actions {
  align-items: stretch;
}

.settings-view {
  gap: 12px;
}

.settings-page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

.settings-page-head > div {
  display: grid;
  gap: 2px;
}

.settings-page-head h2,
.settings-page-head p {
  margin: 0;
}

.settings-page-head h2 {
  font-size: 20px;
}

.settings-page-head p {
  color: var(--muted);
  font-size: 12px;
}

.settings-back {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  font-size: 20px;
}

@media (hover: hover) and (pointer: fine) {
  .profile-disclosure summary:hover {
    background: var(--surface-2);
  }
}

.age-gate {
  display: grid;
  align-content: center;
  min-height: min(70vh, 620px);
}

.age-gate > .panel {
  width: 100%;
}

.age-actions {
  display: grid;
  gap: 10px;
}

.age-actions button {
  min-height: 48px;
}

.age-preview {
  gap: 10px;
}

.age-preview h3 {
  margin: 0;
  font-size: 15px;
}

.read-only-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-block: 1px solid var(--border);
}

.read-only-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.read-only-list li + li {
  border-top: 1px solid var(--border);
}

.read-only-list strong {
  color: var(--text);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .profile-disclosure-side i {
    transition: none;
  }
}

.metric {
  min-height: 74px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 11px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 25px;
  line-height: 1;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.vk-button {
  background: var(--vk);
  color: white;
  font-weight: 850;
}

.tabs,
.bottom-nav {
  display: flex;
  gap: 6px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  z-index: 40;
  width: min(calc(100% - 20px), 500px);
  transform: translateX(-50%);
  padding: 7px;
  background: rgba(9, 11, 15, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
}

.tabs button,
.bottom-nav button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 38px;
  padding: 7px 4px;
  font-size: 12px;
  line-height: 1.1;
}

.tabs button.active,
.bottom-nav button.active {
  background: linear-gradient(180deg, #ffd15d, #e4a12b);
  color: #101010;
  font-weight: 850;
}

.task,
.history-card,
.submission,
.user-row,
.prize-row,
.log-row {
  display: grid;
  gap: 10px;
  background: rgba(16, 19, 25, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  transform: translateZ(0);
  transition:
    transform 170ms var(--ease-out),
    border-color 170ms ease,
    background-color 170ms ease,
    box-shadow 170ms ease,
    opacity 170ms ease;
}

.task.pending,
.task.done {
  opacity: 0.58;
  filter: saturate(0.72);
}

.task.done {
  background: rgba(16, 19, 25, 0.72);
}

.task-layout {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.task-art {
  width: 96px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: #080a0e;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.task-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.task-content {
  display: grid;
  gap: 10px;
}

.task-group {
  gap: 10px;
}

.task-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px;
}

.task-group-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.task-group-head span {
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
}

.task-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.task h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.18;
}

.task p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.36;
}

.task-title strong {
  min-width: 52px;
  color: #14110a;
  background: linear-gradient(180deg, #ffd15d, #d99a28);
  border: 1px solid rgba(245, 182, 66, 0.45);
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

.task-meta,
.task-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.task-actions button {
  flex: 1 1 132px;
}

.task-meta span,
.badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

.badge {
  color: var(--text);
}

.badge.good {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}

.badge.wait {
  background: rgba(255, 209, 102, 0.16);
  color: var(--yellow);
}

.badge.bad {
  background: rgba(255, 93, 108, 0.16);
  color: var(--danger);
}

.network-choice button {
  min-height: 112px;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  text-align: left;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(245, 182, 66, 0.12), transparent 52%),
    linear-gradient(180deg, var(--surface-2), #10141e);
}

.network-choice strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.network-choice span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.network-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.network-switch button {
  min-height: 38px;
  background: transparent;
  border-color: transparent;
}

.network-switch button.active {
  background: linear-gradient(180deg, #ffd15d, #e4a12b);
  color: #101010;
  font-weight: 850;
}

.wheel-hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.wheel-stage {
  display: grid;
  place-items: center;
}

.wheel-disc {
  position: relative;
  width: 136px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(from -15deg, var(--accent), var(--blue), var(--violet), var(--yellow), var(--accent));
  border: 8px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 12px rgba(8, 10, 15, 0.56), 0 18px 38px rgba(0, 0, 0, 0.38);
}

.wheel-disc::before {
  content: "";
  position: absolute;
  top: -12px;
  width: 22px;
  height: 24px;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  background: white;
}

.wheel-disc span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0b0e15;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

.wheel-copy {
  display: grid;
  gap: 9px;
}

.wheel-copy h2,
.wheel-copy p {
  margin: 0;
}

.case-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    #101319;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
}

.case-hero::before {
  display: none;
}

.case-hero > * {
  position: relative;
  z-index: 1;
}

.case-hero h2,
.case-hero p {
  margin: 0;
}

.case-window {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid rgba(245, 182, 66, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
    #080a0e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), inset 0 0 38px rgba(0, 0, 0, 0.45);
}

.case-window::before,
.case-window::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  width: 72px;
  pointer-events: none;
}

.case-window::before {
  left: 0;
  background: linear-gradient(90deg, #080a0e, transparent);
}

.case-window::after {
  right: 0;
  background: linear-gradient(270deg, #080a0e, transparent);
}

.case-marker {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, white 14%, var(--accent) 50%, white 86%, transparent);
  box-shadow: 0 0 22px rgba(245, 182, 66, 0.6);
}

.case-marker::before,
.case-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.case-marker::before {
  top: -9px;
}

.case-marker::after {
  bottom: -9px;
}

.case-reel {
  display: flex;
  gap: 10px;
  width: max-content;
  padding: 14px 0 14px 14px;
  transform: translate3d(var(--case-offset, 0px), 0, 0);
  will-change: transform;
}

.case-reel.spinning {
  transition: transform var(--case-duration, 6.2s) cubic-bezier(0.12, 0.92, 0.18, 1);
}

.case-reel.spinning .case-item {
  filter: blur(0.45px) saturate(0.92);
}

.case-item {
  flex: 0 0 112px;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 160px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  padding: 8px;
  text-align: center;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

.case-item.winner {
  border-color: rgba(245, 182, 66, 0.55);
  box-shadow: 0 0 0 1px rgba(245, 182, 66, 0.38), 0 16px 34px rgba(245, 182, 66, 0.18);
}

.case-item .prize-art {
  min-height: 86px;
}

.case-item strong {
  min-height: 32px;
  font-size: 12px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.case-item > span {
  color: var(--muted);
  font-size: 11px;
}

.case-result {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(245, 182, 66, 0.24);
  border-radius: var(--radius);
  background: rgba(245, 182, 66, 0.06);
  padding: 10px;
}

.case-result .prize-art {
  min-height: 92px;
}

.case-result span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.case-result strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.16;
}

.case-result p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.case-skip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  user-select: none;
}

.case-skip-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.case-open-button {
  width: 100%;
}

.inventory-panel {
  overflow: hidden;
  transform: translateZ(0);
}

.inventory-list {
  display: grid;
  gap: 10px;
}

.inventory-item {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  padding: 8px;
  overflow: hidden;
  contain: layout paint;
  transform: translateZ(0);
  animation: row-in 240ms var(--ease-soft) both;
  animation-delay: calc(var(--i, 0) * 28ms);
  transition:
    transform 180ms var(--ease-out),
    border-color 180ms ease,
    background-color 180ms ease,
    opacity 180ms ease;
}

.inventory-item.dimmed {
  opacity: 0.72;
}

.inventory-item.is-busy {
  pointer-events: none;
  border-color: rgba(245, 182, 66, 0.28);
}

.inventory-item.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(245, 182, 66, 0.12), transparent);
  transform: translateX(-120%);
  animation: shimmer 980ms linear infinite;
  pointer-events: none;
}

.inventory-item .prize-art {
  min-height: 64px;
  aspect-ratio: 1;
}

.inventory-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.inventory-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.inventory-item button {
  white-space: nowrap;
}

.prize-art,
.task-art {
  transform: translateZ(0);
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prize-card {
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 10px;
}

.prize-card strong {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.prize-card > span {
  color: var(--muted);
  font-size: 12px;
}

.prize-art {
  min-height: 88px;
  border-radius: var(--radius);
  display: block;
  background: #090b0f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.prize-art img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.history-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.history-card h3,
.history-card p {
  margin: 0;
}

.history-card h3 {
  font-size: 15px;
  line-height: 1.2;
}

.history-card p,
.history-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.history-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.history-icon.submission {
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.history-icon.bonus {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.history-icon.wheel {
  background: conic-gradient(var(--accent), var(--blue), var(--violet), var(--yellow), var(--accent));
  border-radius: 50%;
}

.history-card b {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
}

.history-card b.good {
  background: var(--success);
}

.history-card b.bad {
  background: var(--danger);
}

.sheet-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.54);
  padding: 12px;
}

.submission-sheet {
  width: min(100%, 500px);
  margin: 0 auto;
  display: grid;
  gap: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #10141e;
  padding: 14px;
  box-shadow: 0 -18px 58px rgba(0, 0, 0, 0.52);
  animation: sheet-in 220ms ease-out;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sheet-head,
.sheet-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sheet-head span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.sheet-head h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.15;
}

.requirements {
  margin: 0;
  border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent);
  padding: 8px 10px;
  background: rgba(245, 182, 66, 0.08);
  color: #f4dfb4;
  font-size: 13px;
  line-height: 1.36;
}

.field-label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.file-picker {
  display: grid;
  gap: 4px;
  min-height: 72px;
  justify-items: center;
  align-content: center;
  border: 1px dashed rgba(245, 182, 66, 0.46);
  border-radius: var(--radius);
  background: rgba(245, 182, 66, 0.07);
  padding: 12px;
  text-align: center;
  cursor: pointer;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker strong {
  color: white;
  font-size: 14px;
}

.file-picker span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.sheet-actions button {
  flex: 1 1 0;
}

.account-list,
.table-list {
  display: grid;
  gap: 8px;
}

.table-list > * {
  content-visibility: auto;
  contain-intrinsic-size: 96px;
  animation: row-in 180ms var(--ease-soft) both;
  transform: translateZ(0);
}

.table-list > *:nth-child(2) {
  animation-delay: 18ms;
}

.table-list > *:nth-child(3) {
  animation-delay: 36ms;
}

.table-list > *:nth-child(4) {
  animation-delay: 54ms;
}

.table-list > *:nth-child(5) {
  animation-delay: 72ms;
}

.table-list > *:nth-child(n + 14) {
  animation: none;
}

.account-row,
.status-grid div,
.account-list > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius);
  padding: 10px;
}

.account-row span:not(.status-dot),
.status-grid span,
.account-list span:not(.status-dot) {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.account-row strong,
.status-grid strong,
.account-list strong {
  display: block;
  margin-top: 3px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.admin-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.admin-content {
  position: relative;
  min-height: 160px;
  animation: surface-in 170ms var(--ease-soft) both;
}

.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 4px;
}

.admin-page-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
}

.admin-page-head span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.admin-content.is-loading {
  cursor: progress;
}

.admin-loading-card {
  min-height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
}

.admin-loading-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(9, 11, 15, 0.82);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  padding: 8px;
  pointer-events: none;
  animation: surface-in 160ms var(--ease-soft) both;
}

.loader-dot {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(245, 182, 66, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loader-spin 760ms linear infinite;
}

.admin-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  position: sticky;
  top: 14px;
}

.admin-nav button {
  justify-content: flex-start;
  text-align: left;
  min-height: 40px;
  padding-inline: 12px;
}

.admin-nav button.active {
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: white;
  font-weight: 850;
}

.notice {
  border-color: color-mix(in oklch, var(--blue) 42%, var(--line));
  background: color-mix(in oklch, var(--blue) 8%, var(--surface));
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.admin-toolbar button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
}

.admin-toolbar button.active {
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: white;
  font-weight: 850;
}

.admin-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.log-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.log-details span {
  display: inline-grid;
  gap: 2px;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  padding: 7px 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.log-details b {
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.admin-form .full {
  grid-column: 1 / -1;
}

.form-section {
  display: grid;
  gap: 4px;
}

.form-section h2 {
  margin: 0;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: 86px minmax(110px, 0.7fr) minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.bonus-issue-form {
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) auto auto;
}

.admin-inline-form input {
  min-height: 38px;
}

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover {
    transform: translateY(-1px);
    border-color: rgba(245, 182, 66, 0.34);
  }

  .inventory-item:hover,
  .task:hover,
  .history-card:hover,
  .user-row:hover,
  .prize-row:hover,
  .log-row:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 182, 66, 0.22);
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  }

  .admin-nav button:hover,
  .admin-toolbar button:hover {
    border-color: rgba(245, 182, 66, 0.32);
  }
}

.check-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  padding: 10px 12px;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.proof-preview {
  display: grid;
  gap: 8px;
}

.proof-preview img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #090c12;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 760px) {
  .admin-layout,
  .admin-form,
  .admin-inline-form,
  .admin-search {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }
}

@media (max-width: 460px) {
  .app-shell {
    padding-inline: 8px;
  }

  .grid-2,
  .metric-grid,
  .action-grid,
  .prize-grid {
    grid-template-columns: 1fr;
  }

  .wheel-hero {
    grid-template-columns: 1fr;
  }

  .wheel-disc {
    width: 150px;
  }

  .task-title {
    grid-template-columns: 1fr;
  }

  .inventory-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .inventory-item button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .task-layout {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
  }

  .task-art {
    width: 84px;
  }

  .task-title strong {
    justify-self: start;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-title {
    display: grid;
  }

  .loyalty {
    max-width: 100%;
    justify-self: start;
  }
}

/* Internal bonus wallet */
.wallet-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(12% 0.018 260);
  animation: wallet-in 200ms var(--ease-out) both;
}

.wallet-panel.compact {
  padding-block: 11px;
}

.wallet-balance {
  display: grid;
  gap: 3px;
}

.wallet-balance > span,
.wallet-balance > small,
.wallet-balance > em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.wallet-balance > strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.wallet-balance > strong small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.wallet-balance > em {
  color: var(--yellow);
}

.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.wallet-actions button {
  min-width: 94px;
}

.case-tier-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(126px, 1fr);
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
}

.case-tier-option {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(11% 0.016 260);
  scroll-snap-align: start;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.case-tier-option.active {
  border-color: color-mix(in oklch, var(--accent) 55%, var(--line));
  background: color-mix(in oklch, var(--accent) 7%, oklch(11% 0.016 260));
}

.case-tier-option .case-tier-select {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 62px;
  padding: 5px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.case-tier-option .case-tier-select img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.case-tier-option .case-tier-select span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.1;
  text-align: left;
}

.case-tier-option .case-tier-select strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1;
}

.case-tier-option .case-tier-buy {
  min-height: 32px;
  padding: 6px 7px;
  border-color: color-mix(in oklch, var(--accent) 28%, var(--line));
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  box-shadow: none;
}

.case-tier-option .case-tier-buy:disabled {
  color: var(--muted);
}

.wallet-sheet-backdrop {
  align-items: end;
  padding: 0;
}

.wallet-sheet {
  width: min(100%, 520px);
  max-height: min(82vh, 620px);
  overflow-y: auto;
  padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: oklch(11% 0.018 260);
  animation: wallet-sheet-in 220ms var(--ease-out) both;
}

.wallet-sheet h2,
.wallet-sheet p {
  margin: 0;
}

.wallet-sheet-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-block: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.wallet-sheet-balance strong {
  color: var(--text);
}

@keyframes wallet-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wallet-sheet-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 380px) {
  .wallet-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .wallet-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Notification preferences: one consent switch, then quiet inline choices. */
.notification-settings-head {
  align-items: flex-start;
}

.notification-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
}

.notification-form,
.notification-options {
  display: grid;
}

.notification-form {
  gap: 14px;
}

.notification-options {
  border-block: 1px solid var(--line);
}

.notification-master,
.notification-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 52px;
  cursor: pointer;
}

.notification-master > span,
.notification-option > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.notification-master strong,
.notification-option strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.notification-master small,
.notification-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.notification-option + .notification-option {
  border-top: 1px solid var(--line);
}

.notification-master input[type="checkbox"] {
  appearance: none;
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 24px;
  min-width: 44px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  cursor: pointer;
}

.notification-master input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 180ms var(--ease-out), background-color 180ms ease;
}

.notification-master input[type="checkbox"]:checked {
  border-color: color-mix(in oklch, var(--success) 62%, var(--line));
  background: color-mix(in oklch, var(--success) 30%, var(--surface));
}

.notification-master input[type="checkbox"]:checked::before {
  transform: translateX(20px);
  background: var(--success);
}

.notification-option input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--success);
  cursor: pointer;
}

.notification-policy {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .notification-master input[type="checkbox"]::before {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wallet-panel,
  .wallet-sheet,
  .case-tier-option {
    animation: none;
    transition-duration: 0ms;
  }
}

/* Impeccable mobile gamer redesign */
:root {
  color-scheme: dark;
  --bg: #05070a;
  --bg-2: #090d12;
  --surface: #0d1219;
  --surface-2: #121923;
  --surface-3: #1a2330;
  --text: #f5f7fb;
  --muted: #a8b0be;
  --line: #273241;
  --accent: oklch(82% 0.19 126);
  --accent-2: oklch(78% 0.12 204);
  --blue: oklch(75% 0.13 213);
  --violet: oklch(68% 0.16 300);
  --yellow: oklch(84% 0.15 84);
  --success: oklch(80% 0.18 142);
  --danger: oklch(70% 0.18 25);
  --vk: #4c8bf5;
  --shadow: 0 8px 14px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 6px 12px rgba(0, 0, 0, 0.22);
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 46px;
}

html {
  background: var(--bg);
}

html,
body {
  min-height: 100%;
}

body {
  background:
    linear-gradient(180deg, #0c1118 0%, #06080c 34%, #030508 100%),
    var(--bg);
  color: var(--text);
  text-rendering: optimizeLegibility;
}

.app-shell {
  width: min(100%, 500px);
  padding: 12px 10px 102px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  margin: -12px -10px 12px;
  padding: calc(10px + env(safe-area-inset-top)) 10px 10px;
  background: linear-gradient(180deg, rgba(5, 7, 10, 0.96), rgba(5, 7, 10, 0.78));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #05070a;
  border-color: color-mix(in oklch, var(--accent) 34%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 9%, transparent);
}

.brand h1 {
  font-size: 17px;
  font-weight: 900;
}

.brand span,
.muted {
  color: var(--muted);
}

button,
input,
select,
textarea {
  border-radius: var(--radius-sm);
}

button {
  min-height: var(--tap);
  border-color: rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, #202a37, #121923);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  font-weight: 760;
}

button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #04100b;
  box-shadow: 0 7px 12px color-mix(in oklch, var(--accent) 20%, transparent);
}

button.ghost {
  background: rgba(255, 255, 255, 0.055);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--accent) 72%, white);
  outline-offset: 2px;
}

input,
select,
textarea {
  background: #080d13;
  border-color: #293545;
}

input::placeholder,
textarea::placeholder {
  color: #8d97a7;
}

.panel,
.hero-panel,
.profile-card,
.wheel-hero,
.case-hero,
.task,
.history-card,
.submission,
.user-row,
.prize-row,
.log-row {
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel,
.hero-panel,
.profile-card,
.case-hero {
  padding: 14px;
}

.hero-panel,
.profile-card,
.case-hero {
  border-color: color-mix(in oklch, var(--accent-2) 20%, var(--line));
}

.hero-panel {
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--accent) 12%, transparent), transparent 48%),
    linear-gradient(180deg, #131b25, #0d1219);
}

.hero-panel h2 {
  font-size: 26px;
  font-weight: 950;
}

.eyebrow {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: color-mix(in oklch, var(--accent) 10%, transparent);
  color: color-mix(in oklch, var(--accent) 72%, white);
  text-transform: none;
  font-size: 11px;
  font-weight: 850;
}

.profile-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.avatar {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  border-color: color-mix(in oklch, var(--accent) 38%, transparent);
  background: linear-gradient(135deg, #202a36, #080d12);
  color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 8%, transparent);
}

.profile-title h2 {
  font-size: 18px;
  font-weight: 950;
}

.profile-meta span,
.verify-chip,
.task-meta span,
.badge,
.loyalty {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
}

.loyalty {
  color: var(--text);
}

.loyalty.gold {
  background: color-mix(in oklch, var(--yellow) 16%, transparent);
  color: color-mix(in oklch, var(--yellow) 78%, white);
}

.loyalty.black {
  background: #030508;
}

.verify-chip.ok {
  background: color-mix(in oklch, var(--success) 12%, transparent);
  color: color-mix(in oklch, var(--success) 80%, white);
}

.metric {
  min-height: 80px;
  border-radius: var(--radius-sm);
  background: #0a1017;
  border-color: rgba(255, 255, 255, 0.07);
}

.metric span {
  color: #9ca6b6;
}

.metric strong {
  color: var(--accent);
  font-size: 24px;
}

.bottom-nav {
  bottom: max(10px, env(safe-area-inset-bottom));
  width: min(calc(100% - 18px), 488px);
  padding: 6px;
  border-radius: 18px;
  background: rgba(6, 9, 13, 0.94);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 14px rgba(0, 0, 0, 0.44);
}

.bottom-nav button {
  min-height: 54px;
  display: grid;
  gap: 3px;
  place-items: center;
  padding: 6px 2px;
  border-radius: 14px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #8e98a8;
  font-size: 11px;
  font-weight: 780;
}

.bottom-nav button::before {
  content: "";
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: inherit;
  font-size: 15px;
  line-height: 1;
  background: currentColor;
  -webkit-mask: var(--nav-icon) center / 18px 18px no-repeat;
  mask: var(--nav-icon) center / 18px 18px no-repeat;
}

.bottom-nav button[data-nav-icon="home"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M4%2010.7%2012%204l8%206.7V20a1%201%200%200%201-1%201h-4v-6H9v6H5a1%201%200%200%201-1-1z%27%20fill%3D%27black%27/%3E%3C/svg%3E");
}

.bottom-nav button[data-nav-icon="quests"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M5%204h14a1%201%200%200%201%201%201v14a1%201%200%200%201-1%201H5a1%201%200%200%201-1-1V5a1%201%200%200%201%201-1zm3%207%202.2%202.2L16%207.4l1.7%201.7-7.5%207.5L6.3%2012.7z%27%20fill%3D%27black%27/%3E%3C/svg%3E");
}

.bottom-nav button[data-nav-icon="case"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M7%206h10l3%204v9a1%201%200%200%201-1%201H5a1%201%200%200%201-1-1v-9zm.7%202-1.5%202h11.6l-1.5-2zM8%2013h8v2H8z%27%20fill%3D%27black%27/%3E%3C/svg%3E");
}

.bottom-nav button[data-nav-icon="history"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M12%205a7%207%200%201%201-6.3%204H3l3.7-4L10%209H7.9A5%205%200%201%200%2012%207zm-1%204h2v4.1l3%201.8-1%201.7-4-2.4z%27%20fill%3D%27black%27/%3E%3C/svg%3E");
}

.bottom-nav button[data-nav-icon="profile"] {
  --nav-icon: url("data:image/svg+xml,%3Csvg%20viewBox%3D%270%200%2024%2024%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M12%2012a4%204%200%201%200%200-8%204%204%200%200%200%200%208zm0%202c-4.4%200-7%202.2-7%204.6V20h14v-1.4c0-2.4-2.6-4.6-7-4.6z%27%20fill%3D%27black%27/%3E%3C/svg%3E");
}

.bottom-nav button.active {
  background: color-mix(in oklch, var(--accent) 13%, transparent);
  color: color-mix(in oklch, var(--accent) 78%, white);
}

.bottom-nav button.active::before {
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #04100b;
}

.network-choice button {
  min-height: 118px;
  border-color: color-mix(in oklch, var(--accent-2) 24%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--accent) 12%, transparent), transparent 52%),
    linear-gradient(180deg, #151f2b, #0c121a);
}

.network-switch {
  background: #080d13;
  border-color: #273343;
  border-radius: 16px;
}

.network-switch button.active,
.tabs button.active,
.admin-toolbar button.active,
.admin-nav button.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #04100b;
}

.task {
  padding: 10px;
  border-radius: 16px;
}

.task-layout {
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 11px;
  align-items: stretch;
}

.task-art {
  width: 86px;
  border-radius: 13px;
  border-color: rgba(255, 255, 255, 0.08);
  background: #05080c;
}

.task h3 {
  font-size: 15px;
  font-weight: 900;
}

.task p {
  color: #a2acbc;
  font-size: 12.5px;
}

.task-title {
  gap: 8px;
}

.task-title strong {
  min-width: 48px;
  color: #06120c;
  background: linear-gradient(135deg, var(--accent), var(--yellow));
  border-color: transparent;
  box-shadow: 0 4px 9px color-mix(in oklch, var(--accent) 18%, transparent);
}

.task-meta span {
  color: color-mix(in oklch, var(--accent-2) 78%, white);
  background: color-mix(in oklch, var(--accent-2) 10%, transparent);
}

.task-actions {
  gap: 7px;
}

.task-actions button {
  min-height: 40px;
  flex-basis: 112px;
}

.task.pending,
.task.done {
  opacity: 0.62;
  filter: saturate(0.65);
}

.task-group-head {
  padding: 6px 2px 2px;
}

.task-group-head h3 {
  font-size: 18px;
  font-weight: 950;
}

.task-group-head span {
  background: color-mix(in oklch, var(--accent) 12%, transparent);
  color: var(--accent);
}

.case-hero {
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--violet) 10%, transparent), transparent 42%),
    linear-gradient(180deg, #121924, #080d13);
}

.case-window {
  min-height: 202px;
  border-color: color-mix(in oklch, var(--accent) 26%, var(--line));
  border-radius: 18px;
  background: linear-gradient(180deg, #05080c, #090f16);
}

.case-window::before {
  background: linear-gradient(90deg, #05080c, transparent);
}

.case-window::after {
  background: linear-gradient(270deg, #05080c, transparent);
}

.case-marker {
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent) 15%, white 50%, var(--accent) 85%, transparent);
  box-shadow: 0 0 16px color-mix(in oklch, var(--accent) 50%, transparent);
}

.case-marker::before,
.case-marker::after {
  background: var(--accent);
}

.case-item {
  border-radius: 16px;
  background: linear-gradient(180deg, #172232, #0d131c);
  box-shadow: var(--shadow-soft);
}

.case-item.winner {
  border-color: color-mix(in oklch, var(--accent) 68%, white);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent) 38%, transparent), 0 8px 14px color-mix(in oklch, var(--accent) 16%, transparent);
}

.case-result,
.requirements {
  border-radius: 14px;
  border-color: color-mix(in oklch, var(--accent) 24%, var(--line));
  background: color-mix(in oklch, var(--accent) 8%, #0d1219);
  color: #dce8d3;
}

.case-skip-toggle {
  min-height: 38px;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.045);
}

.inventory-item,
.prize-card {
  border-radius: 16px;
  background: #0a1017;
}

.inventory-item.is-busy {
  border-color: color-mix(in oklch, var(--accent) 32%, var(--line));
}

.inventory-item.is-busy::after {
  background: linear-gradient(90deg, transparent, color-mix(in oklch, var(--accent) 14%, transparent), transparent);
}

.prize-art,
.task-art {
  border-radius: 13px;
}

.history-card {
  border-radius: 16px;
}

.history-icon {
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
}

.history-card b {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.toast {
  top: max(10px, env(safe-area-inset-top));
  border-radius: 16px;
  background: rgba(10, 15, 22, 0.96);
  box-shadow: 0 10px 14px rgba(0, 0, 0, 0.42);
}

.toast strong {
  color: var(--accent);
}

.sheet-backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(8px);
}

.submission-sheet {
  border-radius: 22px 22px 16px 16px;
  background: #0b1118;
  box-shadow: 0 -10px 14px rgba(0, 0, 0, 0.42);
}

.file-picker {
  border-color: color-mix(in oklch, var(--accent) 34%, var(--line));
  background: color-mix(in oklch, var(--accent) 8%, transparent);
}

.notice {
  border-radius: 14px;
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0) scale(0.996);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(-50%, -10px, 0) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate3d(-50%, 0, 0) scale(1);
  }
}

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover {
    border-color: color-mix(in oklch, var(--accent) 30%, var(--line));
  }

  .inventory-item:hover,
  .task:hover,
  .history-card:hover,
  .user-row:hover,
  .prize-row:hover,
  .log-row:hover {
    border-color: color-mix(in oklch, var(--accent) 26%, var(--line));
    background-color: #111923;
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.3);
  }
}

@media (max-width: 460px) {
  .app-shell {
    padding-inline: 9px;
  }

  .grid-2,
  .metric-grid,
  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-title {
    display: flex;
  }

  .avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .task-layout {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 9px;
  }

  .task-art {
    width: 78px;
  }

  .task-title {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .task-title strong {
    justify-self: auto;
  }

  .task-actions button {
    flex-basis: 94px;
    font-size: 12px;
  }

  .bottom-nav span {
    font-size: 10px;
  }
}

/* Unified motion system: quick feedback, deliberate state changes, no decorative delay. */
:root {
  --motion-instant: 120ms;
  --motion-fast: 160ms;
  --motion-base: 220ms;
  --motion-expand: 340ms;
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
}

.app-view {
  min-width: 0;
  transform-origin: 50% 0;
}

button,
input,
select,
textarea,
.file-picker,
.check-row,
.network-switch,
.tabs,
.profile-disclosure summary,
.profile-disclosure-side i,
.verify-chip,
.badge,
.loyalty,
.task,
.history-card,
.inventory-item,
.prize-card,
.user-row,
.submission,
.prize-row,
.log-row {
  transition-duration: var(--motion-fast);
  transition-timing-function: var(--ease-out-quart);
}

button {
  transition-property: transform, border-color, background-color, color, opacity;
}

button:not(:disabled):active {
  transform: translate3d(0, 1px, 0) scale(0.975);
  transition-duration: var(--motion-instant);
}

input,
select,
textarea,
.file-picker,
.check-row {
  transition-property: border-color, background-color, box-shadow, color, opacity, transform;
}

.bottom-nav button,
.bottom-nav button::before,
.bottom-nav button span {
  transition:
    transform var(--motion-base) var(--ease-out-quint),
    background-color var(--motion-base) var(--ease-out-quart),
    border-color var(--motion-base) var(--ease-out-quart),
    color var(--motion-fast) var(--ease-out-quart),
    opacity var(--motion-fast) var(--ease-out-quart);
}

.bottom-nav button.active::before {
  transform: translate3d(0, -1px, 0) scale(1.06);
}

.bottom-nav button:active::before {
  transform: scale(0.9);
}

.profile-disclosure {
  contain: paint;
}

.profile-disclosure[data-motion] {
  pointer-events: none;
}

.profile-disclosure summary:active .profile-disclosure-side i {
  transform: scale(0.92);
}

.profile-disclosure-body,
.notification-options,
.profile-inline-settings,
.profile-link-actions {
  transform-origin: 50% 0;
}

.notification-master input[type="checkbox"],
.notification-master input[type="checkbox"]::before,
.case-skip-toggle input,
.case-skip-toggle input::before {
  transition:
    transform var(--motion-base) var(--ease-out-quint),
    border-color var(--motion-base) var(--ease-out-quart),
    background-color var(--motion-base) var(--ease-out-quart),
    color var(--motion-fast) var(--ease-out-quart);
}

.notification-option input[type="checkbox"] {
  transition:
    transform var(--motion-instant) var(--ease-out-quart),
    opacity var(--motion-fast) var(--ease-out-quart);
}

.notification-option input[type="checkbox"]:active {
  transform: scale(0.84);
}

.sheet-backdrop {
  animation: backdrop-in var(--motion-base) var(--ease-out-quart) both;
}

.submission-sheet,
.wallet-sheet {
  animation-duration: 280ms;
  animation-timing-function: var(--ease-out-quint);
}

.toast {
  animation-duration: var(--motion-base);
  animation-timing-function: var(--ease-out-quint);
}

.avatar img,
.task-art img,
.prize-art img,
.history-icon img,
.inventory-item img,
.prize-card img {
  transition:
    transform var(--motion-base) var(--ease-out-quint),
    filter var(--motion-base) var(--ease-out-quart),
    opacity var(--motion-fast) var(--ease-out-quart);
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover {
    transform: translate3d(0, -1px, 0);
  }

  button:not(:disabled):active {
    transform: translate3d(0, 1px, 0) scale(0.975);
  }

  .profile-disclosure summary:hover .profile-disclosure-side i {
    color: var(--text);
    background: color-mix(in oklch, var(--accent) 12%, var(--surface-2));
  }

  .task:hover .task-art img,
  .history-card:hover .history-icon img,
  .inventory-item:hover img,
  .prize-card:hover img {
    transform: scale(1.025);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}

/* Retention analytics: one report surface with clear internal hierarchy. */
.analytics-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: oklch(10% 0.014 260);
}

.analytics-controls > div:first-child {
  display: grid;
  gap: 3px;
}

.analytics-controls strong,
.analytics-section h3 {
  color: white;
  font-weight: 880;
}

.analytics-controls span,
.analytics-section p,
.analytics-section small {
  color: var(--muted);
}

.analytics-controls > div:first-child span {
  font-size: 12px;
}

.analytics-filters {
  display: flex;
  align-items: end;
  gap: 8px;
}

.analytics-filters label {
  display: grid;
  gap: 4px;
  min-width: 132px;
}

.analytics-filters label > span {
  font-size: 11px;
  font-weight: 750;
}

.analytics-filters select {
  min-height: 40px;
  padding-block: 7px;
}

.analytics-report {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: oklch(9% 0.012 260);
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: oklch(12% 0.018 260);
}

.analytics-summary > div {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 112px;
  padding: 16px;
}

.analytics-summary > div + div {
  border-left: 1px solid var(--line);
}

.analytics-summary span,
.analytics-summary small {
  color: var(--muted);
  font-size: 12px;
}

.analytics-summary strong {
  color: white;
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
}

.analytics-section {
  border-top: 1px solid var(--line);
  padding: 18px;
}

.analytics-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
}

.analytics-section header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.analytics-section h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
  text-wrap: balance;
}

.analytics-section header p {
  max-width: 62ch;
  margin: 4px 0 0;
  font-size: 12px;
  text-wrap: pretty;
}

.analytics-section header > b {
  flex: 0 0 auto;
  color: oklch(82% 0.09 248);
  font-size: 14px;
}

.analytics-funnel-list,
.analytics-ranking-list,
.analytics-message-types {
  display: grid;
  gap: 11px;
}

.analytics-funnel-row,
.analytics-ranking-row {
  display: grid;
  gap: 6px;
}

.analytics-funnel-row > div,
.analytics-ranking-row > div,
.analytics-message-types > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.analytics-funnel-row span,
.analytics-ranking-row span,
.analytics-message-types span {
  min-width: 0;
  color: var(--text);
}

.analytics-funnel-row b,
.analytics-ranking-row b,
.analytics-message-types b {
  flex: 0 0 auto;
  color: white;
  font-size: 12px;
}

.analytics-track {
  overflow: hidden;
  display: block;
  height: 6px;
  border-radius: 999px;
  background: oklch(16% 0.018 260);
}

.analytics-track > i {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.analytics-retention {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.analytics-retention-metric,
.analytics-returning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.analytics-retention-metric > div {
  display: grid;
  gap: 2px;
}

.analytics-retention-metric strong,
.analytics-returning span {
  color: var(--text);
  font-size: 13px;
}

.analytics-retention-metric span {
  color: var(--muted);
  font-size: 11px;
}

.analytics-retention-metric > b,
.analytics-returning strong {
  color: oklch(82% 0.09 248);
  font-size: 22px;
  font-weight: 900;
}

.analytics-note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.45;
}

.analytics-section-head {
  align-items: end !important;
}

.analytics-legend {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analytics-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
}

.analytics-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.analytics-legend .is-active,
.analytics-bar .is-active {
  background: var(--accent);
}

.analytics-legend .is-task,
.analytics-bar .is-task {
  background: var(--accent-2);
}

.analytics-bars {
  display: grid;
  grid-template-columns: repeat(var(--analytics-columns), minmax(1px, 1fr));
  align-items: end;
  gap: 2px;
  height: 154px;
  padding-top: 8px;
  border-bottom: 1px solid var(--line-strong);
  background:
    linear-gradient(to bottom, transparent 32%, color-mix(in oklch, var(--line) 55%, transparent) 33%, transparent 34%),
    linear-gradient(to bottom, transparent 65%, color-mix(in oklch, var(--line) 55%, transparent) 66%, transparent 67%);
}

.analytics-bar {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 1px;
  height: 100%;
}

.analytics-bar i {
  width: min(46%, 8px);
  min-height: 1px;
  border-radius: 2px 2px 0 0;
}

.analytics-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.analytics-engagement {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0;
  background: oklch(11% 0.016 260);
}

.analytics-engagement > div {
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 14px;
}

.analytics-engagement > div + div {
  border-left: 1px solid var(--line);
}

.analytics-engagement span {
  color: var(--muted);
  font-size: 11px;
}

.analytics-engagement b {
  color: white;
  font-size: 20px;
}

.analytics-ranking-row small {
  font-size: 10.5px;
}

.analytics-messages {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.analytics-message-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 15px;
  border-block: 1px solid var(--line);
}

.analytics-message-summary > div {
  display: grid;
  gap: 4px;
  padding: 10px 8px;
}

.analytics-message-summary > div + div {
  border-left: 1px solid var(--line);
}

.analytics-message-summary span {
  color: var(--muted);
  font-size: 10.5px;
}

.analytics-message-summary b {
  color: white;
  font-size: 17px;
}

.analytics-message-types > div {
  padding-bottom: 7px;
  border-bottom: 1px solid color-mix(in oklch, var(--line) 65%, transparent);
}

.analytics-empty {
  margin: 0;
  padding: 14px 0;
  color: var(--muted);
}

.analytics-club-table {
  display: grid;
}

.analytics-club-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(88px, 0.32fr));
  align-items: center;
  min-height: 48px;
  border-top: 1px solid var(--line);
}

.analytics-club-row.is-head {
  min-height: 34px;
  border-top: 0;
  color: var(--muted);
  font-size: 11px;
}

.analytics-club-row strong {
  color: white;
}

.analytics-club-row > span:not(:first-child) {
  text-align: right;
}

@media (max-width: 900px) {
  .analytics-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-summary > div:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .analytics-summary > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .analytics-split {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .analytics-retention,
  .analytics-messages {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 20px;
    padding-left: 0;
  }
}

@media (max-width: 620px) {
  .analytics-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-filters,
  .analytics-filters label {
    width: 100%;
  }

  .analytics-summary > div {
    min-height: 96px;
    padding: 13px;
  }

  .analytics-summary strong {
    font-size: 23px;
  }

  .analytics-section {
    padding: 14px;
  }

  .analytics-bars {
    gap: 1px;
    height: 126px;
  }

  .analytics-engagement {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
  }

  .analytics-engagement > div {
    min-height: 72px;
  }

  .analytics-engagement > div:nth-child(odd) {
    border-left: 0;
  }

  .analytics-engagement > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .analytics-engagement > div:last-child {
    grid-column: 1 / -1;
  }

  .analytics-section-head {
    align-items: start !important;
    flex-direction: column;
  }

  .analytics-club-row.is-head {
    display: none;
  }

  .analytics-club-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 0;
  }

  .analytics-club-row strong {
    grid-column: 1 / -1;
  }

  .analytics-club-row > span:not(:first-child) {
    display: grid;
    gap: 2px;
    text-align: left;
  }

  .analytics-club-row > span::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .analytics-track > i,
  .analytics-bar i {
    transition: none;
  }
}

/* Persistent player progression; XP is separate from the spendable wallet. */
.player-progress-card {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--accent) 12%, transparent), transparent 54%),
    oklch(11% 0.022 260);
}

.player-progress-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.player-level-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in oklch, var(--accent) 62%, var(--line));
  border-radius: 9px;
  background: color-mix(in oklch, var(--accent) 18%, var(--surface));
  color: oklch(88% 0.06 248);
  font-size: 11px;
  font-weight: 900;
}

.player-progress-head > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.player-progress-head span,
.player-progress-copy span,
.player-progress-action span {
  color: var(--muted);
  font-size: 11px;
}

.player-progress-head h3 {
  margin: 0;
  color: white;
  font-size: 17px;
  line-height: 1.1;
  text-wrap: balance;
}

.player-progress-head > strong {
  color: white;
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
}

.player-progress-copy,
.player-progress-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.player-progress-copy b {
  color: oklch(84% 0.075 248);
  font-size: 11px;
  white-space: nowrap;
}

.player-xp-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: oklch(17% 0.02 260);
}

.player-xp-track > i {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.player-progress-action {
  padding-top: 2px;
}

.player-progress-action button {
  min-height: 36px;
}

.player-progress-card.is-full {
  padding: 15px;
  background: oklch(11% 0.018 260);
}

.player-level-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.player-level-step {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 12px 5px;
  color: var(--muted);
  text-align: center;
}

.player-level-step + .player-level-step {
  border-left: 1px solid var(--line);
}

.player-level-step > i {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: oklch(10% 0.014 260);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.player-level-step > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.player-level-step strong {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.player-level-step small {
  color: oklch(62% 0.018 260);
  font-size: 9.5px;
  line-height: 1.2;
}

.player-level-step.is-unlocked > i {
  border-color: color-mix(in oklch, var(--success) 56%, var(--line));
  background: color-mix(in oklch, var(--success) 18%, var(--surface));
  color: oklch(86% 0.08 145);
}

.player-level-step.is-unlocked strong {
  color: var(--text);
}

.player-level-step.is-current {
  background: color-mix(in oklch, var(--accent) 9%, transparent);
}

.player-level-step.is-current > i {
  border-color: color-mix(in oklch, var(--accent) 70%, white);
  color: white;
}

.player-xp-rules {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
  text-wrap: pretty;
}

.achievements-panel {
  gap: 12px;
}

.achievement-count {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: oklch(10% 0.014 260);
  color: white;
  font-size: 12px;
  font-weight: 850;
}

.achievement-list {
  display: grid;
}

.achievement-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border-top: 1px solid var(--line);
}

.achievement-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: oklch(10% 0.014 260);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.achievement-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.achievement-row strong {
  color: var(--text);
  font-size: 13px;
}

.achievement-row small {
  color: var(--muted);
  font-size: 10.5px;
}

.achievement-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.achievement-row.is-unlocked .achievement-mark {
  border-color: color-mix(in oklch, var(--success) 54%, var(--line));
  background: color-mix(in oklch, var(--success) 16%, var(--surface));
  color: oklch(86% 0.08 145);
}

.achievement-row.is-unlocked .achievement-state {
  color: oklch(82% 0.08 145);
}

@media (max-width: 420px) {
  .player-progress-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .player-progress-head > strong {
    grid-column: 2;
    font-size: 14px;
  }

  .player-level-step {
    padding-inline: 3px;
  }

  .player-level-step small {
    font-size: 8.5px;
  }

  .achievement-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .player-xp-track > i {
    transition: none;
  }
}

/* Live club status and time-limited mission */
.live-dot.is-closed {
  background: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--danger) 12%, transparent);
}

.club-live-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
  border-block: 1px solid rgba(255, 255, 255, 0.1);
}

.club-live-details > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.club-live-details span {
  color: #b5c0d0;
  font-size: 11px;
}

.club-live-details strong {
  overflow-wrap: anywhere;
  color: white;
  font-size: 12px;
}

.club-live-details a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
  text-decoration: none;
}

.hot-mission-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hot-mission-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.hot-mission-copy > span {
  color: #ffd36d;
  font-size: 11px;
  font-weight: 800;
}

.hot-mission-copy > strong {
  color: white;
  font-size: 16px;
  text-wrap: balance;
}

.hot-mission-copy > p {
  max-width: 62ch;
  color: #bdc6d4;
  line-height: 1.4;
  text-wrap: pretty;
}

.hot-mission-action {
  display: grid;
  justify-items: end;
  gap: 7px;
  flex: 0 0 auto;
}

.hot-mission-action b {
  color: #ffd36d;
  font-size: 12px;
}

.hot-mission-action button {
  min-height: 38px;
  padding-inline: 13px;
}

.live-club-admin {
  align-items: start;
}

.live-club-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 4px;
}

.live-club-admin-head > div {
  display: grid;
  gap: 5px;
}

.live-club-admin-head h2,
.live-club-admin-head p {
  margin: 0;
}

.form-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.form-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.live-club-mission-editor {
  display: grid;
  gap: 12px;
  margin-top: 5px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.live-club-mission-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: 12px;
}

.live-club-mission-toggle > span {
  display: grid;
  gap: 3px;
}

.live-club-mission-toggle small {
  color: var(--muted);
  font-size: 11px;
}

.live-club-mission-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.live-club-mission-fields .full {
  grid-column: 1 / -1;
}

.live-club-mission-fields textarea {
  min-height: 96px;
  resize: vertical;
}

.live-club-notification-note {
  max-width: 76ch;
  margin: 0;
  color: oklch(78% 0.05 238);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 620px) {
  .hot-mission-row {
    align-items: stretch;
    flex-direction: column;
  }

  .hot-mission-action {
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .live-club-mission-fields {
    grid-template-columns: 1fr;
  }

  .live-club-mission-fields .full {
    grid-column: auto;
  }
}

@media (max-width: 390px) {
  .club-live-details,
  .live-club-admin-head {
    align-items: stretch;
    flex-direction: column;
  }

  .club-live-details a {
    width: 100%;
  }
}

/* Admin · automatic message control center */
.auto-message-control {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: var(--line-strong);
  background: linear-gradient(145deg, oklch(15% 0.03 258), oklch(10% 0.015 260) 58%);
}

.auto-message-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 18px;
}

.auto-message-title {
  display: grid;
  gap: 7px;
  max-width: 680px;
}

.auto-message-kicker {
  color: oklch(76% 0.14 248);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auto-message-title h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: white;
  font-size: 24px;
}

.auto-message-title p,
.auto-message-hint {
  margin: 0;
}

.auto-message-state {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 5px color-mix(in oklch, var(--muted) 12%, transparent);
}

.auto-message-state.is-live {
  background: var(--success);
  box-shadow: 0 0 0 5px color-mix(in oklch, var(--success) 14%, transparent);
}

.auto-message-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.auto-message-actions button {
  min-height: 40px;
  padding-inline: 13px;
}

.auto-message-policy {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  padding: 10px 18px;
  border-block: 1px solid var(--line);
  background: oklch(9% 0.014 260 / 0.58);
  color: var(--muted);
  font-size: 12px;
}

.auto-message-policy span::before {
  content: "•";
  margin-right: 7px;
  color: var(--accent-2);
}

.auto-message-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.auto-message-metrics > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.auto-message-metrics > div:last-child {
  border-right: 0;
}

.auto-message-metrics strong {
  color: white;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.auto-message-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.auto-message-metrics .has-errors strong {
  color: oklch(78% 0.13 25);
}

.auto-message-channel-line {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.auto-message-channel-line strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.auto-message-hint {
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--accent-2) 8%, transparent);
  color: oklch(80% 0.05 238);
  font-size: 12px;
}

.auto-message-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 11px;
}

.auto-message-history-head > div {
  display: grid;
  gap: 3px;
}

.auto-message-history-head h3 {
  margin: 0;
  color: white;
  font-size: 16px;
}

.auto-message-history-head .ghost {
  min-height: 34px;
  padding: 6px 10px;
}

.auto-queue-list {
  border-top: 1px solid var(--line);
}

.auto-queue-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(320px, auto);
  gap: 20px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.auto-queue-row:last-child {
  border-bottom: 0;
}

.auto-queue-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.auto-queue-main strong {
  overflow: hidden;
  color: white;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-queue-main span,
.auto-queue-meta > span:not(.badge),
.auto-queue-meta time {
  color: var(--muted);
  font-size: 12px;
}

.auto-queue-meta {
  display: grid;
  grid-template-columns: auto minmax(90px, auto) minmax(126px, auto);
  align-items: center;
  justify-content: end;
  gap: 12px;
  text-align: right;
}

.auto-queue-meta .badge {
  justify-self: end;
}

.auto-queue-empty {
  display: grid;
  gap: 3px;
  padding: 20px 18px;
  color: white;
}

.manual-notification-history {
  margin-top: 2px;
}

.manual-notification-history > .auto-message-history-head {
  padding-inline: 2px;
}

@media (max-width: 900px) {
  .auto-message-head {
    align-items: stretch;
    flex-direction: column;
  }

  .auto-message-actions {
    flex-wrap: wrap;
  }

  .auto-queue-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .auto-queue-meta {
    justify-content: start;
    text-align: left;
  }

  .auto-queue-meta .badge {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .auto-message-head {
    gap: 16px;
    padding: 15px;
  }

  .auto-message-actions button {
    flex: 1 1 150px;
  }

  .auto-message-policy {
    padding-inline: 15px;
  }

  .auto-message-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auto-message-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .auto-message-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .auto-message-metrics > div {
    padding: 13px 15px;
  }

  .auto-message-channel-line {
    flex-wrap: wrap;
    gap: 7px 13px;
    padding-inline: 15px;
  }

  .auto-message-channel-line span {
    flex-basis: 100%;
  }

  .auto-message-history-head {
    padding-inline: 15px;
  }

  .auto-queue-row {
    padding-inline: 15px;
  }

  .auto-queue-meta {
    grid-template-columns: auto 1fr;
    gap: 7px 10px;
  }

  .auto-queue-meta time {
    grid-column: 1 / -1;
  }
}

/* Home surfaces share one visual system; color is reserved for status and rewards. */
.home-view {
  gap: 12px;
}

.home-view > .profile-card,
.home-view > .wallet-panel,
.home-view > .activation-card,
.home-view > .live-club-card,
.home-view > .daily-checkin-card,
.home-view > .weekly-leaderboard-card,
.home-view > .referral-card {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.home-view > .profile-card::after,
.home-view > .live-club-card::after {
  display: none;
}

.home-view > .wallet-panel {
  min-height: 76px;
  animation: none;
}

.home-view > .wallet-panel .wallet-balance > strong {
  font-size: 26px;
}

/* Home focus: one next action, compact status rows, no competing progress bars. */
.home-next-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.home-next-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.home-next-copy > span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.home-next-copy > strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
  text-wrap: balance;
}

.home-next-copy > small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-wrap: pretty;
}

.home-next-action > button {
  min-width: 108px;
  min-height: 40px;
}

.player-progress-compact {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.player-progress-compact .player-level-mark {
  width: 38px;
  height: 38px;
}

.player-progress-compact-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.player-progress-compact-copy small {
  color: var(--muted);
  font-size: 10px;
}

.player-progress-compact-copy strong,
.player-progress-compact > b {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-progress-link {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.daily-checkin-card.is-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 11px 12px;
  background: var(--surface);
}

.checkin-compact-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 2px 8px;
  min-width: 0;
}

.checkin-compact-copy span {
  color: var(--muted);
  font-size: 11px;
}

.checkin-compact-copy strong {
  color: var(--text);
  font-size: 15px;
}

.checkin-compact-copy small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-checkin-card.is-compact .checkin-next {
  max-width: 102px;
  white-space: nowrap;
}

.daily-checkin-card.is-compact .checkin-claim {
  width: auto;
  min-height: 36px;
  white-space: nowrap;
}

.checkin-lock-label {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .home-next-action {
    grid-template-columns: 1fr;
  }

  .home-next-action > button {
    width: 100%;
  }

  .player-progress-compact {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .player-progress-link {
    display: none;
  }

  .daily-checkin-card.is-compact {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .checkin-compact-copy {
    grid-column: 1 / -1;
  }
}

@media (max-width: 380px) {
  .home-view > .wallet-panel {
    align-items: center;
    flex-direction: row;
  }

  .home-view > .wallet-panel .wallet-actions {
    display: flex;
  }
}

/* Keep the welcome treatment above the shared late-theme surface rules. */
.panel.welcome-panel {
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(40, 69, 111, 0.34), transparent 58%),
    #10141c;
}

body.mini .app-shell {
  width: 100%;
  max-width: 500px;
}

body.mini .app-shell > * {
  max-width: 100%;
}

.optional-label {
  color: color-mix(in oklch, var(--muted) 82%, white);
  font-weight: 500;
}

.file-picker {
  position: relative;
  transition: border-color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.file-picker [hidden] {
  display: none;
}

.file-picker-empty {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.file-picker.selected {
  border-style: solid;
  border-color: color-mix(in oklch, var(--success) 70%, var(--line));
  background: color-mix(in oklch, var(--success) 10%, oklch(11% 0.02 260));
}

.proof-file-feedback {
  width: 100%;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
}

.proof-file-thumb {
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 8px;
  background: oklch(8% 0.012 260);
}

.proof-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proof-file-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.proof-file-copy strong {
  color: var(--success);
}

.proof-file-copy span,
.proof-file-copy small {
  overflow-wrap: anywhere;
}

.proof-file-copy small {
  color: color-mix(in oklch, var(--success) 58%, white);
  font-size: 11px;
  line-height: 1.3;
}

/* Fixed-size generated case art */
.prize-art {
  min-height: 0;
  display: grid;
  place-items: center;
  background: #050912;
}

.prize-art img,
.history-icon img,
.case-tier-tabs button img {
  object-fit: contain;
}

.case-item .prize-art.reel {
  width: 100%;
  height: 78px;
  min-height: 0;
  border-radius: 8px;
}

.case-item .prize-art.reel img {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.inventory-item {
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px;
}

.inventory-item .prize-art.thumb {
  width: 88px;
  height: 88px;
  min-height: 0;
  aspect-ratio: 1;
  border-radius: 9px;
}

.inventory-item .prize-art.thumb img {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.inventory-item strong {
  font-size: 13px;
  line-height: 1.18;
}

.inventory-item span {
  font-size: 11px;
}

.case-result .prize-art.thumb {
  width: 64px;
  height: 64px;
  min-height: 0;
  flex: 0 0 64px;
}

.case-result .prize-art.thumb img {
  min-height: 0;
}

.prize-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.prize-card {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

.prize-card .prize-art.card {
  width: 100%;
  min-height: 0;
  aspect-ratio: 144 / 166;
  border-radius: 8px;
}

.prize-card .prize-art.card img {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.history-icon {
  width: 44px;
  height: 44px;
  border-radius: 9px;
}

.history-icon img {
  width: 100%;
  height: 100%;
  padding: 0;
  min-height: 0;
}

.case-tier-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.case-tier-tabs button {
  min-height: 66px;
  padding: 7px;
  grid-template-columns: minmax(46px, 58px) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: start;
  column-gap: 7px;
  row-gap: 0;
}

.case-tier-tabs button img {
  grid-row: 1 / 3;
  width: 100%;
  max-width: 58px;
  height: 42px;
  min-width: 0;
  border: 0;
  border-radius: 7px;
  background: #050912;
}

.case-tier-tabs button span,
.case-tier-tabs button strong {
  justify-self: start;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-tier-tabs button span {
  align-self: end;
  color: #aeb8c9;
  font-size: 9px;
  line-height: 1;
  text-transform: uppercase;
}

.case-tier-tabs button strong {
  align-self: start;
  color: #f7fbff;
  font-size: 18px;
  line-height: 1.05;
}

.case-tier-tabs button.active img {
  transform: none;
  filter: saturate(1.04) contrast(1.04);
  animation: none;
}

@media (max-width: 460px) {
  .prize-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-item {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .inventory-item button {
    grid-column: 1 / -1;
  }

  .case-tier-tabs button {
    min-height: 66px;
    grid-template-columns: minmax(42px, 54px) minmax(0, 1fr);
  }

  .case-tier-tabs button img {
    height: 40px;
  }
}

@media (max-width: 340px) {
  .prize-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Admin/user-table + case switch hotfix */
.admin-content.stack {
  align-content: start;
  min-height: 0;
}

.admin-content > .admin-page-head {
  padding: 0 0 14px;
  margin: 0;
}

.admin-content > .admin-status-tabs {
  min-height: 0;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  align-self: start;
  gap: 4px;
  padding: 4px;
  border-radius: 9px;
  background: #070b13;
  border-color: #1e2c43;
}

.admin-content > .admin-status-tabs button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1;
  color: #aab4c5;
  background: transparent;
}

.admin-content > .admin-status-tabs button.active {
  background: #243d68;
  border-color: #5477b0;
  color: #fff;
  font-weight: 720;
}

.admin-user-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.admin-user-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-user-head strong {
  font-size: 15px;
  line-height: 1.15;
}

.admin-user-head span:not(.badge) {
  color: #9da8ba;
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.admin-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 7px;
}

.admin-fact {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid #1d2a3f;
  border-radius: 8px;
  background: #070b13;
}

.admin-fact small {
  color: #7f8a9e;
  font-size: 10px;
  line-height: 1;
}

.admin-fact b {
  min-width: 0;
  color: #edf3ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.admin-fact.case {
  border-color: #304a74;
  background: #0b1322;
}

.admin-fact.tier {
  border-color: #31405e;
  background: #090f1a;
}

.admin-user-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-user-actions > button {
  min-height: 38px;
  padding-inline: 14px;
  white-space: nowrap;
}

.admin-spin-panel {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #1d2a3f;
  border-radius: 8px;
  background: #070b13;
}

.admin-spin-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.admin-spin-title strong {
  font-size: 13px;
}

.admin-spin-title span {
  color: #7f8a9e;
  font-size: 11px;
}

.admin-spin-controls {
  display: grid;
  grid-template-columns: 74px minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(170px, 1.2fr) auto;
  gap: 7px;
  align-items: end;
}

.admin-spin-controls label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-spin-controls label span {
  color: #7f8a9e;
  font-size: 10px;
  line-height: 1;
}

.admin-spin-controls input,
.admin-spin-controls select {
  width: 100%;
  min-height: 36px;
  padding-block: 7px;
  font-size: 13px;
}

.admin-spin-controls button {
  min-height: 36px;
  padding-inline: 14px;
  white-space: nowrap;
}

.case-skip-toggle {
  width: fit-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px 4px 5px;
  border-radius: 999px;
  background: #060a12;
  border-color: #22344f;
}

.case-skip-toggle input[type="checkbox"] {
  appearance: none;
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 20px;
  min-width: 34px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid #344763;
  border-radius: 999px;
  background: #111a29;
  cursor: pointer;
}

.case-skip-toggle input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8995a8;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}

.case-skip-toggle input[type="checkbox"]:checked {
  background: #294877;
  border-color: #6288c7;
}

.case-skip-toggle input[type="checkbox"]:checked::before {
  transform: translateX(14px);
  background: #fff;
}

.case-skip-toggle span {
  color: #c2cad8;
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 980px) {
  .admin-user-actions {
    grid-template-columns: 1fr;
  }

  .admin-user-actions > button {
    width: fit-content;
  }

  .admin-spin-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-spin-controls .reason,
  .admin-spin-controls button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .admin-facts,
  .admin-spin-controls {
    grid-template-columns: 1fr;
  }
}

/* Prize art, avatars, history and admin action refinement */
.admin-user-actions {
  grid-template-columns: 1fr;
}

.admin-spin-controls {
  grid-template-columns: 74px minmax(110px, 0.75fr) minmax(110px, 0.75fr) minmax(170px, 1.2fr) auto auto;
}

.admin-spin-controls button.danger {
  background: #8f315f;
  border-color: #b85082;
}

.history-icon {
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 10px;
  background: #070b13;
}

.history-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.history-icon.wheel {
  border-radius: 10px;
}

.avatar-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: stretch;
}

.avatar-picker {
  min-height: 44px;
}

.case-tier-tabs {
  gap: 9px;
}

.case-tier-tabs button {
  min-height: 104px;
  padding: 7px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  justify-items: stretch;
  gap: 4px;
  overflow: hidden;
}

.case-tier-tabs button img {
  width: 100%;
  min-width: 0;
  height: 58px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 190ms var(--ease-out), filter 190ms ease;
}

.case-tier-tabs button span,
.case-tier-tabs button strong {
  justify-self: center;
}

.case-tier-tabs button.active {
  transform: translateY(-1px);
}

.case-tier-tabs button.active img {
  transform: scale(1.045);
  filter: saturate(1.08) contrast(1.04);
  animation: case-selected-pulse 1800ms ease-in-out infinite;
}

.prize-art img,
.task-art img {
  object-fit: cover;
}

@keyframes case-selected-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(90, 124, 193, 0);
  }
  50% {
    box-shadow: 0 0 18px rgba(90, 124, 193, 0.24);
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-tier-tabs button.active img {
    animation: none;
  }
}

@media (max-width: 980px) {
  .admin-spin-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-spin-controls .reason {
    grid-column: 1 / -1;
  }

  .admin-spin-controls button {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .avatar-form,
  .case-tier-tabs {
    grid-template-columns: 1fr;
  }

  .admin-spin-controls {
    grid-template-columns: 1fr;
  }

  .case-tier-tabs button {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    align-items: center;
    min-height: 72px;
  }

  .case-tier-tabs button img {
    height: 54px;
  }
}

/* 1Shot-inspired graphite/navy refinement */
:root {
  --bg: #03050a;
  --bg-2: #070a12;
  --surface: #0b101a;
  --surface-2: #101725;
  --surface-3: #151e30;
  --text: #f5f7fb;
  --muted: #9da8ba;
  --faint: #657083;
  --line: #1d2a3f;
  --line-strong: #2c4162;
  --accent: #486fb9;
  --accent-2: #6d88c8;
  --blue: #486fb9;
  --success: #4cc18a;
  --danger: #ef6170;
  --radius: 9px;
  --radius-sm: 7px;
  --tap: 44px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  background:
    radial-gradient(circle at 50% -12%, rgba(57, 82, 132, 0.22), transparent 34%),
    linear-gradient(180deg, #070a12 0%, #03050a 52%, #010207 100%);
}

.topbar {
  min-height: 58px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(3, 5, 10, 0.98), rgba(3, 5, 10, 0.88));
}

.brand {
  min-width: 0;
}

.brand img {
  width: 42px;
  height: 42px;
  border-color: #314c79;
}

.brand h1 {
  font-size: 16px;
  letter-spacing: 0;
}

.brand span {
  display: block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

button.primary,
.network-switch button.active,
.tabs button.active,
.admin-toolbar button.active,
.admin-nav button.active {
  background: linear-gradient(180deg, #537ccc, #3f63ad);
  border-color: #6f93d3;
  color: #fff;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button {
  font-weight: 720;
}

.panel,
.hero-panel,
.profile-card,
.case-hero,
.task,
.history-card,
.submission,
.user-row,
.prize-row,
.log-row,
.inventory-item,
.prize-card,
.metric {
  background: linear-gradient(180deg, rgba(16, 23, 37, 0.96), rgba(8, 12, 20, 0.98));
  border-color: var(--line);
}

.profile-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 116px;
  padding: 13px;
  overflow: hidden;
}

.profile-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 42%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(72, 111, 185, 0.08));
  pointer-events: none;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  z-index: 1;
}

.profile-main {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  gap: 7px;
}

.profile-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.profile-title h2 {
  max-width: 100%;
  font-size: 17px;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.profile-title p {
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loyalty {
  max-width: 92px;
  padding: 6px 9px;
  font-size: 10px;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
}

.profile-meta,
.verify-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-meta span,
.verify-chip {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.15;
}

.verify-chip i {
  width: 7px;
  height: 7px;
}

.hero-panel {
  padding: 12px;
}

.metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  min-height: 72px;
  padding: 10px 11px;
  border-radius: 8px;
}

.metric span {
  display: block;
  min-height: 15px;
  color: #aab5c6;
  font-size: 11px;
}

.metric strong {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
}

.action-grid {
  gap: 8px;
}

.bottom-nav {
  width: min(calc(100% - 20px), 486px);
  padding: 5px;
  border-radius: 11px;
  background: rgba(4, 7, 13, 0.97);
}

.bottom-nav button {
  min-height: 50px;
  gap: 3px;
  border-radius: 8px;
  color: #8c96a8;
  font-weight: 650;
}

.bottom-nav button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.bottom-nav button.active {
  background: linear-gradient(180deg, #243856, #16243b);
  border-color: #3b5a89;
  color: #eef4ff;
}

.bottom-nav button.active span {
  font-weight: 650;
}

.case-hero {
  gap: 11px;
  padding: 12px;
  background: linear-gradient(180deg, #0f1726, #070a12);
}

.case-hero .section-head {
  align-items: start;
}

.case-hero h2 {
  font-size: 25px;
  line-height: 1;
}

.case-tier-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.case-tier-tabs button {
  min-height: 52px;
  padding: 8px 7px;
  display: grid;
  gap: 3px;
  justify-items: start;
  background: #080d16;
  border-color: #1d2a3f;
  color: #b5bfd0;
}

.case-tier-tabs button span {
  font-size: 11px;
  text-transform: uppercase;
}

.case-tier-tabs button strong {
  color: #fff;
  font-size: 19px;
}

.case-tier-tabs button.active {
  background: linear-gradient(180deg, #172844, #101a2d);
  border-color: #4f72ad;
}

.case-skip-toggle {
  width: fit-content;
  min-height: 32px;
  padding: 5px 10px 5px 6px;
  gap: 8px;
  border-radius: 999px;
  background: #050810;
}

.case-skip-toggle input {
  appearance: none;
  position: relative;
  width: 32px;
  height: 18px;
  margin: 0;
  border: 1px solid #33445f;
  border-radius: 999px;
  background: #111826;
}

.case-skip-toggle input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8c96a8;
  transition: transform 160ms var(--ease-out), background 160ms ease;
}

.case-skip-toggle input:checked {
  background: #263f6d;
  border-color: #5f82bf;
}

.case-skip-toggle input:checked::before {
  transform: translateX(14px);
  background: white;
}

.case-skip-toggle span {
  font-size: 12px;
  color: #b5bfd0;
}

.case-window {
  min-height: 196px;
}

.case-reel.spinning {
  transition-timing-function: cubic-bezier(0.08, 0.72, 0.08, 1);
}

.case-open-button {
  min-height: 46px;
}

.toast {
  left: 50%;
  top: max(12px, env(safe-area-inset-top));
  width: auto;
  max-width: min(360px, calc(100% - 28px));
  min-height: 38px;
  padding: 8px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border-radius: 999px;
  background: rgba(9, 14, 23, 0.94);
  border-color: #2b3f5d;
  animation: toast-in 180ms var(--ease-out);
}

.toast i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6d88c8;
}

.toast.success i {
  background: var(--success);
}

.toast.error i {
  background: var(--danger);
}

.toast span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #d9e1ef;
  font-size: 13px;
}

.toast strong {
  display: none;
}

.admin-layout {
  grid-template-columns: 210px minmax(0, 1fr);
}

.admin-nav,
.admin-content {
  background: rgba(7, 10, 17, 0.96);
}

.admin-nav button {
  min-height: 38px;
  padding: 8px 10px;
}

.admin-content {
  padding: 13px;
}

.admin-page-head {
  margin-bottom: 12px;
}

.admin-page-head h2 {
  font-size: 24px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 6px;
  overflow-x: auto;
}

.admin-toolbar button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.table-list {
  display: grid;
  gap: 8px;
}

.user-row,
.submission,
.prize-row,
.log-row {
  display: grid;
  gap: 8px;
  padding: 11px;
}

.user-row .row,
.submission .row,
.prize-row .row,
.log-row .row {
  min-width: 0;
  align-items: center;
}

.user-row strong,
.submission strong,
.prize-row strong,
.log-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-inline-form {
  grid-template-columns: 72px minmax(96px, 0.7fr) minmax(96px, 0.7fr) minmax(150px, 1fr) auto;
  align-items: center;
}

.bonus-issue-form {
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) auto auto;
}

.admin-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form .full {
  grid-column: 1 / -1;
}

.log-details {
  gap: 6px;
}

.log-details span {
  padding: 7px 8px;
}

.inventory-item {
  will-change: auto;
}

.inventory-item,
.task,
.history-card,
.user-row,
.submission,
.prize-row,
.log-row,
.panel,
.profile-card,
.case-hero {
  transition:
    transform 150ms var(--ease-out),
    border-color 150ms ease,
    background-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .inventory-item:hover,
  .task:hover,
  .history-card:hover,
  .user-row:hover,
  .submission:hover,
  .prize-row:hover,
  .log-row:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 760px) {
  .admin-toolbar {
    margin-inline: -2px;
  }

  .admin-inline-form,
  .bonus-issue-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-inline-form button,
  .bonus-issue-form button {
    grid-column: auto;
  }
}

@media (max-width: 460px) {
  .profile-card {
    min-height: 108px;
  }

  .case-tier-tabs button {
    min-height: 48px;
  }

  .admin-inline-form,
  .bonus-issue-form,
  .admin-form {
    grid-template-columns: 1fr;
  }
}

/* Impeccable graphite/navy rebuild */
:root {
  color-scheme: dark;
  --bg: oklch(7% 0.01 260);
  --bg-2: oklch(10% 0.015 260);
  --surface: oklch(15% 0.018 260);
  --surface-2: oklch(18% 0.02 260);
  --surface-3: oklch(23% 0.024 260);
  --text: oklch(97% 0.006 260);
  --muted: oklch(69% 0.018 260);
  --faint: oklch(51% 0.018 260);
  --line: oklch(28% 0.022 260);
  --line-strong: oklch(38% 0.035 260);
  --accent: oklch(61% 0.23 262);
  --accent-2: oklch(68% 0.16 235);
  --blue: oklch(61% 0.23 262);
  --violet: oklch(59% 0.19 292);
  --yellow: oklch(82% 0.12 86);
  --success: oklch(72% 0.16 145);
  --danger: oklch(67% 0.21 24);
  --vk: oklch(62% 0.2 258);
  --shadow: none;
  --shadow-soft: none;
  --radius: 8px;
  --radius-sm: 7px;
  --tap: 46px;
  --ease-out: cubic-bezier(0.2, 0.85, 0.22, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Segoe UI", Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

html,
body {
  background: var(--bg);
}

body {
  background:
    linear-gradient(180deg, oklch(12% 0.022 260) 0, var(--bg) 42%, oklch(5% 0.006 260) 100%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

body.admin {
  background:
    linear-gradient(180deg, oklch(11% 0.018 260) 0, oklch(7% 0.01 260) 36%, oklch(5% 0.006 260) 100%),
    var(--bg);
}

body::selection {
  background: color-mix(in oklch, var(--accent) 50%, transparent);
  color: white;
}

.app-shell {
  width: min(100%, 500px);
  padding: 10px 10px 104px;
}

.admin-shell {
  width: min(100%, 1240px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 18px 40px;
}

.topbar,
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  min-height: 64px;
  margin: -10px -10px 12px;
  padding: calc(10px + env(safe-area-inset-top)) 10px 10px;
  background: linear-gradient(180deg, rgba(6, 7, 10, 0.98), rgba(6, 7, 10, 0.88));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.admin-topbar {
  margin: 0 0 16px;
  padding: 0 0 14px;
  background: transparent;
  backdrop-filter: none;
}

.brand {
  gap: 10px;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: oklch(5% 0.006 260);
  box-shadow: none;
}

.brand h1,
.profile-title h2,
.hero-panel h2,
.section-head h2,
.section-head h3,
.panel h2,
.panel h3,
.admin-page-head h2,
.task-group-head h3 {
  margin: 0;
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.08;
  text-wrap: balance;
}

.brand h1 {
  font-size: 17px;
}

.brand span,
.muted,
.admin-page-head span,
.task p,
.profile-meta span {
  color: var(--muted);
}

.section-head,
.row,
.topbar,
.admin-topbar {
  gap: 10px;
}

button,
input,
select,
textarea {
  border-radius: var(--radius-sm);
}

button {
  min-height: var(--tap);
  border: 1px solid var(--line);
  background: oklch(18% 0.02 260);
  color: var(--text);
  font-weight: 780;
  box-shadow: none;
  transition:
    transform 150ms var(--ease-out),
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

button.primary,
.network-switch button.active,
.tabs button.active,
.admin-toolbar button.active,
.admin-nav button.active {
  border-color: color-mix(in oklch, var(--accent) 72%, var(--line));
  background: var(--accent);
  color: white;
  box-shadow: none;
}

button.warn {
  border-color: color-mix(in oklch, var(--accent-2) 58%, var(--line));
  background: oklch(22% 0.04 250);
  color: white;
}

button.danger {
  border-color: color-mix(in oklch, var(--danger) 62%, var(--line));
  background: color-mix(in oklch, var(--danger) 74%, oklch(13% 0.018 260));
  color: white;
}

button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

button.small {
  min-height: 36px;
}

button:disabled {
  opacity: 0.42;
}

button:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--accent) 80%, white);
  outline-offset: 2px;
}

input,
select,
textarea {
  min-height: 46px;
  border: 1px solid var(--line);
  background: oklch(10% 0.014 260);
  color: var(--text);
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in oklch, var(--accent) 72%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent);
}

input::placeholder,
textarea::placeholder {
  color: oklch(64% 0.018 260);
}

a {
  color: oklch(72% 0.16 248);
}

.panel,
.hero-panel,
.profile-card,
.wheel-hero,
.case-hero,
.task,
.history-card,
.submission,
.user-row,
.prize-row,
.log-row,
.inventory-item,
.prize-card,
.metric,
.requirements,
.case-result,
.notice,
.admin-toolbar,
.check-row,
pre {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.panel,
.hero-panel,
.profile-card,
.case-hero {
  padding: 14px;
}

.hero-panel,
.case-hero,
.profile-card {
  background: linear-gradient(180deg, oklch(17% 0.024 260), var(--surface));
  border-color: var(--line-strong);
}

.hero-panel h2 {
  font-size: 27px;
  line-height: 0.98;
  color: white;
}

.eyebrow {
  width: fit-content;
  border: 1px solid color-mix(in oklch, var(--accent) 44%, var(--line));
  border-radius: 6px;
  padding: 4px 7px;
  background: oklch(12% 0.026 260);
  color: oklch(80% 0.09 248);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 820;
}

.profile-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.avatar {
  width: 62px;
  height: 62px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: oklch(9% 0.014 260);
  color: white;
  box-shadow: none;
  overflow: hidden;
}

.avatar img {
  filter: saturate(0.95) contrast(1.04);
}

.profile-title h2 {
  font-size: 18px;
}

.profile-meta span,
.verify-chip,
.task-meta span,
.badge,
.loyalty {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(12% 0.016 260);
  color: var(--muted);
}

.verify-chip.ok,
.badge.good,
.loyalty.gold {
  border-color: color-mix(in oklch, var(--success) 48%, var(--line));
  background: color-mix(in oklch, var(--success) 16%, var(--surface));
  color: oklch(86% 0.08 145);
}

.verify-chip.wait {
  border-color: color-mix(in oklch, var(--accent-2) 44%, var(--line));
  background: color-mix(in oklch, var(--accent-2) 13%, var(--surface));
  color: oklch(84% 0.065 238);
}

.verify-chip.wait i {
  background: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent-2) 18%, transparent);
}

.profile-langame-action {
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  padding-inline: 11px;
  color: oklch(88% 0.06 238);
  white-space: normal;
  text-align: center;
}

.profile-langame-action:disabled {
  color: var(--muted);
}

.badge.wait {
  border-color: color-mix(in oklch, var(--accent-2) 44%, var(--line));
  background: color-mix(in oklch, var(--accent-2) 13%, var(--surface));
  color: oklch(82% 0.07 238);
}

.badge.bad {
  border-color: color-mix(in oklch, var(--danger) 54%, var(--line));
  background: color-mix(in oklch, var(--danger) 16%, var(--surface));
  color: oklch(82% 0.11 25);
}

.loyalty.black {
  background: oklch(5% 0.006 260);
  color: white;
}

.metric-grid {
  gap: 10px;
}

.metric {
  min-height: 82px;
  padding: 12px;
  background: oklch(13% 0.018 260);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  color: white;
  font-size: 25px;
  line-height: 1;
}

.bottom-nav {
  bottom: max(10px, env(safe-area-inset-bottom));
  width: min(calc(100% - 18px), 488px);
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(7, 8, 12, 0.96);
  box-shadow: none;
}

.bottom-nav button {
  min-height: 54px;
  border-radius: 8px;
  border-color: transparent;
  background: transparent;
  color: oklch(62% 0.018 260);
  font-size: 10.5px;
}

.bottom-nav button::before {
  width: 22px;
  height: 22px;
  -webkit-mask-size: 18px 18px;
  mask-size: 18px 18px;
}

.bottom-nav button.active {
  background: var(--accent);
  color: white;
}

.bottom-nav button.active::before {
  background: currentColor;
  color: white;
}

.network-switch,
.tabs {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(10% 0.014 260);
  padding: 4px;
}

.network-switch button,
.tabs button {
  min-height: 42px;
  border-radius: 6px;
  border-color: transparent;
  background: transparent;
}

.network-choice button {
  min-height: 112px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, oklch(18% 0.026 260), oklch(12% 0.018 260));
  color: white;
}

.task {
  padding: 10px;
  border-color: var(--line);
  background: oklch(13% 0.018 260);
}

.task-layout {
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
}

.task-art,
.prize-art {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(7% 0.01 260);
}

.task h3 {
  font-size: 15px;
  font-weight: 880;
  color: white;
}

.task p {
  font-size: 12.5px;
}

.task-title strong {
  min-width: 48px;
  border: 1px solid color-mix(in oklch, var(--accent) 50%, var(--line));
  border-radius: 6px;
  background: oklch(11% 0.02 260);
  color: oklch(82% 0.09 248);
  box-shadow: none;
}

.task-meta span {
  color: var(--muted);
  background: oklch(11% 0.014 260);
}

.task-actions button {
  min-height: 40px;
  flex-basis: 112px;
}

.task.pending,
.task.done {
  opacity: 0.58;
  filter: grayscale(0.28) saturate(0.78);
}

.task-group-head {
  padding: 8px 2px 2px;
}

.task-group-head h3 {
  font-size: 18px;
}

.task-group-head span {
  background: oklch(12% 0.026 260);
  border: 1px solid color-mix(in oklch, var(--accent) 44%, var(--line));
  color: oklch(78% 0.1 248);
}

.case-hero {
  background: linear-gradient(180deg, oklch(15% 0.032 262), oklch(9% 0.014 260));
}

.case-window {
  min-height: 208px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: oklch(5% 0.006 260);
}

.case-window::before {
  background: linear-gradient(90deg, oklch(5% 0.006 260), transparent);
}

.case-window::after {
  background: linear-gradient(270deg, oklch(5% 0.006 260), transparent);
}

.case-marker {
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent) 16%, white 50%, var(--accent) 84%, transparent);
  box-shadow: none;
}

.case-marker::before,
.case-marker::after {
  background: white;
}

.case-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: oklch(13% 0.022 260);
  box-shadow: none;
}

.case-item.winner {
  border-color: color-mix(in oklch, var(--accent) 72%, white);
  background: color-mix(in oklch, var(--accent) 16%, var(--surface));
  box-shadow: none;
}

.case-result,
.requirements {
  border-color: color-mix(in oklch, var(--accent) 44%, var(--line));
  background: oklch(11% 0.022 260);
  color: var(--text);
}

.case-skip-toggle {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(10% 0.014 260);
}

.inventory-item,
.prize-card {
  border-color: var(--line);
  border-radius: 8px;
  background: oklch(12% 0.018 260);
}

.inventory-item.is-busy {
  border-color: color-mix(in oklch, var(--accent) 52%, var(--line));
}

.inventory-item.is-busy::after {
  background: linear-gradient(90deg, transparent, color-mix(in oklch, var(--accent) 16%, transparent), transparent);
}

.history-card,
.submission,
.user-row,
.prize-row,
.log-row {
  border-radius: 8px;
  background: oklch(12% 0.018 260);
}

.history-icon {
  border-radius: 7px;
  background: var(--accent);
  color: white;
}

.toast {
  top: max(10px, env(safe-area-inset-top));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: oklch(11% 0.016 260);
  box-shadow: none;
}

.toast strong {
  color: oklch(82% 0.08 248);
}

.sheet-backdrop {
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(8px);
}

.submission-sheet {
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: oklch(10% 0.014 260);
  box-shadow: none;
}

.file-picker {
  border: 1px dashed color-mix(in oklch, var(--accent) 54%, var(--line));
  border-radius: 8px;
  background: oklch(11% 0.02 260);
}

.loader-dot {
  border-color: color-mix(in oklch, var(--accent) 18%, var(--line));
  border-top-color: var(--accent);
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.admin-nav {
  position: sticky;
  top: 18px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: oklch(10% 0.014 260);
  padding: 8px;
}

.admin-nav button {
  justify-content: flex-start;
  min-height: 40px;
  border-radius: 7px;
  border-color: transparent;
  background: transparent;
  text-align: left;
  color: var(--muted);
}

.admin-nav button.active {
  color: white;
}

.admin-content {
  position: relative;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: oklch(9% 0.012 260);
  padding: 14px;
}

.admin-page-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.admin-page-head .eyebrow {
  display: none;
}

.admin-page-head h2 {
  font-size: 26px;
}

.admin-page-head span {
  display: block;
  max-width: 76ch;
  margin-top: 5px;
}

.admin-toolbar {
  gap: 6px;
  padding: 6px;
  background: oklch(10% 0.014 260);
}

.admin-toolbar button {
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

.admin-search {
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
}

.admin-form {
  gap: 10px;
}

.admin-form .form-section {
  gap: 5px;
}

.admin-form .form-section h2 {
  font-size: 20px;
}

.table-list {
  gap: 8px;
}

.user-row,
.submission,
.prize-row,
.log-row {
  padding: 12px;
}

.user-row strong,
.submission strong,
.prize-row strong,
.log-row strong {
  color: white;
  font-weight: 850;
}

.inline-actions {
  gap: 7px;
}

.admin-inline-form {
  grid-template-columns: 86px minmax(120px, 0.7fr) minmax(170px, 1fr) auto;
  gap: 8px;
}

.bonus-issue-form {
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.1fr) auto auto;
}

.check-row {
  min-height: 46px;
  background: oklch(11% 0.016 260);
}

.log-details span {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: oklch(10% 0.014 260);
  color: var(--muted);
}

.log-details b {
  color: white;
  letter-spacing: 0;
  text-transform: none;
}

pre {
  background: oklch(6% 0.008 260);
  color: var(--muted);
}

.admin-loading-card,
.admin-loading-overlay {
  background: oklch(10% 0.014 260);
  border-color: var(--line);
  box-shadow: none;
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translate3d(0, 5px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(-50%, -8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
  }
}

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover {
    border-color: color-mix(in oklch, var(--accent) 50%, var(--line));
    background-color: oklch(20% 0.026 260);
  }

  button.primary:not(:disabled):hover,
  .admin-nav button.active:hover,
  .admin-toolbar button.active:hover {
    background-color: var(--accent);
    border-color: color-mix(in oklch, var(--accent) 80%, white);
  }

  .inventory-item:hover,
  .task:hover,
  .history-card:hover,
  .user-row:hover,
  .submission:hover,
  .prize-row:hover,
  .log-row:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background-color: oklch(15% 0.02 260);
    box-shadow: none;
  }
}

@media (max-width: 760px) {
  .admin-shell {
    padding: 12px 10px 24px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-content {
    padding: 10px;
  }

  .admin-page-head h2 {
    font-size: 22px;
  }

  .admin-search,
  .admin-form,
  .admin-inline-form,
  .bonus-issue-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .app-shell {
    padding-inline: 9px;
  }

  .hero-panel h2 {
    font-size: 25px;
  }

  .grid-2,
  .metric-grid,
  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-title {
    display: grid;
    gap: 5px;
  }

  .avatar {
    width: 56px;
    height: 56px;
  }

  .task-layout {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 9px;
  }

  .task-art {
    width: 76px;
  }

  .task-title {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .task-actions button {
    flex-basis: 94px;
    font-size: 12px;
  }

  .bottom-nav span {
    font-size: 10px;
  }
}

/* Final motion cascade: keep interaction timing stable across all theme layers. */
button {
  transition:
    transform var(--motion-instant) var(--ease-out-quart),
    border-color var(--motion-fast) var(--ease-out-quart),
    background-color var(--motion-fast) var(--ease-out-quart),
    color var(--motion-fast) var(--ease-out-quart),
    opacity var(--motion-fast) var(--ease-out-quart);
}

input,
select,
textarea,
.file-picker,
.check-row {
  transition:
    border-color var(--motion-fast) var(--ease-out-quart),
    background-color var(--motion-fast) var(--ease-out-quart),
    box-shadow var(--motion-base) var(--ease-out-quart),
    color var(--motion-fast) var(--ease-out-quart),
    opacity var(--motion-fast) var(--ease-out-quart),
    transform var(--motion-fast) var(--ease-out-quart);
}

.task,
.history-card,
.inventory-item,
.prize-card,
.user-row,
.submission,
.prize-row,
.log-row {
  transition:
    transform var(--motion-fast) var(--ease-out-quart),
    border-color var(--motion-fast) var(--ease-out-quart),
    background-color var(--motion-fast) var(--ease-out-quart),
    opacity var(--motion-fast) var(--ease-out-quart);
}

.bottom-nav button,
.bottom-nav button::before,
.bottom-nav button span {
  transition:
    transform var(--motion-base) var(--ease-out-quint),
    background-color var(--motion-base) var(--ease-out-quart),
    border-color var(--motion-base) var(--ease-out-quart),
    color var(--motion-fast) var(--ease-out-quart),
    opacity var(--motion-fast) var(--ease-out-quart);
}

.submission-sheet,
.wallet-sheet {
  animation-duration: 280ms;
  animation-timing-function: var(--ease-out-quint);
}

.toast {
  animation-duration: var(--motion-base);
  animation-timing-function: var(--ease-out-quint);
}

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover {
    transform: translate3d(0, -1px, 0);
  }

  button:not(:disabled):active {
    transform: translate3d(0, 1px, 0) scale(0.975);
  }
}

/* Guest system states: preserve context during refreshes and make recovery explicit. */
.connection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklch, var(--surface) 88%, black);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.connection-banner strong {
  color: var(--text);
}

.connection-banner.is-offline,
.connection-banner.is-timeout,
.connection-banner.is-rate {
  border-color: color-mix(in oklch, var(--accent) 42%, var(--line));
}

.connection-banner.is-denied,
.connection-banner.is-unavailable {
  border-color: color-mix(in oklch, var(--danger) 38%, var(--line));
}

.connection-banner.is-loading {
  justify-content: flex-start;
}

.connection-banner.is-loading::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
  animation: status-pulse 1.2s ease-in-out infinite;
}

.loading-view,
.system-state {
  min-height: min(66vh, 560px);
}

.loading-list {
  display: grid;
  gap: 10px;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.skeleton-row > span:last-child {
  display: grid;
  gap: 9px;
}

.skeleton {
  display: block;
  overflow: hidden;
  position: relative;
  min-height: 12px;
  border-radius: 8px;
  background: color-mix(in oklch, var(--surface) 72%, var(--line));
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    color-mix(in oklch, white 10%, transparent) 48%,
    transparent 76%
  );
  content: "";
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.45s ease-in-out infinite;
}

.skeleton-title {
  width: min(62%, 280px);
  min-height: 25px;
}

.skeleton-line {
  width: 100%;
}

.skeleton-line.short {
  width: 58%;
}

.skeleton-box {
  width: 72px;
  min-height: 72px;
  border-radius: 12px;
}

.system-state {
  display: grid;
  place-items: center;
  padding-block: 18px;
}

.system-state > .panel {
  width: min(100%, 520px);
}

.system-state-mark {
  width: 48px;
  height: 48px;
  border: 1px solid color-mix(in oklch, var(--accent) 48%, var(--line));
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 50%, var(--accent) 0 4px, transparent 5px),
    color-mix(in oklch, var(--accent) 12%, var(--surface));
}

.system-state-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.system-state-actions > :only-child {
  grid-column: 1 / -1;
}

.empty-state {
  align-items: start;
}

.empty-state-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in oklch, var(--accent) 42%, var(--line));
  border-radius: 12px;
  background: color-mix(in oklch, var(--accent) 11%, var(--surface));
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.empty-state button {
  min-height: 44px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes skeleton-shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes status-pulse {
  50% {
    opacity: 0.4;
    transform: scale(0.82);
  }
}

@media (max-width: 480px) {
  .connection-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-banner .ghost {
    width: 100%;
  }

  .system-state-actions {
    grid-template-columns: 1fr;
  }

  .system-state-actions > :only-child {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .connection-banner.is-loading::before,
  .skeleton::after {
    animation: none;
  }
}

/* Guest dual-theme system: one product language, tenant-owned identity. */
@font-face {
  font-family: "Onest";
  src: url("/saas/onest-cyrillic-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: var(--tenant-accent, #5f84d5);
  --bg: #0a0c0f;
  --bg-2: #0f1216;
  --surface: #15191f;
  --surface-2: #1b2027;
  --surface-3: #232a33;
  --surface-inset: #0f1216;
  --surface-raised: #1b2027;
  --text: #f4f6f8;
  --muted: #a8b1bd;
  --faint: #7f8996;
  --line: #2e353e;
  --line-strong: #444e5b;
  --accent-ink: #ffffff;
  --header-bg: rgba(10, 12, 15, 0.94);
  --nav-bg: rgba(15, 18, 22, 0.97);
  --canvas-fill: linear-gradient(180deg, #101318 0, #0a0c0f 42%, #07090b 100%);
  --hero-fill: linear-gradient(145deg, color-mix(in oklch, var(--accent) 18%, #15191f), #11151a 64%);
  --hero-mark: rgba(244, 246, 248, 0.045);
  --soft-accent: color-mix(in oklch, var(--accent) 14%, var(--surface));
  --soft-success: color-mix(in oklch, var(--success) 14%, var(--surface));
  --soft-danger: color-mix(in oklch, var(--danger) 14%, var(--surface));
}

:root[data-theme="light"] {
  color-scheme: light;
  --accent: var(--tenant-accent, #5f84d5);
  --bg: #f4f6f8;
  --bg-2: #e9edf1;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --surface-3: #e5eaf0;
  --surface-inset: #f7f9fb;
  --surface-raised: #ffffff;
  --text: #17202a;
  --muted: #596675;
  --faint: #768392;
  --line: #d7dde4;
  --line-strong: #b8c2cd;
  --accent-ink: #ffffff;
  --header-bg: rgba(244, 246, 248, 0.94);
  --nav-bg: rgba(255, 255, 255, 0.97);
  --canvas-fill: linear-gradient(180deg, #ffffff 0, #f4f6f8 38%, #edf1f4 100%);
  --hero-fill: linear-gradient(145deg, color-mix(in oklch, var(--accent) 10%, #ffffff), #f7f9fb 68%);
  --hero-mark: rgba(23, 32, 42, 0.045);
  --soft-accent: color-mix(in oklch, var(--accent) 10%, var(--surface));
  --soft-success: color-mix(in oklch, var(--success) 10%, var(--surface));
  --soft-danger: color-mix(in oklch, var(--danger) 9%, var(--surface));
}

body.mini {
  min-height: 100vh;
  background: var(--canvas-fill), var(--bg);
  color: var(--text);
  font-family: "Onest", "Segoe UI", Arial, sans-serif;
  transition:
    background-color 180ms var(--ease-out-quart),
    color 180ms var(--ease-out-quart);
}

body.mini .app-shell {
  width: min(100%, 520px);
  padding: 10px 12px 106px;
}

body.mini .topbar {
  min-height: 68px;
  margin: -10px -12px 14px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: var(--header-bg);
  border-color: var(--line);
  backdrop-filter: blur(16px);
}

body.mini .brand {
  min-width: 0;
}

body.mini .brand img {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-inset);
}

body.mini .brand > div {
  min-width: 0;
}

body.mini .brand h1 {
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.mini .brand span {
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

body.mini .theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 10px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

body.mini .theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

body.mini .logout-button {
  min-height: 40px;
}

body.mini button {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}

body.mini button.primary,
body.mini .network-switch button.active,
body.mini .tabs button.active {
  border-color: color-mix(in oklch, var(--accent) 76%, var(--line));
  background: var(--accent);
  color: var(--accent-ink);
}

body.mini button.ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

body.mini button:focus-visible,
body.mini input:focus-visible,
body.mini select:focus-visible,
body.mini textarea:focus-visible,
body.mini summary:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--accent) 72%, var(--text));
  outline-offset: 2px;
}

body.mini input,
body.mini select,
body.mini textarea {
  border-color: var(--line);
  background: var(--surface-inset);
  color: var(--text);
}

body.mini input::placeholder,
body.mini textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

body.mini .panel,
body.mini .hero-panel,
body.mini .profile-card,
body.mini .wheel-hero,
body.mini .case-hero,
body.mini .task,
body.mini .history-card,
body.mini .submission,
body.mini .inventory-item,
body.mini .prize-card,
body.mini .metric,
body.mini .requirements,
body.mini .case-result,
body.mini .notice,
body.mini .check-row,
body.mini .connection-banner,
body.mini .skeleton-row,
body.mini .profile-disclosure {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

body.mini .welcome-panel,
body.mini .hero-panel,
body.mini .case-hero,
body.mini .profile-card {
  border-color: var(--line-strong);
  background: var(--hero-fill);
}

body.mini .welcome-panel::after {
  color: var(--hero-mark);
}

body.mini .welcome-panel h2,
body.mini .hero-panel h2,
body.mini .panel h2,
body.mini .panel h3,
body.mini .section-head h2,
body.mini .section-head h3,
body.mini .profile-title h2 {
  color: var(--text);
  font-family: inherit;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

body.mini .welcome-panel h2 {
  max-width: 16ch;
  font-size: 28px;
  line-height: 1.02;
}

body.mini .eyebrow {
  border-color: color-mix(in oklch, var(--accent) 46%, var(--line));
  background: var(--soft-accent);
  color: color-mix(in oklch, var(--accent) 72%, var(--text));
}

body.mini .muted,
body.mini .task p,
body.mini .profile-meta span,
body.mini .activation-step small,
body.mini .live-club-card p,
body.mini .visit-series-copy span {
  color: var(--muted);
}

body.mini .activation-card,
body.mini .live-club-card,
body.mini .referral-card,
body.mini .referral-hero {
  border-color: var(--line-strong);
  background: var(--hero-fill);
  box-shadow: none;
}

body.mini button.activation-step,
body.mini .visit-series,
body.mini .network-switch,
body.mini .tabs,
body.mini .metric,
body.mini .selected-guest,
body.mini .proof-text,
body.mini .webhook-setup {
  border-color: var(--line);
  background: var(--surface-inset);
}

body.mini .progress-ring {
  background: conic-gradient(var(--accent) calc(var(--progress) * 1turn), var(--surface-3) 0);
  color: var(--text);
}

body.mini .progress-ring::before {
  background: var(--surface);
}

body.mini .activation-step b,
body.mini .task-meta strong,
body.mini .wallet-amount,
body.mini .reward-value {
  color: color-mix(in oklch, var(--accent) 74%, var(--text));
}

body.mini .visit-series-copy strong,
body.mini .metric strong,
body.mini .task strong {
  color: var(--text);
}

body.mini .profile-meta span,
body.mini .verify-chip,
body.mini .task-meta span,
body.mini .badge,
body.mini .loyalty {
  border-color: var(--line);
  background: var(--surface-inset);
  color: var(--muted);
}

body.mini .verify-chip.ok,
body.mini .badge.good,
body.mini .loyalty.gold {
  border-color: color-mix(in oklch, var(--success) 48%, var(--line));
  background: var(--soft-success);
  color: color-mix(in oklch, var(--success) 62%, var(--text));
}

body.mini .badge.bad,
body.mini .connection-banner.is-denied,
body.mini .connection-banner.is-unavailable {
  background: var(--soft-danger);
}

body.mini .network-choice button {
  border-color: var(--line-strong);
  background: var(--hero-fill);
  color: var(--text);
}

body.mini .task,
body.mini .history-card,
body.mini .inventory-item,
body.mini .prize-card {
  background: var(--surface);
}

body.mini .bottom-nav {
  bottom: max(9px, env(safe-area-inset-bottom));
  width: min(calc(100% - 20px), 500px);
  padding: 5px;
  border-color: var(--line-strong);
  background: var(--nav-bg);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
}

body.mini .bottom-nav button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

body.mini .bottom-nav button.active {
  background: var(--accent);
  color: var(--accent-ink);
}

body.mini .bottom-nav button.active::before {
  background: currentColor;
}

body.mini .submission-sheet,
body.mini .wallet-sheet {
  background: color-mix(in oklch, var(--bg) 74%, transparent);
}

body.mini .submission-sheet > div,
body.mini .wallet-sheet > div,
body.mini .toast {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
}

body.mini .skeleton {
  background: color-mix(in oklch, var(--surface-2) 72%, var(--line));
}

body.mini .skeleton::after {
  background: linear-gradient(
    100deg,
    transparent 20%,
    color-mix(in oklch, var(--text) 9%, transparent) 48%,
    transparent 76%
  );
}

body.mini ::selection {
  background: color-mix(in oklch, var(--accent) 42%, transparent);
  color: var(--text);
}

@media (hover: hover) and (pointer: fine) {
  body.mini button:not(:disabled):hover {
    border-color: color-mix(in oklch, var(--accent) 48%, var(--line));
    background-color: var(--surface-3);
  }

  body.mini button.primary:not(:disabled):hover,
  body.mini .bottom-nav button.active:hover {
    border-color: color-mix(in oklch, var(--accent) 82%, var(--text));
    background-color: color-mix(in oklch, var(--accent) 90%, var(--text));
  }

  body.mini .task:hover,
  body.mini .history-card:hover,
  body.mini .inventory-item:hover,
  body.mini .prize-card:hover {
    border-color: var(--line-strong);
    background-color: var(--surface-2);
  }
}

@media (max-width: 440px) {
  body.mini .theme-toggle {
    width: 40px;
    padding: 7px;
    justify-content: center;
  }

  body.mini .theme-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  body.mini .welcome-panel h2 {
    font-size: 27px;
  }
}

@media (max-width: 360px) {
  body.mini .brand span {
    display: none;
  }

  body.mini .logout-button {
    width: 40px;
    padding-inline: 5px;
    overflow: hidden;
    color: transparent;
  }

  body.mini .logout-button::before {
    color: var(--text);
    content: "↗";
  }
}

@media (prefers-reduced-motion: reduce) {
  body.mini {
    transition: none;
  }
}

/* Neutral organization launcher and final touch-target pass. */
.launch-body {
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
}

.launch-shell {
  width: min(100%, 560px);
  display: grid;
  gap: 24px;
}

.launch-logo { width: 180px; height: auto; }

.launch-panel {
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.launch-panel h1 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.launch-panel > p:not(.launch-status) {
  max-width: 55ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
}

.launch-status { margin: 0; color: var(--accent); font-weight: 750; }
.launch-brands { display: grid; gap: 10px; margin-top: 26px; }

.launch-brand,
.launch-retry { min-height: 56px; border-radius: 8px; }

.launch-brand {
  display: grid;
  gap: 3px;
  justify-items: start;
  padding: 13px 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.launch-brand:hover,
.launch-brand:focus-visible { border-color: var(--accent); background: var(--surface-3); }
.launch-brand span { font-size: 1rem; font-weight: 850; }
.launch-brand small { color: var(--muted); font-size: 0.82rem; }

.launch-skeleton {
  min-height: 62px;
  border-radius: 8px;
  background: var(--surface-2);
  animation: launch-pulse 1.2s ease-in-out infinite alternate;
}

.launch-error {
  padding: 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--text);
}

.launch-retry { margin-top: 12px; padding: 10px 16px; }

@keyframes launch-pulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@media (pointer: coarse), (max-width: 760px) {
  body.mini button,
  body.mini [role="button"] { min-height: 44px; }
  body.mini .theme-toggle { width: 44px; height: 44px; min-height: 44px; }
  body.mini .logout-button,
  body.mini .bottom-nav button,
  body.mini .network-switch button,
  body.mini .task-actions button,
  body.mini .case-tier-tabs button,
  body.mini .empty-state button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .launch-skeleton { animation: none; }
}
