  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { width: 100%; height: 100%; overflow: hidden; background: #000;
    font-family: "Segoe UI", system-ui, sans-serif; }
  canvas.game { display: block; }

  /* ---------- HUD ---------- */
  #crosshair { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%);
    color: #fff; font-size: 22px; pointer-events: none; text-shadow: 0 0 3px #000;
    z-index: 10; user-select: none; }
  #hotbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    display: flex; gap: 4px; z-index: 10; pointer-events: none; }
  .slot { width: 52px; height: 52px; background: rgba(0,0,0,.45); border: 2px solid #666;
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    position: relative; }
  .slot canvas { image-rendering: pixelated; }
  .slot.active { border-color: #fff; box-shadow: 0 0 8px rgba(255,255,255,.6); }
  .slot .key { position: absolute; top: 2px; left: 4px; color: #ccc; font-size: 10px; }
  .slot .name { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
    color: #eee; font-size: 12px; text-shadow: 0 1px 2px #000; white-space: nowrap; display: none; }
  .slot.active .name { display: block; }
  #debug { position: fixed; left: 10px; top: 10px; color: #fff; font-size: 12px;
    text-shadow: 0 1px 2px #000; z-index: 10; pointer-events: none; line-height: 1.5; }

  /* ---------- Здоровье, сообщения ---------- */
  #hearts { position: fixed; left: 12px; top: 66px; z-index: 10; font-size: 21px;
    letter-spacing: 2px; pointer-events: none; text-shadow: 0 1px 3px #000; }
  #hurt { position: fixed; inset: 0; z-index: 15; pointer-events: none; opacity: 0;
    transition: opacity .5s; box-shadow: inset 0 0 120px 40px rgba(200,0,0,.75); }
  #msg { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 12;
    color: #fff; font-size: 26px; text-shadow: 0 2px 4px #000; pointer-events: none;
    opacity: 0; transition: opacity .4s; }

  /* ---------- Стартовое меню ---------- */
  #overlay { position: fixed; inset: 0; z-index: 20; display: flex;
    align-items: center; justify-content: center;
    background: linear-gradient(160deg, rgba(15,30,55,.94), rgba(10,45,30,.94)); }
  #panel { background: rgba(0,0,0,.55); border: 1px solid #445; border-radius: 12px;
    padding: 26px 34px; color: #eee; width: 640px; max-width: 94vw; max-height: 92vh;
    overflow-y: auto; text-align: center; }
  #panel h1 { font-size: 30px; margin-bottom: 4px; letter-spacing: 1px; }
  #panel h1 span { color: #7dc95f; }
  #panel p.sub { color: #aaa; margin-bottom: 16px; font-size: 13px; }
  #panel label { font-size: 13px; color: #bbb; }
  #seed { width: 120px; padding: 6px 8px; margin: 4px 8px; border-radius: 6px;
    border: 1px solid #667; background: #12161c; color: #fff; font-size: 14px; }
  #play { margin: 12px 0 14px; padding: 10px 34px; font-size: 17px; cursor: pointer;
    background: #4c8a3a; color: #fff; border: none; border-radius: 8px; }
  #play:hover { background: #5aa046; }
  #help { text-align: left; font-size: 13px; line-height: 1.8; color: #cfd6dd; }
  #help b { color: #ffd76a; font-family: Consolas, monospace; }
  #craftGuide { text-align: left; font-size: 13px; color: #cfd6dd; margin-top: 8px; }
  #craftGuide h3 { color: #7dc95f; margin-bottom: 6px; font-size: 15px; }
  #craftGuide .grid { font-family: Consolas, monospace; background: rgba(0,0,0,.35);
    border-radius: 6px; padding: 6px 10px; margin: 6px 0; white-space: pre; font-size: 12px;
    line-height: 1.4; display: inline-block; }
  #craftGuide .out { color: #ffd76a; }
  .hidden { display: none !important; }

  /* ---------- GUI инвентаря / крафта / сундука / печки ---------- */
  #gui { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center;
    justify-content: center; background: rgba(0,0,0,.45); }
  #guiPanel { background: #2b2b33; border: 2px solid #55555f; border-radius: 10px;
    padding: 16px 20px; color: #ddd; box-shadow: 0 8px 40px rgba(0,0,0,.6); }
  #guiTitle { font-size: 16px; margin-bottom: 10px; color: #fff; }
  .gridRow { display: flex; gap: 4px; margin-bottom: 4px; }
  .gslot { width: 50px; height: 50px; background: #3b3b45; border: 2px solid #55555f;
    border-radius: 4px; position: relative; display: flex; align-items: center;
    justify-content: center; cursor: pointer; }
  .gslot:hover { border-color: #9a9ab0; background: #45454f; }
  .gslot canvas { image-rendering: pixelated; pointer-events: none; }
  .gslot .cnt { position: absolute; right: 3px; bottom: 1px; color: #fff; font-size: 12px;
    font-weight: bold; text-shadow: 1px 1px 0 #000; pointer-events: none; }
  .gslot.hot { background: #4a4a58; }
  .gslot.craftOut { background: #46543c; border-color: #6f8050; }
  #craftZone, #smeltZone { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
  .arrow { font-size: 24px; color: #999; }
  #fBar { width: 40px; height: 8px; background: #222; border-radius: 3px; overflow: hidden; margin-top: 4px; }
  #fBarIn { height: 100%; background: #f80; width: 0%; }
  #pBar { width: 40px; height: 8px; background: #222; border-radius: 3px; overflow: hidden; }
  #pBarIn { height: 100%; background: #6cf; width: 0%; }
  #invSeparator { height: 8px; }
  #guiHelp { font-size: 11px; color: #999; margin-top: 10px; max-width: 500px; line-height: 1.5; }
  #guiClose { margin-top: 10px; padding: 6px 18px; background: #5a4a3a; color: #fff;
    border: none; border-radius: 6px; cursor: pointer; font-size: 13px; }
  #cursorStack { position: fixed; z-index: 40; width: 40px; height: 40px; pointer-events: none;
    display: none; }
  #cursorStack canvas { image-rendering: pixelated; }
  #cursorStack .cnt { position: absolute; right: 0; bottom: -2px; color: #fff; font-size: 12px;
    font-weight: bold; text-shadow: 1px 1px 0 #000; }

  /* ---------- Сенсорное управление ---------- */
  #touchUI { position: fixed; inset: 0; z-index: 11; pointer-events: none; display: none; }
  body.is-touch #touchUI { display: block; }
  #joyZone { position: absolute; left: 18px; bottom: 84px; width: 150px; height: 150px; border-radius: 50%;
    background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25);
    pointer-events: auto; touch-action: none; }
  #joyKnob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px;
    border-radius: 50%; background: rgba(255,255,255,.35); border: 2px solid rgba(255,255,255,.6);
    pointer-events: none; }
  .tbtn { position: absolute; width: 54px; height: 54px; border-radius: 12px;
    background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.35); color: #fff; font-size: 21px;
    display: flex; align-items: center; justify-content: center; pointer-events: auto;
    touch-action: none; user-select: none; -webkit-user-select: none; }
  .tbtn:active { background: rgba(255,255,255,.3); }
  #tBreak { right: 20px; bottom: 150px; width: 74px; height: 74px; font-size: 30px; }
  #tPlace { right: 106px; bottom: 206px; }
  #tJump  { right: 106px; bottom: 140px; }
  #tDown  { right: 20px; bottom: 76px; }
  #tInv   { right: 20px; top: 14px; }
  #tFly   { right: 20px; top: 76px; }
  #tMenu  { right: 20px; top: 138px; }
  #tPrev  { left: 184px; bottom: 92px; width: 44px; height: 44px; font-size: 18px; }
  #tNext  { left: 236px; bottom: 92px; width: 44px; height: 44px; font-size: 18px; }
  @media (pointer: coarse) {
    .slot { width: 34px; height: 34px; }
    .slot canvas { width: 28px; height: 28px; }
    .slot .key { display: none; }
    #hotbar { bottom: 8px; gap: 2px; }
    #hearts { font-size: 16px; top: 50px; }
    #debug { font-size: 10px; line-height: 1.3; }
  }

