/* 2026-08 remediation: compact mobile layout and complete result/profile views. */

/*
 * TP Wallet and several Android WebViews keep opacity/transform scroll layers in
 * the GPU compositor after a tab switch.  That presents as old cards being
 * painted over the current scroll position.  Keep inactive pages out of the
 * paint tree and avoid transforms on the page-sized scrolling layer.
 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}
body,
#root,
.phone,
.views {
  isolation: isolate;
}
.views {
  background: var(--bg);
}
.view {
  display: none;
  z-index: 0;
  visibility: hidden;
  opacity: 1;
  transform: none;
  transition: none;
  background-color: var(--bg);
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(var(--tab-h) + var(--safe-b) + 20px);
}
.view.active {
  display: block;
  z-index: 1;
  visibility: visible;
  transform: none;
}
/* This full-height subpage is a flex column. Block layout collapses its
   flex:1 stage and leaves only a thin strip of the background video. */
.zodiac-draw-view.active {
  display: flex;
}

/* TP and several Android WebViews sometimes apply backdrop-filter to following
   composited siblings too, which blurred the result modal itself. A darker
   translucent overlay keeps the page separation without contaminating cards. */
.overlay {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: rgba(18, 24, 18, .68);
}
.modal.fullscreen.gacha,
.gacha-results,
.gacha-card,
.gacha-card .beast-art,
.gacha-card .card-img {
  -webkit-filter: none;
  filter: none;
}

/* Synthesis is a full-screen scene, not a translucent dialog.  An opaque base
   prevents the inventory page and its modal dimmer from showing through in TP
   Wallet/Android WebViews, while the result card always paints at full brightness. */
#modal-synth {
  z-index: 1200 !important;
  isolation: isolate;
  opacity: 1 !important;
  -webkit-filter: none !important;
  filter: none !important;
  background:
    radial-gradient(ellipse at 50% 32%, rgba(255, 252, 230, .92), rgba(212, 228, 190, .78) 45%, rgba(243, 240, 228, 1) 78%),
    #f3f0e4 !important;
}
#modal-synth.phase-reveal .synth-reveal,
#modal-synth.phase-reveal .synth-result,
#modal-synth.phase-reveal .miner-preview,
#modal-synth.phase-reveal .card-img {
  opacity: 1 !important;
  -webkit-filter: none !important;
  filter: none !important;
}
#modal-synth .synth-result {
  background: #fff8df !important;
  color: var(--text) !important;
}
.view:not(.active) {
  display: none !important;
  pointer-events: none !important;
}

/* Use opaque chrome on mobile WebViews. backdrop-filter combined with a nested
   scrolling layer is the other source of the duplicated/ghosted panels. */
