@font-face { font-family: 'Pixelify Sans'; src: url('../fonts/pixelify-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Pixelify Sans'; src: url('../fonts/pixelify-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Pixelify Sans'; src: url('../fonts/pixelify-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --btn: #2f4a54; --btn-hi: #7fa6b0; --btn-lo: #16262c; --btn-hover: #3c6573; --ring: #49d6e3;
  --sol1: #9945ff; --sol2: #14f195; --gold: #ffd84a; --red: #e8452c; --ink: #fff; --dim: #b9c3c7;
  --shadow: 2px 2px 0 #1a1a1a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--ink); font-family: 'Pixelify Sans', ui-monospace, monospace; font-weight: 500; -webkit-font-smoothing: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a { color: inherit; }
#ui { position: fixed; inset: 0; overflow-y: auto; z-index: 2; }
#ui[hidden] { display: none; }
body:not([data-screen="title"]):not([data-screen="game"]) #ui { background: rgba(8, 10, 14, .62); }
body[data-screen="title"] #ui { background: radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0) 30%, rgba(0,0,0,.35) 100%); }

/* ---------- buttons ---------- */
.mc { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; padding: 6px 14px; margin: 0; font: inherit; font-size: 18px; color: #f4f4f4; text-shadow: var(--shadow); text-decoration: none; cursor: pointer;
  background: var(--btn); border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--btn-hi), inset -2px -2px 0 var(--btn-lo); image-rendering: pixelated; border-radius: 0; }
.mc:hover:not(:disabled), .mc:focus-visible { background: var(--btn-hover); outline: none; box-shadow: inset 2px 2px 0 #a8d2dc, inset -2px -2px 0 var(--btn-lo), 0 0 0 2px var(--ring); }
.mc:active:not(:disabled) { box-shadow: inset -2px -2px 0 var(--btn-hi), inset 2px 2px 0 var(--btn-lo); }
.mc:disabled { color: #8a8f91; background: #2a3235; box-shadow: inset 2px 2px 0 #3d4649, inset -2px -2px 0 #1b2023; cursor: default; }
.mc.sm { min-height: 30px; font-size: 14px; padding: 3px 10px; width: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.field { width: 100%; padding: 8px 10px; font: inherit; font-size: 17px; color: #fff; background: #000; border: 2px solid #a0a0a0; outline: none; border-radius: 0; user-select: text; -webkit-user-select: text; }
.field:focus { border-color: #fff; }
textarea.field { resize: vertical; }
.lbl { display: block; margin: 4px 0 4px; color: var(--dim); font-size: 15px; text-shadow: var(--shadow); text-align: center; }
.desc { margin: 0; color: #9ea9ad; font-size: 14px; text-align: center; text-shadow: var(--shadow); line-height: 1.3; }
.pill { font: inherit; font-size: 14px; color: #fff; background: rgba(0,0,0,.55); border: 2px solid #000; box-shadow: inset 1px 1px 0 #555; padding: 5px 10px; cursor: pointer; }
.pill:hover { background: rgba(40,40,40,.8); }

/* ---------- title ---------- */
.title { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 70px 16px 90px; }
#logo { image-rendering: pixelated; max-width: min(92vw, 760px); height: auto; filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); }
.edition { margin-top: -6px; padding: 3px 12px; font-size: clamp(14px, 2.2vw, 20px); font-weight: 700; letter-spacing: .08em; color: #eafff6; text-shadow: var(--shadow);
  background: linear-gradient(90deg, #3b1d6e, #1d5e4c); border: 2px solid #000; box-shadow: inset 2px 2px 0 rgba(255,255,255,.25), inset -2px -2px 0 rgba(0,0,0,.35); }
.splash { margin-top: 6px; padding: 2px 10px; font-size: clamp(13px, 1.9vw, 17px); color: #ffe26a; text-shadow: var(--shadow); background: #b8321e; border: 2px solid #000; transform: rotate(-2deg); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: rotate(-2deg) scale(1.06); } }
.menu { width: min(400px, 92vw); display: grid; gap: 10px; margin-top: 26px; }
.hint { max-width: 420px; margin: 12px 0 0; text-align: center; font-size: 14px; color: #c8d2d6; text-shadow: var(--shadow); }
.corner { position: fixed; z-index: 3; display: flex; gap: 8px; align-items: center; font-size: 14px; text-shadow: var(--shadow); }
.corner.tr { top: 10px; right: 10px; } .corner.bl { bottom: 10px; left: 10px; } .corner.br { bottom: 10px; right: 12px; color: #ddd; }
.corner.br a { text-decoration: none; } .corner.br a:hover { text-decoration: underline; }
.xlink { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; }
.xic { display: inline-grid; place-items: center; width: 26px; height: 26px; background: #000; border: 2px solid #fff; font-size: 14px; }
.xlink:hover { text-decoration: underline; }

/* CA */
.ca { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; max-width: min(760px, 96vw); padding: 8px 10px; background: rgba(0,0,0,.62); border: 2px solid #000; box-shadow: inset 2px 2px 0 rgba(153,69,255,.55), inset -2px -2px 0 rgba(20,241,149,.35); }
.ca-t { font-weight: 700; color: var(--sol2); text-shadow: var(--shadow); }
.ca code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: #fff; background: #000; padding: 5px 7px; border: 1px solid #444; user-select: all; -webkit-user-select: all; word-break: break-all; }
.ca-n { display: inline-flex; gap: 8px; font-size: 14px; color: #ffe26a; text-shadow: var(--shadow); } .ca-n i { color: #cfd; font-style: normal; }

/* ---------- panels ---------- */
.panel { width: min(560px, 94vw); margin: 0 auto; padding: 46px 0 40px; display: grid; gap: 9px; }
.panel h2 { margin: 0 0 6px; text-align: center; font-size: 22px; font-weight: 500; text-shadow: var(--shadow); }
.list { width: min(720px, 96vw); }
.worlds { height: min(52vh, 460px); overflow-y: auto; background: rgba(0,0,0,.5); border-top: 2px solid #000; border-bottom: 2px solid #000; padding: 4px; }
.wrow { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border: 2px solid transparent; cursor: pointer; }
.wrow:hover { background: rgba(255,255,255,.06); } .wrow.sel { border-color: #c6c6c6; background: rgba(255,255,255,.08); }
.wrow:focus-visible { outline: 2px solid var(--ring); }
.wrow img, .wrow canvas { width: 48px; height: 48px; image-rendering: pixelated; object-fit: cover; background: #222; }
.wl p { margin: 1px 0; font-size: 15px; text-shadow: var(--shadow); } .wl .dim { color: #9fa9ad; font-size: 14px; }
.m-creative { color: #55e3ff; } .m-survival { color: #7cff5a; } .m-coin { color: var(--gold); } .live { color: #7cff5a; }
.cap { align-self: start; font-size: 14px; color: #ddd; text-shadow: var(--shadow); }
.empty { text-align: center; color: #aaa; margin-top: 40px; text-shadow: var(--shadow); }
.slider { display: block; position: relative; }
.slider span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; font-size: 17px; text-shadow: var(--shadow); z-index: 1; }
.slider input { -webkit-appearance: none; appearance: none; width: 100%; height: 40px; margin: 0; background: #000; border: 2px solid #000; box-shadow: inset 0 0 0 2px #555; cursor: pointer; }
.slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 40px; background: var(--btn); border: 2px solid #000; box-shadow: inset 2px 2px 0 var(--btn-hi), inset -2px -2px 0 var(--btn-lo); }
.slider input::-moz-range-thumb { width: 12px; height: 36px; border-radius: 0; background: var(--btn); border: 2px solid #000; }
.loading { padding-top: 30vh; } .bar { height: 10px; background: #333; border: 2px solid #000; } .bar i { display: block; height: 100%; width: 10%; background: linear-gradient(90deg, var(--sol1), var(--sol2)); transition: width .4s; }

/* skins */
.skins { width: min(720px, 96vw); }
.skin-wrap { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
.skin-prev { text-align: center; background: rgba(0,0,0,.35); padding: 10px; } .skin-prev p { margin: 0 0 6px; text-shadow: var(--shadow); }
.skin-prev canvas { width: 160px; height: 320px; image-rendering: pixelated; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.preset { font: inherit; font-size: 12px; color: #fff; background: rgba(0,0,0,.45); border: 2px solid #000; padding: 4px; cursor: pointer; display: grid; justify-items: center; gap: 2px; }
.preset:hover { border-color: var(--ring); } .preset canvas { width: 24px; height: 48px; image-rendering: pixelated; }
.parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.parts label { display: flex; gap: 6px; align-items: center; font-size: 14px; text-shadow: var(--shadow); background: rgba(0,0,0,.35); padding: 4px; }
.parts input { width: 30px; height: 26px; border: 2px solid #000; padding: 0; background: none; cursor: pointer; }
.inv .grid { display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 4px; justify-content: center; background: rgba(0,0,0,.5); padding: 8px; border: 2px solid #000; }
.slot { width: 52px; height: 52px; display: grid; place-items: center; background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737; cursor: pointer; padding: 0; }
.slot:hover { background: #a8a8a8; } .slot canvas { width: 40px; height: 40px; image-rendering: pixelated; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#hud[hidden] { display: none; }
.cross { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; mix-blend-mode: difference; }
.cross::before, .cross::after { content: ''; position: absolute; background: #fff; } .cross::before { left: 8px; top: 0; width: 2px; height: 18px; } .cross::after { top: 8px; left: 0; height: 2px; width: 18px; }
.info { position: absolute; left: 8px; top: 8px; font-size: 15px; text-shadow: var(--shadow); background: rgba(0,0,0,.35); padding: 4px 8px; }
.coinb { position: absolute; right: 8px; top: 8px; display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.55); border: 2px solid #000; padding: 4px 6px; pointer-events: auto; font-size: 15px; }
.coinb img { width: 28px; height: 28px; image-rendering: pixelated; object-fit: cover; } .coinb b { color: var(--gold); } .coinb i { font-style: normal; color: #cfd; }
.coinb a { color: #fff; background: var(--btn); border: 2px solid #000; padding: 2px 8px; text-decoration: none; } .coinb a:hover { background: var(--btn-hover); }
.hotbar { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; background: rgba(0,0,0,.4); border: 2px solid #000; pointer-events: auto; }
.hs { position: relative; width: 48px; height: 48px; display: grid; place-items: center; border: 2px solid #8d8d8d; box-shadow: inset 0 0 0 2px #444; cursor: pointer; }
.hs.on { border-color: #fff; box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #000; z-index: 1; }
.hs canvas { width: 34px; height: 34px; image-rendering: pixelated; } .hs b { position: absolute; right: 3px; bottom: 0; font-size: 14px; text-shadow: var(--shadow); }
.hearts { position: absolute; left: 50%; bottom: 66px; transform: translateX(-218px); display: flex; gap: 1px; }
.hearts i { width: 16px; height: 14px; background: #3a0d0d; clip-path: polygon(0 25%, 25% 0, 50% 25%, 75% 0, 100% 25%, 100% 55%, 50% 100%, 0 55%); }
.hearts i.f { background: #e8282c; } .hearts i.h { background: linear-gradient(90deg, #e8282c 50%, #3a0d0d 50%); }
.itemname { position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%); font-size: 17px; text-shadow: var(--shadow); opacity: 0; }
.itemname.on { animation: fadeName 2.2s forwards; } @keyframes fadeName { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.chatlog { position: absolute; left: 6px; bottom: 120px; width: min(520px, 70vw); display: grid; gap: 1px; }
.chatlog p { margin: 0; padding: 2px 6px; background: rgba(0,0,0,.45); font-size: 15px; text-shadow: var(--shadow); transition: opacity 1s; }
.chatlog p b { color: #ffe26a; font-weight: 500; } .chatlog p i { color: #9fe8ff; font-style: normal; }
.chatlog p.fade { opacity: 0; } .chatlog.open p { opacity: 1 !important; } .chatlog p.old { opacity: .9; }
.chatin { position: absolute; left: 6px; right: 6px; bottom: 70px; pointer-events: auto; } .chatin input { width: 100%; font: inherit; font-size: 16px; color: #fff; background: rgba(0,0,0,.65); border: 0; padding: 8px 10px; outline: none; user-select: text; }
.clicktoplay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(0,0,0,.35); pointer-events: auto; }
.clicktoplay[hidden] { display: none; }
.clicktoplay .mc { width: 260px; } .clicktoplay p { max-width: 560px; margin: 0; text-align: center; font-size: 14px; color: #ddd; text-shadow: var(--shadow); padding: 0 16px; }
body.hurt::after { content: ''; position: fixed; inset: 0; background: rgba(200, 0, 0, .28); z-index: 5; pointer-events: none; }

/* touch */
.touch { position: absolute; inset: 0; }
.stick { position: absolute; left: 28px; bottom: 90px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.35); pointer-events: auto; display: grid; place-items: center; touch-action: none; }
.stick i { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.4); }
.tbtns { position: absolute; right: 18px; bottom: 90px; display: grid; grid-template-columns: 64px 64px; gap: 10px; }
.tbtns button, .ttop button { pointer-events: auto; font: inherit; color: #fff; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.4); touch-action: none; }
.tbtns button { width: 64px; height: 64px; font-size: 26px; }
.ttop { position: absolute; right: 8px; top: 48px; display: flex; gap: 6px; } .ttop button { padding: 6px 10px; font-size: 14px; }

/* ---------- modal (wallet + launch) ---------- */
#modal { position: relative; z-index: 10; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.cw { width: min(380px, 94vw); background: #121417; border: 2px solid #000; box-shadow: inset 2px 2px 0 #2c3136, 0 18px 40px rgba(0,0,0,.5); padding: 14px; color: #fff; }
.cw-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cw-h h2 { margin: 0; font-size: 19px; font-weight: 500; } .cw-h button { font: inherit; font-size: 14px; color: #ccc; background: none; border: 0; cursor: pointer; } .cw-h button:hover { color: #fff; text-decoration: underline; }
.cw-list { display: grid; gap: 6px; }
.cw-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; font: inherit; color: #fff; background: #1b1f23; border: 2px solid #000; padding: 8px 10px; cursor: pointer; text-align: left; }
.cw-row:hover, .cw-row:focus-visible { background: #24292e; outline: 2px solid var(--ring); }
.cw-row img, .wi { width: 32px; height: 32px; } .wi { display: grid; place-items: center; background: #333; font-weight: 700; }
.cw-row small { color: #9aa; font-size: 13px; }
.cw-msg { color: #ff9a8a; font-size: 14px; } .cw-foot { color: #8b9499; font-size: 13px; margin: 10px 0 0; }
.launch { width: min(760px, 96vw); }
.ln-body { display: grid; grid-template-columns: 240px 1fr; gap: 14px; }
.ln-img img { width: 100%; aspect-ratio: 1; object-fit: cover; image-rendering: pixelated; border: 2px solid #000; background: #222; }
.ln-img .row2 { margin: 8px 0; } .up { cursor: pointer; }
.ln-form { display: grid; gap: 8px; } .ln-form label { display: grid; gap: 4px; font-size: 14px; color: #cfd6d9; }
.ln-form .field { font-size: 15px; padding: 6px 8px; } .ln-form .desc { text-align: left; }
.steps { margin: 4px 0; padding-left: 22px; display: grid; gap: 2px; font-size: 14px; color: #8b9499; }
.steps li.run { color: #fff; } .steps li.run::marker { content: '▶ '; color: var(--sol2); }
.steps li.ok { color: #7cff5a; } .steps li.err { color: #ff8a7a; } .steps em { display: block; font-style: normal; font-size: 13px; color: #ffb3a8; }
.done { background: #0c1a12; border: 2px solid #1f6f42; padding: 10px; display: grid; gap: 8px; } .done p { margin: 0; } .done code { font-size: 12px; word-break: break-all; background: #000; padding: 4px 6px; user-select: all; }
#toast { position: fixed; left: 50%; top: 18%; transform: translate(-50%, -8px); z-index: 20; padding: 8px 14px; background: rgba(0,0,0,.78); border: 2px solid #000; font-size: 16px; text-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .skin-wrap, .ln-body { grid-template-columns: 1fr; } .skin-prev canvas { width: 100px; height: 200px; }
  .hs { width: 38px; height: 38px; } .hs canvas { width: 26px; height: 26px; } .hearts { transform: translateX(-172px); bottom: 54px; }
  .chatlog { bottom: 230px; font-size: 13px; } .corner.br { display: none; } .ca code { font-size: 11px; }
  .mc { font-size: 16px; min-height: 38px; } .menu { margin-top: 18px; gap: 8px; }
  .title { padding: 60px 12px 70px; justify-content: flex-start; padding-top: 70px; }
}
@media (prefers-reduced-motion: reduce) { .splash { animation: none; } }
.m-off { color: #fff; background: #3b1d6e; border: 1px solid #9945ff; padding: 0 5px; font-size: 13px; }
.launchb { position: absolute; right: 8px; top: 52px; display: flex; align-items: center; gap: 10px; pointer-events: auto; cursor: pointer; font: inherit; color: #fff; text-align: left;
  background: linear-gradient(90deg, rgba(60,30,110,.92), rgba(20,90,70,.92)); border: 2px solid #000; box-shadow: inset 2px 2px 0 rgba(255,255,255,.25), 0 0 0 2px rgba(255,216,74,.6); padding: 8px 12px; animation: lbpulse 2s ease-in-out infinite; }
.launchb b { display: block; font-weight: 500; font-size: 16px; text-shadow: var(--shadow); } .launchb small { display: block; font-size: 12px; color: #ffe26a; }
.launchb:hover { filter: brightness(1.15); }
.lc-ic { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6a8, #f3cd32 45%, #b08a14); border: 2px solid #000; }
@keyframes lbpulse { 50% { box-shadow: inset 2px 2px 0 rgba(255,255,255,.25), 0 0 0 4px rgba(255,216,74,.9); } }
.mc.gold { background: #6a5214; box-shadow: inset 2px 2px 0 #f3cd32, inset -2px -2px 0 #3a2c08; }
.mc.gold:hover { background: #806418; }
@media (max-width: 640px) { .launchb { top: 90px; } }
.mc.big { min-height: 50px; font-size: 20px; gap: 10px; }
.mc.big .lc-ic { width: 24px; height: 24px; }
