@font-face {
  font-family: 'PixelRus';
  src: url('assets/PixelRus.woff') format('woff');
  font-display: block;
}

:root {
  --fs: 16.5px;            /* replaced at runtime by a whole-device-pixel multiple of 11 */
  --fs-big: 22px;
  --px: 2px;               /* one "art pixel" for UI borders */
  --ink: #ece2c8;
  --muted: #a99a86;
  --bg: #1b1622;
  --bg2: #2a2a3a;
  --wood: #5c3a2a;
  --wood-l: #a5713f;
  --gold: #e0b13a;
  --good: #8cc152;
  --bad: #e47a52;
  --blue: #6cc0e0;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; overscroll-behavior: none; }
body {
  font-family: 'PixelRus', monospace;
  font-size: var(--fs);
  line-height: 1.2;
  -webkit-font-smoothing: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
img { image-rendering: pixelated; }
canvas { image-rendering: pixelated; display: block; touch-action: none; }
button, input { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: calc(var(--fs) * 0.999); opacity: .9; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; margin: 0 0 .5em; }
.row.gap { gap: .5em; }
.row.wrap { flex-wrap: wrap; }
p { margin: .4em 0; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
/* a computer screen: a wider column, so the world and the battle field get bigger */
@media (pointer: fine) and (min-width: 760px) and (min-height: 700px) { #app, #toasts { max-width: 680px; } }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ---------- framed panels (9-slice wood) ---------- */
.panel {
  border-style: solid;
  border-width: calc(var(--px) * 4);
  border-image: url('assets/ui/ui_panel.png') 8 fill / calc(var(--px) * 8) stretch;
  image-rendering: pixelated;
  background-clip: padding-box;
}

.btn {
  border-style: solid;
  border-width: calc(var(--px) * 3) calc(var(--px) * 4) calc(var(--px) * 4);
  border-image: url('assets/ui/ui_btn.png') 5 6 fill / calc(var(--px) * 5) calc(var(--px) * 6) stretch;
  image-rendering: pixelated;
  background: none;
  color: #2b1a12;
  padding: .25em .6em;
  min-height: 2.4em;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .3em;
  white-space: nowrap;
}
.btn:active:not(:disabled) { border-image-source: url('assets/ui/ui_btn_down.png'); transform: translateY(var(--px)); }
.btn:disabled { filter: grayscale(.8) brightness(.7); }
.btn.primary { color: #2b1a12; }
.btn.danger { filter: hue-rotate(-28deg) saturate(1.3); }
.btn.danger:disabled { filter: grayscale(.8) brightness(.7); }
.btn.small { min-height: 1.8em; padding: 0 .5em; }
.btn.wide { width: 100%; margin-top: .6em; }

.slot {
  position: relative;
  width: calc(var(--px) * 20 * 1.5); height: calc(var(--px) * 20 * 1.5);
  min-width: 48px; min-height: 48px;
  border-style: solid;
  border-width: calc(var(--px) * 2);
  border-image: url('assets/ui/ui_slot.png') 4 fill / calc(var(--px) * 3) stretch;
  image-rendering: pixelated;
  display: flex; align-items: center; justify-content: center;
  background: none; padding: 0;
}
.slot.big { width: 64px; height: 64px; }
.slot .ico { width: 75%; height: 75%; object-fit: contain; }
.slot .cnt { position: absolute; right: 2px; bottom: 0; color: var(--ink); text-shadow: 1px 1px 0 #000, -1px 0 0 #000; }
.slot.sel { outline: calc(var(--px) * 1.5) solid var(--gold); outline-offset: -2px; }
.ico-s { width: 1em; height: 1em; vertical-align: -0.12em; }

/* ---------- auth ---------- */
#auth { align-items: center; justify-content: flex-start; padding: 16px; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 30%, #2c5a35 0%, #1f3a2b 40%, #14302e 70%, #1b1622 100%); }
.auth-box { width: min(100%, 380px); padding: 12px 16px; margin: auto 0; flex: none; }
.auth-foot { text-align: center; }
.logo { font-size: calc(var(--fs-big) * 1.5); text-align: center; color: var(--gold); text-shadow: 0 calc(var(--px)*1.5) 0 #6b4a1a, 0 calc(var(--px)*3) 0 #1b1622; margin: .2em 0; }
.tagline { text-align: center; color: var(--muted); margin-bottom: 1em; }
.auth-form { display: flex; flex-direction: column; gap: .6em; }
.auth-foot { margin-top: 1em; }
.field { display: flex; flex-direction: column; gap: .2em; }
.field input {
  background: #14121c; border: var(--px) solid #45475c; padding: .5em .6em; outline: none; border-radius: 0;
  font-size: max(16px, var(--fs));
}
.field input:focus { border-color: var(--gold); }
.shop-daily { display: flex; justify-content: space-between; align-items: baseline; gap: .5em; flex-wrap: wrap; margin-top: .6em; padding: .3em .2em; border-top: var(--px) solid #6b4a1a; color: var(--gold); }
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { flex: 1; min-width: 0; padding-right: 2.8em; }
.pw-wrap input::-ms-reveal, .pw-wrap input::-ms-clear { display: none; }
.pw-eye {
  position: absolute; top: 0; right: 0; bottom: 0; width: 2.6em; padding: 0; border: 0; background: none;
  display: flex; align-items: center; justify-content: center; color: #8a8ca3; cursor: pointer;
}
.pw-eye svg { width: 1.6em; height: auto; fill: currentColor; filter: drop-shadow(0 var(--px) 0 #1b1622); }
.pw-eye:hover, .pw-eye.on { color: var(--gold); }
#auth-error { min-height: 1.3em; margin-top: .5em; text-align: center; }
.bad-input { border-color: #c44a3d !important; }

.tabs { display: flex; gap: .3em; margin: .3em 0 .6em; }
.tab { flex: 1; background: #14121c; border: var(--px) solid #45475c; padding: .45em; cursor: pointer; }
.tab.on { border-color: var(--gold); color: var(--gold); background: #2a2131; }

/* ---------- HUD ---------- */
#hud { padding: calc(6px + var(--safe-t)) 8px 6px; background: linear-gradient(#1b1622, #221b2b); border-bottom: var(--px) solid #3b2420; }
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hud-row.bars { margin-top: 4px; }
.hud-row.bars .bar { flex: 1; }
.hud-right { display: flex; gap: .8em; align-items: center; }
.lvl { color: var(--gold); }
.coins { color: var(--gold); white-space: nowrap; }
.fish-water { position: relative; height: 96px; margin: 8px 0; border: var(--px) solid #23405a; background: repeating-linear-gradient(180deg, #2c6d94 0 10px, #2a6489 10px 20px); overflow: hidden; }
.fish-float { position: absolute; left: 50%; top: 40%; width: 10px; height: 16px; margin-left: -5px; background: linear-gradient(#e8443a 0 50%, #f4f0e6 50%); border: 2px solid #1b1622; transition: transform .15s; }
.fish-water.idle .fish-float { opacity: .25; }
.fish-water.wait .fish-float { animation: bob 1.4s ease-in-out infinite; }
.fish-water.bite .fish-float { animation: bite .18s linear infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }
@keyframes bite { 50% { transform: translateY(14px); } }
.fish-status { text-align: center; min-height: 2.4em; }
.fish-btn.bite { animation: glow .25s infinite alternate; }
.fish-catch { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.hud-gems { color: #9fe3ff; cursor: pointer; }
.hud-right { gap: .6em; }
.wallet { margin-bottom: 6px; }

.bar { position: relative; height: 1.25em; background: #14121c; border: var(--px) solid #0e0b14; overflow: hidden; }
.bar .fill { position: absolute; inset: 0 auto 0 0; transition: width .25s; }
.bar.hp .fill { background: linear-gradient(#e47a52 0 30%, #c44a3d 30% 75%, #8f2e33 75%); }
.bar.xp .fill { background: linear-gradient(#d29ef0 0 30%, #9a5cc0 30% 75%, #6a3a8a 75%); }
.bar.sta .fill { background: linear-gradient(#ffe27a 0 30%, #e0b13a 30% 75%, #a87a24 75%); }
.bar span { position: relative; display: block; text-align: center; line-height: 1.25em; font-size: var(--fs); text-shadow: 1px 1px 0 #000; }

#stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; position: relative;
  background: #14302e; }
canvas.world { box-shadow: 0 0 0 var(--px) #0e0b14; }
#conn { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); background: #5a1f2a; padding: .3em .8em; border: var(--px) solid #1b1622; z-index: 3; }

#actions { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 6px 8px calc(8px + var(--safe-b)); background: linear-gradient(#221b2b, #1b1622); border-top: var(--px) solid #3b2420; }
.act { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #2a2131; border: var(--px) solid #45365a; padding: 6px 2px; cursor: pointer; }
.act img { width: 32px; height: 32px; }
.act:active:not(:disabled) { background: #3e2156; }
.act:disabled { opacity: .45; }
.act.glow { border-color: var(--gold); box-shadow: 0 0 10px #e0b13a66; animation: glow 1.2s infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 2px #e0b13a33; } }
.badge { position: absolute; top: 2px; right: 6px; background: #c44a3d; color: #fff; min-width: 1.2em; padding: 0 .2em; font-weight: normal; }
.badge:empty { display: none; }
/* bookmark ribbons hanging from the top of «Задания»: green — to hand in, red — to do */
.qtab { position: absolute; top: calc(var(--px) * -1); width: 18px; height: 24px; padding-top: 3px; text-align: center; font-size: .8em; font-weight: normal; line-height: 1; color: #fff;
  text-shadow: 1px 1px 0 #0008; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); pointer-events: none; }
.qtab:empty { display: none; }
.qtab.ok { left: 5px; background: linear-gradient(90deg, #5cc06a 0 22%, #3f9a4a 22% 78%, #2c7236 78%); }
.qtab.todo { right: 5px; background: linear-gradient(90deg, #e2685a 0 22%, #c44a3d 22% 78%, #8f2e33 78%); }

/* ---------- battle ---------- */
#battle { background: #14121c; }
.b-head { padding: calc(6px + var(--safe-t)) 8px 6px; background: #1b1622; border-bottom: var(--px) solid #3b2420; }
#b-turn { text-align: center; color: var(--gold); margin-bottom: 4px; }
#b-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#b-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; }
#b-hint { position: absolute; left: 8px; right: 8px; top: 4px; z-index: 5; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; cursor: pointer; opacity: .96; }
.b-progress { margin: .3em 0; }
/* fixed height: a long line must not push the arena up or the buttons down mid-fight */
#b-log { flex: none; height: calc(3 * 1.3em + 8px); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 4px 10px; line-height: 1.3; color: var(--muted); font-size: var(--fs); }
#b-log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#b-help { flex: none; box-sizing: border-box; height: calc(2.6em + 8px + var(--safe-b)); line-height: 1.3; overflow: hidden; }
#b-log div:last-child { color: var(--ink); }
.b-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 0 8px 4px; }
.b-skills { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; }
.b-skills:empty { display: none; }
.b-sk { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 2px; min-width: 0; font-size: .78em; line-height: 1.1; }
.b-sk .ico { width: 32px; height: 32px; image-rendering: pixelated; }
.b-sk .nm { max-width: 100%; font-size: .92em; line-height: 1.05; min-height: 2.1em; display: flex; align-items: center; justify-content: center; text-align: center; white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
/* five skills (level 30+): a touch smaller so the long names wrap into two lines on a 360px phone */
.b-skills:has(> :nth-child(5)) { gap: 3px; }
.b-skills:has(> :nth-child(5)) .b-sk { padding: 3px 1px; font-size: .72em; }
.b-skills:has(> :nth-child(5)) .b-sk .ico { width: 28px; height: 28px; }
.b-skills:has(> :nth-child(6)) { gap: 2px; }
.b-skills:has(> :nth-child(6)) .b-sk { font-size: .66em; }
.b-skills:has(> :nth-child(6)) .b-sk .ico { width: 26px; height: 26px; }
.poison-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9em, 1fr)); gap: 4px; margin-top: .4em; }
.poison-row .talent { text-align: left; }
.b-sk .cd { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.6em; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.b-sk .icw { position: relative; }
.b-sk.on { box-shadow: 0 0 10px #9fe3ff; border-color: #9fe3ff; }
.b-sk:disabled .ico { filter: grayscale(.8) brightness(.7); }
.talent-row { margin: .4em 0 .7em; }
.talent-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: .25em; }
.talent { text-align: left; background: #14121c; border: var(--px) solid #45475c; padding: .5em; color: inherit; font: inherit; cursor: pointer; }
.talent b { color: #ece2c8; }
.talent.on { border-color: var(--gold); background: #2a2131; }
.talent.on b { color: var(--gold); }
.talent.off { opacity: .45; }
.talent:disabled { cursor: default; }
.talent:not(:disabled):hover { border-color: #9fe3ff; }
.b-help { text-align: center; padding: 0 8px calc(8px + var(--safe-b)); min-height: 1.4em; }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; background: #0b0910aa; display: flex; align-items: flex-end; justify-content: center; z-index: 20; opacity: 0; transition: opacity .15s; }
.sheet-wrap.open { opacity: 1; }
.sheet { width: min(100%, 560px); max-height: 86vh; display: flex; flex-direction: column; transform: translateY(20px); transition: transform .15s; margin-bottom: var(--safe-b); }
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 6px; border-bottom: var(--px) solid #45365a; }
.sheet-title { color: var(--gold); font-size: var(--fs-big); }
.icon-btn { background: none; border: none; color: var(--bad); font-size: var(--fs-big); padding: 0 .4em; cursor: pointer; }
.sheet-body { overflow-y: auto; padding: 8px 6px 10px; }

.inv-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 56px)); justify-content: center; gap: 6px; margin: .3em 0 .8em; }
.inv-grid .slot { width: 100%; height: auto; aspect-ratio: 1; cursor: pointer; }
/* gilded backpack rows (gem shop) */
.gold-label { color: var(--gold); text-align: center; letter-spacing: .05em; margin-top: -.3em; }
.inv-grid.gold-grid { padding: 6px; margin-top: .2em; border: calc(var(--px) * 2) solid #b8892c; background: linear-gradient(180deg, rgba(242, 201, 76, .12), rgba(242, 201, 76, .03)); box-shadow: inset 0 0 0 calc(var(--px)) #5c4210, 0 0 10px rgba(242, 201, 76, .25); }
.slot.gold { border-image: none; border: calc(var(--px) * 2) solid #d9a93a; background: linear-gradient(160deg, #4d3c14, #2a2010 60%, #3d2f10); box-shadow: inset 0 0 0 calc(var(--px)) #7a5a1a, inset 0 0 8px rgba(242, 201, 76, .25); }
.shop-row.gold-offer .item-name { color: var(--gold); }
/* loot sack window */
.sack-sheet .loot-item { cursor: pointer; }
.detail { min-height: 7em; }
.item-card { background: #14121c; border: var(--px) solid #3b2f46; padding: 8px; }
.item-card-head { display: flex; gap: 10px; align-items: center; }
.item-name { font-size: var(--fs-big); }
.item-stats { display: flex; flex-wrap: wrap; gap: 4px; margin: .5em 0 .2em; }
.chip { background: #2a2131; border: var(--px) solid #45365a; padding: 0 .4em; white-space: nowrap; }

.eq-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: .8em 0; }
.eq-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; text-align: center; cursor: pointer; padding: 0; }
.eq-slot .slot { width: 52px; height: 52px; }
.eq-slot .small { line-height: 1.05; }
.hero-head { display: flex; gap: 10px; align-items: center; }
.hero-head .bar { margin-top: 4px; }
.stats { display: flex; flex-direction: column; gap: 6px; }
.stat-row { display: flex; align-items: center; justify-content: space-between; background: #14121c; border: var(--px) solid #2a2131; padding: 4px 8px; }
.derived { display: flex; flex-wrap: wrap; gap: 4px; margin: .7em 0 .3em; }
.notice { background: #3e2156; border: var(--px) solid #9a5cc0; padding: .4em .6em; margin-bottom: .5em; }

.keeper { display: flex; gap: 10px; align-items: center; margin-bottom: .6em; }
.shop-list { display: flex; flex-direction: column; gap: 6px; }
.shop-row { display: flex; gap: 8px; align-items: center; background: #14121c; border: var(--px) solid #2a2131; padding: 4px 6px; }
.shop-row.rest { border-color: #6b4a1a; }
.shop-row.owned { opacity: .6; }
.shop-row .btn { min-width: 4.4em; }

.reward { display: flex; gap: 6px; flex-wrap: wrap; margin: .3em 0 .7em; }
.loot { display: flex; flex-wrap: wrap; gap: 8px; margin: .4em 0; }
.loot-item { display: flex; flex-direction: column; align-items: center; width: 72px; text-align: center; line-height: 1.05; }
.loot-item.lost { opacity: .4; }
.loot-item.pick { cursor: pointer; opacity: .45; }
.loot-item.pick.on { opacity: 1; }
.loot-item.pick.on .slot { box-shadow: 0 0 0 2px var(--gold); }
.levelup { display: flex; gap: 8px; align-items: center; background: #3e2156; border: var(--px) solid var(--gold); padding: 6px; margin: .5em 0; }
.levelup img { width: 48px; height: 48px; }
.levelup .lvl-new { color: #e8d9ff; }
.levelup .lvl-btn { margin-top: 4px; }
.result-win .sheet-title { color: var(--good); }
.result-lose .sheet-title { color: var(--bad); }
.help p { margin: .5em 0; }

/* ---------- toasts ---------- */
#toasts { position: fixed; top: calc(70px + var(--safe-t)); left: 0; right: 0; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; z-index: 30; }
.toast { background: #1b1622ee; border: var(--px) solid #45365a; padding: .35em .7em; max-width: 92%; box-sizing: border-box; overflow-wrap: anywhere; text-align: center; transition: opacity .4s, transform .4s; animation: tin .2s; }
.toast.good { border-color: #4f9445; }
.toast.bad { border-color: #c44a3d; color: #f2b8b0; }
.toast.loot { border-color: var(--gold); }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

#loc-info { text-align: center; padding: 0 12px; }
#loc-name { display: none; }
#loc-hint .danger { color: var(--bad); }
/* the journal under the map: game messages, the herald and the chat */
/* three lines high, as wide as the map's frame (main.ts layout) */
#game-log { height: calc(3 * (1.15em + 2px) + 2px); overflow-y: auto; overflow-x: hidden; text-align: left; line-height: 1.15; padding: 1px 2px; margin: 0 auto 4px; max-width: 100%; box-sizing: border-box;
  border-style: solid; border-width: calc(var(--px) * 3);
  border-image: url('assets/ui/ui_panel.png') 8 fill / calc(var(--px) * 6) stretch; image-rendering: pixelated; background-clip: padding-box;
  overscroll-behavior: contain; }
#game-log .gl { position: relative; padding: 1px 2px 1px calc(.55em + 8px); color: var(--ink); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#game-log .gl.full { white-space: normal; overflow-wrap: anywhere; background: #2a213166; }
/* a small pixel diamond before each line, coloured by the kind of message */
#game-log .gl::before { content: ''; position: absolute; left: 3px; top: calc(.58em - 1px); width: calc(var(--px) * 3); height: calc(var(--px) * 3);
  background: #8a7c9e; transform: rotate(45deg); box-shadow: 0 0 0 var(--px) #0b0a10; }
#game-log .gl .t { color: #7d7590; margin-right: .35em; }
#game-log .gl[data-n]::after { content: ' ' attr(data-n); color: var(--gold); }
#game-log .gl.good { color: #a8e092; } #game-log .gl.good::before { background: #6cc04a; }
#game-log .gl.bad { color: #f2b8b0; } #game-log .gl.bad::before { background: var(--bad); }
#game-log .gl.loot { color: var(--gold); } #game-log .gl.loot::before { background: var(--gold); }
#game-log .gl.place { color: #e7d7a6; text-align: center; padding-left: 2px; }
#game-log .gl.place::before { content: none; }
#game-log .gl.chat::before { background: #c9a86a; }
#game-log .gl.chat b { color: var(--gold); }
#game-log .gl.chat.sys { color: var(--blue); } #game-log .gl.chat.sys::before { background: var(--blue); }
#game-log .gl.chat.clan b { color: #8fc7ff; } #game-log .gl.chat.clan::before { background: #8fc7ff; }
#game-log .gl.link { cursor: pointer; }
#game-log .gl.link:hover { background: #2a213166; }
#game-log .gl.new { animation: gl-new 1.4s; }
@keyframes gl-new { from { background: #5a4370aa; } to { background: transparent; } }

/* ---------- appearance picker ---------- */
.look-picker { display: flex; flex-direction: column; gap: 8px; align-items: stretch; background: #14121c; border: var(--px) solid #3b2f46; padding: 6px; }
.look-stage { flex: none; align-self: center; width: 120px; height: 120px; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(circle at 50% 80%, #3f7d3c 0 40%, #2c5a35 41% 60%, transparent 61%); }
.look-preview { width: 120px; height: 120px; }
.look-rows { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.look-row { display: grid; grid-template-columns: 5.5em auto 1fr auto; align-items: center; gap: 4px; }
.look-val { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.look-row .btn.small { min-height: 1.7em; padding: 0 .35em; }
.eq-grid { grid-template-columns: repeat(4, 1fr) !important; }

/* ---------- context button, tracker ---------- */
/* the action button sits on the map itself, bottom centre, so the text under the map stays centred */
#btn-place { position: absolute; left: 50%; bottom: calc(var(--px) * 3); transform: translateX(-50%); z-index: 2; min-width: 7em; line-height: normal; white-space: nowrap; animation: glow 1.2s infinite alternate; }
/* the context button sits at the bottom right: keep the hint and the tracker clear of it */
#tracker { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.trk { color: var(--ink); background: #1b1622aa; border: var(--px) solid #45365a; padding: 1px 6px; cursor: pointer; }
.trk.ready { border-color: var(--gold); color: var(--gold); }
.trk-go { color: var(--gold); margin-left: .5em; white-space: nowrap; }
.trk-note { color: var(--muted); }
.act span { font-size: var(--fs); }

/* ---------- maps ---------- */
.map-pane { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.map-frame { padding: calc(var(--px) * 2); background: #0e0b14; border: var(--px) solid #45365a; }
.map-canvas { display: block; touch-action: pan-x pan-y; }
.map-legend { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.lg { display: inline-block; width: .8em; height: .8em; margin-right: .3em; vertical-align: -.05em; border: 1px solid #1b1622; }
.lg-me { background: #fff; border-radius: 50%; }
.lg-npc { background: #ffe27a; }
.lg-npc2 { background: #e47a52; }
.lg-exit { background: #ece2c8; }
.world-info { align-self: stretch; background: #14121c; border: var(--px) solid #3b2f46; padding: 8px; }
.chip.good { color: var(--good); }

/* ---------- dialogs & quests ---------- */
.dialog-head { display: flex; gap: 10px; align-items: center; margin-bottom: .4em; }
.dialog-text { background: #ece2c8; color: #2b1a12; padding: .6em .7em; border: var(--px) solid #8a7a68; min-height: 3.6em; margin: .4em 0 .6em; }
.dialog-options { display: flex; flex-direction: column; gap: 6px; margin-top: .6em; }
.dialog-options .btn { justify-content: flex-start; white-space: normal; text-align: left; }
.dlg-lore, .dlg-back, .dlg-bye { filter: saturate(.6) brightness(.9); }
.shop-list .keeper { display: flex; flex-direction: column; align-items: stretch; gap: .3em; padding: .45em; border: var(--px) solid #45475c; background: #17141f; }
.keeper-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 0 .6em; text-align: left; }
.keeper .keeper-items { justify-content: flex-start; }
.keeper-items { display: flex; flex-wrap: wrap; gap: 4px; }
.keeper-item { position: relative; }
.keeper-item.alien { opacity: .45; }
.keeper-item.have { box-shadow: 0 0 6px #8cc152; }
.rep-row { display: flex; align-items: center; gap: .6em; text-align: left; }
.rep-bar { height: 6px; margin: 3px 0; background: #2a2533; border: 1px solid #45475c; }
.rep-bar > i { display: block; height: 100%; background: #d8a93c; }
.rep-tiers { margin: .3em 0 .5em; }
.rep-line { color: #d8a93c; margin-top: 2px; }
.rep-chip { color: #d8a93c; }
.shop-row.locked { opacity: .7; }
.story-list { display: flex; flex-direction: column; gap: 6px; }
.story { display: flex; flex-direction: column; gap: .3em; padding: .5em; border: var(--px) solid #45475c; background: #17141f; text-align: left; }
.story.best { border-color: #d8a93c; }
.story-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .6em; }
.story-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.story-foot { align-items: center; }
.story-input { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.friends-pane { display: flex; flex-direction: column; gap: .6em; }
.friends-block .shop-row { align-items: center; gap: .4em; }
.dlg-low { color: var(--muted, #8a8796); filter: saturate(0) brightness(.85); }
.quest-list { display: flex; flex-direction: column; gap: 8px; }
.quest-card { background: #14121c; border: var(--px) solid #45365a; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.quest-card.ready { border-color: var(--gold); }
.goals { display: flex; flex-direction: column; gap: 2px; }
.goal { display: flex; justify-content: space-between; gap: 8px; }
.goal.ok { color: var(--good); }
.quest-card .btn.small { align-self: flex-end; }

/* ---------- chat & mail ---------- */
.hud-btn { position: relative; background: #2a2131; border: var(--px) solid #45365a; padding: 2px 4px; cursor: pointer; line-height: 0; }
.hud-btn img { width: 24px; height: 24px; }
.hud-btn .badge { top: -4px; right: -5px; line-height: 1.25; font-size: .8em; text-align: center; border: 1px solid #1b1622; z-index: 3; }
#chat-ticker { position: absolute; top: 6px; left: 8px; right: 8px; z-index: 2; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
#chat-ticker .tk { background: #1b1622cc; border: var(--px) solid #45365a; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chat-ticker .tk.sys { color: var(--blue); }
#chat-ticker .tk.sys b { color: var(--gold); }
.chat-pane { display: flex; flex-direction: column; gap: 6px; }
.chat-log { height: min(52vh, 420px); overflow-y: auto; background: #14121c; border: var(--px) solid #2a2131; padding: 6px; display: flex; flex-direction: column; gap: 3px; -webkit-user-select: text; user-select: text; }
.chat-msg { line-height: 1.25; word-break: break-word; }
.chat-msg.sys { color: var(--blue); }
.chat-msg.sys b.sys { color: var(--gold); }
.chat-msg.pm { color: #d29ef0; }
.chat-name { background: none; border: none; padding: 0; color: var(--blue); cursor: pointer; }
.chat-name.me { color: var(--good); }
img.crown { width: 14px; height: 12px; image-rendering: pixelated; vertical-align: -1px; margin-right: 3px; }
.glow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.glow-sw { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; background: #2a2131; border: var(--px) solid #45365a; color: var(--ink); font: inherit; cursor: pointer; }
.glow-sw.on { border-color: var(--gold); background: #3a2d44; }
.glow-sw:disabled { opacity: .5; cursor: default; }
.glow-dot { width: 18px; height: 18px; border-radius: 50%; border: var(--px) solid #1b1622; background: repeating-linear-gradient(45deg, #2a2131 0 3px, #45365a 3px 6px); }
.prem-perks { margin: 6px 0 4px 0; padding-left: 1.2em; }
.prem-perks li { margin: 2px 0; }
.chat-send { display: flex; gap: 6px; }
.chat-input, .compose input, .compose textarea, .compose select, .field select, .field textarea {
  flex: 1; min-width: 0; background: #14121c; border: var(--px) solid #45365a; color: var(--ink); padding: .5em .6em; font: inherit; font-size: max(16px, var(--fs)); border-radius: 0;
}
.field textarea, .compose textarea { resize: vertical; }
.tab-badge { background: #c44a3d; color: #fff; padding: 0 .3em; margin-left: .3em; font-weight: normal; }
.shop-row.thread, .shop-row.mail { text-align: left; cursor: pointer; width: 100%; }
.shop-row.mail.unread { border-color: var(--gold); }
.letter { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.letter > .quest-card { align-self: stretch; }
.letter-body { white-space: pre-wrap; background: #ece2c8; color: #2b1a12; padding: .6em .7em; border: var(--px) solid #8a7a68; align-self: stretch; -webkit-user-select: text; user-select: text; }
.compose { display: flex; flex-direction: column; gap: 6px; }
.small-grid .slot { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }

/* travel between lands */
.travel-overlay { position: fixed; inset: 0; z-index: 30; background: #0b0910cc; display: flex; align-items: center; justify-content: center; padding: 16px; }
.travel-box { display: flex; flex-direction: column; gap: 10px; align-items: stretch; max-width: 420px; width: 100%; padding: 14px; }
.travel-box .map-frame { align-self: center; }
.travel-btns { gap: 8px; }
.travel-btns .btn { flex: 1; }

/* photos */
.photo-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; }
.photo-thumb { position: relative; flex: 0 0 72px; height: 72px; padding: 0; border: var(--px) solid #45365a; background: #1b1622; cursor: pointer; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb.pending, .photo-cell.pending { border-color: var(--gold); }
.photo-thumb.rejected, .photo-cell.rejected { opacity: .55; }
.photo-st { position: absolute; left: 0; right: 0; bottom: 0; background: #1b1622cc; font-size: 11px; text-align: center; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 6px 0; }
.photo-cell { display: flex; flex-direction: column; gap: 4px; border: var(--px) solid #45365a; padding: 4px; background: #221b2b; }
.photo-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; }
.photo-cell input { width: 100%; }
.gallery { position: fixed; inset: 0; z-index: 40; background: #0b0910f2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
.gallery-img { max-width: 100%; max-height: calc(100% - 64px); object-fit: contain; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.gallery-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.gallery-cap { color: #ece2c8; min-width: 70px; text-align: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: #6b5d7a; }
.dot.on { background: #7ad36b; box-shadow: 0 0 4px #7ad36b; }
.col.gap { display: flex; flex-direction: column; gap: 8px; }

.link-btn { background: none; border: 0; color: var(--gold); text-decoration: underline; cursor: pointer; padding: .4em; align-self: center; font: inherit; }
.report-btn { margin-left: .5em; vertical-align: middle; }
.chat-msg { cursor: default; }
.row.wrap { flex-wrap: wrap; }
.gold { color: var(--gold); }

/* tutorial */
#tut { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 6; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; pointer-events: auto; }
.tut-head { display: flex; justify-content: space-between; align-items: center; }
.tut-head .link-btn { padding: 0; }
.tut-text { line-height: 1.35; }
.tut-glow { border-color: var(--gold) !important; box-shadow: 0 0 10px #e0b13a99; animation: glow 1s infinite alternate; }
.row > input, .photo-cell input { flex: 1; min-width: 0; background: #14121c; color: inherit; border: var(--px) solid #45475c; padding: .45em .6em; outline: none; border-radius: 0; font: inherit; font-size: max(16px, var(--fs)); }
.row > input:focus, .photo-cell input:focus { border-color: var(--gold); }

/* heroes */
.hero-card { display: flex; align-items: center; gap: 10px; background: #14121c; border: var(--px) solid #3b2f46; padding: 8px; overflow: hidden; }
.hero-card-img { width: 64px; height: 64px; box-sizing: border-box; padding: 2px 2px 4px; image-rendering: pixelated; object-fit: contain; flex: none;
  background: radial-gradient(ellipse 34% 9% at 50% 90%, #2f5a35 0 98%, transparent 100%), #1d1a28; border: var(--px) solid #3b2f46; }
.hero-card .grow { min-width: 0; }
.hero-card .item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card-btns { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.class-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.class-card { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #14121c; border: var(--px) solid #3b2f46; padding: 4px 2px; cursor: pointer; color: inherit; font: inherit; }
.class-card img { width: 72px; height: 72px; image-rendering: pixelated; }
.class-card.on { border-color: var(--gold); background: #2a2131; box-shadow: 0 0 8px #e0b13a55; }
.class-card.on span { color: var(--gold); }
.class-info { background: #14121c; border: var(--px) solid #3b2f46; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.class-info p { margin: 0; }
.class-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; }
/* two in a row while they fit; a long name with its pips never squeezes past the card edge */
.class-stat { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex: 1 1 calc(50% - 6px); min-width: max-content; }
.pips { display: flex; gap: 2px; flex: none; }
.pips i { width: 8px; height: 8px; background: #2a2433; border: 1px solid #45365a; }
.pips i.on { background: var(--gold); border-color: #6b4a1a; }

/* gem shop */
.gem { display: inline-block; width: .8em; height: .8em; transform: rotate(45deg); background: linear-gradient(135deg, #b8f0ff 0 30%, #4fc3e8 31% 65%, #2a7fb8 66%); border: 1px solid #12324a; vertical-align: -0.05em; margin: 0 .15em; }
.gems { white-space: nowrap; }
.gem-balance { font-size: calc(var(--fs-big) * 1.1); color: #9fe3ff; }
.gem-big .gem { width: 22px; height: 22px; margin: 6px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 6px 0; }
.pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #14121c; border: var(--px) solid #3b5a7a; padding: 8px 4px; color: inherit; font: inherit; cursor: pointer; }
.pack:active { background: #1f2a3a; }
.pack b { font-size: var(--fs-big); color: #9fe3ff; }
.pack-bonus { position: absolute; top: 2px; right: 2px; background: #c44a3d; color: #fff; font-size: 11px; padding: 0 3px; }
.right { text-align: right; }
.auth-foot a { color: var(--muted); }
.sheet a { color: #9fe3ff; }
.siege-line { cursor: pointer; }
.tabs.wrap { flex-wrap: wrap; }

/* login calendar */
.daily-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0 12px; }
.daily-cell { position: relative; background: rgba(0,0,0,.25); border: 2px solid #4a3a28; border-radius: 6px; padding: 2px 0 3px; text-align: center; font-size: 10px; line-height: 1.1; min-width: 0; }
.daily-cell .ico { width: 24px; height: 24px; display: block; margin: 0 auto; image-rendering: pixelated; }
.daily-cell .dn { opacity: .7; }
.daily-cell .dv { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 1px; }
.daily-cell.big { border-color: #b08a3a; background: rgba(176,138,58,.18); }
.daily-cell.got { opacity: .45; }
.daily-cell.now { border-color: #ffe27a; box-shadow: 0 0 8px #ffe27a; animation: dailyPulse 1.4s ease-in-out infinite; }
.daily-cell.today { border-color: #8cc152; }
.daily-cell .tick { position: absolute; top: 0; right: 3px; color: #8cc152; font-weight: bold; }
@keyframes dailyPulse { 50% { box-shadow: 0 0 2px #ffe27a; } }
.got-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; }
.got-row { display: flex; align-items: center; gap: 8px; }
.got-row .ico { width: 32px; height: 32px; image-rendering: pixelated; }

/* journal */
.diary-page { background: #e9dcb8; color: #3a2a18; border-radius: 4px; padding: 8px 10px; margin: 6px 0; font-style: italic; box-shadow: inset 0 0 12px rgba(120,80,30,.35); }
.diary-page b { font-style: normal; display: block; margin-bottom: 4px; }
.diary-page.missing { background: rgba(0,0,0,.2); color: inherit; box-shadow: none; }
.shop-row.ach.done { border-color: #b08a3a; }
.good { color: #8cc152; }

/* group strip */
#party { position: absolute; left: 6px; top: 6px; z-index: 5; display: flex; flex-direction: column; gap: 3px; background: rgba(20,16,30,.72); border: var(--px) solid #3b2f46; padding: 4px 6px; min-width: 110px; cursor: pointer; }
#party .pm-name { font-size: 11px; white-space: nowrap; }
#party .pm-bar { height: 4px; background: #5a1f2a; }
#party .pm-bar div { height: 100%; background: #6cc0e0; }
#party .pm-row.away { opacity: .6; }
#party .pm-loc { font-size: 9px; }
.brew-inp { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-top: 2px; }
.brew-inp .chip { display: inline-flex; align-items: center; gap: 2px; }
.chip.bad { color: #e47a52; }

/* ---------- loading screen ---------- */
#loader { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #2a2131, #14111a 70%); transition: opacity .4s; }
#loader.out { opacity: 0; pointer-events: none; }
.loader-box { width: min(80vw, 320px); text-align: center; display: flex; flex-direction: column; gap: 10px; }
.loader-bar { height: 14px; border: var(--px, 2px) solid #45365a; background: #1b1622; padding: 2px; }
.loader-bar .fill { height: 100%; width: 0; background: linear-gradient(#f0c75e, #c8902e); transition: width .2s; }
.ver-link { color: inherit; text-decoration: underline dotted; }
.changelog h4 { margin: 10px 0 4px; color: var(--gold); }
.changelog ul { margin: 0; padding-left: 1.2em; }
.update-bar { position: fixed; left: 8px; right: 8px; bottom: calc(76px + var(--safe-b, 0px)); z-index: 40; display: flex; gap: 8px; align-items: center; justify-content: space-between; background: #1b1622f2; border: var(--px) solid var(--gold); padding: 6px 8px; }

#hud-xp { position: relative; }
#hud-xp .rest { position: absolute; top: 0; bottom: 0; background: rgba(110, 170, 255, .35); pointer-events: none; }

/* ---------- «Книга героев» ---------- */
.top-tabs { flex-wrap: wrap; }
.top-list { display: flex; flex-direction: column; gap: 3px; }
.top-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; background: #1b1622; border: var(--px) solid #2c2338; cursor: pointer; }
.top-row.me { border-color: var(--gold); }
.top-n { min-width: 1.8em; text-align: center; color: var(--muted, #9a8fae); }
.top-n.m1 { color: #ffd34d; } .top-n.m2 { color: #d8dde6; } .top-n.m3 { color: #d79157; }
.where-btn { margin-left: 4px; padding: 0 .4em; min-height: 1.5em; }

.set-block { border: var(--px) solid #5a4a1e; background: #1f1a12; padding: 4px 6px; margin: 4px 0; display: flex; flex-direction: column; gap: 2px; }

/* ---------- scrollbars in the game style: a wooden slider in a dark stone groove ---------- */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: #b07a3a #14121c; } }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #14121c; border: 2px solid #2b2536; box-shadow: inset 2px 2px 0 #0b0a10; }
::-webkit-scrollbar-thumb { background: #b07a3a; border: 2px solid #3a2418; box-shadow: inset 2px 2px 0 #e0a85a, inset -2px -2px 0 #7a4f22; min-height: 28px; }
::-webkit-scrollbar-thumb:hover { background: #c98d45; }
::-webkit-scrollbar-thumb:active { background: var(--gold); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: #14121c; }

.dng-diff { margin-bottom: .6em; display: flex; flex-direction: column; gap: .3em; }
.dng-diff.locked { opacity: .7; }

.gem-info .shop-list { margin-bottom: .6em; }
.gem-info p { margin: .35em 0; }

/* ---------- rarity: legendary and relic items glow in their slots ---------- */
.slot.rar-legendary { box-shadow: inset 0 0 6px rgba(255, 179, 71, .45); }
.slot.rar-relic { box-shadow: inset 0 0 8px rgba(255, 94, 94, .55), 0 0 6px rgba(255, 94, 94, .35); animation: relic-pulse 1.8s ease-in-out infinite alternate; }
@keyframes relic-pulse { from { box-shadow: inset 0 0 5px rgba(255, 94, 94, .4), 0 0 3px rgba(255, 94, 94, .2); } to { box-shadow: inset 0 0 10px rgba(255, 94, 94, .7), 0 0 8px rgba(255, 94, 94, .45); } }
.rar-select { flex: 1; min-width: 0; background: #14121c; color: inherit; border: var(--px) solid #45475c; padding: .4em .5em; border-radius: 0; font: inherit; font-size: max(16px, var(--fs)); }
.rar-select option { background: #14121c; }

/* ---------- captcha ---------- */
.captcha-row { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; }
.captcha-img { width: 100%; max-width: 256px; aspect-ratio: 128 / 44; image-rendering: pixelated; border: var(--px) solid #45475c; background: #1b1a26; }
.captcha-new { min-width: 2.6em; font-size: 1.2em; }

/* ---------- ornate frame around the map and the battle field (art/gen_frame.py) ---------- */
.gframe { position: relative; display: inline-block; line-height: 0;
  border: calc(var(--px) * 8) solid transparent;
  border-image: url('assets/ui/ui_frame.png') 8 / calc(var(--px) * 8) round;
  image-rendering: pixelated;
  box-shadow: 0 calc(var(--px) * 3) 0 rgba(0, 0, 0, .35), 0 0 24px rgba(0, 0, 0, .45); }
.gframe > canvas { display: block; }
/* room for the corner gems that stick out of the frame, so they never touch the HUD or the text */
#stage > .gframe, #b-stage > .gframe { margin: calc(var(--px) * 5) 0; flex: none; }
canvas.world { box-shadow: none; }
.gframe-c { position: absolute; width: calc(var(--px) * 24); height: calc(var(--px) * 24); pointer-events: none; z-index: 1;
  background: url('assets/ui/ui_frame_corner.png') 0 0 / 100% 100%; image-rendering: pixelated; }
.gframe-c.tl { left: calc(var(--px) * -12); top: calc(var(--px) * -12); }
.gframe-c.tr { right: calc(var(--px) * -12); top: calc(var(--px) * -12); transform: scaleX(-1); }
.gframe-c.bl { left: calc(var(--px) * -12); bottom: calc(var(--px) * -12); transform: scaleY(-1); }
.gframe-c.br { right: calc(var(--px) * -12); bottom: calc(var(--px) * -12); transform: scale(-1, -1); }

/* ---------- fights on the location: the skill bar under the HUD bars, the hero menu ---------- */
.rt-bar { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; line-height: 1; margin-top: 5px; }
.rt-bar.stun .rt-row { opacity: .45; }
.rt-row { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.rt-skill { position: relative; width: 30px; height: 30px; padding: 0; display: flex; align-items: center; justify-content: center;
  background: #1b1a26; border: var(--px) solid #45475c; color: inherit; cursor: pointer; }
.rt-skill:active { border-color: var(--gold); }
.rt-skill .ico { width: 24px; height: 24px; image-rendering: pixelated; }
.rt-skill.low .ico { filter: grayscale(1) brightness(.6); }
.rt-sword { font-size: 17px; color: #f0d27a; }
.rt-cd { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-style: normal;
  background: rgba(10, 8, 16, .65); color: #fff; font-size: var(--fs); }
.rt-cd.on { display: flex; }
.rt-hit { touch-action: none; user-select: none; -webkit-user-select: none; }
.rt-gap { width: 4px; }
.rt-pot { border-color: #5c4a2c; }
.rt-pot.empty { color: #7a6a4a; font-size: 16px; border-style: dashed; }
.rt-pot.none .ico { filter: grayscale(1) brightness(.5); }
.rt-n { position: absolute; right: 1px; bottom: 0; font-style: normal; font-size: 10px; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.rt-edit { color: #c9b98a; font-size: 14px; }
.bar-cells { margin: 6px 0; align-items: center; }
.bar-cell { cursor: pointer; }
.bar-cell.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(240, 210, 122, .35); }
.bar-sheet .loot-item { cursor: pointer; }
/* the target plate lies over the top edge of the map */
.rt-chip { position: absolute; top: calc(var(--px) * 2); left: 50%; transform: translateX(-50%); z-index: 3; max-width: 92%; line-height: 1.1;
  display: flex; align-items: center; gap: 4px; padding: 1px 2px 1px 6px; background: #2a1720e6; border: var(--px) solid #a33a32; box-sizing: border-box; }
.rt-chip-name { color: #ffb4a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-chip-hp { flex: none; width: 56px; height: 5px; background: #14101a; display: inline-block; }
.rt-chip-hp i { display: block; height: 100%; background: #e0483c; }
.rt-chip-x { flex: none; background: none; border: 0; color: #ffb4a8; cursor: pointer; font: inherit; padding: 0 4px; line-height: 1.1; }
/* a match on the map (arena, battleground, the dragon, the trial): time, score, the way out */
.mt-bar { position: absolute; top: calc(var(--px) * 2); left: 50%; transform: translateX(-50%); z-index: 3; max-width: 96%; box-sizing: border-box;
  display: flex; align-items: center; gap: 6px; padding: 1px 2px 1px 6px; line-height: 1.1; white-space: nowrap;
  background: #1b1a26e6; border: var(--px) solid var(--gold); }
.mt-title { color: var(--gold); font-weight: normal; }
.mt-time { color: #ece2c8; min-width: 2.6em; text-align: center; }
.mt-time.soon { color: #ffe27a; animation: glow 0.5s infinite alternate; }
.mt-info { color: #c9c3d8; overflow: hidden; text-overflow: ellipsis; }
.mt-leave { flex: none; background: #3a1f24; border: var(--px) solid #a33a32; color: #ffb4a8; font: inherit; padding: 0 6px; cursor: pointer; }
.in-match .rt-chip { top: calc(var(--px) * 2 + 1.6em); }
.rt-menu { position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 150px; background: #1b1a26;
  border: var(--px) solid var(--gold); box-shadow: 0 4px 14px rgba(0, 0, 0, .6); }
.rt-menu-title { padding: 6px 10px; color: var(--gold); border-bottom: var(--px) solid #45475c; }
.rt-menu-item { background: none; border: 0; color: inherit; font: inherit; text-align: left; padding: 8px 10px; cursor: pointer; }
.rt-menu-item:hover, .rt-menu-item.on { background: #2a2131; }
.rt-menu-item.bad { color: #ff8a7a; }

/* mail away from a village mailbox */
.mail-away { padding: 12px 6px; }
.mail-away .ico { width: 80px; height: 64px; image-rendering: pixelated; }
