        @font-face {
            font-family: "TFW DejaVu Sans";
            src: url("media/gui/DejaVuSans.ttf") format("truetype");
            font-style: normal;
            font-weight: 400;
            font-display: swap;
        }

        @font-face {
            font-family: "TFW DejaVu Sans";
            src: url("media/gui/DejaVuSans-Bold.ttf") format("truetype");
            font-style: normal;
            font-weight: 700;
            font-display: swap;
        }

        @font-face {
            font-family: "TFW DejaVu Sans";
            src: url("media/gui/DejaVuSans-Oblique.ttf") format("truetype");
            font-style: italic;
            font-weight: 400;
            font-display: swap;
        }

	        html, body, canvas, #canvas, * {
	            cursor: none !important;
	        }

	        html, body {
	            min-height: 100%;
	            margin: 0;
	            background: #030403;
	        }

        @-webkit-keyframes rotation {
            from {-webkit-transform: rotate(0deg);}
            to {-webkit-transform: rotate(360deg);}
        }
        @-moz-keyframes rotation {
            from {-moz-transform: rotate(0deg);}
            to {-moz-transform: rotate(360deg);}
        }
        @-o-keyframes rotation {
            from {-o-transform: rotate(0deg);}
            to {-o-transform: rotate(360deg);}
        }
        @keyframes rotation {
            from {transform: rotate(0deg);}
            to {transform: rotate(360deg);}
        }

        /* the canvas *must not* have any border or padding, or mouse coords will be wrong */
	        #canvas {
	            position: absolute;
	            top: 0px;
	            left: 0px;
            margin: 0px;
            width: 100%;
            height: 100%;
            overflow: hidden;
            display: block;
	            border: 0px none;
	            background-color: black;
	        }

	        #html-battle-ended {
	            position: fixed;
	            top: 10px;
	            right: 10px;
	            z-index: 8;
	            display: none;
	            color: #1e170d;
	            font: 14px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	            cursor: default !important;
	            pointer-events: none;
	        }

	        #html-battle-ended.is-visible {
	            display: block;
	        }

	        #html-battle-loading {
	            position: fixed;
	            inset: 0;
	            z-index: 7;
	            display: none;
	            align-items: center;
	            justify-content: center;
	            background: transparent;
	            color: #f3e7b2;
	            font: 14px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	            cursor: default !important;
	            pointer-events: none;
	        }

	        #html-battle-loading.is-visible {
	            display: flex;
	        }

	        #html-battle-renderer {
	            position: fixed;
	            inset: 0;
	            z-index: 2;
	            display: none;
	            overflow: hidden;
	            background: #040503;
	            pointer-events: auto;
	            cursor: default !important;
	        }

	        #html-battle-renderer.is-visible {
	            display: block;
	        }

	        #html-battle-renderer,
	        #html-battle-renderer * {
	            cursor: default !important;
	        }

	        #html-battle-renderer canvas {
	            width: 100%;
	            height: 100%;
	            display: block;
	        }

	        .html-battle-cursor {
	            position: fixed;
	            z-index: 30;
	            width: 64px;
	            height: 64px;
	            margin-left: -8px;
	            margin-top: -7px;
	            pointer-events: none;
	            background-image: url("media/gui/Skins/cursors.png");
	            background-repeat: no-repeat;
	            image-rendering: auto;
	            filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.58));
	        }

	        .html-battle-cursor[data-cursor="cursor"] {
	            display: none !important;
	        }

	        .html-battle-cursor[data-cursor="move"] {
	            background-position: 0 -64px;
	        }

	        .html-battle-cursor[data-cursor="attack"] {
	            background-position: 0 0;
	        }

	        .html-battle-cursor[data-cursor="shoot"] {
	            background-position: -64px -64px;
	        }

	        .html-battle-cursor[data-cursor="special"] {
	            background-position: -128px 0;
	        }

	        .html-battle-cursor[data-cursor="target"] {
	            background-position: -128px -64px;
	        }

	        .html-battle-cursor[data-cursor="construction"] {
	            background-position: -64px 0;
	        }

	        #html-battle-loading, #html-battle-loading * {
	            cursor: default !important;
	        }

	        .html-battle-loading-panel {
	            min-width: 260px;
	            padding: 18px 22px;
	            border: 1px solid rgba(211, 173, 86, 0.72);
	            background: rgba(20, 15, 8, 0.92);
	            box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
	            text-align: center;
	            pointer-events: auto;
	        }

	        .html-battle-loading-title {
	            font-size: 18px;
	            font-weight: 800;
	        }

	        .html-battle-loading-subtitle {
	            margin-top: 6px;
	            color: rgba(243, 231, 178, 0.78);
	            font-size: 12px;
	        }

	        .html-battle-ended-panel {
	            display: flex;
	            align-items: center;
	            gap: 8px;
	            max-width: min(360px, calc(100vw - 20px));
	            padding: 6px 7px 6px 10px;
	            border: 1px solid rgba(57, 44, 20, 0.86);
	            background: linear-gradient(rgba(244, 228, 164, 0.97), rgba(195, 145, 62, 0.96));
	            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 4px 14px rgba(0, 0, 0, 0.42);
	            pointer-events: auto;
	        }

	        .html-battle-ended-title {
	            min-width: 0;
	            overflow: hidden;
	            font-size: 12px;
	            font-weight: 700;
	            text-overflow: ellipsis;
	            white-space: nowrap;
	        }

	        .html-battle-ended-button {
	            min-width: 112px;
	            min-height: 28px;
	            border: 1px solid #57411b;
	            background: linear-gradient(#f8dc6f, #bd812f);
	            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 2px 4px rgba(0, 0, 0, 0.24);
	            color: #1c160c;
	            font-weight: 800;
	            cursor: pointer !important;
	        }

	        #html-battle-ui {
	            position: fixed;
	            inset: 0;
	            z-index: 5;
	            display: none;
	            grid-template-columns: 84px minmax(420px, 1fr) 430px;
	            grid-template-rows: 62px minmax(260px, 1fr) 102px;
	            gap: 0;
	            color: #f1e3b6;
	            font-family: "TFW DejaVu Sans", sans-serif;
	            pointer-events: none;
	            cursor: default !important;
	        }

	        #html-battle-ui.is-visible {
	            display: grid;
	        }

	        #html-battle-ui *,
	        #html-battle-ui button,
	        #html-battle-ui input {
	            cursor: default !important;
	        }

	        .html-battle-ui-panel,
	        .html-battle-ui-button,
	        .html-battle-big-card,
	        .html-battle-hand-card,
	        .html-battle-enchants,
	        .html-battle-hand-scroll,
	        .html-battle-hand-scroll button,
	        .html-battle-player,
	        .html-battle-chat-input {
	            pointer-events: auto;
	        }

	        .html-battle-side {
	            grid-column: 1;
	            grid-row: 1 / 3;
	            display: flex;
	            flex-direction: column;
	            gap: 0;
	            align-items: stretch;
	            padding: 0 4px 6px 4px;
	            background: linear-gradient(90deg, rgba(4, 5, 4, 0.78), rgba(4, 5, 4, 0.16));
	        }

	        .html-battle-side-spacer {
	            flex: 1 1 auto;
	        }

	        .html-battle-ui-button {
	            min-height: 32px;
	            padding: 4px 5px;
	            border: 1px solid #221709;
	            border-radius: 2px;
	            background:
	                linear-gradient(#e6d9ad, #9d7a3a 48%, #2d2415 49%, #695329);
	            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 4px rgba(0, 0, 0, 0.48);
	            color: #fff2bf;
	            font-size: 11px;
	            font-weight: 700;
	            text-shadow: 0 1px 1px #000;
	        }

	        .html-battle-ui-button:hover:not(:disabled) {
	            filter: brightness(1.14);
	        }

	        .html-battle-ui-button:disabled {
	            opacity: 0.42;
	            filter: grayscale(0.55);
	        }

	        .html-battle-ui-button.is-danger {
	            background: linear-gradient(#e5b995, #8d3e2a 48%, #27140f 49%, #542117);
	        }

	        .html-battle-ui-button.is-action {
	            min-height: 44px;
	        }

	        .html-battle-side > .html-battle-ui-button {
	            width: 76px;
	            min-height: 50px;
	            margin: 0;
	            border-radius: 0;
	            font-size: 12px;
	        }

	        #html-battle-normal-actions,
	        #html-battle-action-actions {
	            display: flex;
	            flex-direction: column;
	            align-items: center;
	            gap: 0;
	        }

	        #html-battle-normal-actions[hidden],
	        #html-battle-action-actions[hidden] {
	            display: none;
	        }

	        #html-battle-normal-actions .html-battle-ui-button,
	        #html-battle-action-actions .html-battle-ui-button,
	        .html-battle-pass-all {
	            display: block;
	            border: 0;
	            border-radius: 0;
	            background-color: transparent;
	            background-image:
	                linear-gradient(180deg, rgba(255, 245, 190, 0.18), transparent 16px),
	                radial-gradient(circle at 50% 18px, rgba(255, 236, 170, 0.22), transparent 30px),
	                linear-gradient(180deg, rgba(48, 58, 40, 0.98), rgba(15, 19, 13, 0.98) 55%, rgba(6, 8, 5, 0.99));
	            background-repeat: no-repeat;
	            box-shadow: none;
	            color: #c0c0c0;
	            font-size: 10px;
	            font-weight: 700;
	            line-height: 12px;
	            text-align: center;
	            text-shadow: 0 1px 1px #000;
	            filter: none;
	        }

	        #html-battle-normal-actions .html-battle-ui-button:hover:not(:disabled),
	        #html-battle-action-actions .html-battle-ui-button:hover:not(:disabled),
	        .html-battle-pass-all:hover {
	            filter: brightness(1.12);
	        }

	        #html-battle-normal-actions .html-battle-ui-button:disabled,
	        #html-battle-action-actions .html-battle-ui-button:disabled {
	            opacity: 1;
	            filter: grayscale(0.45);
	        }

	        .html-battle-pass-all {
	            position: relative;
	            grid-template-columns: 1fr;
	            width: 65px;
	            height: 70px;
	            min-height: 70px;
	            padding: 56px 0 0;
	            background-position: -563px 0;
	        }

	        .html-battle-pass-all.is-checked {
	            background-position: -563px -63px;
	            color: #fff;
	        }

	        .html-battle-pass-all input {
	            position: absolute;
	            opacity: 0;
	            pointer-events: none;
	        }

	        #html-battle-pass {
	            width: 76px;
	            height: 73px;
	            min-height: 73px;
	            padding: 60px 0 0;
	            background-position: -347px -61px;
	        }

	        #html-battle-pass:disabled {
	            background-position: -347px 0;
	        }

	        [data-battle-command="cancel"] {
	            width: 76px;
	            height: 73px;
	            min-height: 73px;
	            padding: 60px 0 0;
	            background-position: -423px -61px;
	        }

	        [data-battle-command="melee"],
	        [data-battle-command="shoot"],
	        [data-battle-command="move"],
	        [data-battle-command="special"] {
	            width: 60px;
	            height: 70px;
	            min-height: 70px;
	            padding: 56px 0 0;
	        }

	        [data-battle-command="melee"] {
	            background-position: -626px -2px;
	        }

	        [data-battle-command="shoot"] {
	            background-position: -684px -2px;
	        }

	        [data-battle-command="move"] {
	            width: 58px;
	            background-position: -626px -122px;
	        }

	        [data-battle-command="special"] {
	            background-position: -684px -122px;
	        }

	        .html-battle-pass-all {
	            display: grid;
	            grid-template-columns: 1fr;
	            gap: 0;
	            align-items: start;
	        }

	        .html-battle-pass-all input {
	            width: 16px;
	            height: 16px;
	            accent-color: #c49b3f;
	        }

	        .html-battle-top {
	            grid-column: 2;
	            grid-row: 1;
	            display: flex;
	            align-items: flex-start;
	            justify-content: center;
	            gap: 12px;
	            padding-top: 8px;
	        }

	        .html-battle-flux {
	            display: flex;
	            gap: 5px;
	            min-height: 44px;
	            padding: 6px 8px;
	            border: 1px solid rgba(210, 170, 82, 0.58);
	            background: rgba(10, 12, 9, 0.64);
	        }

	        .html-battle-flux-well {
	            position: relative;
	            width: 32px;
	            height: 32px;
	            border-radius: 999px;
	            background:
	                radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), transparent 0 20%, rgba(255, 255, 255, 0.18) 21% 32%, transparent 34%),
	                radial-gradient(circle at 50% 58%, #d9d9d9, #9b9b9b 63%, #141414 100%);
	        }

	        .html-battle-flux-well::after {
	            content: "";
	            position: absolute;
	            inset: 0;
	            border-radius: inherit;
	            background: radial-gradient(circle, var(--well-color, #fff), transparent 64%);
	            opacity: var(--well-alpha, 0.12);
	            filter: drop-shadow(0 0 5px var(--well-color, #fff));
	        }

	        .html-battle-big-text {
	            position: fixed;
	            left: 50%;
	            top: 24%;
	            z-index: 6;
	            display: none;
	            min-width: 180px;
	            padding: 10px 18px;
	            transform: translateX(-50%);
	            border: 1px solid rgba(230, 190, 88, 0.8);
	            background: rgba(8, 8, 5, 0.74);
	            color: #ffe698;
	            font-size: 26px;
	            font-weight: 800;
	            text-align: center;
	            text-shadow: 0 2px 4px #000;
	            pointer-events: none;
	        }

	        .html-battle-big-text.is-visible {
	            display: block;
	            animation: tfw-battle-big-text 1.9s ease-out forwards;
	        }

	        @keyframes tfw-battle-big-text {
	            0% { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.96); }
	            18% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
	            78% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
	            100% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(1.03); }
	        }

	        .html-battle-right {
	            grid-column: 3;
	            grid-row: 1 / 4;
	            display: grid;
	            grid-template-rows: minmax(160px, 1fr) 310px;
	            gap: 6px;
	            padding: 8px 10px 8px 0;
	            background: linear-gradient(270deg, rgba(3, 4, 3, 0.84), rgba(3, 4, 3, 0.12));
	        }

	        .html-battle-log {
	            display: grid;
	            grid-template-rows: auto 1fr;
	            min-height: 0;
	            border: 1px solid rgba(73, 57, 31, 0.86);
	            background: rgba(5, 6, 5, 0.74);
	        }

	        .html-battle-chat-input {
	            width: 100%;
	            height: 24px;
	            box-sizing: border-box;
	            border: 1px solid #333;
	            border-width: 1px 0;
	            background: rgba(0, 0, 0, 0.32);
	            color: #fff;
	            font: 12px "TFW DejaVu Sans", sans-serif;
	            outline: none;
	        }

	        .html-battle-log-lines {
	            min-height: 0;
	            overflow: auto;
	            padding: 6px;
	            color: #f6eed5;
	            font-size: 11px;
	            line-height: 1.34;
	            text-shadow: 0 1px 1px #000;
	        }

	        .html-battle-log-line {
	            margin-bottom: 4px;
	        }

	        .html-battle-log-line.is-minor {
	            color: #bbb39b;
	        }

	        .html-battle-log-line.is-chat {
	            color: #f5dfa2;
	        }

	        .html-battle-big-card {
	            width: 408px;
	            height: 300px;
	            justify-self: end;
	        }

	        .html-battle-enchants {
	            grid-column: 2;
	            grid-row: 2;
	            justify-self: end;
	            align-self: center;
	            z-index: 4;
	            display: none;
	            width: 76px;
	            max-height: calc(100% - 24px);
	            box-sizing: border-box;
	            padding: 4px 2px;
	            overflow-x: hidden;
	            overflow-y: auto;
	            scrollbar-width: thin;
	            background: linear-gradient(90deg, rgba(5, 6, 4, 0.08), rgba(5, 6, 4, 0.48));
	            border-left: 1px solid rgba(224, 187, 96, 0.24);
	        }

	        .html-battle-enchants.is-visible {
	            display: flex;
	            flex-direction: column;
	            gap: 3px;
	        }

	        .html-battle-enchant-card {
	            flex: 0 0 72px;
	            margin-right: 0;
	        }

	        .html-battle-bottom {
	            grid-column: 1 / 3;
	            grid-row: 3;
	            display: grid;
	            grid-template-columns: auto minmax(180px, 1fr);
	            align-items: end;
	            min-width: 0;
	            padding: 0 4px 8px 4px;
	            background: linear-gradient(0deg, rgba(4, 5, 4, 0.82), rgba(4, 5, 4, 0));
	        }

	        .html-battle-players {
	            display: flex;
	            gap: 0;
	            overflow: hidden;
	            min-width: 0;
	        }

	        .html-battle-player {
	            position: relative;
	            display: grid;
	            grid-template-columns: 55px 82px 25px;
	            grid-template-rows: 66px 24px;
	            width: 175px;
	            height: 96px;
	            flex: 0 0 175px;
	            box-sizing: border-box;
	            border: 1px solid rgba(0, 0, 0, 0.55);
	            border-radius: 8px 8px 0 0;
	            background: linear-gradient(135deg, var(--player-color, #366370), rgba(24, 27, 27, 0.92));
	            box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
	            overflow: hidden;
	        }

	        .html-battle-player.is-turn {
	            box-shadow: inset 0 0 0 2px rgba(255, 226, 125, 0.7), 0 0 18px rgba(255, 226, 125, 0.25);
	        }

	        .html-battle-player-name {
	            grid-column: 1;
	            grid-row: 1;
	            align-self: start;
	            padding: 2px 3px;
	            color: #fff;
	            font-size: 11px;
	            font-weight: 800;
	            overflow: hidden;
	            text-overflow: ellipsis;
	            white-space: nowrap;
	            text-shadow: 0 1px 1px #000;
	        }

	        .html-battle-player-avatar {
	            grid-column: 1;
	            grid-row: 1;
	            align-self: end;
	            justify-self: center;
	            width: 48px;
	            height: 48px;
	            margin-bottom: 2px;
	            background: #111 center / cover no-repeat;
	            border: 2px solid rgba(0,0,0,0.52);
	            box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
	            overflow: hidden;
	        }

	        .html-battle-player-avatar img {
	            display: block;
	            width: 100%;
	            height: 100%;
	            object-fit: cover;
	        }

	        .html-battle-player-action {
	            grid-column: 2;
	            grid-row: 1;
	            display: flex;
	            flex-direction: column;
	            align-items: center;
	            justify-content: center;
	            gap: 2px;
	            min-width: 0;
	            padding: 0 3px;
	            color: #f8ead0;
	            font-size: 11px;
	            font-weight: 800;
	            text-align: center;
	            text-shadow: 0 1px 2px #000;
	        }

	        .html-battle-player-action-main {
	            max-width: 76px;
	            overflow: hidden;
	            text-overflow: ellipsis;
	            white-space: nowrap;
	        }

	        .html-battle-player-time {
	            min-width: 48px;
	            padding: 1px 5px;
	            border: 1px solid rgba(0,0,0,0.42);
	            border-radius: 3px;
	            background: rgba(11, 13, 10, 0.52);
	            color: #f7efc8;
	            font-size: 10px;
	            line-height: 13px;
	            letter-spacing: 0;
	            box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
	        }

	        .html-battle-player-passed {
	            width: 64px;
	            height: 32px;
	            border: 1px solid rgba(255, 238, 166, 0.45);
	            border-radius: 3px;
	            background: linear-gradient(180deg, rgba(42, 51, 35, 0.92), rgba(11, 13, 9, 0.92));
	        }

	        .html-battle-player-stats {
	            grid-column: 3;
	            grid-row: 1;
	            display: grid;
	            grid-template-rows: 38px 28px;
	            justify-items: center;
	            align-items: center;
	            color: #1c1407;
	            font-weight: 800;
	            text-shadow: 0 1px rgba(255,255,255,0.32);
	        }

	        .html-battle-player-cards {
	            width: 24px;
	            height: 24px;
	            padding-top: 3px;
	            box-sizing: border-box;
	            border: 1px solid rgba(255, 238, 166, 0.46);
	            border-radius: 3px;
	            background:
	                linear-gradient(135deg, transparent 0 72%, rgba(0, 0, 0, 0.18) 73%),
	                linear-gradient(180deg, rgba(245, 238, 211, 0.96), rgba(157, 169, 174, 0.94));
	            text-align: center;
	        }

	        .html-battle-player-bottom {
	            grid-column: 1 / 4;
	            grid-row: 2;
	            display: flex;
	            align-items: center;
	            gap: 4px;
	            padding: 0 4px;
	            color: #fff;
	            font-size: 10px;
	        }

	        .html-battle-player-flux {
	            min-width: 18px;
	            padding: 1px 4px 1px 18px;
	            background: url("media/gui/cards/cost-flux.png") left center / 16px 16px no-repeat;
	        }

	        .html-battle-player-domains {
	            display: flex;
	            min-width: 0;
	            overflow: hidden;
	        }

	        .html-battle-player-domains img {
	            width: 16px;
	            height: 16px;
	            margin-left: -3px;
	        }

	        .html-battle-hand-wrap {
	            min-width: 0;
	            height: 96px;
	            display: grid;
	            grid-template-columns: 1fr;
	            align-items: center;
	            background: linear-gradient(90deg, rgba(23, 35, 26, 0.86), rgba(15, 21, 18, 0.78));
	            border-top: 1px solid rgba(212, 181, 91, 0.28);
	            overflow: hidden;
	        }

	        .html-battle-hand-wrap.has-scroll {
	            grid-template-columns: 1fr 24px;
	        }

	        .html-battle-hand {
	            display: flex;
	            gap: 0;
	            overflow-x: hidden;
	            overflow-y: hidden;
	            min-width: 0;
	            padding: 8px 4px;
	            overscroll-behavior-x: none;
	            scrollbar-width: none;
	        }

	        .html-battle-hand::-webkit-scrollbar {
	            display: none;
	        }

	        .html-battle-hand-card {
	            position: relative;
	            width: 72px;
	            height: 72px;
	            flex: 0 0 60px;
	            margin-right: -10px;
	            padding: 0;
	            border: 0;
	            background: transparent;
	            opacity: 0.96;
	        }

	        .html-battle-hand-card:last-child {
	            margin-right: 0;
	        }

	        .html-battle-hand-card .html-small-card,
	        .html-battle-hand-card .html-small-card:hover {
	            transform: none;
	        }

	        .html-battle-hand-card.is-invalid {
	            opacity: 0.42;
	        }

	        .html-battle-hand-card:hover {
	            z-index: 5;
	            filter: drop-shadow(0 0 8px rgba(255, 226, 126, 0.52));
	        }

	        .html-battle-hand-card .html-small-card {
	            pointer-events: none;
	        }

	        .html-battle-hand-scroll {
	            display: none;
	            flex-direction: column;
	            gap: 8px;
	            align-items: stretch;
	            padding-right: 4px;
	        }

	        .html-battle-hand-wrap.has-scroll .html-battle-hand-scroll {
	            display: flex;
	        }

	        .html-battle-hand-scroll button {
	            width: 20px;
	            height: 28px;
	            border: 1px solid #34250d;
	            background: linear-gradient(#d9c078, #725328);
	            color: #fff0b3;
	            font-size: 11px;
	        }

	        .html-battle-popup {
	            position: fixed;
	            left: 50%;
	            top: 50%;
	            z-index: 9;
	            display: none;
	            width: min(420px, calc(100vw - 28px));
	            max-height: min(520px, calc(100vh - 40px));
	            transform: translate(-50%, -50%);
	            border: 1px solid rgba(225, 184, 91, 0.74);
	            background: rgba(12, 14, 10, 0.95);
	            color: #f8e7b4;
	            box-shadow: 0 18px 48px rgba(0,0,0,0.66);
	            pointer-events: auto;
	        }

	        .html-battle-popup.is-open {
	            display: grid;
	            grid-template-rows: auto 1fr auto;
	        }

	        .html-battle-popup.is-open.is-hex-selector {
	            width: auto;
	            min-width: 112px;
	            max-width: calc(100vw - 20px);
	            max-height: 108px;
	            grid-template-rows: 1fr;
	            padding: 4px;
	            border-color: rgba(237, 218, 92, 0.92);
	            background: linear-gradient(rgba(58, 69, 23, 0.92), rgba(19, 24, 12, 0.96));
	            box-shadow:
	                inset 0 0 0 1px rgba(0, 0, 0, 0.62),
	                0 10px 22px rgba(0, 0, 0, 0.58);
	        }

	        .html-battle-popup-title {
	            padding: 9px 12px;
	            border-bottom: 1px solid rgba(255,255,255,0.08);
	            font-weight: 800;
	        }

	        .html-battle-popup-body {
	            display: flex;
	            flex-wrap: wrap;
	            gap: 8px;
	            min-height: 0;
	            overflow: auto;
	            padding: 8px;
	        }

	        .html-battle-popup.is-hex-selector .html-battle-popup-title,
	        .html-battle-popup.is-hex-selector .html-battle-popup-actions {
	            display: none;
	        }

	        .html-battle-popup.is-hex-selector .html-battle-popup-body {
	            flex-wrap: nowrap;
	            gap: 0;
	            overflow: hidden;
	            padding: 0;
	        }

	        .html-battle-popup-body .html-battle-hand-card {
	            flex: 0 0 72px;
	            margin-right: 0;
	        }

	        .html-battle-popup.is-hex-selector .html-battle-hand-card {
	            width: 72px;
	            height: 88px;
	            flex: 0 0 72px;
	            margin: 0 -2px 0 0;
	        }

	        .html-battle-popup.is-hex-selector .html-small-card {
	            filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
	        }

	        .html-battle-popup-actions {
	            display: flex;
	            justify-content: flex-end;
	            gap: 8px;
	            padding: 8px;
	            border-top: 1px solid rgba(255,255,255,0.08);
	        }

	        .html-battle-dev-card-modal {
	            position: fixed;
	            inset: 0;
	            z-index: 12;
	            display: none;
	            align-items: center;
	            justify-content: center;
	            padding: 18px;
	            background: rgba(2, 3, 2, 0.56);
	            pointer-events: auto;
	        }

	        .html-battle-dev-card-modal.is-open {
	            display: flex;
	        }

	        .html-battle-dev-card-window {
	            display: grid;
	            grid-template-columns: minmax(0, 1fr) 236px;
	            grid-template-rows: auto auto minmax(0, 1fr);
	            width: min(1030px, calc(100vw - 36px));
	            height: min(720px, calc(100vh - 36px));
	            border: 1px solid rgba(225, 184, 91, 0.78);
	            background:
	                linear-gradient(180deg, rgba(22, 25, 17, 0.97), rgba(8, 10, 8, 0.97)),
	                repeating-linear-gradient(115deg, rgba(255, 235, 170, 0.06) 0 1px, transparent 1px 13px);
	            color: #f8e7b4;
	            box-shadow:
	                inset 0 0 0 1px rgba(0, 0, 0, 0.68),
	                0 22px 68px rgba(0, 0, 0, 0.72);
	        }

	        .html-battle-dev-card-title {
	            grid-column: 1 / -1;
	            display: flex;
	            align-items: center;
	            justify-content: space-between;
	            min-height: 44px;
	            padding: 0 10px 0 14px;
	            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	            color: #fff1bf;
	            font-size: 16px;
	            font-weight: 800;
	            letter-spacing: 0;
	        }

	        .html-battle-dev-card-tools {
	            grid-column: 1 / 2;
	            display: grid;
	            grid-template-columns: 1fr 180px 160px;
	            gap: 10px;
	            align-items: end;
	            padding: 10px;
	            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	        }

	        .html-battle-dev-card-tools .html-filter-block {
	            min-width: 0;
	        }

	        .html-battle-dev-card-grid {
	            grid-column: 1 / 2;
	            grid-row: 3 / 4;
	            align-content: start;
	            min-height: 0;
	            overflow: auto;
	            padding: 10px;
	        }

	        .html-battle-dev-card-preview {
	            grid-column: 2 / 3;
	            grid-row: 2 / 4;
	            align-self: start;
	            justify-self: center;
	            margin: 10px;
	        }

	        @media (max-width: 980px) {
	            #html-battle-ui {
	                grid-template-columns: 72px minmax(260px, 1fr);
	                grid-template-rows: 54px minmax(260px, 1fr) 96px 220px;
	            }
	            .html-battle-right {
	                grid-column: 2;
	                grid-row: 4;
	                grid-template-columns: 1fr 160px;
	                grid-template-rows: 1fr;
	                padding: 0 6px 6px 0;
	            }
	            .html-battle-big-card {
	                width: 154px;
	                height: 218px;
	            }
	            .html-battle-enchants {
	                grid-column: 2;
	                grid-row: 2;
	                max-height: calc(100% - 12px);
	            }
	            .html-battle-bottom {
	                grid-template-columns: 1fr;
	            }
	            .html-battle-players {
	                display: none;
	            }
	        }

	        #crash-log {
            position: fixed;
            left: 12px;
            right: 12px;
            bottom: 12px;
            z-index: 10;
            display: none;
            max-height: 45vh;
            overflow: auto;
            margin: 0px;
            padding: 12px;
            border: 1px solid #8c2f2f;
            background: rgba(20, 0, 0, 0.92);
            color: #ffd6d6;
            font: 12px/1.4 monospace;
            white-space: pre-wrap;
        }

        #copy-crash-log {
            position: fixed;
            right: 24px;
            bottom: calc(45vh + 24px);
            z-index: 11;
            display: none;
            padding: 6px 10px;
            border: 1px solid #b85a5a;
            background: #2a0d0d;
            color: #ffd6d6;
            font: 12px sans-serif;
            cursor: pointer !important;
        }

        #crash-log {
            cursor: text !important;
        }

        #html-login {
            position: fixed;
            inset: 0;
            z-index: 6;
            display: none;
            overflow: hidden;
            background: #050402 url("media/gui/Splash_LeapofFaith.jpg") center center / cover no-repeat;
            color: #1e170d;
            font: 14px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            cursor: default !important;
        }

        #html-login, #html-login * {
            box-sizing: border-box;
            cursor: default !important;
        }

        .html-login-panel,
        .html-register-panel {
            position: absolute;
            top: 114px;
            width: 303px;
            min-height: 278px;
            padding: 14px 16px;
            border: 1px solid rgba(57, 44, 20, 0.82);
            background: linear-gradient(rgba(244, 228, 164, 0.95), rgba(195, 145, 62, 0.94));
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), 0 8px 26px rgba(0, 0, 0, 0.5);
        }

        .html-login-panel {
            left: 188px;
        }

        .html-register-panel {
            left: 504px;
            display: none;
        }

        .html-register-panel.is-open {
            display: block;
        }

        .html-login-title {
            margin: 0 0 13px;
            font-size: 17px;
            font-weight: 800;
            text-align: center;
        }

        .html-login-row {
            display: grid;
            grid-template-columns: 84px minmax(0, 1fr);
            gap: 8px;
            align-items: center;
            min-height: 29px;
            margin-bottom: 7px;
        }

        .html-login-row label {
            font-weight: 700;
            text-align: right;
        }

        .html-login-checks {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            margin: 8px 0 10px 84px;
            font-size: 13px;
        }

        .html-login-input {
            width: 100%;
            height: 25px;
            border: 1px solid rgba(57, 44, 20, 0.72);
            background: rgba(255, 250, 218, 0.93);
            color: #201b12;
            padding: 2px 5px;
        }

        .html-login-actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            margin-top: 8px;
        }

        .html-login-button {
            min-height: 34px;
            border: 1px solid #57411b;
            background: linear-gradient(#f8dc6f, #bd812f);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 2px 4px rgba(0, 0, 0, 0.24);
            color: #1c160c;
            font-weight: 800;
            cursor: pointer !important;
        }

        .html-login-button:hover {
            background: linear-gradient(#ffe88a, #cd913b);
        }

        .html-login-button:disabled {
            opacity: 0.55;
        }

        .html-login-why {
            min-height: 32px;
            margin-top: 10px;
            color: #c00000;
            font-weight: 700;
            text-align: center;
        }

        .html-login-version {
            position: absolute;
            left: 8px;
            bottom: 6px;
            color: #f8e7a8;
            font: 12px/1.2 monospace;
            text-shadow: 1px 1px 2px #000;
        }

        @media (max-width: 840px) {
            .html-login-panel,
            .html-register-panel {
                left: 50%;
                width: min(303px, calc(100vw - 24px));
                transform: translateX(-50%);
            }

            .html-register-panel {
                top: 410px;
            }
        }

        #html-lobby {
            position: fixed;
            inset: 0;
            z-index: 4;
            display: none;
            box-sizing: border-box;
            padding: 12px;
            background:
                url("media/gui/BackgroundLeft.jpg") left top / auto 100% no-repeat,
                url("media/gui/BackgroundRight.jpg") right top / auto 100% no-repeat,
                #100d08;
            color: #201b12;
            font: 14px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            cursor: default !important;
        }

        #html-lobby, #html-lobby * {
            box-sizing: border-box;
            cursor: default !important;
        }

        .html-lobby-shell {
            display: flex;
            flex-direction: column;
            width: 100%;
            max-width: 1120px;
            height: 100%;
            max-height: 720px;
            margin: 0 auto;
            min-width: 0;
            min-height: 0;
            background: rgba(20, 15, 8, 0.72);
        }

        .html-tabs {
            display: flex;
            align-items: flex-start;
            gap: 2px;
            height: 32px;
            padding-left: 8px;
            background: rgba(12, 8, 4, 0.55);
        }

        .html-tab {
            width: 150px;
            height: 28px;
            border: 1px solid rgba(57, 44, 20, 0.85);
            border-bottom: 0;
            background: linear-gradient(#d8bf6f, #a9782e);
            color: #1c160c;
            font: 700 13px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            cursor: pointer !important;
        }

        .html-tab.is-active {
            height: 32px;
            background: linear-gradient(#f5e5a7, #d8bf6f);
        }

        .html-topbar {
            position: absolute;
            top: 0;
            right: 0;
            display: flex;
            align-items: flex-start;
            justify-content: flex-end;
            height: 40px;
        }

        .html-status {
            min-width: 130px;
            height: 24px;
            padding: 4px 8px;
            color: #f1e6b6;
            font-size: 12px;
            text-align: right;
        }

        .html-account-name {
            max-width: 220px;
            height: 24px;
            padding: 4px 8px;
            overflow: hidden;
            color: #f1e6b6;
            font-size: 12px;
            text-align: right;
            text-overflow: ellipsis;
            text-shadow: 1px 1px 2px #000;
            white-space: nowrap;
        }

        .html-currency {
            display: none;
            align-items: center;
            gap: 3px;
            height: 24px;
            padding: 3px 7px;
            color: #f1e6b6;
            font-size: 12px;
            font-weight: 700;
            text-align: right;
            text-shadow: 1px 1px 2px #000;
            white-space: nowrap;
        }

        .html-currency.is-visible {
            display: inline-flex;
        }

        .html-currency img {
            width: 16px;
            height: 16px;
            object-fit: contain;
        }

        .html-options-button {
            width: 40px;
            height: 40px;
            border: 1px solid #57411b;
            background: linear-gradient(#f8dc6f, #bd812f);
            color: #1c160c;
            font-weight: 800;
            cursor: pointer !important;
        }

        .html-tab-pages {
            flex: 1;
            min-height: 0;
            padding: 12px;
        }

        .html-page {
            display: none;
            width: 100%;
            height: 100%;
            min-height: 0;
        }

        .html-page.is-active {
            display: grid;
        }

        .html-page-lobby {
            grid-template-columns: minmax(260px, 1fr) 210px 260px;
            gap: 12px;
        }

        .html-page-army,
        .html-page-market {
            grid-template-columns: 1fr 1fr;
            gap: 0;
        }

        .html-page-scenarios {
            grid-template-rows: 200px minmax(0, 1fr);
            gap: 90px;
        }

        .html-lobby-panel {
            min-width: 0;
            min-height: 0;
            border: 1px solid rgba(57, 44, 20, 0.65);
            background: linear-gradient(#efe3aa, #d8bf6f);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 10px rgba(0, 0, 0, 0.28);
        }

        .html-panel-empty {
            background: rgba(239, 227, 170, 0.82);
        }

        .html-lobby-panel-header {
            height: 34px;
            padding: 8px 10px;
            border-bottom: 1px solid rgba(72, 54, 22, 0.45);
            background: rgba(75, 106, 103, 0.22);
            font-weight: 700;
            text-align: center;
        }

        .html-lobby-chat,
        .html-lobby-games {
            display: flex;
            flex-direction: column;
        }

        .html-chat-body {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 130px;
            grid-template-rows: minmax(0, 1fr) 30px;
            flex: 1;
            min-height: 0;
        }

        .html-chat-log {
            padding: 8px;
            overflow: auto;
            border-right: 1px solid rgba(72, 54, 22, 0.35);
            background: rgba(255, 250, 218, 0.72);
            font-size: 12px;
            white-space: normal;
        }

        .html-chat-line {
            margin-bottom: 3px;
            overflow-wrap: anywhere;
            white-space: pre-wrap;
        }

        .html-chat-players {
            overflow: auto;
            background: rgba(255, 250, 218, 0.55);
        }

        .html-chat-player {
            padding: 3px 6px;
            border-bottom: 1px solid rgba(72, 54, 22, 0.18);
            font-size: 12px;
            user-select: none;
        }

        .html-chat-player:hover,
        .html-chat-player.is-menu-target {
            background: rgba(75, 106, 103, 0.22);
            color: #10100a;
        }

        .html-chat-counter {
            grid-column: 2;
            padding: 7px 6px;
            border-top: 1px solid rgba(72, 54, 22, 0.35);
            background: rgba(75, 106, 103, 0.16);
            font-size: 12px;
            text-align: center;
        }

        .html-chat-input {
            grid-column: 1;
            width: 100%;
            height: 30px;
            border: 0;
            border-top: 1px solid rgba(72, 54, 22, 0.35);
            background: rgba(255, 250, 218, 0.94);
            padding: 4px 7px;
            color: #201b12;
        }

        .html-player-menu {
            position: fixed;
            z-index: 9;
            display: none;
            min-width: 176px;
            border: 1px solid rgba(57, 44, 20, 0.86);
            background: linear-gradient(#f3e4a7, #c99a48);
            box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
            color: #201b12;
            font-size: 12px;
            cursor: default !important;
        }

        .html-player-menu.is-open {
            display: block;
        }

        .html-player-menu-title {
            max-width: 220px;
            padding: 6px 8px;
            overflow: hidden;
            border-bottom: 1px solid rgba(72, 54, 22, 0.35);
            background: rgba(75, 106, 103, 0.20);
            font-weight: 700;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .html-player-menu-button {
            display: block;
            width: 100%;
            min-height: 24px;
            padding: 4px 8px;
            border: 0;
            background: transparent;
            color: #201b12;
            font: inherit;
            text-align: left;
            cursor: pointer !important;
        }

        .html-player-menu-button:hover:not(:disabled) {
            background: rgba(255, 250, 218, 0.52);
        }

        .html-player-menu-button:disabled {
            color: rgba(55, 44, 24, 0.54);
            cursor: default !important;
        }

        .html-private-chats {
            position: fixed;
            right: 18px;
            bottom: 18px;
            z-index: 6;
            display: flex;
            flex-direction: row-reverse;
            gap: 10px;
            align-items: flex-end;
            pointer-events: none;
        }

        .html-private-chat {
            display: flex;
            flex-direction: column;
            width: 270px;
            height: 300px;
            border: 1px solid rgba(57, 44, 20, 0.86);
            background: linear-gradient(#efe3aa, #d8bf6f);
            box-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
            pointer-events: auto;
        }

        .html-private-chat-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            min-height: 30px;
            padding: 4px 6px 4px 9px;
            border-bottom: 1px solid rgba(72, 54, 22, 0.42);
            background: rgba(75, 106, 103, 0.22);
            font-size: 12px;
            font-weight: 700;
        }

        .html-private-chat-title {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .html-private-chat-close {
            width: 22px;
            height: 22px;
            border: 1px solid rgba(57, 44, 20, 0.72);
            background: linear-gradient(#f8dc6f, #bd812f);
            color: #1c160c;
            font-weight: 800;
            cursor: pointer !important;
        }

        .html-private-chat-log {
            flex: 1;
            min-height: 0;
            padding: 7px;
            overflow: auto;
            background: rgba(255, 250, 218, 0.72);
            font-size: 12px;
        }

        .html-private-chat-line {
            margin-bottom: 4px;
            overflow-wrap: anywhere;
        }

        .html-private-chat-input {
            height: 28px;
            border: 0;
            border-top: 1px solid rgba(72, 54, 22, 0.35);
            background: rgba(255, 250, 218, 0.94);
            padding: 4px 7px;
            color: #201b12;
        }

        .html-lobby-placeholder {
            flex: 1;
            margin: 10px;
            padding: 10px;
            overflow: auto;
            border: 1px solid rgba(72, 54, 22, 0.35);
            background: rgba(255, 250, 218, 0.72);
            color: rgba(32, 27, 18, 0.72);
        }

        .html-battle-list {
            flex: 1;
            overflow: auto;
            background: rgba(255, 250, 218, 0.55);
        }

        .html-battle-item {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 50px 60px;
            align-items: center;
            width: 100%;
            min-height: 40px;
            padding: 0 0 0 5px;
            border: 0;
            border-bottom: 1px solid rgba(72, 54, 22, 0.28);
            background: rgba(32, 27, 18, 0.16);
            color: #201b12;
            text-align: left;
            cursor: pointer !important;
        }

        .html-battle-action {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 0;
            height: 28px;
            margin: 0 5px 0 4px;
            padding: 0 5px;
            overflow: hidden;
            border: 1px solid rgba(38, 22, 8, 0.88);
            background: linear-gradient(#4b2f13, #221408);
            box-shadow: inset 0 1px 0 rgba(255, 235, 155, 0.22), 0 1px 2px rgba(0, 0, 0, 0.22);
            color: #ffe99c;
            font-size: 12px;
            font-weight: 800;
            line-height: 1;
            text-align: center;
            text-overflow: ellipsis;
            text-shadow: 0 1px 1px #000;
            white-space: nowrap;
        }

        .html-battle-action:empty {
            display: none;
        }

        .html-battle-counter {
            color: #008b00;
            text-align: center;
        }

        .html-split-pane {
            display: grid;
            grid-template-rows: 124px 26px minmax(0, 1fr);
            min-width: 0;
            min-height: 0;
            padding: 0;
            border-right: 1px solid rgba(57, 44, 20, 0.45);
        }

        .html-split-pane:last-child {
            border-right: 0;
        }

        .html-filter-block {
            display: flex;
            flex-wrap: wrap;
            gap: 5px 10px;
            padding: 8px;
            align-content: start;
            overflow: auto;
        }

        .html-filter-button {
            position: relative;
            width: 36px;
            height: 50px;
            border: 1px solid rgba(57, 44, 20, 0.55);
            background: rgba(255, 250, 218, 0.68);
            color: #201b12;
            font-weight: 700;
            cursor: pointer !important;
        }

        .html-filter-button.is-off {
            opacity: 0.35;
            filter: grayscale(1);
        }

        .html-filter-button img {
            position: absolute;
            left: 2px;
            top: 2px;
            width: 32px;
            height: 32px;
            object-fit: contain;
        }

        .html-filter-button span {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 2px;
            text-align: center;
        }

        .html-filter-label {
            width: 100%;
            height: 13px;
            margin-top: 1px;
            font-size: 12px;
            font-weight: 800;
            line-height: 13px;
            text-align: center;
        }

        .html-toolbar {
            display: grid;
            grid-template-columns: 50px minmax(70px, 1fr) 150px;
            gap: 0;
            align-items: center;
            padding: 0;
        }

        .html-toolbar label {
            text-align: right;
            padding-right: 5px;
            font-size: 13px;
        }

        .html-input,
        .html-select {
            width: 100%;
            height: 25px;
            border: 1px solid rgba(57, 44, 20, 0.65);
            background: rgba(255, 250, 218, 0.9);
            color: #201b12;
        }

        .html-card-list {
            margin: 0;
            padding: 8px;
            overflow: auto;
            border-top: 1px solid rgba(57, 44, 20, 0.35);
            background: rgba(255, 250, 218, 0.46);
        }

        .html-card-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, 72px);
            grid-auto-rows: 72px;
            gap: 2px;
            align-content: start;
        }

        .html-card-row {
            display: flex;
            justify-content: space-between;
            gap: 10px;
            min-height: 24px;
            margin-bottom: 4px;
            padding: 4px 6px;
            border: 1px solid rgba(57, 44, 20, 0.25);
            background: rgba(255, 255, 235, 0.62);
        }

        .html-small-card {
            position: relative;
            width: 72px;
            height: 72px;
            border: 0;
            background: transparent;
            color: #fff;
            text-align: left;
            cursor: pointer !important;
        }

        .html-small-card.is-invalid {
            filter: grayscale(1) brightness(0.65);
        }

        .html-small-card.is-missing-card {
            filter: grayscale(1) brightness(0.82);
        }

        .html-small-card-back {
            position: absolute;
            left: 7px;
            top: 6px;
            width: 63px;
            height: 63px;
        }

        .html-small-card-icon {
            position: absolute;
            left: 10px;
            top: 9px;
            width: 48px;
            height: 48px;
            object-fit: cover;
        }

        .html-small-card-missing-mark {
            position: absolute;
            left: 10px;
            top: 9px;
            display: flex;
            width: 48px;
            height: 48px;
            align-items: center;
            justify-content: center;
            border: 1px dashed rgba(255, 234, 166, 0.8);
            background: rgba(18, 13, 8, 0.75);
            color: #ffeaa6;
            font-size: 24px;
            font-weight: 900;
            line-height: 1;
            text-shadow: 1px 1px 2px #000;
        }

        .html-small-card-title {
            position: absolute;
            left: 5px;
            right: 7px;
            bottom: 0;
            overflow: hidden;
            color: #fff;
            font-size: 11px;
            line-height: 13px;
            text-shadow: 1px 1px 1px #000;
            white-space: nowrap;
        }

        .html-small-card-flux {
            position: absolute;
            top: 1px;
            right: 6px;
            width: 20px;
            height: 20px;
            color: #fff;
            font-weight: 800;
            line-height: 20px;
            text-align: center;
            text-shadow: 1px 1px 1px #000;
        }

        .html-card-overlays {
            position: absolute;
            z-index: 5;
            display: flex;
            flex-wrap: wrap;
            align-content: flex-start;
            gap: 3px;
            overflow: hidden;
            color: #fff;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            font-size: 15px;
            font-weight: 700;
            line-height: 18px;
            pointer-events: none;
            text-shadow: 1px 1px 2px #000;
        }

        .html-card-overlay-item {
            display: inline-flex;
            align-items: center;
            max-width: 100%;
            filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.82));
        }

        .html-card-overlay-item img {
            width: auto;
            height: auto;
            max-width: 48px;
            max-height: 48px;
        }

        .html-card-overlay-count {
            white-space: nowrap;
        }

        .html-small-card-overlays {
            left: 9px;
            top: 8px;
            right: 8px;
            bottom: 16px;
            gap: 1px;
            font-size: 10px;
            line-height: 12px;
        }

        .html-small-card-overlays .html-card-overlay-item img {
            max-width: 18px;
            max-height: 18px;
        }

        .html-domain-cost {
            position: absolute;
            left: 0;
            top: 0;
            display: flex;
            width: 52px;
            height: 20px;
        }

        .html-domain-cost img {
            width: 20px;
            height: 20px;
            margin-right: -8px;
        }

        .html-big-card {
            position: relative;
            align-self: end;
            justify-self: end;
            width: min(408px, 100%);
            height: 300px;
            margin-top: auto;
            background: rgba(255, 250, 218, 0.55);
            background-size: 100% 100%;
            color: #111;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            cursor: default !important;
        }

        .html-big-card * {
            cursor: default !important;
        }

        .html-big-card-image {
            position: absolute;
            left: 4px;
            top: 31px;
            width: 250px;
            height: 250px;
            object-fit: cover;
        }

        .html-big-card-missing-mark {
            position: absolute;
            left: 4px;
            top: 31px;
            display: flex;
            width: 250px;
            height: 250px;
            align-items: center;
            justify-content: center;
            border: 1px dashed rgba(92, 63, 26, 0.65);
            background:
                linear-gradient(135deg, rgba(30, 21, 12, 0.78), rgba(92, 63, 26, 0.34));
            color: #ffeaa6;
            font-size: 82px;
            font-weight: 900;
            text-shadow: 2px 3px 6px #000;
        }

        .html-big-card-overlays {
            left: 9px;
            top: 36px;
            width: 242px;
            height: 239px;
        }

        .html-big-card-owner-color {
            position: absolute;
            left: 10px;
            top: 7px;
            width: 240px;
            height: 16px;
            background: rgba(255, 255, 255, 0.5);
        }

        .html-big-card-title {
            position: absolute;
            left: 12px;
            top: 7px;
            width: 238px;
            height: 16px;
            overflow: hidden;
            color: #000;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            font-size: 15px;
            font-weight: 400;
            line-height: 16px;
            text-shadow: none;
            white-space: nowrap;
        }

        .html-big-card-title-name {
            display: inline-block;
            max-width: 104px;
            overflow: hidden;
            text-overflow: ellipsis;
            vertical-align: top;
        }

        .html-big-card-title-meta {
            float: right;
            font-size: 10px;
            line-height: 16px;
            color: #1f1b15;
            letter-spacing: 0;
        }

        .html-big-card-rarity {
            position: absolute;
            left: 383px;
            top: 0;
            width: 23px;
            height: 24px;
        }

        .html-big-card-rarity img {
            position: absolute;
            left: 0;
            top: 0;
            width: 23px;
            height: 24px;
        }

        .html-big-card-domain {
            position: absolute;
            left: 132px;
            top: 5px;
            width: 100px;
            height: 20px;
            display: flex;
            justify-content: flex-end;
        }

        .html-big-card-flux {
            position: absolute;
            left: 233px;
            top: 5px;
            width: 20px;
            height: 20px;
            color: #000;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            font-size: 15px;
            font-weight: 700;
            line-height: 19px;
            text-align: center;
            text-shadow: none;
        }

        .html-big-card-flux img {
            position: absolute;
            inset: 0;
            width: 20px;
            height: 20px;
        }

        .html-big-card-flux span {
            position: relative;
            z-index: 1;
        }

        .html-big-card-desc {
            position: absolute;
            left: 270px;
            top: 33px;
            width: 131px;
            height: 227px;
            overflow: hidden;
            color: #000;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            font-size: 15px;
            line-height: 15px;
            text-shadow: 1px 1px 1px rgba(255,255,255,0.6);
            white-space: pre-wrap;
        }

        .html-rich-icon {
            display: inline-block;
            width: 18px;
            height: 18px;
            vertical-align: -4px;
        }

        .html-rich-domain {
            display: inline-flex;
            height: 20px;
            vertical-align: -5px;
        }

        .html-rich-domain img {
            flex: 0 0 20px;
            width: 20px;
            height: 20px;
            margin-right: 0;
        }

        .html-rich-domain img:not(:last-child) {
            margin-right: -8px;
        }

        .html-rich-flux {
            display: inline-block;
            position: relative;
            min-width: 20px;
            height: 20px;
            margin: 0 1px;
            background: url("media/gui/cards/cost-flux.png") center / 20px 20px no-repeat;
            color: #000;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            font-size: 15px;
            font-weight: 700;
            line-height: 19px;
            text-align: center;
            text-shadow: none;
            vertical-align: middle;
        }

	        .html-rich-link,
	        .html-rich-card,
	        .html-rich-deck,
	        .html-rich-attr,
	        .html-rich-time {
	            color: #e5d000;
	            text-decoration: underline;
	        }

	        button.html-rich-card {
	            display: inline;
	            margin: 0;
	            padding: 0;
	            border: 0;
	            background: transparent;
	            font: inherit;
	            cursor: pointer;
	        }

	        button.html-rich-deck {
	            display: inline-flex;
	            align-items: center;
	            min-height: 22px;
	            margin: 1px 2px;
	            padding: 2px 8px;
	            border: 1px solid rgba(66, 42, 16, 0.76);
	            border-radius: 3px;
	            background: linear-gradient(#ffe7a0, #bd7b2b);
	            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 2px rgba(0, 0, 0, 0.25);
	            color: #1b1006;
	            font: 800 12px/1 var(--tfw-font-ui);
	            text-decoration: none;
	            text-shadow: 0 1px 0 rgba(255, 242, 182, 0.55);
	            cursor: pointer;
	        }

	        button.html-rich-deck:hover {
	            filter: brightness(1.08) saturate(1.08);
	        }

        .html-big-card-artist {
            position: absolute;
            left: 136px;
            bottom: 0;
            width: 109px;
            height: 15px;
            overflow: hidden;
            color: #000;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            font-size: 11px;
            text-align: center;
            text-shadow: 1px 1px 1px rgba(255,255,255,0.6);
            white-space: nowrap;
        }

        .html-big-card-stats {
            position: absolute;
            left: 260px;
            top: 265px;
            width: 150px;
            height: 30px;
        }

        .html-big-card-stat {
            position: absolute;
            isolation: isolate;
            width: 31px;
            height: 21px;
            color: #000;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            font-size: 15px;
            font-weight: 700;
            line-height: 21px;
            text-align: center;
            text-shadow: 1px 1px 1px rgba(255,255,255,0.6);
        }

        .html-big-card-stat-value {
            position: relative;
            z-index: 2;
            display: block;
        }

        .html-big-card-stat-attack { left: 1px; top: 5px; }
        .html-big-card-stat-hp { left: 27px; top: 2px; }
        .html-big-card-stat-maxhp { left: 39px; top: 10px; }
        .html-big-card-stat-speed { left: 60px; top: 6px; }
        .html-big-card-stat-vision { left: 91px; top: 6px; }
        .html-big-card-stat-range { left: 120px; top: 6px; }

        .html-big-card-stat-glow {
            position: absolute;
            left: 5px;
            top: 0;
            z-index: 1;
            width: 21px;
            height: 21px;
            pointer-events: none;
        }

        .html-big-card-desc .html-rich-attr,
        .html-big-card-desc .html-rich-card {
            color: #0000ff;
            font-weight: 400;
            text-decoration: none;
        }

        .html-big-card-desc .html-rich-attr[data-keyword-tooltip] {
            cursor: help !important;
        }

        .html-big-card-desc .html-rich-link {
            color: #ffff00;
            font-weight: 400;
            text-decoration: underline;
        }

        .html-big-card .html-rich-link,
        .html-big-card .html-rich-card,
        .html-big-card button.html-rich-card {
            cursor: pointer !important;
        }

        .html-rich-card-preview {
            position: fixed;
            z-index: 38;
            display: none;
            width: 408px;
            max-width: calc(100vw - 24px);
            height: 300px;
            margin: 0;
            animation: none;
            filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.52));
            pointer-events: auto;
            scale: 1;
            translate: 0 0;
            transform: none;
            transition: none;
        }

        .html-rich-card-preview.is-visible {
            display: block;
        }

        .html-keyword-tooltip {
            position: fixed;
            z-index: 2147483000;
            display: none;
            width: max-content;
            max-width: min(360px, calc(100vw - 18px));
            padding: 8px 10px;
            border: 2px solid #201409;
            background: linear-gradient(#f3e6bd, #bd8e4a);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 5px 14px rgba(0, 0, 0, 0.45);
            color: #160e07;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            font-size: 13px;
            font-weight: 700;
            line-height: 1.25;
            pointer-events: none;
            white-space: normal;
            text-shadow: 1px 1px 0 rgba(255, 238, 178, 0.6);
        }

        .html-keyword-tooltip.is-open {
            display: block;
        }

        .html-deck-toolbar {
            display: grid;
            grid-template-columns: minmax(120px, 1fr) 90px 90px 90px;
            gap: 2px;
            align-items: center;
        }

        .html-scenario-top {
            padding: 10px;
        }

        .html-scenario-list {
            padding: 10px;
            overflow: auto;
        }

        .html-modal-backdrop {
            position: fixed;
            inset: 0;
            z-index: 5;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.35);
        }

        .html-modal-backdrop.is-open {
            display: flex;
        }

        .html-options-window.html-army-dialog-window {
            width: 430px;
            min-height: 0;
        }

        .html-army-dialog-body {
            padding: 18px 18px 8px;
        }

        .html-army-dialog-copy {
            min-height: 38px;
            margin-bottom: 14px;
            color: #211407;
            font-family: var(--tfw-font-ui);
            font-size: 14px;
            font-weight: 800;
            line-height: 1.35;
        }

        .html-army-dialog-field {
            display: grid;
            gap: 7px;
            color: #2b1b09;
            font-family: var(--tfw-font-ui);
            font-size: 12px;
            font-weight: 900;
            text-transform: uppercase;
        }

        .html-army-dialog-field[hidden] {
            display: none;
        }

        .html-army-dialog-field .html-input {
            width: 100%;
            height: 34px;
            border-color: rgba(45, 28, 10, 0.72);
            background:
                linear-gradient(180deg, rgba(255, 251, 225, 0.98), rgba(222, 197, 129, 0.96));
            color: #1e1207;
            font-weight: 800;
        }

        .html-army-dialog-error {
            min-height: 20px;
            padding-top: 7px;
            color: #6f1710;
            font-family: var(--tfw-font-ui);
            font-size: 12px;
            font-weight: 900;
        }

        .html-army-dialog-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            padding: 0 18px 18px;
        }

        .html-army-dialog-actions .html-lobby-button {
            min-width: 96px;
        }

        .html-army-dialog-actions .html-army-dialog-danger {
            border-color: rgba(64, 20, 13, 0.82);
            background:
                linear-gradient(180deg, #b94b34, #642219);
            color: #fff0c7;
            text-shadow: 0 1px 1px #000;
        }

        .html-options-window {
            width: 434px;
            max-width: calc(100vw - 24px);
            min-height: 325px;
            border: 1px solid rgba(57, 44, 20, 0.75);
            background: linear-gradient(#efe3aa, #d8bf6f);
            box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
        }

        .html-options-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 35px;
            padding: 0 8px 0 14px;
            border-bottom: 1px solid rgba(57, 44, 20, 0.45);
            font-weight: 800;
        }

        .html-close-button {
            width: 28px;
            height: 28px;
            border: 1px solid rgba(57, 44, 20, 0.7);
            background: #b94d3f;
            color: #fff4dc;
            font-weight: 800;
            cursor: pointer !important;
        }

        .html-options-tabs {
            display: flex;
            height: 28px;
        }

        .html-options-tab {
            flex: 1;
            border: 0;
            border-bottom: 1px solid rgba(57, 44, 20, 0.45);
            background: rgba(255, 250, 218, 0.35);
            font-weight: 700;
            cursor: pointer !important;
        }

        .html-options-tab.is-active {
            background: rgba(255, 250, 218, 0.82);
            border-bottom: 0;
        }

        .html-options-page {
            display: none;
            padding: 10px;
        }

        .html-options-page.is-active {
            display: block;
        }

        .html-form-row {
            display: grid;
            grid-template-columns: 120px minmax(0, 1fr);
            gap: 10px;
            align-items: center;
            min-height: 28px;
            margin-bottom: 8px;
        }

        .html-checkbox-row {
            margin: 8px 0;
        }

        .html-hotkeys {
            height: 116px;
            margin-top: 8px;
            padding: 8px;
            overflow: auto;
            border: 1px solid rgba(57, 44, 20, 0.35);
            background: rgba(255, 250, 218, 0.55);
            white-space: pre-line;
        }

        .html-deck-window {
            width: 470px;
            max-height: calc(100vh - 32px);
        }

        .html-deck-picker-copy {
            padding: 12px 14px 8px;
            color: #241709;
            font-weight: 700;
            line-height: 1.35;
        }

        .html-deck-picker-list {
            display: grid;
            gap: 6px;
            max-height: min(430px, calc(100vh - 190px));
            padding: 8px 14px 14px;
            overflow: auto;
        }

        .html-deck-choice {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            gap: 6px 12px;
            align-items: center;
            width: 100%;
            min-height: 48px;
            padding: 8px 10px;
            border: 1px solid rgba(57, 44, 20, 0.62);
            background: linear-gradient(#fff0b5, #d29b49);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 2px 4px rgba(0, 0, 0, 0.22);
            color: #1f170c;
            text-align: left;
            cursor: pointer !important;
        }

        .html-deck-choice:hover {
            background: linear-gradient(#fff6c9, #e0ad5a);
        }

        .html-deck-choice-name {
            min-width: 0;
            overflow: hidden;
            font-weight: 900;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .html-deck-choice-meta {
            color: rgba(40, 26, 9, 0.74);
            font-size: 12px;
            font-weight: 800;
            text-align: right;
        }

        .html-deck-choice-badge {
            justify-self: start;
            padding: 2px 6px;
            border: 1px solid rgba(45, 92, 88, 0.45);
            background: rgba(45, 119, 112, 0.18);
            color: #143f3c;
            font-size: 11px;
            font-weight: 900;
            text-transform: uppercase;
        }

        .html-deck-picker-empty {
            padding: 14px;
            border: 1px solid rgba(57, 44, 20, 0.35);
            background: rgba(255, 250, 218, 0.52);
            color: #271808;
            font-weight: 700;
            line-height: 1.4;
        }

        .html-deck-picker-actions {
            display: flex;
            justify-content: flex-end;
            padding: 0 14px 14px;
        }

        .html-deck-picker-actions .html-lobby-button {
            width: 120px;
            min-height: 34px;
            margin: 0;
        }

        .html-page-market {
            position: relative;
        }

        .html-market-right {
            display: flex;
            flex-direction: column;
            min-width: 0;
            min-height: 0;
            overflow: hidden;
        }

        .html-market-tabs {
            display: flex;
            gap: 2px;
            min-height: 34px;
            padding: 5px 6px 0;
            border-bottom: 1px solid rgba(57, 44, 20, 0.45);
            background: rgba(75, 106, 103, 0.18);
        }

        .html-market-tab {
            flex: 1;
            min-width: 0;
            border: 1px solid rgba(57, 44, 20, 0.62);
            border-bottom: 0;
            background: linear-gradient(#d8bf6f, #a9782e);
            color: #1c160c;
            font-weight: 800;
            cursor: pointer !important;
        }

        .html-market-tab.is-active {
            background: linear-gradient(#f5e5a7, #d8bf6f);
        }

        .html-market-content {
            flex: 1;
            min-height: 0;
            overflow: hidden;
            background: rgba(255, 250, 218, 0.40);
        }

        .html-market-pane {
            display: none;
            height: 100%;
            min-height: 0;
            padding: 14px;
            overflow: auto;
        }

        .html-market-pane.is-active {
            display: block;
        }

        .html-market-store-copy,
        .html-market-pane-title {
            margin-bottom: 10px;
            color: #ffff00;
            font-size: 18px;
            font-weight: 900;
            text-shadow: 1px 1px 2px #2b1d0b;
        }

        .html-market-starter-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(120px, 150px));
            gap: 12px;
            margin-bottom: 14px;
        }

        .html-starter-deck {
            position: relative;
            width: 150px;
            height: 150px;
            border: 1px solid rgba(57, 44, 20, 0.72);
            background: rgba(32, 27, 18, 0.2);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
            overflow: hidden;
            cursor: pointer !important;
        }

        .html-starter-deck img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .html-starter-deck span {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            padding: 4px 5px;
            background: rgba(18, 12, 5, 0.72);
            color: #ffeaa6;
            font-size: 12px;
            font-weight: 800;
            text-shadow: 1px 1px 2px #000;
        }

        .html-market-store-panel {
            display: grid;
            gap: 7px;
            max-width: 430px;
            margin-bottom: 12px;
        }

        .html-market-store-line {
            display: flex;
            align-items: center;
            justify-content: space-between;
            min-height: 30px;
            padding: 5px 8px;
            border: 1px solid rgba(57, 44, 20, 0.28);
            background: rgba(255, 250, 218, 0.42);
            color: #1f170c;
            font-weight: 800;
        }

        .html-market-store-actions {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 6px;
        }

        .html-market-store-actions .html-lobby-button {
            min-height: 34px;
            margin: 0;
            font-size: 12px;
        }

        .html-market-note {
            max-width: 430px;
            color: #ffff00;
            line-height: 1.35;
            text-shadow: 1px 1px 2px #2b1d0b;
        }

        .html-market-table {
            display: grid;
            gap: 4px;
        }

        .html-market-table-head,
        .html-market-row {
            display: grid;
            grid-template-columns: minmax(170px, 1fr) 58px 58px 220px;
            gap: 6px;
            align-items: center;
        }

        .html-market-history-row,
        .html-market-history-table-head {
            grid-template-columns: minmax(180px, 1fr) 86px 66px 130px;
        }

        .html-market-table-head {
            min-height: 26px;
            padding: 0 8px;
            color: rgba(32, 27, 18, 0.78);
            font-size: 12px;
            font-weight: 900;
            text-transform: uppercase;
        }

        .html-market-row {
            min-height: 86px;
            padding: 4px 8px;
            border: 1px solid rgba(57, 44, 20, 0.28);
            background: rgba(255, 250, 218, 0.50);
            color: #1f170c;
        }

        .html-market-row:hover {
            background: rgba(255, 250, 218, 0.72);
        }

        .html-market-card-cell {
            display: grid;
            grid-template-columns: 72px minmax(0, 1fr);
            gap: 8px;
            align-items: center;
            min-width: 0;
        }

        .html-market-card-name {
            min-width: 0;
            overflow: hidden;
            font-weight: 900;
            text-overflow: ellipsis;
        }

        .html-market-change {
            display: grid;
            grid-template-columns: 60px 1fr 1fr;
            gap: 4px;
        }

        .html-market-change input {
            min-width: 0;
            height: 26px;
        }

        .html-market-change button,
        .html-market-history-controls .html-lobby-button {
            min-height: 26px;
            margin: 0;
            padding: 4px 6px;
            font-size: 12px;
        }

        .html-market-history-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
        }

        .html-market-history-controls {
            display: flex;
            align-items: center;
            gap: 6px;
            color: #ffff00;
            font-weight: 900;
            text-shadow: 1px 1px 2px #2b1d0b;
        }

        #html-market-big-card {
            position: fixed;
            z-index: 36;
            display: none;
            width: 408px;
            max-width: calc(100vw - 24px);
            height: 300px;
            margin: 0;
            animation: none;
            filter: none;
            pointer-events: auto;
            scale: 1;
            translate: 0 0;
            transform: none;
            transition: none;
        }

        #html-market-big-card.is-visible {
            display: block;
        }

        .html-market-window {
            width: 340px;
            min-height: 338px;
        }

        .html-market-dialog-body {
            padding: 12px 16px 16px;
        }

        .html-market-dialog-card {
            display: grid;
            grid-template-columns: 72px minmax(0, 1fr);
            gap: 10px;
            align-items: start;
            margin-bottom: 10px;
        }

        .html-market-dialog-name {
            min-width: 0;
            overflow: hidden;
            font-weight: 900;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .html-market-dialog-facts {
            display: grid;
            gap: 5px;
            margin: 8px 0 12px;
        }

        .html-market-dialog-fact {
            display: flex;
            justify-content: space-between;
            gap: 10px;
            min-height: 24px;
            padding: 3px 6px;
            background: rgba(255, 250, 218, 0.34);
        }

        .html-market-dialog-actions {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            margin-bottom: 12px;
        }

        .html-market-dialog-actions .html-lobby-button,
        .html-market-dialog-order .html-lobby-button {
            min-height: 30px;
            margin: 0;
            font-size: 12px;
        }

        .html-market-dialog-order {
            display: grid;
            grid-template-columns: 58px 52px 58px 44px 1fr;
            gap: 5px;
            align-items: center;
            margin-top: 6px;
        }

        .html-market-dialog-order input {
            width: 100%;
            height: 25px;
        }

        .html-market-placeholder {
            padding: 10px;
            border: 1px solid rgba(57, 44, 20, 0.28);
            background: rgba(255, 250, 218, 0.42);
            color: rgba(32, 27, 18, 0.72);
            font-weight: 700;
        }

        .html-trade-request-window {
            width: 400px;
            min-height: 210px;
        }

        .html-trade-request-copy {
            min-height: 78px;
            padding: 42px 22px 12px;
            color: #241709;
            font-weight: 800;
            text-align: center;
        }

        .html-trade-request-actions {
            display: flex;
            justify-content: center;
            gap: 16px;
            padding: 12px 18px 18px;
        }

        .html-trade-request-actions .html-lobby-button {
            min-width: 86px;
            min-height: 32px;
            margin: 0;
        }

        .html-trade-overlay {
            position: fixed;
            inset: 18px;
            z-index: 5;
            display: none;
            align-items: center;
            justify-content: center;
            pointer-events: none;
        }

        .html-trade-overlay.is-open {
            display: flex;
        }

        .html-trade-window {
            display: flex;
            flex-direction: column;
            width: min(1180px, calc(100vw - 36px));
            height: min(720px, calc(100vh - 36px));
            min-width: 0;
            min-height: 0;
            border: 1px solid rgba(57, 44, 20, 0.78);
            background: linear-gradient(#efe3aa, #d8bf6f);
            box-shadow: 0 12px 34px rgba(0, 0, 0, 0.50);
            color: #201b12;
            pointer-events: auto;
        }

        .html-trade-body {
            position: relative;
            display: grid;
            grid-template-columns: minmax(0, 1fr) 408px;
            flex: 1;
            min-height: 0;
        }

        .html-trade-left {
            display: grid;
            grid-template-rows: 40% minmax(0, 60%);
            min-width: 0;
            min-height: 0;
            border-right: 1px solid rgba(57, 44, 20, 0.55);
        }

        .html-trade-wants {
            display: grid;
            grid-template-columns: 1fr 1fr;
            min-height: 0;
            border-bottom: 1px solid rgba(57, 44, 20, 0.55);
        }

        .html-trade-want-pane {
            display: flex;
            flex-direction: column;
            min-width: 0;
            min-height: 0;
            border-right: 1px solid rgba(57, 44, 20, 0.45);
            background: rgba(255, 250, 218, 0.26);
        }

        .html-trade-want-pane:last-child {
            border-right: 0;
        }

        .html-trade-pane-head,
        .html-trade-offering {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto auto auto;
            gap: 6px;
            align-items: center;
            min-height: 30px;
            padding: 3px 8px 3px 12px;
            border-bottom: 1px solid rgba(57, 44, 20, 0.42);
            background: rgba(75, 106, 103, 0.22);
            color: #ffff00;
            font-weight: 900;
            text-shadow: 1px 1px 2px #2b1d0b;
        }

        .html-trade-pane-head .html-lobby-button {
            min-width: 64px;
            min-height: 24px;
            margin: 0;
            padding: 3px 8px;
            font-size: 12px;
        }

        .html-trade-pane-head input {
            width: 72px;
            height: 24px;
            color: #000;
        }

        .html-trade-pane-head img,
        .html-trade-offering img {
            width: 20px;
            height: 20px;
            object-fit: contain;
        }

        .html-trade-card-grid {
            flex: 1;
            min-height: 0;
            padding: 7px;
            overflow: auto;
            align-content: start;
        }

        .html-trade-collection-pane {
            display: grid;
            grid-template-rows: 82px minmax(0, 1fr);
            min-height: 0;
        }

        .html-trade-collection-tools {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 320px;
            min-width: 0;
            min-height: 0;
            border-bottom: 1px solid rgba(57, 44, 20, 0.42);
            background: rgba(75, 106, 103, 0.18);
        }

        .html-trade-collection-tools .html-filter-block {
            padding: 4px 8px;
            overflow: hidden;
        }

        .html-trade-toolbar {
            display: grid;
            grid-template-columns: 1fr;
            gap: 3px;
            align-content: center;
            padding: 6px 8px;
        }

        .html-trade-collection {
            min-height: 0;
            padding: 8px;
            overflow: auto;
            background: rgba(255, 250, 218, 0.46);
            align-content: start;
        }

        .html-trade-right {
            display: grid;
            grid-template-rows: 30px minmax(0, 1fr) 28px 300px;
            min-width: 0;
            min-height: 0;
            background: rgba(255, 250, 218, 0.22);
        }

        .html-trade-offering {
            grid-template-columns: auto minmax(0, 1fr);
        }

        .html-trade-chat-log {
            border: 0;
            border-bottom: 1px solid rgba(57, 44, 20, 0.42);
            background: rgba(255, 250, 218, 0.62);
        }

        .html-trade-big-card {
            justify-self: stretch;
            margin: 0;
        }

        .html-trade-status {
            min-height: 24px;
            padding: 4px 10px;
            border-top: 1px solid rgba(57, 44, 20, 0.42);
            background: rgba(75, 106, 103, 0.18);
            color: #201b12;
            font-size: 12px;
            font-weight: 800;
        }

        .html-trade-confirm {
            position: absolute;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.36);
        }

        .html-trade-confirm.is-open {
            display: flex;
        }

        .html-trade-confirm-window {
            width: 350px;
            min-height: 204px;
        }

        .html-trade-confirm-copy {
            display: grid;
            gap: 8px;
            min-height: 92px;
            padding: 36px 20px 8px;
            font-weight: 900;
            text-align: center;
        }

        @media (max-width: 980px) {
            .html-trade-body {
                grid-template-columns: 1fr;
                grid-template-rows: minmax(0, 1fr) 300px;
            }

            .html-trade-right {
                grid-template-columns: 1fr 300px;
                grid-template-rows: 30px minmax(0, 1fr) 28px;
            }

            .html-trade-offering,
            .html-trade-chat-log,
            .html-trade-chat-input {
                grid-column: 1;
            }

            .html-trade-big-card {
                grid-column: 2;
                grid-row: 1 / span 3;
            }
        }

        .html-lobby-actions {
            display: flex;
            flex-direction: column;
            padding: 12px;
        }

        .html-lobby-title {
            margin: 0 0 12px;
            font-size: 18px;
            font-weight: 800;
            text-align: center;
        }

        .html-lobby-section {
            margin: 12px 0 7px;
            color: rgba(32, 27, 18, 0.72);
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0;
            text-align: center;
            text-transform: uppercase;
        }

        .html-lobby-button {
            width: 100%;
            min-height: 46px;
            margin: 0 0 8px;
            padding: 8px 10px;
            border: 1px solid #57411b;
            background: linear-gradient(#f8dc6f, #bd812f);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 4px rgba(0, 0, 0, 0.25);
            color: #1c160c;
            font: 700 14px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            text-align: center;
            cursor: pointer !important;
        }

        .html-lobby-button:hover {
            background: linear-gradient(#ffe88a, #cd913b);
        }

        .html-lobby-button:active {
            transform: translateY(1px);
            box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.25);
        }

        .html-lobby-spacer {
            flex: 1;
        }

        @media (max-width: 760px) {
            #html-lobby {
                padding: 0;
            }

            .html-tabs {
                overflow-x: auto;
                padding-left: 0;
            }

            .html-tab {
                min-width: 120px;
                width: 120px;
            }

            .html-page-lobby,
            .html-page-army,
            .html-page-market {
                grid-template-columns: 1fr;
                grid-auto-rows: minmax(180px, auto);
            }

            .html-lobby-actions {
                padding: 10px;
            }
        }

        /* HTML out-of-game skin: keep the old layout, replace the flat browser layer. */
        :root {
            --tfw-font-title: "Cinzel Decorative", "Goudy Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
            --tfw-font-body: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
            --tfw-font-ui: "Optima", "Gill Sans", "Trebuchet MS", sans-serif;
            --tfw-ink: #1a130c;
            --tfw-night: #070806;
            --tfw-night-2: #11140f;
            --tfw-cedar: #23170d;
            --tfw-parchment: #ead8a1;
            --tfw-parchment-2: #c89548;
            --tfw-gold: #e7bb48;
            --tfw-gold-hot: #ffe37a;
            --tfw-ember: #be5239;
            --tfw-moss: #4f6f52;
            --tfw-teal: #2f7770;
            --tfw-sky: #67aab3;
            --tfw-shadow: rgba(0, 0, 0, 0.58);
            --tfw-line: rgba(232, 190, 84, 0.42);
            --tfw-hairline: rgba(48, 34, 17, 0.82);
            --tfw-panel: linear-gradient(135deg, rgba(255, 240, 178, 0.96), rgba(206, 151, 70, 0.95) 58%, rgba(101, 73, 35, 0.96));
            --tfw-panel-dark: linear-gradient(135deg, rgba(21, 26, 20, 0.96), rgba(42, 30, 17, 0.94));
            --tfw-button: linear-gradient(180deg, #ffe176 0%, #d39434 54%, #84511e 100%);
            --tfw-button-hover: linear-gradient(180deg, #fff0a4 0%, #efb54f 58%, #9b6328 100%);
        }

        @keyframes tfw-sheet-in {
            from {
                opacity: 0;
                translate: 0 14px;
                scale: 0.985;
                filter: brightness(0.8);
            }
            to {
                opacity: 1;
                translate: 0 0;
                scale: 1;
                filter: brightness(1);
            }
        }

        @keyframes tfw-tab-in {
            from {
                opacity: 0;
                transform: translateY(-12px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes tfw-candle {
            0%, 100% {
                opacity: 0.68;
                transform: translateX(-1.5%);
            }
            50% {
                opacity: 0.92;
                transform: translateX(1.5%);
            }
        }

        @keyframes tfw-load-pulse {
            0%, 100% {
                box-shadow: 0 0 0 1px rgba(231, 187, 72, 0.42), 0 18px 44px rgba(0, 0, 0, 0.72);
            }
            50% {
                box-shadow: 0 0 0 1px rgba(255, 227, 122, 0.82), 0 0 34px rgba(231, 187, 72, 0.28), 0 18px 44px rgba(0, 0, 0, 0.72);
            }
        }

        #html-login,
        #html-lobby,
        #html-battle-loading,
        #html-battle-ended,
        .html-modal-backdrop {
            color: var(--tfw-ink);
            font-family: var(--tfw-font-body);
            letter-spacing: 0;
        }

        #html-login button,
        #html-lobby button,
        #html-lobby input,
        #html-lobby select,
        #html-login input,
        .html-modal-backdrop button,
        .html-modal-backdrop input,
        .html-modal-backdrop select {
            font-family: var(--tfw-font-ui);
        }

        #html-login input,
        #html-lobby input,
        .html-modal-backdrop input {
            cursor: text !important;
        }

        #html-login input[type="checkbox"],
        #html-lobby input[type="checkbox"],
        .html-modal-backdrop input[type="checkbox"] {
            cursor: pointer !important;
        }

        #html-lobby select,
        .html-modal-backdrop select,
        #html-login button,
        #html-lobby button,
        .html-modal-backdrop button {
            cursor: pointer !important;
        }

        #html-login {
            background:
                linear-gradient(90deg, rgba(2, 3, 3, 0.62), rgba(13, 8, 3, 0.18) 48%, rgba(2, 3, 3, 0.66)),
                linear-gradient(180deg, rgba(4, 4, 3, 0.08), rgba(4, 4, 3, 0.76)),
                url("media/gui/Splash_LeapofFaith.jpg") center center / cover no-repeat,
                #050402;
            isolation: isolate;
        }

        #html-login::before,
        #html-login::after,
        #html-lobby::before,
        #html-lobby::after {
            content: "";
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 0;
        }

        #html-login .html-login-panel,
        #html-login .html-register-panel,
        #html-login .html-login-version,
        #html-lobby .html-lobby-shell {
            z-index: 1;
        }

        #html-lobby .html-lobby-shell {
            position: relative;
        }

        #html-login::before {
            background:
                repeating-linear-gradient(112deg, rgba(255, 226, 126, 0.08) 0 1px, transparent 1px 18px),
                repeating-linear-gradient(22deg, rgba(103, 170, 179, 0.05) 0 1px, transparent 1px 28px);
            mix-blend-mode: screen;
            animation: tfw-candle 7s ease-in-out infinite;
        }

        #html-login::after {
            background:
                linear-gradient(90deg, rgba(0, 0, 0, 0.78), transparent 31%, transparent 67%, rgba(0, 0, 0, 0.72)),
                linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.78));
        }

        .html-login-panel,
        .html-register-panel {
            width: 326px;
            min-height: 302px;
            padding: 18px 18px 16px;
            border: 1px solid rgba(255, 225, 118, 0.56);
            border-radius: 3px;
            background:
                linear-gradient(135deg, rgba(255, 244, 193, 0.96), rgba(214, 162, 76, 0.95) 56%, rgba(95, 64, 29, 0.94)),
                url("media/gui/MyGUI_Media/MyGUI_BlackOrangeSkins.png") center / 320px auto;
            box-shadow:
                inset 0 0 0 1px rgba(80, 48, 19, 0.72),
                inset 0 1px 0 rgba(255, 255, 255, 0.45),
                0 20px 52px rgba(0, 0, 0, 0.64);
            animation: tfw-sheet-in 420ms ease-out both;
        }

        .html-login-panel {
            left: clamp(24px, 14vw, 188px);
        }

        .html-register-panel {
            left: clamp(374px, 45vw, 536px);
            animation-delay: 90ms;
        }

        .html-login-panel::before,
        .html-register-panel::before,
        .html-lobby-panel::before,
        .html-options-window::before,
        .html-private-chat::before,
        .html-player-menu::before {
            content: "";
            position: absolute;
            inset: 6px;
            border: 1px solid rgba(57, 34, 13, 0.44);
            pointer-events: none;
        }

        .html-lobby-panel,
        .html-options-window,
        .html-private-chat {
            position: relative;
        }

        .html-login-title,
        .html-lobby-title {
            color: #2a1708;
            font-family: var(--tfw-font-title);
            font-weight: 700;
            text-shadow: 0 1px 0 rgba(255, 238, 176, 0.72);
        }

        .html-login-title {
            margin-bottom: 17px;
            font-size: 24px;
        }

        .html-login-row label,
        .html-form-row label,
        .html-checkbox-row,
        .html-login-checks {
            color: rgba(28, 19, 9, 0.86);
            font-family: var(--tfw-font-ui);
            font-weight: 700;
        }

        .html-login-input,
        .html-input,
        .html-select,
        .html-chat-input,
        .html-private-chat-input {
            border: 1px solid rgba(31, 21, 10, 0.72);
            border-radius: 2px;
            background:
                linear-gradient(rgba(255, 247, 213, 0.94), rgba(232, 211, 150, 0.9));
            box-shadow:
                inset 0 1px 3px rgba(60, 40, 15, 0.35),
                0 1px 0 rgba(255, 255, 255, 0.36);
            color: #170f08;
            outline: none;
        }

        .html-login-input:focus,
        .html-input:focus,
        .html-select:focus,
        .html-chat-input:focus,
        .html-private-chat-input:focus {
            border-color: var(--tfw-sky);
            box-shadow:
                inset 0 1px 3px rgba(60, 40, 15, 0.32),
                0 0 0 2px rgba(103, 170, 179, 0.28),
                0 0 18px rgba(103, 170, 179, 0.18);
        }

        .html-login-button,
        .html-lobby-button,
        .html-options-button,
        .html-close-button,
        .html-private-chat-close,
        .html-battle-ended-button {
            border: 1px solid rgba(48, 28, 10, 0.9);
            border-radius: 3px;
            background: var(--tfw-button);
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.58),
                inset 0 -1px 0 rgba(70, 38, 12, 0.62),
                0 4px 0 rgba(58, 33, 13, 0.82),
                0 9px 18px rgba(0, 0, 0, 0.25);
            color: #1b1006;
            font-family: var(--tfw-font-ui);
            font-weight: 800;
            letter-spacing: 0.02em;
            text-shadow: 0 1px 0 rgba(255, 235, 161, 0.6);
            transition: transform 110ms ease, box-shadow 110ms ease, filter 160ms ease;
        }

        .html-login-button:hover,
        .html-lobby-button:hover,
        .html-options-button:hover,
        .html-close-button:hover,
        .html-private-chat-close:hover,
        .html-battle-ended-button:hover {
            background: var(--tfw-button-hover);
            filter: saturate(1.08);
            transform: translateY(-1px);
        }

        .html-login-button:active,
        .html-lobby-button:active,
        .html-options-button:active,
        .html-close-button:active,
        .html-private-chat-close:active,
        .html-battle-ended-button:active {
            transform: translateY(2px);
            box-shadow:
                inset 0 2px 5px rgba(35, 20, 8, 0.44),
                0 1px 0 rgba(58, 33, 13, 0.82);
        }

        .html-login-why {
            color: #7e1f16;
            font-family: var(--tfw-font-ui);
            text-shadow: 0 1px 0 rgba(255, 234, 160, 0.45);
        }

        .html-login-version {
            color: rgba(255, 226, 142, 0.9);
            font-family: "Courier New", monospace;
        }

        #html-lobby {
            padding: clamp(8px, 1.5vw, 18px);
            background:
                linear-gradient(90deg, rgba(3, 5, 4, 0.58), rgba(5, 9, 8, 0.28) 22%, rgba(5, 9, 8, 0.30) 78%, rgba(3, 5, 4, 0.64)),
                url("media/gui/BackgroundLeft.jpg") left top / auto 100% no-repeat,
                url("media/gui/BackgroundRight.jpg") right top / auto 100% no-repeat,
                #0a0d0a;
            isolation: isolate;
        }

        #html-lobby::before {
            background:
                repeating-linear-gradient(0deg, transparent 0 31px, rgba(231, 187, 72, 0.045) 31px 32px),
                repeating-linear-gradient(90deg, transparent 0 43px, rgba(103, 170, 179, 0.045) 43px 44px),
                linear-gradient(135deg, rgba(231, 187, 72, 0.10), transparent 38%, rgba(47, 119, 112, 0.08) 75%, transparent);
            opacity: 0.9;
        }

        #html-lobby::after {
            background:
                linear-gradient(180deg, rgba(0, 0, 0, 0.36), transparent 22%, transparent 72%, rgba(0, 0, 0, 0.54)),
                repeating-linear-gradient(125deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 9px);
            mix-blend-mode: soft-light;
        }

        .html-lobby-shell {
            width: min(1180px, 100%);
            max-width: 1180px;
            max-height: 760px;
            border: 1px solid rgba(231, 187, 72, 0.44);
            border-radius: 4px;
            background:
                linear-gradient(180deg, rgba(15, 17, 12, 0.92), rgba(12, 11, 8, 0.84)),
                url("media/gui/Skins/Skin.png") center / 520px auto;
            box-shadow:
                inset 0 0 0 1px rgba(0, 0, 0, 0.72),
                inset 0 18px 48px rgba(255, 235, 151, 0.04),
                0 24px 68px rgba(0, 0, 0, 0.62);
            overflow: hidden;
            animation: tfw-sheet-in 360ms ease-out both;
        }

        #html-lobby .html-lobby-shell {
            width: min(1320px, 100%);
            max-width: 1320px;
            max-height: calc(100vh - 24px);
        }

        .html-tabs {
            height: 42px;
            gap: 0;
            padding: 8px 11px 0;
            background:
                linear-gradient(180deg, rgba(35, 25, 13, 0.96), rgba(15, 14, 10, 0.84));
            border-bottom: 1px solid rgba(231, 187, 72, 0.28);
        }

        .html-tab {
            position: relative;
            width: 142px;
            min-width: 118px;
            height: 33px;
            margin-right: 4px;
            border: 1px solid rgba(50, 32, 14, 0.96);
            border-bottom: 0;
            border-radius: 5px 5px 0 0;
            background:
                linear-gradient(180deg, rgba(79, 111, 82, 0.95), rgba(39, 54, 39, 0.95));
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.16),
                0 -1px 0 rgba(231, 187, 72, 0.22);
            color: #f1dfaa;
            font: 800 12px/1 var(--tfw-font-ui);
            text-transform: uppercase;
            text-shadow: 0 1px 2px #000;
            animation: tfw-tab-in 260ms ease-out both;
        }

        .html-tab:nth-child(2) { animation-delay: 35ms; }
        .html-tab:nth-child(3) { animation-delay: 70ms; }
        .html-tab:nth-child(4) { animation-delay: 105ms; }
        .html-tab:nth-child(5) { animation-delay: 140ms; }

        .html-tab::after {
            content: "";
            position: absolute;
            left: 9px;
            right: 9px;
            bottom: 4px;
            height: 2px;
            background: rgba(103, 170, 179, 0.0);
            transition: background 140ms ease, box-shadow 140ms ease;
        }

        .html-tab:hover {
            background:
                linear-gradient(180deg, rgba(82, 128, 102, 0.98), rgba(47, 66, 48, 0.98));
        }

        .html-tab.is-active {
            height: 36px;
            background:
                linear-gradient(180deg, rgba(246, 217, 120, 0.98), rgba(183, 112, 45, 0.96));
            color: #1d1006;
            text-shadow: 0 1px 0 rgba(255, 237, 171, 0.72);
        }

        .html-tab.is-active::after {
            background: var(--tfw-teal);
            box-shadow: 0 0 10px rgba(103, 170, 179, 0.45);
        }

        .html-topbar {
            top: 10px;
            right: 14px;
            z-index: 2;
            gap: 6px;
            height: 30px;
        }

        .html-status,
        .html-account-name,
        .html-currency {
            height: 26px;
            padding: 5px 9px;
            border: 1px solid rgba(231, 187, 72, 0.24);
            border-radius: 3px;
            background: rgba(8, 10, 8, 0.58);
            color: #e9d99d;
            font-family: var(--tfw-font-ui);
            text-shadow: 0 1px 2px #000;
        }

        .html-currency {
            gap: 5px;
            color: #ffe37a;
            font-weight: 900;
        }

        .html-currency img {
            filter: drop-shadow(0 1px 1px #000);
        }

        .html-options-button {
            width: 34px;
            height: 30px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            color: #1d1207;
            font-family: Georgia, "Times New Roman", serif;
            font-size: 20px;
            line-height: 1;
        }

        .html-options-button::before {
            content: none;
        }

        .html-tab-pages {
            padding: 14px;
            background:
                linear-gradient(180deg, rgba(5, 7, 5, 0.22), rgba(5, 7, 5, 0.48));
        }

        .html-page-lobby {
            grid-template-columns: minmax(315px, 1fr) 220px 272px;
            gap: 14px;
        }

        .html-page-army,
        .html-page-market {
            gap: 10px;
        }

        .html-page-army {
            grid-template-columns: minmax(500px, 1fr) minmax(520px, 1fr);
        }

        .html-lobby-panel {
            border: 1px solid rgba(231, 187, 72, 0.42);
            border-radius: 4px;
            background:
                linear-gradient(135deg, rgba(255, 240, 178, 0.94), rgba(207, 151, 71, 0.91) 58%, rgba(95, 64, 29, 0.90));
            box-shadow:
                inset 0 0 0 1px rgba(48, 28, 10, 0.64),
                inset 0 1px 0 rgba(255, 255, 255, 0.32),
                0 14px 26px rgba(0, 0, 0, 0.35);
            overflow: hidden;
            animation: tfw-sheet-in 380ms ease-out both;
        }

        .html-page.is-active .html-lobby-panel:nth-child(2) { animation-delay: 50ms; }
        .html-page.is-active .html-lobby-panel:nth-child(3) { animation-delay: 100ms; }

        .html-panel-empty {
            background:
                repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.10) 0 1px, transparent 1px 11px),
                linear-gradient(135deg, rgba(235, 216, 160, 0.78), rgba(155, 104, 48, 0.62));
        }

        .html-lobby-panel-header,
        .html-private-chat-header,
        .html-options-title {
            border-bottom: 1px solid rgba(52, 31, 12, 0.58);
            background:
                linear-gradient(90deg, rgba(47, 119, 112, 0.34), rgba(231, 187, 72, 0.16), rgba(190, 82, 57, 0.20)),
                linear-gradient(180deg, rgba(255, 244, 194, 0.52), rgba(102, 68, 29, 0.22));
            color: #211306;
            font-family: var(--tfw-font-title);
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0;
            text-shadow: 0 1px 0 rgba(255, 239, 181, 0.5);
        }

        .html-chat-body {
            grid-template-columns: minmax(0, 1fr) 142px;
            grid-template-rows: minmax(0, 1fr) 34px;
        }

        .html-chat-log,
        .html-private-chat-log,
        .html-battle-list,
        .html-card-list,
        .html-hotkeys,
        .html-lobby-placeholder,
        .html-chat-players {
            scrollbar-color: rgba(130, 82, 31, 0.9) rgba(38, 27, 13, 0.25);
        }

        .html-chat-log,
        .html-private-chat-log,
        .html-lobby-placeholder,
        .html-battle-list,
        .html-card-list {
            background:
                repeating-linear-gradient(0deg, rgba(56, 38, 16, 0.045) 0 1px, transparent 1px 13px),
                rgba(255, 247, 211, 0.62);
        }

        .html-chat-line,
        .html-private-chat-line {
            color: #211407;
            font-size: 13px;
        }

        .html-chat-players {
            border-left: 1px solid rgba(61, 39, 15, 0.36);
            background:
                linear-gradient(180deg, rgba(39, 54, 39, 0.18), rgba(255, 250, 218, 0.36));
        }

        .html-chat-player {
            min-height: 25px;
            padding: 5px 8px;
            border-bottom: 1px solid rgba(61, 39, 15, 0.18);
            color: #241609;
            font-family: var(--tfw-font-ui);
            font-weight: 700;
        }

        .html-chat-player:hover,
        .html-chat-player.is-menu-target {
            background:
                linear-gradient(90deg, rgba(47, 119, 112, 0.35), rgba(255, 227, 122, 0.22));
            color: #0a1815;
        }

        .html-chat-counter {
            border-top: 1px solid rgba(61, 39, 15, 0.38);
            background: rgba(35, 23, 10, 0.18);
            color: #33200e;
            font-family: var(--tfw-font-ui);
            font-weight: 800;
        }

        .html-player-menu,
        .html-private-chat,
        .html-options-window,
        .html-battle-ended-panel,
        .html-battle-loading-panel {
            border-radius: 4px;
            border-color: rgba(231, 187, 72, 0.52);
            background:
                linear-gradient(135deg, rgba(255, 240, 178, 0.97), rgba(204, 145, 65, 0.96) 62%, rgba(77, 48, 22, 0.97));
            box-shadow:
                inset 0 0 0 1px rgba(46, 28, 11, 0.62),
                0 16px 38px rgba(0, 0, 0, 0.48);
        }

        .html-player-menu-button {
            color: #1c1107;
            font-family: var(--tfw-font-ui);
            font-weight: 700;
        }

        .html-player-menu-button:hover:not(:disabled) {
            background: rgba(103, 170, 179, 0.24);
        }

        .html-private-chats {
            right: 22px;
            bottom: 22px;
        }

        .html-private-chat {
            width: 286px;
            height: 318px;
        }

        .html-battle-item {
            grid-template-columns: minmax(0, 1fr) 50px 64px;
            min-height: 47px;
            border-bottom: 1px solid rgba(60, 37, 14, 0.24);
            background:
                linear-gradient(90deg, rgba(255, 247, 211, 0.55), rgba(47, 119, 112, 0.09));
            color: #201408;
            font-family: var(--tfw-font-ui);
            transition: transform 110ms ease, background 130ms ease, box-shadow 130ms ease;
        }

        .html-battle-item:hover {
            background:
                linear-gradient(90deg, rgba(255, 234, 164, 0.82), rgba(47, 119, 112, 0.22));
            box-shadow: inset 3px 0 0 var(--tfw-teal);
            transform: translateX(2px);
        }

        .html-battle-action {
            border-color: rgba(23, 15, 7, 0.92);
            border-radius: 2px;
            background:
                linear-gradient(180deg, rgba(42, 31, 15, 0.98), rgba(12, 15, 11, 0.98));
            box-shadow:
                inset 0 1px 0 rgba(255, 233, 162, 0.22),
                inset 0 -1px 0 rgba(0, 0, 0, 0.42),
                0 1px 2px rgba(0, 0, 0, 0.32);
            color: #ffeaa6;
            font-size: 12px;
            font-weight: 900;
            text-shadow: 0 1px 1px #000;
        }

        .html-battle-item:hover .html-battle-action {
            background:
                linear-gradient(180deg, rgba(73, 50, 19, 0.98), rgba(15, 36, 32, 0.98));
            color: #fff4c4;
        }

        .html-battle-counter {
            color: #245634;
            font-weight: 900;
        }

        .html-lobby-actions {
            gap: 2px;
            padding: 16px 14px;
            background:
                linear-gradient(180deg, rgba(255, 243, 185, 0.12), rgba(49, 28, 10, 0.16));
        }

        .html-lobby-title {
            margin-bottom: 13px;
            font-size: 21px;
        }

        .html-lobby-section {
            margin: 13px 0 8px;
            color: #563a16;
            font-family: var(--tfw-font-ui);
            font-size: 11px;
            font-weight: 900;
            letter-spacing: 0.09em;
        }

        .html-lobby-button {
            min-height: 48px;
            margin-bottom: 9px;
            padding: 9px 10px;
            font-size: 13px;
        }

        .html-split-pane {
            border-right: 1px solid rgba(52, 31, 12, 0.34);
            background: rgba(255, 247, 211, 0.14);
        }

        .html-filter-block {
            gap: 6px;
            padding: 10px;
            background:
                linear-gradient(180deg, rgba(30, 36, 29, 0.10), rgba(255, 247, 211, 0.10));
        }

        .html-page-army .html-split-pane {
            grid-template-rows: 112px 34px minmax(0, 1fr);
        }

        .html-army-filter-block {
            display: grid;
            grid-template-columns: 1.45fr 1fr 1fr 1.05fr 0.7fr;
            gap: 7px;
            overflow: hidden;
            padding: 8px 10px;
        }

        .html-filter-section {
            display: grid;
            grid-template-rows: 15px minmax(0, 1fr);
            min-width: 0;
            min-height: 0;
            padding: 2px 3px 3px;
            border: 1px solid rgba(52, 31, 12, 0.18);
            border-radius: 3px;
            background: rgba(255, 247, 211, 0.13);
        }

        .html-filter-section .html-filter-label {
            width: auto;
            height: 15px;
            margin: 0 0 3px;
            overflow: hidden;
            font-size: 10px;
            line-height: 15px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .html-filter-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 3px;
            align-content: flex-start;
            min-width: 0;
            min-height: 0;
            overflow: hidden;
        }

        .html-filter-button {
            width: 40px;
            height: 54px;
            border: 1px solid rgba(44, 28, 11, 0.7);
            border-radius: 3px;
            background:
                linear-gradient(180deg, rgba(255, 239, 180, 0.82), rgba(133, 88, 37, 0.54));
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.34),
                0 2px 7px rgba(0, 0, 0, 0.24);
            transition: transform 100ms ease, filter 120ms ease;
        }

        .html-army-filter-block .html-filter-button {
            flex: 0 0 30px;
            width: 30px;
            height: 37px;
        }

        .html-army-filter-block .html-filter-button img {
            left: 3px;
            top: 2px;
            width: 24px;
            height: 24px;
        }

        .html-army-filter-block .html-filter-button span {
            bottom: 1px;
            font-size: 10px;
            line-height: 11px;
        }

        .html-filter-button:hover {
            transform: translateY(-1px);
        }

        .html-filter-button.is-off {
            opacity: 0.44;
            filter: saturate(0.4) brightness(0.72);
        }

        .html-filter-button img {
            left: 4px;
            top: 4px;
        }

        .html-filter-label,
        .html-toolbar label {
            color: #3d260f;
            font-family: var(--tfw-font-ui);
            font-weight: 900;
        }

        .html-page-army .html-filter-label {
            color: #f6e7b8;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.92);
        }

        .html-toolbar,
        .html-deck-toolbar {
            padding: 3px 5px;
            border-top: 1px solid rgba(50, 31, 12, 0.20);
            border-bottom: 1px solid rgba(50, 31, 12, 0.20);
            background: rgba(35, 23, 10, 0.10);
        }

        .html-page-army .html-toolbar {
            grid-template-columns: 58px minmax(80px, 1fr) 150px;
            gap: 5px;
            align-items: center;
            min-height: 34px;
        }

        .html-page-army .html-deck-toolbar {
            display: grid;
            grid-template-columns: minmax(140px, 1fr) 64px 64px 76px 64px;
            gap: 5px;
            align-items: center;
            min-height: 34px;
        }

        .html-army-card-count {
            display: inline-flex;
            min-width: 0;
            height: 25px;
            align-items: center;
            justify-content: center;
            padding: 0 5px;
            border: 1px solid rgba(57, 44, 20, 0.52);
            border-radius: 2px;
            background: rgba(14, 10, 5, 0.38);
            color: #f8e7aa;
            font-family: var(--tfw-font-ui);
            font-size: 10px;
            font-weight: 900;
            line-height: 1;
            text-align: center;
            text-shadow: 0 1px 2px #000;
            white-space: nowrap;
        }

        .html-army-card-count.is-invalid {
            color: #ffb4a8;
        }

        #html-army-deck-list.has-invalid-current {
            border-color: rgba(179, 38, 30, 0.88);
            color: #b3261e;
            font-weight: 900;
        }

        #html-army-deck-list option.is-invalid {
            color: #b3261e;
            font-weight: 900;
        }

        .html-page-army .html-deck-toolbar .html-lobby-button {
            min-height: 25px;
            height: 25px;
            margin: 0;
            padding: 0 6px;
            overflow: hidden;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.45),
                inset 0 -1px 0 rgba(70, 38, 12, 0.50),
                0 2px 0 rgba(58, 33, 13, 0.72);
            font-size: 11px;
            line-height: 23px;
            white-space: nowrap;
        }

        .html-page-army .html-input,
        .html-page-army .html-select {
            height: 25px;
        }

        .html-page-army .html-split-pane:nth-child(2) > .html-card-list {
            position: relative;
            display: block;
            overflow: hidden;
        }

        #html-army-deck {
            height: 100%;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
            align-content: start;
            padding: 5px 2px 0 0;
        }

        #html-army-big-card {
            position: fixed;
            z-index: 36;
            display: none;
            width: 408px;
            max-width: calc(100vw - 24px);
            height: 300px;
            margin: 0;
            animation: none;
            filter: none;
            pointer-events: auto;
            scale: 1;
            translate: 0 0;
            transform: none;
            transition: none;
        }

        #html-army-big-card.is-visible {
            display: block;
        }

        .html-card-grid {
            grid-template-columns: repeat(auto-fill, 74px);
            grid-auto-rows: 74px;
            gap: 4px;
        }

        .html-small-card {
            filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.34));
            transition: transform 110ms ease, filter 110ms ease;
        }

        .html-small-card:hover {
            transform: translateY(-3px) scale(1.035);
            filter:
                drop-shadow(0 0 9px rgba(255, 226, 126, 0.55))
                drop-shadow(0 5px 8px rgba(0, 0, 0, 0.34));
            z-index: 2;
        }

        .html-page-army .html-small-card:hover {
            transform: none;
            filter:
                drop-shadow(0 0 9px rgba(255, 226, 126, 0.55))
                drop-shadow(0 3px 5px rgba(0, 0, 0, 0.34));
        }

        .html-small-card.is-missing-card {
            filter:
                grayscale(1)
                brightness(0.82)
                drop-shadow(0 2px 3px rgba(0, 0, 0, 0.34));
        }

        .html-small-card.is-missing-card:hover {
            filter:
                grayscale(1)
                brightness(0.92)
                drop-shadow(0 0 9px rgba(255, 226, 126, 0.42))
                drop-shadow(0 5px 8px rgba(0, 0, 0, 0.34));
        }

        .html-card-row {
            border-color: rgba(56, 35, 14, 0.35);
            border-radius: 2px;
            background:
                linear-gradient(90deg, rgba(255, 248, 215, 0.78), rgba(218, 174, 91, 0.42));
            color: #211407;
            font-family: var(--tfw-font-ui);
            font-weight: 700;
        }

        .html-big-card {
            border-radius: 0;
            box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
            transform-origin: bottom right;
            animation: tfw-sheet-in 320ms ease-out both;
        }

        .html-big-card-title {
            background: transparent;
            color: #000;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            font-size: 15px;
            font-weight: 400;
        }

        .html-big-card-desc,
        .html-big-card-artist,
        .html-big-card-stats,
        .html-big-card-flux {
            color: #000;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
        }

	        .html-rich-link,
	        .html-rich-card,
	        .html-rich-deck,
	        .html-rich-attr,
	        .html-rich-time {
            color: #0b6c6a;
            font-weight: 700;
            text-decoration-color: rgba(11, 108, 106, 0.55);
        }

        button.html-rich-card {
            display: inline;
            margin: 0;
            padding: 0;
            border: 0;
            background: transparent;
            font: inherit;
            cursor: pointer;
        }

        .html-rich-flux {
            background: url("media/gui/cards/cost-flux.png") center / 20px 20px no-repeat;
            box-shadow: none;
            color: #000;
        }

        .html-modal-backdrop {
            background:
                repeating-linear-gradient(45deg, rgba(255, 226, 126, 0.07) 0 1px, transparent 1px 13px),
                rgba(0, 0, 0, 0.52);
            backdrop-filter: blur(2px);
            cursor: default !important;
        }

        .html-modal-backdrop * {
            cursor: default !important;
        }

        .html-modal-backdrop button,
        .html-modal-backdrop select,
        .html-modal-backdrop input[type="range"],
        .html-modal-backdrop input[type="checkbox"] {
            cursor: pointer !important;
        }

        .html-battle-popup,
        .html-battle-popup *,
        #html-battle-ended,
        #html-battle-ended *,
        .html-battle-ended,
        .html-battle-ended *,
        #html-battle-loading,
        #html-battle-loading *,
        .html-battle-loading,
        .html-battle-loading *,
	        .html-modal-backdrop,
	        .html-modal-backdrop *,
	        .html-trade-overlay,
	        .html-trade-overlay *,
	        .html-battle-dev-card-modal,
	        .html-battle-dev-card-modal * {
	            cursor: default !important;
	        }

        .html-battle-popup button,
        #html-battle-ended button,
        .html-battle-ended button,
        #html-battle-loading button,
        .html-battle-loading button,
        .html-modal-backdrop button,
        .html-modal-backdrop select,
        .html-modal-backdrop input[type="range"],
        .html-modal-backdrop input[type="checkbox"],
        .html-modal-backdrop input[type="button"],
        .html-modal-backdrop input[type="submit"],
	        .html-trade-overlay button,
	        .html-trade-overlay select,
	        .html-trade-overlay input[type="range"],
	        .html-trade-overlay input[type="checkbox"],
	        .html-battle-dev-card-modal button,
	        .html-battle-dev-card-modal select,
	        .html-battle-dev-card-modal input[type="checkbox"] {
	            cursor: pointer !important;
	        }

        .html-modal-backdrop input[type="text"],
        .html-modal-backdrop input[type="password"],
	        .html-trade-overlay input[type="text"],
	        .html-battle-popup input[type="text"],
	        .html-battle-dev-card-modal input[type="search"] {
	            cursor: text !important;
	        }

        .html-options-window {
            width: 500px;
            background:
                linear-gradient(135deg, rgba(255, 244, 196, 0.98), rgba(215, 159, 75, 0.98) 54%, rgba(78, 50, 24, 0.98)),
                repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.10) 0 1px, transparent 1px 12px);
            border: 1px solid rgba(244, 205, 104, 0.62);
            border-radius: 5px;
            box-shadow:
                inset 0 0 0 1px rgba(51, 29, 10, 0.65),
                inset 0 1px 0 rgba(255, 255, 255, 0.44),
                0 24px 60px rgba(0, 0, 0, 0.58);
            overflow: hidden;
            animation: tfw-sheet-in 220ms ease-out both;
        }

        .html-options-title {
            height: 46px;
            padding: 0 10px 0 14px;
            background:
                linear-gradient(90deg, rgba(47, 119, 112, 0.34), rgba(255, 226, 126, 0.18), rgba(190, 82, 57, 0.24)),
                linear-gradient(180deg, rgba(255, 247, 202, 0.58), rgba(78, 50, 24, 0.22));
            color: #1e1207;
            font-family: var(--tfw-font-title);
            font-size: 17px;
            text-shadow: 0 1px 0 rgba(255, 238, 180, 0.62);
        }

        .html-options-title-main {
            display: inline-flex;
            align-items: center;
            gap: 9px;
        }

        .html-options-title-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            border: 1px solid rgba(37, 23, 9, 0.72);
            border-radius: 50%;
            background: linear-gradient(180deg, #ffe589, #a96b2a);
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.55),
                0 1px 3px rgba(0, 0, 0, 0.32);
            font-family: Georgia, "Times New Roman", serif;
            font-size: 17px;
            line-height: 1;
        }

        .html-close-button {
            border-radius: 3px;
            background:
                linear-gradient(180deg, #a94335, #5c1f19);
            box-shadow:
                inset 0 1px 0 rgba(255, 218, 178, 0.28),
                0 2px 4px rgba(0, 0, 0, 0.28);
            color: #fff0c7;
            text-shadow: 0 1px 1px #000;
        }

        .html-options-tabs {
            height: 38px;
            padding: 5px 8px 0;
            gap: 5px;
            background:
                linear-gradient(180deg, rgba(34, 22, 9, 0.18), rgba(255, 247, 211, 0.08));
        }

        .html-options-tab {
            border: 1px solid rgba(56, 35, 14, 0.42);
            border-bottom: 0;
            border-radius: 4px 4px 0 0;
            background:
                linear-gradient(180deg, rgba(69, 91, 67, 0.38), rgba(46, 52, 35, 0.18));
            color: #311f0c;
            font-family: var(--tfw-font-ui);
            font-weight: 900;
        }

        .html-options-tab.is-active {
            background:
                linear-gradient(180deg, rgba(255, 241, 181, 0.86), rgba(239, 185, 91, 0.46));
            box-shadow:
                inset 0 -3px 0 var(--tfw-teal),
                inset 0 1px 0 rgba(255, 255, 255, 0.38);
        }

        .html-options-page {
            padding: 15px 18px 18px;
            background:
                linear-gradient(180deg, rgba(255, 247, 211, 0.32), rgba(82, 52, 24, 0.08));
        }

        .html-form-row {
            grid-template-columns: 150px minmax(0, 1fr);
            min-height: 34px;
            margin-bottom: 11px;
            padding: 7px 8px;
            border: 1px solid rgba(59, 37, 14, 0.22);
            border-radius: 3px;
            background: rgba(255, 249, 221, 0.30);
        }

        .html-form-row label {
            text-align: left;
        }

        .html-options-window .html-input[type="range"] {
            height: 24px;
            padding: 0;
            border: 0;
            background: transparent;
            box-shadow: none;
            accent-color: var(--tfw-teal);
        }

        .html-options-window .html-select {
            height: 29px;
            border-color: rgba(36, 22, 8, 0.68);
            background:
                linear-gradient(180deg, rgba(255, 250, 220, 0.96), rgba(218, 191, 120, 0.94));
            font-weight: 700;
        }

        .html-checkbox-row {
            display: flex;
            align-items: center;
            gap: 8px;
            min-height: 32px;
            margin: 8px 0;
            padding: 6px 8px;
            border: 1px solid rgba(59, 37, 14, 0.20);
            border-radius: 3px;
            background: rgba(255, 249, 221, 0.26);
        }

        .html-checkbox-row input {
            width: 16px;
            height: 16px;
            accent-color: var(--tfw-teal);
        }

        .html-hotkeys {
            border-color: rgba(56, 35, 14, 0.34);
            border-radius: 3px;
            background:
                repeating-linear-gradient(0deg, rgba(50, 33, 12, 0.05) 0 1px, transparent 1px 13px),
                rgba(255, 247, 211, 0.56);
            color: #211407;
            font-family: var(--tfw-font-ui);
            line-height: 1.38;
        }

	        #html-battle-loading {
	            background: transparent;
	        }

        .html-battle-loading-panel {
            min-width: 310px;
            padding: 22px 26px;
            background:
                linear-gradient(135deg, rgba(21, 26, 20, 0.98), rgba(48, 31, 15, 0.97));
            color: #f4df9d;
            animation: tfw-load-pulse 1.8s ease-in-out infinite;
        }

        .html-battle-loading-title {
            font-family: var(--tfw-font-title);
            font-size: 22px;
            letter-spacing: 0.02em;
        }

        .html-battle-loading-subtitle {
            color: rgba(244, 223, 157, 0.72);
            font-family: var(--tfw-font-ui);
        }

        .html-battle-ended-panel {
            background:
                linear-gradient(135deg, rgba(255, 240, 178, 0.98), rgba(202, 145, 64, 0.98));
        }

        @media (max-width: 900px) {
            .html-login-panel,
            .html-register-panel {
                left: 50%;
                width: min(326px, calc(100vw - 28px));
                transform: translateX(-50%);
            }

            .html-register-panel {
                top: 430px;
            }

            .html-page-lobby,
            .html-page-army,
            .html-page-market {
                grid-template-columns: 1fr;
                grid-auto-rows: minmax(190px, auto);
            }

            .html-tab-pages {
                overflow: auto;
            }
        }

        @media (max-width: 1100px) {
            .html-page-army {
                grid-template-columns: 1fr;
                grid-auto-rows: minmax(520px, 1fr);
                overflow: auto;
            }
        }

        @media (max-width: 760px) {
            .html-lobby-shell {
                border-left: 0;
                border-right: 0;
                border-radius: 0;
                max-height: none;
            }

            .html-tabs {
                height: 45px;
                padding-left: 6px;
            }

            .html-tab {
                width: 122px;
                min-width: 122px;
                font-size: 11px;
            }

            .html-topbar {
                top: 46px;
                right: 8px;
            }
        }

        /* Battle screen redesign: compact rune rail, narrow log, full bottom-right card. */
        :root {
            --battle-card-scale: 1;
            --battle-card-space: 438px;
            --battle-chat-width: 288px;
            --battle-gold: #f0c65d;
            --battle-gold-hot: #ffe99a;
            --battle-mint: #75c8b9;
            --battle-red: #ba4934;
            --battle-panel: rgba(6, 8, 5, 0.72);
            --battle-panel-hard: rgba(6, 8, 5, 0.88);
            --battle-line: rgba(240, 198, 93, 0.46);
            --battle-line-soft: rgba(240, 198, 93, 0.2);
            --battle-control-brass: #d4a947;
            --battle-control-brass-hot: #fff1a6;
            --battle-control-iron: #1b2018;
            --battle-control-ink: #070905;
        }

        @keyframes tfw-battle-rise {
            from {
                opacity: 0;
                translate: 0 10px;
                filter: brightness(0.72);
            }
            to {
                opacity: 1;
                translate: 0 0;
                filter: brightness(1);
            }
        }

        @keyframes tfw-battle-rail {
            from {
                opacity: 0;
                translate: -12px 0;
            }
            to {
                opacity: 1;
                translate: 0 0;
            }
        }

        @keyframes tfw-battle-ember {
            0%, 100% {
                opacity: 0.34;
                transform: translateX(-22%);
            }
            50% {
                opacity: 0.66;
                transform: translateX(22%);
            }
        }

        #html-battle-ui {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 5;
            color: #f6e4aa;
            font-family: "TFW DejaVu Sans", var(--tfw-font-ui);
            pointer-events: none;
        }

        #html-battle-ui.is-visible {
            display: block;
        }

        #html-battle-ui *,
        #html-battle-ui button,
        #html-battle-ui input {
            cursor: default !important;
        }

        .html-battle-ui-panel,
        .html-battle-ui-button,
        .html-battle-big-card,
        .html-battle-hand-card,
        .html-battle-enchants,
        .html-battle-hand-scroll,
        .html-battle-hand-scroll button,
        .html-battle-player,
        .html-battle-chat-input {
            pointer-events: auto;
        }

        .html-battle-side {
            position: fixed;
            left: 12px;
            top: 50%;
            z-index: 7;
            display: flex;
            width: 86px;
            max-height: calc(100vh - 118px);
            box-sizing: border-box;
            flex-direction: column;
            gap: 8px;
            align-items: center;
            padding: 10px 8px;
            transform: translateY(-50%);
            border: 1px solid var(--battle-line);
            border-radius: 6px;
            background:
                radial-gradient(circle at 50% 0, rgba(117, 200, 185, 0.18), transparent 42%),
                repeating-linear-gradient(135deg, rgba(255, 238, 166, 0.055) 0 1px, transparent 1px 10px),
                linear-gradient(180deg, rgba(31, 35, 23, 0.88), rgba(8, 9, 6, 0.66));
            box-shadow:
                inset 0 1px 0 rgba(255, 238, 166, 0.18),
                inset 0 -24px 42px rgba(0, 0, 0, 0.34),
                0 18px 38px rgba(0, 0, 0, 0.56);
            animation: tfw-battle-rail 240ms ease-out both;
            backdrop-filter: blur(1.5px);
        }

        .html-battle-side[hidden] {
            display: none;
        }

        .html-battle-side::before {
            content: "";
            position: absolute;
            inset: 5px;
            border: 1px solid rgba(0, 0, 0, 0.34);
            border-radius: 4px;
            pointer-events: none;
        }

        .html-battle-side-spacer {
            flex: 1 1 auto;
            min-height: 8px;
        }

        .html-battle-system-actions {
            position: fixed;
            top: 10px;
            right: 14px;
            z-index: 8;
            display: flex;
            gap: 6px;
            pointer-events: none;
            animation: tfw-battle-rise 220ms ease-out both;
        }

        .html-battle-system-actions .html-battle-ui-button {
            width: 50px;
            min-height: 42px;
            padding: 27px 3px 4px;
            border-radius: 4px;
            font-size: 8px;
            line-height: 9px;
            letter-spacing: 0;
        }

        .html-battle-system-actions .html-battle-ui-button::before {
            top: 6px;
            width: 20px;
            height: 20px;
        }

        .html-battle-system-actions .html-battle-ui-button::after {
            left: 50%;
            top: 5px;
            width: 25px;
            height: 22px;
            transform: translateX(-50%);
        }

        .html-battle-ui-button,
        .html-battle-pass-all {
            --battle-icon: none;
            --button-accent: var(--battle-control-brass);
            --button-glow: rgba(240, 198, 93, 0.28);
            position: relative;
            display: flex;
            width: 68px;
            min-height: 62px;
            box-sizing: border-box;
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            padding: 42px 4px 6px;
            isolation: isolate;
            border: 1px solid rgba(8, 7, 4, 0.98);
            border-radius: 4px;
            background:
                linear-gradient(180deg, rgba(255, 245, 190, 0.18), transparent 16px),
                radial-gradient(circle at 50% 18px, rgba(255, 236, 170, 0.22), transparent 30px),
                linear-gradient(180deg, rgba(48, 58, 40, 0.98), rgba(15, 19, 13, 0.98) 55%, rgba(6, 8, 5, 0.99));
            box-shadow:
                inset 0 1px 0 rgba(255, 248, 198, 0.24),
                inset 0 0 0 1px rgba(240, 198, 93, 0.15),
                inset 0 -12px 22px rgba(0, 0, 0, 0.34),
                0 1px 0 rgba(255, 239, 166, 0.1),
                0 3px 8px rgba(0, 0, 0, 0.54);
            color: #f9e9b5;
            font-size: 10px;
            font-weight: 900;
            line-height: 12px;
            text-align: center;
            text-shadow: 0 1px 1px #000, 0 0 7px rgba(240, 198, 93, 0.18);
            text-transform: uppercase;
            transition: filter 130ms ease, transform 100ms ease, border-color 130ms ease, box-shadow 130ms ease;
        }

        #html-battle-normal-actions .html-battle-ui-button,
        #html-battle-action-actions .html-battle-ui-button,
        .html-battle-pass-all,
        .html-battle-side > .html-battle-ui-button {
            margin: 0;
            background-color: transparent;
            background-image:
                linear-gradient(180deg, rgba(255, 245, 190, 0.18), transparent 16px),
                radial-gradient(circle at 50% 18px, rgba(255, 236, 170, 0.22), transparent 30px),
                linear-gradient(180deg, rgba(48, 58, 40, 0.98), rgba(15, 19, 13, 0.98) 55%, rgba(6, 8, 5, 0.99));
            background-repeat: no-repeat;
        }

        .html-battle-ui-button::before,
        .html-battle-pass-all::before {
            content: "";
            position: absolute;
            left: 50%;
            top: 8px;
            width: 34px;
            height: 34px;
            transform: translateX(-50%);
            z-index: 2;
            background:
                linear-gradient(180deg, #fffbe0 0 17%, var(--button-accent) 48%, #8e6024 100%);
            filter:
                drop-shadow(0 1px 1px rgba(0, 0, 0, 0.85))
                drop-shadow(0 0 8px var(--button-glow));
            -webkit-mask: var(--battle-icon) center / contain no-repeat;
            mask: var(--battle-icon) center / contain no-repeat;
        }

        .html-battle-ui-button::after,
        .html-battle-pass-all::after {
            content: "";
            position: absolute;
            left: 13px;
            top: 7px;
            width: 40px;
            height: 34px;
            z-index: 1;
            border: 1px solid rgba(240, 198, 93, 0.28);
            border-radius: 50%;
            background:
                radial-gradient(circle at 50% 38%, rgba(255, 243, 171, 0.2), transparent 0 22%, rgba(0, 0, 0, 0.08) 23% 62%, transparent 64%),
                radial-gradient(circle, rgba(117, 200, 185, 0.12), rgba(10, 12, 8, 0.2) 62%);
            box-shadow:
                inset 0 1px 1px rgba(255, 255, 255, 0.14),
                inset 0 -5px 10px rgba(0, 0, 0, 0.26),
                0 0 8px rgba(240, 198, 93, 0.1);
            pointer-events: none;
        }

        .html-battle-ui-button:hover:not(:disabled),
        .html-battle-pass-all:hover {
            border-color: rgba(255, 233, 154, 0.82);
            box-shadow:
                inset 0 1px 0 rgba(255, 248, 198, 0.32),
                inset 0 0 0 1px rgba(240, 198, 93, 0.26),
                inset 0 -12px 22px rgba(0, 0, 0, 0.3),
                0 0 14px var(--button-glow),
                0 5px 12px rgba(0, 0, 0, 0.55);
            filter: brightness(1.16) saturate(1.08);
            transform: translateY(-1px);
        }

        .html-battle-ui-button:disabled {
            opacity: 0.44;
            filter: saturate(0.38) brightness(0.72);
        }

        .html-battle-ui-button.is-danger {
            --button-accent: #ff8c62;
            --button-glow: rgba(255, 96, 56, 0.34);
            background-image:
                linear-gradient(180deg, rgba(255, 232, 188, 0.16), transparent 16px),
                radial-gradient(circle at 50% 18px, rgba(255, 216, 168, 0.22), transparent 30px),
                linear-gradient(180deg, rgba(101, 40, 25, 0.98), rgba(35, 12, 8, 0.98) 58%, rgba(10, 6, 4, 0.99));
        }

        #html-battle-normal-actions,
        #html-battle-action-actions {
            display: flex;
            width: 100%;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        #html-battle-normal-actions[hidden],
        #html-battle-action-actions[hidden],
        [data-battle-command][hidden] {
            display: none !important;
        }

        .html-battle-pass-all input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

        .html-battle-pass-all span {
            position: relative;
            z-index: 1;
        }

        [data-battle-command="resign"] {
            --battle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='black' d='M15 8h7v47h-7zM22 10h29l-7 11 8 11H22zm0 38h29v7H11v-7zM31 15v12h10l-4-6 4-6z'/%3E%3C/svg%3E");
        }

        [data-battle-command="pause"] {
            --button-accent: #cfe7ff;
            --button-glow: rgba(112, 181, 255, 0.32);
            --battle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='black' d='M15 10h13v44H15zm21 0h13v44H36zM20 15v34h3V15zm21 0v34h3V15z'/%3E%3C/svg%3E");
        }

        #html-battle-pass {
            --button-accent: #ffe08c;
            --button-glow: rgba(255, 221, 126, 0.36);
            --battle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='black' d='M16 7h32v10c0 7-5 12-10 15 5 3 10 8 10 15v10H16V47c0-7 5-12 10-15-5-3-10-8-10-15zm8 8v2c0 5 5 8 8 10 3-2 8-5 8-10v-2zm8 22c-3 2-8 5-8 10v2h16v-2c0-5-5-8-8-10zM12 4h40v6H12zm0 50h40v6H12z'/%3E%3C/svg%3E");
        }

        .html-battle-pass-all {
            --button-accent: #9ff2e6;
            --button-glow: rgba(117, 200, 185, 0.34);
            --battle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='black' d='M8 14l17 18L8 50V38l6-6-6-6zm19 0l17 18-17 18V38l6-6-6-6zm19 0l10 10v16L46 50V38l6-6-6-6z'/%3E%3C/svg%3E");
        }

        .html-battle-pass-all.is-checked {
            --button-accent: #d6fff8;
            border-color: rgba(154, 255, 239, 0.86);
            color: #ffffff;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.28),
                inset 0 0 18px rgba(117, 200, 185, 0.28),
                0 0 18px rgba(117, 200, 185, 0.38),
                0 4px 10px rgba(0, 0, 0, 0.55);
        }

        [data-battle-command="melee"] {
            --battle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='black' d='M13 9l19 19-5 5L8 14zm38 0l5 5-19 19-5-5zM29 36l-6 6 5 5-7 7-11-11 7-7 5 5 6-6zm6 0l6 6 5-5 7 7-11 11-7-7 5-5-6-6z'/%3E%3C/svg%3E");
        }

        [data-battle-command="shoot"] {
            --battle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='black' d='M50 8h7v26h-7V21L18 53l-7-7 32-32H30V8zM15 14l35 35-7 7-35-35z'/%3E%3C/svg%3E");
        }

        [data-battle-command="move"] {
            --battle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='black' d='M9 28h32V16l17 16-17 16V36H9zM12 11h15v7H12zm0 35h15v7H12z'/%3E%3C/svg%3E");
        }

        [data-battle-command="special"] {
            --battle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='black' d='M32 5l6 18 19 2-15 11 5 18-15-10-15 10 5-18L7 25l19-2zM32 18l-3 11-11 1 9 6-3 10 8-6 8 6-3-10 9-6-11-1z'/%3E%3C/svg%3E");
        }

        [data-battle-command="cancel"] {
            --battle-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='black' d='M18 10l14 14 14-14 8 8-14 14 14 14-8 8-14-14-14 14-8-8 14-14-14-14z'/%3E%3C/svg%3E");
        }

        .html-battle-top {
            position: fixed;
            left: 50%;
            top: 10px;
            z-index: 7;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            max-width: calc(100vw - 430px);
            padding: 0;
            translate: -50% 0;
            pointer-events: none;
            animation: tfw-battle-rise 220ms ease-out both;
        }

        .html-battle-last-action,
        .html-battle-flux {
            position: relative;
            overflow: hidden;
            border: 1px solid var(--battle-line);
            border-radius: 5px;
            background:
                linear-gradient(90deg, rgba(117, 200, 185, 0.12), rgba(240, 198, 93, 0.14) 52%, rgba(186, 73, 52, 0.1)),
                var(--battle-panel);
            box-shadow:
                inset 0 1px 0 rgba(255, 238, 166, 0.16),
                0 10px 24px rgba(0, 0, 0, 0.46);
            pointer-events: auto;
            backdrop-filter: blur(1px);
        }

        .html-battle-last-action[hidden] {
            display: none;
        }

        .html-battle-last-action::after,
        .html-battle-flux::after,
        .html-battle-log::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(105deg, transparent 0 34%, rgba(255, 236, 170, 0.18) 50%, transparent 66% 100%);
            opacity: 0.24;
            pointer-events: none;
            animation: tfw-battle-ember 5.6s ease-in-out infinite;
        }

        .html-battle-last-action {
            display: flex;
            align-items: center;
            gap: 7px;
            min-width: 0;
            max-width: min(370px, 31vw);
            min-height: 34px;
            box-sizing: border-box;
            padding: 3px 5px 3px 9px;
            color: #fff2bb;
            font-size: 11px;
            line-height: 13px;
            text-shadow: 0 1px 2px #000;
        }

        .html-battle-last-action-label {
            flex: 0 0 auto;
            color: rgba(117, 200, 185, 0.96);
            font-family: var(--tfw-font-title);
            font-size: 9px;
            font-weight: 800;
            letter-spacing: 0;
            text-transform: uppercase;
        }

        .html-battle-last-action-text {
            min-width: 0;
            overflow: hidden;
            font-weight: 800;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .html-battle-last-action-card {
            position: relative;
            z-index: 1;
            flex: 0 0 28px;
            width: 28px;
            height: 28px;
            object-fit: cover;
            border: 1px solid rgba(255, 238, 166, 0.46);
            border-radius: 3px;
            box-shadow: 0 2px 7px rgba(0, 0, 0, 0.5);
        }

        .html-battle-flux {
            display: flex;
            gap: 4px;
            min-height: 34px;
            max-width: min(430px, 42vw);
            padding: 4px 8px;
        }

        .html-battle-flux-well {
            width: 26px;
            height: 26px;
            filter: drop-shadow(0 1px 2px #000);
        }

        .html-battle-right {
            position: fixed;
            top: 54px;
            right: 14px;
            z-index: 6;
            display: block;
            width: var(--battle-chat-width);
            padding: 0;
            background: none;
            pointer-events: none;
            animation: none;
        }

        .html-battle-log {
            position: relative;
            display: grid;
            width: 100%;
            height: 296px;
            grid-template-rows: minmax(0, 1fr) 25px;
            min-height: 0;
            overflow: hidden;
            border: 1px solid var(--battle-line);
            border-radius: 6px;
            background:
                repeating-linear-gradient(0deg, rgba(240, 198, 93, 0.05) 0 1px, transparent 1px 13px),
                linear-gradient(180deg, rgba(9, 14, 10, 0.86), rgba(4, 6, 4, 0.66));
            box-shadow:
                inset 0 1px 0 rgba(255, 238, 166, 0.13),
                0 14px 32px rgba(0, 0, 0, 0.5);
            pointer-events: auto;
            backdrop-filter: blur(1.5px);
        }

        .html-battle-log-lines {
            grid-row: 1;
            min-height: 0;
            overflow: auto;
            padding: 7px 8px;
            color: #f4e9c7;
            font-size: 11px;
            line-height: 1.33;
            scrollbar-color: rgba(240, 198, 93, 0.75) rgba(6, 8, 5, 0.26);
            text-shadow: 0 1px 2px #000;
        }

        .html-battle-log-line {
            margin-bottom: 3px;
        }

        .html-battle-log-line.is-minor {
            color: rgba(219, 210, 183, 0.72);
        }

        .html-battle-log-line.is-chat {
            color: var(--battle-gold-hot);
        }

        .html-battle-chat-input {
            grid-row: 2;
            width: 100%;
            height: 25px;
            box-sizing: border-box;
            padding: 3px 8px;
            border: 0;
            border-top: 1px solid rgba(240, 198, 93, 0.24);
            background:
                linear-gradient(90deg, rgba(117, 200, 185, 0.1), rgba(240, 198, 93, 0.08)),
                rgba(0, 0, 0, 0.42);
            color: #fff1bc;
            font: 12px "TFW DejaVu Sans", var(--tfw-font-ui);
            outline: none;
            text-shadow: 0 1px 1px #000;
            cursor: text !important;
        }

        .html-battle-chat-input:focus {
            box-shadow: inset 0 0 0 1px rgba(117, 200, 185, 0.56);
        }

        .html-battle-big-card {
            position: fixed;
            right: 14px;
            bottom: 14px;
            z-index: 7;
            width: 408px;
            height: 300px;
            margin: 0;
            transform: scale(var(--battle-card-scale));
            transform-origin: bottom right;
            box-shadow:
                0 1px 0 rgba(255, 238, 166, 0.2),
                0 18px 42px rgba(0, 0, 0, 0.62),
                0 0 0 1px rgba(240, 198, 93, 0.18);
            pointer-events: auto;
            animation: none;
        }

        .html-battle-bottom {
            position: fixed;
            left: 8px;
            right: var(--battle-card-space);
            bottom: 14px;
            z-index: 6;
            display: grid;
            height: 88px;
            grid-template-columns: auto minmax(160px, 1fr);
            gap: 7px;
            align-items: end;
            min-width: 0;
            padding: 0;
            background: none;
            pointer-events: none;
            animation: tfw-battle-rise 260ms ease-out 80ms both;
        }

        .html-battle-players {
            display: flex;
            gap: 4px;
            min-width: 0;
            max-width: min(318px, 31vw);
            overflow: hidden;
            pointer-events: auto;
        }

        .html-battle-player {
            position: relative;
            display: grid;
            width: 154px;
            height: 88px;
            flex: 0 0 154px;
            grid-template-columns: 48px 72px 24px;
            grid-template-rows: 59px 23px;
            box-sizing: border-box;
            overflow: hidden;
            border: 1px solid rgba(240, 198, 93, 0.3);
            border-radius: 5px;
            background:
                linear-gradient(135deg, var(--player-color, #366370), rgba(10, 12, 9, 0.84) 62%),
                repeating-linear-gradient(125deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 9px);
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.15),
                inset 0 -12px 24px rgba(0, 0, 0, 0.22),
                0 12px 24px rgba(0, 0, 0, 0.42);
        }

        .html-battle-player.is-turn {
            border-color: rgba(255, 233, 154, 0.78);
            box-shadow:
                inset 0 0 0 2px rgba(255, 233, 154, 0.42),
                0 0 18px rgba(255, 233, 154, 0.24),
                0 12px 24px rgba(0, 0, 0, 0.42);
        }

        .html-battle-player-name {
            grid-column: 1 / 3;
            grid-row: 1;
            align-self: start;
            padding: 3px 5px;
            overflow: hidden;
            color: #fff7cf;
            font-size: 11px;
            font-weight: 900;
            text-overflow: ellipsis;
            text-shadow: 0 1px 2px #000;
            white-space: nowrap;
        }

        .html-battle-player-avatar {
            grid-column: 1;
            grid-row: 1;
            align-self: end;
            justify-self: center;
            width: 42px;
            height: 42px;
            margin-bottom: 3px;
            overflow: hidden;
            border: 1px solid rgba(255, 238, 166, 0.38);
            border-radius: 3px;
            background: #111 center / cover no-repeat;
            box-shadow:
                0 0 0 1px rgba(0, 0, 0, 0.5),
	                0 3px 8px rgba(0, 0, 0, 0.38);
	        }

	        .html-battle-player-avatar img {
	            display: block;
	            width: 100%;
	            height: 100%;
	            object-fit: cover;
	        }

        .html-battle-player-action {
            grid-column: 2;
            grid-row: 1;
            display: flex;
            min-width: 0;
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            gap: 2px;
            padding: 17px 2px 5px;
            color: #f8ead0;
            font-size: 10px;
            font-weight: 900;
            text-align: center;
            text-shadow: 0 1px 2px #000;
        }

        .html-battle-player-action-main {
            max-width: 67px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .html-battle-player-time {
            min-width: 44px;
            padding: 1px 4px;
            border: 1px solid rgba(240, 198, 93, 0.24);
            border-radius: 3px;
            background: rgba(0, 0, 0, 0.36);
            color: var(--battle-gold-hot);
            font-size: 10px;
            line-height: 13px;
        }

        .html-battle-player-passed {
            width: 58px;
            height: 29px;
        }

        .html-battle-player-stats {
            grid-column: 3;
            grid-row: 1;
            display: grid;
            grid-template-rows: 34px 25px;
            justify-items: center;
            align-items: center;
            font-size: 11px;
            font-weight: 900;
        }

        .html-battle-player-cards {
            width: 22px;
            height: 22px;
            padding-top: 2px;
        }

        .html-battle-player-bottom {
            grid-column: 1 / 4;
            grid-row: 2;
            display: flex;
            align-items: center;
            gap: 4px;
            min-width: 0;
            padding: 0 5px 3px;
            background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
            color: #fff1bd;
            font-size: 10px;
        }

        .html-battle-hand-wrap {
            display: grid;
            height: 88px;
            min-width: 0;
            grid-template-columns: minmax(0, 1fr);
            align-items: center;
            overflow: hidden;
            border: 1px solid var(--battle-line-soft);
            border-radius: 5px;
            background:
                linear-gradient(90deg, rgba(117, 200, 185, 0.08), rgba(240, 198, 93, 0.09) 46%, rgba(186, 73, 52, 0.06)),
                linear-gradient(180deg, rgba(9, 14, 10, 0.78), rgba(4, 5, 4, 0.56));
            box-shadow:
                inset 0 1px 0 rgba(255, 238, 166, 0.13),
                0 12px 28px rgba(0, 0, 0, 0.44);
            pointer-events: auto;
            backdrop-filter: blur(1px);
        }

        .html-battle-hand-wrap.has-scroll {
            grid-template-columns: minmax(0, 1fr) 22px;
        }

        .html-battle-hand {
            display: flex;
            height: 88px;
            min-width: 0;
            box-sizing: border-box;
            align-items: center;
            gap: 0;
            overflow-x: hidden;
            overflow-y: hidden;
            padding: 7px 4px 7px 8px;
            overscroll-behavior-x: none;
            scrollbar-width: none;
        }

        .html-battle-hand::-webkit-scrollbar {
            display: none;
        }

        .html-battle-hand-card {
            position: relative;
            width: 72px;
            height: 72px;
            flex: 0 0 56px;
            margin-right: -12px;
            padding: 0;
            border: 0;
            background: transparent;
            opacity: 0.98;
            transition: filter 120ms ease, transform 120ms ease;
        }

        .html-battle-hand-card:last-child {
            margin-right: 0;
        }

        .html-battle-hand-card:hover {
            z-index: 5;
            filter: drop-shadow(0 0 10px rgba(255, 233, 154, 0.58));
            transform: translateY(-3px);
        }

        .html-battle-hand-card .html-small-card,
        .html-battle-hand-card .html-small-card:hover {
            transform: none;
        }

        .html-battle-hand-card .html-small-card {
            pointer-events: none;
        }

        .html-battle-hand-card.is-invalid {
            opacity: 0.38;
            filter: saturate(0.35);
        }

        .html-battle-hand-scroll {
            display: none;
            flex-direction: column;
            gap: 6px;
            align-items: center;
            padding-right: 3px;
        }

        .html-battle-hand-wrap.has-scroll .html-battle-hand-scroll {
            display: flex;
        }

        .html-battle-hand-scroll button {
            width: 18px;
            height: 29px;
            border: 1px solid rgba(240, 198, 93, 0.34);
            border-radius: 3px;
            background:
                linear-gradient(180deg, rgba(255, 233, 154, 0.9), rgba(104, 70, 29, 0.92));
            color: #140d06;
            font-size: 12px;
            font-weight: 900;
            text-shadow: 0 1px 0 rgba(255, 238, 166, 0.5);
        }

        .html-battle-enchants {
            position: fixed;
            left: 8px;
            top: 6px;
            right: auto;
            bottom: auto;
            z-index: 8;
            display: none;
            width: auto;
            max-width: min(420px, calc(100vw - var(--battle-card-space) - 130px));
            max-height: 76px;
            box-sizing: border-box;
            padding: 4px 7px;
            transform: none;
            overflow-x: auto;
            overflow-y: hidden;
            border: 1px solid rgba(240, 198, 93, 0.28);
            border-radius: 5px;
            background:
                linear-gradient(90deg, rgba(20, 24, 16, 0.64), rgba(8, 9, 6, 0.46));
            box-shadow: 0 14px 26px rgba(0, 0, 0, 0.42);
            pointer-events: auto;
            scrollbar-width: thin;
            backdrop-filter: blur(1px);
        }

        .html-battle-enchants.is-visible {
            display: flex;
            flex-direction: row;
            gap: 5px;
        }

        .html-battle-enchant-card {
            flex: 0 0 72px;
            margin-right: 0;
            opacity: 0.98;
            filter: none;
        }

        .html-battle-enchant-card.is-invalid,
        .html-battle-enchant-card .html-small-card.is-invalid {
            opacity: 0.98;
            filter: none;
        }

        .html-battle-tutorial-layer {
            position: fixed;
            inset: 0;
            z-index: 16;
            pointer-events: none;
        }

        .html-battle-tutorial-highlight {
            position: absolute;
            box-sizing: border-box;
            border: 2px solid rgba(255, 245, 190, 0.88);
            border-radius: 8px;
            background: rgba(255, 238, 166, 0.08);
            box-shadow:
                0 0 0 9999px rgba(0, 0, 0, 0.12),
                0 0 18px rgba(255, 233, 154, 0.52),
                inset 0 0 12px rgba(255, 233, 154, 0.24);
            pointer-events: none;
        }

        .html-battle-tutorial-line {
            position: absolute;
            height: 5px;
            border-radius: 999px;
            background:
                linear-gradient(90deg, rgba(255, 245, 190, 0.92), rgba(117, 200, 185, 0.86));
            box-shadow: 0 0 10px rgba(255, 233, 154, 0.48);
            transform-origin: 0 50%;
            pointer-events: none;
        }

        .html-battle-tutorial-popup,
        .html-battle-dialog {
            position: absolute;
            box-sizing: border-box;
            border: 1px solid rgba(255, 238, 166, 0.54);
            border-radius: 6px;
            background:
                radial-gradient(circle at 50% 0, rgba(255, 238, 166, 0.12), transparent 44%),
                repeating-linear-gradient(135deg, rgba(255, 238, 166, 0.04) 0 1px, transparent 1px 9px),
                linear-gradient(180deg, rgba(47, 41, 23, 0.97), rgba(12, 13, 9, 0.97));
            color: #fff0bf;
            box-shadow:
                inset 0 1px 0 rgba(255, 245, 190, 0.2),
                0 18px 42px rgba(0, 0, 0, 0.62);
            pointer-events: auto;
        }

        .html-battle-tutorial-popup {
            min-height: 108px;
            padding: 12px 14px 10px;
            cursor: pointer;
        }

        .html-battle-tutorial-title,
        .html-battle-dialog-title {
            margin-bottom: 8px;
            color: var(--battle-gold-hot);
            font-family: var(--tfw-font-title);
            font-size: 15px;
            font-weight: 900;
            text-shadow: 0 1px 2px #000;
        }

        .html-battle-tutorial-copy,
        .html-battle-dialog-copy {
            color: #fff5d0;
            font-size: 13px;
            font-weight: 750;
            line-height: 1.35;
            text-shadow: 0 1px 2px #000;
        }

        .html-battle-tutorial-copy .html-rich-card,
        .html-battle-dialog-copy .html-rich-card {
            color: #ffe99a;
        }

        .html-battle-tutorial-hint {
            margin-top: 11px;
            color: rgba(117, 200, 185, 0.94);
            font-size: 11px;
            font-weight: 900;
            text-align: right;
        }

        .html-battle-dialog-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.24);
            pointer-events: auto;
        }

        .html-battle-dialog {
            left: 50%;
            top: 50%;
            width: min(460px, calc(100vw - 28px));
            padding: 15px;
            transform: translate(-50%, -50%);
        }

        .html-battle-dialog-actions {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 16px;
        }

        .html-battle-dialog-actions .html-battle-ui-button {
            width: auto;
            min-width: 104px;
            min-height: 34px;
            padding: 7px 12px;
        }

        .html-battle-dialog-actions .html-battle-ui-button::before,
        .html-battle-dialog-actions .html-battle-ui-button::after {
            display: none;
        }

	        .html-battle-big-text {
	            top: 21%;
	            min-width: 178px;
            padding: 9px 18px;
            border: 1px solid rgba(255, 233, 154, 0.72);
            border-radius: 4px;
            background:
                linear-gradient(90deg, rgba(117, 200, 185, 0.1), rgba(240, 198, 93, 0.14), rgba(186, 73, 52, 0.09)),
                rgba(7, 9, 6, 0.72);
            box-shadow: 0 18px 40px rgba(0, 0, 0, 0.48);
            color: var(--battle-gold-hot);
	            font-family: var(--tfw-font-title);
	            font-size: 25px;
	        }

	        .html-battle-hex-text {
	            position: fixed;
	            z-index: 8;
	            min-width: 72px;
	            padding: 5px 10px;
	            transform: translate(-50%, -118%);
	            border: 1px solid rgba(255, 233, 154, 0.7);
	            border-radius: 4px;
	            background:
	                linear-gradient(90deg, rgba(22, 27, 17, 0.9), rgba(6, 8, 5, 0.76)),
	                rgba(8, 8, 5, 0.82);
	            box-shadow: 0 10px 22px rgba(0, 0, 0, 0.42);
	            color: #fff5d2;
	            font-family: var(--tfw-font-title);
	            font-size: 18px;
	            font-weight: 800;
	            letter-spacing: 0;
	            pointer-events: none;
	            text-align: center;
	            text-shadow: 0 2px 4px #000;
	            animation: tfw-battle-hex-text 1.75s ease-out forwards;
	        }

	        @keyframes tfw-battle-hex-text {
	            0% { opacity: 0; transform: translate(-50%, -92%) scale(0.96); }
	            14% { opacity: 1; transform: translate(-50%, -118%) scale(1); }
	            74% { opacity: 1; transform: translate(-50%, -126%) scale(1); }
	            100% { opacity: 0; transform: translate(-50%, -152%) scale(1.02); }
	        }

	        .html-battle-popup {
            width: min(454px, calc(100vw - 28px));
            overflow: hidden;
            border: 1px solid var(--battle-line);
            border-radius: 5px;
            background:
                radial-gradient(circle at 18% 0, rgba(117, 200, 185, 0.14), transparent 38%),
                repeating-linear-gradient(135deg, rgba(255, 238, 166, 0.04) 0 1px, transparent 1px 10px),
                linear-gradient(135deg, rgba(26, 31, 21, 0.98), rgba(52, 33, 15, 0.96));
            box-shadow:
                inset 0 1px 0 rgba(255, 238, 166, 0.15),
                0 22px 56px rgba(0, 0, 0, 0.68);
            color: #f8e7b4;
        }

        .html-battle-popup-title {
            padding: 10px 13px;
            border-bottom: 1px solid rgba(240, 198, 93, 0.16);
            background:
                linear-gradient(90deg, rgba(117, 200, 185, 0.14), rgba(240, 198, 93, 0.12), rgba(186, 73, 52, 0.1));
            color: var(--battle-gold-hot);
            font-family: var(--tfw-font-title);
            font-size: 15px;
            font-weight: 700;
            text-shadow: 0 1px 2px #000;
        }

        .html-battle-popup-body {
            gap: 7px;
            padding: 10px;
        }

        .html-battle-popup-actions {
            padding: 9px 10px;
            border-top: 1px solid rgba(240, 198, 93, 0.16);
        }

        .html-battle-popup.is-no-footer .html-battle-popup-actions {
            display: none;
        }

        .html-battle-popup .html-battle-ui-button {
            width: auto;
            min-width: 118px;
            min-height: 34px;
            justify-content: center;
            padding: 8px 13px;
            border-radius: 4px;
            font-size: 12px;
            line-height: 14px;
            text-transform: none;
        }

        .html-battle-popup .html-battle-ui-button::before,
        .html-battle-popup .html-battle-ui-button::after {
            display: none;
        }

        .html-battle-popup.is-option-selector .html-battle-popup-body {
            align-items: stretch;
            justify-content: center;
        }

        @keyframes tfw-battle-hand-ready {
            0%, 100% {
                box-shadow:
                    inset 0 0 0 2px rgba(96, 164, 255, 0.66),
                    inset 0 0 30px rgba(39, 96, 255, 0.24),
                    inset 0 1px 0 rgba(255, 238, 166, 0.18),
                    0 0 34px rgba(31, 92, 255, 0.68),
                    0 -10px 38px rgba(91, 176, 255, 0.32),
                    0 14px 30px rgba(0, 0, 0, 0.48);
            }
            50% {
                box-shadow:
                    inset 0 0 0 2px rgba(176, 222, 255, 0.92),
                    inset 0 0 48px rgba(44, 105, 255, 0.38),
                    inset 0 1px 0 rgba(255, 238, 166, 0.26),
                    0 0 64px rgba(28, 97, 255, 0.94),
                    0 -14px 54px rgba(91, 206, 255, 0.48),
                    0 14px 30px rgba(0, 0, 0, 0.48);
            }
        }

        @keyframes tfw-battle-well-pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.12); }
        }

        .html-battle-side {
            left: 10px;
            top: auto;
            bottom: 112px;
            width: 74px;
            max-height: calc(100vh - 220px);
            padding: 7px 5px;
            transform: none;
        }

        .html-battle-side-spacer {
            display: none;
        }

        #html-battle-action-actions {
            width: auto;
            gap: 6px;
        }

        #html-battle-normal-actions {
            display: flex;
            width: auto;
            flex: 0 0 auto;
            flex-direction: row;
            align-items: center;
            justify-content: flex-end;
            gap: 3px;
            padding: 0 4px 0 3px;
        }

        #html-battle-normal-actions[hidden] {
            display: none !important;
        }

        .html-battle-hand-actions .html-battle-ui-button,
        .html-battle-hand-actions.html-battle-pass-all,
        .html-battle-hand-actions .html-battle-pass-all {
            box-sizing: border-box;
            width: 50px;
            height: auto;
            min-height: 50px;
            padding: 32px 2px 4px;
            border-radius: 3px;
            font-size: 8px;
            line-height: 9px;
        }

        .html-battle-hand-actions #html-battle-pass {
            width: 50px;
            height: auto;
            min-height: 50px;
            padding: 32px 2px 4px;
        }

        .html-battle-hand-actions .html-battle-ui-button::before,
        .html-battle-hand-actions .html-battle-pass-all::before {
            top: 6px;
            width: 27px;
            height: 27px;
        }

        .html-battle-hand-actions .html-battle-ui-button::after,
        .html-battle-hand-actions .html-battle-pass-all::after {
            top: 6px;
            left: 50%;
            width: 31px;
            height: 27px;
            transform: translateX(-50%);
        }

        .html-battle-system-actions {
            top: 7px;
            right: 12px;
        }

        .html-battle-system-actions .html-battle-ui-button {
            width: 54px;
            min-height: 44px;
            padding-top: 28px;
        }

        .html-battle-top {
            top: 7px;
            gap: 12px;
            max-width: calc(100vw - 210px);
            align-items: flex-start;
            transform: translateX(-50%);
        }

        .html-battle-last-action {
            max-width: min(360px, 34vw);
            min-height: 38px;
            padding: 3px 4px;
            border: 0;
            background: transparent;
            box-shadow: none;
            color: #fff6d0;
            font-size: 16px;
            line-height: 38px;
        }

        .html-battle-last-action::after {
            display: none;
        }

        .html-battle-last-action-label {
            display: none;
        }

        .html-battle-last-action-text {
            font-weight: 900;
        }

        .html-battle-last-action-card {
            flex-basis: 50px;
            width: 50px;
            height: 50px;
            border-color: #1efcff;
            box-shadow:
                0 0 0 1px rgba(0, 0, 0, 0.76),
                0 0 12px rgba(30, 252, 255, 0.42);
        }

        .html-battle-flux {
            align-items: center;
            gap: 12px;
            min-width: 292px;
            min-height: 48px;
            max-width: none;
            justify-content: center;
            padding: 4px 16px;
            overflow: visible;
            border: 1px solid rgba(250, 219, 126, 0.4);
            border-radius: 999px;
            background:
                linear-gradient(90deg, rgba(60, 135, 255, 0.2), transparent 18% 82%, rgba(255, 64, 48, 0.2)),
                radial-gradient(ellipse at 50% 0, rgba(255, 248, 186, 0.18), transparent 54%),
                linear-gradient(180deg, rgba(25, 31, 25, 0.92), rgba(5, 7, 5, 0.92));
            box-shadow:
                inset 0 1px 0 rgba(255, 246, 181, 0.26),
                inset 0 -14px 28px rgba(0, 0, 0, 0.38),
                0 8px 20px rgba(0, 0, 0, 0.42);
        }

        .html-battle-flux::after {
            display: block;
            inset: 5px 12px;
            border-radius: 999px;
            background:
                linear-gradient(90deg, transparent, rgba(255, 239, 160, 0.18) 50%, transparent),
                repeating-linear-gradient(90deg, transparent 0 13px, rgba(255, 232, 142, 0.08) 14px 15px);
            opacity: 0.42;
            animation: tfw-battle-ember 5.6s ease-in-out infinite;
        }

        .html-battle-flux-wells {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-width: 134px;
            padding: 0 4px;
            z-index: 1;
        }

        .html-battle-flux-well {
            position: relative;
            width: 19px;
            height: 19px;
            border-radius: 999px;
            background:
                radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), transparent 0 20%, rgba(255, 255, 255, 0.18) 21% 32%, transparent 34%),
                radial-gradient(circle at 50% 58%, var(--well-color, #d9d9d9), var(--well-core, #9b9b9b) 63%, #141414 100%);
            box-shadow:
                inset 0 -2px 4px rgba(0, 0, 0, 0.48),
                0 0 0 1px rgba(0, 0, 0, 0.72),
                0 0 14px var(--well-glow, rgba(255, 255, 255, 0.18)),
                0 0 28px var(--well-soft-glow, rgba(255, 255, 255, 0));
            filter: none;
        }

        .html-battle-flux-well::after {
            display: none;
        }

        .html-battle-flux-well.is-blue {
            --well-color: #35a7ff;
            --well-core: #043dff;
            --well-glow: rgba(25, 102, 255, 0.98);
            --well-soft-glow: rgba(35, 183, 255, 0.52);
            animation: tfw-battle-well-pulse 2.3s ease-in-out infinite;
        }

        .html-battle-flux-well.is-red {
            --well-color: #ff5b36;
            --well-core: #f00000;
            --well-glow: rgba(255, 28, 20, 1);
            --well-soft-glow: rgba(255, 62, 29, 0.55);
            animation: tfw-battle-well-pulse 2.3s ease-in-out infinite;
        }

        .html-battle-flux-well.is-open {
            opacity: 0.88;
        }

        .html-battle-top-glory {
            position: relative;
            display: grid;
            width: 44px;
            height: 44px;
            place-items: center;
            box-sizing: border-box;
            border: 1px solid rgba(255, 244, 180, 0.48);
            border-radius: 999px;
            background:
                radial-gradient(circle at 34% 25%, rgba(255, 255, 255, 0.86), transparent 0 14%, rgba(255, 255, 255, 0.16) 15% 27%, transparent 29%),
                radial-gradient(circle at 50% 55%, rgba(255, 253, 199, 0.95), rgba(237, 196, 72, 0.86) 44%, rgba(101, 67, 21, 0.92) 78%, rgba(18, 16, 10, 0.96));
            color: var(--glory-color, #1d44ff);
            font: 900 13px/1 "TFW DejaVu Sans", var(--tfw-font-ui);
            text-shadow: 0 1px 0 #fff, 0 0 6px rgba(255, 255, 255, 0.56);
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.42),
                inset 0 -5px 9px rgba(0, 0, 0, 0.22),
                0 2px 3px rgba(0, 0, 0, 0.84),
                0 0 12px var(--glory-glow, rgba(255, 255, 255, 0.08));
            z-index: 1;
        }

        .html-battle-top-glory::before,
        .html-battle-top-glory::after {
            content: "";
            position: absolute;
            top: 9px;
            bottom: 5px;
            width: 10px;
            border: 2px solid rgba(255, 238, 146, 0.7);
            pointer-events: none;
        }

        .html-battle-top-glory::before {
            left: -6px;
            border-right: 0;
            border-radius: 100% 0 0 100%;
            transform: rotate(-14deg);
        }

        .html-battle-top-glory::after {
            right: -6px;
            border-left: 0;
            border-radius: 0 100% 100% 0;
            transform: rotate(14deg);
        }

        .html-battle-top-glory.is-blue-side {
            --glory-color: #1742ff;
            --glory-glow: rgba(51, 128, 255, 0.5);
        }

        .html-battle-top-glory.is-red-side {
            --glory-color: #e80000;
            --glory-glow: rgba(255, 52, 36, 0.48);
        }

        .html-battle-right {
            top: 56px;
            right: 26px;
            width: 302px;
        }

        .html-battle-log {
            height: min(382px, calc(100vh - 382px));
            min-height: 236px;
        }

        .html-battle-big-card {
            right: 26px;
            bottom: 8px;
        }

        .html-battle-bottom {
            left: 0;
            right: calc(var(--battle-card-space) + 8px);
            bottom: 0;
            height: 98px;
            grid-template-columns: auto minmax(190px, 1fr);
            gap: 4px;
            align-items: stretch;
        }

        .html-battle-players {
            max-width: none;
            gap: 0;
            align-items: stretch;
        }

        .html-battle-player {
            width: 154px;
            height: 98px;
            flex-basis: 154px;
            grid-template-columns: 54px minmax(0, 1fr) 28px;
            grid-template-rows: 21px 42px 35px;
            border-radius: 2px;
            border-color: rgba(0, 0, 0, 0.82);
            background:
                linear-gradient(180deg, var(--player-side, #1573ff), var(--player-side-dark, #061d52) 21px, rgba(7, 8, 5, 0.96) 22px),
                linear-gradient(135deg, var(--player-color, #366370), rgba(10, 12, 9, 0.84));
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.18),
                inset 0 -18px 30px rgba(0, 0, 0, 0.34),
                0 12px 24px rgba(0, 0, 0, 0.42);
        }

        .html-battle-player.is-blue-side {
            --player-side: #147dff;
            --player-side-dark: #052c7a;
        }

        .html-battle-player.is-red-side {
            --player-side: #ff4b54;
            --player-side-dark: #7d0713;
        }

        .html-battle-player-name {
            grid-column: 1 / 4;
            grid-row: 1;
            align-self: center;
            min-width: 0;
            padding: 2px 7px 0;
            color: var(--player-name-color, #fefefe);
            font-size: 11px;
            line-height: 15px;
            overflow: hidden;
            text-align: center;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .html-battle-player.is-blue-side .html-battle-player-name {
            --player-name-color: #ffffff;
        }

        .html-battle-player.is-red-side .html-battle-player-name {
            --player-name-color: #ffe8e8;
        }

        .html-battle-player-avatar {
            grid-column: 1;
            grid-row: 2;
            align-self: start;
            width: 42px;
            height: 42px;
            margin: 2px 0 0 6px;
            border-color: rgba(255, 255, 255, 0.75);
        }

        .html-battle-player-action {
            grid-column: 1;
            grid-row: 3;
            align-self: center;
            justify-self: center;
            padding: 0;
            gap: 2px;
        }

        .html-battle-player-action-main {
            display: none;
        }

        .html-battle-player-total-time {
            grid-column: 2;
            grid-row: 2;
            align-self: center;
            justify-self: start;
            min-width: 48px;
            margin: 9px 0 0 2px;
            padding: 0 4px;
            border: 1px solid rgba(255, 238, 166, 0.28);
            border-radius: 2px;
            background: rgba(0, 0, 0, 0.58);
            color: #f7efc8;
            font-size: 9px;
            font-weight: 900;
            line-height: 13px;
            text-align: center;
            text-shadow: 0 1px 2px #000;
        }

        .html-battle-player-timers {
            display: grid;
            width: 48px;
            gap: 1px;
        }

        .html-battle-player-time {
            min-width: 0;
            padding: 0 2px;
            border-color: rgba(255, 238, 166, 0.34);
            border-radius: 2px;
            background: rgba(0, 0, 0, 0.68);
            font-size: 9px;
            line-height: 12px;
            text-align: center;
        }

        .html-battle-player-time.is-move {
            color: #ffe99a;
        }

        .html-battle-player-time.is-danger {
            color: #ffdfd5;
            border-color: rgba(255, 54, 54, 0.78);
            background: rgba(86, 0, 0, 0.72);
        }

        .html-battle-player-stats {
            grid-column: 3;
            grid-row: 2;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 10px 4px 0 0;
        }

        .html-battle-player-cards {
            position: relative;
            display: grid;
            place-items: center;
            justify-self: center;
            padding: 0;
            color: #fff7dc;
            text-shadow: 0 1px 2px #000;
        }

        .html-battle-player-cards {
            width: 24px;
            height: 22px;
            border: 1px solid rgba(255, 238, 166, 0.46);
            border-radius: 3px;
            background:
                linear-gradient(135deg, transparent 0 72%, rgba(0, 0, 0, 0.18) 73%),
                linear-gradient(180deg, rgba(245, 238, 211, 0.96), rgba(157, 169, 174, 0.94));
            color: #091016;
            font-weight: 900;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
            box-shadow:
                inset 2px 0 0 rgba(255, 255, 255, 0.48),
                inset -2px -2px 0 rgba(36, 42, 45, 0.22),
                0 1px 2px rgba(0, 0, 0, 0.7);
        }

        .html-battle-player-bottom {
            grid-column: 2 / 4;
            grid-row: 3;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 3px;
            min-width: 0;
            padding: 2px 4px 4px 0;
            background: none;
            overflow: visible;
        }

        .html-battle-player-flux {
            position: relative;
            display: grid;
            flex: 0 0 20px;
            width: 20px;
            height: 20px;
            min-width: 20px;
            place-items: center;
            padding: 0;
            background: none;
            color: #000;
            font-family: "TFW DejaVu Sans", "DejaVu Sans", sans-serif;
            font-size: 13px;
            font-weight: 700;
            line-height: 19px;
            text-align: center;
            text-shadow: none;
        }

        .html-battle-player-flux img {
            position: absolute;
            inset: 0;
            width: 20px;
            height: 20px;
        }

        .html-battle-player-flux span {
            position: relative;
            z-index: 1;
        }

        .html-battle-player-domains {
            display: flex;
            flex: 0 1 auto;
            min-width: 0;
            max-width: none;
            overflow: visible;
            justify-content: flex-end;
        }

        .html-battle-player-domains img {
            flex: 0 0 auto;
            width: 16px;
            height: 16px;
            margin-left: -3px;
            filter:
                drop-shadow(0 1px 1px rgba(0, 0, 0, 0.9))
                drop-shadow(0 0 4px rgba(255, 238, 166, 0.16));
        }

        .html-battle-hand-wrap {
            height: 98px;
            box-sizing: border-box;
            grid-template-columns: minmax(0, 1fr);
            border-radius: 0;
            background:
                linear-gradient(90deg, rgba(23, 38, 40, 0.74), rgba(56, 45, 25, 0.68) 48%, rgba(52, 18, 16, 0.62)),
                linear-gradient(180deg, rgba(10, 12, 8, 0.88), rgba(4, 5, 4, 0.66));
        }

        .html-battle-hand-wrap.has-turn-actions {
            grid-template-columns: minmax(0, 1fr) auto;
        }

        .html-battle-hand-wrap.has-turn-actions.has-scroll {
            grid-template-columns: minmax(0, 1fr) auto 22px;
        }

        .html-battle-hand-wrap.is-your-turn {
            border-color: rgba(142, 204, 255, 0.92);
            animation: tfw-battle-hand-ready 2.2s ease-in-out infinite;
        }

        .html-battle-hand {
            height: 98px;
            padding: 9px 4px 7px 9px;
        }

        .html-battle-hand-card {
            width: 78px;
            height: 78px;
            flex-basis: 58px;
            margin-right: -14px;
        }

        .html-battle-hand-scroll {
            order: 3;
            padding-right: 4px;
        }

        @media (max-width: 1280px) {
            :root {
                --battle-card-scale: 0.86;
                --battle-card-space: 366px;
                --battle-chat-width: 270px;
            }

            .html-battle-top {
                max-width: calc(100vw - 380px);
            }
        }

        @media (max-width: 980px) {
            :root {
                --battle-card-scale: 0.68;
                --battle-card-space: 294px;
                --battle-chat-width: 232px;
            }

            .html-battle-side {
                left: 6px;
                width: 76px;
                padding-inline: 5px;
            }

            .html-battle-system-actions {
                top: 8px;
                right: 8px;
                gap: 4px;
            }

            .html-battle-system-actions .html-battle-ui-button {
                width: 44px;
                min-height: 38px;
                padding-top: 24px;
                font-size: 7px;
            }

            .html-battle-ui-button,
            .html-battle-pass-all {
                width: 64px;
            }

            .html-battle-top {
                max-width: calc(100vw - 92px);
            }

            .html-battle-last-action {
                max-width: 38vw;
            }

            .html-battle-flux {
                max-width: 42vw;
                overflow: hidden;
            }

            .html-battle-right {
                right: 8px;
                top: 50px;
            }

            .html-battle-log {
                height: 252px;
            }

            .html-battle-big-card {
                right: 8px;
                bottom: 8px;
            }

            .html-battle-bottom {
                left: 6px;
                right: var(--battle-card-space);
                bottom: 8px;
                height: 88px;
                grid-template-columns: 1fr;
            }

            .html-battle-players {
                display: none;
            }

            .html-battle-enchants {
                top: 6px;
                left: 6px;
                right: auto;
                bottom: auto;
                max-width: calc(100vw - 104px);
                max-height: 76px;
            }
        }

        @media (max-width: 760px) {
            :root {
                --battle-card-scale: 0.55;
                --battle-card-space: 242px;
                --battle-chat-width: 210px;
            }

            .html-battle-last-action {
                max-width: 32vw;
                padding-inline: 6px 4px;
            }

            .html-battle-last-action-label {
                display: none;
            }

            .html-battle-flux-well {
                width: 23px;
                height: 23px;
            }

            .html-battle-log {
                height: 232px;
            }

            .html-battle-log-lines {
                font-size: 10px;
            }

            .html-battle-hand-card {
                flex-basis: 50px;
                margin-right: -16px;
            }

            .html-battle-enchants {
                width: auto;
                max-width: calc(100vw - 94px);
                padding-inline: 5px;
            }
        }
