.home-page {
  text-align: center;
}

.home-welcome {
  max-width: 560px;
  margin: 0 auto;
}

.home-kicker,
.eyebrow {
  margin: 0 0 5px;
  color: #4ade80;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.home-title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.65rem, 7vw, 2.35rem);
  letter-spacing: -.04em;
}

.home-subtitle {
  max-width: 32rem;
  margin: 7px auto 0;
  color: var(--color-muted);
  font-size: .82rem;
  line-height: 1.48;
}

.lion-stage {
  position: relative;
  display: grid;
  width: min(82vw, 390px);
  aspect-ratio: 1;
  margin: 22px auto 25px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #cbcbcb 0%, #9a9a9a 60%, #6c6c6c 100%);
  box-shadow: 0 22px 32px rgb(0 0 0 / 57%);
  cursor: pointer;
  transition: transform 120ms ease;
}

.lion-stage:active {
  transform: scale(.97);
}

.lion-ring {
  position: absolute;
  inset: 7%;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 50%;
  box-shadow: inset 0 0 30px rgb(255 255 255 / 16%);
}

.lion-image {
  position: relative;
  z-index: 2;
  width: 75%;
  user-select: none;
  -webkit-user-drag: none;
}

.lion-level-badge {
  position: absolute;
  z-index: 3;
  bottom: 7%;
  left: 50%;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 999px;
  background: rgb(6 17 40 / 85%);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  translate: -50% 0;
  backdrop-filter: blur(8px);
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  text-align: left;
}

.home-metrics .metric-card {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 118px;
  padding: 12px;
}

.home-metrics .metric-icon {
  width: 34px;
  height: 34px;
}

.route-page {
  padding-bottom: 6px;
}

.ad-placement-list {
  display: grid;
  gap: 10px;
}

.ad-placement-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 4%));
  box-shadow: var(--shadow-card);
}

.ad-placement-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: rgb(40 199 111 / 12%);
  color: #28c76f;
  font-size: 1.35rem;
}

.ad-placement-copy {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.ad-placement-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.ad-placement-title {
  min-width: 0;
  font-size: .9rem;
}

.reward-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reward-chip {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 800;
}

.reward-chip-coins { background: rgb(255 189 36 / 13%); color: #ffd66b; }
.reward-chip-xp { background: rgb(137 122 255 / 13%); color: #c5bbff; }

.ad-placement-action {
  grid-column: 1 / -1;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: rgb(255 255 255 / 5%);
  color: var(--color-muted);
  font-size: .72rem;
  font-weight: 750;
}

.ad-placement-action.is-ready {
  border-color: rgb(74 222 128 / 28%);
  background: rgb(74 222 128 / 8%);
  color: #86efac;
}

.level-overview {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgb(77 156 255 / 13%), rgb(255 255 255 / 4%));
  box-shadow: var(--shadow-card);
}

.level-orb {
  display: grid;
  width: 108px;
  height: 108px;
  place-content: center;
  border: 2px solid rgb(255 255 255 / 30%);
  border-radius: 50%;
  background: radial-gradient(circle, #4d9cff, #184295 70%);
  box-shadow: inset 0 5px 12px rgb(255 255 255 / 20%), 0 12px 24px rgb(0 0 0 / 28%);
  text-align: center;
}

.level-orb-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; }
.level-orb-value { font-size: 2.5rem; line-height: 1; }
.level-overview-copy { min-width: 0; }
.level-overview-title { margin: 0 0 10px; font-size: 1.2rem; }

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

.requirement-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: rgb(255 255 255 / 5%);
}

.requirement-status {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  font-size: 1.1rem;
}

.requirement-status.is-complete { background: rgb(74 222 128 / 12%); color: #4ade80; }
.requirement-status.is-incomplete { background: rgb(251 113 133 / 12%); color: #fb7185; }
.requirement-status.is-unknown { background: rgb(251 191 36 / 12%); color: #fbbf24; }
.requirement-copy { display: grid; gap: 3px; }
.requirement-label { font-size: .84rem; }
.requirement-current { color: var(--color-muted); font-size: .7rem; }

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

.benefit-item {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--color-border);
  border-radius: 13px;
  background: rgb(255 255 255 / 5%);
  font-size: .8rem;
}

.benefit-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgb(74 222 128 / 12%);
  color: #4ade80;
}

.invite-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgb(241 196 15 / 28%);
  border-radius: var(--radius-md);
  background: rgb(241 196 15 / 7%);
}

.invite-link-input {
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: rgb(6 17 40 / 70%);
  color: #e7eefb;
  font-size: .72rem;
}

.copy-button {
  min-width: 72px;
  border: 0;
  border-radius: 11px;
  background: #f1c40f;
  color: #2d2300;
  font-weight: 850;
  cursor: pointer;
}

.copy-button:disabled {
  background: rgb(255 255 255 / 9%);
  color: var(--color-muted);
}

.pending-withdrawal-card,
.profile-card,
.app-version-card {
  padding: 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 4%));
  box-shadow: var(--shadow-card);
}

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

