@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700;800&family=Russo+One&display=swap');

:root {
  color-scheme: dark;
  --ink:#ecf0df; --muted:#aebcaf; --dark:#111c18; --panel:#182720; --panel-2:#22352b;
  --border:#455849; --moss:#bdd680; --moss-dark:#718a48; --amber:#f2c580; --red:#ee8d7a;
  --glass:rgba(17,30,25,.89); --head:'Russo One','Arial Black',sans-serif; --body:'Golos Text',sans-serif;
  --top:max(env(safe-area-inset-top,0px),var(--tg-top,0px));
  --right:max(env(safe-area-inset-right,0px),var(--tg-right,0px));
  --bottom:max(env(safe-area-inset-bottom,0px),var(--tg-bottom,0px));
  --left:max(env(safe-area-inset-left,0px),var(--tg-left,0px));
}
* {box-sizing:border-box}
[hidden] {display:none!important}
html,body {height:100%; margin:0; overscroll-behavior:none}
body {background:var(--dark); color:var(--ink); font:500 15px/1.45 var(--body); -webkit-tap-highlight-color:transparent}
button,input {font:inherit; color:inherit}
button {cursor:pointer; touch-action:manipulation}
button:disabled {opacity:.49; cursor:default}
button:focus-visible,input:focus-visible {outline:2px solid var(--amber); outline-offset:2px}
button,input {border-radius:5px}
a {color:var(--moss)}
p,h1,h2,h3 {margin:0}
.symbols {position:absolute; width:0; height:0; pointer-events:none}
.icon {display:inline-block; width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; vertical-align:middle}
.overline {display:flex; gap:.7em; align-items:center; color:var(--moss); font-size:11px; font-weight:800; letter-spacing:.16em}
.pixel {width:8px; height:8px; background:var(--moss); box-shadow:3px 3px 0 #52673f; display:inline-block; flex:none; transform:translateY(-1px)}
.pixel.amber {background:var(--amber); box-shadow:3px 3px 0 #725c3c}
.soft,.main-button,.glass {display:inline-flex; gap:8px; min-height:42px; align-items:center; justify-content:center; padding:0 13px; border:1px solid var(--border); font-weight:700; transition:background .14s,border-color .14s,color .14s}
.soft {background:#273a30; color:var(--ink)}
.soft:hover:not(:disabled) {background:#324a3a; border-color:#75876a}
.main-button {background:var(--moss); color:#233321; border-color:#d5e7a9; box-shadow:inset 0 -3px 0 rgba(34,52,21,.2)}
.main-button:hover:not(:disabled) {background:#d1e6a2}
.main-button:active:not(:disabled) {background:#aabd77}
.main-button .icon {stroke-width:2}
.glass {background:var(--glass); color:var(--ink); border-color:rgba(226,237,209,.45)}
button.glass:hover {background:#324337}
.icon-button {width:42px; min-width:42px; padding:0}

.landing {position:relative; isolation:isolate; min-height:100%; min-height:100dvh; display:flex; background:#263c35}
.cover {position:fixed; inset:0; z-index:-3; width:100%; height:100%; user-select:none}
.landing::after {content:''; position:fixed; inset:0; z-index:-2; pointer-events:none; background:linear-gradient(100deg,#172620ed 4%,#192c24bd 37%,#1b292557 75%),linear-gradient(0deg,#101813e8 0%,transparent 64%)}
.landing-inner {width:min(1320px,100%); min-height:100%; margin:0 auto; padding:max(26px,var(--top)) max(clamp(22px,5.2vw,72px),var(--right)) max(24px,var(--bottom)) max(clamp(22px,5.2vw,72px),var(--left)); display:grid; grid-template-rows:auto 1fr auto; gap:clamp(26px,7vh,76px)}
.masthead,.mast-foot {display:flex; gap:16px; justify-content:space-between; align-items:center}
.masthead {border-bottom:1px solid #b4c7a450; padding:0 0 16px}
.brand {display:flex; gap:10px; align-items:center; font:400 16px var(--head); letter-spacing:.14em; color:#f4f6da}
.brand span {display:grid; place-items:center; width:36px; height:36px; border:1px solid #c9dd91; color:#d0e8a0; background:#263c2c; box-shadow:3px 3px 0 #141e19; border-radius:4px}
.mast-help {background:#1c3027ab; border-color:#95aa8d8c; color:#edf2df}
.mast-help .icon {color:var(--moss)}
.mast-foot {border-top:1px solid #b4c7a450; padding-top:14px; color:#c3c9ac; font-size:10px; font-weight:800; letter-spacing:.15em}
.lobby-grid {max-width:1140px; width:100%; align-self:center; display:grid; grid-template-columns:minmax(0,1fr) minmax(290px,360px); gap:clamp(28px,7vw,100px); align-items:center}
.hero {min-width:0}
.hero h1 {font:400 clamp(60px,10vw,137px)/1 var(--head); margin:.13em 0 .15em -.04em; letter-spacing:-.075em; color:#f2f3d9; text-shadow:4px 6px 0 #1f3228,0 16px 40px #16291eba}
.hero h1 span {color:var(--amber); margin-left:.035em}
.hero p {max-width:440px; font-size:clamp(15px,1.68vw,20px); line-height:1.53; color:#e2e7d2; text-shadow:0 1px 7px #18261e}
.tags {display:flex; flex-wrap:wrap; gap:7px 16px; margin-top:26px; font-size:12px; color:#d8e2c6}
.tags span {display:flex; align-items:center; gap:5px; white-space:nowrap}
.tags .icon {width:15px; height:15px; color:var(--moss)}
.entry {position:relative; padding:clamp(19px,3vw,30px); background:linear-gradient(151deg,#22382e,#182720 74%); border:1px solid #748671; border-radius:6px; box-shadow:7px 7px 0 #121d17ad,0 18px 56px #12231d8f}
.entry::before,.sheet::before {content:''; position:absolute; top:-1px; right:19px; width:38px; height:4px; background:var(--amber); box-shadow:5px 3px 0 #8e7450}
.entry h2 {font:400 clamp(21px,3vw,28px)/1.23 var(--head); margin:9px 0 20px; color:#eef0da}
.world-button {width:100%; justify-content:flex-start; gap:12px; padding:10px 12px; min-height:61px; text-align:left}
.world-button>.icon:first-child {width:25px; height:25px}
.world-button b,.world-button small {display:block}
.world-button b {font-size:16px}
.world-button small {font-size:11.5px; opacity:.79; font-weight:600}
.right-arrow {margin-left:auto}
.divider {display:flex; align-items:center; gap:8px; margin:18px 0 12px; color:#a8b7a9; font-size:11px}
.divider::before,.divider::after {content:''; height:1px; flex:1; background:#4d6455}
.entry label,.room-code label {display:block; margin-bottom:6px; color:#e2e9d8; font-weight:700; font-size:12px}
.code-row {display:flex; gap:7px}
.code-row input {flex:1; min-width:0; width:100%; background:#121e19; border:1px solid #617561; padding:8px 10px; min-height:42px; color:var(--ink); outline-offset:1px; font-size:16px; font-weight:800; letter-spacing:.12em}
.code-row input::placeholder {color:#91a096; font-weight:500; letter-spacing:0}
#join-code {text-transform:uppercase}
.entry-status {margin-top:13px; color:#abbdb1; min-height:2.5em; font-size:11.5px}
.entry-status.error {color:#ffc3a7}

.play {position:fixed; inset:0; overflow:hidden; background:#3e655d; user-select:none; -webkit-user-select:none; touch-action:none}
.play canvas,.names,.hurt-flash {position:absolute; inset:0; width:100%; height:100%; outline:none}
.play canvas {display:block; touch-action:none; cursor:crosshair}
.play.drag canvas {cursor:grab}
.play.drag canvas:active {cursor:grabbing}
.names,.hurt-flash {pointer-events:none}
.nameplate {position:absolute; white-space:nowrap; translate:-50% -50%; padding:2px 7px; border:1px solid #c1d2a478; border-radius:3px; background:#15251cce; font-size:11px; color:#eaf8d0}
.hurt-flash {background:radial-gradient(ellipse at center,transparent 36%,#d44737ae 100%); opacity:0; transition:opacity .22s}
.hurt-flash.flash {opacity:1; transition:none}
.hud-top {position:absolute; top:calc(var(--top) + 12px); left:calc(var(--left) + 13px); right:calc(var(--right) + 13px); display:flex; justify-content:space-between; align-items:flex-start; pointer-events:none; gap:8px}
.hud-top button {pointer-events:auto}
.hud-chips {display:flex; align-items:center; gap:6px}
.hud-chips .glass {min-height:36px; font-size:12px; border-radius:5px}
.hud-chips .icon {width:16px; height:16px; color:var(--moss)}
.hud-chips .icon-button .icon {width:20px; height:20px}
#clock-icon {color:var(--amber)}
.coordinates {color:#f0f1dc; font-size:11px; font-weight:700; margin:5px 0 0 2px; text-shadow:0 1px 4px #101e18,0 0 6px #101e18}
.network {background:#291f1bec; margin-top:6px; width:max-content; padding:4px 8px; border:1px solid #b58564; border-radius:3px; color:#f8cf9b; font-size:11px}
.trail {position:absolute; top:calc(var(--top) + 70px); right:calc(var(--right) + 14px); max-width:min(231px,43vw); padding:8px 11px; background:#18271ddc; border:1px solid #91a67c83; border-left:3px solid var(--moss); border-radius:4px; pointer-events:none}
.trail span {color:var(--moss); font-size:9px; font-weight:800; letter-spacing:.13em}
.trail p {font-size:11.5px; line-height:1.36; margin-top:3px}
.aim-ui {position:absolute; top:50%; left:50%; pointer-events:none}
.cross {position:absolute; inset:-9px auto auto -9px; width:18px; height:18px; filter:drop-shadow(0 1px 2px #141d17)}
.cross::before,.cross::after {content:''; position:absolute; background:#f5f4dc; border-radius:1px}
.cross::before {left:8px; top:0; width:2px; height:18px}
.cross::after {top:8px; left:0; width:18px; height:2px}
.cross.active::before,.cross.active::after {background:#fbe1a4}
.target {position:absolute; top:17px; left:50%; translate:-50% 0; width:max-content; text-align:center; max-width:min(260px,80vw); text-shadow:0 1px 3px #111e18,0 0 6px #111e18; color:#fff9dd; font-size:12px}
.target b,.target small {display:block}
.target small {font-size:10.5px; color:#f6dca5}
.dig-meter {margin:4px auto 0; width:82px; height:5px; background:#202c24; border:1px solid #e6d7ab; border-radius:2px; overflow:hidden}
.dig-meter>div {height:100%; width:0; background:#f1c779; transition:width .15s linear}
.toast {z-index:3; position:absolute; left:50%; top:calc(var(--top) + 73px); translate:-50% 0; width:max-content; max-width:min(380px,83vw); padding:8px 12px; border-radius:4px; border:1px solid #a0b78b; background:#25392cee; color:#f2f5db; font-size:12px; box-shadow:0 5px 16px #16201950; text-align:center; pointer-events:none}
.hud-bottom {position:absolute; bottom:calc(var(--bottom) + 7px); left:50%; translate:-50% 0; max-width:calc(100% - var(--left) - var(--right) - 16px); width:max-content; pointer-events:none}
.look-hint,.held-title {text-align:center; font-size:11.5px; color:#f5f5df; text-shadow:0 1px 4px #142019,0 0 6px #142019}
.look-hint {margin:0 auto 5px; padding:3px 8px; background:#15221cc4; border:1px solid #d4e5c344; border-radius:4px; width:max-content; max-width:100%}
.held-title {height:17px; margin-top:3px}
.status-line {display:flex; flex-wrap:wrap; gap:4px; align-items:center; margin:0 0 4px}
.vital {--vital:#f17664; display:flex; align-items:center; gap:4px; padding:3px 5px; color:var(--vital); background:#14251ee8; border:1px solid #a3ad858c; border-radius:4px; font-size:10px; line-height:1}
.vital .icon {width:15px; height:15px; fill:currentColor; stroke-width:0}
.vital>div {width:clamp(22px,9vw,58px); height:6px; border-radius:1px; background:#465047; overflow:hidden}
.vital i {display:block; width:100%; height:100%; background:currentColor; transition:width .2s}
.vital b {color:#ebf0df; min-width:12px; text-align:center}
.vital.hunger {--vital:#eab466}
.vital.air {--vital:#8fd8e3}
.vital.air .icon {fill:none;stroke-width:2}
.hotbar {display:grid; grid-template-columns:repeat(9,minmax(0,1fr)); gap:4px; pointer-events:none; width:clamp(342px,56vw,468px); max-width:100%; padding:4px; border:1px solid #9eab87; border-radius:5px; background:#15241de8; box-shadow:1px 5px 0 #17281a64}
.slot {position:relative; display:grid; place-items:center; padding:0; aspect-ratio:1; border-radius:3px; border:1px solid #788676; background:#25392e; color:#eaf2dc; min-width:0; pointer-events:auto}
.slot:hover {border-color:#ccdcae}
.slot.active {border-color:#f7e1af; background:#4e5b36; box-shadow:inset 0 0 0 1px #f7e1af}
.slot>.n,.slot>.amount {position:absolute; text-shadow:0 1px 2px #121f18; line-height:1}
.slot>.n {left:3px;top:2px; font-size:9px; color:#cbd6b8}
.slot>.amount {right:3px;bottom:3px; font-size:10px}
.slot>.durability {position:absolute; bottom:2px; left:10%; height:2px; width:80%; border-radius:1px; background:#21271c}
.durability>i {display:block; height:100%; border-radius:1px; background:#bcd783}
.item-glyph {display:inline-flex; align-items:center; justify-content:center; color:var(--item,#bacb9d); flex:none}
.item-glyph .icon {width:24px; height:24px; stroke-width:2; fill:color-mix(in srgb,currentColor 35%,#16251d); filter:drop-shadow(1px 2px 0 #17241c)}
.slot .item-glyph .icon {width:clamp(16px,4.1vw,24px); height:auto; aspect-ratio:1}
.hand {position:absolute; bottom:10px; right:max(6%,calc(var(--right) + 40px)); width:160px; height:135px; pointer-events:none; transform:translateY(22px) rotate(-12deg); transform-origin:100% 100%; filter:drop-shadow(4px 7px 0 #1a251b45); opacity:.92}
.hand .sleeve {position:absolute; bottom:-23px; left:47px; width:78px; height:103px; background:linear-gradient(90deg,#3a5d4e 0 19%,#5b8c72 19% 95%,#6c9e80 95%); border-top:19px solid #ad7f5d; border-radius:4px 4px 0 0; transform:skewX(12deg) rotate(-19deg)}
.hand-object {position:absolute; z-index:2; left:25px; top:-8px}
.hand-object .icon {width:78px; height:78px; filter:drop-shadow(2px 3px 0 #26362a); stroke-width:1.45}
.hand.walk {animation:walk .58s infinite ease-in-out alternate}
.hand.swing {animation:swing .30s infinite ease-in-out alternate}
@keyframes walk {from{transform:translateY(23px) rotate(-14deg)} to{transform:translate(-7px,12px) rotate(-9deg)}}
@keyframes swing {from{transform:translateY(19px) rotate(-10deg)} to{transform:translate(-36%,-23%) rotate(-30deg)}}
.touch-controls {display:none}
.touch .touch-controls {display:block; position:absolute; inset:0; pointer-events:none}
.touch .hand {display:none}
.touch .look-hint {display:none}
.joystick {--size:clamp(82px,23vw,114px); position:absolute; width:var(--size); height:var(--size); left:calc(var(--left) + 13px); bottom:calc(var(--bottom) + 104px); border:2px solid #e2efd1aa; border-radius:50%; background:#142a20a3; box-shadow:0 3px 8px #15241c50,inset 0 0 0 6px #b4cdae24; pointer-events:auto; touch-action:none}
.joy-guides {position:absolute; inset:18%; border-radius:50%; background:linear-gradient(90deg,transparent 49%,#d1e2c44d 49% 51%,transparent 51%),linear-gradient(transparent 49%,#d1e2c44d 49% 51%,transparent 51%)}
.joy-stick {position:absolute; width:42%; height:42%; left:29%; top:29%; background:#abc788; border:1px solid #d3e7b6; border-radius:50%; box-shadow:0 3px 0 #263e2c; pointer-events:none}
.actions {position:absolute; right:calc(var(--right) + 11px); bottom:calc(var(--bottom) + 96px); display:grid; grid-template-columns:repeat(2,1fr); gap:6px; align-items:end; pointer-events:none}
.touch-button {display:flex; flex-direction:column; align-items:center; justify-content:center; width:clamp(50px,15vw,66px); height:clamp(50px,15vw,66px); padding:3px; gap:3px; background:#1d3429db; border:1px solid #c2d9aecc; border-radius:10px; color:#eaf3db; box-shadow:0 3px 0 #192c21b0; font-size:9px; touch-action:none; pointer-events:auto}
.touch-button:active,.touch-button.pressed {background:#587550e9; border-color:#eff6d8}
.touch-button .icon {width:22px; height:22px; color:#e4edc7}
.touch-button.dig {background:#51412bdf; border-color:#e6cb92}
.touch-button.dig.pressed {background:#89603b}
.touch-button.jump {grid-column:2; grid-row:1}
.touch-button.dig {grid-column:1; grid-row:2}
.touch-button.use {grid-column:2; grid-row:2}

.overlay {position:fixed; inset:0; z-index:10; display:grid; place-items:center; padding:calc(var(--top) + 12px) calc(var(--right) + 12px) calc(var(--bottom) + 12px) calc(var(--left) + 12px); background:#0d1814c0; overscroll-behavior:contain}
.sheet {position:relative; display:flex; flex-direction:column; width:min(100%,650px); max-height:100%; min-height:0; padding:clamp(14px,3.4vw,24px); background:linear-gradient(145deg,#22382d,#182620 80%); border:1px solid #788a70; border-radius:6px; box-shadow:5px 6px 0 #101b16b0,0 14px 44px #101914b0; animation:appear .17s ease-out}
@keyframes appear {from{translate:0 5px;opacity:0}to{translate:0 0;opacity:1}}
.sheet-head {display:flex; align-items:flex-start; justify-content:space-between; gap:12px; border-bottom:1px solid #516955; padding:1px 0 12px; margin-bottom:12px}
.sheet-head h2 {font:400 clamp(22px,5.8vw,32px)/1.18 var(--head); color:#eff2d8; margin-top:6px}
.sheet-content {overflow:auto; overscroll-behavior:contain; min-height:0; padding:1px 2px 2px; scrollbar-color:#788765 #1b2c22}
.sheet-buttons,.world-options,.tabs {display:flex; flex-wrap:wrap; gap:7px}
.sheet-buttons {margin:16px 0 0}
.sheet-buttons button {flex:1 1 auto}
.sheet-buttons .main-button {flex:2 1 auto}
.tabs .soft {min-height:36px}
.tabs [aria-pressed=true] {background:#bbd180; color:#243520; border-color:#d6e3a6}
.muted {color:#bdcab9; font-size:13px; line-height:1.44; margin:10px 0}
.bag-list,.recipes-list {display:grid; gap:6px; grid-template-columns:repeat(2,minmax(0,1fr))}
#pack-belt {width:min(100%,380px); min-width:0; margin:0 0 10px; box-shadow:none}
.bag-item,.recipe-item {display:flex; align-items:center; gap:7px; text-align:left; padding:7px 8px; min-width:0; min-height:48px; border:1px solid #54705a; background:#283e30; border-radius:4px}
.bag-item:hover,.recipe-item:not(.unavailable):hover {border-color:#bed38e; background:#314a37}
.bag-item strong,.recipe-item strong {display:block; color:#eff0da; font-size:12px}
.bag-item small,.recipe-item small {display:block; color:#bdcdbb; font-size:10.5px; line-height:1.4}
.bag-item .quantity {font-weight:800; color:#d9e8a7; margin-left:auto; font-size:11px}
.recipe-item {cursor:pointer}
.recipe-item.unavailable {background:#203128; border-color:#3e5546}
.recipe-item.unavailable strong {color:#c1cdb9}
.recipe-item .requires {color:#f0c697}
.pack-notice {min-height:1.4em; margin-top:7px; color:var(--amber); font-size:12px}
.room-code input {letter-spacing:.19em; color:#f0dda5}
.room-roster {padding:9px 10px; margin:10px 0; border:1px solid #435b49; border-radius:4px; background:#182921}
.room-roster h3 {font-size:13px; color:#e3ebce}
.room-roster ul {display:flex; flex-wrap:wrap; gap:5px; list-style:none; margin:7px 0 0; padding:0}
.room-roster li {background:#2b4435; border-radius:3px; padding:3px 8px; font-size:12px; overflow-wrap:anywhere}
.world-options .soft {min-height:34px; font-size:12px}
.world-options .icon {width:16px; height:16px; color:var(--moss)}
.help-grid {display:grid; gap:12px; grid-template-columns:repeat(2,minmax(0,1fr))}
.help-grid section {border:1px solid #516955; background:#24392d; border-radius:4px; padding:11px}
.help-grid h3 {font-size:15px; color:#dceab2}
.help-grid dl {margin:7px 0 0}
.help-grid dt {font-weight:800; font-size:12px; color:#f2ebcc; margin:7px 0 2px}
.help-grid dd {margin:0; color:#c6d3c2; font-size:11.5px}
kbd {padding:1px 4px; background:#14271c; border:1px solid #6e8064; border-radius:3px; font:700 11px var(--body)}
.field-note {padding:10px; margin:10px 0 4px; border-left:3px solid var(--amber); background:#383a29; color:#efe4bd; font-size:13px; border-radius:3px}
[data-panel=death] .field-note {background:#453129; border-color:#e08c77; color:#f4d7ca}

@media(max-width:730px){
  .lobby-grid {grid-template-columns:minmax(0,1fr); gap:23px}
  .landing-inner {gap:clamp(20px,4vh,38px); width:min(520px,100%)}
  .hero h1 {font-size:clamp(58px,16vw,98px); margin:.09em 0 .14em -.04em}
  .hero p {font-size:14px; max-width:375px}
  .tags {margin-top:13px; gap:5px 10px; font-size:11px}
  .tags .icon {width:13px; height:13px}
  .entry h2 {margin-bottom:14px}
  .masthead {padding-bottom:10px}
  .mast-help {min-height:35px; font-size:12px}
  .mast-foot {font-size:9px}
  .landing::after {background:linear-gradient(100deg,#182c24df,#182c23a0),linear-gradient(0deg,#101813e8,transparent 62%)}
}
@media(max-width:415px){
  .hud-top {left:calc(var(--left) + 7px);right:calc(var(--right) + 7px);gap:4px}
  .hud-chips {gap:4px}
  .hud-chips .glass {padding:0 7px; font-size:11px}
  .hud-chips .icon-button {width:35px;min-width:35px}
  .trail {max-width:53vw; top:calc(var(--top) + 65px);right:calc(var(--right) + 8px);padding:4px 7px}
  .trail p {font-size:10.5px}
  .hotbar {width:calc(100vw - 20px);gap:3px;padding:3px}
  .bag-list,.recipes-list,.help-grid {grid-template-columns:minmax(0,1fr)}
  .bag-item,.recipe-item{min-height:42px}
  #copy-code .icon {display:none}
}
@media(max-height:500px) and (min-width:500px){
  .landing-inner {padding-top:max(12px,var(--top));padding-bottom:max(12px,var(--bottom));gap:16px;width:min(1100px,100%)}
  .lobby-grid {grid-template-columns:minmax(0,1fr) minmax(230px,300px);gap:22px}
  .hero h1 {font-size:clamp(43px,9vw,91px)}
  .entry {padding:13px 16px}
  .divider {margin:9px 0 6px}
  .entry h2 {margin:6px 0 10px}
  .entry-status {margin-top:8px;min-height:0}
  .mast-foot {display:none}
  .hotbar {width:351px}
  .trail {top:calc(var(--top) + 59px);max-width:35vw}
  .joystick {bottom:calc(var(--bottom) + 17px);--size:80px}
  .actions {bottom:calc(var(--bottom) + 13px)}
  .touch-button {width:52px;height:48px}
}
@media(max-height:500px) and (max-width:590px) and (orientation:landscape){
  .hotbar {width:calc(100vw - 258px);min-width:225px}
  .joystick {--size:69px;left:calc(var(--left) + 6px)}
  .actions {right:calc(var(--right) + 6px);gap:4px}
  .touch-button {width:43px;height:43px;font-size:8px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
