/*
 * Premium visual layer.
 * Loaded last and intentionally presentation-only: it restyles existing
 * markup without changing structure, copy or behaviour, so it can be
 * removed by dropping the <link> if anything ever looks off.
 */

:root {
  --pt-gold: #c09537;
  --pt-gold-lite: #e5c476;
  --pt-gold-deep: #9b7b1b;
  --pt-hairline: rgba(30, 27, 24, .09);
  --pt-hairline-strong: rgba(30, 27, 24, .14);
  --pt-label: #7d7264;
  --pt-well: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 252, 245, .7));
  --pt-lift:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 1px 2px rgba(62, 40, 16, .04),
    0 10px 24px rgba(62, 40, 16, .07);
  --pt-lift-lg:
    0 1px 0 rgba(255, 255, 255, .92) inset,
    0 2px 5px rgba(62, 40, 16, .05),
    0 22px 54px rgba(62, 40, 16, .11);
}

/* ---------- canvas ---------- */

body {
  background:
    radial-gradient(1100px 620px at 10% -10%, rgba(217, 139, 43, .2), transparent 58%),
    radial-gradient(900px 560px at 110% 6%, rgba(21, 122, 110, .13), transparent 60%),
    radial-gradient(820px 700px at 50% 112%, rgba(155, 123, 27, .12), transparent 58%),
    linear-gradient(180deg, #fffdf8 0%, #f8f2e5 48%, #f2ead9 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fine paper grain: keeps large flat areas from looking plasticky. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.32'/></svg>");
  mix-blend-mode: multiply;
}

.backdrop-grid {
  opacity: .55;
  background-size: 26px 26px;
}

/* ---------- cards ---------- */

.overview-card,
.action-card {
  position: relative;
  border: 1px solid var(--pt-hairline);
  border-radius: 24px;
  background-color: rgba(255, 252, 245, .82);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, 0) 46%);
  box-shadow: var(--pt-lift-lg);
  backdrop-filter: blur(18px) saturate(1.06);
}

/* Re-apply the accent tints that the base rule above would otherwise flatten. */
.wealth-card {
  background-image:
    radial-gradient(circle at top right, rgba(21, 122, 110, .17), transparent 36%),
    radial-gradient(circle at bottom left, rgba(155, 123, 27, .19), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, 0) 46%);
}

.team-card {
  background-image:
    radial-gradient(circle at top right, rgba(46, 103, 177, .15), transparent 36%),
    radial-gradient(circle at bottom left, rgba(217, 139, 43, .17), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, 0) 46%);
}

.global-burn-card {
  background-image:
    radial-gradient(circle at top right, rgba(195, 81, 63, .17), transparent 36%),
    radial-gradient(circle at bottom left, rgba(217, 139, 43, .19), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, 0) 46%);
}

/* Warm hairline that catches the light along the top-left edge. */
.overview-card::after,
.action-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(155deg, rgba(201, 162, 39, .38), rgba(201, 162, 39, 0) 44%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* ---------- headings ---------- */

.card-head h2 {
  position: relative;
  padding-left: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.card-head h2::before {
  content: "";
  position: absolute;
  top: .18em;
  bottom: .18em;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pt-gold-lite), var(--pt-gold-deep));
}

.card-head p {
  color: var(--pt-label);
}

/* ---------- data wells ---------- */

.wealth-stats-grid div,
.wealth-countdown,
.global-burn-grid div,
.team-grid div,
.identity-meta div,
.identity-box,
.claim-row,
.history-row,
.history-toggle,
.directs-row,
.wealth-plan-option {
  border: 1px solid var(--pt-hairline);
  background: var(--pt-well);
  box-shadow: var(--pt-lift);
}

/* No uppercase here: the UI mixes CJK with brand casing such as "Community",
   which text-transform would mangle into "COMMUNITY". */
.wealth-stats-grid span,
.global-burn-grid span,
.team-grid span,
.identity-meta span,
.history-row span {
  color: var(--pt-label);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .01em;
}

/* Values line up across rows and read as figures, not prose. */
.wealth-stats-grid strong,
.wealth-countdown strong,
.global-burn-grid strong,
.team-grid strong,
.identity-meta strong,
.reward-number,
.directs-volume {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: #171310;
  letter-spacing: -.01em;
}

