  @import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&display=swap');
  :root{
    --panel:#3a2b6e; --ink:#fff; --dim:#d9d0ff;
    --lime:#8dff5a; --cyan:#37d6ff; --rose:#ff5c7a; --gold:#ffcf3a; --stroke:#241a45;
  }
  *{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;
    font-family:'Baloo 2',system-ui,sans-serif;}
  html,body{height:100%;background:#3a86b5;color:var(--ink);overflow:hidden;user-select:none;}
  #game{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;}
  canvas{display:block;touch-action:none;}
  #hud{position:fixed;top:0;left:0;right:118px;padding:10px;display:flex;gap:8px;
    align-items:flex-start;pointer-events:none;z-index:5;flex-wrap:wrap;}
  .card{background:linear-gradient(#4a3690,#3a2b6e);border:3px solid var(--stroke);
    border-radius:16px;padding:7px 11px;box-shadow:0 4px 0 rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.14);}
  #inv{display:flex;gap:5px;flex-wrap:wrap;font-size:14px;font-weight:800;max-width:62vw;}
  .slot{display:flex;align-items:center;gap:4px;padding:2px 7px;background:rgba(0,0,0,.22);border-radius:10px;}
  .dot{width:13px;height:13px;border-radius:5px;flex:0 0 auto;border:2px solid rgba(0,0,0,.35);}
  #hearts{font-size:18px;letter-spacing:1px;}
  #obj{font-size:12px;font-weight:700;color:var(--dim);max-width:250px;line-height:1.35;}
  #obj b{color:var(--gold);}
  #stick{position:fixed;left:20px;bottom:22px;width:138px;height:138px;border-radius:50%;
    background:radial-gradient(circle at 50% 40%,rgba(58,43,110,.7),rgba(36,26,69,.7));
    border:4px solid var(--stroke);z-index:6;touch-action:none;box-shadow:0 5px 0 rgba(0,0,0,.25);}
  #nub{position:absolute;left:50%;top:50%;width:60px;height:60px;margin:-30px 0 0 -30px;border-radius:50%;
    background:radial-gradient(circle at 38% 30%,#8f7bff,#5b45c8);border:4px solid var(--stroke);
    box-shadow:0 4px 0 rgba(0,0,0,.3);}
  #act{position:fixed;right:20px;bottom:30px;display:flex;flex-direction:column;gap:14px;z-index:6;align-items:center;}
  .btn{width:92px;height:92px;border-radius:50%;border:4px solid var(--stroke);
    font-size:14px;font-weight:800;display:flex;align-items:center;justify-content:center;
    text-align:center;line-height:1;color:#fff;text-shadow:0 2px 0 rgba(0,0,0,.35);
    touch-action:none;cursor:pointer;box-shadow:0 6px 0 rgba(0,0,0,.3), inset 0 3px 0 rgba(255,255,255,.25);}
  .btn:active{transform:translateY(3px);box-shadow:0 3px 0 rgba(0,0,0,.3), inset 0 3px 0 rgba(255,255,255,.25);}
  #actMine{background:radial-gradient(circle at 40% 30%,#ffc94a,#f39616);}
  #actPlace{width:72px;height:72px;font-size:12px;background:radial-gradient(circle at 40% 30%,#ffe07a,#d99a10);}
  #actAtk{width:72px;height:72px;background:radial-gradient(circle at 40% 30%,#ff7a92,#e83e5e);}
  /* щит держат нажатым: пока палец на кнопке, она горит */
  #actShield{width:72px;height:72px;font-size:12px;background:radial-gradient(circle at 40% 30%,#c9a6ff,#7a3fd6);}
  #actShield.up{background:radial-gradient(circle at 40% 30%,#eadcff,#b45cff);border-color:#fff;
    box-shadow:0 0 18px rgba(200,150,255,.9), inset 0 3px 0 rgba(255,255,255,.35);transform:translateY(3px);}
  #craftBtn{position:fixed;right:22px;top:82px;z-index:6;padding:9px 15px;border-radius:14px;
    border:3px solid var(--stroke);background:linear-gradient(#8dff5a,#5bcc2e);color:#173a08;
    font-size:14px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.4);}
  #craftBtn:active{transform:translateY(2px);}
  #healBtn{position:fixed;right:22px;top:130px;z-index:6;padding:9px 15px;border-radius:14px;
    border:3px solid var(--stroke);background:linear-gradient(#ff8ea3,#e83e5e);color:#fff;
    font-size:14px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.35);}
  #healBtn:active{transform:translateY(2px);}
  #weaponBtn{position:fixed;right:22px;top:178px;z-index:6;padding:9px 15px;border-radius:14px;
    border:3px solid var(--stroke);background:linear-gradient(#b0b6bd,#7c828a);color:#fff;
    font-size:17px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.35);}
  #weaponBtn:active{transform:translateY(2px);}
  /* полоска жажды: под сердцами, той же карточкой */
  #thirst{position:relative;margin-top:5px;height:13px;border-radius:7px;
    background:rgba(0,0,0,.35);border:2px solid var(--stroke);overflow:hidden;min-width:120px;}
  #thirstFill{position:absolute;left:0;top:0;bottom:0;width:100%;
    background:linear-gradient(#6fd8ff,#2a86d6);transition:width .2s;}
  #thirstFill.low{background:linear-gradient(#ffd94a,#e0a010);}
  #thirstFill.dry{background:linear-gradient(#ff8ea3,#c2203e);}
  #thirstTxt{position:relative;display:block;text-align:center;font-size:9px;font-weight:800;
    line-height:13px;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.7);}
  /* Кнопка питья стоит рядом с лечением, а не в конце длинного столбика:
     пить и лечиться — соседние дела, и обе кнопки должны попадаться на глаза сразу.
     Появляется, только когда есть что пить: у воды или с водой во фляге */
  #drinkBtn{position:fixed;right:92px;top:130px;z-index:6;padding:9px 15px;border-radius:14px;
    border:3px solid var(--stroke);background:linear-gradient(#6fd8ff,#2a86d6);color:#062a45;
    font-size:15px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.4);}
  #drinkBtn:active{transform:translateY(2px);}
  /* у самой воды кнопка шире, светлее и подмигивает — её нельзя не заметить */
  #drinkBtn.near{background:linear-gradient(#a8ecff,#37a8e8);border-color:#eafcff;
    animation:drinkPulse 1.1s ease-in-out infinite;}
  @keyframes drinkPulse{
    0%,100%{box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.4), 0 0 0 0 rgba(111,216,255,.6);}
    50%{box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.4), 0 0 0 9px rgba(111,216,255,0);}}
  #dropBtn{position:fixed;right:22px;top:226px;z-index:6;padding:9px 15px;border-radius:14px;
    border:3px solid var(--stroke);background:linear-gradient(#ffd94a,#e0a010);color:#3a2b0a;
    font-size:14px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.4);
    touch-action:none;user-select:none;}
  #dropBtn:active{transform:translateY(2px);}
  #pvpBtn{position:fixed;right:22px;top:274px;z-index:6;padding:9px 15px;border-radius:14px;
    border:3px solid var(--stroke);background:linear-gradient(#ff8ea3,#c2203e);color:#fff;
    font-size:14px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.35);
    touch-action:none;user-select:none;}
  #pvpBtn:active{transform:translateY(2px);}
  #pvpBtn.wait{filter:grayscale(.7);opacity:.6;}
  #parry{position:fixed;z-index:21;width:104px;height:104px;margin:-52px 0 0 -52px;
    display:flex;align-items:center;justify-content:center;cursor:pointer;touch-action:none;user-select:none;}
  #parryRing{position:absolute;inset:0;border-radius:50%;border:5px solid #ffd94a;
    background:rgba(255,217,74,.16);box-shadow:0 0 0 4px rgba(36,26,69,.55), 0 0 22px rgba(255,217,74,.5);}
  #parry span{position:relative;font-size:13px;font-weight:800;color:#fff;
    text-shadow:0 2px 0 rgba(0,0,0,.6);pointer-events:none;}
  #parry.hit #parryRing{border-color:#8dff5a;background:rgba(141,255,90,.25);}
  #menuBtn{padding:9px 15px;border-radius:14px;
    border:3px solid var(--stroke);background:linear-gradient(#6a5ab8,#463a8e);color:#fff;
    font-size:17px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.3);}
  #menuBtn:active{transform:translateY(2px);}
  #worldsBtn{padding:9px 15px;border-radius:14px;
    border:3px solid var(--stroke);background:linear-gradient(#8dff5a,#5bcc2e);color:#173a08;
    font-size:17px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.4);}
  #worldsBtn:active{transform:translateY(2px);}
  #setBtn{padding:9px 15px;border-radius:14px;
    border:3px solid var(--stroke);background:linear-gradient(#ffd94a,#c29a10);color:#3a2b00;
    font-size:17px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.4);}
  #setBtn:active{transform:translateY(2px);}
  #voiceBtn{padding:9px 15px;border-radius:14px;
    border:3px solid var(--stroke);background:linear-gradient(#6a5ab8,#463a8e);color:#fff;
    font-size:17px;font-weight:800;cursor:pointer;box-shadow:0 4px 0 rgba(0,0,0,.3), inset 0 2px 0 rgba(255,255,255,.3);}
  #voiceBtn:active{transform:translateY(2px);}
  #wsInfo{font-size:13px;font-weight:800;color:#ffd94a;letter-spacing:.4px;}
  #topCenterBtns{position:fixed;top:10px;left:50%;transform:translateX(-50%);z-index:7;
    display:flex;gap:10px;}
  .skinSw{width:42px;height:42px;border-radius:12px;border:3px solid var(--stroke);cursor:pointer;}
  .skinSw.sel{box-shadow:0 0 0 3px #ffd94a;}
  .hatBtn{padding:7px 11px;border-radius:11px;border:3px solid var(--stroke);cursor:pointer;
    background:linear-gradient(#4a3690,#3a2b6e);color:#fff;font-size:12px;font-weight:800;}
  .hatBtn.sel{border-color:#ffd94a;color:#ffd94a;}
  #hotbar{position:fixed;left:50%;bottom:8px;transform:translateX(-50%);z-index:6;
    display:flex;gap:5px;padding:5px;background:rgba(30,22,56,.7);border:3px solid var(--stroke);
    border-radius:14px;max-width:92vw;overflow-x:auto;}
  .hslot{position:relative;width:46px;height:46px;flex:0 0 auto;border-radius:9px;border:3px solid var(--stroke);
    background:rgba(0,0,0,.25);display:flex;align-items:center;justify-content:center;cursor:pointer;}
  .hslot.sel{border-color:#ffd94a;box-shadow:0 0 0 2px #ffd94a inset;}
  .hslot .hcube{width:24px;height:24px;border-radius:6px;border:2px solid rgba(0,0,0,.4);}
  .hslot .hn{position:absolute;bottom:0;right:2px;font-size:11px;font-weight:800;color:#fff;
    text-shadow:0 1px 2px #000;}
  .hslot .htree{font-size:22px;line-height:1;}
  .ov{position:fixed;inset:0;z-index:20;display:none;align-items:center;justify-content:center;
    background:rgba(20,14,45,.72);backdrop-filter:blur(4px);padding:16px;}
  .ov.on{display:flex;}
  .box{background:linear-gradient(#5847a8,#3a2b6e);border:4px solid var(--stroke);border-radius:24px;
    padding:22px;max-width:440px;width:100%;text-align:center;max-height:90vh;overflow-y:auto;
    box-shadow:0 10px 0 rgba(0,0,0,.3), inset 0 3px 0 rgba(255,255,255,.18);}
  h1{font-size:36px;font-weight:800;letter-spacing:1px;margin-bottom:6px;color:var(--gold);
    text-shadow:0 3px 0 var(--stroke);-webkit-text-stroke:2px var(--stroke);}
  h2{font-size:23px;font-weight:800;margin-bottom:12px;color:var(--gold);
    text-shadow:0 2px 0 var(--stroke);-webkit-text-stroke:1.5px var(--stroke);}
  p.sub{color:#efeaff;font-size:14px;font-weight:600;line-height:1.55;margin-bottom:16px;}
  .go{padding:13px 26px;border-radius:16px;border:3px solid var(--stroke);font-weight:800;font-size:17px;cursor:pointer;
    background:linear-gradient(#ffd94a,#f5a417);color:#4a2e00;letter-spacing:.5px;
    box-shadow:0 6px 0 rgba(0,0,0,.3), inset 0 3px 0 rgba(255,255,255,.4);}
  .go:active{transform:translateY(3px);box-shadow:0 3px 0 rgba(0,0,0,.3);}
  #miniWrap{max-width:380px;}
  #miniCanvas{width:100%;background:linear-gradient(#2c2158,#1c1440);border-radius:16px;
    border:4px solid var(--stroke);touch-action:none;box-shadow:inset 0 3px 8px rgba(0,0,0,.4);}
  #miniHint{font-size:13px;font-weight:600;color:#efeaff;margin:12px 0;line-height:1.45;}
  #miniTap{margin-top:6px;padding:16px;border-radius:16px;border:3px solid var(--stroke);width:100%;
    background:linear-gradient(#37d6ff,#1ba8dc);color:#062a38;font-weight:800;font-size:18px;cursor:pointer;
    box-shadow:0 6px 0 rgba(0,0,0,.3), inset 0 3px 0 rgba(255,255,255,.4);}
  #miniTap:active{transform:translateY(3px);box-shadow:0 3px 0 rgba(0,0,0,.3);}
  .recipe{display:flex;justify-content:space-between;align-items:center;gap:10px;
    padding:10px 12px;border:3px solid var(--stroke);border-radius:15px;margin-bottom:9px;
    background:linear-gradient(#4a3690,#3a2b6e);cursor:pointer;text-align:left;box-shadow:0 4px 0 rgba(0,0,0,.25);}
  .recipe:active{transform:translateY(2px);box-shadow:0 2px 0 rgba(0,0,0,.25);}
  .recipe.no{opacity:.45;}
  .rname{font-size:14.5px;font-weight:800;}
  .rcost{font-size:11px;font-weight:600;color:var(--dim);margin-top:2px;}
  .rtier{font-size:10px;font-weight:700;margin-top:2px;}
  .rmake{font-size:12px;color:var(--lime);font-weight:800;flex:0 0 auto;text-shadow:0 1px 0 var(--stroke);text-align:center;}
  .x{margin-top:6px;background:linear-gradient(#6a5ab8,#463a8e);border:3px solid var(--stroke);color:#fff;
    padding:11px 22px;border-radius:14px;cursor:pointer;font-size:14px;font-weight:800;box-shadow:0 4px 0 rgba(0,0,0,.25);}
  .x:active{transform:translateY(2px);}
  #toast{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:30;
    background:linear-gradient(#4a3690,#2e2258);border:3px solid var(--gold);color:var(--gold);
    padding:12px 22px;border-radius:16px;font-size:15px;font-weight:800;opacity:0;
    transition:opacity .25s, transform .25s;pointer-events:none;text-align:center;max-width:80vw;
    text-shadow:0 1px 0 var(--stroke);box-shadow:0 6px 0 rgba(0,0,0,.3);}
  #toast.on{opacity:1;transform:translate(-50%,-58%);}
  .kbd{color:var(--dim);font-size:11px;font-weight:600;margin-top:12px;}
  .tag{display:inline-block;padding:1px 7px;border-radius:8px;font-size:11px;font-weight:800;margin:2px;border:2px solid var(--stroke);}
