/* TrenchPad UI: cream "storybook" panels with ink outlines floating over the painted world.
   Single deliberate theme (the world art is fixed), so colors are set explicitly. */
:root {
  --ink: #2a2140;
  --ink-soft: #6c6188;
  --paper: #fffaf0;
  --paper-2: #f4ecdc;
  --gold: #ffc533;
  --gold-deep: #e9a400;
  --teal: #20a99a;
  --up: #17a35a;
  --down: #e0485f;
  --line: rgba(42, 33, 64, .9);
  --display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #1b1530; color: var(--ink); font-family: var(--body); }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--ink-soft); }
.lbl { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 8px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 14px; border: 2.5px solid var(--line); background: var(--paper); font-family: var(--display); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; color: var(--ink); box-shadow: 0 3px 0 var(--line); transition: transform .08s, box-shadow .08s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--line); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.btn.gold { background: var(--gold); }
.btn.ghost { background: rgba(255, 250, 240, .92); }
.btn.big { width: 100%; padding: 13px; font-size: 18px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

input, textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid rgba(42, 33, 64, .35); background: #fff; outline: none; }
input:focus, textarea:focus { border-color: var(--ink); }
textarea { resize: vertical; }

/* top HUD */
.hud-top { position: fixed; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 0; display: flex; align-items: center; gap: 8px; pointer-events: none; z-index: 5; }
.hud-top > * { pointer-events: auto; }
.spacer { flex: 1; }
.pill { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 250, 240, .94); border: 2.5px solid var(--line); font-weight: 800; font-size: 14px; box-shadow: 0 3px 0 var(--line); }
.brand { font-family: var(--display); font-weight: 700; font-size: 18px; padding: 4px 14px 4px 6px; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.zone-pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--line); }
.stats { gap: 14px; font-weight: 700; color: var(--ink-soft); }
.stats b { color: var(--ink); font-variant-numeric: tabular-nums; }

.demo-badge { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 112px); background: #ffe7ef; border: 2px solid var(--down); color: #9b1832; font-weight: 800; font-size: 12px; padding: 4px 12px; border-radius: 999px; z-index: 4; }

