:root {
  --pink: #ff5fb8; --hot: #ff2f92; --lilac: #c9a7ff; --ink: #2a1630; --glass: rgba(255, 240, 248, 0.78);
  --glass2: rgba(40, 14, 44, 0.62); --cyan: #7af7ff;
  --r: 18px; --shadow: 0 10px 30px rgba(120, 0, 70, 0.25);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f3c6dc; color: var(--ink); overscroll-behavior: none; }
#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
a { color: var(--hot); }

/* labels */
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; white-space: nowrap; text-align: center; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.5); color: #fff; will-change: transform; }
.tag .cb { font-weight: 600; opacity: .8; margin-left: 4px; font-size: 10px; color: #ffe; }
.mtag .nm { color: #ffe14d; }
.hpbar { width: 46px; height: 5px; margin: 2px auto 0; background: #6a0d2a; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #7dff9a, #3ddc84); }
.badge { color: #ffd76a; margin-right: 3px; text-shadow: 0 0 6px #ff5fb8; }
.nc-pink { color: #ff6fc4 !important; text-shadow: 0 0 8px #ff2f92, 0 1px 2px #000; }
.nc-holo { background: linear-gradient(90deg, #7af7ff, #ff9bf2, #fff38a, #7af7ff); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: holo 3s linear infinite; text-shadow: none; filter: drop-shadow(0 1px 1px #000); }
@keyframes holo { to { background-position: 200% 0; } }
.bubble { background: #fff; color: var(--ink); text-shadow: none; font-weight: 700; padding: 5px 10px; border-radius: 14px; max-width: 220px; white-space: normal; box-shadow: var(--shadow); font-size: 13px; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; transform: translateX(-50%); }
.splat { font-weight: 900; font-size: 15px; width: 28px; height: 28px; line-height: 28px; border-radius: 50%; color: #fff; text-shadow: 0 1px 1px #000; }
.splat.dmg { background: radial-gradient(circle at 35% 35%, #ff7fb8, #d6005c); box-shadow: 0 0 10px #ff2f92; }
.splat.miss { background: radial-gradient(circle at 35% 35%, #9fd8ff, #2a7bd6); }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hover { position: fixed; left: 10px; top: calc(8px + env(safe-area-inset-top)); color: #fff; font-weight: 800; text-shadow: 0 1px 2px #000; pointer-events: none !important; font-size: 14px; }
#hover .red { color: #ffe14d; } #hover em { color: #ffb3b3; font-style: normal; font-size: 12px; }
#topright { position: fixed; right: 10px; top: calc(10px + env(safe-area-inset-top)); width: 150px; height: 150px; }
#minimap { width: 150px; height: 150px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--pink), var(--shadow); background: #3d6e3a; cursor: crosshair; }
.orb { position: absolute; left: -16px; bottom: -6px; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: #3a0f22; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--pink); }
.orb i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(#ff7fb0, #e0005e); transition: height .3s; }
.orb span { position: relative; display: block; text-align: center; line-height: 40px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000; }
#xpdrops { position: fixed; right: 170px; top: calc(20px + env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: flex-end; pointer-events: none !important; }
.drop { color: #fff; font-weight: 900; text-shadow: 0 1px 2px #000; animation: rise 1.8s ease-out forwards; display: flex; align-items: center; gap: 4px; }
.drop .ico { width: 22px; height: 22px; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } 15% { opacity: 1; transform: none; } to { transform: translateY(-40px); opacity: 0; } }

#chat { position: fixed; left: 8px; bottom: calc(64px + env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 16px)); }
#chatlog { max-height: 140px; overflow-y: auto; font-size: 13px; padding: 6px 8px; border-radius: 14px 14px 0 0; background: var(--glass2); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); scrollbar-width: thin; }
#chatlog .line { margin: 2px 0; text-shadow: 0 1px 1px rgba(0,0,0,.6); }
#chatlog .sys { color: #ffd1ec; font-style: italic; }
#chatlog b { color: var(--cyan); }
#chatin { width: 100%; border: 0; padding: 9px 12px; border-radius: 0 0 14px 14px; background: rgba(255,255,255,.9); font: inherit; font-size: 16px; outline: none; }
#dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 4px; background: linear-gradient(transparent, rgba(60,10,50,.35)); }
#dock button { width: 46px; height: 46px; border-radius: 14px; border: 2px solid #fff; background: var(--glass); font-size: 21px; box-shadow: var(--shadow); transition: transform .12s; }
#dock button svg { width: 26px; height: 26px; display: block; margin: auto; }
#dock button.on { background: linear-gradient(135deg, #ff9ad5, #c9a7ff); transform: translateY(-4px); }
#panel { position: fixed; right: 10px; bottom: calc(66px + env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 20px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--glass); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border: 2px solid #fff; border-radius: var(--r); box-shadow: var(--shadow); }
#panel header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 6px; }
#panel h3 { margin: 0; font-size: 18px; background: linear-gradient(90deg, var(--hot), #8a4dff); -webkit-background-clip: text; background-clip: text; color: transparent; }
#pclose, .x { border: 0; background: #fff; width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--hot); }
#pbody { overflow-y: auto; padding: 4px 14px 14px; }
#pbody h4 { margin: 12px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #8a3b6c; }
.hint, .legal, .fine { font-size: 12px; color: #6d4a63; }
.ico { width: 34px; height: 34px; }
.inv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.slot { position: relative; aspect-ratio: 1; border-radius: 12px; border: 2px solid #ffd1ec; background: rgba(255,255,255,.6); display: grid; place-items: center; padding: 2px; }
.slot:disabled { opacity: .5; cursor: default; }
.slot em { position: absolute; left: 4px; top: 2px; font-style: normal; font-weight: 900; font-size: 11px; color: #c2187a; }
.bank { margin-top: 8px; }
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.skill { display: flex; gap: 6px; align-items: center; background: rgba(255,255,255,.6); border-radius: 12px; padding: 6px; }
.skill > div { flex: 1; } .skill b { font-size: 12px; display: block; } .skill span { font-weight: 900; font-size: 18px; color: var(--hot); }
.bar { height: 5px; border-radius: 3px; background: #f3d3e4; overflow: hidden; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--lilac)); }
.total { text-align: center; }
.seg { display: flex; gap: 6px; } .seg.wrap { flex-wrap: wrap; }
.seg button { flex: 1; border: 2px solid #ffd1ec; background: rgba(255,255,255,.7); border-radius: 12px; padding: 7px 8px; font-weight: 700; color: var(--ink); }
.seg button.on { background: linear-gradient(135deg, #ff9ad5, #c9a7ff); border-color: #fff; color: #fff; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #e9b6d3; }
.sw.on { box-shadow: 0 0 0 3px var(--hot); }
.wr { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.wi { flex: 0 0 82px; border: 2px solid #ffd1ec; background: rgba(255,255,255,.7); border-radius: 12px; padding: 4px; font-size: 11px; font-weight: 700; min-height: 48px; }
.wi.on { border-color: var(--hot); box-shadow: 0 0 0 2px #ffd1ec; }
.wi .art { width: 52px; height: 52px; display: block; margin: 0 auto; }
.wi.ghost { color: var(--hot); }
.emotes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.emotes button { border: 2px solid #ffd1ec; background: #fff; border-radius: 12px; padding: 10px; font-weight: 800; }
.emotes .locked { opacity: .65; }
.shopgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card { background: rgba(255,255,255,.75); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; border: 2px solid #fff; }
.card .art { width: 72px; height: 72px; filter: drop-shadow(0 4px 6px rgba(200,0,100,.25)); }
.card b { font-size: 13px; } .card small { font-size: 11px; color: #6d4a63; min-height: 28px; }
.card button { width: 100%; border: 0; border-radius: 10px; padding: 7px; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--hot), #8a4dff); }
.card button:disabled { background: #b7e8c8; color: #1d6b3a; }
.card.owned { border-color: #b7e8c8; }
.tipamt { width: 100%; border: 2px solid #ffd1ec; border-radius: 8px; padding: 4px; font: inherit; text-align: center; }
.hs { padding-left: 22px; } .hs li { margin: 4px 0; } .hs li span { float: right; font-size: 12px; color: #6d4a63; }
.btn { display: inline-block; border: 0; border-radius: 14px; padding: 11px 16px; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--hot), #8a4dff); text-decoration: none; text-align: center; box-shadow: 0 6px 16px rgba(255, 47, 146, .35); }
.btn.alt { background: linear-gradient(135deg, #7a5cff, #33c6ff); }
.btn.ghost { background: #fff; color: var(--hot); box-shadow: none; border: 2px solid #ffd1ec; }
.btn:disabled { opacity: .6; }
#ctx { position: fixed; z-index: 20; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
#ctx b { font-size: 13px; padding: 2px 6px; color: var(--hot); }
#ctx button { border: 0; background: #fff0f8; border-radius: 10px; padding: 8px; text-align: left; font-weight: 700; }

/* auth */
#auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at top, rgba(255,95,184,.25), transparent 60%); }
.authcard { width: min(380px, 100%); background: var(--glass); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); border: 2px solid #fff; border-radius: 26px; padding: 22px; box-shadow: var(--shadow); text-align: center; }
.logo { margin: 0; font-size: 46px; line-height: 1; font-weight: 1000; letter-spacing: -1px; color: #fff; -webkit-text-stroke: 2px var(--hot); text-shadow: 3px 3px 0 var(--hot), 6px 6px 0 #8a4dff; font-style: italic; }
.logo span { color: #fff38a; margin-left: 4px; }
.tag { margin: 10px 0 14px; } .authcard .tag { position: static; font-weight: 700; color: #6d2a58; text-shadow: none; white-space: normal; font-size: 13px; }
#authform { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
#authform input { border: 2px solid #ffd1ec; border-radius: 14px; padding: 12px; font: inherit; font-size: 16px; background: #fff; outline: none; }
#authform input:focus { border-color: var(--pink); }
#autherr { color: #c4003d; font-weight: 700; min-height: 1em; margin: 0; font-size: 13px; }
#loading { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; gap: 8px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000; pointer-events: none; }
.heartbeat { font-size: 42px; animation: beat 1s infinite; } @keyframes beat { 50% { transform: scale(1.2); } }
#toast { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translate(-50%, -80px); background: #fff; color: var(--ink); padding: 10px 16px; border-radius: 16px; font-weight: 800; box-shadow: var(--shadow); transition: transform .3s; z-index: 50; max-width: 90vw; text-align: center; }
#toast.on { transform: translate(-50%, 0); }

/* pay modal */
#modal { position: fixed; inset: 0; z-index: 40; background: rgba(40, 10, 40, .45); display: grid; place-items: center; padding: 12px; }
.sheet { position: relative; width: min(400px, 100%); max-height: 94vh; overflow-y: auto; background: #fff; border-radius: 24px; padding: 18px; box-shadow: var(--shadow); text-align: center; }
.sheet .x { position: absolute; right: 10px; top: 10px; background: #fff0f8; }
.payhead { display: flex; gap: 10px; align-items: center; justify-content: center; } .payhead .art { width: 64px; height: 64px; }
.payhead h3 { margin: 0; } .amt { font-size: 22px; font-weight: 1000; color: var(--hot); }
.qr { width: 220px; height: 220px; margin: 10px auto; padding: 6px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 3px #ffd1ec; }
.qr svg { width: 100%; height: 100%; }
.paybtns { display: flex; flex-direction: column; gap: 8px; }
.status { margin-top: 10px; font-weight: 800; }
.spin { display: inline-block; width: 12px; height: 12px; border: 3px solid #ffd1ec; border-top-color: var(--hot); border-radius: 50%; animation: sp 1s linear infinite; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  #topright, #minimap { width: 112px; height: 112px; }
  #xpdrops { right: 130px; }
  #chat { bottom: calc(62px + env(safe-area-inset-bottom)); width: calc(100vw - 16px); }
  #chatlog { max-height: 88px; font-size: 12px; }
  #panel { left: 8px; right: 8px; width: auto; bottom: calc(62px + env(safe-area-inset-bottom)); max-height: 62vh; z-index: 5; }
  #dock button { width: 40px; height: 42px; font-size: 19px; }
  .orb { width: 40px; height: 40px; } .orb span { line-height: 34px; }
}
