:root { --bg: #0d0718; --panel: #160c2a; --line: #3b2768; --text: #f3edff; --muted: #b3a2d6; --green: #b98cff; --gold: #ffcf4a; --bad: #ff6b6b; --r: 12px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); overflow: hidden; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hide { display: none !important; }
button { font: inherit; color: var(--text); background: #0f1d13; border: 1px solid var(--line); border-radius: var(--r); min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; white-space: nowrap; }
button:hover { border-color: var(--green); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--green); color: #031106; border-color: var(--green); font-weight: 800; }
button.primary.big { width: 100%; min-height: 54px; font-size: 20px; letter-spacing: .08em; margin-top: 18px; }
input { width: 100%; min-height: 44px; padding: 0 14px; font: inherit; color: var(--text); background: #07100a; border: 1px solid var(--line); border-radius: var(--r); }
label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 6px; }
.muted { color: var(--muted); font-size: 13px; }
.bad { color: var(--bad); min-height: 1.5em; margin: 8px 0 0; font-size: 14px; }
.ok { color: var(--green); }

/* ---------- menu ---------- */
#menu { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto;
  background: radial-gradient(1200px 700px at 50% -10%, #0e3a1a 0%, #050806 60%); }
#menu .bgwrap { position: absolute; inset: 0; background-image: linear-gradient(#0000 0 0), repeating-linear-gradient(90deg, #ffffff06 0 32px, #0000 32px 64px), repeating-linear-gradient(0deg, #ffffff06 0 32px, #0000 32px 64px); pointer-events: none; }
.panel { position: relative; width: min(440px, 100%); background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 26px 24px 22px; box-shadow: 0 0 0 4px #000, 0 20px 60px #000a; }
.panel h1 { margin: 8px 0 0; font: 900 clamp(48px, 12vw, 72px)/1 var(--font); letter-spacing: -.03em; color: var(--gold); text-align: center; text-shadow: 0 4px 0 #6a4c00, 0 0 24px #ffd23c40; }
.tag { text-align: center; color: var(--muted); margin: 6px 0 4px; }
.chips { display: flex; gap: 8px; justify-content: center; }
.chip { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.servers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.srv { flex-direction: column; min-height: 58px; gap: 0; }
.srv small { color: var(--muted); }
.srv.on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.how { margin: 8px 0; padding-left: 18px; font-size: 14px; color: #cfe8d3; }
.ores { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0; margin: 0 0 8px; font-size: 14px; }
.ores li { background: #07100a; border: 1px solid var(--line); border-radius: 8px; min-height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.ores b { color: var(--gold); font-weight: 700; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud input { pointer-events: auto; }
#stats { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; }
#stats div { min-width: 82px; min-height: 54px; background: #000a; border: 1px solid #ffffff22; border-radius: 10px; padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; }
#stats small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
#stats b { font-size: 18px; line-height: 1.2; }
#stats em { font-style: normal; font-size: 11px; color: var(--muted); line-height: 1.2; }
#s-sol { color: var(--gold); }
#topbar { position: absolute; right: 14px; top: 14px; display: flex; gap: 10px; align-items: center; }
#who { background: #000a; border: 1px solid #ffffff22; border-radius: 10px; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; font-weight: 700; }
#wdBtn { background: var(--gold); border-color: var(--gold); color: #1c1400; font-weight: 800; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 0 1px #0008; }
#crosshair::before { left: 8px; top: 0; width: 2px; height: 18px; } #crosshair::after { top: 8px; left: 0; height: 2px; width: 18px; }
#aim { position: absolute; left: 50%; top: calc(50% + 20px); transform: translateX(-50%); font-size: 13px; color: #fff; text-shadow: 0 1px 3px #000; text-transform: capitalize; }
#toast { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -10px); opacity: 0; transition: opacity .2s, transform .2s; background: #000c; border: 1px solid #ffffff33; border-radius: 12px; padding: 10px 18px; font-weight: 700; text-align: center; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.gold { background: #3a2c00ee; border-color: var(--gold); color: var(--gold); font-size: 22px; }
#toast.coin { background: #000a; font-size: 15px; padding: 6px 14px; }
#prompt { position: absolute; left: 50%; bottom: 26%; transform: translateX(-50%); background: #000b; border: 1px solid var(--green); border-radius: 12px; padding: 8px 18px; display: none; font-weight: 700; }
#prompt.show { display: block; }
#chat { position: absolute; left: 14px; bottom: 44px; width: min(460px, 70vw); }
#chatlog .line { background: #0008; border-radius: 6px; padding: 2px 8px; margin-top: 2px; width: fit-content; max-width: 100%; font-size: 14px; overflow-wrap: anywhere; transition: opacity 1s; }
#chatlog .line.old { opacity: 0; }
#chatlog b { color: var(--green); }
#chatin { margin-top: 6px; background: #000c; }
#tab { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); width: min(420px, 90vw); background: #000d; border: 1px solid #ffffff33; border-radius: 12px; padding: 10px 16px; }
#tab h3 { margin: 4px 0 8px; font-size: 15px; }
#tab div { display: flex; justify-content: space-between; min-height: 28px; align-items: center; }
#tab small { color: var(--muted); }
#help { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 12px; color: #fffb; text-shadow: 0 1px 3px #000; white-space: nowrap; max-width: 96vw; overflow: hidden; text-overflow: ellipsis; }
#paused { position: fixed; inset: 0; background: #000a; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
#paused h2 { font: 900 56px/1 var(--font); color: var(--gold); margin: 0; }

/* ---------- withdraw modal ---------- */
.modal { position: fixed; inset: 0; background: #000b; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 5; }
.card { width: min(480px, 100%); max-height: 92vh; overflow: auto; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.card h2 { margin: 0 0 4px; } .card h3 { margin: 16px 0 6px; font-size: 15px; }
.card .big { font-size: 18px; margin: 4px 0; } .card .big b { color: var(--gold); }
.card .row { display: flex; gap: 10px; margin-top: 12px; } .card .row button { flex: 1; }
#wd-msg { min-height: 1.5em; margin: 8px 0 0; font-size: 14px; }
#wd-msg.bad { color: var(--bad); } #wd-msg.ok { color: var(--green); }
#wd-list { list-style: none; padding: 0; margin: 0; font-size: 14px; } #wd-list li { min-height: 32px; display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); }
#wd-list em { font-style: normal; font-size: 12px; border-radius: 99px; padding: 0 10px; min-height: 22px; display: inline-flex; align-items: center; border: 1px solid var(--line); }
#wd-list em.paid { color: var(--green); border-color: var(--green); } #wd-list em.pending { color: var(--gold); border-color: var(--gold); }
#wd-list a { color: var(--green); }
@media (max-width: 720px) { #stats { flex-wrap: wrap; max-width: calc(100vw - 28px); } #stats div { min-width: 70px; } #help { display: none; } #who { display: none; } #wdBtn { min-height: 38px; } }

#hotbar{position:fixed;left:16px;bottom:16px;display:flex;gap:8px;z-index:6;pointer-events:none}
#hotbar .slot{position:relative;width:72px;height:72px;border-radius:14px;background:rgba(18,9,36,.78);border:2px solid rgba(169,112,255,.35);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;box-shadow:0 4px 0 rgba(0,0,0,.35)}
#hotbar .slot.on{border-color:#ffcf4a;background:rgba(58,30,98,.9);transform:translateY(-3px)}
#hotbar .slot svg{width:36px;height:36px}
#hotbar .slot b{position:absolute;left:7px;top:4px;font-size:12px;color:#c9b4ff}
#hotbar .slot small{font-size:12px;color:#efe8ff;font-weight:700;white-space:nowrap}
#chatlog{bottom:104px!important}

/* menu over the live mine */
#menu { background: radial-gradient(900px 600px at 50% 50%, #0d071800 0%, #0d071866 55%, #0d0718cc 100%) !important; }
#menu .bgwrap { display: none; }
.panel { background: #160c2ae6 !important; border-color: #4b3388 !important; box-shadow: 0 0 0 4px #0d0718, 0 24px 80px #000c, 0 0 60px #a970ff33 !important; }
.panel .logo { display: block; width: 96px; height: 96px; margin: 2px auto 0; border-radius: 22px; box-shadow: 0 0 0 3px #2a1850, 0 8px 30px #a970ff55; }
.panel h1 { color: #e7dcff !important; text-shadow: 0 4px 0 #4b2a8a, 0 0 28px #a970ff80 !important; }
button.primary { background: linear-gradient(#ffd85e, #f5b62a) !important; color: #2a1600 !important; border-color: #c98a10 !important; box-shadow: 0 4px 0 #9a6400; }
button.primary:hover { filter: brightness(1.06); }
.srv.on { border-color: #ffcf4a !important; box-shadow: inset 0 0 0 1px #ffcf4a !important; }
input, .srv, button:not(.primary) { background: #1f1238 !important; border-color: #3b2768 !important; color: #f3edff; }
.srv.on { background: #2c1a52 !important; border-color: #ffcf4a !important; }
.chip { background: #1f1238; border-color: #3b2768; color: #d9ccff; }

/* juice: floating numbers and the gold flash when an ore is found */
.pop { position: absolute; left: 50%; top: 44%; transform: translate(-50%, 0); font: 900 26px system-ui, Arial Black, sans-serif; color: #ffe27a; text-shadow: 0 3px 0 #6b3b00, 0 0 18px #ffb80080; pointer-events: none; animation: popup 1.25s cubic-bezier(.2,.8,.3,1) forwards; }
.pop.coin { font-size: 21px; color: #e9dcff; text-shadow: 0 2px 0 #3b2768, 0 0 12px #a970ff80; }
.pop.sol { font-size: 44px; }
@keyframes popup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -6px) scale(1.12); } 30% { transform: translate(-50%, -12px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -90px) scale(.95); } }
#flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, #ffd84a00 35%, #ffc83a66 100%); }
#flash.on { animation: flash 0.9s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
#crosshair.ok::before, #crosshair.ok::after { background: #ffd84a; box-shadow: 0 0 6px #ffb800; }

/* shop panel */
#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
#fade.on { animation: fadein 0.9s ease-out; }
@keyframes fadein { 0% { opacity: 1; } 100% { opacity: 0; } }
.shopcard { width: min(560px, 100%); max-height: 86vh; overflow: auto; }
.shophead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.shophead h2 { margin: 0; flex: 1; letter-spacing: .04em; color: var(--gold); }
.pill { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 99px; background: #0d0718; border: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.x { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: #0d0718; border: 1px solid var(--line); color: var(--text); font-size: 18px; cursor: pointer; }
#shop-list h3 { margin: 16px 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
#shop-list .it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: #1d1036; margin-bottom: 8px; }
#shop-list .it.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
#shop-list .it.lock { opacity: .55; }
#shop-list .tx { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#shop-list .tx span { font-size: 13px; color: var(--muted); }
#shop-list .sw { width: 34px; height: 34px; border-radius: 50%; flex: none; box-shadow: inset 0 -6px 10px #0005, 0 0 0 2px #0d0718; }
#shop-list .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#shop-list .grid .it { margin: 0; }
#shop-list button.buy { min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; border-radius: 12px; border: 1px solid #c98a10; background: linear-gradient(#ffd85e, #f5b62a); color: #2a1600; font-weight: 800; cursor: pointer; }
#shop-list button.buy:disabled { filter: none; opacity: 1; background: #2a1d45 !important; color: #b3a2d6 !important; border-color: #3b2768 !important; cursor: not-allowed; }
#shop-list em { font-style: normal; font-size: 12px; font-weight: 700; min-height: 30px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
#shop-list .it.on em { color: var(--gold); border-color: var(--gold); }
.hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
@media (max-width: 520px) { #shop-list .grid { grid-template-columns: 1fr; } }

#mic{position:fixed;right:16px;bottom:16px;z-index:6;display:flex;align-items:center;gap:6px;padding:8px 12px;border-radius:12px;background:rgba(18,9,36,.78);border:2px solid rgba(255,90,90,.6);color:#ff7a7a;font:700 13px system-ui;pointer-events:none}
#mic svg{width:20px;height:20px}
#mic.on{border-color:rgba(90,255,150,.7);color:#7dffb0}
#hud #wdBtn { background: var(--gold) !important; border-color: #fff3 !important; color: #1c1400 !important; font-weight: 900; box-shadow: 0 3px 0 #8a6a00; }
#links { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 6; }
#links span { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 14px; border-radius: 999px; background: #000b; border: 1px solid #ffcf4a66; color: #ffe9a8; font-weight: 800; font-size: 14px; white-space: nowrap; }
@media (max-width: 1000px) { #links { top: auto; bottom: 96px; } }
#links #caBtn { min-height: 34px; padding: 0 14px; border-radius: 999px; background: #ffcf4a !important; border-color: #ffcf4a !important; color: #1c1400 !important; font-weight: 900; font-size: 14px; pointer-events: auto; }
