
        * { box-sizing: border-box; }
        body { margin: 0; overflow: hidden; background-color: #000; font-family: 'Courier New', Courier, monospace; color: #cfe8ff; }
        canvas { display: block; }

        #crosshair { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 34px; color: #ffffff; text-shadow: 0 0 6px #000, 2px 2px 0 #000; pointer-events: none; user-select: none; }

        #instructions { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, 92vw); background: rgba(4, 12, 24, 0.86); border: 1px solid #21d07a; box-shadow: 0 0 30px rgba(33, 208, 122, 0.35); padding: 22px 26px; border-radius: 8px; pointer-events: auto; }
        #instructions h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: 3px; color: #21d07a; }
        #instructions .sub { margin: 0 0 16px; font-size: 12px; color: #7fa8c0; letter-spacing: 1px; }
        #instructions ul { margin: 0; padding-left: 18px; line-height: 1.85; font-size: 13px; }
        #instructions kbd { background: #0d2033; border: 1px solid #2b5378; border-radius: 4px; padding: 1px 6px; font-family: inherit; color: #8fe3ff; }
        #instructions .hint { margin-top: 16px; font-size: 12px; color: #21d07a; text-align: center; }

        #hud { position: absolute; left: 12px; bottom: 86px; background: rgba(0,0,0,0.55); border: 1px solid #2b5378; border-radius: 6px; padding: 10px 12px; font-size: 12px; letter-spacing: 1px; min-width: 210px; }
        #hud .readout { color: #8fe3ff; margin-top: 6px; }
        #hud .readout b { color: #21d07a; font-weight: normal; }
        #hud #msg { color: #ffb36b; min-height: 14px; }

        #hotbar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px; padding: 8px; background: rgba(0,0,0,0.55); border: 1px solid #2b5378; border-radius: 6px; }
        #hotbar .slot { position: relative; width: 48px; height: 48px; background: #0d2033; border: 2px solid #2b5378; border-radius: 5px; }
        #hotbar .slot.selected { border-color: #ffffff; box-shadow: 0 0 10px rgba(255,255,255,0.45); }
        #hotbar .swatch { position: absolute; top: 7px; left: 7px; right: 7px; bottom: 14px; border-radius: 3px; }
        #hotbar .key { position: absolute; top: 1px; left: 4px; font-size: 10px; color: #7fa8c0; }
        #hotbar .name { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: 9px; color: #cfe8ff; }
        #hotbar.full { border-color: #d0483a; box-shadow: 0 0 14px rgba(208,72,58,0.55); }
        .panel { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
                 width: min(600px, 94vw); max-height: 86vh; overflow-y: auto;
                 background: rgba(4, 12, 24, 0.96); border: 1px solid #21d07a;
                 box-shadow: 0 0 30px rgba(33, 208, 122, 0.35); padding: 16px 18px;
                 border-radius: 8px; display: none; pointer-events: auto; }
        .panel.open { display: block; }
        .panel h2 { margin: 0 0 2px; font-size: 16px; letter-spacing: 2px; color: #21d07a; }
        .panel .psub { margin: 0 0 12px; font-size: 11px; color: #7fa8c0; letter-spacing: 1px; }
        .recipe { border: 1px solid #2b5378; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
        .recipe .rname { font-size: 13px; color: #8fe3ff; margin-bottom: 2px; }
        .recipe .rcost { font-size: 11px; color: #7fa8c0; margin-bottom: 8px; }
        .recipe .rcost.have { color: #21d07a; }
        .recipe .rcost.lack { color: #d0483a; }
        .panel button { background: #0d2033; border: 1px solid #2b5378; border-radius: 4px;
                        padding: 5px 12px; font-family: inherit; font-size: 12px; color: #8fe3ff;
                        cursor: pointer; }
        .panel button:hover:not(:disabled) { border-color: #21d07a; color: #21d07a; }
        .panel button:disabled { opacity: 0.4; cursor: default; }
        .chestgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
        .chestgrid .cslot { position: relative; min-height: 52px; background: #0d2033;
                            border: 1px solid #2b5378; border-radius: 5px; padding: 14px 4px 4px;
                            font-size: 10px; text-align: center; color: #cfe8ff; cursor: pointer; }
        .chestgrid .cslot.sel { border-color: #ffffff; box-shadow: 0 0 8px rgba(255,255,255,0.4); }
        .chestgrid .cswatch { position: absolute; top: 4px; left: 8px; right: 8px; height: 12px; border-radius: 2px; }
        .chestgrid .cname  { position: absolute; bottom: 4px; left: 4px; right: 4px; font-size: 9px; text-align: center; color: #cfe8ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .chestgrid .ccount { position: absolute; top: 1px; right: 4px; font-size: 10px; color: #ffb36b; }
        .panel .row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
        .panel .note { font-size: 11px; color: #7fa8c0; }
        .furnacegrid { grid-template-columns: repeat(3, 1fr); max-width: 240px; }
        .furnace-progress-wrap { height: 10px; background: #0d2033; border: 1px solid #2b5378;
                                 border-radius: 5px; overflow: hidden; margin: 10px 0 2px; }
        #fprogressbar { height: 100%; width: 0; background: #ff8c00; transition: width 0.2s linear; }
        .cheatgrid { grid-template-columns: repeat(5, 1fr); }
        .cheatgrid .cslot { cursor: pointer; }
        .cheatgrid .cslot:hover { border-color: #21d07a; }
        .chestgrid .cslot, .furnacegrid .cslot { cursor: pointer; }
        .chestgrid .cslot:hover, .furnacegrid .cslot:hover { border-color: #21d07a; }
        .slot, .cslot, .panel, .psub, .note { user-select: none; -webkit-user-select: none; }
        .furnacegrid .cslot { padding-top: 18px; padding-bottom: 16px; }
        .furnacegrid .flabel { position: absolute; bottom: 3px; left: 0; right: 0;
                               font-size: 9px; text-align: center; color: #7fa8c0; }
        .furnacegrid .cslot .cname { bottom: 15px; }
    