.reward-number {
  background: linear-gradient(150deg, #2a2118 12%, #8a6a1f 52%, #241d15 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}

.wealth-countdown strong {
  color: #191510;
}

/* ---------- plan selector ---------- */

.wealth-plan-option {
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.wealth-plan-option.is-active {
  background: linear-gradient(165deg, #2c2620, #16120d);
  border-color: rgba(0, 0, 0, .5);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .12) inset,
    0 10px 26px rgba(30, 22, 8, .3);
}

/* ---------- inputs ---------- */

.amount-input {
  border: 1px solid var(--pt-hairline-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 1px 2px rgba(62, 40, 16, .05) inset;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.amount-input:focus,
.amount-input:focus-visible {
  outline: none;
  border-color: rgba(192, 149, 55, .6);
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(192, 149, 55, .16),
    0 1px 2px rgba(62, 40, 16, .05) inset;
}

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

.primary-button {
  border: 1px solid rgba(0, 0, 0, .58);
  background: linear-gradient(165deg, #322a22, #17120d);
  color: #fdf6e6;
  font-weight: 800;
  letter-spacing: .01em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .14) inset,
    0 8px 20px rgba(30, 22, 8, .24);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.primary-button:hover:not(:disabled) {
  filter: brightness(1.09);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .18) inset,
    0 12px 26px rgba(30, 22, 8, .3);
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.primary-button:disabled {
  opacity: 1;
  border-color: rgba(30, 27, 24, .12);
  background: linear-gradient(180deg, rgba(30, 27, 24, .13), rgba(30, 27, 24, .1));
  color: rgba(30, 27, 24, .42);
  box-shadow: none;
}

.ghost-button {
  border-color: var(--pt-hairline-strong);
  background: rgba(255, 255, 255, .6);
  font-weight: 750;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.ghost-button:hover:not(:disabled) {
  border-color: rgba(192, 149, 55, .55);
  background: #fff;
}

.direct-view-btn {
  background: linear-gradient(165deg, #322a22, #17120d);
  border-color: rgba(0, 0, 0, .55);
  box-shadow: 0 6px 14px rgba(30, 22, 8, .22);
}

/* ---------- bottom navigation ---------- */

/* Kept close to opaque: the bar floats over scrolling content, and a more
   translucent fill let text show through behind the labels. */
.tab-bar {
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 24px;
  background: rgba(255, 250, 242, .96);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 -1px 0 rgba(30, 27, 24, .04) inset,
    0 20px 50px rgba(62, 40, 16, .18);
  backdrop-filter: blur(26px) saturate(1.1);
}

.tab-button {
  border-radius: 17px;
  font-weight: 700;
  transition: color .18s ease, background .18s ease;
}

.tab-button.is-active {
  background: linear-gradient(165deg, #322a22, #16120d);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .14) inset,
    0 8px 20px rgba(30, 22, 8, .26);
}

/* ---------- wallet gate ---------- */

.wallet-gate {
  background: rgba(244, 237, 224, .74);
  backdrop-filter: blur(18px) saturate(1.05);
}

.wallet-gate-card {
  border: 1px solid var(--pt-hairline);
  border-radius: 26px;
  background-color: rgba(255, 252, 246, .96);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 42%);
  box-shadow: var(--pt-lift-lg);
}

.wallet-gate-card h2 {
  letter-spacing: -.02em;
}

/* ---------- toast ---------- */

.status-toast {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(38, 32, 26, .95), rgba(18, 15, 11, .95));
  box-shadow: 0 18px 44px rgba(30, 22, 8, .34);
}

/* ---------- swap panel ---------- */

.swap-panel {
  box-shadow: var(--pt-lift);
}

.swap-field {
  border-color: var(--pt-hairline-strong);
  background: var(--pt-well);
}

.swap-action {
  letter-spacing: .01em;
}

/* ---------- desktop affordances ---------- */

@media (hover: hover) and (pointer: fine) {
  .action-card,
  .overview-card {
    transition: transform .22s ease, box-shadow .22s ease;
  }

  .action-card:hover,
  .overview-card:hover {
    transform: translateY(-2px);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, .92) inset,
      0 4px 10px rgba(62, 40, 16, .06),
      0 30px 66px rgba(62, 40, 16, .14);
  }
}

@media (prefers-reduced-motion: reduce) {
  .action-card,
  .overview-card,
  .primary-button,
  .ghost-button,
  .wealth-plan-option {
    transition: none;
  }
}
