/* The game screen in the layout of the classic clients (0.13): the game window and the console on the
   left, the side panel on the right with the minimap, health and mana, the equipment with the fight
   modes, the buttons and a column of small windows (skills, battle list, VIP, party, the bags).
   Grey bevelled panels and small sharp text; everything drawn here, no pictures of another game. */
:root {
  --c-frame: #2a2826;
  --c-frame-hi: #57534d;
  --c-frame-lo: #0e0d0c;
  --c-panel: #36332f;
  --c-panel-2: #24221f;
  --c-head: #1b1917;
  --c-text: #d8d2c4;
  --c-dim: #9a9284;
  --c-yellow: #f2e55a;
  --c-white: #f4f4f4;
  --c-green: #4fdc4f;
  --c-red: #f05040;
  --c-blue: #8fc6ff;
  --c-orange: #f5a03a;
  --side-w: 200px;
  --console-h: 170px;
  --ui: Verdana, Tahoma, "Segoe UI", sans-serif;
}
body.in-game { padding: 0; overflow: hidden; background: var(--c-frame); }
.game.classic { max-width: none; margin: 0; display: block; gap: 0; height: 100vh; height: 100dvh; font-family: var(--ui); font-size: 11px; color: var(--c-text); }
.game.classic button { font-family: var(--ui); font-size: 11px; min-height: 0; padding: 3px 6px; color: var(--c-text); background: linear-gradient(#4a4640, #34312d); border: 1px solid; border-color: var(--c-frame-hi) var(--c-frame-lo) var(--c-frame-lo) var(--c-frame-hi); }
.game.classic button:hover:not(:disabled) { background: linear-gradient(#58534b, #3d3934); }
.game.classic button:active, .game.classic button[aria-pressed="true"] { border-color: var(--c-frame-lo) var(--c-frame-hi) var(--c-frame-hi) var(--c-frame-lo); background: #2a2724; color: #fff; }
.game.classic button.primary { color: #fff; background: linear-gradient(#6b4a2c, #4c331f); }
.game.classic input, .game.classic select, .game.classic textarea { font-family: var(--ui); font-size: 11px; padding: 3px 5px; background: #141210; color: var(--c-text); border: 1px solid; border-color: var(--c-frame-lo) var(--c-frame-hi) var(--c-frame-hi) var(--c-frame-lo); }
.game.classic label { font-size: 11px; color: var(--c-text); }
.game.classic .note { font-size: 11px; color: var(--c-dim); }
.game.classic h3 { font-family: var(--ui); font-size: 11px; letter-spacing: 0; color: var(--c-text); font-weight: bold; }
.bevel, .sw, .gw-view, .gw-console, .mw { border: 2px solid; border-color: var(--c-frame-lo) var(--c-frame-hi) var(--c-frame-hi) var(--c-frame-lo); }

/* ---------- the frame ---------- */
.gw { display: flex; height: 100%; gap: 3px; padding: 3px; background: var(--c-frame); }
.gw.side-left { flex-direction: row-reverse; }
.gw-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.gw-top { display: flex; align-items: center; gap: 10px; height: 20px; padding: 0 4px; }
.gw-top h1 { font-size: 12px; letter-spacing: 4px; }
.gw-top h1 a { color: var(--gold); text-decoration: none; }
.gw-top .who { color: var(--c-dim); }
.gw-top-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.fps { color: var(--c-green); }
.mini-btn { padding: 1px 6px !important; }
.gw-view { position: relative; flex: 1 1 auto; min-height: 160px; background: #1a1816; display: flex; align-items: center; justify-content: center; overflow: hidden; max-width: none; aspect-ratio: auto; box-shadow: none; margin: 0; width: auto; }
.gw-view canvas { box-shadow: 0 0 0 1px var(--c-frame-lo), 0 0 0 2px var(--c-frame-hi); display: block; image-rendering: pixelated; image-rendering: crisp-edges; touch-action: none; cursor: default; width: 480px; height: 352px; }
.gw-view.smooth canvas { image-rendering: auto; }
/* 0.17: the canvas sits in a wrapper that the quest tracker and the action bar are placed in */
.view-wrap { position: relative; display: block; line-height: 0; }
.tracker { position: absolute; top: 8px; left: 8px; max-width: min(260px, 45%); line-height: 1.3; font-size: 12px; color: #f1ead7;
  background: linear-gradient(180deg, rgba(20,16,12,0.78), rgba(20,16,12,0.55)); border: 1px solid rgba(232,196,110,0.35); border-radius: 8px;
  padding: 7px 10px 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.35); backdrop-filter: blur(2px); cursor: pointer; user-select: none; }
.tracker .tr-head { font: 700 11px/1 Georgia, serif; letter-spacing: 0.12em; text-transform: uppercase; color: #e8c46e; margin-bottom: 5px; }
.tracker .tr-head::after { content: ' ▾'; color: rgba(232,196,110,0.7); }
.tracker.folded .tr-head { margin-bottom: 0; } .tracker.folded .tr-head::after { content: ' ▸'; }
.tracker.folded .tr-item, .tracker.folded .tr-tip { display: none; }
.tracker .tr-item + .tr-item { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(232,196,110,0.18); }
.tracker strong { display: block; color: #fff6dc; font-size: 12px; }
.tracker p { margin: 2px 0 0; color: #d8cfb8; font-size: 11.5px; }
.tracker .tr-tip { color: #cfc5ad; font-style: italic; }
.tracker .tr-bar { position: relative; height: 13px; margin-top: 4px; border-radius: 7px; background: rgba(0,0,0,0.45); overflow: hidden; border: 1px solid rgba(232,196,110,0.25); }
.tracker .tr-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #8a6a24, #e3bd5c); transition: width 0.4s ease-out; }
.tracker .tr-bar.full i { background: linear-gradient(90deg, #3d7a2c, #7ccf55); }
.tracker .tr-bar span { position: relative; display: block; text-align: center; font: 700 10px/13px Verdana, sans-serif; color: #fff; text-shadow: 0 1px 1px #000; }
.actionbar { position: absolute; left: 50%; bottom: 8px; opacity: 0.92; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; line-height: 1;
  background: rgba(16,13,10,0.72); border: 1px solid rgba(232,196,110,0.3); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
.ab-slot { position: relative; width: var(--ab, 38px); height: var(--ab, 38px); padding: 0; border-radius: 7px; border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(60,52,42,0.95), rgba(32,27,22,0.95)); color: #f1ead7; cursor: pointer; overflow: hidden; }
.ab-slot:hover { border-color: rgba(232,196,110,0.8); box-shadow: 0 0 0 1px rgba(232,196,110,0.35) inset; }
.ab-slot:active { transform: translateY(1px); }
.ab-slot.empty { background: rgba(30,26,22,0.55); border-style: dashed; }
.ab-slot.none .ab-icon img { filter: grayscale(1); opacity: 0.4; }
.ab-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ab-icon img { width: calc(var(--ab, 38px) - 6px); height: calc(var(--ab, 38px) - 6px); image-rendering: pixelated; }
.ab-icon.spell { font: 700 9.5px/1.05 Verdana, sans-serif; color: #bfe3ff; padding: 3px; text-align: center; word-break: break-word;
  background: radial-gradient(circle at 50% 40%, rgba(70,110,170,0.55), rgba(20,30,50,0.2)); }
.ab-key { position: absolute; top: 2px; left: 3px; font: 700 8.5px/1 Verdana, sans-serif; color: rgba(255,240,200,0.75); text-shadow: 0 1px 1px #000; pointer-events: none; }
.ab-count { position: absolute; right: 3px; bottom: 2px; font: 700 10px/1 Verdana, sans-serif; color: #fff; text-shadow: 0 1px 1px #000, 0 0 2px #000; pointer-events: none; }
.ab-cd { position: absolute; inset: 0; border-radius: 6px; pointer-events: none; }
@media (max-width: 700px) { .actionbar { display: none; } .tracker { display: none; } }
/* modern bars: smooth and with a light sheen */
#hp-fill, #mana-fill, #exp-fill { transition: width 0.35s ease-out; box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), inset 0 -2px 0 rgba(0,0,0,0.2); }
.statusline { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: var(--c-white); font: bold 12px var(--ui); text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; pointer-events: none; padding: 0 12px; transform: none; background: none; border: 0; }
.statusline.look { color: var(--c-green); }
.gw-view.has-ab .statusline { bottom: 66px; } /* above the action bar */
.statusline.warn { color: var(--c-red); }
.gw-split { height: 5px; cursor: row-resize; background: var(--c-frame); border-top: 1px solid var(--c-frame-hi); border-bottom: 1px solid var(--c-frame-lo); touch-action: none; }
.gw-split:hover { background: #3c3934; }

/* ---------- the console ---------- */
.gw-console { height: var(--console-h); min-height: 90px; display: flex; flex-direction: column; background: #121110; gap: 0; }
.gw-console .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 1px; background: var(--c-panel-2); padding: 2px 2px 0; border-bottom: 1px solid var(--c-frame-lo); scrollbar-width: thin; }
.gw-console .tabs > button { flex: 0 0 auto; padding: 2px 10px; border-bottom: 0; color: var(--c-dim); background: linear-gradient(#3a3631, #2a2724); }
.gw-console .tabs > button[aria-selected="true"] { color: #fff; background: #121110; border-color: var(--c-frame-hi) var(--c-frame-lo) #121110 var(--c-frame-hi); }
.gw-console .tabs > button.unread { color: var(--c-red); }
.gw-console .tabs-tools { margin-left: auto; display: flex; gap: 2px; padding-bottom: 2px; flex: 0 0 auto; }
.gw-console #logs { flex: 1 1 auto; min-height: 0; position: relative; }
.gw-console .log { position: absolute; inset: 0; overflow-y: auto; padding: 3px 6px; font: 11px/1.45 var(--ui); background: transparent; border: 0; height: auto; max-height: none; scrollbar-width: thin; }
.gw-console .log div { color: var(--c-yellow); white-space: pre-wrap; word-break: break-word; }
.gw-console .log .say, .gw-console .log .yell, .gw-console .log .whisper { color: var(--c-yellow); }
.gw-console .log .npc { color: var(--c-blue); }
.gw-console .log .spell, .gw-console .log .monster { color: var(--c-orange); }
.gw-console .log .info, .gw-console .log .look, .gw-console .log .advance, .gw-console .log .loot { color: var(--c-white); }
.gw-console .log .small { color: var(--c-white); }
.gw-console .log .warn, .gw-console .log .bad { color: var(--c-red); }
.gw-console .log .world, .gw-console .log [class^="ch-"] { color: var(--c-yellow); }
.gw-console .log .ch-trade { color: #e9c38b; }
.gw-console .log .ch-help { color: #9fe0a6; }
.gw-console .log .ch-guild, .gw-console .log .ch-party { color: #8fe8c8; }
.gw-console .log .pm-in { color: #8fc6ff; }
.gw-console .log .pm-out { color: #a8b8d8; }
.gw-console form { display: flex; gap: 3px; align-items: center; padding: 3px; background: var(--c-panel-2); border-top: 1px solid var(--c-frame-hi); }
.gw-console form select { width: auto; flex: 0 0 auto; }
.gw-console form .note { flex: 0 0 auto; color: var(--c-dim); min-width: 50px; }
.gw-console form input { flex: 1 1 auto; min-width: 0; font-size: 12px; }

/* ---------- the side panel ---------- */
.gw-side { flex: 0 0 var(--side-w); width: var(--side-w); display: flex; flex-direction: column; gap: 3px; min-height: 0; background: none; padding: 0; border: 0; box-shadow: none; }
.sw { background: var(--c-panel); padding: 4px; display: flex; flex-direction: column; gap: 4px; box-shadow: none; }
.sw-mini { display: grid; grid-template-columns: 1fr auto; gap: 4px; align-items: start; }
.sw-mini canvas { width: 100%; aspect-ratio: 1; image-rendering: pixelated; background: #000; border: 1px solid var(--c-frame-lo); cursor: pointer; display: block; }
.mm-btns { display: flex; flex-direction: column; gap: 2px; }
.ico { width: 26px; height: 24px; padding: 0 !important; display: inline-grid; place-items: center; }
.ico svg { display: block; }
.sw-mini .place { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 10px; color: var(--c-dim); }
.sw-mini .place strong { color: var(--c-text); font-weight: bold; }
.sw-status { gap: 3px; }
.game.classic .bar { position: relative; height: 15px; background: #1b1513; border: 1px solid; border-color: var(--c-frame-lo) var(--c-frame-hi) var(--c-frame-hi) var(--c-frame-lo); overflow: hidden; }
.game.classic .bar i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.game.classic .bar.hp i { background: linear-gradient(#e4483c, #9c1f16); }
.game.classic .bar.mana i { background: linear-gradient(#4e7fe0, #1e3f8c); }
.game.classic .bar span { position: relative; display: block; text-align: center; font: bold 10px/13px var(--ui); color: #fff; text-shadow: 1px 1px 0 #000; }

.sw-inv { display: grid; grid-template-columns: auto 1fr; gap: 4px; align-items: start; }
.game.classic .equip { display: grid; grid-template-columns: repeat(3, 36px); grid-auto-rows: 36px; gap: 2px; }
.game.classic .equip .slot, .game.classic .equip .stat { width: 36px; height: 36px; }
.game.classic .slot { width: 34px; height: 34px; padding: 0; position: relative; background: #1c1a18; border: 1px solid; border-color: var(--c-frame-lo) var(--c-frame-hi) var(--c-frame-hi) var(--c-frame-lo); display: grid; place-items: center; min-height: 0; }
.game.classic .slot img { width: 32px; height: 32px; image-rendering: pixelated; }
.game.classic .slot b { position: absolute; right: 1px; bottom: 0; font: bold 10px var(--ui); color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; }
.game.classic .slot.empty-label img.ghost { width: 32px; height: 32px; image-rendering: pixelated; filter: grayscale(1) brightness(0.55); opacity: 0.28; pointer-events: none; }
.game.classic .slot.empty-label { font-size: 8px; color: #5d574f; text-transform: uppercase; letter-spacing: 0; text-align: center; line-height: 1.1; }
.equip .stat { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #1c1a18; border: 1px solid; border-color: var(--c-frame-lo) var(--c-frame-hi) var(--c-frame-hi) var(--c-frame-lo); font-size: 9px; color: var(--c-dim); line-height: 1.15; }
.equip .stat b { color: #fff; font-size: 11px; }
.combat { display: grid; grid-template-columns: repeat(2, 26px); grid-template-rows: repeat(3, 26px) auto; grid-auto-flow: column; gap: 2px; justify-content: end; }
.combat .fight-modes, .combat .chase-modes { display: contents; }
.combat .fight-modes button { grid-column: 1; }
.combat .chase-modes button, .combat #btn-secure { grid-column: 2; }
.combat .stop { grid-column: 1 / -1; grid-row: 4; padding: 2px 0 !important; }
.combat .ico { width: 26px; height: 26px; }
.game.classic .icons { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px; min-height: 0; }
.game.classic .icons span { font-size: 9px; padding: 1px 4px; background: #1c1a18; border: 1px solid var(--c-frame-lo); color: var(--c-dim); }
.game.classic .icons .pz { color: var(--c-green); }
.game.classic .icons .battle, .game.classic .icons .pzlock { color: var(--c-red); }
.sw-buttons .logout { color: #ffb3a8 !important; }
/* 0.19.5: the window buttons sit in the bar over the game window, so the side panel is free for the backpacks */
.top-buttons { display: flex; gap: 3px; align-items: center; min-width: 0; overflow-x: auto; scrollbar-width: none; margin-left: 12px; }
.top-buttons::-webkit-scrollbar { display: none; }
.top-buttons button { padding: 1px 8px !important; font-size: 11px; line-height: 16px; white-space: nowrap; flex: none; }
.top-buttons .logout { margin-left: 6px; }
.gw-top .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 60px; flex: 0 1 auto; }

/* ---------- the small windows of the side panel ---------- */
.gw-stack { flex: 1 1 auto; min-height: 60px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 3px; background: var(--c-panel-2); border: 2px solid; border-color: var(--c-frame-lo) var(--c-frame-hi) var(--c-frame-hi) var(--c-frame-lo); padding: 2px; scrollbar-width: thin; }
.gw-stack #containers { display: contents; }
.mw { background: var(--c-panel); display: flex; flex-direction: column; flex: 0 0 auto; min-height: 0; padding: 0; gap: 0; }
.mw-head { display: flex; align-items: center; gap: 2px; background: var(--c-head); padding: 1px 2px 1px 5px; cursor: grab; user-select: none; touch-action: none; }
.mw-head .mw-title { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: bold; font-size: 10px; color: var(--c-text); }
.mw-head button { width: 16px; height: 14px; padding: 0 !important; line-height: 10px; font-size: 11px !important; }
.mw-body { padding: 3px; overflow-y: auto; resize: vertical; min-height: 24px; display: flex; flex-direction: column; gap: 3px; scrollbar-width: thin; }
.mw.min .mw-body { display: none; }
.mw.dragging { opacity: 0.6; }
.mw.drop-before { box-shadow: 0 -3px 0 var(--gold); }
.mw .bag, .gw-stack .bag { display: grid; grid-template-columns: repeat(auto-fill, 36px); gap: 2px; justify-content: start; }
.mw .bag .slot { width: 36px; height: 36px; }
.mw .slot.is-open { outline: 1px solid var(--gold); }
.srow { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; }
.srow b { color: #fff; font-weight: normal; }
.pbar { height: 4px; background: #1b1513; border: 1px solid var(--c-frame-lo); }
.pbar i { display: block; height: 100%; background: var(--c-red); }
.mw hr { border: 0; border-top: 1px solid var(--c-frame-lo); border-bottom: 1px solid var(--c-frame-hi); margin: 2px 0; width: 100%; }
.game.classic .skills { display: flex; flex-direction: column; gap: 2px; }
.game.classic .skill { display: grid; grid-template-columns: 1fr auto; gap: 1px 6px; font-size: 11px; color: var(--c-text); }
.game.classic .skill .n { color: var(--c-text); }
.game.classic .skill .v { color: #fff; text-align: right; }
.game.classic .skill .p { grid-column: 1 / -1; height: 4px; background: #1b1513; border: 1px solid var(--c-frame-lo); display: block; }
.game.classic .skill .p i { display: block; height: 100%; background: var(--c-red); }
.game.classic .battle { display: flex; flex-direction: column; gap: 1px; }
.game.classic .battle .bl { display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto 4px; gap: 0 4px; text-align: left; padding: 1px 2px !important; background: transparent; border-color: transparent; align-items: center; }
.game.classic .battle .bl canvas { grid-row: 1 / span 2; width: 24px; height: 24px; image-rendering: pixelated; }
.game.classic .battle .bl span { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text); }
.game.classic .battle .bl > i { grid-column: 2; height: 4px; background: #000; display: block; border: 1px solid #000; }
.game.classic .battle .bl > i > i { display: block; height: 100%; }
.game.classic .battle .bl.target { border-color: var(--c-red); }
.game.classic .battle .bl.follow { border-color: var(--c-green); }
.game.classic .battle .bl.k-n span { color: var(--c-blue); }
.battle-filter { gap: 6px !important; }
.battle-filter label { flex-direction: row; align-items: center; gap: 3px; }
.battle-filter input, .vip-add input { width: auto; }
.vip-add input { flex: 1 1 auto; min-width: 0; }
.game.classic .vip-row { display: flex; justify-content: space-between; gap: 4px; }
.game.classic .vip-row .link { background: none; border: 0; padding: 0 !important; color: var(--c-red); text-align: left; }
.game.classic .vip-row.on .link:first-child { color: var(--c-green); }
.side-foot { display: flex; justify-content: flex-end; gap: 3px; }
.gw-mobile { display: none; }

/* ---------- dialogs ---------- */
.game.classic .window.dlg { position: fixed; left: 50%; top: 70px; right: auto; transform: translateX(-50%); z-index: 50; width: min(320px, calc(100vw - 16px)); max-height: calc(100vh - 90px); overflow: auto; background: var(--c-panel); border: 2px solid; border-color: var(--c-frame-hi) var(--c-frame-lo) var(--c-frame-lo) var(--c-frame-hi); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6); padding: 0 8px 8px; gap: 6px; }
.game.classic .window.dlg.placed { transform: none; }
.game.classic .window.dlg.wide { width: min(560px, calc(100vw - 16px)); }
.game.classic .window.dlg > .head { position: sticky; top: 0; z-index: 1; margin: 0 -8px; padding: 3px 4px 3px 8px; background: var(--c-head); display: flex; justify-content: space-between; align-items: center; cursor: grab; user-select: none; touch-action: none; }
.game.classic .window.dlg > .head button { padding: 1px 8px !important; }
.game.classic .window .tabs { display: flex; gap: 1px; flex-wrap: wrap; }
.game.classic .window .tabs button { padding: 2px 8px; }
.game.classic .window .tabs button[aria-selected="true"] { color: #fff; background: #1c1a18; }
.opt-page { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.chk { flex-direction: row !important; align-items: flex-start; gap: 6px !important; line-height: 1.4; }
.chk input { width: auto; margin-top: 1px; }
.opt-page select { width: auto; }
.help-list { margin: 4px 0; padding-left: 16px; display: flex; flex-direction: column; gap: 5px; line-height: 1.45; }
.chan-list { display: flex; flex-direction: column; gap: 2px; }
.chan-list button { text-align: left; }
.game.classic .ctx { font-family: var(--ui); font-size: 11px; background: var(--c-panel); border: 2px solid; border-color: var(--c-frame-hi) var(--c-frame-lo) var(--c-frame-lo) var(--c-frame-hi); padding: 2px; z-index: 100; }
.game.classic .ctx button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 3px 14px !important; }
.game.classic .ctx button:hover, .game.classic .ctx button:focus-visible { background: #55504a; color: #fff; }
.game.classic .overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); z-index: 5; }
.game.classic .overlay .panel { background: var(--c-panel); border: 2px solid; border-color: var(--c-frame-hi) var(--c-frame-lo) var(--c-frame-lo) var(--c-frame-hi); box-shadow: none; padding: 12px; font-size: 12px; }
.game.classic .overlay h2 { font-family: var(--ui); font-size: 14px; }
.game.classic .shop-row { font-size: 11px; }
.game.classic .hotkey-row { font-size: 11px; }
.game.classic .spell-list table { font-size: 11px; }

/* ---------- phones and small windows: one column, the pad and the quick buttons under the game ---------- */
@media (max-width: 860px), (pointer: coarse) and (max-width: 1100px) {
  body.in-game { overflow: auto; }
  .game.classic { height: auto; }
  .gw, .gw.side-left { flex-direction: column; height: auto; }
  .gw-view { flex: none; min-height: 0; }
  .gw-side { width: auto; flex: none; }
  .gw-stack { max-height: none; overflow: visible; }
  .gw-mobile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 4px 0; }
  .gw-mobile .dpad { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); gap: 3px; }
  .gw-mobile .dpad button { font-size: 18px !important; }
  .gw-mobile .group { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .gw-mobile .group button { min-height: 40px; padding: 6px 10px !important; }
  .gw-split { display: none; }
  .sw-mini { grid-template-columns: 160px auto; justify-content: start; }
}

/* ---------- 0.17: the modern theme (Options > Graphics > Theme; the classic grey bevels stay one click away) ---------- */
.game.classic.theme-modern {
  --c-frame: #15130f; --c-frame-hi: #3a332a; --c-frame-lo: #0b0a08; --c-panel: #1f1b16; --c-panel-2: #181510; --c-head: #120f0c;
  --c-text: #e6dfcf; --c-dim: #a59c8a; --accent: #e3bd5c; --accent-dim: rgba(227,189,92,0.35); --radius: 8px;
  --ui: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
}
.theme-modern .gw { gap: 6px; padding: 6px; background: radial-gradient(1200px 600px at 30% 0%, #221d16, #110f0c 70%); }
.theme-modern .bevel, .theme-modern .sw, .theme-modern .gw-view, .theme-modern .gw-console, .theme-modern .mw {
  border: 1px solid var(--c-frame-hi); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.theme-modern .gw-view { background: #0c0b09; overflow: hidden; }
.theme-modern .gw-view canvas { box-shadow: none; border-radius: 4px; }
.theme-modern .gw-console { overflow: hidden; background: #110f0c; }
.theme-modern .sw { background: linear-gradient(180deg, #221e18, #1a1712); padding: 6px; gap: 6px; }
.theme-modern .gw-top { height: 26px; }
.theme-modern .gw-top h1 { font-family: Georgia, serif; letter-spacing: 6px; }
.game.classic.theme-modern button { font-family: var(--ui); font-size: 12px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--c-frame-hi);
  background: linear-gradient(180deg, #2f2921, #231e18); color: var(--c-text); transition: border-color 0.12s, background 0.12s, color 0.12s; }
.game.classic.theme-modern button:hover:not(:disabled) { border-color: var(--accent-dim); background: linear-gradient(180deg, #3a3228, #2a241d); color: #fff; }
.game.classic.theme-modern button:active, .game.classic.theme-modern button[aria-pressed="true"] { border-color: var(--accent); background: #2b2318; color: #ffe9b0; }
.game.classic.theme-modern button.primary { background: linear-gradient(180deg, #8a5f2c, #64421d); border-color: #a77a3f; color: #fff; }
.game.classic.theme-modern input, .game.classic.theme-modern select, .game.classic.theme-modern textarea {
  font-size: 12px; border-radius: 6px; border: 1px solid var(--c-frame-hi); background: #0f0d0a; padding: 4px 7px; }
.game.classic.theme-modern input:focus, .game.classic.theme-modern select:focus, .game.classic.theme-modern textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(227,189,92,0.18); }
.theme-modern .gw-console .tabs { background: #16130f; padding: 4px 4px 0; gap: 3px; border-bottom: 1px solid var(--c-frame-hi); }
.theme-modern .gw-console .tabs > button { border-radius: 6px 6px 0 0; border-bottom: 0; background: transparent; color: var(--c-dim); }
.theme-modern .gw-console .tabs > button[aria-selected="true"] { background: #110f0c; color: #ffe9b0; border-color: var(--c-frame-hi); box-shadow: inset 0 2px 0 var(--accent); }
.theme-modern .gw-console .log { font: 12px/1.5 var(--ui); }
.theme-modern .gw-console form { background: #16130f; border-top: 1px solid var(--c-frame-hi); padding: 5px; gap: 5px; }
.game.classic.theme-modern .bar { height: 17px; border-radius: 9px; border: 1px solid rgba(0,0,0,0.6); background: #0d0b09; box-shadow: inset 0 1px 3px rgba(0,0,0,0.6); }
.game.classic.theme-modern .bar i { border-radius: 9px; }
.game.classic.theme-modern .bar.hp i { background: linear-gradient(180deg, #ff6a5a, #c42a1f 60%, #8f1a12); }
.game.classic.theme-modern .bar.mana i { background: linear-gradient(180deg, #6ea2ff, #2f5fd0 60%, #1d3d91); }
.game.classic.theme-modern .bar span { font: 700 11px/15px var(--ui); letter-spacing: 0.02em; }
.game.classic.theme-modern .slot { border-radius: 6px; border: 1px solid #2c261e; background: radial-gradient(circle at 50% 35%, #2a241c, #15120e); }
.game.classic.theme-modern .slot:hover { border-color: var(--accent-dim); }
.theme-modern .mw { background: #1a1712; overflow: hidden; }
.theme-modern .mw-head { background: linear-gradient(180deg, #2a241b, #1e1a14); border-bottom: 1px solid var(--c-frame-hi); }
.theme-modern .mw-title { color: var(--accent); font-weight: 600; letter-spacing: 0.03em; }
.theme-modern .window { border-radius: 12px; border: 1px solid #4a3f30; background: linear-gradient(180deg, #221d17, #191510); box-shadow: 0 18px 50px rgba(0,0,0,0.55); }
.theme-modern .window .head { border-radius: 12px 12px 0 0; background: linear-gradient(180deg, #2c251c, #201b15); border-bottom: 1px solid #3a3128; }
.theme-modern .window .head h3 { color: var(--accent); font-size: 13px; letter-spacing: 0.04em; }
.theme-modern #ctx { border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.theme-modern ::-webkit-scrollbar { width: 9px; height: 9px; } .theme-modern ::-webkit-scrollbar-thumb { background: #3a3228; border-radius: 6px; } .theme-modern ::-webkit-scrollbar-track { background: transparent; }
.gw-top-right { flex: none; }
.gw-top-right .mini-btn { white-space: nowrap; }
@media (max-width: 1360px) { .top-buttons button { padding: 1px 5px !important; } .top-buttons { margin-left: 6px; gap: 2px; } }
.spell-ico { width: 24px; height: 24px; vertical-align: middle; margin-right: 6px; image-rendering: pixelated; border-radius: 3px; }