/* toasts */
.toasts { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 96px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 6; pointer-events: none; width: min(560px, calc(100% - 32px)); }
.toast { background: rgba(42, 33, 64, .94); color: #fff; padding: 10px 18px; border-radius: 16px; font-family: var(--display); font-weight: 600; font-size: 16px; text-align: center; border: 2.5px solid var(--c, #fff); box-shadow: 0 6px 24px rgba(0, 0, 0, .35); animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.toast small { display: block; font-family: var(--body); font-weight: 700; font-size: 12px; opacity: .75; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

/* minimap */
.minimap { position: fixed; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); width: 240px; height: 90px; border-radius: 12px; border: 2.5px solid var(--line); box-shadow: 0 3px 0 var(--line); background: #2a2140; z-index: 4; cursor: pointer; }

/* jump / slap */
.act-btns { position: fixed; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 118px); display: flex; gap: 10px; z-index: 5; }
.act { width: 74px; height: 74px; border-radius: 50%; border: 3px solid var(--line); background: var(--paper); box-shadow: 0 4px 0 var(--line); font-family: var(--display); font-weight: 700; font-size: 16px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.act small { font-family: var(--body); font-size: 10px; font-weight: 800; color: var(--ink-soft); margin-top: 4px; }
.act.slap { background: #ff8a5c; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.act.slap small { color: rgba(255,255,255,.85); }
.act:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn.icon { padding: 7px 10px; }

/* town chat */
.townchat { position: fixed; left: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); width: 370px; height: 330px; display: flex; flex-direction: column; background: rgba(255, 250, 240, .93); border: 2.5px solid var(--line); border-radius: 18px; box-shadow: 0 3px 0 var(--line); z-index: 6; overflow: hidden; }
.townchat.collapsed { height: auto; }
.townchat.collapsed .tc-log, .townchat.collapsed .tc-form { display: none; }
.tc-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 2px solid rgba(42, 33, 64, .12); font-family: var(--display); font-size: 16px; }
.tc-head .muted { font-family: var(--body); font-size: 12px; font-weight: 700; flex: 1; }
.tc-toggle { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper-2); font-weight: 800; cursor: pointer; line-height: 1; }
.tc-log { flex: 1; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 14px; line-height: 1.35; overscroll-behavior: contain; }
.tc-msg { overflow-wrap: anywhere; }
.tc-msg .who { font-weight: 800; margin-right: 4px; cursor: default; }
.tc-msg .tk { font-weight: 800; color: #6b3fd6; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.tc-msg.mine .who { color: var(--gold-deep); }
.tc-msg.mention { background: #fff2c2; border-radius: 8px; padding: 2px 6px; margin-inline: -6px; }
.tc-sys { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); padding-left: 8px; border-left: 3px solid var(--c, var(--ink-soft)); }
.tc-sys.click { cursor: pointer; }
.tc-time { color: var(--ink-soft); font-size: 11px; margin-right: 4px; font-variant-numeric: tabular-nums; }
.tc-form { display: flex; gap: 6px; padding: 8px; border-top: 2px solid rgba(42, 33, 64, .12); }
.tc-form input { padding: 8px 10px; }
.tc-form .btn { padding: 7px 12px; font-size: 14px; }
.chat-fab { display: none; position: fixed; left: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 6; }
.unread { background: var(--down); color: #fff; border-radius: 99px; font-size: 12px; padding: 1px 7px; }
.small { font-size: 12px; font-weight: 700; }

/* resident card */
.card { position: fixed; right: 14px; top: calc(env(safe-area-inset-top, 0px) + 72px); bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); width: 380px; background: var(--paper); border: 3px solid var(--line); border-radius: 24px; box-shadow: 0 5px 0 var(--line), 0 20px 50px rgba(0, 0, 0, .35); padding: 18px; display: flex; flex-direction: column; gap: 14px; z-index: 8; overflow: hidden; animation: slidein .25s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.x { position: absolute; right: 12px; top: 10px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper-2); font-size: 22px; line-height: 1; cursor: pointer; }
.card-head { display: flex; gap: 14px; align-items: center; padding-right: 30px; }
.avatar { width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--gold); background: radial-gradient(circle at 50% 35%, #fff, var(--paper-2)); overflow: hidden; flex: none; display: grid; place-items: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.avatar img.sprite { object-fit: contain; object-position: 50% 8%; transform: scale(1.9) translateY(18%); }
.who { min-width: 0; }
.who h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1; overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--paper-2); border: 1.5px solid rgba(42, 33, 64, .25); }
.badge.tier { color: #fff; border-color: transparent; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.badge.dead { background: #e7e3f2; }
.badge.demo { background: #ffe7ef; color: #9b1832; }
.mcap-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.mcap { font-family: var(--display); font-weight: 700; font-size: 34px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.chg { font-weight: 800; padding: 5px 10px; border-radius: 999px; background: #dff6e8; color: var(--up); font-variant-numeric: tabular-nums; }
.chg.neg { background: #fde3e7; color: var(--down); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.val { font-family: var(--display); font-weight: 600; font-size: 19px; font-variant-numeric: tabular-nums; }
.bar-wrap { display: flex; flex-direction: column; gap: 5px; }
.bar { height: 12px; border-radius: 99px; background: var(--paper-2); border: 2px solid rgba(42, 33, 64, .3); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 99px; transition: width .6s; }
.bar.aura i { background: linear-gradient(90deg, #46b4ff, #a35bff, #ff7ae6); }
.actions { display: flex; gap: 8px; }
.actions .btn { flex: 1; padding: 9px 8px; font-size: 14px; }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.holders-now { font-size: 12px; font-weight: 800; background: #e6f7f4; color: #0f6b5f; border-radius: 99px; padding: 3px 10px; }
.foot-btns { display: flex; gap: 8px; }
.foot-btns .btn { flex: 1; font-size: 14px; padding: 9px 8px; }
.hb { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; border-radius: 99px; padding: 0 7px; margin-right: 4px; vertical-align: 1px; text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.vf { color: var(--teal); font-weight: 800; margin-right: 2px; }
.share-sheet { width: min(760px, 100%); }
.share-sheet canvas { width: 100%; height: auto; border-radius: 16px; border: 2.5px solid var(--line); display: block; }
.share-btns { display: flex; gap: 8px; }
.share-btns .btn { flex: 1; }
.card-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; border-top: 2px dashed rgba(42, 33, 64, .2); padding-top: 12px; }

/* modals */
.modal { position: fixed; inset: 0; background: rgba(27, 21, 48, .55); display: grid; place-items: center; padding: 16px; z-index: 20; backdrop-filter: blur(3px); }
.sheet { position: relative; width: min(560px, 100%); max-height: calc(100% - 16px); overflow-y: auto; background: var(--paper); border: 3px solid var(--line); border-radius: 26px; box-shadow: 0 6px 0 var(--line); padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.sheet h1, .sheet h2 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.05; text-wrap: balance; }
.sheet h1 { font-size: 34px; }
.sheet h2 { font-size: 28px; }
.sheet p { margin: 0; line-height: 1.5; }
.avatars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatars button { height: 96px; min-width: 0; border-radius: 14px; border: 2.5px solid rgba(42, 33, 64, .25); background: var(--paper-2); cursor: pointer; padding: 4px; display: grid; place-items: center; }
.avatars button img { max-width: 100%; max-height: 84px; width: auto; height: auto; display: block; }
.avatars button[aria-pressed="true"] { border-color: var(--ink); background: var(--gold); box-shadow: 0 3px 0 var(--line); }
.map-sheet { width: min(760px, 100%); }
.map-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.map-grid button { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; border: 2.5px solid var(--line); overflow: hidden; cursor: pointer; padding: 0; background-size: cover; background-position: center; }
.map-grid button span { position: absolute; left: 6px; right: 6px; bottom: 6px; background: rgba(255, 250, 240, .94); border-radius: 10px; padding: 4px 6px; font-family: var(--display); font-weight: 600; font-size: 14px; text-align: left; }
.map-grid button small { display: block; font-family: var(--body); font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.map-grid button em { position: absolute; top: 6px; right: 6px; font-style: normal; font-weight: 800; font-size: 12px; background: var(--ink); color: #fff; border-radius: 99px; padding: 2px 8px; }
.launch-sheet form { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 14px; }
.col { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.drop { width: 132px; flex: none; aspect-ratio: 1; border-radius: 18px; border: 2.5px dashed rgba(42, 33, 64, .45); display: grid; place-items: center; cursor: pointer; overflow: hidden; position: relative; background: var(--paper-2); font-family: var(--display); font-weight: 600; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.launch-status { padding: 10px 12px; border-radius: 12px; background: var(--paper-2); font-weight: 700; font-size: 14px; }
.launch-status.err { background: #fde3e7; color: #9b1832; }
.launch-status.ok { background: #dff6e8; color: #0f6b3b; }

@media (max-width: 760px) {
  .stats, .zone-pill { display: none; }
  .hud-top { gap: 6px; padding-inline: 10px; }
  .hud-top .btn { padding: 6px 9px; font-size: 13px; }
  .hud-top { overflow-x: auto; scrollbar-width: none; }
  .hud-top::-webkit-scrollbar { display: none; }
  #btnSound { display: none; }
  .hud-top .btn, .hud-top .pill { flex: none; }
  .brand span { display: none; }
  .minimap { width: 150px; height: 56px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); }
  .townchat { left: 10px; right: 10px; width: auto; height: 46%; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 7; }
  .act-btns { bottom: calc(env(safe-area-inset-bottom, 0px) + 76px); right: 10px; }
  .act small { display: none; }
  .act { width: 66px; height: 66px; }
  .townchat.collapsed { display: none; }
  .townchat.collapsed ~ .chat-fab { display: inline-flex; }
  .card { left: 10px; right: 10px; width: auto; top: auto; height: auto; max-height: 80%; overflow-y: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); }
  .avatars { grid-template-columns: repeat(3, 1fr); }
  .row3, .map-grid { grid-template-columns: 1fr; }
  .drop { width: 104px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Wallet picker */
.wallet-sheet { width: min(420px, 100%); }
.wl-list { display: flex; flex-direction: column; gap: 8px; }
.wl-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border-radius: 14px; border: 2.5px solid var(--line); background: var(--paper); box-shadow: 0 3px 0 var(--line); font-family: var(--display); font-size: 17px; color: var(--ink); cursor: pointer; text-align: left; transition: transform .08s, box-shadow .08s; }
.wl-item:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--line); background: #fff; }
.wl-item:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.wl-item img, .wl-letter { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.wl-letter { display: grid; place-items: center; background: var(--gold); border: 2px solid var(--line); font-weight: 700; }
.wl-item b { flex: 1; font-weight: 600; }
.wl-item em { font-style: normal; font-family: var(--body); font-size: 12px; font-weight: 800; color: var(--up); }
.wl-get { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.wl-current, .launch-wallet { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--paper-2); font-weight: 700; font-size: 14px; }
.linkish { border: 0; background: none; padding: 0; font: inherit; font-weight: 800; color: var(--teal); text-decoration: underline; cursor: pointer; white-space: nowrap; }

/* Loading screen: twilight town, floating coins, hovering mascot, meme parade, blast-off exit */
.loader { position: fixed; inset: 0; z-index: 40; overflow: hidden; color: #fff; background: #1b1530; transition: opacity .5s ease .15s; }
.loader.done { opacity: 0; pointer-events: none; }
.loader-bg { position: absolute; inset: -6%; background: url(/assets/brand/loader-bg.jpg) center 40% / cover no-repeat; animation: loaderPan 22s ease-in-out infinite alternate; filter: saturate(1.15); }
.loader-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, rgba(27, 21, 48, .15) 0%, rgba(27, 21, 48, .55) 55%, rgba(27, 21, 48, .92) 100%), linear-gradient(180deg, rgba(27, 21, 48, .35), rgba(27, 21, 48, 0) 30%, rgba(27, 21, 48, .6)); }
.loader-fx { position: absolute; inset: 0; pointer-events: none; }
.loader-fx i { position: absolute; bottom: -40px; display: block; animation: loaderRise linear infinite; opacity: .9; }
.loader-fx i.coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c9, #ffc533 45%, #d18a00 100%); border: 2px solid #8a5a00; box-shadow: 0 0 12px rgba(255, 197, 51, .7); }
.loader-fx i.conf { width: 8px; height: 14px; border-radius: 2px; }
.loader-center { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: min(12px, 1.6vh); padding: 16px 16px min(150px, 20vh); text-align: center; }
.loader-hero-wrap { position: relative; height: min(210px, 24vh); margin-bottom: 1.5vh; aspect-ratio: 0.82; animation: loaderHover 2.4s ease-in-out infinite; }
.loader-halo { position: absolute; left: 50%; top: 52%; width: 190%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(79, 224, 163, .55) 0%, rgba(79, 224, 163, .18) 38%, rgba(79, 224, 163, 0) 68%); animation: loaderPulse 2.4s ease-in-out infinite; }
.loader-hero { position: relative; height: 100%; width: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)); }
.loader-flame { position: absolute; bottom: -10%; width: 15%; height: 26%; border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%; background: radial-gradient(ellipse at 50% 25%, #fff 0%, #ffe066 30%, #ff8a1f 65%, rgba(255, 80, 0, 0) 100%); filter: blur(1px); transform-origin: 50% 0; animation: loaderFlame .12s ease-in-out infinite alternate; }
.loader-flame.l { left: 20%; }
.loader-flame.r { right: 14%; animation-delay: .06s; }
.loader-logo { width: min(440px, 80vw, 52vh); height: auto; filter: drop-shadow(0 6px 0 rgba(27, 21, 48, .6)); animation: loaderPop .7s cubic-bezier(.2, 1.5, .4, 1) both .1s; }
.loader-bar { position: relative; width: min(420px, 84vw); height: 22px; margin-top: 6px; border-radius: 999px; background: rgba(27, 21, 48, .7); border: 3px solid var(--paper); box-shadow: 0 4px 0 var(--line), 0 0 24px rgba(79, 224, 163, .25); overflow: hidden; }
.loader-bar i { position: relative; display: block; height: 100%; width: 3%; border-radius: 999px; background: linear-gradient(90deg, #1fb87a, #4fe0a3); box-shadow: 0 0 16px #4fe0a3; transition: width .3s ease; overflow: hidden; }
.loader-bar i::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .35) 0 10px, rgba(255, 255, 255, 0) 10px 20px); background-size: 28px 28px; animation: loaderStripes .6s linear infinite; }
.loader-row { width: min(420px, 84vw); display: flex; justify-content: space-between; gap: 12px; font-weight: 800; font-size: 14px; text-shadow: 0 2px 0 rgba(27, 21, 48, .8); }
.loader-row b { font-family: var(--display); font-size: 18px; color: #4fe0a3; font-variant-numeric: tabular-nums; }
.loader-tip { min-height: 1.3em; font-size: 14px; font-weight: 700; color: #ffe9a8; text-shadow: 0 2px 0 rgba(27, 21, 48, .8); transition: opacity .3s; }
.loader-tip.swap { opacity: 0; }
.loader-parade { position: absolute; left: 0; right: 0; bottom: 0; height: min(130px, 18vh); overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.loader-track { position: absolute; bottom: 6px; left: 0; display: flex; align-items: flex-end; gap: 26px; width: max-content; animation: loaderMarch 40s linear infinite; }
.loader-track img { height: min(104px, 15vh); width: auto; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .4)); animation: loaderStep .5s ease-in-out infinite alternate; }
.loader-track img:nth-child(2n) { height: min(92px, 13vh); animation-delay: .25s; }
.loader-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
/* exit: mascot blasts off, white flash, fade */
.loader.launch .loader-hero-wrap { animation: loaderBlast .75s cubic-bezier(.5, 0, .9, .4) forwards; }
.loader.launch .loader-flame { height: 70%; bottom: -55%; width: 20%; }
.loader.launch .loader-flash { animation: loaderFlash .7s ease-out .35s; }
@keyframes loaderPan { from { transform: scale(1.08) translateX(-2%); } to { transform: scale(1.02) translateX(2%); } }
@keyframes loaderRise { from { transform: translateY(0) rotate(0); } to { transform: translateY(-115vh) rotate(540deg); } }
@keyframes loaderHover { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-16px) rotate(2deg); } }
@keyframes loaderPulse { 0%, 100% { opacity: .7; transform: translate(-50%, -50%) scale(.92); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } }
@keyframes loaderFlame { from { transform: scaleY(.8) scaleX(1.05); opacity: .85; } to { transform: scaleY(1.15) scaleX(.9); opacity: 1; } }
@keyframes loaderPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes loaderStripes { to { background-position: 28px 0; } }
@keyframes loaderMarch { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes loaderStep { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-6px) rotate(3deg); } }
@keyframes loaderBlast { 0% { transform: translateY(0) scale(1); } 20% { transform: translateY(14px) scale(1.04, .94); } 100% { transform: translateY(-120vh) scale(.9, 1.15); } }
@keyframes loaderFlash { 0% { opacity: 0; } 30% { opacity: .85; } 100% { opacity: 0; } }
@media (max-width: 760px) { .loader-track img { height: min(78px, 12vh); } .loader-track img:nth-child(2n) { height: min(68px, 10vh); } }
@media (prefers-reduced-motion: reduce) { .loader-bg, .loader-fx, .loader-track { animation: none !important; } .loader-fx { display: none; } }

/* Town token: CA + BUY under the header */
.ca-bar { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 62px); z-index: 5; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 5px 5px 5px 14px; border-radius: 999px; background: rgba(255, 250, 240, .95); border: 2.5px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.ca-lbl { font-family: var(--display); font-weight: 700; font-size: 15px; }
.ca-addr { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: none; padding: 0; font-family: var(--mono); font-size: 13px; color: var(--ink); cursor: pointer; }
.ca-addr:disabled { font-family: var(--body); font-weight: 800; color: var(--ink-soft); cursor: default; }
.ca-buy { padding: 6px 18px; border-radius: 999px; font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.ca-buy[aria-disabled="true"] { opacity: .5; pointer-events: none; }
@media (max-width: 760px) { .ca-bar { top: calc(env(safe-area-inset-top, 0px) + 56px); } .ca-addr { max-width: 46vw; } }

/* Settings */
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; }

/* Launches list */
.launches-sheet { width: min(520px, 100%); }
.ls-list { display: flex; flex-direction: column; gap: 8px; }
.ls-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border-radius: 14px; border: 2.5px solid var(--line); background: var(--paper); box-shadow: 0 3px 0 var(--line); cursor: pointer; text-align: left; color: var(--ink); font: inherit; }
.ls-row:hover { background: #fff; transform: translateY(-1px); }
.ls-row img { width: 40px; height: 48px; object-fit: contain; flex: none; }
.ls-row img.logo { height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.ls-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ls-info b { font-family: var(--display); font-size: 17px; }
.ls-info small { color: var(--ink-soft); font-weight: 700; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-cap { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.ls-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ca-x { padding: 6px 10px; border-radius: 999px; background: #000; color: #fff; }
.ca-x:hover { background: #222; }

/* How it works */
.how-sheet { width: min(640px, 100%); gap: 14px; }
.how-head { display: flex; align-items: center; gap: 14px; padding-right: 36px; }
.how-head img { height: 92px; width: auto; flex: none; filter: drop-shadow(0 4px 0 rgba(42, 33, 64, .25)); }
.how-head h2 { font-size: 26px; }
.how-head p { margin-top: 4px; }
.how-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.how-steps li { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--paper-2); border: 2px solid rgba(42, 33, 64, .12); }
.how-pic { width: 96px; height: 72px; flex: none; object-fit: cover; border-radius: 12px; border: 2.5px solid var(--line); background: #2a2140; }
.how-pic.aura { object-fit: contain; background: radial-gradient(circle, #7dffb0 0%, #3dbb7f 45%, #2a2140 75%); }
.how-steps b { font-family: var(--display); font-size: 17px; font-weight: 700; }
.how-steps p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.how-steps em, .how-play em { font-style: normal; font-weight: 800; color: var(--ink); }
.how-ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0; font-weight: 800; color: var(--ink-soft); }
.how-ladder i { font-style: normal; font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--paper); border: 2px solid var(--line); color: var(--ink); }
.how-play { padding: 10px 14px; border-radius: 16px; border: 2px dashed rgba(42, 33, 64, .25); }
.how-play b { font-family: var(--display); font-size: 17px; }
.how-play ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 6px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 var(--line); }
.how-btns { display: flex; gap: 10px; }
.how-btns .btn { flex: 1; }
@media (max-width: 520px) { .how-pic { width: 70px; height: 60px; } .how-head img { height: 70px; } .how-btns { flex-direction: column; } }