.status-bar,
.tabbar,
.sub-header,
#view-inventory .inv-dock,
.profile-detail-panel {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.status-bar,
.sub-header { background: #fff9e6 !important; }
.tabbar { background: #fff9e6 !important; }

/* Each mining block remains in normal document flow and paints independently.
   This also makes rows grow correctly when the wallet increases system fonts. */
#view-mining .page-pad {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#view-mining .page-pad > *,
.reward-package-row,
.mine-claim-trainer,
.miner-item {
  position: relative;
  min-width: 0;
  height: auto;
  flex: 0 0 auto;
  transform: none;
}
.mine-overview,
.mine-asset-strip,
.reward-package-block,
.mine-claim-trainer,
.mine-cards-block {
  isolation: isolate;
}
.mine-count-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mine-output-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 8px 0 0; }
.mine-output-strip strong { font-size: 13px; white-space: nowrap; }
.reward-package-row {
  overflow: visible;
}
.reward-package-row .miner-claim-info,
.reward-package-action,
.trainer-entry-info {
  min-width: 0;
}
.reward-package-row .muted,
.ling-auto-note,
.trainer-entry-hint {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Dead beasts stay visible for 48 hours, then move into a collapsed archive. */
.miner-section-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.mine-cards-block .miner-section-head .mythic-picker-label { margin-bottom: 0; }
.retired-miner-entry {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 3px 10px;
  border: 1px solid rgba(91, 130, 77, .38);
  border-radius: 999px;
  background: rgba(107, 155, 90, .13);
  color: var(--green-deep, #356c48);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.retired-miner-entry strong {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--green-deep, #356c48);
  color: #fff;
  font-size: 10px;
}
.retired-miner-entry:disabled { opacity: .45; cursor: default; }
.retired-miner-entry[aria-expanded="true"] { background: rgba(107, 155, 90, .24); }
.miner-item-retired {
  border-style: dashed;
  background: color-mix(in srgb, var(--bg-elev) 82%, #8a8a8a 18%);
}
.miner-item-retired .card-img { filter: grayscale(.72); opacity: .78; }
.weight-badge.is-retired { background: rgba(80, 80, 80, .12); color: var(--muted); }
.retired-status { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.retired-miner-archive,
.profile-retired-miners {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
  overflow: hidden;
}
.retired-miner-archive.is-open { margin: 0 0 12px; }
.retired-miner-archive > summary,
.profile-retired-miners > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}
.retired-miner-archive > summary span { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
.retired-miner-list { display: grid; gap: 8px; padding: 0 10px 10px; }
.retired-miner-list article {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 12px;
  background: var(--card);
}
.retired-miner-list img { width: 56px; height: 56px; object-fit: contain; filter: grayscale(.72); opacity: .78; }
.retired-miner-list div { display: grid; gap: 3px; min-width: 0; }
.retired-miner-list small { color: var(--muted); }
.profile-retired-miners article { margin: 0 8px 8px; }

@media (max-width: 430px) {
  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  .reward-package-action {
    width: 100%;
  }
  .reward-package-action .miner-claim-btn,
  .reward-package-action .reinvested-pill {
    flex: 0 0 auto;
  }
}
.status-bar {
  top: 6px;
  left: 10px;
  right: 10px;
  gap: 5px;
  padding: 5px 7px;
}
.wallet-pill { padding: 5px 9px; }
.more-btn { width: 32px; height: 32px; }
#view-home .ling-panel { padding-top: 0; transform: translateY(-8px); }
#view-home .ling-hero { min-height: 132px; max-height: 174px; }
#view-home .ling-gem-wrap { width: min(66%, 230px); }
#view-home .draw-entry-home {
  margin-top: -12px;
  padding: 6px 10px;
  grid-template-columns: 40px 1fr;
  gap: 8px;
}
#view-home .draw-entry-home .presale-entry-art { width: 40px; height: 40px; }
#view-home .ling-metric { padding: 6px 8px; gap: 6px; }
#view-home .ling-metric-ico { width: 28px; height: 28px; }
#view-home .ling-flow-card { padding: 8px 10px; }

.draw-content { justify-content: flex-end; }
.phone.is-draw .draw-content { padding-top: calc(var(--status-h) + 12px); }
.draw-stats { margin-bottom: 24%; transform: translateY(-38px); }
.timer-dial { width: 190px; height: 190px; }
.dial-ring { width: 132px; height: 132px; padding: 8px; }
.dial-time { font-size: 24px; }

/* Frontend requirement document: miner cards are compact summaries that open
   a readable earnings/reinvestment detail panel on tap. */
.miner-head[role="button"] { cursor: pointer; border-radius: 12px; }
.miner-head[role="button"]:focus-visible { outline: 2px solid var(--purple-deep); outline-offset: 3px; }
.miner-detail-toggle {
  display: inline-flex;
  margin-top: 6px;
  color: var(--purple-deep);
  font-size: 11px;
  font-weight: 800;
}
.miner-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.reward-batch-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin: 8px 0 12px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.reward-batch-copy { grid-column: 1 / -1; display: grid; gap: 3px; }
.reward-batch-copy strong { color: var(--text); font-size: 14px; }
.reward-batch-copy span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.daily-output-amount { align-self: center; color: var(--purple-deep); font-size: 18px; }
.daily-output-amount small { color: var(--muted); font-size: 11px; }
.reward-batch-action .btn { min-width: 96px; padding: 9px 12px; }
.ling-auto-note {
  margin: 8px 0 12px;
  padding: 9px 11px;
  color: var(--green-deep, #356c48);
  background: rgba(90, 150, 98, .10);
  border: 1px solid rgba(90, 150, 98, .24);
  border-radius: 11px;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-height: 700px) {
  .draw-stats { margin-bottom: 19%; transform: translateY(-28px); }
}

.modal.fullscreen.gacha {
  padding: calc(5vh + env(safe-area-inset-top, 0px)) 10px 12px;
  overflow-y: auto;
}
.gacha-congrats { margin-bottom: 8px; font-size: clamp(22px, 7vw, 30px); }
.gacha-results,
.gacha-results[data-count="5"],
.gacha-results[data-count="10"] {
  display: grid;
  width: min(100%, 390px);
  max-width: 390px;
  max-height: calc(100dvh - 165px);
  overflow-y: auto;
  align-content: start;
  justify-content: stretch;
  gap: 6px;
  padding: 2px 4px 8px;
}
.gacha-results[data-count="5"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gacha-results[data-count="10"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gacha-results[data-count="10"] .gacha-card:nth-child(9),
.gacha-results[data-count="10"] .gacha-card:nth-child(10) { grid-column: auto; }
.gacha-results[data-count="5"] .gacha-card,
.gacha-results[data-count="10"] .gacha-card {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 6px 4px 7px;
  border-radius: 11px;
}
.gacha-results[data-count="5"] .beast-art,
.gacha-results[data-count="10"] .beast-art { min-height: 54px; margin-bottom: 3px; }
.gacha-results[data-count="5"] .beast-art .card-img.hero,
.gacha-results[data-count="10"] .beast-art .card-img.hero { max-width: 54px; max-height: 72px; }
.gacha-actions {
  position: sticky;
  bottom: 0;
  margin-top: 8px;
  padding-top: 6px;
  background: linear-gradient(180deg, transparent, var(--bg) 35%);
}

.avatar { overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-identity { flex: 1; min-width: 0; }
.addr-line {
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-height: 1.25;
  font-size: 11px;
}
.profile-edit-btn { margin-left: auto; }
.profile-head { margin-bottom: 10px; padding-top: 0; gap: 8px; }
.profile-head .avatar { width: 48px; height: 48px; border-radius: 14px; }
.promo-grid.compact { gap: 6px; margin-bottom: 8px; }
.promo-grid.compact .promo-cell { padding: 8px 10px; border-radius: 11px; text-align: left; }
.promo-grid.compact .promo-cell span { margin-bottom: 4px; }
.promo-grid.compact .promo-cell strong { font-size: 17px; }
.promo-cell-button { width: 100%; color: var(--text); cursor: pointer; }
.avatar-upload-field { position: relative; display: grid; gap: 7px; }
.avatar-file-input { position: absolute; width: 1px !important; height: 1px; opacity: 0; pointer-events: none; }
.avatar-upload-control { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar-preview { width: 48px; height: 48px; border-radius: 14px; }
.profile-editor { margin: -6px 0 12px; padding: 12px; }
.profile-editor input {
  width: 100%;
  padding: 10px 11px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.profile-editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-detail-panel {
  position: fixed;
  z-index: 980;
  top: calc(max(0px, (100dvh - min(844px, calc(100dvh - 48px))) / 2) + var(--status-h) + 6px);
  right: auto;
  bottom: calc(max(0px, (100dvh - min(844px, calc(100dvh - 48px))) / 2) + var(--tab-h) + var(--safe-b) + 12px);
  left: 50%;
  width: calc(min(100vw, 390px) - 16px);
  max-width: none;
  box-sizing: border-box;
  padding: 14px;
  overflow: auto;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
  transform: translateX(-50%);
}
.profile-detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.profile-detail-head button { color: var(--purple-deep); }
.profile-detail-list { display: grid; gap: 8px; }
.profile-detail-list article {
  display: grid;
  gap: 4px;
  padding: 11px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.profile-detail-list article strong { color: var(--purple-deep); }
.profile-detail-list .team-member-address { overflow-wrap: anywhere; word-break: break-all; font-size: 11px; }
.profile-detail-list article small { color: var(--muted); }
.profile-detail-section-title {
  margin: 5px 2px 1px;
  color: var(--green-deep, #356c48);
  font-size: 13px;
  letter-spacing: .04em;
}

@media (max-width: 430px) {
  .profile-detail-panel {
    top: calc(var(--status-h) + 6px);
    bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
    width: calc(100vw - 16px);
  }
}

@media (max-height: 700px) {
  .modal.fullscreen.gacha { padding-top: calc(2vh + env(safe-area-inset-top, 0px)); }
  .gacha-results[data-count="5"], .gacha-results[data-count="10"] { max-height: calc(100dvh - 125px); }
  .gacha-congrats { font-size: 20px; margin-bottom: 4px; }
}

/* Symmetric result layouts: one centered card, five as 2+2+1, ten as 2x5. */
.gacha-results[data-count="1"],
.gacha-results[data-count="5"],
.gacha-results[data-count="10"] {
  display: grid;
  width: min(100%, 350px);
  max-width: 350px;
  justify-content: stretch;
  align-content: start;
  justify-items: stretch;
  gap: 8px;
  padding: 3px;
  margin-inline: auto;
}
.gacha-results[data-count="1"] {
  grid-template-columns: minmax(0, 238px);
  justify-content: center;
  align-content: center;
}
.gacha-results[data-count="1"] .gacha-card {
  width: 100%;
  max-width: 238px;
  justify-self: center;
}
.gacha-results[data-count="5"],
.gacha-results[data-count="10"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gacha-results[data-count="5"] .gacha-card,
.gacha-results[data-count="10"] .gacha-card {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 132px;
  padding: 8px 7px 9px;
  border-radius: 13px;
}
.gacha-results[data-count="5"] .gacha-card:nth-child(5) {
  grid-column: 1 / -1;
  width: calc(50% - 4px);
  justify-self: center;
}
.gacha-results[data-count="5"] .beast-art,
.gacha-results[data-count="10"] .beast-art { min-height: 76px; margin-bottom: 4px; }
.gacha-results[data-count="5"] .beast-art .card-img.hero,
.gacha-results[data-count="10"] .beast-art .card-img.hero { max-width: 72px; max-height: 78px; }
.gacha-results[data-count="5"] .gacha-card h3,
.gacha-results[data-count="10"] .gacha-card h3 { font-size: 11px; line-height: 1.25; white-space: normal; }
.gacha-results[data-count="5"] .gacha-card .rank,
.gacha-results[data-count="10"] .gacha-card .rank { font-size: 9px; }
.gacha-actions { position: sticky; bottom: 0; margin-top: 8px; padding: 7px 0 2px; }

/* 811: remove the black frame around the trial video while retaining side contrast. */
#view-draw .draw-stage { background: #07131b; }
#view-draw .storm { inset: 0; background: #07131b; }
#view-draw .storm::after {
  background: linear-gradient(90deg, rgba(0,0,0,.42) 0%, transparent 18%, transparent 82%, rgba(0,0,0,.42) 100%);
}

/* 811: compact daily collection and three-decimal reward-package controls. */
.reward-batch-action.compact {
  grid-template-columns: minmax(72px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin: 6px 0 9px;
  padding: 9px 10px;
  border-radius: 12px;
}
.reward-batch-title { color: var(--text); font-size: 14px; }
.reward-batch-action.compact .daily-output-amount { font-size: 16px; }
.reward-batch-action.compact .btn { min-width: 76px; padding: 8px 10px; }
.reward-package-action .reinvested-pill {
  display: inline-flex;
  min-width: 96px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  color: var(--ok);
  background: rgba(61, 139, 90, .12);
  border: 1px solid rgba(61, 139, 90, .32);
  border-radius: 999px;
  font-weight: 700;
}

/* 813: keep one reward package on screen; daily settlements live in expandable details. */
.reward-wallet-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(49, 74, 45, .06);
}
.reward-wallet-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 13px;
}
.reward-wallet-summary .miner-claim-info { min-width: 0; }
.reward-wallet-summary .miner-claim-amt { margin: 3px 0; }
.reward-wallet-action { align-self: end; }
.reward-detail-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  color: var(--text);
  background: rgba(90, 150, 98, .08);
  border: 0;
  border-top: 1px solid var(--line);
  font: inherit;
  cursor: pointer;
}
.reward-detail-toggle span { font-size: 12px; font-weight: 700; }
.reward-detail-toggle strong { color: var(--green-deep, #356c48); font-size: 12px; }
.reward-daily-details { display: grid; padding: 0 13px 5px; }
.reward-daily-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
}
.reward-daily-row div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.reward-daily-row div strong { color: var(--text); font-size: 12px; }
.reward-daily-row div span {
  padding: 2px 6px;
  color: var(--green-deep, #356c48);
  background: rgba(90, 150, 98, .10);
  border-radius: 999px;
  font-size: 10px;
}
.reward-daily-row b { color: var(--text); font-size: 12px; }
.reward-daily-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .reward-wallet-summary { grid-template-columns: 1fr; align-items: stretch; }
  .reward-wallet-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .reward-wallet-action input { width: 100%; }
}

/* 815: wallet-bound platform miners live beside the user's normal miners while
   retaining an isolated ledger and never contributing to ordinary weight UI. */
.platform-miner-block {
  border-color: rgba(184, 128, 47, .35);
  background: linear-gradient(180deg, rgba(255, 249, 226, .96), rgba(246, 238, 208, .88));
}
.platform-miner-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.platform-miner-section-head .mythic-picker-label { margin-bottom: 2px; }
.platform-miner-section-head span {
  color: var(--muted);
  font-size: 11px;
}
.platform-miner-section-head em,
.platform-miner-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #7b5721;
  background: rgba(211, 162, 78, .18);
  border: 1px solid rgba(184, 128, 47, .32);
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}
.platform-batch-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}
.platform-batch-actions .btn { width: 100%; padding: 9px 10px; font-size: 12px; }
.platform-miner-item { border-color: rgba(184, 128, 47, .34); }
.platform-miner-art { position: relative; }
.platform-miner-art > span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 2px 5px;
  color: #fff9e6;
  background: rgba(105, 70, 20, .86);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}
.platform-miner-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 10px 10px;
  overflow: hidden;
  background: rgba(184, 128, 47, .18);
  border: 1px solid rgba(184, 128, 47, .18);
  border-radius: 12px;
}
.platform-miner-summary > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  background: rgba(255, 251, 235, .92);
}
.platform-miner-summary span { color: var(--muted); font-size: 10px; }
.platform-miner-summary strong {
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.platform-miner-summary small { font-size: 9px; }
.platform-ledger-list {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}
.platform-miner-note {
  margin: 0;
  padding: 8px 10px;
  color: #6f6040;
  background: rgba(211, 162, 78, .10);
  border-radius: 10px;
  font-size: 10px;
  line-height: 1.5;
}
.platform-ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  background: rgba(255, 252, 239, .92);
  border: 1px solid rgba(184, 128, 47, .22);
  border-radius: 11px;
}
.platform-ledger-row > div:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.platform-ledger-row strong { color: var(--text); font-size: 11px; }
.platform-ledger-row span { color: #476b4e; font-size: 11px; font-weight: 700; }
.platform-ledger-row small { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.platform-ledger-actions { display: flex; gap: 6px; }
.platform-ledger-actions .btn { min-width: 54px; padding: 7px 9px; font-size: 11px; }
.platform-ledger-finished { color: var(--muted) !important; font-size: 10px !important; }
.platform-ledger-empty { margin: 4px 0; }
@media (max-width: 380px) {
  .platform-miner-section-head { display: grid; }
  .platform-miner-section-head em { justify-self: start; }
  .platform-ledger-row { grid-template-columns: 1fr; }
  .platform-ledger-actions .btn { flex: 1 1 0; }
}

/* xq: the configurable announcement belongs in My > below Community. */
.profile-announcement-entry { width: 100%; }
.profile-announcement-entry > summary {
  list-style: none;
  cursor: pointer;
}
.profile-announcement-entry > summary::-webkit-details-marker { display: none; }
.profile-announcement-entry[open] > summary .chev { transform: rotate(90deg); }
.profile-announcement-content {
  padding: 14px 18px 16px;
  color: var(--text);
  background: rgba(83, 122, 76, .07);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.profile-announcement-entry:last-child .profile-announcement-content { border-bottom: 0; }

/* 815 xq: referral-gated draws and explicit today/cumulative reward scopes. */
.draw-entry-home:disabled,
.summon-card:disabled {
  cursor: not-allowed;
  filter: grayscale(.2);
  opacity: .58;
}
.draw-referral-required {
  margin: 10px 18px 0;
  padding: 9px 11px;
  color: #7a4e20;
  background: rgba(211, 162, 78, .14);
  border: 1px solid rgba(184, 128, 47, .28);
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}
.reward-history-summary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* 811: wallet-friendly circular avatar cropper. */
.profile-avatar-button,
.avatar-preview { border-radius: 50% !important; }
.profile-avatar-button { padding: 0; color: var(--text); cursor: pointer; border: 1px solid var(--line); }
.avatar-upload-control .btn { width: auto; }
.avatar-crop-modal {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(18, 26, 18, .72);
}
.avatar-crop-card {
  width: min(100%, 304px);
  display: grid;
  gap: 12px;
  padding: 16px;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 55px rgba(0,0,0,.32);
}
.avatar-crop-head { display: flex; align-items: center; justify-content: space-between; }
.avatar-crop-head button { color: var(--purple-deep); }
.avatar-crop-stage {
  position: relative;
  width: 260px;
  height: 260px;
  overflow: hidden;
  touch-action: none;
  cursor: move;
  user-select: none;
  background: #172018;
  border-radius: 12px;
}
.avatar-crop-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
}
.avatar-crop-mask {
  position: absolute;
  inset: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0,0,0,.56);
  pointer-events: none;
}
.avatar-crop-zoom { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.avatar-crop-zoom input { width: 100%; accent-color: var(--purple-deep); }
.avatar-crop-card > .muted { margin: -4px 0 0; font-size: 11px; line-height: 1.45; }

/* 813: balanced draw-result layouts. Keep the title below the wallet/browser
   chrome and scale each result count independently instead of stretching the
   same card dimensions across single, five and ten draws. */
.modal.fullscreen.gacha {
  box-sizing: border-box;
  justify-content: flex-start;
  padding: clamp(92px, 11dvh, 124px) 14px 22px;
  overflow-y: auto;
}
.modal.fullscreen.gacha .gacha-congrats {
  flex: 0 0 auto;
  margin: 0 auto 14px;
  font-size: clamp(25px, 7.2vw, 32px);
  line-height: 1.15;
  letter-spacing: .16em;
}
.modal.fullscreen.gacha .gacha-results {
  flex: 0 0 auto;
  width: min(100%, 316px);
  max-width: 316px;
  max-height: none;
  gap: 7px;
  padding: 2px;
  margin: 0 auto;
  overflow: visible;
}
.modal.fullscreen.gacha .gacha-actions {
  position: relative;
  bottom: auto;
  flex: 0 0 auto;
  width: min(100%, 292px);
  margin: 14px auto 0;
  padding: 0;
  background: none;
}

/* Single draw: one focused card, but not a near-full-width poster. */
.gacha-results[data-count="1"] {
  grid-template-columns: minmax(0, 190px);
  justify-content: center;
  margin-top: 8px !important;
}
.gacha-results[data-count="1"] .gacha-card {
  box-sizing: border-box;
  width: 190px;
  min-height: 244px;
  padding: 16px 14px 15px;
  border-radius: 18px;
}
.gacha-results[data-count="1"] .beast-art {
  min-height: 148px;
  margin-bottom: 8px;
}
.gacha-results[data-count="1"] .beast-art .card-img.hero { max-width: 142px; max-height: 148px; }
.gacha-results[data-count="1"] .gacha-card h3 { font-size: 17px; margin-bottom: 4px; }
.gacha-results[data-count="1"] .gacha-card .rank { font-size: 11px; }

/* Five draws: compact 2 + 2 + 1 composition. */
.gacha-results[data-count="5"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gacha-results[data-count="5"] .gacha-card {
  min-height: 108px;
  padding: 6px 6px 7px;
  border-radius: 12px;
}
.gacha-results[data-count="5"] .gacha-card:nth-child(5) {
  grid-column: 1 / -1;
  width: calc(50% - 3.5px);
}
.gacha-results[data-count="5"] .beast-art {
  min-height: 58px;
  margin-bottom: 3px;
}
.gacha-results[data-count="5"] .beast-art .card-img.hero { max-width: 58px; max-height: 62px; }
.gacha-results[data-count="5"] .gacha-card h3 { font-size: 10px; margin-bottom: 1px; }
.gacha-results[data-count="5"] .gacha-card .rank { font-size: 8px; }
.gacha-results[data-count="5"] .gacha-card .rank-stars { font-size: 9px; }

/* Ten draws: readable 2 x 5 grid sized to stay inside an ordinary phone. */
.gacha-results[data-count="10"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 7px;
}
.gacha-results[data-count="10"] .gacha-card,
.gacha-results[data-count="10"] .gacha-card:nth-child(9),
.gacha-results[data-count="10"] .gacha-card:nth-child(10) {
  grid-column: auto;
  min-height: 78px;
  padding: 4px 5px 5px;
  border-radius: 10px;
}
.gacha-results[data-count="10"] .beast-art {
  min-height: 39px;
  margin-bottom: 2px;
}
.gacha-results[data-count="10"] .beast-art .card-img.hero { max-width: 41px; max-height: 42px; }
.gacha-results[data-count="10"] .gacha-card h3 { font-size: 9px; margin-bottom: 0; }
.gacha-results[data-count="10"] .gacha-card .rank { font-size: 7px; line-height: 1.1; }
.gacha-results[data-count="10"] .gacha-card .rank-stars { font-size: 8px; }

@media (max-height: 740px) {
  .modal.fullscreen.gacha { padding-top: clamp(66px, 9dvh, 78px); padding-bottom: 12px; }
  .modal.fullscreen.gacha .gacha-congrats { margin-bottom: 8px; font-size: 22px; }
  .modal.fullscreen.gacha .gacha-actions { margin-top: 8px; }
  .gacha-results[data-count="1"] .gacha-card { min-height: 216px; }
  .gacha-results[data-count="1"] .beast-art { min-height: 126px; }
  .gacha-results[data-count="5"] .gacha-card { min-height: 98px; }
  .gacha-results[data-count="10"] { gap: 4px 6px; }
  .gacha-results[data-count="10"] .gacha-card { min-height: 70px; }
}
/* Wallet authorization confirmation is intentionally rendered inside the DApp;
   the actual password/biometric prompt remains owned by TP Wallet. */
.withdraw-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top, 0px)) 18px max(18px, env(safe-area-inset-bottom, 0px));
  background: rgba(5, 10, 8, .68);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.withdraw-confirm-card {
  width: min(360px, 100%);
  max-height: calc(100dvh - 36px);
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(53, 108, 72, .22);
  border-radius: 20px;
  background: #fffdf2;
  color: #202820;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .32);
}
.withdraw-confirm-head { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.withdraw-confirm-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: #e5f2df;
  color: #356c48;
  font-size: 24px;
  font-weight: 900;
}
.withdraw-confirm-head h3 { margin: 0; font-size: 20px; line-height: 1.2; }
.withdraw-confirm-head small { display: block; margin-top: 3px; color: #6e776e; font-size: 12px; }
.withdraw-confirm-amount {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 14px;
  background: #edf6e8;
}
.withdraw-confirm-amount span,
.withdraw-confirm-address span { color: #687168; font-size: 12px; }
.withdraw-confirm-amount strong { color: #2f6942; font-size: 25px; line-height: 1.15; }
.withdraw-confirm-amount strong small { font-size: 13px; }
.withdraw-confirm-address { display: grid; gap: 4px; margin-top: 12px; }
.withdraw-confirm-address strong { font-size: 12px; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.withdraw-confirm-tip {
  margin: 12px 0 0;
  padding: 10px 11px;
  border-left: 3px solid #6d9b69;
  border-radius: 0 10px 10px 0;
  background: #f4f2e7;
  color: #5e675f;
  font-size: 12px;
  line-height: 1.55;
}
.withdraw-risk-check { display: flex; align-items: flex-start; gap: 9px; margin: 15px 0; font-size: 13px; line-height: 1.4; }
.withdraw-risk-check input { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; }
.withdraw-confirm-actions { display: grid; grid-template-columns: 1fr 1.55fr; gap: 10px; margin-top: 14px; }
.withdraw-confirm-actions .btn { min-height: 46px; font-size: 14px; }

.invite-copy-row { display: block; margin-bottom: 8px; }
.invite-copy-row .btn { margin: 0; }
.invite-copy-button { position: relative; width: 100%; min-height: 58px; padding: 9px 158px 9px 18px; }
.invite-copy-label { display: block; font-size: 17px; font-weight: 900; }
.invite-code-inline {
  position: absolute;
  top: 50%;
  right: 24px;
  max-width: 142px;
  overflow: visible;
  color: rgba(255, 255, 255, .86);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .01em;
  text-overflow: clip;
  white-space: nowrap;
  transform: translateY(-50%);
}
.invite-code-inline strong { color: #fff; font-size: 12px; letter-spacing: .04em; }
.profile-level-badge {
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid rgba(53, 108, 72, .22);
  border-radius: 999px;
  background: #edf6e8;
  color: #356c48;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.profile-detail-head > button { margin-left: 8px; }
.community-choice-modal{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:22px;background:rgba(5,10,8,.62);backdrop-filter:blur(4px)}
.community-fund-modal{
  align-items:start;
  justify-items:center;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  touch-action:pan-y;
  padding:calc(var(--status-h) + 14px + env(safe-area-inset-top,0px)) 8px calc(var(--tab-h) + var(--safe-b) + 14px);
}
.community-fund-card{
  box-sizing:border-box;
  width:100%;
  max-width:520px;
  max-height:none;
  margin:0 auto;
  padding-bottom:24px;
  overflow-x:hidden;
}
.community-fund-head{position:sticky;top:0;z-index:2;min-height:36px;padding:2px 0 8px;background:#fff}
.community-fund-back{display:inline-flex;align-items:center;justify-content:center;gap:2px;min-width:62px;min-height:34px;padding:4px 8px;border:1px solid rgba(86,119,69,.28);border-radius:999px;background:#f3f8ee;color:var(--green-deep,#356c48)!important;font-size:13px;font-weight:800}
.community-fund-back svg{width:18px;height:18px;flex:0 0 auto}
.community-fund-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.community-fund-stats span{display:flex;flex-direction:column;gap:4px;padding:10px;border:1px solid rgba(86,119,69,.28);border-radius:12px;background:rgba(255,255,255,.34);font-size:12px;color:var(--muted)}
.community-fund-stats strong{font-size:15px;color:var(--text)}
.community-policy-text{padding:10px;border-radius:10px;background:rgba(82,126,64,.1);font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
.community-fund-form{display:grid;gap:10px;margin:14px 0}
.community-fund-form .field,.community-fund-form input,.community-fund-form textarea{box-sizing:border-box;min-width:0;max-width:100%}
.community-fund-form input,.community-fund-form textarea{width:100%}
.community-fund-form textarea{min-height:78px;resize:vertical}
.community-quote-card{display:grid;gap:4px;padding:10px 12px;border:1px solid rgba(82,126,64,.24);border-radius:10px;background:rgba(82,126,64,.08);color:#34482e}
.community-quote-card strong{font-size:14px}
.community-quote-card small{font-size:11px;line-height:1.5;color:#66725e;overflow-wrap:anywhere}
.community-quote-card.error{border-color:rgba(165,74,58,.3);background:rgba(165,74,58,.08);color:#934638}
.community-invoice-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;min-width:0}
.community-fund-list{max-height:280px;overflow:auto}
.community-fund-list article .btn{margin-top:8px;align-self:flex-start}
.community-choice-card{width:min(340px,100%);padding:18px;border-radius:18px;background:#fff;color:#202820}.community-choice-actions{display:grid;gap:10px;margin-top:16px}
.team-member-title{display:flex;align-items:center;gap:8px}.team-member-title img{width:30px;height:30px;border-radius:50%;object-fit:cover;background:#edf1eb}
.zodiac-draw-view .sub-header{min-height:54px;padding-top:0;padding-bottom:0;position:relative}
.zodiac-draw-view .sub-header h2{position:absolute;top:50%;left:50%;width:max-content;max-width:calc(100% - 112px);margin:0;text-align:center;white-space:nowrap;transform:translate(-50%,-50%);pointer-events:none}
.zodiac-draw-view .sub-header-balance{display:block;width:36px;height:36px;margin-left:auto}
.ling-live.is-stale{color:#9b7442;background:#fff0d2}.ling-live.is-stale i{background:#c28a43;box-shadow:0 0 0 4px rgba(194,138,67,.12)}
#view-home .ling-metric-val.ling-metric-full{font-size:clamp(11px,3.25vw,15px);overflow:visible;text-overflow:clip;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
#view-home .ling-flow-legend strong{font-size:clamp(9px,2.8vw,12px);font-variant-numeric:tabular-nums;white-space:nowrap}
.rules-document-card{max-height:min(76dvh,620px);overflow:auto}
.rules-document-link{display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;text-decoration:none}
.rules-document-link strong{overflow-wrap:anywhere}.rules-document-link small{flex:0 0 auto;opacity:.72}

/* xq 2026-08-30: balance the decorative icon so the blind-box copy is
   geometrically centered rather than centered only in the remaining column. */
#view-home .draw-entry-home{grid-template-columns:40px minmax(0,1fr) 40px}
#view-home .draw-entry-home::after{content:"";display:block;width:40px;height:1px}
#view-home .draw-entry-home .presale-entry-text{align-items:center;text-align:center}
