/* =========================================================
   wow.css — ambient light, live tape, chart crosshair,
   price flashes, premium micro-interactions.
   ========================================================= */

/* ---------- app tabs: My Stonkling / Lobby / Market ---------- */
.app-tabs { display: flex; gap: 8px; margin: 22px 0 30px; padding: 5px; border-radius: 16px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.app-tabs button { flex: 1; font: 700 14px "Space Grotesk", sans-serif; color: var(--muted); background: none;
  border: 1px solid transparent; border-radius: 12px; padding: 12px 10px; cursor: pointer; min-height: 44px;
  transition: background .2s ease, color .2s ease, border-color .2s ease; }
.app-tabs button:hover { color: var(--text); }
.app-tabs button.on { color: var(--text); background: rgba(124,92,255,.16); border-color: rgba(124,92,255,.5); box-shadow: inset 0 0 0 1px rgba(124,92,255,.25); }
.tab-panel[hidden] { display: none; }
@media (max-width: 640px) { .app-tabs { margin: 14px 0 20px; } .app-tabs button { font-size: 12.5px; padding: 11px 4px; } }

/* ---------- ambient: market grid + film grain + scroll progress ----------
   a trading-chart grid instead of a soft gradient-blob "aurora": on theme (this is a market app),
   distinctive rather than a generic dark-hero glow, and cheap (a static background-image, no blur). */
.aurora { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
  background-image: linear-gradient(rgba(124,92,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(61,214,245,.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 40%, transparent 100%); }
/* a scatter of quiet ticks of light drifting through the grid, like distant data points — not a wallpaper.
   Richer than before (7 instead of 3) but still just opacity+transform on 3px dots: cheap at any count. */
.aurora i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: 0; will-change: transform, opacity; animation: spark 15s ease-in-out infinite; }
.aurora i:nth-child(1) { left: 12%; top: 14%; box-shadow: 0 0 9px 2px rgba(124,92,255,.9); animation-delay: 0s; }
.aurora i:nth-child(2) { left: 64%; top: 18%; box-shadow: 0 0 9px 2px rgba(61,214,245,.9); animation-delay: -5s; }
.aurora i:nth-child(3) { left: 84%; top: 8%; box-shadow: 0 0 9px 2px rgba(61,220,151,.9); animation-delay: -10s; }
.aurora i:nth-child(4) { left: 33%; top: 28%; box-shadow: 0 0 8px 2px rgba(255,207,110,.85); animation-delay: -2.5s; animation-duration: 18s; }
.aurora i:nth-child(5) { left: 8%; top: 42%; box-shadow: 0 0 9px 2px rgba(61,214,245,.9); animation-delay: -12s; animation-duration: 13s; }
.aurora i:nth-child(6) { left: 92%; top: 34%; box-shadow: 0 0 8px 2px rgba(124,92,255,.9); animation-delay: -7.5s; animation-duration: 17s; }
.aurora i:nth-child(7) { left: 48%; top: 6%; box-shadow: 0 0 8px 2px rgba(61,220,151,.85); animation-delay: -15s; animation-duration: 14s; }
@keyframes spark { 0%, 100% { opacity: 0; transform: translateY(0); } 8% { opacity: .9; } 50% { opacity: .45; transform: translateY(46px); } 92% { opacity: .9; } }

/* real falling stars: a thin streak that shoots once every cycle then goes quiet for a long while —
   "richer but not too much", transform+opacity only, same recipe as the lobby's shooting star */
.aurora s { position: absolute; top: 6%; left: 15%; width: 130px; height: 2px; border-radius: 2px; opacity: 0;
  transform: rotate(-20deg); background: linear-gradient(90deg, rgba(255,255,255,0), #fff 70%, rgba(255,255,255,0));
  animation: auroraFall 17s ease-in 3s infinite; }
.aurora s:nth-child(9) { top: 4%; left: 55%; animation-delay: 10.5s; animation-duration: 21s; }
@keyframes auroraFall { 0% { opacity: 0; transform: translate(0, 0) rotate(-20deg); } 2% { opacity: 1; }
  9% { opacity: 0; transform: translate(340px, 150px) rotate(-20deg); } 100% { opacity: 0; } }
/* normal blending on purpose: a full-screen overlay-blend layer above everything forces the whole page to be
   re-blended on every scroll frame */
.grain { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .03;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.scroll-bar { position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 40; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--a1), var(--a2), #3ddc97); box-shadow: 0 0 12px rgba(61,214,245,.6); pointer-events: none; }

/* ---------- live ticker tape ---------- */
.tape { position: relative; z-index: 5; overflow: hidden; border-bottom: 1px solid var(--line); background: rgba(10, 12, 18, .72);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.tape-track { display: flex; width: max-content; animation: tape var(--tape-dur, 180s) linear infinite; }
.tape:hover .tape-track, .tape:focus-within .tape-track { animation-play-state: paused; }
@keyframes tape { to { transform: translateX(calc(-1 * var(--tape-w, 50%))); } }
.tp { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 18px; font-size: 12.5px; text-decoration: none; color: var(--text); white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.05); border-radius: 0; transition: background .2s; }
.tp:hover { background: rgba(255,255,255,.05); }
.tp b { font-family: "Space Grotesk", sans-serif; letter-spacing: .02em; }
.tp-p { color: #c3cad8; }
.tp-c { font-style: normal; font-size: 11.5px; }
.tp-c.up { color: var(--up); } .tp-c.down { color: var(--down); }

/* ---------- live indicator ---------- */
.live-val { display: inline-flex; align-items: center; gap: 8px; }
.live-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--up); box-shadow: 0 0 10px rgba(61,220,151,.8); flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--up); opacity: 0; animation: livePulse 2.4s ease-out infinite; }
.live-dot.stale { background: var(--gold); box-shadow: 0 0 10px rgba(244,178,74,.8); }
.live-dot.stale::after { border-color: var(--gold); }
.live-dot.beat { animation: beat .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes livePulse { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes beat { 40% { transform: scale(1.6); } }

/* ---------- price flashes on refresh ---------- */
[data-t] { position: relative; }
.flash-up::after, .flash-down::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: flash 1.8s ease-out forwards; }
.flash-up::after { background: rgba(61,220,151,.22); box-shadow: inset 0 0 0 1px rgba(61,220,151,.55); }
.flash-down::after { background: rgba(255,92,122,.2); box-shadow: inset 0 0 0 1px rgba(255,92,122,.55); }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- chart crosshair (hero 24h, diary) ---------- */
.timeline, .diary-body { position: relative; }
.diary-body { --c: #a594ff; }
#timeline, #diary-chart { cursor: crosshair; outline: none; touch-action: pan-y; }
#timeline:focus-visible, #diary-chart:focus-visible { box-shadow: 0 0 0 2px rgba(61,214,245,.5); border-radius: 6px; }
.xh, .xh-dot, .xh-tip { position: absolute; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 3; }
.xh { width: 1px; background: rgba(255,255,255,.4); transform: translateX(-.5px); }
.xh-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--a2)); box-shadow: 0 0 0 2px #0e1118, 0 0 14px var(--c, var(--a2)); transform: translate(-50%, -50%); }
.xh-tip { transform: translate(-50%, calc(-100% - 8px)); background: rgba(19,23,34,.96); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px;
  white-space: nowrap; box-shadow: 0 10px 30px rgba(0,0,0,.45); display: flex; flex-direction: column; line-height: 1.3; backdrop-filter: blur(6px); }
.xh-tip b { font: 700 14px "JetBrains Mono", monospace; color: var(--text); }
.xh-tip span { font-size: 11px; color: var(--muted); }
.xh-on .xh, .xh-on .xh-dot, .xh-on .xh-tip { opacity: 1; }
.end-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--a2)); transform: translate(-50%, -50%); pointer-events: none; z-index: 2;
  box-shadow: 0 0 0 2px #0e1118; transition: opacity .15s; }
