    * { margin: 0; padding: 0; box-sizing: border-box; }
    body { overflow: hidden; font-family: 'Courier New', monospace; background: #87CEEB; touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
    canvas { display: block; }

    #crosshair {
        position: fixed; top: 50%; left: 50%;
        transform: translate(-50%, -50%);
        width: 20px; height: 20px;
        pointer-events: none; z-index: 1000;
    }
    #crosshair::before, #crosshair::after { content: ''; position: absolute; background: rgba(255,255,255,.9); }
    #crosshair::before { width: 2px; height: 20px; left: 9px; top: 0; }
    #crosshair::after  { width: 20px; height: 2px; left: 0; top: 9px; }
    #crosshair.attack::before, #crosshair.attack::after { background: #ff4444; }

    /* ---------- Schriftzug unten links ---------- */
    #brand {
        position: fixed;
        left: calc(14px + env(safe-area-inset-left));
        bottom: calc(10px + env(safe-area-inset-bottom));
        font: 300 12px/1 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
        letter-spacing: 0.35em;
        color: rgba(255, 255, 255, 0.6);
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
        pointer-events: none;
        z-index: 2040;   /* immer sichtbar, auch über Dialogen und dem Startbildschirm */
    }

    /* ---------- Version und Copyright unten rechts ---------- */
    #version {
        position: fixed;
        right: calc(14px + env(safe-area-inset-right));
        bottom: calc(10px + env(safe-area-inset-bottom));
        font: 300 10px/1 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
        letter-spacing: 0.08em;
        color: rgba(255, 255, 255, 0.5);
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
        pointer-events: none;
        z-index: 2040;
    }

    /* ---------- Toolbar oben links ---------- */
    #toolbar {
        position: fixed; top: 10px; left: 10px;
        display: flex; gap: 6px; z-index: 2050;   /* auch über dem Startbildschirm bedienbar */
    }
    #toolbar button {
        display: flex; align-items: center; gap: 8px;
        height: 40px; padding: 0 12px 0 8px; cursor: pointer;
        font: bold 13px 'Courier New', monospace; color: #fff;
        background: rgba(0,0,0,0.6); border: 3px solid #fff; border-radius: 0;
        text-shadow: 1px 1px 0 #000; transition: transform .1s;
    }
    #toolbar button b {
        display: inline-block; width: 22px; height: 22px; line-height: 20px;
        text-align: center; font-size: 16px;
        background: #4CAF50; border: 2px solid #8f8; color: #fff;
    }
    #toolbar button:hover { transform: scale(1.06); border-color: yellow; }
    #toolbar button.hidden { display: none; }
    #quit-btn b { background: #a33; border-color: #e88; }

    /* ---------- Hilfe-Dialog ---------- */
    #help {
        position: fixed; inset: 0; z-index: 2100;
        display: flex; align-items: center; justify-content: center;
        background: rgba(0,0,0,.6); color: #fff;
    }
    #help.hidden { display: none; }
    .help-window {
        width: min(680px, 94vw); max-height: 88vh;
        display: flex; flex-direction: column; gap: 10px;
        background: #2b2b2b; border: 4px solid #555; border-radius: 6px;
        padding: 14px; box-shadow: 0 8px 40px rgba(0,0,0,.7);
    }
    #help-close {
        font: inherit; font-size: 16px; width: 32px; height: 32px; cursor: pointer;
        background: #444; color: #fff; border: 2px solid #666; border-radius: 4px;
    }
    #help-close:hover { background: #a33; }
    .help-body {
        overflow-y: auto; min-height: 0;
        background: #1c1c1c; border: 2px solid #444; border-radius: 4px;
        padding: 6px 14px 10px; font-size: 13px; line-height: 1.7;
        scrollbar-color: #4CAF50 #1c1c1c;
    }
    .help-body::-webkit-scrollbar { width: 12px; }
    .help-body::-webkit-scrollbar-track { background: #1c1c1c; }
    .help-body::-webkit-scrollbar-thumb { background: #4CAF50; border: 2px solid #1c1c1c; }
    .help-body section { padding: 8px 0 10px; border-bottom: 2px solid #333; }
    .help-body section:last-child { border-bottom: none; }
    .help-body h3 { color: #4CAF50; font-size: 15px; margin-bottom: 4px; }
    .help-body p { color: #ddd; }
    .help-body kbd {
        background: #333; padding: 1px 6px; border-radius: 3px; color: #fff;
        border: 1px solid #555; border-bottom-width: 2px;
    }

    #block-selector {
        position: fixed; bottom: 10px; left: 50%;
        transform: translateX(-50%);
        display: flex; gap: 5px; z-index: 1000;
    }
    .block-btn {
        position: relative;
        width: 50px; height: 50px;
        border: 3px solid white; cursor: pointer;
        transition: transform .1s;
        background-color: rgba(0,0,0,0.35);
        background-size: cover;
        image-rendering: pixelated;
    }
    .block-btn i {
        position: absolute; top: 1px; left: 3px;
        font: bold 11px 'Courier New', monospace; font-style: normal;
        color: #fff; text-shadow: 1px 1px 0 #000;
    }
    .block-btn small {
        position: absolute; right: 2px; bottom: 0;
        font: bold 12px 'Courier New', monospace;
        color: #fff; text-shadow: 1px 1px 0 #000;
    }
    .block-btn:hover { transform: scale(1.1); }
    .block-btn.selected { border-color: yellow; box-shadow: 0 0 10px yellow; }

    #debug-info {
        position: fixed; top: 10px; right: 10px;
        background: rgba(0,0,0,0.7); color: white;
        padding: 10px; border-radius: 8px; font-size: 12px;
        text-align: right; z-index: 1000; line-height: 1.5;
    }

    .panel-head::after, #player-list .head::after { content: ' ▾'; opacity: .6; }
    .collapsed > .panel-head::after, #player-list.collapsed .head::after { content: ' ▸'; }
    #debug-info .panel-head { cursor: pointer; user-select: none; font-weight: bold; margin-bottom: 4px; }
    #debug-info.collapsed .panel-head { margin-bottom: 0; }
    #debug-info.collapsed #info-body { display: none; }
    #player-list .head { pointer-events: auto; cursor: pointer; user-select: none; }
    #player-list.collapsed > div:not(.head) { display: none; }
    #player-list.collapsed .head { margin-bottom: 0; }

    #healthbar {
        position: fixed; bottom: 70px; left: 50%;
        transform: translateX(-50%);
        z-index: 1000; font-size: 22px; color: #e33;
        text-shadow: 1px 1px 0 #000;
        pointer-events: none;
    }
    /* Hungerleiste über den Herzen: 10 Keulen, leere ausgegraut, blinkt bei Hunger */
    #hungerbar {
        position: fixed; bottom: 98px; left: 50%;
        transform: translateX(-50%);
        z-index: 1000; font-size: 16px; line-height: 1; letter-spacing: 1px;
        filter: drop-shadow(1px 1px 0 #000);
        pointer-events: none;
    }
    #hungerbar.hidden { display: none; }
    #hungerbar span.off { opacity: .22; filter: grayscale(1); }
    #hungerbar.low span.on { animation: hungerPulse 1s ease-in-out infinite; }
    @keyframes hungerPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
    /* Abbau-Fortschritt unter dem Fadenkreuz */
    #dig-progress {
        position: fixed; top: calc(50% + 18px); left: 50%;
        transform: translateX(-50%);
        width: 64px; height: 6px;
        background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.75);
        z-index: 1000; pointer-events: none;
    }
    #dig-progress.hidden { display: none; }
    #dig-progress div { height: 100%; width: 0; background: #ffd54a; }

    #damage-flash {
        position: fixed; inset: 0;
        background: rgba(255, 0, 0, 0.35);
        opacity: 0; transition: opacity .3s;
        pointer-events: none; z-index: 1500;
    }

    #overlay {
        position: fixed; inset: 0; z-index: 2000;
        display: flex; align-items: center; justify-content: center;
        background: rgba(0,0,0,0.55); color: white;
        font-size: 22px; text-align: center; cursor: pointer;
    }
    #overlay.hidden { display: none; }
    #overlay div { background: rgba(0,0,0,.6); padding: 30px 50px; border-radius: 12px; }
    #overlay small { display: block; margin-top: 10px; font-size: 14px; color: #aaa; }

    #toast {
        position: fixed; bottom: 110px; left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,.75); color: #fff;
        padding: 8px 16px; border-radius: 8px; font-size: 14px;
        z-index: 1600; pointer-events: none;
        opacity: 0; transition: opacity .25s;
        white-space: pre-line; text-align: center; max-width: 90vw;
    }
    #toast.show { opacity: 1; }

    /* Spielerliste (Mehrspieler): unten rechts, mit Abstand über der Versionszeile */
    #player-list {
        position: fixed; right: calc(14px + env(safe-area-inset-right)); bottom: calc(44px + env(safe-area-inset-bottom));
        min-width: 150px; max-width: 240px; padding: 6px 10px; z-index: 1100; pointer-events: none;
        background: rgba(0,0,0,.45); border-radius: 6px; color: #fff; font-size: 13px; line-height: 1.5;
        text-shadow: 0 1px 2px #000;
    }
    #player-list.hidden { display: none; }
    #player-list .head { font-weight: bold; margin-bottom: 2px; }
    #player-list .sub { margin-top: 6px; font-size: 11px; color: #bcd; text-transform: uppercase; letter-spacing: .05em; }
    #player-list > div:not(.head):not(.sub) { display: flex; gap: 6px; align-items: baseline; }
    #player-list .dot { flex: none; font-size: 10px; }
    #player-list .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #player-list .ex { flex: none; font-size: 11px; color: #bcd; }
    #player-list .on .dot { color: #6f6; }
    #player-list .me .nm { font-weight: bold; }
    #player-list .off { opacity: .6; }
    body.touch #player-list { bottom: auto; top: calc(76px + env(safe-area-inset-top)); right: calc(20px + env(safe-area-inset-right)); }

    #chat {
        position: fixed; left: 12px; bottom: 150px; width: min(440px, 70vw);
        z-index: 1550; pointer-events: none; color: #fff; font-size: 14px;
        text-shadow: 0 1px 3px #000, 0 0 2px #000;
    }
    #chat div { background: rgba(0,0,0,.4); padding: 2px 8px; margin-top: 2px; border-radius: 4px; transition: opacity 1.5s; }
    #chat div.sys { color: #ffd479; font-style: italic; }
    #chat div.old { opacity: 0; }

    #sleep-fade {
        position: fixed; inset: 0; background: #000;
        opacity: 0; transition: opacity .6s;
        pointer-events: none; z-index: 1700;
    }

    /* ---------- Inventar-Dialog ---------- */
    #inventory {
        position: fixed; inset: 0; z-index: 1900;
        display: flex; align-items: center; justify-content: center;
        background: rgba(0,0,0,.55); color: #fff;
    }
    #inventory.hidden { display: none; }
    .inv-window {
        width: min(720px, 94vw); max-height: 92vh;
        display: flex; flex-direction: column; gap: 10px;
        background: #2b2b2b; border: 4px solid #555; border-radius: 6px;
        padding: 14px; box-shadow: 0 8px 40px rgba(0,0,0,.7);
    }
    .inv-head { display: flex; align-items: center; gap: 10px; }
    .inv-head h2 { flex: 1; font-size: 20px; color: #fff; }
    #inv-search {
        width: 190px; padding: 6px 8px; font: inherit; font-size: 13px;
        background: #111; color: #fff; border: 2px solid #666; border-radius: 4px;
    }
    #inv-close {
        font: inherit; font-size: 16px; width: 32px; height: 32px; cursor: pointer;
        background: #444; color: #fff; border: 2px solid #666; border-radius: 4px;
    }
    #inv-close:hover { background: #a33; }
    #inv-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
    #inv-tabs button {
        font: inherit; font-size: 13px; padding: 6px 12px; cursor: pointer;
        background: #3a3a3a; color: #ddd; border: 2px solid #555; border-radius: 4px;
    }
    #inv-tabs button:hover { background: #4a4a4a; }
    #inv-tabs button.active { background: #4CAF50; color: #fff; border-color: #8f8; }
    #inv-grid {
        display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px;
        overflow-y: auto; min-height: 120px; max-height: 46vh;
        background: #1c1c1c; border: 2px solid #444; border-radius: 4px; padding: 8px;
        font-size: 13px;
    }
    .inv-item {
        display: flex; flex-direction: column; align-items: center; gap: 4px;
        padding: 8px 4px; cursor: pointer; text-align: center;
        background: #333; border: 2px solid #4a4a4a; border-radius: 4px;
    }
    .inv-item:hover { background: #444; border-color: yellow; }
    .inv-item span {
        width: 40px; height: 40px; background-size: cover; image-rendering: pixelated;
        border: 2px solid #777;
    }
    .inv-item b { font-weight: normal; font-size: 11px; line-height: 1.2; }
    #inv-desc { min-height: 34px; font-size: 13px; color: #cfd; line-height: 1.4; }
    #inv-hotbar { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
    .inv-hint { font-size: 11px; color: #999; text-align: center; line-height: 1.6; }
    .inv-hint kbd { background: #444; padding: 1px 4px; border-radius: 3px; }

    #cmdline {   /* Eingabezeile am unteren Bildrand, die Auswahlliste klappt darüber auf */
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1950;
        background: rgba(0,0,0,.88); border-top: 2px solid #666;
        padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    }
    body.cmd-open #brand, body.cmd-open #version { display: none; }   /* sonst scheinen sie durch die Eingabezeile */
    #cmdline > * { max-width: 820px; margin-left: auto; margin-right: auto; }
    #cmd-bar { display: flex; gap: 8px; }
    #cmd-send {
        flex: none; width: 52px; font: inherit; font-size: 20px; cursor: pointer;
        background: #4CAF50; color: #fff; border: 2px solid #8f8; border-radius: 4px;
    }
    #cmd-send:active { filter: brightness(1.2); }
    #cmdline.hidden { display: none; }
    #cmd-input {
        flex: 1; min-width: 0; padding: 8px 10px; font: inherit; font-size: 16px;
        background: #111; color: #fff; border: 2px solid #4CAF50; border-radius: 4px; outline: none;
    }
    #cmdline small { display: block; margin-top: 6px; color: #aaa; font-size: 11px; }
    #cmdline small kbd { background: #333; padding: 0 4px; border-radius: 3px; }
    #cmd-list {
        display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px;
        max-height: 42vh; overflow-y: auto; scrollbar-color: #4CAF50 #1c1c1c;
    }
    #cmd-list.hidden { display: none; }
    .cmd-row {
        display: flex; align-items: baseline; gap: 10px; padding: 5px 9px; cursor: pointer;
        background: #222; border: 2px solid #444; border-radius: 4px; font-size: 13px;
    }
    .cmd-row b { color: #8f8; white-space: nowrap; }
    .cmd-row span { color: #bbb; font-size: 11px; }
    .cmd-row:hover { border-color: #8f8; }
    .cmd-row.sel { background: #2e4a2e; border-color: #4CAF50; }

    .inv-item { position: relative; }
    .inv-item em {
        position: absolute; top: 2px; right: 5px; font-style: normal; font-weight: bold;
        font-size: 12px; color: #ff0; text-shadow: 1px 1px 0 #000;
    }
    #inv-grid.craft { display: flex; flex-direction: column; gap: 6px; }
    .craft-row {
        display: flex; align-items: center; gap: 12px; padding: 6px 10px;
        background: #333; border: 2px solid #4a4a4a; border-radius: 4px;
    }
    .craft-row .ico {
        width: 36px; height: 36px; flex: none; background-size: cover; image-rendering: pixelated;
        border: 2px solid #777;
    }
    .craft-row div { flex: 1; line-height: 1.4; }
    .craft-row b { display: block; font-size: 14px; }
    .craft-row small { font-size: 11px; color: #bcd; }
    .craft-row .miss { color: #f77; }
    .craft-row button {
        font: inherit; font-size: 13px; padding: 6px 12px; cursor: pointer;
        background: #4CAF50; color: #fff; border: 2px solid #8f8; border-radius: 4px;
    }
    .craft-row button:disabled { background: #444; border-color: #555; color: #888; cursor: not-allowed; }

    /* ---------- Planeten-Dialog ---------- */
    #planet-dialog {
        position: fixed; inset: 0; z-index: 2100;
        display: flex; align-items: center; justify-content: center;
        background: rgba(0,0,0,.6); color: #fff;
    }
    #planet-dialog.hidden { display: none; }
    .planet-window {
        width: min(620px, 94vw); max-height: 88vh;
        display: flex; flex-direction: column; gap: 10px;
        background: #2b2b2b; border: 4px solid #555; border-radius: 6px;
        padding: 14px; box-shadow: 0 8px 40px rgba(0,0,0,.7);
    }
    #planet-close {
        font: inherit; font-size: 16px; width: 32px; height: 32px; cursor: pointer;
        background: #444; color: #fff; border: 2px solid #666; border-radius: 4px;
    }
    #planet-close:hover { background: #a33; }
    #planet-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
    .planet-row {
        display: flex; align-items: center; gap: 12px; padding: 10px 12px;
        background: #333; border: 2px solid #4a4a4a; border-radius: 4px;
    }
    .planet-row.current { border-color: #4CAF50; background: #2e4a2e; }
    .planet-row .ico { font-size: 28px; width: 40px; text-align: center; flex: none; }
    .planet-row div { flex: 1; line-height: 1.4; }
    .planet-row b { display: block; font-size: 15px; }
    .planet-row small { font-size: 11px; color: #bcd; }
    .planet-row button {
        font: inherit; font-size: 13px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
        background: #4CAF50; color: #fff; border: 2px solid #8f8; border-radius: 4px;
    }
    .planet-row button:disabled { background: #444; border-color: #555; color: #888; cursor: default; }
    #planet-btn b { background: #3a5aa8; border-color: #8ab; font-size: 13px; }

    /* ---------- Mehrspieler-Dialog ---------- */
    #net-dialog, #radio-dialog {
        position: fixed; inset: 0; z-index: 2100;
        display: flex; align-items: center; justify-content: center;
        background: rgba(0,0,0,.6); color: #fff;
    }
    #net-dialog.hidden, #radio-dialog.hidden { display: none; }
    .net-window {
        width: min(440px, 94vw); display: flex; flex-direction: column; gap: 12px;
        background: #2b2b2b; border: 4px solid #555; border-radius: 6px;
        padding: 14px; box-shadow: 0 8px 40px rgba(0,0,0,.7);
    }
    #net-close, #radio-close {
        font: inherit; font-size: 16px; width: 32px; height: 32px; cursor: pointer;
        background: #444; color: #fff; border: 2px solid #666; border-radius: 4px;
    }
    #net-close:hover, #radio-close:hover { background: #a33; }
    #net-status, #radio-status { margin: 0; font-size: 13px; line-height: 1.5; color: #cde; }
    #net-form, #radio-form { display: flex; flex-direction: column; gap: 10px; }
    #net-form.hidden, #net-form label.hidden, .net-actions button.hidden { display: none; }
    #net-form label, #radio-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #bcd; }
    #net-form input, #radio-form input[type=url] {
        font: inherit; font-size: 16px; padding: 9px 10px; color: #fff;
        background: #1b1b1b; border: 2px solid #555; border-radius: 4px; outline: none;
    }
    #net-form input:focus, #radio-form input:focus { border-color: #8f8; }
    #radio-vol { accent-color: #4CAF50; }
    #radio-stop { background: #a33; border-color: #e88; }
    #donate-btn b { background: #a8325a; border-color: #f8b; font-size: 14px; }
    #radio-btn b { background: #8a5a2e; border-color: #fc8; font-size: 13px; }
    #radio-btn.on b { border-color: #6f6; box-shadow: 0 0 8px #6f6; }
    #net-form label small { color: #9ab; }
    #net-reset-form, #net-reg-form { display: flex; flex-direction: column; gap: 10px; }
    #net-reset-form label, #net-reg-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #bcd; }
    #net-reset-form input:not([type=checkbox]), #net-reg-form input:not([type=checkbox]) {
        font: inherit; font-size: 16px; padding: 9px 10px; color: #fff;
        background: #1b1b1b; border: 2px solid #555; border-radius: 4px; outline: none;
    }
    #net-reset-form input:focus, #net-reg-form input:focus { border-color: #8f8; }
    #net-reg-form label.hidden { display: none; }
    #net-reg-form .net-row2 { display: flex; gap: 10px; }
    #net-reg-form .net-row2 label { flex: 1; min-width: 0; }
    #net-reg-form label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.45; color: #cde; }
    #net-reg-form label.check input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: #4CAF50; }
    #net-reset-form.hidden, #net-reg-form.hidden, #net-codeview.hidden { display: none; }
    #net-codeview p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: #cde; }
    #net-codebox {
        font: bold 22px/1.3 Consolas, 'Courier New', monospace; letter-spacing: .08em; text-align: center;
        padding: 14px 8px; background: #111; border: 2px solid #4CAF50; border-radius: 6px; color: #8f8; user-select: all;
    }
    .linkbtn { align-self: flex-start; background: none; border: none; color: #8cf; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; }
    .net-actions { display: flex; gap: 8px; flex-wrap: wrap; }
    .net-actions button.secondary { background: #444; border-color: #888; }
    .net-actions button {
        flex: 1; font: inherit; font-size: 16px; padding: 10px 14px; cursor: pointer;
        background: #4CAF50; color: #fff; border: 2px solid #8f8; border-radius: 4px;
    }
    .net-actions button:hover { filter: brightness(1.1); }
    #net-leave { background: #a33; border-color: #e88; }
    #net-btn b { background: #2e7d5a; border-color: #8ec; font-size: 13px; }

    /* ---------- Touch-Steuerung ---------- */
    #touch.hidden { display: none; }
    #touch button {
        position: absolute; width: 64px; height: 64px; border-radius: 50%;
        font: bold 26px 'Courier New', monospace; color: #fff; cursor: pointer;
        background: rgba(0,0,0,0.45); border: 3px solid rgba(255,255,255,0.85);
        text-shadow: 1px 1px 0 #000; touch-action: none; -webkit-tap-highlight-color: transparent;
        z-index: 1200; pointer-events: auto;
    }
    #touch button:active, #touch button.on { background: rgba(76,175,80,0.7); border-color: #8f8; }
    #touch button.hidden { display: none; }
    #joystick {
        position: fixed; left: calc(24px + env(safe-area-inset-left)); bottom: calc(90px + env(safe-area-inset-bottom));
        width: 120px; height: 120px; border-radius: 50%; z-index: 1200;
        background: rgba(0,0,0,0.3); border: 3px solid rgba(255,255,255,0.6); touch-action: none;
    }
    #joy-knob {
        position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
        border-radius: 50%; background: rgba(255,255,255,0.75); border: 3px solid #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,.5); pointer-events: none;
    }
    #touch-right { position: fixed; right: calc(20px + env(safe-area-inset-right)); bottom: calc(80px + env(safe-area-inset-bottom)); width: 220px; height: 220px; z-index: 1200; }
    #touch-right [data-act=dig]   { right: 150px; bottom: 70px; width: 72px; height: 72px; font-size: 30px; }
    #touch-right [data-act=use]   { right: 72px;  bottom: 140px; }
    #touch-right [data-act=jump]  { right: 0;     bottom: 70px; width: 72px; height: 72px; font-size: 30px; }
    #touch-right [data-act=sneak] { right: 72px;  bottom: 0; }
    #touch-right [data-act=fly]   { right: 150px; bottom: 150px; }
    #touch-top { position: fixed; right: calc(20px + env(safe-area-inset-right)); top: calc(12px + env(safe-area-inset-top)); z-index: 1200; display: flex; gap: 10px; }
    #touch-top button { position: static; width: 52px; height: 52px; font-size: 22px; }
    body.touch #debug-info { display: none; }
    body.touch #block-selector { bottom: calc(10px + env(safe-area-inset-bottom)); }
    body.touch .block-btn { width: 56px; height: 56px; }
    body.touch #healthbar { bottom: calc(76px + env(safe-area-inset-bottom)); }
    body.touch #hungerbar { bottom: calc(104px + env(safe-area-inset-bottom)); }
    body.touch #toolbar { left: calc(10px + env(safe-area-inset-left)); top: calc(10px + env(safe-area-inset-top)); }
    body.touch #toolbar button { height: 48px; }
    body.touch #crosshair { opacity: .8; }
    @media (max-width: 700px) {
        body.touch .block-btn { width: 40px; height: 40px; border-width: 2px; }
        #joystick { width: 100px; height: 100px; }
        #touch button { width: 54px; height: 54px; font-size: 22px; }
    }