.profile-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.profile-avatar {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 24%);
  border-radius: 50%;
  background: radial-gradient(circle, #4d9cff, #184295);
  color: #fff;
  font-size: 2rem;
}

.profile-copy { display: grid; gap: 5px; min-width: 0; }
.profile-name { margin: 0; font-size: 1.15rem; }
.profile-username { margin: 0; color: var(--color-muted); font-size: .76rem; }

.app-version-card {
  display: grid;
  gap: 1px;
  padding: 0;
  overflow: hidden;
  background: var(--color-border);
}

.app-version-row {
  padding: 11px 13px;
  background: #0d234d;
  color: var(--color-muted);
  font-size: .74rem;
}

@media (max-width: 520px) {
  .home-metrics { grid-template-columns: 1fr; }
  .home-metrics .metric-card { min-height: 90px; }
}

@media (max-width: 360px) {
  .level-overview { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .invite-card { grid-template-columns: 1fr; }
  .copy-button { min-height: 42px; }
}

/* Phase 14 — Earn, Play, Providers, and Games */
.page-refresh-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 38px;
  margin: -8px 0 12px auto;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgb(255 255 255 / 6%);
  color: #dce7fb;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}

.page-refresh-button .icon { width: 16px; height: 16px; }
.page-refresh-button:disabled { opacity: .55; cursor: wait; }

.earn-stats { margin-bottom: 4px; }
.placement-confirmation { color: var(--color-muted); font-size: .66rem; }

.provider-status {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  color: var(--color-muted);
  font-size: .7rem;
  line-height: 1.45;
}
.provider-status:empty { display: none; }
.provider-status[data-tone="success"] { color: #86efac; }
.provider-status[data-tone="warning"] { color: #fcd34d; }
.provider-status[data-tone="error"] { color: #fda4af; }

.provider-host {
  grid-column: 1 / -1;
  overflow: hidden;
  border-radius: 12px;
}
.provider-host:empty { display: none; }
.provider-host:not(:empty) {
  padding: 8px;
  border: 1px solid var(--color-border);
  background: rgb(0 0 0 / 14%);
}

.ad-placement-action:not(:disabled),
.internal-ad-action:not(:disabled) {
  cursor: pointer;
}

.internal-ad-list { display: grid; gap: 10px; }
.internal-ad-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 4%));
  box-shadow: var(--shadow-card);
}
.internal-ad-copy { display: grid; gap: 6px; min-width: 0; }
.internal-ad-title { font-size: .9rem; }
.internal-ad-description { margin: 0; color: var(--color-muted); font-size: .72rem; line-height: 1.45; }
.internal-ad-action {
  min-width: 116px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgb(255 255 255 / 7%);
  color: #dce7fb;
  font-size: .7rem;
  font-weight: 850;
}
.internal-ad-action.is-ready {
  border-color: rgb(74 222 128 / 35%);
  background: rgb(74 222 128 / 12%);
  color: #86efac;
}
.internal-ad-action:disabled { color: var(--color-muted); }

#adsgram-task-host-adsgram_task_1:not(:empty) {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}
#adsgram-task-host-adsgram_task_1 adsgram-task {
  --adsgram-task-font-size: .78rem;
  --adsgram-task-icon-size: 38px;
  --adsgram-task-icon-title-gap: 9px;
  --adsgram-task-icon-border-radius: 9px;
  --adsgram-task-button-width: 112px;
}

