/* Realm of Old Earth — ui.css (v49): the painted UI. Dark weathered iron, crimson and cream, the pieces painted on fal
   (img/ui, library/tools/build_ui.py): the HUD's portrait and bars, the boss bars, the windows' iron frame, the main
   menu, the pause menu, the level-complete screen and the inventory. Loaded after game.css, so these win. */
:root {
  --ui-text: #efe4cf;
  --ui-dim: #a8a196;
  --ui-gold: #dcb46c;
  --ui-gold-hi: #f4d79a;
  --ui-crimson: #9e2028;
  --ui-crimson-hi: #e04a4c;
  --ui-teal: #a6ecec;
  --ui-iron: rgba(150, 146, 140, 0.32);
  --ui-panel: rgba(13, 12, 17, 0.9);
  --font-ui: "Cinzel", "Trajan Pro", Georgia, serif;
}

/* ---------- buttons and plates, everywhere ---------- */
.primary, .secondary { font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.12em; border-radius: 2px; }
.primary {
  color: #f6e7c8; background: linear-gradient(180deg, #8a222a, #561218 60%, #3e0c11);
  border: 1px solid rgba(232, 128, 108, 0.5); box-shadow: inset 0 1px 0 rgba(255, 190, 170, 0.22), 0 3px 10px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.primary:hover { filter: brightness(1.12); }
.secondary {
  color: #d9d0c0; background: linear-gradient(180deg, rgba(40, 38, 46, 0.92), rgba(22, 21, 27, 0.92));
  border: 1px solid var(--ui-iron); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.secondary:hover { border-color: rgba(220, 180, 108, 0.6); color: var(--ui-text); }
.plate {
  background: linear-gradient(180deg, rgba(24, 23, 30, 0.86), rgba(12, 11, 16, 0.86));
  border: 1px solid var(--ui-iron); border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.4);
}
.wave-name { font-family: var(--font-ui); font-weight: 700; color: var(--ui-gold); letter-spacing: 0.06em; }
.wave-plate::before, .wave-plate::after { background: var(--ui-crimson-hi); }

/* every menu window wears the painted iron frame (its corners kept, its rails stretched) */
.tablet, .ui-frame {
  border: 22px solid transparent; border-radius: 0;
  border-image: url("../img/ui/panel_frame.png") 81 / 22px / 6px stretch;
  background: radial-gradient(ellipse at 50% 0%, rgba(60, 30, 36, 0.35), transparent 60%), var(--ui-panel);
  background-clip: border-box; background-origin: border-box;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.tablet { padding: 22px 26px 18px; }
.tablet h1 { font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.04em; color: var(--ui-text); }
.eyebrow { color: var(--ui-crimson-hi); letter-spacing: 0.22em; }
.stats div { border-color: var(--ui-iron); background: rgba(0, 0, 0, 0.25); border-radius: 2px; }

/* ---------- the HUD: your portrait, health, magic and stamina ---------- */
.left-stack { width: min(340px, 72vw); }
.hero-plate.ui49 {
  background: none; border: 0; box-shadow: none; padding: 0;
  display: grid; grid-template-columns: 94px 1fr; align-items: center; column-gap: 2px;
}
.hero-plate.ui49 .hero-bag { display: none; }
.hud-portrait { position: relative; width: 94px; height: 92px; }
.hud-portrait canvas {
  position: absolute; left: 17.7%; top: 13.3%; width: 64.6%; height: 66.3%;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: radial-gradient(circle at 50% 40%, #3b3a46, #15141b 75%);
}
.hud-portrait img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hud-portrait .lv-badge {
  position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%); min-width: 22px; text-align: center;
  font: 700 12px/1 var(--font-ui); color: var(--ui-gold-hi); text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.9);
  font-variant-numeric: tabular-nums;
}
.hud-bars { display: grid; gap: 1px; min-width: 0; }
.hud-bars .who { font: 700 13px/1 var(--font-ui); letter-spacing: 0.1em; color: var(--ui-gold); text-shadow: 0 1px 3px #000; margin: 0 0 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ubar { position: relative; height: 28px; background: url("../img/ui/bar_frame.png") center / 100% 100% no-repeat; }
.ubar.mana { height: 21px; width: 86%; }
.ubar.stam { height: 17px; width: 72%; }
.ubar .track {
  position: absolute; left: 4.5%; top: 11.6%; width: 93.6%; height: 72%; overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%);
}
.ubar .track i, .ubar .track b { position: absolute; inset: 0 auto 0 0; width: 100%; }
.ubar .track i { transition: width 0.14s ease-out; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 3px rgba(0, 0, 0, 0.35); }
.ubar .track b { background: rgba(255, 236, 214, 0.75); transition: width 0.5s ease-in 0.35s; }
.ubar.hp .track i { background: url("../img/ui/fill_red.jpg") left center / auto 100% repeat-x; }
.ubar.mana .track i { background: url("../img/ui/fill_blue.jpg") left center / auto 100% repeat-x; transition: width 0.12s linear; }
.ubar.stam .track i { background: url("../img/ui/fill_gold.jpg") left center / auto 100% repeat-x; transition: none; }
.ubar.stam.low .track i { filter: hue-rotate(-18deg) saturate(1.3); }
.ubar.stam.out .track i { filter: hue-rotate(-40deg) saturate(1.5) brightness(0.9); }
.ubar.stam.out { animation: tired49 0.9s ease-in-out infinite; }
@keyframes tired49 { 50% { filter: drop-shadow(0 0 5px rgba(255, 96, 74, 0.8)); } }
.ubar.hp.low .track i { animation: hplow 0.8s ease-in-out infinite; }
@keyframes hplow { 50% { filter: brightness(1.45) saturate(1.2); } }
.ubar .num {
  position: absolute; left: 4.5%; width: 91%; top: 50%; transform: translateY(-52%); text-align: center;
  font: 800 13px/1 var(--font-body); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; color: #fff4e2;
  text-shadow: 0 0 2px #000, 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.8); pointer-events: none;
}
.ubar.mana .num { font-size: 11px; }
.hud-xp { height: 3px; width: 70%; margin: 3px 0 0 4%; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(150, 146, 140, 0.25); position: relative; }
.hud-xp i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #a8783a, var(--ui-gold-hi)); transition: width 0.3s ease-out; }
.ubar.deny { animation: denied 0.3s; }

/* ---------- boss bars: a painted crest over a long iron bar, the name below ---------- */
.left-stack > .boss-plate.ui49, .boss-plate.ui49 {
  top: calc(58px + var(--inset-t)); width: min(600px, 82vw); padding: 0; background: none; border: 0; box-shadow: none; text-align: center;
}
.boss-plate.ui49 .crest { display: block; height: auto; width: 50%; margin: 0 auto -5.6%; position: relative; z-index: 1; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6)); }
.boss-plate.ui49[data-kind="mini"] .crest { width: 44%; margin-bottom: -4.6%; }
.boss-plate.ui49[data-kind="plain"] .crest { display: none; }
.boss-plate.ui49 .bossbar { position: relative; height: auto; aspect-ratio: 1100 / 111; margin: 0; border: 0; background: url("../img/ui/boss_bar_frame.png") center / 100% 100% no-repeat; overflow: visible; }
.boss-plate.ui49 .bossbar .track { position: absolute; left: 10.3%; top: 26.5%; width: 79.8%; height: 50%; overflow: hidden; background: rgba(8, 5, 7, 0.9); }
.boss-plate.ui49 .bossbar .track i, .boss-plate.ui49 .bossbar .track b { position: absolute; inset: 0 auto 0 0; width: 100%; }
.boss-plate.ui49 .bossbar .track i { background: linear-gradient(180deg, rgba(255, 200, 140, 0.35), transparent 40%), url("../img/ui/fill_red.jpg") left center / auto 100% repeat-x; filter: saturate(1.15) hue-rotate(8deg); transition: width 0.18s ease-out; }
.boss-plate.ui49 .bossbar .track b { background: rgba(255, 226, 190, 0.7); transition: width 0.6s ease-in 0.4s; }
.boss-plate.ui49 .boss-num { position: absolute; inset: 0; display: grid; place-items: center; font: 800 12px/1 var(--font-body); color: #fff1dc; text-shadow: 0 0 2px #000, 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.boss-plate.ui49 .boss-name {
  margin-top: 1px; font: 700 15px/1.2 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: #f1e2bd;
  text-shadow: 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, 0.9);
}
.boss-plate.ui49 .boss-name::before, .boss-plate.ui49 .boss-name::after { content: "\25C6"; display: inline-block; margin: 0 10px; font-size: 8px; vertical-align: 3px; color: var(--ui-gold); }

