/* POKEMAX — game screens: gate, creator, HUD, graded slab, launch, trade, dashboard. */
@import url('/css/trade.css');
@import url('/css/slab.css');
@import url('/css/launch.css');
.game-body { overflow: hidden; height: 100dvh; touch-action: none; user-select: none; -webkit-user-select: none; }
#game { position: fixed; inset: 0; overflow: hidden; background: #0a1210; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: grab; }
#view:active { cursor: grabbing; }
.screen { position: absolute; inset: 0; z-index: 30; }
.screen--dim { z-index: 40; background: radial-gradient(120% 90% at 50% 40%, rgba(3,6,4,.55), rgba(3,6,4,.88)); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; overflow: auto; }
.loading { position: absolute; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 16px; background: #050806; transition: opacity .8s ease .2s, visibility .8s .2s; }
.loading img { width: 84px; animation: logohop .9s cubic-bezier(.4,0,.3,1) infinite alternate; box-shadow: 0 16px 40px -10px rgba(0,200,5,.6); }
@keyframes logohop { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-14px) rotate(3deg); } }
.loading span { font: 700 12px/1 var(--body); letter-spacing: .3em; text-transform: uppercase; color: var(--mute); }
.loading.done { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes spinball { 0% { transform: rotate(0) } 60%, 100% { transform: rotate(360deg) } }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); border-bottom-width: 2px; background: rgba(255,255,255,.08); font: 700 11px/1 var(--pixel); color: var(--text); }

