/* ==========================================================================
   Loading screen, scroll-cinema hero, and per-launchpad subdomain view.
   Extends styles.css. Same theme lock (dark) and accent (--accent green).
   ========================================================================== */

/* -------------------------- loading screen ----------------------------- */
#loader {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background:
    radial-gradient(60vw 50vh at 50% 42%, rgba(0, 200, 5, 0.10), transparent 60%),
    var(--bg);
  transition: opacity .55s ease, visibility .55s ease;
}
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-core { display: grid; place-items: center; gap: 22px; }
.loader-ring {
  position: relative; width: 96px; height: 96px; display: grid; place-items: center;
}
/* lime-green sweeping ring (Robinhood green -> bright lime) */
.loader-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 22%, #00c805 55%, #7dff3a 78%, transparent 92%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  animation: ring-spin 1s linear infinite;
}
.loader-ring::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  box-shadow: 0 0 34px rgba(0, 200, 5, 0.45); opacity: .8;
  animation: ring-pulse 1.6s ease-in-out infinite;
}
.loader-mark {
  width: 52px; height: 52px; border-radius: 15px; overflow: hidden; display: grid; place-items: center;
  animation: mark-breathe 1.6s ease-in-out infinite; z-index: 1;
}
.loader-mark img { width: 100%; height: 100%; display: block; }
.loader-word { font-weight: 700; letter-spacing: -0.02em; font-size: 15px; }
.loader-word .fun { color: var(--accent); }
.loader-bar { width: 172px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.loader-bar i {
  display: block; height: 100%; width: 40%; border-radius: 3px;
  background: linear-gradient(90deg, #00c805, #7dff3a);
  animation: bar-slide 1.15s cubic-bezier(.65,0,.35,1) infinite;
}
@keyframes ring-spin { to { transform: rotate(360deg); } }
@keyframes ring-pulse { 0%,100% { opacity: .35; } 50% { opacity: .9; } }
@keyframes mark-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes bar-slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(360%); } }

/* --------------------------- cinema hero ------------------------------- */
/* Track is tall; stage pins. Film scrubs on desktop, plays on mobile,
   or falls back to the static hero when no film is loaded. */
.cinema-track { position: relative; }
.cinema-track.scrub { height: 360vh; }        /* ~30vh per film-second */
.cinema-track.chapters { height: auto; }
.cinema-stage {
  position: sticky; top: 0; height: 100dvh; overflow: hidden;
  display: grid; place-items: center; background: #05060700;
}
.cinema-stage video, .cinema-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
.cinema-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8,9,11,0.55) 0%, transparent 26%, transparent 55%, rgba(8,9,11,0.82) 100%),
    radial-gradient(70vw 50vh at 50% 60%, transparent 40%, rgba(8,9,11,0.35));
}
.cinema-overlays { position: relative; z-index: 2; width: 100%; max-width: var(--maxw); padding: 0 24px; }
.cine-act {
  position: absolute; left: 24px; right: 24px; bottom: 16vh; opacity: 0; will-change: opacity, transform;
}
/* backing plate flies in with the text so copy is always legible over the film */
.cine-plate {
  display: inline-block; max-width: min(58ch, 92%);
  padding: 22px 28px 24px; border-radius: 18px;
  background: rgba(6, 8, 10, 0.62);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid rgba(0, 200, 5, 0.20);
  border-left: 3px solid var(--accent);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.cine-act h2 {
  font-size: clamp(30px, 5vw, 64px); line-height: 0.98; letter-spacing: -0.04em; font-weight: 800;
  max-width: 15ch; color: #f4f7f9; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}
.cine-act p { color: var(--text); opacity: 0.86; font-size: clamp(15px, 1.8vw, 20px); margin-top: 13px; max-width: 44ch; }
.cine-act .hl { color: var(--accent); }

/* solid fallback when the viewer disables transparency */
@media (prefers-reduced-transparency: reduce) {
  .cine-plate { background: rgba(6, 8, 10, 0.94); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.cinema-cta {
  position: absolute; z-index: 3; left: 50%; bottom: 8vh; transform: translateX(-50%);
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; opacity: 0;
  transition: opacity .35s ease;
}
.cinema-cta.show { opacity: 1; }
.cine-progress {
  position: absolute; z-index: 3; left: 50%; bottom: 3.5vh; transform: translateX(-50%);
  width: 120px; height: 2px; background: var(--line-soft); border-radius: 2px; overflow: hidden;
}
.cine-progress i { display: block; height: 100%; width: 0; background: var(--accent); }
.scroll-hint {
  position: absolute; z-index: 3; left: 50%; bottom: 3.5vh; transform: translateX(-50%);
  color: var(--text-faint); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  animation: hint 2s ease-in-out infinite;
}
@keyframes hint { 0%,100% { opacity: .4; } 50% { opacity: .9; } }

/* mobile chapter tier: stacked, native-playing looping videos crossfaded */
.chapter { position: relative; height: 100dvh; }
.chapter video { position: sticky; top: 0; }

/* ------------------------- launchpad subdomain ------------------------- */
.lp-hero { padding: 60px 0 30px; }
.lp-badge {
  display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600;
  color: var(--text-dim); border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 6px 13px; margin-bottom: 20px;
}
.lp-badge b { color: var(--accent); }
.lp-hero h1 { font-size: clamp(36px, 6vw, 64px); letter-spacing: -0.035em; line-height: 1.02; font-weight: 800; }
.lp-hero .lp-sub { color: var(--text-dim); font-size: 18px; margin: 18px 0 26px; max-width: 54ch; }
.lp-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 30px; }
.lp-stats .m b { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.lp-stats .m span { display: block; color: var(--text-faint); font-size: 12.5px; margin-top: 2px; }
.subdomain-link { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.subdomain-link a:hover { color: var(--accent); }

/* ------------------------------ bridge -------------------------------- */
.bridge-shell { max-width: 480px; margin: 0 auto; }
.bridge-widget { display: flex; justify-content: center; }
.bridge-frame {
  width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); display: block;
}
.bridge-loading { max-width: 480px; margin: 0 auto; }
.bridge-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 30px; text-align: center;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
}
.bridge-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  color: var(--text-dim); border: 1px solid var(--line); background: var(--bg-2);
  border-radius: 999px; padding: 5px 12px; margin-bottom: 16px;
}
.bridge-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.bridge-card h3 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 18px; }
.bridge-card p { color: var(--text-dim); font-size: 14px; }
.bridge-card .btn { margin-top: 4px; }
.brg-form { text-align: left; display: grid; gap: 14px; }
.brg-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.brg-field { display: grid; gap: 6px; }
.brg-field > span { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.brg-field select, .brg-field input {
  font: inherit; font-size: 15px; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px 13px; width: 100%;
}
.brg-field input:focus, .brg-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,200,5,0.15); }
.brg-arrow { text-align: center; color: var(--accent); font-size: 18px; margin: -4px 0; }
.brg-receive {
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 14px 15px; background: var(--bg-2);
  display: grid; gap: 3px;
}
.brg-receive > span { font-size: 12px; color: var(--text-faint); }
.brg-receive b { font-family: var(--mono); font-size: 20px; letter-spacing: -0.02em; }
.brg-receive small { color: var(--text-dim); font-size: 12px; }