.end-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid var(--c, var(--a2)); animation: livePulse 2.2s ease-out infinite; }
.xh-on .end-dot { opacity: 0; }

/* ---------- headings: masked rise + eyebrow rule ---------- */
.sec-head.reveal h2 { clip-path: inset(0 0 100% 0); transform: translateY(.45em); transition: clip-path 1.1s cubic-bezier(.2,.8,.2,1) .08s, transform 1.1s cubic-bezier(.2,.8,.2,1) .08s; }
.sec-head.reveal.in h2 { clip-path: inset(-10% -5% -20% -5%); transform: none; }
.sec-head .eyebrow { display: flex; align-items: center; gap: 12px; }
.sec-head .eyebrow::before { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, var(--a2), transparent); transform-origin: 0 50%; transform: scaleX(0); transition: transform .9s cubic-bezier(.2,.8,.2,1) .25s; }
.sec-head.reveal.in .eyebrow::before { transform: scaleX(1); }
h1 .grad { background-size: 220% auto; animation: shimmer 7s ease-in-out infinite; }
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ---------- buttons: sheen + magnetic ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; will-change: transform; }
.btn::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; transform: translateX(-120%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.btn:hover::after { transform: translateX(120%) skewX(-20deg); }
.btn.primary::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); z-index: 0; mix-blend-mode: soft-light; }
.btn.magnetic { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, background .2s, border-color .2s; }

