        body, html {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            background-color: #111111;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            user-select: none;
        }
        canvas {
            display: block;
        }
        #ui-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
        .panel {
            position: absolute;
            background: rgba(15, 15, 15, 0.95);
            border: 2px solid #4a4a4a;
            color: #f0e6d2;
            padding: 15px;
            pointer-events: auto;
            border-radius: 4px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0,0,0,0.5);
        }
        .monster-icon-badge { display: inline-flex; justify-content: center; align-items: center; width: 24px; height: 24px; background: rgba(0,0,0,0.5); border: 1px solid #5a4b31; border-radius: 50%; font-size: 14px; }
        .hp-text { color: white; font-weight: bold; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; position: absolute; width: 100%; text-align: center; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 0.85rem; }
        .monster-bottom-row { display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 0.9rem; margin-top: 8px; }
        #top-bar {
            top: 0;
            left: 0;
            width: 100%;
            height: 28px;
            font-size: 0.9rem;
            font-weight: bold;
            display: flex;
            align-items: center;
            padding: 0 15px;
            box-sizing: border-box;
            border-radius: 0;
            border: none;
            border-bottom: 2px solid #4a4a4a; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
            background: #1a1a1a;
        }
        #bottom-bar {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: auto;
            background: rgba(15, 15, 15, 0.95);
            border-top: 2px solid #4a4a4a; box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.8);
            padding: 22px 10px 25px 10px;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            pointer-events: auto;
        }
        .menu-group {
            display: flex;
            gap: 8px;
            width: 100%;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
        }
        #info-panel {
            width: 260px;
            padding: 12px;
            display: none;
            z-index: 50;
        }
        #info-panel.hero-window {
            background: rgba(10, 10, 10, 0.95);
            border: 2px solid #4a4a4a;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.6);
        }
        #info-panel.hero-window h3 {
            font-size: 0.88rem;
            color: #ffffff;
        }
        #info-panel h3 { margin: 0; color: #ffcc00; font-size: 0.95rem; }
        .stat-line { display: flex; justify-content: space-between; margin-bottom: 3px; font-size: 0.85rem; }

        .shop-slot-btn {
            background: #1e3a8a; border: 2px solid #4a4a4a; border-radius: 4px;
            width: 65px; height: 65px; color: white; font-size: 0.85rem; font-weight: bold;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            cursor: pointer; transition: background 0.2s, box-shadow 0.2s;
            box-shadow: 0 2px 4px rgba(0,0,0,0.4);
        }
        .shop-slot-btn:hover { background: #4a4a4a; box-shadow: 0 0 8px #ffcc00; }
        .shop-slot-row { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }

        .shop-item-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
        .shop-item-btn {
            background: #242424; border: 1px solid #4a4a4a; border-radius: 4px;
            padding: 5px; color: white; display: flex; flex-direction: column; align-items: center;
            cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.3); transition: 0.2s;
            box-sizing: border-box; overflow: hidden; width: 100%;
        }
        .shop-item-btn:hover:not(:disabled) { background: #333333; border-color: #ffcc00; border-color: #4a4a4a; }
        .shop-item-btn:disabled { opacity: 0.4; cursor: not-allowed; }
        .shop-item-btn.selected { border-color: #ffcc00; box-shadow: 0 0 8px #1e3a8a; background: #3a4a63; }
        .item-icon { font-size: 1.5rem; }
        .item-cost { font-size: 0.8rem; color: #ffcc00; margin: 2px 0; font-weight: bold; }
        .item-classes { font-size: 0.7rem; letter-spacing: -2px; }

        .btn {
            background: #242424;
            border: 1px solid #4a4a4a;
            color: #f0e6d2;
            padding: 4px 8px;
            font-size: 0.85rem;
            cursor: pointer;
            border-radius: 3px;
            font-weight: bold;
            transition: background 0.2s;
        }
        .btn:hover:not(:disabled) { background: #333333; border-color: #ffcc00; }
        .btn.active { background: #1e3a8a; color: #ffcc00; border-color: #ffcc00; }
        .btn:disabled { background: #1a1a1a; color: #4a4a4a; cursor: not-allowed; border-color: #242424; }

        .tax-btn {
            background: #242424;
            border: 1px solid #4a4a4a;
            color: #aaaaaa;
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: 0.2s;
            margin-left: 2px;
        }
        .tax-btn:hover { background: #333333; color: #ffcc00; color: #f0e6d2; }
        .tax-btn.active { background: #1e3a8a; border-color: #ffcc00; color: #fff; font-weight: bold; }

        .menu-btn {
            background: #242424;
            border: 3px solid #4a4a4a;
            color: #f0e6d2;
            width: 64px;
            height: 64px;
            border-radius: 10px;
            cursor: pointer;
            display: block;
            position: relative;
            box-shadow: 0 4px 6px rgba(0,0,0,0.4);
            transition: transform 0.1s, border-color 0.2s, filter 0.2s;
            padding: 0;
            margin: 0 3px;
        }
        #bottom-bar .menu-btn { width: 76px; height: 76px; margin: 0 6px; }
        .menu-btn:hover:not(:disabled) { transform: translateY(-2px); }
        .menu-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(80%); }

        .build-btn:hover:not(:disabled) { border-color: #ffcc00; }
        .build-btn.active { border-color: #ffcc00; background: #1e3a8a; }

        .build-btn-header {
            position: absolute;
            top: -10px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 0;
            z-index: 2;
        }

        .build-btn-title {
            background: #4a4a4a;
            color: #f0e6d2;
            padding: 1px 6px;
            border-radius: 0 4px 4px 0;
            font-size: 0.65rem;
            font-weight: bold;
            letter-spacing: 0.5px;
            white-space: nowrap;
            border: 1px solid #000000;
            border-left: none;
            box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
            transition: 0.2s;
        }
        .menu-btn.active .build-btn-title,
        .menu-btn:hover:not(:disabled) .build-btn-title {
            background: #ffcc00;
            color: #1a1a1a;
            border-color: #000000;
        }
        #bottom-bar .build-btn-title { font-size: 0.75rem; padding: 2px 8px; }

        .build-btn-hotkey {
            background: #ffcc00;
            color: #1a1a1a;
            padding: 1px 5px;
            border-radius: 4px 0 0 4px;
            font-weight: 900;
            font-size: 0.65rem;
            border: 1px solid #000000;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        #bottom-bar .build-btn-hotkey { font-size: 0.75rem; padding: 2px 6px; }

        .build-btn-icon {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 2.0rem;
            line-height: 1;
            text-align: center;
            width: 100%;
        }
        #bottom-bar .build-btn-icon { font-size: 2.3rem; }

        .build-btn-cost-badge {
            position: absolute;
            bottom: -12px;
            left: 50%;
            transform: translateX(-50%);
            background: #1a1a1a;
            border: 2px solid #4a4a4a;
            padding: 1px 6px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            white-space: nowrap;
            box-shadow: 0 2px 4px rgba(0,0,0,0.5);
            z-index: 2;
            transition: 0.2s;
        }
        #bottom-bar .build-btn-cost-badge { bottom: -14px; padding: 2px 8px; }

        .build-btn-cost { font-size: 0.65rem; font-weight: bold; color: #ffcc00; }
        #bottom-bar .build-btn-cost { font-size: 0.75rem; }

        .nav-btn { background: #1e3a8a; border-color: #3b82f6; }
        .nav-btn .build-btn-title { background: #3b82f6; border-color: #000000; }
        .nav-btn .build-btn-cost-badge { background: #0f172a; border-color: #3b82f6; }
        .nav-btn:hover:not(:disabled) { border-color: #ffcc00; }
        .nav-btn:hover:not(:disabled) .build-btn-title { background: #ffcc00; color: #1a1a1a; border-color: #000000; }
        .nav-btn:hover:not(:disabled) .build-btn-cost-badge { border-color: #ffcc00; }
        .nav-btn .build-btn-icon { text-shadow: 2px 2px 4px rgba(0,0,0,0.6); }

        .panel-btn-grid {
            display: flex;
            flex-wrap: nowrap;
            gap: 12px;
            justify-content: center;
            margin-top: 25px;
            margin-bottom: 15px;
        }
        .panel-btn-grid .menu-btn { margin: 0; }

        #pause-overlay {
            display: none;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 4rem;
            color: rgba(255, 255, 255, 0.9);
            font-weight: bold;
            text-shadow: 0px 4px 15px rgba(0,0,0,1);
            pointer-events: none;
            letter-spacing: 8px;
            z-index: 10;
        }

        body.is-paused #bottom-bar,
        body.is-paused #info-panel {
            pointer-events: none;
            opacity: 0.5;
            filter: grayscale(80%);
        }

        #game-over {
            display: none;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(10, 15, 20, 0.98);
            border: 3px solid #e53e3e;
            padding: 12px;
            width: 85%;
            max-width: 800px;
            height: auto;
            max-height: 98vh;
            color: #f0e6d2;
            pointer-events: auto;
            z-index: 1000;
            border-radius: 8px;
            box-shadow: 0 0 50px rgba(0,0,0,1);
            flex-direction: column;
        }
        .go-title { font-size: 1.4rem; text-align: center; margin-bottom: 5px; font-weight: bold; border-bottom: 2px solid; padding-bottom: 5px; flex-shrink: 0; }
        .score-grid { display: flex; flex-direction: column; gap: 6px; flex-grow: 1; min-height: 0; }
        .go-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 2px; }
        .go-table th { background: #242424; padding: 4px; text-align: left; color: #ffcc00; border-bottom: 2px solid #4a4a4a; }
        .go-table td { padding: 3px 4px; border-bottom: 1px solid #242424; }
        .go-table tr:nth-child(even) { background: rgba(255,255,255,0.03); }
        .stat-box { background: #1a1a1a; border: 1px solid #4a4a4a; padding: 6px 10px; border-radius: 4px; display: flex; flex-direction: column; min-height: 0; }
        .stat-row { display: flex; justify-content: space-between; margin-bottom: 4px; border-bottom: 1px dashed #242424; padding-bottom: 2px; }
        .stat-label { color: #aaaaaa; }
        .stat-val { font-weight: bold; color: #ffcc00; }

        #tooltip {
            position: absolute;
            background: rgba(10, 10, 10, 0.95);
            border: 2px solid #4a4a4a;
            padding: 6px;
            pointer-events: none;
            border-radius: 4px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.6);
            display: none;
            z-index: 1000;
            text-align: left;
            min-width: 50px;
            width: fit-content;
            max-width: 150px;
        }
        .tooltip-title { font-weight: bold; font-size: 0.88rem; margin-bottom: 3px; color: #ffffff; }
        .tooltip-desc { color: #f0e6d2; font-size: 0.77rem; line-height: 1.2; }
        #tooltip.building-tooltip { min-width: 210px; max-width: 270px; padding: 10px; }
        .pop-icon-glow { text-shadow: 0 0 4px white, 0 0 6px white; }

        #guild-roster-icons { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
        .roster-icon { display: inline-flex; justify-content: center; align-items: center; background: #242424; border: 1px solid #4a4a4a; border-radius: 4px; width: 28px; height: 28px; font-size: 1.1rem; cursor: help; transition: background 0.2s, border-color 0.2s, transform 0.1s; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
        .roster-icon:hover { background: #4a4a4a; border-color: #ffcc00; transform: translateY(-2px); }

        .scrollable-grid::-webkit-scrollbar { width: 6px; }
        .scrollable-grid::-webkit-scrollbar-track { background: #1a1a1a; border-radius: 3px; }
        .scrollable-grid::-webkit-scrollbar-thumb { background: #1e3a8a; border-radius: 3px; }

        #floating-text-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 40;
            overflow: hidden;
        }
        .floating-text {
            position: absolute;
            font-family: Arial, sans-serif;
            font-weight: bold;
            text-shadow: 1px 1px 2px black, -1px -1px 2px black, 1px -1px 2px black, -1px 1px 2px black;
            transform-origin: center center;
            will-change: transform, opacity;
            white-space: nowrap;
        }