/* --------------------------- balances --------------------------------- */
.bal-chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12.5px; color: var(--text-dim); font-family: var(--mono);
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 6px 12px;
}
.bal-chip b { color: var(--text); font-weight: 600; }
.bal-chip span { color: var(--text-faint); }
@media (max-width: 780px) { .bal-chip { display: none; } }

/* inline "Balance: x  [MAX]" row above an amount input */
.bal-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--text-faint); margin-bottom: 6px;
}
.bal-row .bal-val { font-family: var(--mono); color: var(--text-dim); }
.bal-row button {
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  background: none; border: 1px solid var(--line); color: var(--accent);
  border-radius: 999px; padding: 2px 9px; cursor: pointer;
}
.bal-row button:hover { border-color: var(--accent); background: rgba(0,200,5,.08); }

/* --------------------------- beta badge ------------------------------- */
.beta-badge {
  position: fixed; left: 14px; bottom: 14px; z-index: 70;
  display: flex; align-items: center; gap: 8px;
  background: rgba(13, 15, 18, 0.9); backdrop-filter: blur(10px);
  border: 1px solid var(--warn); border-radius: 999px; padding: 7px 8px 7px 13px;
  font-size: 12px; font-weight: 600; color: var(--warn); box-shadow: var(--shadow);
}
.beta-badge button {
  background: none; border: 0; color: var(--text-faint); font-size: 16px; line-height: 1;
  cursor: pointer; padding: 0 4px; border-radius: 6px;
}
.beta-badge button:hover { color: var(--text); }
.beta-badge.hidden { display: none; }
@media (max-width: 600px) { .beta-badge { left: 10px; bottom: 10px; font-size: 11px; } }

