/* Local refinement: preserve the existing N-Pulse palette and layout. */
:root { --ease-ui: cubic-bezier(.23,1,.32,1); }
::selection { background: var(--gold); color: #101010; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 4px;
}
button:disabled { opacity: .5; cursor: not-allowed; }
.tab, .nav-btn, .hero-primary, .hero-action, .mini-generate, .send-btn,
.theme-choice, .emoji-choice, .sheet-close, .sheet-x, .heart, .icon-btn {
  transition: transform 140ms var(--ease-ui), background-color 160ms ease, color 160ms ease;
}
button:active:not(:disabled) { transform: scale(.97); }
.sheet { transition: transform 260ms cubic-bezier(.32,.72,0,1); visibility: hidden; }
.sheet.active { visibility: visible; }
.overlay { transition: opacity 180ms ease-out; }
.hero-kicker, .hero-grid { display: none; }
.hero-top { justify-content: flex-end; }
.grad { color: var(--gold); background: none; -webkit-text-fill-color: currentColor; }
.tab:not(.active), .nav-btn:not(.active) { color: #b8b4ad; }
.sec-name, .cat-head > span, .card-meta, .card-sub,
.profile-link-tx small, .settings-title, .wallet-sub { color: #b8b4ad; }
.hero-copy p { color: #d6d1c7; line-height: 1.5; }
.tab { min-height: 44px; }
.heart, .icon-btn, .sheet-x, .lightbox-close, .lightbox-tools button { min-width: 44px; min-height: 44px; }
.hero-action, .hero-primary { min-height: 44px; }
.card { border-radius: 16px; }
.card-title { line-height: 1.3; }
.nav { box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.nav-btn.active { box-shadow: 0 4px 12px rgba(0,0,0,.22); }
.guide-sheet { scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
@media (hover:hover) and (pointer:fine) {
  .hero-action:hover, .tab:not(.active):hover, .nav-btn:not(.active):hover { background-color: rgba(255,255,255,.08); }
  .mini-generate:hover, .send-btn:hover, .hero-primary:hover { filter: brightness(1.06); }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .sheet, .overlay, button, .spot-video { transition: none !important; }
}

/* A shared moving highlight keeps the selected state spatially continuous. */
.tabs, .theme-grid { position: relative; isolation: isolate; }
.nav { isolation: isolate; }
.tabs > button, .theme-grid > button, .nav > button { position: relative; z-index: 1; }
.moving-highlight {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0;
  border-radius: 999px; background: var(--gold);
  transition: transform 280ms cubic-bezier(.32,.72,0,1), width 280ms cubic-bezier(.32,.72,0,1), height 280ms cubic-bezier(.32,.72,0,1), background-color 200ms ease;
}
.theme-grid > .moving-highlight { background: rgba(255,255,255,.045); border: 1.5px solid var(--gold); border-radius: 16px; }
.nav > .moving-highlight { background: linear-gradient(135deg,var(--cta-1),var(--cta-2)); border-radius: 20px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.tabs .tab.active, .nav .nav-btn.active { background: transparent !important; box-shadow: none !important; }
#view-profile .theme-choice.active { border-color: transparent; box-shadow: none; background: transparent; }
.nav .nav-btn.active::before, .nav .nav-btn.active::after { display: none; }
@keyframes balanceArrive {
  from { opacity: .25; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
#view-pay.active .wallet, #view-profile.active .profile-head { animation: balanceArrive 320ms var(--ease-ui) both; }
#view-pay.active .pack { animation: balanceArrive 380ms var(--ease-ui) both; }
#view-pay.active .pack:nth-child(2) { animation-delay: 60ms; }
#view-pay.active .pack:nth-child(3) { animation-delay: 120ms; }
#view-pay.active .pack:nth-child(4) { animation-delay: 180ms; }
#view-pay.active .pack:nth-child(5) { animation-delay: 240ms; }
@media (prefers-reduced-motion:reduce) { .moving-highlight { transition: none; } }
.hero-count strong { font-variant-numeric: tabular-nums; }
#payBalance { font-variant-numeric: tabular-nums; }
#payBalance.balance-loading { display: inline-flex; align-items: center; gap: 4px; min-height: 1em; }
#payBalance.balance-loading > span { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: balanceDot 1100ms ease-in-out infinite; }
#payBalance.balance-loading > span:nth-child(2) { animation-delay: 140ms; }
#payBalance.balance-loading > span:nth-child(3) { animation-delay: 280ms; }
@keyframes balanceDot { 0%, 70%, 100% { opacity: .4; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-4px); } }
.pack { transition: transform 160ms var(--ease-ui), border-color 180ms ease; }
.pack:active { transform: scale(.985); }

/* N-PULSE 2026 visual pass: quiet surfaces, expressive feedback. */
:root {
  --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-standard: cubic-bezier(.2, .8, .2, 1);
  --view-shift: 14px;
  --rose-light: #ff8db3;
}

.topbar,
.balance,
.card,
.nav,
.hero,
.profile-head,
.wallet,
.pack,
.tab {
  transition: border-color 260ms ease, box-shadow 260ms ease, color 260ms ease, background-color 260ms ease;
}

.hero {
  border-radius: 26px;
  box-shadow: inset 0 1px 0 rgba(255,244,216,.18), 0 24px 56px rgba(0,0,0,.48);
}

.card {
  border-radius: 18px;
  border-color: rgba(255,250,238,.10);
  box-shadow: 0 14px 34px rgba(0,0,0,.38);
  transition: transform 220ms var(--ease-out-expo), border-color 220ms ease, box-shadow 220ms ease;
}
.card-media,
.card::after { border-radius: 18px; }
.card:active {
  transform: scale(.982);
  border-color: rgba(255,244,216,.20);
  box-shadow: 0 10px 26px rgba(0,0,0,.34);
}
.card-title { line-height: 1.22; letter-spacing: -.025em; }
.card-media img { transition: opacity 360ms ease, transform 600ms var(--ease-out-expo); }

.cat-head { align-items: center; padding-bottom: 14px; }
.cat-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  line-height: 1.15;
}
.cat-title-text { min-width: 0; text-wrap: balance; }

.category-sticker-wrap {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: var(--gold);
  background: linear-gradient(145deg, rgba(255,255,255,.09), var(--accent-soft));
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 5px 14px rgba(0,0,0,.24);
}
.category-sticker {
  width: 19px;
  height: 19px;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.24));
}
.category-sticker .sticker-core,
.category-sticker .sticker-shine,
.category-sticker .sticker-reel {
  transform-box: fill-box;
  transform-origin: center;
}
.sec-name { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.sec-name .category-sticker-wrap {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
}
.sec-name .category-sticker { width: 14px; height: 14px; }
.sec-chip .sticker-flame { color: #ffab78; }
.category .sticker-flame,
.category .sticker-pumpkin { color: #ffad72; }

.category.is-visible .sticker-spark .sticker-core { animation: stickerSpark 3.4s var(--ease-standard) infinite; }
.category.is-visible .sticker-spark .sticker-shine,
.category.is-visible .sticker-luxury .sticker-shine { animation: stickerGlimmer 2.8s ease-in-out infinite; }
.category.is-visible .sticker-flame .sticker-core { animation: stickerFlame 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.category.is-visible .sticker-video .sticker-shine,
.category.is-visible .sticker-cinema .sticker-shine { animation: stickerPlay 2.8s var(--ease-standard) infinite; }
.category.is-visible .sticker-shield .sticker-core { animation: stickerShield 4s var(--ease-standard) infinite; }
.category.is-visible .sticker-reel { animation: stickerReel 5s linear infinite; }
.category.is-visible .sticker-pumpkin .sticker-core { animation: stickerSway 3.2s ease-in-out infinite; transform-origin: 50% 85%; }
.category.is-visible .sticker-nature .sticker-core,
.category.is-visible .sticker-flower .sticker-core { animation: stickerSway 4.4s ease-in-out infinite; transform-origin: 50% 90%; }
.category.is-visible .sticker-travel { animation: stickerFloat 3.8s ease-in-out infinite; }
.category.is-visible .sticker-kids .sticker-core { animation: stickerFloat 3.8s ease-in-out infinite; }
.category.is-visible .sticker-sea .sticker-core { animation: stickerWave 3.6s ease-in-out infinite; }
.category.is-visible .sticker-memory .sticker-shine { animation: stickerFlame 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
.category.is-visible .sticker-auto .sticker-shine { animation: stickerGlimmer 3s ease-in-out infinite; }
.category.is-visible .sticker-studio .sticker-shine { animation: stickerReel 8s linear infinite; }

@keyframes stickerSpark { 0%,62%,100% { transform: rotate(0) scale(1); } 20% { transform: rotate(16deg) scale(1.09); } 38% { transform: rotate(-6deg) scale(1); } }
@keyframes stickerGlimmer { 0%,100% { opacity: .45; transform: scale(.86); } 45% { opacity: 1; transform: scale(1.08); } }
@keyframes stickerFlame { 0%,100% { transform: scale(1,1) rotate(0); } 35% { transform: scale(.96,1.07) rotate(-2deg); } 68% { transform: scale(1.03,.97) rotate(2deg); } }
@keyframes stickerPlay { 0%,62%,100% { transform: scale(1); opacity: 1; } 24% { transform: scale(1.18); opacity: .76; } 42% { transform: scale(1); opacity: 1; } }
@keyframes stickerShield { 0%,68%,100% { transform: rotate(0); } 24% { transform: rotate(-5deg); } 42% { transform: rotate(4deg); } }
@keyframes stickerReel { to { transform: rotate(360deg); } }
@keyframes stickerSway { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(3deg); } }
@keyframes stickerFloat { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.4px) rotate(2deg); } }
@keyframes stickerWave { 0%,100% { transform: translateX(-.7px); } 50% { transform: translateX(.7px); } }

.mini-generate {
  min-height: 32px;
  background: linear-gradient(135deg, var(--cta-1), var(--cta-2));
  box-shadow: 0 7px 18px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.62);
}
.card-cost { box-shadow: inset 0 0 0 1px var(--line-strong); }

.tabs .moving-highlight,
.nav > .moving-highlight {
  background: linear-gradient(135deg, var(--cta-1), var(--cta-2) 62%, var(--cta-3));
  box-shadow: 0 8px 22px var(--cta-glow), inset 0 1px 0 rgba(255,255,255,.68);
}
.moving-highlight { transition: none; }
.tab { font-weight: 650; }
.tab.active,
.nav-btn.active { color: #141210; }
.nav {
  border-radius: 26px;
  background: rgba(13,13,13,.84);
  border-color: rgba(255,250,238,.12);
  box-shadow: 0 18px 48px rgba(0,0,0,.54), inset 0 1px 0 rgba(255,255,255,.07);
}
.nav-btn { transition: color 180ms ease, transform 160ms var(--ease-out-expo); }
.nav-btn svg { transition: transform 260ms var(--ease-out-expo), opacity 180ms ease; }
.nav-btn:not(.active) svg { opacity: .76; }
.nav-btn.active svg { transform: translateY(-1px) scale(1.08); }
.nav-btn span { transition: transform 260ms var(--ease-out-expo); }
.nav-btn.active span { transform: translateY(-.5px); }

.view.active { animation: refinedViewIn 340ms var(--ease-out-expo) both; }
@keyframes refinedViewIn {
  from { opacity: .25; transform: translate3d(var(--view-shift),0,0); filter: blur(3px); }
  to { opacity: 1; transform: translate3d(0,0,0); filter: blur(0); }
}

.sheet {
  transition: transform 380ms var(--ease-out-expo), visibility 380ms;
}
.sheet::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  transform: translateX(-50%);
}
.sheet-close { margin-top: 7px; }
.sheet.active .sheet-card { animation: sheetCardIn 420ms var(--ease-out-expo) 60ms both; }
.sheet.active .sheet-actions { animation: sheetActionsIn 360ms var(--ease-out-expo) 110ms both; }
@keyframes sheetCardIn {
  from { opacity: .2; transform: translateY(14px) scale(.975); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes sheetActionsIn {
  from { opacity: 0; transform: translate(-50%,10px); }
  to { opacity: 1; transform: translate(-50%,0); }
}

.card .heart {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  top: 10px;
  right: 10px;
  padding: 0;
  border-radius: 50%;
  color: rgba(255,255,255,.92);
  background: rgba(12,10,12,.52);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 6px 18px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.10);
  overflow: visible;
}
.card .heart::before { inset: -5px; }
.heart-icon {
  width: 18px;
  height: 18px;
  display: block;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill 180ms ease, stroke 180ms ease, transform 180ms var(--ease-out-expo);
}
.heart.on {
  color: var(--rose-light);
  background: rgba(62,18,35,.66);
  border-color: rgba(255,112,158,.38);
  box-shadow: 0 7px 20px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.12);
  animation: none;
}
.heart.on .heart-icon { fill: currentColor; stroke: var(--rose); }
.heart.is-bursting { animation: favoriteButton 460ms var(--ease-out-expo) both; }
.heart.is-bursting .heart-icon { animation: favoriteHeart 480ms var(--ease-out-expo) both; }
.heart::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 1.5px solid var(--rose-light);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}
.heart.is-bursting::after { animation: favoriteRing 520ms var(--ease-out-expo) both; }
.heart-burst { position: absolute; inset: 50%; z-index: 8; pointer-events: none; }
.heart-burst i {
  --angle: 0deg;
  position: absolute;
  width: 4px;
  height: 4px;
  margin: -2px;
  border-radius: 50%;
  background: var(--rose-light);
  box-shadow: 0 2px 5px rgba(0,0,0,.20);
  animation: favoriteParticle 540ms var(--ease-out-expo) both;
}
.heart-burst i:nth-child(2n) { width: 3px; height: 3px; background: var(--cta-2); }
.heart-burst i:nth-child(1) { --angle: 0deg; }
.heart-burst i:nth-child(2) { --angle: 60deg; }
.heart-burst i:nth-child(3) { --angle: 120deg; }
.heart-burst i:nth-child(4) { --angle: 180deg; }
.heart-burst i:nth-child(5) { --angle: 240deg; }
.heart-burst i:nth-child(6) { --angle: 300deg; }
@keyframes favoriteButton { 0% { transform: scale(.84); } 44% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes favoriteHeart { 0% { transform: scale(.55) rotate(-8deg); } 46% { transform: scale(1.22) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes favoriteRing { 0% { opacity: .65; transform: scale(.75); } 100% { opacity: 0; transform: scale(1.8); } }
@keyframes favoriteParticle {
  0% { opacity: 0; transform: rotate(var(--angle)) translateY(-7px) scale(.4); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--angle)) translateY(-27px) scale(0); }
}
#sheetHeart {
  position: relative;
  inset: auto;
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  border-radius: 17px;
}
#sheetHeart .heart-icon { width: 22px; height: 22px; }

.toast {
  left: 50%;
  right: auto;
  top: calc(74px + env(safe-area-inset-top));
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--mint);
  background: rgba(17,16,14,.92);
  border-color: var(--line-strong);
  box-shadow: 0 14px 38px rgba(0,0,0,.44);
  transform: translate(-50%,-12px) scale(.96);
  transition: opacity 200ms ease, transform 280ms var(--ease-out-expo);
}
.toast.active { transform: translate(-50%,0) scale(1); }

@media (hover:hover) and (pointer:fine) {
  .card:hover { transform: translateY(-3px); border-color: rgba(255,244,216,.18); box-shadow: 0 20px 42px rgba(0,0,0,.42); }
  .card:hover .card-media img { transform: scale(1.025); }
  .heart:hover { border-color: rgba(255,141,179,.46); color: var(--rose-light); }
  .sec-chip:hover .sec-ring { transform: translateY(-2px); }
}
.sec-ring { transition: transform 240ms var(--ease-out-expo); }

.nav-btn,
.hero-rec,
.pass-kicker,
.pass-tier,
.pass-label,
.settings-title,
.stat span { font-size: 11px; }
.cat-head > span,
.cat-all,
.hero-live,
.hero-count span { font-size: 12px; }
.profile-badge { padding: 12px; }

@media (max-width: 370px) {
  .category-sticker-wrap { width: 28px; height: 28px; flex-basis: 28px; }
  .cat-head h2 { gap: 7px; }
  .card .heart { width: 34px; height: 34px; min-width: 34px; min-height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .view.active { animation: reducedViewIn 160ms ease both !important; }
  .sheet.active .sheet-card,
  .sheet.active .sheet-actions { animation: none; }
  .category-sticker,
  .category-sticker * { animation: none !important; }
  .heart.is-bursting,
  .heart.is-bursting .heart-icon { animation: reducedFavorite 180ms ease both !important; }
  .heart.is-bursting::after,
  .heart-burst { display: none; }
  .card:hover,
  .card:hover .card-media img,
  .nav-btn.active svg,
  .nav-btn.active span { transform: none; }
  .toast,
  .toast.active { transition: opacity 120ms ease; }
}
@keyframes reducedViewIn { from { opacity: .55; } to { opacity: 1; } }
@keyframes reducedFavorite { from { opacity: .55; } to { opacity: 1; } }

/* Preserve the requested compact favorite size. */
.card .heart { width:32px; height:32px; min-width:32px; min-height:32px; }
.card .heart::before { inset:-6px; }

/* Keep words intact in template names. */
.card-title { -webkit-hyphens:none; hyphens:none; overflow-wrap:normal; word-break:normal; }

/* Readable category hierarchy; legacy .cat-head span must not shrink titles. */
.cat-head h2 { font-size:1.375rem; font-weight:700; line-height:1.2; color:#fff4d8; gap:10px; }
.cat-head h2 .cat-title-text { font-size:inherit; font-weight:inherit; line-height:inherit; color:inherit; letter-spacing:-.015em; }
.cat-head > span, .cat-head .cat-all { font-size:.8125rem; line-height:1.35; color:#b8b4ad; }
.cat-head h2 .category-sticker-wrap { width:34px; height:34px; flex-basis:34px; color:var(--gold); }
.cat-head h2 .category-sticker { width:22px; height:22px; }
.sec-name { font-size:.8125rem; font-weight:600; line-height:1.25; }
@media(max-width:370px) { .cat-head h2 { font-size:1.25rem; gap:8px; } }

/* Slightly calmer category headings, including narrow phones. */
.cat-head h2 { font-size:1.125rem; gap:8px; }
.cat-head h2 .category-sticker-wrap { width:30px; height:30px; flex-basis:30px; }
.cat-head h2 .category-sticker { width:19px; height:19px; }
