/* memecraft — the game's chrome. Pixel fonts (Press Start 2P + VT323, both OFL), stone buttons and dark dirt panels drawn
   from the game's own textures at boot (game.js sets --tex-btn / --tex-panel / --tex-slot as data URLs), bevelled frames. */
@font-face { font-family: PS2P; src: url(/fonts/press-start-2p.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: VT; src: url(/fonts/vt323.woff2) format('woff2'); font-display: swap; }
:root { --ink: #0b0d12; --txt: #f4f4f4; --mut: #a9adb8; --gold: #f3ba2f; --gold2: #ffd766; --green: #5ae06e; --red: #ff5a66; --ui: VT, 'VT323', monospace; --px: PS2P, 'Press Start 2P', monospace; }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: #000; color: var(--txt); font: 22px/1.25 var(--ui); -webkit-user-select: none; user-select: none; touch-action: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
[hidden] { display: none !important; }
.grow { flex: 1; } .mut { color: var(--mut); }
.shadow { text-shadow: 3px 3px 0 rgba(0,0,0,.6); }

/* pixel buttons: stone face, light bevel top-left, dark bottom-right, gold edge when hovered */
.mc { font: 20px/1 var(--ui); letter-spacing: .02em; color: #f4f4f4; text-shadow: 2px 2px 0 rgba(0,0,0,.55); background: var(--tex-btn) center / 128px 40px; border: 2px solid #0b0d12; box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -2px 0 rgba(0,0,0,.45); padding: 11px 22px; cursor: pointer; min-width: 300px; image-rendering: pixelated; }
.mc:hover { color: #ffe9a8; box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -2px 0 rgba(0,0,0,.45), 0 0 0 2px var(--gold); }
.mc:active { box-shadow: inset -2px -2px 0 rgba(255,255,255,.25), inset 2px 2px 0 rgba(0,0,0,.45); transform: translateY(1px); }
.mc.sm { min-width: 0; padding: 7px 12px; font-size: 17px; } .mc.gold { background: var(--tex-gold) center / 128px 40px; color: #2b1d00; text-shadow: none; }
.mc:disabled { opacity: .6; cursor: default; }

/* screens over the live panorama */
.screen { position: absolute; inset: 0; display: grid; place-items: center; }
.screen.dim { background: rgba(0, 0, 0, .55); }
.menu-inner { display: grid; gap: 14px; justify-items: center; padding: 20px; width: min(560px, 96vw); }
#logo { width: min(640px, 92vw); image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.55)); }
.ed { font: 14px/1 var(--px); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: #2b2f3a; padding: 8px 12px; border: 2px solid #0b0d12; box-shadow: inset 2px 2px 0 rgba(255,255,255,.2), inset -2px -2px 0 rgba(0,0,0,.4), 0 4px 0 rgba(0,0,0,.5); margin-top: -8px; }
.ribbon { font: 11px/1 var(--px); color: #fff; background: #d84a2f; padding: 7px 12px; border: 2px solid #0b0d12; box-shadow: 0 3px 0 rgba(0,0,0,.5); transform: rotate(-2deg); letter-spacing: .04em; }
.tag { color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.7); text-align: center; max-width: 520px; font-size: 21px; }
.btns { display: grid; gap: 10px; margin-top: 6px; } .hint { color: #e8e8e8; font-size: 18px; text-shadow: 2px 2px 0 rgba(0,0,0,.7); text-align: center; min-height: 22px; }
.menu-foot { position: absolute; left: 14px; right: 14px; bottom: 10px; display: flex; justify-content: space-between; gap: 12px; font-size: 18px; color: #e8e8e8; text-shadow: 2px 2px 0 rgba(0,0,0,.7); } .foot-link { color: var(--gold2); }
.splash { position: absolute; left: 50%; top: 50%; transform: translate(170px, -140px) rotate(-18deg); font: 13px/1 var(--px); color: #ffe100; text-shadow: 2px 2px 0 rgba(0,0,0,.6); animation: pulse .5s infinite alternate; pointer-events: none; white-space: nowrap; }
@keyframes pulse { from { transform: translate(170px, -140px) rotate(-18deg) scale(1); } to { transform: translate(170px, -140px) rotate(-18deg) scale(1.08); } }

/* panels: dark dirt texture, bevelled frame */
.panel { width: min(680px, 94vw); max-height: 88vh; background: var(--tex-panel) center / 64px 64px; border: 3px solid #0b0d12; box-shadow: inset 3px 3px 0 rgba(255,255,255,.14), inset -3px -3px 0 rgba(0,0,0,.5), 0 10px 0 rgba(0,0,0,.4); display: grid; grid-template-rows: auto 1fr; overflow: hidden; image-rendering: pixelated; }
.ph { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 3px solid rgba(0,0,0,.45); box-shadow: 0 2px 0 rgba(255,255,255,.08); } .ph b { font: 13px/1 var(--px); color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.6); }
.list { overflow: auto; padding: 10px; display: grid; gap: 6px; }
.list .w { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; background: rgba(0,0,0,.45); border: 2px solid #0b0d12; box-shadow: inset 1px 1px 0 rgba(255,255,255,.12); cursor: pointer; }
.list .w:hover { background: rgba(0,0,0,.25); box-shadow: inset 1px 1px 0 rgba(255,255,255,.12), 0 0 0 2px var(--gold); } .list .w b { font-size: 23px; } .list .w small { color: var(--mut); display: block; font-size: 17px; }
.list .w .pl { color: var(--green); font-size: 20px; white-space: nowrap; text-shadow: 2px 2px 0 rgba(0,0,0,.6); }
.form { padding: 14px; display: grid; gap: 12px; overflow: auto; } .form label { display: grid; gap: 5px; font-size: 18px; color: #d8d8d8; text-shadow: 1px 1px 0 rgba(0,0,0,.6); }
.form input { height: 44px; padding: 0 12px; background: #000; border: 2px solid #8a8a8a; box-shadow: inset 2px 2px 0 rgba(0,0,0,.6); color: var(--txt); font: 22px var(--ui); } .form input:focus { outline: none; border-color: #fff; }
.skins { display: flex; gap: 8px; flex-wrap: wrap; } .skins button { width: 46px; height: 46px; border: 2px solid #0b0d12; background: rgba(0,0,0,.5); cursor: pointer; padding: 2px; box-shadow: inset 1px 1px 0 rgba(255,255,255,.12); } .skins button.on { box-shadow: 0 0 0 2px var(--gold); } .skins canvas { width: 100%; height: 100%; image-rendering: pixelated; }

/* loading */
#loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--tex-panel) center / 64px 64px; image-rendering: pixelated; }
#loading .box { display: grid; gap: 14px; justify-items: center; } #loading b { font: 14px/1.6 var(--px); color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.6); text-align: center; }
.pbar { width: min(420px, 80vw); height: 14px; background: #000; border: 2px solid #8a8a8a; } .pbar i { display: block; height: 100%; background: var(--green); width: 0; transition: width .15s; }

/* hud */
#hud { position: absolute; inset: 0; pointer-events: none; } #hud > * { pointer-events: auto; }
#cross { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); pointer-events: none; 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; width: 18px; height: 2px; }
#top { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; gap: 10px; align-items: center; font-size: 20px; text-shadow: 2px 2px 0 rgba(0,0,0,.7); }
#worldName { font: 12px/1 var(--px); } #coinTag { padding: 4px 8px; background: var(--gold); color: #2b1d00; font-size: 18px; border: 2px solid #0b0d12; text-shadow: none; box-shadow: 0 2px 0 rgba(0,0,0,.5); }
#online { color: var(--green); }
#chat { position: absolute; left: 10px; bottom: 100px; width: min(480px, 72vw); display: grid; gap: 6px; }
#chatLog { display: grid; gap: 1px; font-size: 20px; text-shadow: 2px 2px 0 rgba(0,0,0,.8); max-height: 190px; overflow: hidden; justify-items: start; }
#chatLog div { background: rgba(0,0,0,.45); padding: 1px 8px; } #chatLog b { color: var(--gold2); } #chatLog .sys { color: #cfd3dc; }
#chatIn { height: 38px; padding: 0 10px; background: rgba(0,0,0,.6); border: 2px solid #8a8a8a; color: var(--txt); font: 21px var(--ui); }
#hotbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 0; padding: 3px; background: rgba(0,0,0,.6); border: 2px solid #8a8a8a; box-shadow: inset 1px 1px 0 rgba(255,255,255,.2), 0 0 0 2px #0b0d12; }
#hotbar .slot, #invGrid .slot { width: 52px; height: 52px; border: 2px solid #0b0d12; background: var(--tex-slot) center / 52px 52px; display: grid; place-items: center; position: relative; cursor: pointer; image-rendering: pixelated; }
#hotbar .slot.on { box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px #fff; z-index: 1; }
.slot canvas { width: 38px; height: 38px; image-rendering: pixelated; } .slot small { position: absolute; left: 3px; top: 2px; font-size: 15px; color: #e8e8e8; text-shadow: 1px 1px 0 #000; }
#slotName { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); font-size: 22px; color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.8); pointer-events: none; transition: opacity .6s; }
#inv { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); }
#invGrid { display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 2px; padding: 10px; justify-content: center; max-height: 58vh; overflow: auto; }
#invGrid .slot:hover { box-shadow: inset 0 0 0 3px #fff; } .slot .nm { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); white-space: nowrap; font-size: 18px; background: #0b0d12; border: 2px solid #4b3a8a; padding: 2px 8px; display: none; z-index: 3; } .slot:hover .nm { display: block; }
#help { position: absolute; right: 10px; bottom: 10px; font-size: 17px; color: #e8e8e8; text-shadow: 2px 2px 0 rgba(0,0,0,.8); max-width: 44vw; text-align: right; }
#toast { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); background: rgba(0,0,0,.7); border: 2px solid var(--gold); padding: 8px 14px; font-size: 21px; }
#vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.35) 100%); }
#hand { position: absolute; right: 0; bottom: 0; width: 320px; height: 260px; pointer-events: none; }

/* touch */
#touch { position: absolute; inset: 0; pointer-events: none; }
#stick { position: absolute; left: 24px; bottom: 100px; width: 124px; height: 124px; border-radius: 50%; background: rgba(0,0,0,.25); border: 2px solid rgba(255,255,255,.35); pointer-events: auto; }
#stick i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255,255,255,.4); }
#tbtns { position: absolute; right: 16px; bottom: 100px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; pointer-events: auto; }
#tbtns button { width: 62px; height: 62px; border: 2px solid #0b0d12; background: var(--tex-btn) center / 128px 40px; color: #fff; font: 24px var(--ui); box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -2px 0 rgba(0,0,0,.45); text-shadow: 2px 2px 0 rgba(0,0,0,.6); }
body.touch #help { display: none; } body.touch #hand { display: none; } body.touch #hotbar .slot { width: 42px; height: 42px; background-size: 42px 42px; } body.touch .slot canvas { width: 30px; height: 30px; }
@media (max-width: 640px) { #top { font-size: 17px; } #chat { bottom: 80px; } .mc { min-width: 240px; } .splash { display: none; } }

/* coin creation + economy */
.coinhead { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drop { height: 110px; border: 2px dashed #8a8a8a; background: rgba(0,0,0,.45); display: grid; place-items: center; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--gold); } .drop .pv { width: 96px; height: 96px; display: grid; place-items: center; color: var(--mut); font-size: 18px; overflow: hidden; } .drop .pv img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.check { display: flex !important; gap: 8px; align-items: flex-start; font-size: 19px !important; color: #fff !important; } .check input { width: 20px; height: 20px; margin-top: 2px; }
.econ-note { background: rgba(0,0,0,.45); border: 2px solid #0b0d12; box-shadow: inset 1px 1px 0 rgba(255,255,255,.12); padding: 10px 12px; font-size: 19px; color: #e8e8e8; } .econ-note b { color: var(--gold2); }
.menu-top { position: absolute; right: 14px; top: 12px; }
#feeTag { padding: 4px 8px; background: rgba(0,0,0,.55); border: 2px solid #0b0d12; font-size: 18px; color: var(--green); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; } .kv div { background: rgba(0,0,0,.45); border: 2px solid #0b0d12; padding: 8px 10px; } .kv b { display: block; font-size: 24px; color: #fff; } .kv span { font-size: 17px; color: var(--mut); }
.rounds { display: grid; gap: 6px; font-size: 18px; } .rounds div { background: rgba(0,0,0,.35); padding: 6px 10px; }
@media (max-width: 560px) { .coinhead, .grid2 { grid-template-columns: 1fr; } }

/* survival: counts, dig progress, crafting */
.slot .ct { position: absolute; right: 3px; bottom: 1px; font-size: 16px; color: #fff; text-shadow: 1px 1px 0 #000; }
.slot.empty canvas { opacity: .15; }
#digbar { position: absolute; left: 50%; top: calc(50% + 26px); transform: translateX(-50%); width: 90px; height: 8px; background: rgba(0,0,0,.6); border: 2px solid #0b0d12; } #digbar i { display: block; height: 100%; background: var(--gold); width: 0; }
#craft { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); }
.craftbox { display: flex; gap: 18px; align-items: center; justify-content: center; padding: 14px; }
.cgrid { display: grid; grid-template-columns: repeat(3, 52px); gap: 2px; } .cgrid.two { grid-template-columns: repeat(2, 52px); }
.cgrid .slot, .cout .slot { width: 52px; height: 52px; border: 2px solid #0b0d12; background: var(--tex-slot) center / 52px 52px; display: grid; place-items: center; position: relative; cursor: pointer; }
.arrow { font: 28px var(--px); color: #fff; text-shadow: 2px 2px 0 #000; } .cout { display: grid; gap: 8px; justify-items: center; }
.recipes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px; max-height: 26vh; overflow: auto; font-size: 18px; } .recipes div { background: rgba(0,0,0,.4); padding: 6px 8px; display: flex; gap: 8px; align-items: center; cursor: pointer; } .recipes div:hover { outline: 2px solid var(--gold); } .recipes canvas { width: 24px; height: 24px; image-rendering: pixelated; }
.seg { display: inline-flex; gap: 2px; background: rgba(0,0,0,.45); border: 2px solid #0b0d12; padding: 2px; flex-wrap: wrap; } .seg button { border: 0; background: transparent; color: var(--mut); font: 17px var(--ui); padding: 6px 10px; cursor: pointer; } .seg button.on { background: rgba(255,255,255,.14); color: #fff; }
.list .row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; background: rgba(0,0,0,.4); border: 2px solid #0b0d12; } .list .row .n { font: 13px var(--px); color: var(--gold2); } .list .row b { font-size: 21px; } .list .row small { display: block; color: var(--mut); font-size: 17px; } .list .row .v { color: var(--green); white-space: nowrap; }
#privySlot .btn { font: 17px var(--ui); color: #f4f4f4; background: var(--tex-btn) center / 128px 40px; border: 2px solid #0b0d12; box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -2px 0 rgba(0,0,0,.45); padding: 7px 12px; cursor: pointer; text-shadow: 2px 2px 0 rgba(0,0,0,.55); }

/* survival HUD: hearts, air, death */
#hearts, #air { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; pointer-events: none; }
#hearts { bottom: 78px; } #air { bottom: 100px; }
#hearts i, #air i { width: 18px; height: 18px; display: block; background: #3a0d0d; clip-path: polygon(50% 100%, 10% 55%, 0 30%, 15% 10%, 35% 10%, 50% 25%, 65% 10%, 85% 10%, 100% 30%, 90% 55%); box-shadow: inset 0 0 0 2px #0b0d12; }
#hearts i.full { background: #ff3b3b; } #hearts i.half { background: linear-gradient(90deg, #ff3b3b 50%, #3a0d0d 50%); }
#air i { clip-path: circle(45%); background: #0b2a4a; } #air i.full { background: #4fb0ff; }
#death { background: rgba(120, 0, 0, .55); }
body.touch #hearts { bottom: 70px; } body.touch #air { bottom: 92px; }