/* --------------------------- logo upload ------------------------------ */
.logo-field { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.logo-drop {
  width: 76px; height: 76px; flex: 0 0 auto; border-radius: 16px; cursor: pointer;
  border: 1.5px dashed var(--line); background: var(--bg-2); overflow: hidden;
  display: grid; place-items: center; color: var(--text-faint); text-align: center;
  font-size: 22px; line-height: 1.1; transition: border-color .15s, background .15s;
}
.logo-drop small { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.logo-drop:hover, .logo-drop:focus, .logo-drop.drag { border-color: var(--accent); color: var(--accent); outline: none; }
.logo-drop.has-img { border-style: solid; border-color: var(--line); }
.logo-drop img { width: 100%; height: 100%; object-fit: cover; }
.logo-field-txt { flex: 1; min-width: 0; }
.logo-field-txt .lab { font-size: 13px; font-weight: 600; }
.logo-actions { display: flex; gap: 8px; margin: 8px 0 6px; }

/* launcher logo avatar used across cards / feed / launchpad / nav */
.lo {
  border-radius: 10px; overflow: hidden; flex: 0 0 auto; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center;
  font-weight: 800; color: var(--accent);
}
.lo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lo.lo-40 { width: 40px; height: 40px; font-size: 16px; }
.lo.lo-30 { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
.lo.lo-56 { width: 56px; height: 56px; font-size: 22px; border-radius: 14px; }

/* --------------------------- token trading ---------------------------- */
.tk-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.tk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.tk-stat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-2); }
.tk-stat span { display: block; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.tk-stat b { font-family: var(--mono); font-size: 15px; letter-spacing: -0.01em; display: block; }
.tk-stat b i { font-style: normal; font-size: 10px; color: var(--text-faint); margin-left: 4px; letter-spacing: 0; }
.tk-chart { min-height: 220px; }
.price-chart { width: 100%; height: 220px; display: block; }
.chart-empty { height: 200px; display: grid; place-items: center; color: var(--text-faint); border: 1px dashed var(--line); border-radius: 10px; }

.swap-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--bg-2); padding: 4px; border-radius: 12px; }
.swap-tab { flex: 1; font: inherit; font-weight: 700; font-size: 14px; padding: 9px; border: 0; border-radius: 9px; background: none; color: var(--text-dim); cursor: pointer; transition: background .15s, color .15s; }
.swap-tab.active { background: var(--accent); color: var(--accent-ink); }
.swap-tab[data-side="sell"].active { background: var(--danger); color: #fff; }
.sw-out { border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px 14px; background: var(--bg-2); font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }
.sw-out b { color: var(--text); font-family: var(--mono); font-size: 16px; }
.sw-slip { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-faint); margin-bottom: 14px; }
.sw-slip select { width: auto; padding: 5px 8px; font-size: 12.5px; }

.trade-row { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.trade-row:last-child { border-bottom: 0; }
.trade-row .side { font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.trade-row.buy .side { color: var(--accent); background: rgba(0,200,5,0.1); }
.trade-row.sell .side { color: var(--danger); background: rgba(255,84,112,0.1); }
.trade-row .amt { font-size: 12.5px; text-align: right; }
.trade-row .who { color: var(--text-faint); font-size: 12px; text-align: right; }
.trade-row .who:hover { color: var(--accent); }

@media (max-width: 900px) { .tk-grid { grid-template-columns: 1fr; } .tk-stats { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------ social -------------------------------- */
/* live activity feed */
.feed { display: grid; gap: 10px; }
.feed-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface);
}
.feed-item .ic {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 14px; background: var(--surface-2); border: 1px solid var(--line);
}
.feed-item.launcher .ic { color: var(--accent); }
.feed-item.token .ic { color: #7dff3a; }
.feed-item.comment .ic { color: var(--text-dim); }
.feed-item .body { flex: 1; min-width: 0; font-size: 14px; }
.feed-item .body .who { font-weight: 600; }
.feed-item .body .sub { color: var(--text-faint); font-size: 12.5px; margin-top: 2px; word-break: break-word; }
.feed-item .body a { color: var(--accent); }

/* comment thread */
.comments { display: grid; gap: 0; }
.comment {
  display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft);
}
.comment:last-child { border-bottom: 0; }
.comment .av {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-2));
  border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--accent);
}
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: baseline; gap: 8px; }
.comment .c-head .nm { font-weight: 600; font-size: 13.5px; }
.comment .c-head .t { color: var(--text-faint); font-size: 12px; }
.comment .c-text { font-size: 14px; margin-top: 3px; color: var(--text); word-break: break-word; }
.comment .c-actions { margin-top: 7px; }
.like-btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 600;
  background: none; border: 1px solid var(--line); color: var(--text-dim); border-radius: 999px;
  padding: 4px 11px; cursor: pointer; transition: border-color .15s, color .15s, transform .08s;
}
.like-btn:hover { border-color: var(--accent); color: var(--accent); }
.like-btn:active { transform: scale(0.95); }
.like-btn.liked { border-color: var(--accent); color: var(--accent); background: rgba(0,200,5,0.08); }

.comment-box { display: grid; gap: 10px; margin-top: 18px; }
.comment-box .cb-row { display: flex; gap: 10px; }
.comment-box textarea {
  font: inherit; font-size: 14px; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 11px 13px; width: 100%;
  resize: vertical; min-height: 46px; max-height: 160px;
}
.comment-box textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,200,5,0.15); }
.comment-box .cb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comment-box .cb-foot .count { color: var(--text-faint); font-size: 12px; }

.name-chip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim);
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.name-chip:hover { border-color: var(--accent); color: var(--accent); }
.name-chip b { color: var(--text); }

/* token detail */
.detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.detail-head .sym-lg {
  width: 54px; height: 54px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 800; font-size: 20px; color: var(--accent); overflow: hidden; flex: 0 0 auto;
}
.detail-head h2 { font-size: 26px; letter-spacing: -0.02em; }
.detail-head .addr { margin-top: 2px; }

@media (max-width: 900px) {
  .cinema-track.scrub { height: auto; }   /* JS switches to chapters/static on touch */
  .cine-act { bottom: 12vh; }
}
@media (prefers-reduced-motion: reduce) {
  .loader-ring::before, .loader-mark, .loader-bar i, .scroll-hint { animation: none; }
}