/* Mobile controls: disjoint top toolbar and two-column action grid. */
#hotbar {bottom: max(18px, env(safe-area-inset-bottom));}
#keyFeedback {position:fixed;left:50%;top:60%;transform:translateX(-50%);z-index:12;color:white;background:#152d37d9;border-radius:8px;padding:7px 12px;opacity:0;transition:opacity .15s;pointer-events:none;font-weight:600;}
#keyFeedback.flash{opacity:1} #msg {font-size:17px;max-width:90vw;text-align:center;background:#162732b0;border-radius:8px;padding:5px 10px;}
#desktopTools{position:fixed;right:12px;top:12px;display:flex;gap:7px;z-index:13;} body.is-touch #desktopTools{display:none;}
#desktopTools button,#startCoop,dialog button{padding:8px 12px;border:1px solid #59776c;border-radius:8px;background:#284a40;color:white;font-size:14px;cursor:pointer;}
dialog{position:fixed;margin:auto;background:#182c2a;color:#f0f3ec;border:1px solid #638c76;border-radius:14px;padding:16px;width:min(560px,94vw);max-height:82dvh;overflow:auto;z-index:50;}
dialog::backdrop{background:#061513b5}dialog h2{font-size:20px;margin-bottom:10px}dialog p{font-size:13px;line-height:1.45;margin:8px 0}dialog input{width:100%;padding:10px;margin:5px 0 10px;background:#0f201e;color:#fff;border:1px solid #74937d;border-radius:5px}dialog button:disabled{opacity:.45}#catalog{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:6px;margin:12px 0}#catalog button{display:flex;flex-direction:column;align-items:center;padding:6px 4px;font-size:11px;min-height:66px}#catalog canvas{width:36px;height:36px;image-rendering:pixelated}#phrases,.coopButtons{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0}.mode{display:inline-block;padding:8px}#startCoop{margin-bottom:14px}
body.is-touch #touchTop{position:absolute;right:max(8px,env(safe-area-inset-right));top:max(8px,env(safe-area-inset-top));display:grid;grid-template-columns:repeat(5,44px);gap:5px;}
body.is-touch #touchActions{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:calc(max(7px,env(safe-area-inset-bottom)) + 62px);display:grid;grid-template-columns:repeat(2,min(63px,17vw));gap:8px;}
body.is-touch #touchTop .tbtn,body.is-touch #touchActions .tbtn{position:static;inset:auto;width:100%;height:44px;font-size:19px;pointer-events:auto;}
body.is-touch #touchActions .tbtn{height:58px;display:flex;flex-direction:column;gap:1px;}
.tbtn small{font-size:10px;line-height:1}.tbtn.pressed{background:#6eaa60b3;border-color:#fff;transform:scale(.96)}
body.is-touch #joyZone{left:max(12px,env(safe-area-inset-left));bottom:calc(max(7px,env(safe-area-inset-bottom)) + 62px);width:clamp(88px,32vw,122px);height:clamp(88px,32vw,122px);}
body.is-touch #joyKnob{width:44px;height:44px;margin:-22px 0 0 -22px;}
body.is-touch #hotbar{pointer-events:auto;gap:2px;bottom:max(8px,env(safe-area-inset-bottom));}body.is-touch .slot{width:min(35px,10vw);height:min(35px,10vw);touch-action:none;}body.is-touch .slot .name{bottom:auto;top:-20px;font-size:10px;}
body.is-touch #debug{max-width:125px;top:calc(max(8px,env(safe-area-inset-top)) + 52px);}body.is-touch #hearts{top:calc(max(8px,env(safe-area-inset-top)) + 113px);}
#guiPanel{max-width:96vw;max-height:90dvh;overflow:auto;padding:12px;} .gslot{width:clamp(27px,9.1vw,49px);height:clamp(27px,9.1vw,49px)}.gslot canvas{max-width:100%;max-height:100%;}#panel{max-height:92dvh;padding:18px 16px;}
@media (max-height:480px){body.is-touch #touchTop{grid-template-columns:repeat(5,40px)}body.is-touch #touchActions .tbtn{height:44px;}body.is-touch #touchActions{gap:5px;bottom:calc(max(7px,env(safe-area-inset-bottom)) + 47px)}body.is-touch #joyZone{bottom:calc(max(7px,env(safe-area-inset-bottom)) + 47px)}body.is-touch #debug{top:6px;}body.is-touch #hearts{top:66px;}}

#onlineBadge{position:fixed;top:8px;left:50%;transform:translateX(-50%);z-index:12;color:#d9f8e8;background:#123b31bc;padding:3px 8px;border-radius:5px;font-size:11px;pointer-events:none;}#onlineBadge:empty{display:none}body.is-touch #onlineBadge{top:calc(max(8px,env(safe-area-inset-top)) + 55px);left:auto;right:10px;transform:none;max-width:55vw;text-align:right;}

/* Visible microphone control stays accessible during play; no hidden capture. */
#micToggle[hidden]{display:none!important}#micToggle{position:fixed;z-index:40;top:max(92px,calc(env(safe-area-inset-top) + 86px));right:max(10px,env(safe-area-inset-right));min-width:48px;min-height:48px;display:flex;align-items:center;gap:6px;padding:7px 10px;color:white;background:#4a4c53;border:2px solid #d2d6da;border-radius:12px;font-size:14px;font-weight:600;touch-action:manipulation}#micToggle[data-on="true"]{background:#215d36;border-color:#a4e7b1}#micIcon{font-size:23px}body.is-touch #micToggle{max-width:155px}body.is-touch #micText{font-size:11px;max-width:95px;text-align:left} @media(max-height:480px){#micToggle{top:96px;right:10px;min-height:44px;max-width:150px}}

#invite{font-size:22px;letter-spacing:5px;font-variant-numeric:tabular-nums}#ownerControls{border-top:1px solid #59776c;margin-top:12px;padding-top:10px}#ownerControls summary{cursor:pointer;padding:8px 0}#ownerControls label{display:block;margin-top:8px}#createdCode{font-size:20px;font-weight:700;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}

/* Context prompt: the existing inventory button becomes a workbench button nearby. */
#workbenchHint[hidden]{display:none!important}
#workbenchHint{position:fixed;left:50%;top:calc(50% - 42px);transform:translate(-50%,-50%);z-index:12;pointer-events:none;background:#202a20e8;color:#fff8d4;border:1px solid #e7d699;border-radius:8px;padding:7px 12px;font-weight:700;font-size:14px;white-space:nowrap;}
#workbenchHint .benchTouch{display:none}body.is-touch #workbenchHint .benchDesktop{display:none}body.is-touch #workbenchHint .benchTouch{display:inline}
body.is-touch #tInv[aria-label="Верстак"]{background:#476c32;border-color:#f2d894;}
#guiClose{min-height:44px;padding:8px 20px;}body.is-touch #guiHelp{font-size:12px;}body.is-touch .gslot{touch-action:manipulation;}

@media(max-width:560px){#guiPanel .gslot{width:clamp(24px,calc((96vw - 62px)/9),49px);height:clamp(24px,calc((96vw - 62px)/9),49px);flex-shrink:0;}}

#coopPanel .familyBig{display:block;width:100%;min-height:48px;margin:8px 0;font-size:18px;font-weight:bold;background:#38783d}#coopPanel .familyBig:disabled{background:#284a40}#deviceStatus{font-weight:600}

/* v9 — lively, original voxel-world launcher, no dependencies. */
#overlay{background:radial-gradient(ellipse at 50% 0%,#71cbeb 0%,#2789ba 50%,#103e63 100%);padding:12px;overflow:hidden}
#panel{width:min(510px,96vw);max-height:calc(100dvh - 24px);padding:16px 20px 20px;border:3px solid #b8edeb;border-radius:24px;background:linear-gradient(155deg,#163c56,#102c41 70%);box-shadow:0 9px 0 #0a273e,0 22px 55px #082c5480;scrollbar-width:thin;color:#fff;overflow:auto}
.launchHero{height:clamp(90px,22vh,168px);position:relative;overflow:hidden;border-radius:15px;background:linear-gradient(#268fc5,#83ddfa 83%,#baf3fa);isolation:isolate;box-shadow:inset 0 0 0 2px #ffffff45}
.skySun{position:absolute;width:44px;height:44px;top:12px;right:12%;background:#ffed81;box-shadow:0 0 30px 12px #fff29b9e;border-radius:4px;transform:rotate(12deg)}
.cloud{position:absolute;width:65px;height:15px;background:#fff9;box-shadow:17px -9px 0 #fff9,36px 0 0 #fff9;animation:cloudDrift 18s ease-in-out infinite alternate;top:26px;left:8%;border-radius:3px}.c2{left:65%;top:52px;animation-delay:-9s;transform:scale(.8)}
.island{position:absolute;height:98%;width:100%;left:0;bottom:0;filter:drop-shadow(0 7px 3px #164d6866);animation:islandFloat 4s ease-in-out infinite}.heroCube{animation:cubeBob 2.5s ease-in-out infinite;transform-box:fill-box;transform-origin:center}.spark{position:absolute;color:#fff9c5;text-shadow:0 0 10px #ffde56;font-size:24px;animation:sparkle 3s ease-in-out infinite}.s1{top:18%;left:26%}.s2{right:20%;top:15%;animation-delay:-1s}.s3{left:45%;top:10%;animation-delay:-2s}
@keyframes cloudDrift{to{translate:50px 0}}@keyframes islandFloat{50%{translate:0 -3px}}@keyframes cubeBob{50%{translate:0 -10px;rotate:5deg}}@keyframes sparkle{50%{opacity:.35;scale:.7}}
#panel h1{font-size:clamp(29px,7vw,44px);line-height:1.1;font-weight:1000;letter-spacing:2px;margin:8px 0 2px;text-shadow:0 4px 0 #09273a;color:#fff3cc}#panel h1 em{color:#8ef594;font-style:normal}.launchSubtitle{font-size:15px;color:#c5f4ff;margin-bottom:12px}
.worldChoices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}.worldChoices button{border:2px solid #628ea5;background:#224e68;color:#e5f9ff;font-size:18px;font-weight:800;border-radius:13px;min-height:62px;cursor:pointer;box-shadow:0 3px 0 #09283b}.worldChoices button span{font-size:26px;display:block;line-height:1.1}.worldChoices button[aria-pressed=true]{background:#246b55;border-color:#95f4a5;color:#fff;border-width:3px;box-shadow:0 3px 0 #114d37,inset 0 0 12px #9df8bc38}
.worldForm{text-align:left;display:grid;gap:5px}#panel label{font-size:14px;font-weight:700;color:#d7efff}.seedRow{display:flex;gap:8px;align-items:center;margin:4px 0 8px}.seedRow input,#panel #seed{min-width:0;flex:1;width:100%;margin:0;padding:10px 12px;min-height:47px;border:2px solid #7199ae;border-radius:10px;background:#0d293b;color:#fff;font-size:21px;letter-spacing:1px}.seedRow button{min-width:48px;min-height:47px;border-radius:10px;background:#356989;border:2px solid #8bc8d8;color:white;font-size:23px;cursor:pointer}.smallNote{font-size:12px;color:#d4e6f1;margin:-3px 0 8px}#panel label.mode{display:flex;align-items:center;gap:8px;margin:0 0 8px;min-height:25px}#panel label.mode[hidden]{display:none}#creative{width:20px;height:20px;accent-color:#7ee67f}
#panel #play,#panel #startCoop{display:block;width:100%;min-height:53px;font-size:19px;font-weight:900;letter-spacing:.2px;border-radius:13px;cursor:pointer;margin:9px 0 10px;box-shadow:0 4px 0 #16472b;border:1px solid #b2f4a1;background:linear-gradient(#76d85c,#38a347);color:#092d20}#panel #startCoop{background:linear-gradient(#63b5e9,#3479ae);border-color:#a4d8ff;box-shadow:0 4px 0 #173e69;color:white}#panel button:active{transform:translateY(2px)}#panel button:disabled{opacity:.55;cursor:default}#menuStatus{color:#ffeb9b;font-size:14px;min-height:1em}#setupDevice{background:#264962;border:1px solid #62869e;color:#fff;padding:10px;border-radius:8px;margin-top:6px}#manual{border-top:1px solid #60819555;margin-top:10px;padding-top:8px;color:#bfe5f6;font-size:13px}#manual summary{cursor:pointer;padding:8px}#coopPanel #joinSeed,#coopPanel #invite{width:100%;font-size:22px;min-height:48px;letter-spacing:2px}#coopPanel #joinFields label{display:block;margin:10px 0 3px}#coopPanel [hidden],#panel [hidden]{display:none!important}
@media (min-width:650px) and (max-height:500px){#panel{width:min(760px,96vw);display:grid;grid-template-columns:1fr 1fr;gap:6px 18px;text-align:center;padding:12px 18px}.launchHero{grid-column:1;grid-row:1 / span 4;height:150px;align-self:start}#panel h1{grid-column:1;grid-row:5;align-self:end}.launchSubtitle{grid-column:1;grid-row:6}.worldChoices{grid-column:2;grid-row:1;margin:0}.worldForm{grid-column:2;grid-row:2 / span 3}#panel #play{grid-column:2;grid-row:5;margin:0}#panel #startCoop{grid-column:2;grid-row:6;margin:0}#menuStatus,#setupDevice,#loadError,#manual{grid-column:1 / -1}.worldChoices button{min-height:46px}.worldChoices button span{display:inline;font-size:20px}.seedRow{margin:2px 0}.seedRow input,#panel #seed,.seedRow button{min-height:38px;padding:6px}.launchSubtitle{margin:0}}
@media(prefers-reduced-motion:reduce){.cloud,.island,.heroCube,.spark{animation:none}}

#recentSection{text-align:left;margin-top:6px;color:#d7efff;font-weight:700}#recentWorlds{display:flex;gap:8px;overflow-x:auto;padding:5px 0}#recentWorlds button{flex:0 0 auto;min-height:44px;border-radius:10px;background:#27516c;color:white;border:1px solid #8bc8d8;font-size:16px;padding:6px 12px}@media(min-width:650px) and (max-height:500px){#recentSection{grid-column:1/-1}}

/* v10: one launch form, illustrated local splash. */
#overlay{background:#102c41 url('splash.webp') center center / cover no-repeat;justify-content:flex-start;padding:clamp(8px,3vw,40px);}
#panel{width:min(470px,96vw);max-height:calc(100dvh - 20px);max-width:100%;display:block;text-align:center;padding:16px 22px;background:linear-gradient(150deg,#102c41f5,#11374bed);border:2px solid #c5f9ff;border-radius:22px;box-shadow:0 10px 45px #071b35b0;}
.launchArt{position:relative;height:88px;border-radius:12px;overflow:hidden;background:url('splash.webp') 85% 48% / cover no-repeat;box-shadow:inset 0 0 0 1px #ffffff70;}
.launchArt i{position:absolute;color:#fff4a3;font-size:24px;font-style:normal;text-shadow:0 0 12px #fff;animation:launchShine 3s ease-in-out infinite;left:13%;top:10%;}.launchArt i:nth-child(2){left:72%;top:55%;animation-delay:1s}.launchArt i:nth-child(3){left:91%;top:12%;animation-delay:2s}@keyframes launchShine{0%,100%{opacity:.45;transform:scale(.85)}50%{opacity:1;transform:scale(1.15)}}
#panel h1{font-size:clamp(29px,6vw,43px);margin:8px 0 2px}#panel #play,#panel #startCoop{min-height:48px;margin:7px 0 9px}#menuStatus:empty{display:none}#deviceSetup{border:1px solid #ffdc8b;background:#293c48;border-radius:12px;padding:10px;margin-top:8px;text-align:left}#deviceSetup p{font-size:13px;line-height:1.35;margin:0 0 8px}#deviceSetup button,#forgetSavedPins{color:#fff;background:#264962;border:1px solid #62869e;border-radius:8px;min-height:42px;padding:6px 10px;cursor:pointer}#forgetSavedPins{font-size:12px;margin-top:8px}#recentWorlds{display:grid;grid-template-columns:1fr;overflow:visible;gap:6px}.recentCard{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;align-items:center;padding:7px;border-radius:10px;background:#173d52;border:1px solid #62869e}.recentCard div{text-align:left;min-width:0}.recentCard strong,.recentCard small{display:block;overflow-wrap:anywhere}.recentCard small{font-size:12px;color:#d7efff;font-weight:400}.recentCard button{min-height:44px;white-space:normal;max-width:100%;font-size:14px!important}.recentPin{grid-column:1/-1;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.recentPin span{font-variant-numeric:tabular-nums;letter-spacing:2px}.recentPin button{font-size:12px!important}.recentCard .recentOpen{background:#32794a!important;border-color:#a6ed94!important}#panel [hidden]{display:none!important}
@media(max-width:600px){#overlay{justify-content:center;padding:8px;background-position:70% center}#panel{padding:12px 14px}.launchArt{height:72px}.worldChoices button{min-height:52px}}
@media(min-width:650px) and (max-height:500px){#panel{width:min(730px,96vw);padding:12px 18px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px 16px}.launchArt{grid-column:1;grid-row:1/3;height:105px}#panel h1{grid-column:1;grid-row:3}.launchSubtitle{grid-column:1;grid-row:4}.worldChoices{grid-column:2;grid-row:1}.worldForm{grid-column:2;grid-row:2/4}#panel #play{grid-column:2;grid-row:4;margin:0}#panel #startCoop{grid-column:2;grid-row:5;margin:0}#menuStatus,#deviceSetup,#recentSection,#setupDevice,#forgetSavedPins,#loadError,#manual{grid-column:1/-1}.seedRow input,#panel #seed,.seedRow button{min-height:42px}.recentCard{grid-template-columns:minmax(0,1fr) auto}}
@media(prefers-reduced-motion:reduce){.launchArt i{animation:none}}

/* v12: child-friendly close control, center health, selected skins, fullscreen affordance. */
#hearts{left:50%!important;right:auto!important;top:auto!important;bottom:clamp(64px,calc(55px + env(safe-area-inset-bottom)),90px)!important;transform:translateX(-50%);text-align:center;white-space:nowrap;font-size:clamp(16px,2vw,23px)!important;letter-spacing:1px;background:rgba(12,23,23,.34);border-radius:12px;padding:1px 8px;}
.guiHeader{display:flex;justify-content:space-between;align-items:center;gap:12px;position:sticky;top:-12px;background:#2b2b33;padding:8px 0;z-index:3;}#guiExitTop{background:#397b56;color:#fff;border:2px solid #c8f5aa;border-radius:12px;padding:10px 16px;font-size:17px;font-weight:800;min-height:50px;touch-action:manipulation;cursor:pointer;}#guiClose{font-size:16px;font-weight:700;background:#397b56;}#guiPanel{max-height:91dvh;overscroll-behavior:contain;}
#fullExit{position:fixed;left:8px;top:8px;z-index:14;padding:7px 10px;min-height:35px;background:#162f3ab8;color:#fff;border:1px solid #91abb2;border-radius:9px;font-size:12px;}#fullExit[hidden]{display:none!important;}body.is-touch #fullExit{top:calc(max(8px,env(safe-area-inset-top)) + 5px);left:10px;font-size:10px;max-width:110px;}
.playerProfile{background:#123c52a8;padding:12px;border-radius:16px;border:1px solid #4f87a1;margin:8px 0 12px;}.playerProfile>label{display:block;text-align:left;font-weight:700;color:#fff;margin-bottom:6px}.playerProfile input{width:100%;min-height:43px;font-size:17px;background:#0c2537;border:1px solid #74a9c4;color:white;border-radius:10px;padding:8px 12px;}.skinCaption{display:flex;align-items:center;justify-content:space-between;margin-top:10px;gap:12px;color:#e4f8ff;font-weight:700;font-size:13px;}#randomSkin{border-radius:10px;padding:7px 10px;background:#255d79;border:1px solid #8ed8f5;color:white;font-size:13px;}#skinChoices{display:flex;gap:7px;overflow-x:auto;padding:7px 2px;scroll-snap-type:x mandatory;touch-action:pan-x;}#skinChoices button{scroll-snap-align:center;flex:0 0 76px;min-height:95px;border-radius:12px;background:#0d2d42;border:2px solid #547b9a;color:#fff;display:flex;flex-direction:column;align-items:center;gap:5px;padding:7px 3px;font-size:11px;}#skinChoices button[aria-pressed="true"]{border-color:#fce789;box-shadow:0 0 0 2px #ffa83f,0 0 18px #ffdc766e;background:#234b57;}.avatarThumb{width:38px;height:55px;position:relative;background:linear-gradient(var(--hair) 0 20%,var(--face) 20% 42%,var(--shirt) 42% 76%,var(--pants) 76%);border:3px solid #182c39;border-radius:10px 10px 5px 5px;box-shadow:inset 0 0 0 2px #e5ebf4,3px 4px 0 #061b29;}.avatarThumb::after{content:'••';position:absolute;top:18%;left:8px;font-size:17px;letter-spacing:6px;color:#22313d;}
@media(max-height:550px){.playerProfile{padding:6px}.playerProfile input{min-height:34px}.skinCaption{margin-top:5px}#skinChoices button{min-height:73px;flex-basis:64px}.avatarThumb{height:36px;width:28px}#hearts{bottom:55px!important}}

/* Put Create and Join on the same row: both must be visible without a second form. */
#panel .worldActions{display:flex;gap:9px;margin:6px 0 8px;grid-column:2;align-items:stretch;}
#panel .worldActions #play,#panel .worldActions #startCoop{flex:1;min-width:0;width:auto;min-height:48px;display:flex;align-items:center;justify-content:center;padding:6px;font-size:clamp(13px,3.7vw,17px);line-height:1.16;margin:0;}
#panel .playerProfile{padding:8px 10px;margin:5px 0 7px;}
#panel #skinChoices button{min-height:77px;flex-basis:66px;padding:4px 3px;}
#panel .avatarThumb{height:39px;width:28px;}
#panel .skinCaption{margin-top:5px;}
#panel #skinChoices{padding:4px 2px;}
#panel .playerProfile input{min-height:38px;}
#panel .launchArt{height:45px;}
#panel h1{font-size:clamp(25px,5vw,35px);margin:3px 0 1px;}
#panel .seedRow input,#panel #seed,#panel .seedRow button{min-height:40px;padding:6px 9px;}
@media(min-width:650px) and (max-height:500px){#panel .playerProfile{grid-column:1;grid-row:5/8}#panel .worldActions{grid-column:2;grid-row:5}#panel .worldForm{grid-row:2/5}#panel #play,#panel #startCoop{grid-column:auto;grid-row:auto}#panel{max-height:96dvh;}}

#gameHome{position:fixed;left:max(8px,env(safe-area-inset-left));top:calc(max(8px,env(safe-area-inset-top)) + 51px);z-index:14;display:inline-flex;min-height:43px;align-items:center;padding:6px 12px;border-radius:12px;color:#fff;text-decoration:none;background:#163f54d8;border:1px solid #b4eaff;font:800 14px system-ui}
#fullExit{min-height:44px;font-size:14px;top:max(8px,env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));}body.is-touch #fullExit{font-size:12px;min-height:44px;top:max(8px,env(safe-area-inset-top));left:max(8px,env(safe-area-inset-left));}