/* ---------- gate ---------- */
.gate { display: flex; align-items: center; padding: 0 var(--gutter); background: linear-gradient(90deg, rgba(3,6,4,.92) 0%, rgba(3,6,4,.7) 38%, rgba(3,6,4,0) 70%); }
.gate-in { max-width: 680px; display: grid; gap: 18px; justify-items: start; }
.gate-brand { display: inline-flex; align-items: center; gap: 12px; font: 900 20px/1 var(--display); margin-bottom: 10px; }
.gate-brand img { width: 46px; box-shadow: 0 8px 24px -6px rgba(0,200,5,.6); }
.gate h1 { margin: 0; font: 900 clamp(44px, 5.2vw, 80px)/.94 var(--display); letter-spacing: -.035em; text-transform: uppercase; }
.gate h1 em { font-style: normal; background: linear-gradient(100deg, #6bff86, var(--green) 40%, var(--gold) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate p { margin: 0; color: #c7d1cb; font-size: 17px; max-width: 470px; }
.gate-go { height: 60px; padding: 0 34px; font-size: 15px; margin-top: 6px; }
.gate-who { font: 600 12px/1 var(--mono); color: var(--mute); min-height: 12px; }
.gate-steps { list-style: none; margin: 8px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.gate-steps li { display: flex; gap: 12px; align-items: baseline; color: #c7d1cb; font-weight: 600; }
.gate-steps b { font: 700 11px/1 var(--pixel); color: var(--green); letter-spacing: .1em; }
@media (max-width: 720px) {
  .gate { align-items: flex-end; padding: 16px 16px max(28px, env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(3,6,4,.96) 0%, rgba(3,6,4,.82) 55%, rgba(3,6,4,0) 100%); }
  .gate-brand { margin-bottom: 0; }
  .gate h1 { font-size: 46px; }
  .gate p { font-size: 15px; }
  .gate-go { width: 100%; }
  .gate-steps { display: none; }
}

/* ---------- creator ---------- */
#creator { display: flex; justify-content: flex-end; align-items: stretch; padding: 18px; pointer-events: none; }
.cr { pointer-events: auto; width: min(460px, 100%); max-height: 100%; overflow: auto; display: grid; gap: 16px; align-content: start; padding: 26px; border-radius: 24px; border: 1px solid var(--line2); background: linear-gradient(180deg, rgba(14,21,16,.9), rgba(7,10,8,.92)); backdrop-filter: blur(16px); box-shadow: 0 30px 90px -20px rgba(0,0,0,.7); }
.cr-head h1 { margin: 8px 0 6px; font: 900 40px/.95 var(--display); text-transform: uppercase; letter-spacing: -.03em; }
.cr-head h1 em { font-style: normal; color: var(--green); }
.cr-head p { margin: 0; color: var(--mute); font-size: 14px; }
.cr-name { display: grid; gap: 8px; }
.cr-name input { height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(0,0,0,.35); font: 800 18px/1 var(--body); outline: none; transition: border-color .2s; }
.cr-name input:focus { border-color: var(--green); }
.cr-name small { font-size: 12px; color: var(--mute); }
.cr-name small.ok { color: var(--green); } .cr-name small.bad { color: var(--red); }
.cr-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.35); border: 1px solid var(--line); }
.cr-tabs button { height: 38px; border: 0; border-radius: 10px; background: none; font: 800 13px/1 var(--body); color: var(--mute); }
.cr-tabs button.on { background: rgba(255,255,255,.09); color: var(--text); }
.cr-panel { display: grid; gap: 16px; }
.cr-group { display: grid; gap: 10px; }
.cr-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-opts .sw { width: 34px; height: 34px; border-radius: 10px; border: 2px solid rgba(255,255,255,.12); background: var(--c); box-shadow: inset 0 -6px 0 rgba(0,0,0,.18); transition: transform .15s, border-color .15s; }
.cr-opts .sw:hover { transform: translateY(-2px); }
.cr-opts .sw.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(0,200,5,.55), inset 0 -6px 0 rgba(0,0,0,.18); }
.cr-opts .chip { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); font: 700 13px/1 var(--body); }
.cr-opts .chip.on { border-color: var(--green); background: rgba(0,200,5,.14); color: #d9ffe0; }
.cr-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.cr-cancel { border: 0; background: none; color: var(--mute); font-weight: 700; justify-self: center; }
.cr-note { margin: 0; font-size: 12px; color: var(--dim); text-align: center; }
@media (max-width: 900px) {
  #creator { align-items: flex-end; padding: 0; }
  .cr { width: 100%; max-height: 62dvh; overflow-x: hidden; border-radius: 24px 24px 0 0; padding: 20px 16px max(20px, env(safe-area-inset-bottom)); }
  .cr-actions { grid-template-columns: 1fr 1.7fr; }
  .cr-actions .btn { padding: 0 10px; font-size: 12px; letter-spacing: .03em; }
  .cr-head h1 { font-size: 28px; } .cr-head p { display: none; }
}

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; z-index: 10; pointer-events: none; font-family: var(--body); }
#hud > * { pointer-events: auto; }
#hud .labels, #hud .aim, #hud .aim-q, #hud .feed, #hud .hud-loc, #hud .hud-radar, #hud .hud-help, #hud .hud-target { pointer-events: none; }
.glass { background: rgba(8,12,9,.62); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(10px); }
.hud-me { position: absolute; top: 16px; left: 16px; display: flex; align-items: center; gap: 12px; padding: 6px 14px 6px 6px; border-radius: 16px; border: 1px solid rgba(255,255,255,.12); background: rgba(8,12,9,.66); backdrop-filter: blur(10px); text-align: left; transition: border-color .2s, transform .2s; }
.hud-me:hover { border-color: rgba(0,200,5,.6); transform: translateY(-1px); }
.hud-me img { width: 44px; height: 44px; border-radius: 10px; image-rendering: pixelated; background: #1b2a1f; box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); }
.hud-me b { display: block; font: 800 15px/1.1 var(--body); }
.hud-me small { display: block; font: 500 12px/1.3 var(--pixel); color: var(--mute); letter-spacing: .02em; }
.hud-me-arrow svg { width: 14px; height: 14px; color: var(--green); }
.hud-loc { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 4px; padding: 9px 18px; border-radius: 14px; background: rgba(8,12,9,.5); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(8px); white-space: nowrap; }
.hud-loc b { font: 800 14px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.hud-loc span { font: 500 11.5px/1 var(--pixel); color: var(--mute); }
.hud-right { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; align-items: center; }
.hud-eth { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; background: rgba(8,12,9,.66); border: 1px solid rgba(255,255,255,.1); font: 700 13px/1 var(--pixel); }
.hud-eth svg { width: 14px; height: 14px; color: var(--gold); }
.hud-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(8,12,9,.66); }
.hud-ico svg { width: 18px; height: 18px; }
.hud-pop { position: absolute; top: 64px; right: 16px; z-index: 5; display: grid; min-width: 230px; padding: 6px; border-radius: 16px; background: rgba(10,15,11,.95); border: 1px solid var(--line2); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.hud-pop button, .hud-pop a { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border: 0; border-radius: 10px; background: none; text-align: left; font: 700 14px/1 var(--body); }
.hud-pop button:hover, .hud-pop a:hover { background: rgba(255,255,255,.06); }
.hud-map { position: absolute; top: 66px; right: 16px; width: 132px; height: 132px; border-radius: 50%; overflow: hidden; border: 3px solid rgba(8,12,9,.8); box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 12px 30px rgba(0,0,0,.45); }
.hud-map canvas { width: 132px; height: 132px; image-rendering: pixelated; display: block; }
.hud-map-me { position: absolute; left: 50%; top: 50%; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 14px solid #fff; transform: translate(-50%, -60%); filter: drop-shadow(0 0 3px #000); }
.hud-map-n { position: absolute; left: 50%; top: 50%; margin: -9px 0 0 -9px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: #0b100d; font: 700 10px/1 var(--pixel); color: var(--gold); }
.hud-radar { position: absolute; top: 210px; right: 16px; display: grid; gap: 6px; justify-items: end; }
.rad { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 12px; border-radius: 10px; background: rgba(8,12,9,.66); border: 1px solid rgba(255,255,255,.08); font-size: 12.5px; }
.rad b { font-weight: 800; } .rad span { font: 500 11px/1 var(--pixel); color: var(--mute); }
.rad .arr svg { width: 14px; height: 14px; color: var(--tc, var(--gold)); }
.rad .arr { display: inline-grid; }
.rad--shrine { --tc: #f2c14e; border-color: rgba(242,193,78,.35); }
.tier-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--tc, #aaa); box-shadow: 0 0 8px var(--tc, #aaa); flex: none; }
.hud-target { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 16px; background: rgba(8,12,9,.78); border: 1px solid color-mix(in srgb, var(--tc) 50%, transparent); box-shadow: 0 0 30px -8px var(--tc); backdrop-filter: blur(10px); white-space: nowrap; animation: pop .25s ease; }
.hud-target img { width: 46px; height: 46px; image-rendering: pixelated; background: rgba(255,255,255,.05); border-radius: 10px; }
.hud-target b { display: block; font: 800 15px/1.1 var(--body); }
.hud-target span { display: flex; align-items: center; gap: 6px; font: 500 12px/1.3 var(--pixel); color: var(--mute); }
.hud-target .key { margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--line); color: var(--text); font: 700 12px/1 var(--body); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px) scale(.96); } }
.aim { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.aim i, .aim b { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); border-radius: 50%; }
.aim i { border: 4px solid #fff; box-shadow: 0 0 16px rgba(0,0,0,.4), inset 0 0 12px rgba(255,255,255,.2); transition: border-color .1s; }
.aim b { border: 2px dashed rgba(255,255,255,.85); }
.aim-q { position: absolute; left: 50%; top: 38%; transform: translate(-50%, 10px); font: 900 34px/1 var(--display); letter-spacing: -.01em; text-transform: uppercase; opacity: 0; transition: opacity .2s, transform .3s; text-shadow: 0 4px 0 rgba(0,0,0,.35); }
.aim-q.show { opacity: 1; transform: translate(-50%, 0); }
.aim-q.q1 { color: #43a6ff; } .aim-q.q2 { color: #4dff6e; } .aim-q.q3 { color: var(--gold); }
.hotbar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(8,12,9,.7); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(8px); }
.slot { position: relative; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 9px; border: 2px solid rgba(255,255,255,.08); background: rgba(255,255,255,.04); padding: 0; }
.slot.empty { opacity: .55; }
.slot img { width: 56px; height: 56px; image-rendering: pixelated; margin-top: -8px; }
.slot:hover { border-color: var(--tc); }
.slot::after { content: ''; position: absolute; inset: auto 6px 4px; height: 3px; border-radius: 2px; background: var(--tc); opacity: .8; }
.slot-n { position: absolute; top: 3px; left: 5px; font: 700 10px/1 var(--pixel); color: var(--mute); }
.slot em { position: absolute; bottom: 7px; left: 0; right: 0; font: 700 9.5px/1 var(--pixel); font-style: normal; color: var(--gold); text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 3px; }
.slot em.go { color: var(--green); }
.slot.is-live { border-color: rgba(242,193,78,.45); }
.labels { position: absolute; inset: 0; overflow: hidden; }
.mon-tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; background: rgba(5,8,6,.66); border-bottom: 2px solid var(--tc); font: 700 12px/1 var(--body); white-space: nowrap; will-change: transform; }
.mon-tag span { font: 500 10px/1 var(--pixel); color: var(--tc); text-transform: uppercase; letter-spacing: .06em; }
.mon-tag.is-target { background: rgba(5,8,6,.88); box-shadow: 0 0 0 1px var(--tc), 0 0 18px -4px var(--tc); }
.feed { position: absolute; left: 16px; bottom: 96px; display: grid; gap: 6px; width: min(420px, calc(100vw - 32px)); }
.feed-item { padding: 9px 14px; border-radius: 12px; background: rgba(8,12,9,.72); border: 1px solid rgba(255,255,255,.08); font-size: 13.5px; line-height: 1.4; animation: feedin .3s ease; transition: opacity .6s, transform .6s; }
.feed-item[data-tier="legendary"] { border-color: rgba(242,193,78,.5); box-shadow: 0 0 24px -10px var(--gold); }
.feed-item[data-tier="epic"] { border-color: rgba(255,138,61,.5); }
.feed-item b { color: #fff; }
.feed-item.out { opacity: 0; transform: translateX(-12px); }
@keyframes feedin { from { opacity: 0; transform: translateY(8px); } }
.hud-help { position: absolute; left: 16px; bottom: 16px; max-width: min(400px, calc(50vw - 330px)); padding: 10px 14px; border-radius: 12px; background: rgba(8,12,9,.6); font-size: 12.5px; color: #c7d1cb; line-height: 1.8; transition: opacity 1s; }
.hud-help.fade { opacity: 0; }
@media (max-width: 1320px) { .hud-help { display: none; } }
@media (max-width: 760px) {
  .hud-me { top: max(10px, env(safe-area-inset-top)); left: 10px; padding: 4px 10px 4px 4px; gap: 8px; }
  .hud-me img { width: 36px; height: 36px; }
  .hud-me b { font-size: 13px; } .hud-me small { font-size: 10.5px; }
  .hud-me-arrow { display: none; }
  .hud-loc { top: calc(max(10px, env(safe-area-inset-top)) + 152px); left: auto; right: 10px; transform: none; justify-items: end; padding: 6px 10px; }
  .hud-loc b { font-size: 11px; } .hud-loc span { font-size: 10px; }
  .hud-right { top: max(10px, env(safe-area-inset-top)); right: 10px; }
  .hud-eth { display: none; }
  .hud-map { top: calc(max(10px, env(safe-area-inset-top)) + 50px); right: 10px; width: 96px; height: 96px; }
  .hud-map canvas { width: 96px; height: 96px; }
  .hud-radar { top: calc(max(10px, env(safe-area-inset-top)) + 200px); right: 10px; }
  .rad { height: 28px; font-size: 11.5px; }
  .hotbar { bottom: max(8px, env(safe-area-inset-bottom)); gap: 2px; padding: 3px; }
  .slot { width: 38px; height: 38px; } .slot img { width: 36px; height: 36px; margin-top: -4px; } .slot em, .slot-n { display: none; }
  .slot:nth-child(n+7) { display: none; }
  .hud-target { bottom: auto; top: calc(max(10px, env(safe-area-inset-top)) + 56px); left: 10px; transform: none; padding: 6px 10px 6px 6px; }
  .hud-target img { width: 36px; height: 36px; } .hud-target .key { display: none; }
  @keyframes pop { from { opacity: 0; } }
  .feed { bottom: calc(env(safe-area-inset-bottom) + 120px); left: 10px; width: calc(100vw - 150px); }
  .feed-item { font-size: 12px; padding: 7px 10px; }
}
/* touch controls */
#touchUi { position: absolute; inset: 0; z-index: 11; pointer-events: none; }
#touchUi > * { pointer-events: auto; }
.stick { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); background: rgba(8,12,9,.35); left: 28px; bottom: 110px; opacity: .45; transition: opacity .2s; pointer-events: none !important; }
.stick.on { opacity: 1; }
.stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.m-btn { position: absolute; right: 18px; display: grid; place-items: center; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); background: rgba(8,12,9,.55); font: 800 12px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: #fff; backdrop-filter: blur(6px); touch-action: none; }
.m-jump { width: 66px; height: 66px; bottom: calc(env(safe-area-inset-bottom) + 70px); right: 112px; }
.m-throw { width: 88px; height: 88px; bottom: calc(env(safe-area-inset-bottom) + 120px); gap: 2px; align-content: center; transition: border-color .2s, box-shadow .2s, opacity .2s; opacity: .55; }
.m-throw span { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(180deg, #e23b3b 48%, #1b1b1b 48% 56%, #f4f4f4 56%); box-shadow: inset 0 0 0 2px #1b1b1b; }
.m-throw.ready { opacity: 1; border-color: var(--green); box-shadow: 0 0 24px -4px var(--green); }

/* ---------- graded slab (reveal + launch) ---------- */
.rv { position: relative; display: grid; grid-template-columns: auto minmax(280px, 400px); gap: clamp(24px, 5vw, 70px); align-items: center; opacity: 0; transform: scale(.96); transition: opacity .4s, transform .5s cubic-bezier(.2,.9,.3,1.1); }
.rv.is-in { opacity: 1; transform: none; }
.rv-rays { position: absolute; left: 25%; top: 50%; width: 900px; height: 900px; margin: -450px 0 0 -450px; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc) 22%, transparent) 0 6deg, transparent 6deg 18deg); mask: radial-gradient(circle, #000 0, transparent 60%); -webkit-mask: radial-gradient(circle, #000 0, transparent 60%); animation: rays 30s linear infinite; pointer-events: none; }
@keyframes rays { to { transform: rotate(360deg); } }
.rv-side .micro { color: var(--tc); }
.rv-side h2 { margin: 10px 0 12px; font: 900 clamp(38px, 5vw, 60px)/.95 var(--display); text-transform: uppercase; letter-spacing: -.03em; }
.rv-side p { color: #c7d1cb; margin: 0 0 22px; }
.rv-actions { display: grid; gap: 10px; }
.rv-note { font-size: 12.5px !important; color: var(--dim) !important; margin-top: 14px !important; }
@media (max-width: 820px) {
  .rv { grid-template-columns: 1fr; justify-items: center; gap: 18px; text-align: center; }
  .rv-rays { left: 50%; top: 32%; }
  .slab { width: min(270px, 70vw); }
  .rv-side h2 { font-size: 38px; margin: 6px 0; }
  .rv-side p { font-size: 14px; margin-bottom: 14px; }
}

.tx-panel, .dx { position: relative; width: min(1080px, 100%); max-height: calc(100dvh - 40px); overflow: auto; border-radius: 26px; border: 1px solid var(--line2); background: linear-gradient(180deg, #0e1510, #070a08); box-shadow: 0 40px 120px -20px rgba(0,0,0,.85); }

/* ---------- trade panel (tx) ---------- */
.tx-panel { padding: 26px; }
.tx-load { height: 420px; }
.tx-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding-right: 50px; margin-bottom: 18px; }
.tx-head img { width: 84px; height: 84px; object-fit: contain; background: radial-gradient(circle, rgba(0,200,5,.18), transparent 70%); }
.tx-head h2 { margin: 6px 0 4px; font: 900 34px/1 var(--display); }
.tx-head p { margin: 0; color: var(--mute); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tx-mc { text-align: right; display: grid; gap: 6px; justify-items: end; min-width: 180px; }
.tx-mc b { font: 900 28px/1 var(--display); color: var(--green); }
.tx-mc small { color: var(--mute); font-size: 12px; }
.bar { width: 100%; height: 6px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); border-radius: 4px; }
.tx-mc .bar { width: 180px; }
.tx-body { display: grid; grid-template-columns: 1fr 340px; gap: 18px; }
.tx-chart { display: grid; gap: 10px; min-width: 0; }
.tx-chart #txChart { height: 340px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0,0,0,.25); overflow: hidden; position: relative; }
.tx-trades { max-height: 190px; overflow: auto; }
.tx-side { display: grid; gap: 10px; align-content: start; }
@media (max-width: 900px) {
  .tx-panel { padding: 18px; }
  .tx-head { grid-template-columns: auto 1fr; padding-right: 40px; }
  .tx-head img { width: 60px; height: 60px; }
  .tx-head h2 { font-size: 24px; }
  .tx-mc { grid-column: 1 / -1; justify-items: start; text-align: left; }
  .tx-body { grid-template-columns: 1fr; }
  .tx-chart #txChart { height: 260px; }
}

/* ---------- dashboard (dx) ---------- */
.dx { padding: 28px; }
.dx-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding-right: 50px; }
.dx-face { width: 84px; height: 84px; border-radius: 18px; image-rendering: pixelated; box-shadow: 0 0 0 3px rgba(0,200,5,.5), 0 14px 40px rgba(0,0,0,.5); }
.dx-who h2 { margin: 6px 0; font: 900 34px/1 var(--display); }
.dx-addr { display: inline-flex; gap: 8px; align-items: center; border: 0; background: none; padding: 0; font: 600 12.5px/1 var(--mono); color: var(--mute); }
.dx-addr svg { width: 13px; height: 13px; }
.dx-public svg { width: 14px; height: 14px; }
.dx-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 22px 0; }
.dx-stats > div { padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); display: grid; gap: 8px; }
.dx-stats b { font: 900 24px/1 var(--display); } .dx-stats small { font-size: 12px; color: var(--mute); margin-left: 3px; }
.dx-fees { grid-template-columns: 1fr auto; align-items: end; }
.dx-fees .label { grid-column: 1 / -1; } .dx-fees b { color: var(--gold); font-size: 18px; }
.dx-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px solid var(--line); width: max-content; margin-bottom: 16px; }
.dx-tabs button { height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: none; font: 800 13.5px/1 var(--body); color: var(--mute); }
.dx-tabs button.on { background: rgba(255,255,255,.09); color: var(--text); }
.dx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tk { display: grid; gap: 12px; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)); transition: border-color .2s, transform .2s; }
.tk:hover { border-color: color-mix(in srgb, var(--tc) 50%, transparent); transform: translateY(-2px); }
.tk-art { position: relative; aspect-ratio: 1; border-radius: 12px; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--tc) 22%, transparent), rgba(0,0,0,.25) 70%); display: grid; place-items: center; overflow: hidden; }
.tk-art img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
.tk-art .tier { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); }
.tk-body { display: grid; gap: 6px; }
.tk-no { font: 600 11px/1 var(--mono); color: var(--mute); }
.tk-body b { font: 900 20px/1 var(--display); }
.tk-mc { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.tk-mc em { font-style: normal; font-size: 12px; } .up { color: var(--green); } .down { color: var(--red); }
.dx-bag { display: grid; gap: 8px; }
.bag-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.bag-row img { width: 56px; height: 56px; image-rendering: pixelated; background: rgba(255,255,255,.04); border-radius: 10px; }
.bag-row b { display: block; font-weight: 800; }
.bag-row span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--mute); }
.dx-empty { display: grid; justify-items: center; gap: 8px; padding: 50px 20px; text-align: center; }
.dx-empty img { width: 70px; opacity: .8; }
.dx-empty b { font: 800 18px/1 var(--display); } .dx-empty p { margin: 0; color: var(--mute); max-width: 420px; }
.dx-dexnote { margin: 0 0 12px; color: var(--mute); font-size: 13.5px; }
.dx-dex { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.dx-dex img, .dx-dex span { aspect-ratio: 1; width: 100%; border-radius: 8px; background: rgba(255,255,255,.03); }
.dx-dex img { image-rendering: pixelated; background: rgba(0,200,5,.1); }
.dx-dex span { display: grid; place-items: center; font: 600 9px/1 var(--mono); color: #34403a; }
@media (max-width: 900px) {
  .dx { padding: 18px; }
  .dx-head { grid-template-columns: auto 1fr; padding-right: 40px; }
  .dx-face { width: 60px; height: 60px; }
  .dx-who h2 { font-size: 24px; }
  .dx-public { grid-column: 1 / -1; justify-self: start; }
  .dx-stats { grid-template-columns: repeat(2, 1fr); }
  .dx-fees { grid-column: 1 / -1; }
}

/* ---------- MMO: other trainers, chat, online ---------- */
.hud-online { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font: 700 11px/1 var(--pixel); font-style: normal; color: #d9ffe0; }
.hud-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .4; } }
.pl-tag { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 4px; will-change: transform; pointer-events: none; }
.pl-tag b { padding: 4px 9px; border-radius: 8px; background: rgba(5,8,6,.72); border: 1px solid rgba(255,255,255,.18); font: 800 12.5px/1 var(--body); color: #fff; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.pl-tag p { margin: 0; max-width: 240px; padding: 7px 11px; border-radius: 12px 12px 12px 4px; background: #fff; color: #0b100d; font: 700 12.5px/1.35 var(--body); box-shadow: 0 6px 18px rgba(0,0,0,.35); animation: pop .2s ease; overflow-wrap: anywhere; }
.chat { position: absolute; left: 16px; bottom: 200px; width: min(380px, calc(100vw - 32px)); display: grid; gap: 6px; pointer-events: none; }
.chat.open { pointer-events: auto; }
.chat-log { display: grid; gap: 3px; }
.chat-line { justify-self: start; max-width: 100%; padding: 6px 10px; border-radius: 10px; background: rgba(5,8,6,.62); font-size: 13px; line-height: 1.35; color: #e6efe9; transition: opacity 1.2s; overflow-wrap: anywhere; }
.chat-line b { color: var(--green); margin-right: 4px; }
.chat-line.me b { color: var(--gold); }
.chat-line.sys b { color: var(--gold); }
.chat-line.old { opacity: 0; }
.chat.open .chat-line.old { opacity: .85; }
.chat-in { display: flex; gap: 6px; }
.chat-in input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(0,200,5,.55); background: rgba(5,8,6,.88); color: #fff; font: 600 14px/1 var(--body); outline: none; }
.chat-in button { height: 42px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--green); color: #021a06; font: 800 12px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 760px) {
  .chat { bottom: calc(env(safe-area-inset-bottom) + 220px); left: 10px; width: calc(100vw - 130px); }
  .chat-line { font-size: 11.5px; padding: 4px 8px; }
  .chat.open { width: calc(100vw - 20px); }
  #hudChatBtn { display: grid; }
}
/* ghost mode */
.pl-tag.is-ghost b { background: rgba(120,150,180,.35); border-color: rgba(207,232,255,.45); color: #e6f3ff; }
.pl-tag b em, .chat-line b em { margin-left: 6px; padding: 2px 6px; border-radius: 5px; background: #cfe8ff; color: #10202e; font: 800 9px/1 var(--body); font-style: normal; letter-spacing: .12em; text-transform: uppercase; vertical-align: 2px; }
.chat-line.ghost b { color: #cfe8ff; }
.hud-me.is-ghost { border-color: rgba(207,232,255,.45); }
.hud-me.is-ghost img { opacity: .6; filter: saturate(.2) brightness(1.3); }
.hud-me.is-ghost small { color: #cfe8ff; }
.gate-ghost { border: 0; background: none; padding: 4px 0; color: #c7d1cb; font: 700 14px/1.4 var(--body); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255,255,255,.3); cursor: pointer; }
.gate-ghost:hover { color: #fff; text-decoration-color: var(--green); }
.gate-ghost span { display: block; font-size: 12px; font-weight: 600; color: var(--mute); text-decoration: none; }
/* shiny tags, ball picker, daily quests, badge pop */
.mon-tag.is-shiny { border-bottom-color: #ffd34a; box-shadow: 0 0 18px -4px #ffd34a; }
.mon-tag .shiny-mark, .hud-target .shiny-mark { margin-right: 0; vertical-align: 0; }
.ico-ball { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(180deg, #e23b3b 46%, #1b1b1b 46% 56%, #f4f4f4 56%); box-shadow: inset 0 0 0 1.5px #1b1b1b; flex: none; }
.ico-ball.gold { background: linear-gradient(180deg, #ffe08a, #f2c14e 46%, #1b1b1b 46% 56%, #fff5d0 56%); }
.balls { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(8,12,9,.7); border: 1px solid rgba(255,255,255,.12); }
.balls button { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border: 0; border-radius: 9px; background: none; color: var(--mute); font: 700 12px/1 var(--body); }
.balls button.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.balls button[data-ball="golden"].on { background: rgba(242,193,78,.18); box-shadow: inset 0 0 0 1px rgba(242,193,78,.55); color: var(--gold-hi); }
.balls button:disabled { opacity: .4; cursor: not-allowed; }
.balls em { font: 700 11px/1 var(--pixel); font-style: normal; color: var(--gold); }
.quests { position: absolute; top: 80px; left: 16px; width: 270px; border-radius: 14px; background: rgba(8,12,9,.7); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(10px); overflow: hidden; }
.q-head { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 12px; border: 0; background: none; color: #fff; text-align: left; }
.q-head b { font: 800 12.5px/1 var(--body); letter-spacing: .04em; flex: 1; }
.q-head > span { font: 700 11.5px/1 var(--pixel); color: var(--green); }
.q-gold { display: inline-flex; align-items: center; gap: 4px; font-style: normal; margin-left: 4px; }
.q-gold em { font: 700 11.5px/1 var(--pixel); font-style: normal; color: var(--gold); }
.q-list { display: none; padding: 0 12px 10px; gap: 9px; }
.quests.open .q-list { display: grid; }
.q { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; font-size: 12px; color: #dfe8e2; }
.q span { line-height: 1.3; }
.q i { grid-column: 1 / -1; grid-row: 2; height: 4px; border-radius: 3px; background: rgba(255,255,255,.08); position: relative; overflow: hidden; }
.q i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: linear-gradient(90deg, var(--green), var(--gold)); }
.q em { font: 700 10.5px/1.3 var(--pixel); font-style: normal; color: var(--mute); }
.q.done span { color: var(--mute); text-decoration: line-through; }
.q.done em { color: var(--green); }
.q-note { margin: 2px 0 0; font-size: 10.5px; color: var(--dim); line-height: 1.4; }
.badge-pop { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; z-index: 6; }
.bp { display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 12px; border-radius: 16px; background: rgba(10,15,11,.92); border: 1px solid rgba(242,193,78,.45); box-shadow: 0 20px 60px -10px rgba(0,0,0,.6), 0 0 40px -12px var(--gold); }
.bp b { display: block; font: 900 17px/1.1 var(--display); margin-top: 4px; }
.bp small { display: block; color: var(--mute); font-size: 12px; margin-top: 3px; }
.bp .micro { color: var(--gold); font-size: 10px; }
.badge-pop.in .bp { animation: bpIn .5s cubic-bezier(.2,.9,.3,1.3); }
.badge-pop.out { opacity: 0; transition: opacity .5s; }
@keyframes bpIn { from { opacity: 0; transform: translateY(-14px) scale(.92); } }
.medal.locked { opacity: .7; }
@media (max-width: 760px) {
  .quests { top: calc(max(10px, env(safe-area-inset-top)) + 104px); left: 10px; width: 210px; }
  .balls { bottom: calc(env(safe-area-inset-bottom) + 56px); }
  .balls b { display: none; }
  .badge-pop { top: 70px; width: calc(100vw - 20px); }
}
/* dashboard: evolve + badges */
.dx-evo { display: grid; gap: 8px; margin-bottom: 14px; padding: 14px; border-radius: 16px; border: 1px solid rgba(242,193,78,.4); background: rgba(242,193,78,.06); }
.evo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.evo-from { display: flex; align-items: center; }
.evo-from img { width: 44px; height: 44px; image-rendering: pixelated; margin-right: -14px; }
.evo-from span { margin-left: 22px; font-weight: 800; }
.evo-to { display: flex; gap: 6px; flex-wrap: wrap; }
.evo-to .btn img { width: 30px; height: 30px; image-rendering: pixelated; margin: -6px -2px -6px -8px; }
.dx-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dxb { display: grid; justify-items: center; gap: 6px; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); text-align: center; }
.dxb b { font: 800 13px/1.1 var(--body); color: var(--mute); }
.dxb span { font-size: 11px; color: var(--dim); line-height: 1.35; }
.dxb.on { border-color: rgba(242,193,78,.35); background: rgba(242,193,78,.05); }
.dxb.on b { color: #fff; }
/* swimming: breath bubbles, dive button, underwater tint */
.air { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); display: flex; gap: 3px; padding: 5px 8px; border-radius: 10px; background: rgba(8,12,9,.5); }
.air i { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, #9fd8ff 28%, #3a8fd8 70%, #1f5f9e); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); transition: transform .2s, opacity .2s; }
.air i.gone { transform: scale(.3); opacity: 0; }
.air.low i { animation: airlow .5s ease-in-out infinite alternate; }
@keyframes airlow { to { transform: scale(.82); filter: hue-rotate(160deg) saturate(1.6); } }
.m-dive { width: 66px; height: 66px; bottom: calc(env(safe-area-inset-bottom) + 150px); right: 112px; border-color: rgba(120,190,255,.6); }
.underwater { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: radial-gradient(120% 90% at 50% 40%, rgba(40,120,200,.18), rgba(6,30,70,.55)); mix-blend-mode: multiply; }
@media (max-width: 760px) { .air { bottom: calc(env(safe-area-inset-bottom) + 96px); } }