.adsgram-task-reward { margin: 0 0 8px; color: #ffd66b; font-weight: 850; }
.adsgram-task-button {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 13px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #28c76f;
  color: #052e16;
  font-weight: 850;
}
.adsgram-task-button.is-done { background: rgb(255 255 255 / 8%); color: #86efac; }

.play-reward-grid { display: grid; gap: 14px; }
.reward-panel {
  padding: 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 4%));
  box-shadow: var(--shadow-card);
}
.reward-panel-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.reward-panel-title { display: flex; gap: 10px; min-width: 0; }
.reward-panel-title h2 { margin: 0; font-size: 1rem; }
.reward-panel-title p { margin: 4px 0 0; color: var(--color-muted); font-size: .7rem; line-height: 1.4; }
.reward-panel-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: rgb(255 255 255 / 8%);
  color: #a8c7ff;
  font-size: 1.25rem;
}
.reward-panel-icon.tone-daily { color: #4ade80; background: rgb(74 222 128 / 12%); }
.reward-panel-icon.tone-wheel { color: #c4b5fd; background: rgb(167 139 250 / 12%); }
.reward-panel-icon.tone-mines { color: #fda4af; background: rgb(251 113 133 / 12%); }
.reward-footnote { margin: 10px 0 0; color: var(--color-muted); font-size: .66rem; line-height: 1.45; }

.daily-calendar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.daily-day {
  display: grid;
  gap: 3px;
  min-height: 70px;
  padding: 8px 6px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  align-content: center;
  background: rgb(255 255 255 / 4%);
  text-align: center;
}
.daily-day-label { color: var(--color-muted); font-size: .58rem; }
.daily-day-value { font-size: .63rem; }
.daily-day-status { color: var(--color-muted); font-size: .54rem; }
.daily-day.is-claimed { border-color: rgb(74 222 128 / 25%); background: rgb(74 222 128 / 8%); }
.daily-day.is-claimed .daily-day-status { color: #86efac; }
.daily-day.is-available {
  border-color: rgb(241 196 15 / 48%);
  background: linear-gradient(145deg, rgb(241 196 15 / 17%), rgb(241 196 15 / 6%));
  box-shadow: 0 0 0 2px rgb(241 196 15 / 8%);
}
.daily-day.is-available .daily-day-status { color: #fcd34d; font-weight: 850; }

.wheel-stage {
  position: relative;
  display: grid;
  width: min(76vw, 310px);
  aspect-ratio: 1;
  margin: 8px auto 14px;
  place-items: center;
}
.lucky-wheel {
  --wheel-result-angle: 0deg;
  position: relative;
  width: 100%;
  height: 100%;
  border: 8px solid #e9b800;
  border-radius: 50%;
  background: repeating-conic-gradient(from -15deg, #1e4a9c 0deg 30deg, #14336f 30deg 60deg);
  box-shadow: inset 0 0 0 4px rgb(255 255 255 / 18%), 0 16px 28px rgb(0 0 0 / 35%);
}
.lucky-wheel::after {
  content: "A";
  position: absolute;
  inset: 38%;
  display: grid;
  place-items: center;
  border: 4px solid #d8a800;
  border-radius: 50%;
  background: #f1c40f;
  color: #473700;
  font-size: 1.4rem;
  font-weight: 950;
}
.lucky-wheel.has-result { animation: wheel-result 1.6s cubic-bezier(.16,.8,.2,1) both; }
@keyframes wheel-result { from { transform: rotate(0); } to { transform: rotate(var(--wheel-result-angle)); } }
.wheel-pointer {
  position: absolute;
  z-index: 4;
  top: -4px;
  width: 0;
  height: 0;
  border-right: 13px solid transparent;
  border-left: 13px solid transparent;
  border-top: 26px solid #f1c40f;
  filter: drop-shadow(0 5px 4px rgb(0 0 0 / 30%));
}
.wheel-label {
  --angle: calc(var(--slice-index) * 30deg + 15deg);
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  margin: -9px 0 0 -17px;
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  text-align: center;
  transform: rotate(var(--angle)) translateY(-112px) rotate(calc(var(--angle) * -1));
}
.wheel-label.is-jackpot { color: #ffe66d; font-size: .67rem; }
.wheel-result {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid rgb(167 139 250 / 30%);
  border-radius: 12px;
  background: rgb(167 139 250 / 9%);
  text-align: center;
}
.wheel-result span { color: var(--color-muted); font-size: .68rem; }
.wheel-result.is-jackpot { border-color: rgb(241 196 15 / 45%); background: rgb(241 196 15 / 12%); color: #ffe66d; }

.game-modal-host:empty { display: none; }
.game-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: calc(18px + var(--safe-top)) calc(14px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(14px + var(--safe-left));
  place-items: center;
  background: rgb(2 8 23 / 78%);
  backdrop-filter: blur(9px);
}
.game-modal-panel {
  width: min(100%, 520px);
  max-height: calc(var(--tg-viewport-height) - 36px - var(--safe-top) - var(--safe-bottom));
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: #0d234d;
  box-shadow: 0 24px 60px rgb(0 0 0 / 55%);
}
.game-modal-top { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.game-modal-title h2 { margin: 0; }
.game-modal-title p { margin: 4px 0 0; color: var(--color-muted); font-size: .7rem; }
.game-close-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgb(255 255 255 / 7%);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}
.mines-status {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 5px 7px;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  padding: 9px;
  border-radius: 12px;
  background: rgb(255 255 255 / 5%);
  color: var(--color-muted);
  font-size: .68rem;
}
.mines-status strong { color: #fff; }
.mines-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 3px;
  width: min(100%, 420px);
  margin: 0 auto;
  aspect-ratio: 1;
}
.mines-cell {
  min-width: 0;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 5px;
  background: linear-gradient(145deg, #275bb2, #173a7c);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}
.mines-cell:active { transform: scale(.93); }
.mines-cell.is-revealed { background: #d8e3f6; color: #15366f; cursor: default; }
.mines-cell.is-mine { background: #334155; }
.mines-cell.is-exploded { background: #e11d48; }
.mines-cell[data-adjacent="1"] { color: #2563eb; }
.mines-cell[data-adjacent="2"] { color: #15803d; }
.mines-cell[data-adjacent="3"] { color: #dc2626; }
.mines-cell[data-adjacent="4"], .mines-cell[data-adjacent="5"] { color: #7e22ce; }
.mines-message { min-height: 20px; margin: 12px 0; color: var(--color-muted); font-size: .72rem; text-align: center; }
.mines-message.is-win { color: #86efac; }
.mines-message.is-loss { color: #fda4af; }
.mines-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

@media (max-width: 520px) {
  .daily-calendar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .internal-ad-card { grid-template-columns: 1fr; }
  .internal-ad-action { width: 100%; }
  .wheel-label { transform: rotate(var(--angle)) translateY(-33vw) rotate(calc(var(--angle) * -1)); }
}

@media (max-width: 360px) {
  .daily-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reward-panel-heading { align-items: stretch; flex-direction: column; }
}