/* ---------- cards: glowing border on hover ---------- */
.step, .phase, .kpis, .radar-side, .radar-feed, .oc-controls, .sim-controls, .input-card { --glow: 0; }
.step::before, .phase::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: conic-gradient(from var(--oc-a, 0deg), rgba(124,92,255,.9), rgba(61,214,245,.6), rgba(61,220,151,.5), rgba(124,92,255,.9));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ocSpin 5s linear infinite; }
.step:hover::before, .phase:hover::before { opacity: 1; }
.step, .phase { transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.step:hover, .phase:hover { transform: translateY(-4px); }
.phase { position: relative; }

/* ---------- line icons, drawn on reveal ---------- */
.step-top { display: flex; align-items: flex-start; justify-content: space-between; }
.ico { width: 30px; height: 30px; fill: none; stroke: var(--a2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.ph-ico { position: absolute; top: 18px; right: 18px; width: 22px; height: 22px; stroke: var(--muted); }
.phase.live .ph-ico { stroke: var(--up); }
.reveal .ico > * { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.6s cubic-bezier(.4,0,.2,1) .35s; }
.reveal.in .ico > * { stroke-dashoffset: 0; }
.pipeline .step:nth-child(2) .ico > * { transition-delay: .5s; }
.pipeline .step:nth-child(3) .ico > * { transition-delay: .65s; }
.pipeline .step:nth-child(4) .ico > * { transition-delay: .8s; }
.step:hover .ico { filter: drop-shadow(0 0 8px rgba(61,214,245,.6)); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .aurora i, .aurora s, h1 .grad, .live-dot::after, .end-dot::after, .step::before, .phase::before { animation: none !important; }
  .tape-track { animation: none; }
  .tape { overflow-x: auto; }
  .sec-head.reveal h2 { clip-path: none; transform: none; transition: none; }
  .reveal .ico > * { stroke-dashoffset: 0; transition: none; }
  .btn::after { display: none; }
}
@media (max-width: 720px) {
  .tp { padding: 7px 14px; font-size: 12px; }
}

/* ---------- company logos ---------- */
.tb.logo { background: none; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 4px 14px rgba(0,0,0,.35); border-radius: 50%; padding: 0; overflow: hidden; }
.tb { position: relative; overflow: hidden; }
.tb-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 50%; opacity: 0; transition: opacity .35s ease; }
.tb.logo .tb-img { opacity: 1; }
.tb.logo .tb-t { visibility: hidden; }
@keyframes logoIn { from { opacity: 0; transform: scale(.85); } }
.tp-logo { width: 16px; height: 16px; border-radius: 50%; align-self: center; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.tp { align-items: center; }

/* ---------- creature: evolution motion ---------- */
/* Motion on the whole SVG (compositor only): the lit, filtered body is rasterised once instead of every frame. */
.pet .bob, .pet .breathe { animation: none; }
svg.pet { animation: petBob 3s ease-in-out infinite; transform-origin: 50% 88%; will-change: transform; }
svg.pet.is-asleep { animation: petBreathe 4.4s ease-in-out infinite; }
@keyframes petBob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-2.6%) scale(.99, 1.01); } }
@keyframes petBreathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.018, .982); } }
.pet-stage.boop svg.pet { animation: squish .6s cubic-bezier(.3,1.5,.5,1); }
@media (prefers-reduced-motion: reduce) { svg.pet, svg.pet.is-asleep { animation: none; } }
.pet .wing-l { animation: flapL 2.8s ease-in-out infinite; }
.pet .wing-r { animation: flapR 2.8s ease-in-out infinite; }
@keyframes flapL { 50% { transform: rotate(-7deg); } }
@keyframes flapR { 50% { transform: rotate(7deg); } }
.pet .pedestal { animation: pedestal 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pedestal { 50% { opacity: .6; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .pet .wing-l, .pet .wing-r, .pet .pedestal { animation: none; } }
.mini-logo { width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; margin-right: 6px; box-shadow: 0 0 0 1px rgba(255,255,255,.08); flex: none; }
.alloc li .mini-logo { margin-right: 0; }
.slider-row { grid-template-columns: 88px 1fr 44px 64px 20px; }
@media (max-width: 720px) { .slider-row { grid-template-columns: 76px 1fr 40px 58px 18px; } }
.slider-row b { display: inline-flex; align-items: center; white-space: nowrap; }

/* ---------- companion: tabs + my portfolio ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.comp-tabs { display: flex; width: 100%; margin-bottom: 16px; }
.comp-tabs button { flex: 1; }
.comp-tabs button.on { background: rgba(124,92,255,.22); color: var(--text); box-shadow: inset 0 0 0 1px rgba(124,92,255,.5); }
.port-intro { margin-bottom: 12px; }
.port-budget { margin: -4px 0 12px; font: 600 12px "JetBrains Mono", monospace; color: var(--a2); }
.port-budget.over { color: var(--gold); }
.quick-pick-label { margin: 0 0 10px; font: 600 13px "Inter", sans-serif; color: var(--text); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin-bottom: 14px; }
.quick-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px;
  background: var(--s1); border: 1px solid var(--line-2); cursor: pointer; font: 700 12px "JetBrains Mono", monospace; color: var(--muted);
  transition: border-color .15s, background .15s, transform .1s; }
.quick-chip:hover { border-color: var(--a1); transform: translateY(-1px); }
.quick-chip .mini-logo { width: 26px; height: 26px; margin: 0; }
.quick-chip .quick-mono { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(124,92,255,.18); color: var(--a1); font: 700 11px "JetBrains Mono", monospace; }
.quick-chip.on { border-color: var(--a2); background: rgba(61,214,245,.12); color: var(--text); box-shadow: 0 0 0 1px rgba(61,214,245,.4), 0 0 16px rgba(61,214,245,.2); }
.quick-chip:disabled { opacity: .35; cursor: not-allowed; }
.quick-manual { margin-bottom: 10px; }
.quick-manual summary { cursor: pointer; font: 600 13px "Inter", sans-serif; color: var(--muted); padding: 6px 0; list-style: none; }
.quick-manual summary::-webkit-details-marker { display: none; }
.quick-manual summary::before { content: "+ "; color: var(--a2); }
.quick-manual[open] summary::before { content: "− "; }
.quick-manual summary:hover { color: var(--text); }
.quick-manual .port-add { margin-top: 10px; }
.acc-avatar-preview { max-width: 150px; margin: 4px auto 14px; }
.port-add { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 8px; }
.port-add input, .port-add select, .port-since input, .port-qty {
  width: 100%; font: 500 14px "Inter", sans-serif; color: var(--text); background: var(--s1); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 12px; outline: none; min-height: 44px; }
.port-add select { padding-right: 8px; }
.port-add input:focus, .port-since input:focus, .port-qty:focus { border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124,92,255,.18); }
.port-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.port-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 92px 34px; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--s1); border: 1px solid var(--line); animation: rowIn .35s ease both; }
.port-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.port-name .mini-logo { width: 26px; height: 26px; margin: 0; }
.port-name b { display: block; font-size: 14px; }
.port-name small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.port-qty { min-height: 36px; padding: 6px 8px; font-family: "JetBrains Mono", monospace; font-size: 13px; }
.port-val { text-align: right; font-size: 13px; color: #c3cad8; }
.port-row .rm { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: none; color: var(--muted); cursor: pointer; font-size: 18px; }
.port-row .rm:hover { color: var(--down); border-color: var(--down); }
.port-total { display: flex; justify-content: space-between; padding: 8px 10px 0; font-size: 13px; color: var(--muted); }
.port-total b { color: var(--text); }
.port-since { margin-top: 14px; display: grid; gap: 6px; }
.port-since input { max-width: 220px; color-scheme: dark; }
.port-cta { margin-top: 14px; }
@media (max-width: 520px) {
  .port-add { grid-template-columns: 1fr 1fr; }
  .port-add #port-t, .port-add button { grid-column: 1 / -1; }
  .port-row { grid-template-columns: minmax(0, 1fr) 84px 34px; }
  .port-row .port-val { display: none; }
}

/* ---------- stock detail drawer ---------- */
body.drawer-open { overflow: hidden; }
.drawer { position: fixed; inset: 0; z-index: 80; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(4,5,9,.62); backdrop-filter: blur(4px); opacity: 0; transition: opacity .25s; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); overflow-y: auto; overscroll-behavior: contain; outline: none;
  background: linear-gradient(180deg, #121624, #0b0e15 40%); border-left: 1px solid var(--line-2); box-shadow: -30px 0 80px rgba(0,0,0,.55);
  padding: 22px 22px 32px; transform: translateX(104%); transition: transform .32s cubic-bezier(.2,.8,.2,1); }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.sd-head { display: flex; align-items: center; gap: 14px; }
.sd-logo .tb { width: 52px; height: 52px; font-size: 13px; }
.sd-id { flex: 1; min-width: 0; }
.sd-id h3 { font-size: 26px; }
.sd-close { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--text); font-size: 22px; cursor: pointer; }
.sd-close:hover { border-color: rgba(255,255,255,.35); }
.sd-price { display: flex; align-items: baseline; gap: 12px; margin: 16px 0 10px; }
.sd-price #sd-price { font-size: 34px; font-weight: 700; }
.sd-price .up { color: var(--up); } .sd-price .down { color: var(--down); }
.sd-range { margin-bottom: 10px; }
.sd-chart { position: relative; }
.sd-chart svg { width: 100%; height: 190px; display: block; cursor: crosshair; outline: none; }
.sd-axis { display: flex; justify-content: space-between; font: 500 11px "JetBrains Mono", monospace; color: var(--muted); margin-top: 4px; }
.sd-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.sd-stats div { padding: 10px 12px; border-radius: 12px; background: var(--s1); border: 1px solid var(--line); }
.sd-stats dt { font-size: 11.5px; color: var(--muted); }
.tile-cap { font: 500 11.5px "JetBrains Mono", monospace; color: var(--muted); margin: -2px 0 4px; }
.sd-about { margin: 4px 0 18px; }
.sd-about #sd-desc { line-height: 1.55; color: var(--text); opacity: .86; margin: 6px 0 8px; }
.sd-about .tiny { font-size: 11px; line-height: 1.5; }
.sd-stats dd { margin: 3px 0 0; font-size: 14px; }
.sd-stats dd.up { color: var(--up); } .sd-stats dd.down { color: var(--down); }
.sd-pet { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; margin: 6px 0 14px; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.02); border: 1px solid var(--line); }
.sd-pet .pet-stage { max-width: 120px; }
.sd-events { margin: 8px 0 16px; max-height: 260px; overflow-y: auto; }
.ev-open { cursor: pointer; }
.ev-open:focus-visible { outline: 2px solid var(--a2); outline-offset: 2px; }
@media (max-width: 560px) { .drawer-panel { width: 100%; border-left: 0; padding: 16px 16px 28px; } .sd-stats { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .drawer-panel, .drawer-scrim { transition: none; } }
.sd-events .ev { grid-template-columns: auto 1fr auto; }
.ev-k { font: 600 11px "JetBrains Mono", monospace; padding: 4px 9px; border-radius: 999px; background: rgba(244,178,74,.14); color: #f4b24a; border: 1px solid rgba(244,178,74,.35); }
.ev-k.split, .ev-k.reverse { background: rgba(124,92,255,.16); color: #b9a8ff; border-color: rgba(124,92,255,.45); }

/* ---------- guide + help popovers ---------- */
.guide-btn { font: 600 12px "Inter", sans-serif; color: var(--text); background: rgba(124,92,255,.14); border: 1px solid rgba(124,92,255,.45); border-radius: 999px; padding: 7px 14px; cursor: pointer; margin-left: auto; margin-right: 10px; min-height: 34px; }
.guide-btn:hover { background: rgba(124,92,255,.25); }
.g-spot { position: fixed; z-index: 90; border-radius: 18px; box-shadow: 0 0 0 4000px rgba(4,5,9,.72), 0 0 0 2px rgba(61,214,245,.8), 0 0 40px rgba(61,214,245,.35); pointer-events: none; transition: all .35s cubic-bezier(.2,.8,.2,1); }
.g-card { position: fixed; z-index: 91; background: linear-gradient(180deg, #171c2b, #10131c); border: 1px solid var(--line-2); border-radius: 18px; padding: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.6); transition: top .35s cubic-bezier(.2,.8,.2,1), left .35s cubic-bezier(.2,.8,.2,1); }
.g-card h3 { font-size: 20px; margin: 6px 0 8px; }
.g-card p { color: #c3cad8; font-size: 15px; }
.g-dots { font-size: 11px; color: var(--a2); letter-spacing: .1em; }
.g-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.help-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255,255,255,.04);
  color: var(--muted); font: 700 12px "Inter", sans-serif; cursor: pointer; vertical-align: middle; padding: 0; position: relative; }
.help-btn::before { content: ""; position: absolute; inset: -11px; }   /* 44px touch target */
.help-btn:hover, .help-btn[aria-expanded="true"] { color: var(--text); border-color: var(--a2); }
.help-btn.corner { position: absolute; top: 10px; right: 10px; margin: 0; z-index: 3; }
.help-pop { position: absolute; z-index: 85; background: #171c2b; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; color: #d6dbe6; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
@media (max-width: 720px) { .guide-btn { padding: 6px 10px; margin-right: 6px; } }
@media (prefers-reduced-motion: reduce) { .g-spot, .g-card { transition: none; } }

/* ---------- alerts card + switch ---------- */
.alerts { margin-top: 20px; }
.al-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.al-head h3 { font-size: 20px; }
.switch { position: relative; flex: none; width: 58px; height: 32px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.06); cursor: pointer; padding: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #c3cad8; transition: transform .25s cubic-bezier(.2,.8,.2,1), background .25s; }
.switch.on { background: rgba(61,220,151,.25); border-color: rgba(61,220,151,.6); }
.switch.on i { transform: translateX(26px); background: var(--up); }
.switch:focus-visible { outline: 2px solid var(--a2); outline-offset: 3px; }
.alerts > .muted { margin: 10px 0 12px; }
.al-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.al-opts label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-height: 36px; cursor: pointer; }
.al-opts input { width: 18px; height: 18px; accent-color: var(--a1); }
.al-opts input:disabled + * , .al-opts label:has(input:disabled) { opacity: .55; cursor: default; }
.al-row { margin-top: 10px; align-items: center; }

/* ---------- accessibility ---------- */
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--text); color: #07080c; font-weight: 700; padding: 10px 16px; border-radius: 10px; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--a2); outline-offset: 2px; border-radius: 6px; }
/* tabindex="-1" targets (main#top, the drawer) only receive focus from links/scripts, never by Tab: a ring there
   draws a frame around the whole first screen after clicking "Create yours"/the logo or reloading on #top */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
.day:focus-visible, .tile:focus-visible, .tk-row:focus-visible { outline: 2px solid var(--a2); outline-offset: 2px; }
@media (pointer: coarse) {
  .seg button, .preset, .try, .btn, .tp, .links a, .chip-back { min-height: 44px; }
  .seg button { padding-top: 10px; padding-bottom: 10px; }
  .day { min-width: 30px; }
}
@media (prefers-contrast: more) {
  :root { --muted: #b7bfce; --line: rgba(255,255,255,.2); --line-2: rgba(255,255,255,.35); }
  .grain, .aurora { display: none; }
}
.lang-sel { margin-right: 8px; font: 600 12px "JetBrains Mono", monospace; color: var(--text); background: rgba(255,255,255,.04); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 10px; min-height: 34px; cursor: pointer; color-scheme: dark; }
.lang-sel option { color: #e9ecf2; background: #12151c; }
.lang-sel + .guide-btn { margin-left: 0; }

/* the X icon sits at the start of the right-hand cluster (icons, then the language pill, then Guide) —
   same grouping idea as a typical web3 nav's icon row before its primary button */
.nav-x { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none;
  border-radius: 999px; color: var(--muted); transition: color .15s, background .15s; }
.nav-x svg { width: 16px; height: 16px; fill: currentColor; }
.nav-x:hover { color: var(--text); background: rgba(255,255,255,.06); }
@media (max-width: 720px) { .nav-x { display: none; } }

/* behaviour cards: rules, not buttons; the one matching the live market is lit */
.react { cursor: default; }
.react:hover { transform: none; }
.react-now { position: absolute; top: 10px; right: 12px; font: 600 10.5px "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase;
  color: var(--up); padding: 3px 8px; border-radius: 999px; background: rgba(61,220,151,.12); border: 1px solid rgba(61,220,151,.4); display: none; }
.react.now { border-color: rgba(61,220,151,.55); box-shadow: 0 0 0 1px rgba(61,220,151,.3) inset, 0 12px 40px -18px rgba(61,220,151,.6); }
.react.now .react-now { display: inline-block; }

/* ---- simple version: the form is in the hero ---- */
.hero .input-card { margin-top: 26px; max-width: 560px; }
.card-title { font: 600 21px/1.25 "Space Grotesk", sans-serif; margin: 0 0 6px; color: var(--text); }
.linklike { display: inline-block; margin-top: 14px; padding: 6px 0; background: none; border: 0; cursor: pointer; text-align: left;
  font: 500 13.5px/1.4 "Inter", sans-serif; color: #9eeaff; text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: #fff; }
.linklike.back { margin: 0 0 10px; }
.companion.solo { grid-template-columns: 1fr; }
/* you vs the market */
.vs-market { position: relative; overflow: hidden; margin: 16px 0 6px; padding: 14px 16px; border-radius: 16px; background: var(--s1); border: 1px solid var(--line); }
.vm-row { display: grid; grid-template-columns: minmax(90px, 130px) 1fr 76px; gap: 12px; align-items: center; padding: 5px 0; }
.vm-l { font-size: 13.5px; color: var(--muted); }
.vm-row.me .vm-l, .vm-row.me2 .vm-l { color: var(--text); font-weight: 600; }
.vm-bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.vm-bar i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .9s cubic-bezier(.2,.7,.2,1); }
.vm-bar i.up { background: var(--up); } .vm-bar i.down { background: var(--down); }
.vm-row.mk .vm-bar i { opacity: .55; }
.vm-row b { text-align: right; font-size: 14px; }
.vm-row b.up { color: var(--up); } .vm-row b.down { color: var(--down); }
.vm-verdict { margin: 10px 0 0; font: 600 16.5px/1.35 "Space Grotesk", sans-serif; }
.vm-verdict.win { color: var(--up); } .vm-verdict.lose { color: #ffb3c1; }
.vm-cta { margin-top: 10px; }
.vm-note { margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .vm-bar i { transition: none; } }
.hero .port-list:empty { display: none; }
.hero #port-status:empty { min-height: 0; margin: 0; }

/* ---- accounts: username, chosen color, log in with a generated key ---- */
.account-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.account-bar:empty { display: none; }
#acc-logged-in { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.acc-who { font: 600 14px "Space Grotesk", sans-serif; color: var(--text); }
.acc-who b { color: var(--a2); }
.acc-skins { display: flex; gap: 6px; }
.acc-skin { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; background: var(--sw, #8a93a6); }
.acc-skin:hover { transform: scale(1.1); }
.acc-skin.on { border-color: #fff; box-shadow: 0 0 0 2px var(--sw, #8a93a6); }
.acc-panel { margin: 4px 0 18px; padding: 16px; border-radius: 14px; background: var(--s1); border: 1px solid var(--line); }
.acc-panel input[type="text"], .acc-panel input[type="password"], .acc-panel input:not([type]) {
  width: 100%; font: 500 14px "JetBrains Mono", monospace; color: var(--text); background: var(--s2); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 10px 12px; outline: none; margin: 8px 0; }
.acc-panel input:focus { border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124,92,255,.18); }
.acc-key-box { display: flex; align-items: center; gap: 10px; margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: #06070b; border: 1px solid var(--line-2); }
.acc-key-box code { flex: 1; font: 500 13px "JetBrains Mono", monospace; color: var(--gold); word-break: break-all; user-select: all; }
.acc-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin: 4px 0 14px; cursor: pointer; }
.acc-duel { margin: 4px 0; }
.acc-duel-search { position: relative; }
.acc-duel-search input { width: 100%; font: 500 14px "Inter", sans-serif; color: var(--text); background: var(--s1); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 10px 12px; outline: none; }
.acc-duel-search input:focus { border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124,92,255,.18); }
.acc-duel-results { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: var(--s2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.6); max-height: 220px; overflow-y: auto; }
.acc-duel-results li { padding: 9px 10px; border-radius: 8px; cursor: pointer; font: 500 14px "Space Grotesk", sans-serif; }
.acc-duel-results li:hover, .acc-duel-results li.active { background: rgba(124,92,255,.18); }

/* ---- community dashboard ---- */
#dash-sort { margin-bottom: 18px; }
.dash-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-count { font: 600 12px "JetBrains Mono", monospace; color: var(--muted); }
.dash-week-note { margin: 10px 0 0; font: 500 12.5px "Inter", sans-serif; color: var(--muted); }
.dash-hint { text-align: center; margin-top: 16px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.dash-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 14px; border-radius: 16px;
  background: var(--s1); border: 1px solid var(--line); text-align: center; animation: rowIn .4s ease both; cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.dash-card:hover, .dash-card:focus-visible { border-color: var(--a1); box-shadow: 0 10px 30px rgba(0,0,0,.35); outline: none; }
.dash-card.rank-1 { border-color: rgba(255,197,84,.6); box-shadow: 0 0 0 1px rgba(255,197,84,.3), 0 10px 30px rgba(255,197,84,.12); }
.dash-card.rank-2 { border-color: rgba(210,220,235,.5); }
.dash-card.rank-3 { border-color: rgba(210,150,90,.5); }
.dash-rank { position: absolute; top: 8px; left: 10px; font: 700 11px "JetBrains Mono", monospace; color: var(--muted); }
.dash-you { position: absolute; top: 8px; right: 10px; font: 700 10px "JetBrains Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--a2); }
.dash-card.me { border-color: rgba(61,214,245,.55); }
.dash-bot { position: absolute; top: 8px; right: 10px; padding: 1px 6px; border-radius: 6px; font: 700 9.5px "JetBrains Mono", monospace; letter-spacing: .08em;
  color: #c9b8ff; background: rgba(124,92,255,.18); border: 1px solid rgba(124,92,255,.45); }
.rank-1 .dash-rank { color: #ffc554; } .rank-2 .dash-rank { color: #d2dceb; } .rank-3 .dash-rank { color: #d2965a; }
.dash-card .pet-stage { width: 84px; height: 84px; }
.dash-card b { font: 700 14px "Space Grotesk", sans-serif; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.dash-card .dash-stage { font: 500 11px "JetBrains Mono", monospace; color: var(--muted); }
.dash-card .dash-change { font: 700 14px "JetBrains Mono", monospace; }
.dash-card .dash-change.up { color: var(--up); } .dash-card .dash-change.down { color: var(--down); }
.dash-card .dash-change.flat { color: var(--muted); }
.dash-badges { display: flex; gap: 5px; margin-top: 2px; }
.dash-badge { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  font-size: 11px; line-height: 1; background: rgba(124,92,255,.18); color: var(--a1); border: 1px solid rgba(124,92,255,.4); cursor: help; }
@media (max-width: 520px) { .dash-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); } .dash-card .pet-stage { width: 64px; height: 64px; } }

/* ---- nav profile chip + avatar onboarding step ---- */
.nav-profile { display: flex; align-items: center; gap: 6px; font: 600 13px "Space Grotesk", sans-serif; color: var(--text);
  background: var(--s1); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px 7px 10px; cursor: pointer; }
.nav-profile:hover { border-color: var(--a1); }
.nav-profile b { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .nav { gap: 8px; }
  .brand { font-size: 17px; gap: 7px; }
  .brand-mark { width: 22px; height: 22px; }
  .lang-sel { margin-right: 0; padding: 6px 8px; }
  .guide-btn { display: none; }
  .nav-mobile .nav-mobile-guide { display: block; }
  .nav-profile { padding: 6px 10px 6px 8px; font-size: 12px; }
  .nav-profile b { max-width: 6ch; }
}
.nav-profile b { color: var(--a2); font-weight: 700; }
.nav-profile-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px rgba(61,220,151,.7); }
.acc-skins-big { display: flex; gap: 10px; margin: 12px 0 16px; flex-wrap: wrap; }
.acc-skins-big .acc-skin { width: 34px; height: 34px; }
#auth-gate .acc-panel { margin: 0; padding: 0; border: 0; background: none; }
#auth-gate .linklike.back { margin: 0 0 10px; }

/* Wall Street clock: always on screen, because "why is it asleep?" should never need explaining */
.mkt-clock { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px;
  margin: -18px 0 26px; padding: 9px 16px; border-radius: 999px; background: rgba(255,255,255,.03);
  border: 1px solid var(--line); font: 600 12.5px "Inter", sans-serif; color: var(--muted); }
.mkt-clock b { color: var(--text); font-weight: 700; }
.mkt-clock #mkt-ny, .mkt-clock #mkt-next { font-family: "JetBrains Mono", monospace; font-size: 12px; }
.mkt-clock #mkt-next { color: var(--a2); }
.mkt-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.mkt-clock.is-open .mkt-dot { background: var(--up); box-shadow: 0 0 10px var(--up); animation: mktPulse 1.8s ease-in-out infinite; }
.mkt-clock.is-ext .mkt-dot { background: #f4b24a; box-shadow: 0 0 10px rgba(244,178,74,.7); }
.mkt-clock.is-shut .mkt-dot { background: #7c8399; }
@keyframes mktPulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .mkt-clock.is-open .mkt-dot { animation: none; } }
@media (max-width: 640px) { .mkt-clock { margin: -10px 0 18px; font-size: 11.5px; gap: 4px 10px; padding: 8px 12px; } }

/* lobby profile panel: who's behind a Stonkling, opened by clicking it in the plaza */
.profile-modal { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.profile-backdrop { position: absolute; inset: 0; background: rgba(3,4,9,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
/* the card needs its own OPAQUE surface: .card alone is a near-transparent film, which over the
   backdrop let the whole page show through the panel */
.profile-card { position: relative; width: min(460px, 100%); max-height: min(600px, 86vh); overflow-y: auto; padding: 24px;
  background: linear-gradient(180deg, #171c2b, #10131c); border: 1px solid var(--line-2); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.profile-card::-webkit-scrollbar { width: 8px; }
.profile-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; }
.profile-close { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2);
  background: #1b2133; color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; z-index: 2; }
.profile-close:hover { background: #262e45; border-color: var(--a2); }
.profile-head { display: flex; align-items: center; gap: 14px; margin: 0 44px 18px 0; }
.profile-pet { width: 84px; height: 84px; flex: none; }
.profile-name { margin: 0; font: 700 19px "Space Grotesk", sans-serif; color: var(--text); word-break: break-word; }
.profile-sub { margin: 4px 0 0; line-height: 1.4; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; }
.profile-stats .profile-stat { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line-2); min-width: 0; }
.profile-stats .profile-stat b { font: 700 15px "JetBrains Mono", monospace; }
.profile-stats .profile-stat span { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.25; }
.profile-holdings-label { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.profile-holdings { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.profile-holdings li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); font: 600 13px "Inter", sans-serif; }
.profile-holdings li b { font-family: "JetBrains Mono", monospace; flex: none; min-width: 4.5em; }
.profile-holdings li span { flex: 1; color: var(--muted); font-weight: 500; font-size: 12px; text-align: right; }
.profile-holdings li i { font-style: normal; font: 700 12px "JetBrains Mono", monospace; flex: none; min-width: 4.5em; text-align: right; }
.profile-modal .cta-row { margin-top: 0; }
@media (max-width: 480px) {
  .profile-card { padding: 18px; }
  .profile-head { gap: 12px; margin-right: 40px; }
  .profile-pet { width: 66px; height: 66px; }
  .profile-stats .profile-stat b { font-size: 13.5px; }
}