/* ---------- numbers you hit for ---------- */
.dmg { font: 900 25px/1 var(--font-body); color: #fff6e6; -webkit-text-stroke: 1px rgba(30, 10, 6, 0.7); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.75), 0 0 10px rgba(255, 120, 40, 0.6); animation: hitnum 1.05s ease-out forwards; }
.dmg.crit { font-size: 34px; color: #ffd27a; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.8), 0 0 14px rgba(255, 150, 40, 0.9); }
.dmg.burn { color: #ffb06a; }
.dmg.hurt { font-size: 22px; color: #ff6a5a; }
.dmg.note, .dmg.xp, .dmg.loot, .dmg.heal { -webkit-text-stroke: 0; animation: rise 0.8s ease-out forwards; }
.dmg.note, .dmg.xp, .dmg.loot { font-size: 14px; }
.dmg.loot { font-size: 15px; }
@keyframes hitnum {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(1.5); }
  12% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  65% { opacity: 1; transform: translate(-50%, -150%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -210%) scale(0.92); }
}

/* ---------- the main menu ---------- */
#screen-title.ui49 { display: block; padding: 0; overflow: hidden; background: #07080c; }
.menu-art {
  position: absolute; inset: 0; background: url("../img/ui/menu_art.jpg?v=52") 70% center / cover no-repeat;
}
.menu-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(4, 5, 8, 0.94) 0%, rgba(4, 5, 8, 0.78) 30%, rgba(4, 5, 8, 0.15) 58%, transparent 75%),
              linear-gradient(0deg, rgba(4, 5, 8, 0.7), transparent 30%);
}
.menu-side {
  position: absolute; top: 0; bottom: 0; left: 0; width: min(520px, 92vw); box-sizing: border-box;
  padding: calc(32px + var(--inset-t)) 24px calc(22px + var(--inset-b)) calc(40px + var(--inset-l));
  display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
}
.menu-logo { width: min(440px, 80vw); height: auto; margin: 0 0 6px -8px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.7)); }
.menu-tag { margin: 0 0 18px; font: 600 13px var(--font-ui); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ui-dim); }
.menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.menu-item {
  position: relative; display: block; width: auto; padding: 8px 10px 8px 34px; background: none; border: 0; cursor: pointer; text-align: left;
  font: 700 clamp(22px, 3.2vw, 30px)/1.1 var(--font-ui); letter-spacing: 0.04em; color: #b9b2c4; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  transition: color 0.15s, transform 0.15s;
}
.menu-item::before {
  content: ""; position: absolute; left: 4px; top: 50%; width: 20px; height: 20px; margin-top: -10px; opacity: 0; transform: scale(0.6) rotate(-20deg);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  background: linear-gradient(135deg, #ffd9a0, var(--ui-crimson-hi) 55%, #7a1018);
  transition: opacity 0.15s, transform 0.2s;
}
.menu-item:hover, .menu-item:focus-visible, .menu-item.sel { color: #fff1d6; transform: translateX(4px); outline: none; }
.menu-item:hover::before, .menu-item:focus-visible::before, .menu-item.sel::before { opacity: 1; transform: scale(1) rotate(0); }
.menu-item small { display: block; margin-top: 2px; font: 600 12px var(--font-body); letter-spacing: 0.08em; color: var(--ui-dim); text-transform: none; }
.menu-foot { margin-top: auto; padding-top: 16px; display: grid; gap: 4px; }
.menu-foot .note { text-align: left; font-size: 12px; color: var(--ui-dim); }
.menu-panel { position: absolute; z-index: 2; top: 50%; left: min(560px, 50vw); transform: translateY(-50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 60px); overflow-y: auto; box-sizing: border-box; padding: 18px 22px; display: grid; gap: 12px; }
.menu-panel h2 { margin: 0; font: 700 22px var(--font-ui); letter-spacing: 0.06em; color: var(--ui-text); }
.menu-panel .controls { padding: 10px 0; }
.menu-panel .tips { margin: 0; }
@media (max-width: 860px) {
  .menu-art { background-position: 75% center; }
  .menu-art::after { background: linear-gradient(0deg, rgba(4, 5, 8, 0.96) 18%, rgba(4, 5, 8, 0.6) 55%, rgba(4, 5, 8, 0.2)); }
  .menu-side { width: 100%; padding-left: max(20px, var(--inset-l)); }
  .menu-side > :first-child { margin-top: auto; }
  .menu-logo { width: min(320px, 78vw); }
  .menu-panel { left: 50%; transform: translate(-50%, -50%); }
}


/* ---------- pause, defeat: the same frame and colours ---------- */
#screen-pause .tablet { max-width: 380px; text-align: center; }
#screen-pause h1 { font-size: 34px; }
#screen-pause .tablet::before { content: ""; display: block; height: 2px; margin: -4px auto 4px; width: 60%; background: linear-gradient(90deg, transparent, var(--ui-crimson-hi), transparent); order: 1; }

/* ---------- level complete ---------- */
#screen-win.ui49 .tablet, #screen-over.ui49 .tablet { max-width: 980px; }
.res-head { display: grid; gap: 6px; text-align: center; }
.res-head .lede { margin: 0 auto; }
.res-head h1 { font-size: clamp(30px, 5vw, 44px); letter-spacing: 0.08em; text-transform: uppercase; }
.res-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0; }
.res-stat { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 10px; padding: 8px 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--ui-iron); }
.res-stat svg { width: 26px; height: 26px; grid-row: span 2; color: var(--ui-gold); }
.res-stat b { font: 800 20px/1.1 var(--font-body); color: var(--ui-text); font-variant-numeric: tabular-nums; }
.res-stat span { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ui-dim); }
.res-body { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.5fr); gap: 12px; }
.res-col { background: rgba(0, 0, 0, 0.28); border: 1px solid var(--ui-iron); padding: 10px 12px; display: grid; gap: 8px; align-content: start; }
.res-col h2 { margin: 0; font: 700 13px var(--font-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ui-gold); }
.res-prog { display: grid; gap: 4px; }
.res-prog .rl { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.res-prog .rl b { color: var(--ui-text); }
.res-prog .rl em { font-style: normal; color: #9ee28a; font-weight: 800; font-variant-numeric: tabular-nums; }
.res-prog .rb { height: 6px; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(150, 146, 140, 0.25); position: relative; }
.res-prog .rb i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #a8783a, var(--ui-gold-hi)); }
.res-loot { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.res-item { position: relative; aspect-ratio: 1; display: grid; place-items: center; background: linear-gradient(180deg, rgba(48, 44, 56, 0.6), rgba(18, 17, 22, 0.8)); border: 1px solid var(--ui-iron); }
.res-item .ico { width: 46%; height: 46%; display: grid; place-items: center; }
.res-item .ico svg { width: 100%; height: 100%; }
.res-item .n { position: absolute; top: 4px; left: 6px; font: 800 13px var(--font-body); color: var(--ui-text); text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.res-item .nm { position: absolute; left: 3px; right: 3px; bottom: 4px; font-size: 10.5px; line-height: 1.1; text-align: center; color: var(--ui-dim); }
.res-empty { color: var(--ui-dim); font-size: 14px; margin: 4px 0; }
@media (max-width: 720px) { .res-body { grid-template-columns: 1fr; } }

/* ---------- the inventory: tabs across the top, a grid of slots, your hero to the right ---------- */
#screen-inventory.ui49 { padding: 0; background: linear-gradient(90deg, rgba(5, 6, 9, 0.86) 0%, rgba(5, 6, 9, 0.72) 52%, rgba(5, 6, 9, 0.15) 70%, rgba(5, 6, 9, 0.35)); }
.inv49 { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(330px, 640px) 1fr; grid-template-rows: auto 1fr; padding: calc(14px + var(--inset-t)) max(18px, var(--inset-r)) calc(14px + var(--inset-b)) max(18px, var(--inset-l)); gap: 10px 20px; box-sizing: border-box; }
.inv49-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }
.inv49-top h1 { margin: 0; font: 700 26px var(--font-ui); letter-spacing: 0.08em; color: var(--ui-text); }
.inv49-top .inv-close { width: auto; margin-left: auto; padding: 8px 14px; }
.inv49-tabs { display: flex; gap: 4px; margin: 0 0 2px; }
.inv49-tab {
  position: relative; width: 56px; height: 50px; display: grid; place-items: center; cursor: pointer; padding: 0;
  background: none; border: 0; color: #8e8798;
}
.inv49-tab svg { width: 28px; height: 28px; }
.inv49-tab[aria-selected="true"] { color: #fff1d6; }
.inv49-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; background: var(--ui-crimson-hi); box-shadow: 0 0 6px var(--ui-crimson-hi); }
.inv49-tab:hover { color: var(--ui-text); }
.inv49-tab .n { position: absolute; top: 2px; right: 6px; font: 800 10px var(--font-body); color: var(--ui-gold); }
.inv49-left { display: grid; grid-template-rows: auto auto minmax(0, auto) auto; align-content: start; min-height: 0; }
.inv49-cat { margin: 0 0 6px; font: 700 13px var(--font-ui); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ui-gold); text-align: center; }
.inv49-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 7px; align-content: start; overflow-y: auto; padding: 4px; min-height: 0; }
/* (v77) the Abilities tab: the slots' cards, scrolling in the grid's place */
.inv49-abil { overflow-y: auto; min-height: 0; max-height: calc(100vh - 170px); padding: 4px 6px 4px 4px; }
.inv49-abil .ab-row { grid-template-columns: 74px minmax(0, 1fr); }
.inv49-abil .ab-foot { margin-top: 10px; }
.inv49-grid .inv-cell {
  position: relative; aspect-ratio: 1; width: auto; height: auto; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: linear-gradient(180deg, rgba(36, 38, 44, 0.75), rgba(14, 15, 19, 0.85)); border: 1px solid rgba(160, 156, 150, 0.28); border-radius: 0;
}
.inv49-grid .inv-cell.empty { cursor: default; background: rgba(14, 15, 19, 0.45); border-color: rgba(160, 156, 150, 0.12); }
.inv49-grid .inv-cell .inv-ico { width: 52%; height: 52%; display: grid; place-items: center; }
.inv49-grid .inv-cell .inv-ico svg { width: 100%; height: 100%; }
.inv49-grid .inv-cell .inv-n { position: absolute; left: 6px; bottom: 4px; top: auto; right: auto; font: 800 13px var(--font-body); color: #f2ead9; text-shadow: 0 1px 2px #000; }
.inv49-grid .inv-cell .inv-n::before { content: "x"; font-size: 11px; margin-right: 1px; color: var(--ui-dim); }
.inv49-grid .inv-cell .worn { position: absolute; top: 4px; right: 5px; width: 9px; height: 9px; transform: rotate(45deg); background: var(--ui-crimson-hi); box-shadow: 0 0 5px var(--ui-crimson-hi); }
.inv49-grid .inv-cell[aria-pressed="true"] { border-color: transparent; background: linear-gradient(180deg, rgba(70, 60, 50, 0.8), rgba(24, 20, 18, 0.9)); }
.inv49-grid .inv-cell[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -3px; pointer-events: none;
  background: linear-gradient(#fff, #fff) left top / 12px 2px, linear-gradient(#fff, #fff) left top / 2px 12px,
              linear-gradient(#fff, #fff) right top / 12px 2px, linear-gradient(#fff, #fff) right top / 2px 12px,
              linear-gradient(#fff, #fff) left bottom / 12px 2px, linear-gradient(#fff, #fff) left bottom / 2px 12px,
              linear-gradient(#fff, #fff) right bottom / 12px 2px, linear-gradient(#fff, #fff) right bottom / 2px 12px;
  background-repeat: no-repeat; filter: drop-shadow(0 0 3px rgba(255, 220, 160, 0.9));
}
.inv49-grid .inv-cell:hover:not(.empty) { border-color: rgba(220, 180, 108, 0.55); }
.inv49-right { position: relative; display: grid; grid-template-rows: 1fr auto; min-height: 0; }
.inv49-hero { display: flex; align-items: baseline; gap: 6px; font: 700 16px var(--font-ui); color: var(--ui-gold); letter-spacing: 0.06em; }
.inv49-right .inv-stage { min-height: 200px; background: none; }
.inv49 .inv-slot .inv-ico { border-radius: 0; border-color: var(--ui-iron); background: linear-gradient(180deg, rgba(36, 38, 44, 0.82), rgba(14, 15, 19, 0.9)); }
.inv49 .inv-slot.filled .inv-ico { border-color: rgba(220, 180, 108, 0.6); }
.inv49 .inv-slot[aria-pressed="true"] .inv-ico { box-shadow: 0 0 0 2px var(--ui-gold), 0 0 14px rgba(220, 180, 108, 0.45); }
/* (v80) an armor set still being forged at the forge: dimmed, with how many of its three pieces are made */
.inv49 .inv-cell.forging .inv-ico { opacity: 0.5; filter: saturate(0.6); }
.inv49-right .inv-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; margin: 0; padding: 6px 0; border: 0; background: none; }
.inv49-right .inv-stats div { padding: 0; border: 0 !important; }
.inv49-right .inv-stats div { display: flex; gap: 5px; align-items: baseline; }
.inv49-right .inv-stats dt { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ui-dim); }
.inv49-right .inv-stats dd { margin: 0; font-weight: 800; color: var(--ui-text); }
.inv49-detail { background: linear-gradient(180deg, rgba(14, 13, 18, 0.92), rgba(8, 8, 11, 0.95)); border-top: 1px solid rgba(220, 180, 108, 0.35); padding: 10px 14px; min-height: 92px; }
.inv49-detail .inv-dhead h3 { font: 700 20px var(--font-ui); letter-spacing: 0.03em; color: var(--ui-text); margin: 0; }
.inv49-detail .inv-sub { color: var(--ui-gold); }
@media (max-width: 760px) {
  .inv49 { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .inv49-right { order: 3; }
  .inv49-right .inv-stage { display: none; }
  #screen-inventory.ui49 { background: rgba(5, 6, 9, 0.88); }
}

/* a phone on its side: everything a size smaller so the menu fits the height */
@media (max-height: 520px) {
  .menu-side { padding-top: calc(12px + var(--inset-t)); padding-bottom: calc(10px + var(--inset-b)); gap: 4px; width: min(440px, 60vw); }
  .menu-side > :first-child { margin-top: 0; }
  .menu-art::after { background: linear-gradient(90deg, rgba(4, 5, 8, 0.94) 0%, rgba(4, 5, 8, 0.7) 40%, transparent 70%); }
  .menu-logo { width: min(250px, 40vw); margin-bottom: 0; }
  .menu-tag { display: none; }
  .menu-item { font-size: 19px; padding: 4px 8px 4px 30px; }
  .menu-item small { display: none; }
  .menu-foot { padding-top: 6px; }
  .menu-foot .note { font-size: 11px; }
  .inv49 { gap: 6px 14px; grid-template-columns: minmax(280px, 400px) 1fr; }
  .inv49-top h1 { font-size: 20px; }
  .inv49-tab { height: 40px; width: 48px; }
  .inv49-cat { display: none; }
  .inv49-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 5px; }
  .inv49-right .inv-stage { min-height: 120px; }
  .inv49-right .inv-stats { display: none; }
  .inv49-detail { min-height: 0; padding: 6px 10px; }
  .hud-portrait { width: 78px; height: 76px; }
  .hero-plate.ui49 { grid-template-columns: 78px 1fr; }
  .ubar { height: 24px; }
  .ubar.mana { height: 18px; }
  .ubar.stam { height: 14px; }
}

/* (v53) the hairstyles as pictures, each one on a plain grey head: picked by its picture */
.hair-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.hair-tile {
  position: relative; aspect-ratio: 1 / 1; padding: 0; border-radius: 6px; overflow: hidden; cursor: pointer;
  background: #23272e; border: 1px solid var(--bronze-line); transition: border-color 0.15s, box-shadow 0.15s;
}
.hair-tile img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.hair-tile:hover { border-color: rgba(214, 168, 92, 0.75); }
.hair-tile:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
.hair-tile[aria-checked="true"] { border-color: var(--bronze); box-shadow: inset 0 0 0 2px var(--bronze), 0 0 12px rgba(214, 168, 92, 0.35); }
.hair-tile.busy img { animation: busy 0.9s ease-in-out infinite; }
.hair-tile.noimg { display: grid; place-items: center; padding: 4px; font: 700 11.5px/1.2 var(--font-body); color: var(--bone); text-align: center; }
@media (max-width: 380px) { .hair-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* (v54) one palette of 64 colours for the hair, the eyes, the brows and the lips: a tab picks what it colours */
.colors .col-tabs { margin-bottom: 8px; }
.colors .col-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 6px; }
.col-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #777); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(214, 168, 92, 0.35); }
.palette { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.pal {
  aspect-ratio: 1.45; min-height: 22px; padding: 0; border: 0; border-radius: 3px; cursor: pointer; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.pal:hover { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--bronze-line); }
.pal[aria-checked="true"] { position: relative; z-index: 1; box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--bronze); }
.pal:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
.lip-natural { margin-bottom: 8px; padding: 6px 12px; font-size: 13px; }
.lip-natural[aria-pressed="true"] { color: var(--ink); background: var(--bronze); border-color: var(--bronze); }

/* (v68) your look, in the head creator's tabs: Face, Eyes, Brows, Mouth, Skin and Hair under one field */
.look { gap: 10px; }
.look-tabs button { padding: 7px 4px; letter-spacing: 0.06em; }
.look-panel { display: grid; gap: 8px; }
.look-panel[hidden] { display: none; }
.create-panel .sub { margin: 4px 0 0; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bronze); }
.create-panel .sub .pick { margin-left: 6px; font-weight: 700; letter-spacing: 0.04em; text-transform: none; color: var(--ash); }
.face-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.face-tiles.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.face-tile {
  display: grid; gap: 3px; justify-items: center; padding: 4px 3px 5px; border-radius: 6px; cursor: pointer; min-width: 0;
  color: var(--ash); background: rgba(0, 0, 0, 0.3); border: 1px solid var(--bronze-line); font: 700 11px/1.2 var(--font-body);
}
.face-tile canvas { display: block; width: 100%; height: auto; border-radius: 4px; background: #d9b9a4; }
.face-tile span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face-tile:hover { border-color: rgba(214, 168, 92, 0.75); }
.face-tile[aria-checked="true"] { color: var(--bone); border-color: var(--bronze); box-shadow: inset 0 0 0 1px var(--bronze), 0 0 10px rgba(214, 168, 92, 0.3); }
.sliders { display: grid; gap: 6px; }
.slider { display: grid; grid-template-columns: 92px minmax(0, 1fr) 40px; align-items: center; gap: 8px; }
.slider label { font: 700 12.5px var(--font-body); color: var(--bone); }
.slider output { font: 700 12px var(--font-body); color: var(--ash); text-align: right; font-variant-numeric: tabular-nums; }
.slider input[type=range] { width: 100%; accent-color: var(--bronze); }
.swatch.pair { background: linear-gradient(180deg, var(--c2) 0%, var(--c2) 45%, var(--c) 100%); }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(#e05a5a, #e0c05a, #6ad06a, #5ab0e0, #a05ae0, #e05a5a); }
.swatch.custom input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); opacity: 0; cursor: pointer; }
.picks { display: flex; gap: 14px; }
.pick-col { display: inline-flex; align-items: center; gap: 6px; font: 700 12px var(--font-body); color: var(--ash); }
.pick-col input[type=color] { width: 34px; height: 26px; padding: 1px; border-radius: 4px; border: 1px solid var(--bronze-line); background: rgba(0, 0, 0, 0.3); cursor: pointer; }
.helm-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.helm-row .sub { margin: 0; }
.helm-row .seg { flex: 1; }
@media (max-width: 380px) { .face-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .face-tiles.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* (v83) the Arsenal: the character screen as your arsenal (arsenal.js) */
#screen-create[data-mode="arsenal"] .create-only { display: none !important; }
#screen-create:not([data-mode="arsenal"]) .arsenal-only { display: none !important; }
.ars-list { display: grid; gap: 6px; }
.ars-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 7px 9px; text-align: left; cursor: pointer; border-radius: 3px;
  background: rgba(0, 0, 0, 0.34); border: 1px solid var(--ui-iron); color: var(--ui-text); font: 500 13px/1.25 "Alegreya Sans", sans-serif; }
.ars-card:hover { border-color: rgba(220, 180, 108, 0.6); }
.ars-card:focus-visible { outline: 2px solid var(--ui-gold); outline-offset: 1px; }
.ars-card.on { border-color: var(--ui-gold); background: linear-gradient(180deg, rgba(90, 70, 40, 0.45), rgba(30, 24, 18, 0.85)); box-shadow: inset 0 0 0 1px rgba(220, 180, 108, 0.3); }
.ars-card.locked { opacity: 0.55; cursor: default; }
.ars-ico svg { width: 38px; height: 38px; display: block; }
.ars-txt { display: grid; gap: 2px; min-width: 0; }
.ars-txt b { font: 700 13.5px/1.2 var(--font-ui); letter-spacing: 0.03em; color: var(--ui-text); }
.ars-card.on .ars-txt b { color: var(--ui-gold-hi); }
.ars-txt small { color: var(--ui-dim); font-size: 12px; }
.ars-tag { font: 700 10px/1 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ui-gold); font-style: normal; }
.ars-card.locked .ars-tag { color: var(--ui-dim); }
.ars-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.ars-stat { margin: 0; display: flex; justify-content: space-between; color: var(--ui-dim); font-size: 13px; border-bottom: 1px solid rgba(150, 146, 140, 0.15); padding: 2px 0; }
.ars-stat b { color: var(--ui-gold-hi); font-variant-numeric: tabular-nums; }
.ars-note, .ars-empty { margin: 8px 0 0; color: var(--ui-dim); font-size: 12.5px; }
/* (v83) the build bar's tab you can't use where you stand (your home's inside, the village outside) */
#build-tabs button.off { opacity: 0.5; }
/* (v84) a class or starting weapon locked for now */
.class-card .lock-badge, .weapon-card .lock-badge { display: none; }
.class-card.locked, .weapon-card.locked { opacity: 0.5; filter: grayscale(0.6); cursor: not-allowed; position: relative; }
.class-card.locked .lock-badge, .weapon-card.locked .lock-badge { display: block; position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; color: var(--ui-gold); }
.class-card.locked .lock-badge svg, .weapon-card.locked .lock-badge svg { width: 16px; height: 16px; display: block; }
.class-card.deny, .weapon-card.deny { animation: lockShake 0.35s ease; }
@keyframes lockShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.lock-note { margin: 6px 0 0; color: var(--ui-dim); font-size: 12.5px; }

/* (v85) the Arsenal's tabs: your class, the other classes (each locked for now); gear your class can't use */
.seg button[role="tab"][aria-selected="true"] { color: var(--ink); background: linear-gradient(180deg, var(--bronze), var(--bronze-deep)); }
.ars-tabs button { text-transform: none; letter-spacing: 0.04em; font-size: 12.5px; }
#screen-create[data-ars-tab="others"] .ars-mine { display: none !important; }
#screen-create:not([data-ars-tab="others"]) .ars-others { display: none !important; }
.ars-classes { display: grid; gap: 14px; }
.ars-class { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--ui-iron); border-radius: 4px; background: rgba(0, 0, 0, 0.22); }
.ars-class-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ars-class-head b { font: 700 15px/1.2 var(--font-ui); letter-spacing: 0.04em; color: var(--ui-gold-hi); }
.ars-class.locked .ars-class-head b { color: var(--ui-text); }
.ars-class-head small { display: inline-flex; align-items: center; gap: 4px; color: var(--ui-dim); font: 700 10.5px/1 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; }
.ars-perk { margin: 0; color: var(--ui-dim); font-size: 12.5px; }
.ars-sub { margin: 4px 0 0; }
.ars-lock { display: inline-block; vertical-align: -2px; margin-right: 3px; color: var(--ui-gold); }
.ars-lock svg { width: 12px; height: 12px; display: block; }
.ars-class.locked .ars-card { filter: grayscale(0.55); }
.ars-card.deny { animation: lockShake 0.35s ease; }
.ars-switch { width: 100%; margin-top: 4px; }
.ars-switch:disabled { opacity: 0.6; cursor: not-allowed; }
/* the weapon you set out with, pictured as your class's (the staff, the scythe...) */
.ars-ico img { width: 38px; height: 38px; display: block; object-fit: contain; }
.inv-cell .inv-ico img { width: 38px; height: 38px; display: block; object-fit: contain; }
.inv-slot .inv-ico img { width: 46px; height: 46px; display: block; object-fit: contain; }
.inv-dico img { width: 40px; height: 40px; display: block; object-fit: contain; }
.inv-cell.locked .inv-ico { opacity: 0.45; filter: grayscale(0.7); }
.inv-cell .lock-badge { position: absolute; top: 4px; left: 4px; width: 14px; height: 14px; color: var(--ui-gold); }
.inv-cell .lock-badge svg { width: 14px; height: 14px; display: block; }
.inv-act.locked { opacity: 0.6; cursor: not-allowed; }
.ars-class.locked .ars-tag-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }   /* (its heading says Locked: the padlock alone) */
.ars-class.locked .ars-lock svg { width: 15px; height: 15px; }
/* (v89) the bag's Level tab: the waiting levels' points, and the HUD badge when levels are ready */
.lvt { display: grid; gap: 12px; padding: 14px 16px; }
.lvt-head h3 { margin: 0; font: 700 18px var(--font-ui); color: var(--ui-gold-hi); letter-spacing: 0.03em; }
.lvt-sub { margin: 4px 0 0; color: var(--ui-dim); font-size: 13px; }
.lvt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--ui-iron); border-radius: 4px; background: rgba(0, 0, 0, 0.28); }
.lvt-lab { display: grid; gap: 2px; min-width: 0; }
.lvt-lab b { font: 700 14px var(--font-ui); color: var(--ui-text); }
.lvt-lab small { color: var(--ui-dim); font-size: 12px; }
.lvt-val { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; min-width: 82px; justify-content: flex-end; }
.lvt-now { font: 800 18px var(--font-ui); color: var(--ui-text); }
.lvt-add { font: 800 15px var(--font-ui); color: #8fe07a; }
.lvt-btns { display: flex; gap: 4px; }
.lvt-b { min-width: 34px; padding: 5px 6px; border-radius: 3px; border: 1px solid var(--ui-iron); background: rgba(0, 0, 0, 0.4); color: var(--ui-text); font: 700 12.5px var(--font-ui); cursor: pointer; }
.lvt-b:hover:not(:disabled) { border-color: var(--ui-gold); }
.lvt-b:disabled { opacity: 0.35; cursor: default; }
.lvt-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lvt-left { margin: 0; flex: 1; color: var(--ui-gold-hi); font: 700 13px var(--font-ui); }
.lvt-left.done { color: #8fe07a; }
.lvt-go { padding: 9px 16px; border-radius: 3px; border: 1px solid var(--ui-gold); background: linear-gradient(180deg, rgba(150, 110, 50, 0.9), rgba(90, 60, 25, 0.95)); color: #fff4d8; font: 800 13px var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.lvt-go:disabled { opacity: 0.45; cursor: default; }
#lv-text.ready { color: #ffe08a; text-shadow: 0 0 8px rgba(255, 200, 90, 0.9); animation: lvReady 1.4s ease-in-out infinite; }
@keyframes lvReady { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.6); } }
/* (v90) the Arsenal's Runes tab */
#screen-create[data-ars-tab="runes"] .ars-mine, #screen-create[data-ars-tab="runes"] .ars-others { display: none !important; }
#screen-create:not([data-ars-tab="runes"]) .ars-runes { display: none !important; }
.rn { display: grid; gap: 10px; }
.rn-load { display: grid; gap: 6px; padding: 9px; border: 1px solid var(--ui-iron); border-radius: 4px; background: rgba(0, 0, 0, 0.24); }
.rn-load.on { border-color: rgba(201, 184, 255, 0.55); }
.rn-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rn-head b { font: 700 13.5px var(--font-ui); color: var(--ui-gold-hi); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rn-cap { color: var(--ui-dim); font: 700 11px var(--font-ui); letter-spacing: 0.06em; white-space: nowrap; }
.rn-cap.over { color: #ff8a7a; }
.rn-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.rn-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8f7ad8, #c9b8ff); }
.rn-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.rn-slot { min-height: 44px; display: grid; place-items: center; gap: 1px; padding: 4px; border-radius: 3px; border: 1px dashed rgba(201, 184, 255, 0.35); background: rgba(20, 16, 34, 0.5); color: var(--ui-text); cursor: pointer; font: 600 11.5px var(--font-ui); text-align: center; }
.rn-slot.full { border-style: solid; border-color: rgba(201, 184, 255, 0.7); background: linear-gradient(180deg, rgba(70, 56, 120, 0.55), rgba(26, 20, 44, 0.85)); }
.rn-slot b { font-size: 11.5px; line-height: 1.15; }
.rn-slot small { color: #e6c86a; font-size: 9.5px; letter-spacing: 0.08em; }
.rn-plus { color: rgba(201, 184, 255, 0.6); font: 400 20px/1 var(--font-ui); }
.rn-seg button[aria-pressed="true"] { color: var(--ink); background: linear-gradient(180deg, var(--bronze), var(--bronze-deep)); }
.rn-list { display: grid; gap: 6px; }
.rn-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 9px; border: 1px solid var(--ui-iron); border-radius: 3px; background: rgba(0, 0, 0, 0.32); }
.rn-card.on { border-color: rgba(201, 184, 255, 0.7); }
.rn-card.locked { opacity: 0.55; filter: grayscale(0.5); }
.rn-txt { display: grid; gap: 2px; min-width: 0; }
.rn-txt b { font: 700 13px var(--font-ui); color: var(--ui-text); }
.rn-whose { color: var(--ui-dim); font-size: 11px; }
.rn-does { color: #c9b8ff; font-size: 12px; }
.rn-acts { display: grid; gap: 4px; }
.rn-put, .rn-up { padding: 4px 8px; border-radius: 3px; border: 1px solid var(--ui-iron); background: rgba(0, 0, 0, 0.4); color: var(--ui-text); font: 700 11px var(--font-ui); cursor: pointer; white-space: nowrap; }
.rn-put:hover:not(:disabled), .rn-up:hover:not(:disabled) { border-color: var(--ui-gold); }
.rn-put:disabled, .rn-up:disabled { opacity: 0.45; cursor: default; }
/* (v90) three tabs and the rune filter fit the panel's width */
.ars-tabs button { flex: 1 1 0; min-width: 0; padding-left: 6px; padding-right: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rn-seg button { flex: 1 1 0; min-width: 0; padding-left: 6px; padding-right: 6px; }
.rn, .rn-load, .rn-list, .ars-runes { min-width: 0; max-width: 100%; }
.ars-tabs button { flex: 1 1 auto; font-size: 11px; letter-spacing: 0.01em; padding: 7px 4px; }
.rn, .rn-load, .rn-list { grid-template-columns: minmax(0, 1fr); }
.rn-load > *, .rn-head b { min-width: 0; }
.rn-head b { flex: 1 1 auto; }
#ars-tabs.seg button { flex: 1 1 auto; min-width: 0; padding: 7px 5px; font-size: 11px; letter-spacing: 0.01em; }
.rn-slot small i { font-style: normal; color: rgba(255, 255, 255, 0.16); }
/* (v91) destroying runes for ember shards */
.rn-kill { justify-self: end; padding: 5px 10px; border-radius: 3px; border: 1px solid rgba(255, 138, 122, 0.4); background: rgba(60, 14, 10, 0.45); color: #ffb3a6; font: 700 11px var(--font-ui); letter-spacing: 0.04em; cursor: pointer; }
.rn-kill.on { background: rgba(120, 28, 20, 0.7); color: #fff; border-color: #ff8a7a; }
.rn-del { padding: 5px 9px; border-radius: 3px; border: 1px solid rgba(255, 138, 122, 0.55); background: rgba(60, 14, 10, 0.55); color: #ffcfc6; font: 700 11px var(--font-ui); cursor: pointer; white-space: nowrap; }
.rn-del:hover { border-color: #ff8a7a; }
.rn-del.armed { background: #a3281b; color: #fff; border-color: #ffb3a6; }
.rn-all { width: 100%; }
.rn-warn { color: #ffb3a6; }
.rn-n { margin-left: 6px; padding: 0 5px; border-radius: 8px; background: rgba(201, 184, 255, 0.18); color: #e6dcff; font: 700 10.5px var(--font-ui); vertical-align: 1px; }
/* (v92) the gear library (gear-lib-ui.js) */
.gl { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: auto minmax(0, 1fr); background: none; color: var(--ui-text); font-family: var(--font-body); }
.gl[hidden] { display: none; }
.gl-top, .gl-side, .gl-main { background: radial-gradient(ellipse at 30% 0%, rgba(60, 44, 24, 0.4), transparent 70%), rgba(9, 9, 13, 0.97); }
.gl-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 16px 24px 14px; border-bottom: 1px solid var(--bronze-line); }
.gl-eyebrow { margin: 0; color: var(--ui-crimson-hi); font: 700 10.5px var(--font-ui); letter-spacing: 0.18em; text-transform: uppercase; }
.gl-top h2 { margin: 2px 0 0; font: 400 28px var(--font-ui); color: var(--ui-gold-hi); }
.gl-sub { margin: 0; color: var(--ui-dim); font-size: 13.5px; max-width: 60ch; }
.gl-topbtns { display: flex; gap: 8px; }
.gl-topbtns button { padding: 9px 16px; }
.gl-body { display: grid; grid-template-columns: 310px minmax(0, 1fr) minmax(400px, 36vw); min-height: 0; }
/* (v95) your hero in the middle: the world shows through, framed by glCamera */
.gl-stage { position: relative; min-width: 0; min-height: 0; cursor: grab; touch-action: none; user-select: none; box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.55); }
.gl-stage.grab { cursor: grabbing; }
.gl-stagebar { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.gl-stagebar .seg { background: rgba(9, 9, 13, 0.82); }
.gl-stagebar button[aria-pressed="true"] { color: var(--ink); background: linear-gradient(180deg, var(--bronze), var(--bronze-deep)); }
.gl-stagebar .seg[hidden] { display: none; }
.gl-wait { position: absolute; top: 54px; left: 0; right: 0; margin: 0; text-align: center; color: var(--ui-gold-hi); font: 700 12px var(--font-ui); letter-spacing: 0.08em; text-shadow: 0 1px 4px #000; }
.gl-stagehint { position: absolute; bottom: 10px; left: 10px; right: 10px; margin: 0; text-align: center; color: rgba(236, 226, 206, 0.75); font-size: 11.5px; text-shadow: 0 1px 4px #000; pointer-events: none; }
.gl-side { border-right: 1px solid var(--ui-iron); }
.gl-main { border-left: 1px solid var(--ui-iron); }
.gl-side { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 8px; padding: 14px; border-right: 1px solid var(--ui-iron); min-height: 0; }
.gl-tabs button[aria-selected="true"] { color: var(--ink); background: linear-gradient(180deg, var(--bronze), var(--bronze-deep)); }
.gl-filters { display: flex; gap: 6px; }
.gl-sel, .gl-search, .gl-num, .gl-name, .gl-about { background: rgba(0, 0, 0, 0.45); color: var(--ui-text); border: 1px solid var(--ui-iron); border-radius: 3px; font: 500 13px var(--font-body); padding: 6px 8px; min-width: 0; }
.gl-sel:focus, .gl-search:focus, .gl-num:focus, .gl-name:focus, .gl-about:focus { outline: none; border-color: var(--ui-gold); }
.gl-filters .gl-sel { flex: 1 1 0; }
.gl-list { overflow-y: auto; display: grid; align-content: start; gap: 4px; padding-right: 4px; }
.gl-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 6px 8px; border: 1px solid transparent; border-radius: 3px; background: rgba(255, 255, 255, 0.03); color: var(--ui-text); text-align: left; cursor: pointer; }
.gl-row:hover { border-color: var(--ui-iron); }
.gl-row.on { border-color: var(--ui-gold); background: rgba(220, 180, 108, 0.1); }
.gl-ico, .gl-big, .gl-pico, .gl-cico { display: grid; place-items: center; border-radius: 3px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--ui-iron); }
.gl-ico { width: 38px; height: 38px; }
.gl-ico svg, .gl-ico img { width: 28px; height: 28px; }
.gl-rtxt { display: grid; min-width: 0; }
.gl-rtxt b { font: 700 13px var(--font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-rtxt small { color: var(--ui-dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-tag { font: 700 9.5px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 6px; border-radius: 9px; font-style: normal; }
.gl-tag.un { background: rgba(201, 140, 255, 0.18); color: #e2c8ff; }
.gl-tag.rg { background: rgba(134, 184, 106, 0.18); color: var(--moss-hi); }
.gl-tag.st { background: rgba(255, 255, 255, 0.08); color: var(--ui-dim); }
.gl-sidefoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gl-sidefoot small { color: var(--ui-dim); }
.gl-sidefoot button { padding: 7px 12px; }
.gl-main { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.gl-edit { overflow-y: auto; padding: 18px 26px 10px; display: grid; align-content: start; gap: 10px; }
.gl-head { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center; }
.gl-big { width: 76px; height: 76px; }
.gl-big svg, .gl-big img { width: 60px; height: 60px; }
.gl-htxt { display: grid; gap: 4px; }
.gl-name { font: 400 22px var(--font-ui); color: var(--ui-gold-hi); padding: 4px 8px; }
.gl-stats { margin: 0; color: #c9b8ff; font-size: 13px; }
.gl-note { margin: 0; padding: 7px 10px; border-left: 2px solid var(--ui-gold); background: rgba(220, 180, 108, 0.08); color: var(--ui-text); font-size: 13px; }
.gl-h { margin: 8px 0 0; font: 700 12px var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ui-gold); }
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.gl-statgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gl-field { display: grid; gap: 4px; align-content: start; min-width: 0; }
.gl-lab { color: var(--ui-dim); font: 700 10.5px var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; }
.gl-hint { color: var(--ui-dim); font-size: 11.5px; margin: 0; }
.gl-seg button[aria-pressed="true"] { color: var(--ink); background: linear-gradient(180deg, var(--bronze), var(--bronze-deep)); }
.gl-num { width: 100%; max-width: 110px; }
.gl-pair { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gl-pair .gl-sel { flex: 1 1 auto; }
.gl-unit { color: var(--ui-dim); }
.gl-col { width: 38px; height: 30px; padding: 0; border: 1px solid var(--ui-iron); border-radius: 3px; background: none; cursor: pointer; }
.gl-parts { display: flex; gap: 8px; flex-wrap: wrap; }
.gl-part { display: flex; gap: 8px; align-items: center; padding: 5px 10px 5px 5px; border: 1px solid var(--ui-iron); border-radius: 3px; background: rgba(0, 0, 0, 0.3); font: 600 13px var(--font-body); }
.gl-pico { width: 32px; height: 32px; }
.gl-pico svg { width: 26px; height: 26px; }
.gl-cost { display: grid; gap: 5px; max-width: 640px; }
.gl-crow { display: grid; grid-template-columns: 30px minmax(0, 0.9fr) minmax(0, 1.4fr) 84px 30px; gap: 6px; align-items: center; }
.gl-cico { width: 30px; height: 30px; }
.gl-cico svg, .gl-cico img { width: 22px; height: 22px; }
.gl-x { width: 30px; height: 30px; border-radius: 3px; border: 1px solid var(--ui-iron); background: rgba(0, 0, 0, 0.4); color: var(--ui-dim); cursor: pointer; font-size: 16px; }
.gl-x:hover { color: #ff8a7a; border-color: #ff8a7a; }
.gl-add { justify-self: start; padding: 5px 10px; border-radius: 3px; border: 1px dashed var(--bronze-line); background: none; color: var(--ui-gold); font: 700 11.5px var(--font-ui); cursor: pointer; }
.gl-add:disabled { opacity: 0.4; cursor: default; }
.gl-about { width: 100%; max-width: 640px; resize: vertical; }
.gl-foot { display: flex; gap: 8px; margin-top: 6px; }
.gl-foot button { padding: 8px 14px; }
.gl-del { border-color: rgba(255, 138, 122, 0.5); color: #ffb3a6; }
.gl-status { margin: 0; padding: 9px 26px; border-top: 1px solid var(--ui-iron); color: var(--ui-dim); font-size: 12.5px; min-height: 1.4em; }
.gl-empty { color: var(--ui-dim); }
@media (max-width: 1100px) { .gl-body { grid-template-columns: 260px minmax(0, 1fr) 360px; } }
@media (max-width: 760px) {
  .gl-top { grid-template-columns: 1fr; gap: 6px; padding: 12px 16px; }
  .gl-body { grid-template-columns: 1fr; grid-template-rows: 46vh 40vh auto; overflow-y: auto; }
  .gl-stage { order: -1; }
  .gl-main { border-left: 0; }
  .gl-side { border-right: 0; border-bottom: 1px solid var(--ui-iron); }
  .gl-edit { padding: 14px 16px; }
  .gl-crow { grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.3fr) 64px 28px; }
}
