/* «Бомжи Онлайн РПГ» UI: cardboard panels, masking-tape buttons, marker headings, hi-vis orange for the main action. */
:root {
  /* the game has its own light paper look: a browser in dark mode must not repaint buttons and inputs */
  color-scheme: light;
  --cardboard: #c89b5e;
  --cardboard-light: #d9b27a;
  --cardboard-dark: #8e6536;
  --marker: #1e1b18;
  --tape: #f3e3a6;
  --tape-shadow: #c9b46e;
  --hivis: #ff6a1a;
  --hivis-dark: #c94a08;
  --asphalt: #2b2d31;
  --night: #1b1d22;
  --paper: #f6efe0;
  --good: #4caf50;
  --bad: #d9443a;
  --r0: #9a9a9a;
  --r1: #4caf50;
  --r2: #2f7fe0;
  --r3: #a24de0;
  --r4: #f2b320;
  --r5: #ff3d6e;
  /* headings, tabs, labels: dense and readable */
  --font-display: 'Russo One', 'Rubik', sans-serif;
  /* big moments only (logo, win/lose banner, loot name): worn, dirty letters */
  --font-grunge: 'Rubik Dirt', 'Russo One', sans-serif;
  --font-body: 'Rubik', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --hud-button-size: 56px;
  scrollbar-color: var(--cardboard-dark) transparent;
}

.btn.combat-surrender { position: absolute; z-index: 39; right: calc(10px + var(--safe-right)); bottom: calc(var(--hud-button-size) + 24px + var(--safe-bottom)); display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 28px); min-height: 44px; border: 2px solid #65291f; border-radius: 7px; background: #a23b2d; color: #fff1d2; box-shadow: 0 3px 0 #49251d; clip-path: none; font-size: 14px; }
.combat-surrender > span { font-size: 22px; line-height: 1; }
.combat-targets { position: absolute; z-index: 39; right: calc(10px + var(--safe-right)); bottom: calc(var(--hud-button-size) + 78px + var(--safe-bottom)); width: min(330px, calc(100vw - 24px - var(--safe-left) - var(--safe-right))); padding: 0 7px 8px; border: 2px solid #493323; border-radius: 5px 11px 8px 6px; color: #2b2119; background: repeating-linear-gradient(94deg, #fff0 0 5px, #3523130b 5px 6px), linear-gradient(135deg, #dbb67b, #b98b51); box-shadow: 0 4px 0 #352319, 0 8px 22px #130c0b66, inset 0 0 0 1px #f9e3b888; }
.combat-alert-heading { display: flex; align-items: center; gap: 9px; position: relative; margin: -3px -9px 8px; padding: 10px 12px 11px; color: #fff2d2; background: repeating-linear-gradient(-35deg, #ffffff04 0 2px, #0000 2px 6px), linear-gradient(115deg, #682c25, #943d29 58%, #692a24); border: 1px solid #3d211a; border-bottom: 3px solid #422319; border-radius: 4px 9px 2px 2px; box-shadow: 0 2px 0 #e8c58c66; }
.combat-alert-heading::before, .combat-alert-heading::after { content: ''; position: absolute; top: -7px; width: 32px; height: 13px; background: #e8d097d9; box-shadow: 0 1px 2px #281e1666; transform: rotate(-11deg); clip-path: polygon(2% 4%, 98% 0, 96% 100%, 0 93%); }
.combat-alert-heading::before { left: 10px; }
.combat-alert-heading::after { right: 13px; transform: rotate(13deg); }
.combat-alert-icon { display: grid; place-items: center; flex: 0 0 41px; width: 41px; height: 41px; border: 1px solid #f5c18055; border-radius: 50%; background: #301e1b66; box-shadow: inset 0 2px 3px #180d0b55; }
.combat-alert-icon img { width: 35px; height: 35px; object-fit: contain; filter: drop-shadow(0 2px 0 #26130f); }
.combat-alert-title { flex: 1; min-width: 0; }
.combat-alert-title h2 { margin: 0; font: 17px/1.15 var(--font-display); letter-spacing: -.3px; text-shadow: 0 2px 0 #391b16; }
.combat-alert-title p { margin: 4px 0 0; color: #edc6a0; font: 11px/1.2 var(--font-body); }
.combat-alert-count { display: grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border: 1px solid #ecc89b66; border-radius: 4px; background: #311c19aa; color: #ffe2ac; font: 14px var(--font-display); }
.combat-opponents { display: flex; flex-direction: column; gap: 7px; max-height: min(320px, 33vh); overflow-y: auto; padding: 2px; }
.combat-opponent { position: relative; flex-shrink: 0; padding: 8px 8px 8px 10px; border: 1px solid #8c663b; border-radius: 3px 6px 4px 3px; background: repeating-linear-gradient(2deg, #54381d05 0 1px, #0000 1px 4px), linear-gradient(110deg, #f7ebd0, #e9d6b1); box-shadow: 0 2px 0 #74502e55, inset 0 1px #fff8; }
.combat-opponent.is-current { border-color: #a74722; background: repeating-linear-gradient(2deg, #75472006 0 1px, #0000 1px 4px), linear-gradient(110deg, #fff2cf, #f6d395); box-shadow: inset 3px 0 #d46226, 0 0 0 1px #ffcc74, 0 2px 0 #74502e66; }
.combat-opponent-heading { display: flex; align-items: center; gap: 6px; min-height: 17px; margin-bottom: 6px; }
.combat-opponent-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 13px/1.2 var(--font-display); }
.combat-opponent-badge { flex-shrink: 0; padding: 2px 5px; border-radius: 2px; color: #8f371d; background: #eeb46a66; font: 700 9px var(--font-body); text-transform: uppercase; letter-spacing: .4px; }
.combat-opponent-badge[hidden] { display: none; }
.combat-opponent-actions { display: grid; grid-template-columns: minmax(0, 1fr) 94px; align-items: center; gap: 8px; }
.combat-health { position: relative; height: 25px; overflow: hidden; border: 2px solid #433528; border-radius: 4px 7px 6px 4px; background: #4e4030; box-shadow: 0 1px 0 #fff8, inset 0 2px 2px #1b1a1766; }
.combat-health-fill { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(-50deg, #fff1 0 5px, #0000 5px 10px), linear-gradient(#94b263, #64823b); border-right: 1px solid #fff4; }
.combat-health[data-level="medium"] .combat-health-fill { background: repeating-linear-gradient(-50deg, #fff1 0 5px, #0000 5px 10px), linear-gradient(#e3b759, #b78431); }
.combat-health[data-level="low"] .combat-health-fill { background: repeating-linear-gradient(-50deg, #fff1 0 5px, #0000 5px 10px), linear-gradient(#d96e53, #a53f31); }
.combat-health-heart { position: absolute; z-index: 1; left: 3px; top: 2px; width: 17px; height: 17px; object-fit: contain; filter: drop-shadow(0 1px 0 #3c261b); }
.combat-health-value { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 17px; color: #fff9e5; font: 12px/1 var(--font-display); font-variant-numeric: tabular-nums; text-shadow: -1px -1px 0 #35291c, 1px -1px 0 #35291c, -1px 1px 0 #35291c, 1px 1px 0 #35291c, 0 2px 0 #35291c; }
.combat-target { display: flex; justify-content: center; align-items: center; gap: 4px; width: 100%; min-height: 44px; margin: 0; padding: 3px 5px; border: 1px solid #7e391f; border-radius: 5px 3px 5px 3px; background: linear-gradient(#f6b452, #de7d2d); color: #452618; box-shadow: 0 2px 0 #7b3d22, inset 0 1px #ffe5a477; cursor: pointer; }
.combat-target-fist { width: 25px; height: 25px; flex-shrink: 0; object-fit: contain; filter: drop-shadow(0 1px 0 #fff5); }
.combat-target-label { font: 10px/1 var(--font-display); white-space: nowrap; }
.combat-target:hover { filter: brightness(1.08); }
.combat-target:focus-visible { outline: 3px solid #fff5d7; outline-offset: 2px; }
.combat-target:active { transform: translateY(1px); box-shadow: 0 1px 0 #7b3d22; }
.combat-target[aria-pressed="true"] { border-color: #683921; background: linear-gradient(#785136, #553924); color: #ffe6ad; box-shadow: inset 0 1px 3px #321e19aa, 0 1px #fff6; cursor: default; }
.combat-target[aria-pressed="true"] .combat-target-fist { filter: drop-shadow(0 1px 0 #2c1913); }
@media (max-height: 500px) and (orientation: landscape) {
  .combat-targets { width: 290px; }
  .combat-alert-heading { padding-top: 6px; padding-bottom: 7px; }
  .combat-opponents { max-height: 36vh; }
  .combat-opponent { display: grid; grid-template-columns: minmax(0, 1fr) 82px; grid-template-rows: 16px 25px; gap: 2px 6px; padding: 5px 6px; }
  .combat-opponent-heading { grid-column: 1; grid-row: 1; min-height: 15px; margin: 0; }
  .combat-opponent-name { font-size: 11px; }
  .combat-opponent-badge { padding: 1px 3px; font-size: 7px; }
  .combat-opponent-actions { display: contents; }
  .combat-health { grid-column: 1; grid-row: 2; }
  .combat-target { grid-column: 2; grid-row: 1 / span 2; }
  .combat-target-fist { width: 22px; height: 22px; }
  .combat-target-label { font-size: 9px; }
}
.target-help { grid-column: 1 / -1; }
.target-help[hidden] { display: none; }
#ui:has(.combat-surrender) .context-actions, #ui:has(.combat-surrender) .hud-daily-dock, #ui:has(.combat-surrender) .update-banner { display: none; }
#ui:has(.combat-surrender) .chat { bottom: calc(var(--hud-button-size) + 84px + var(--safe-bottom)); }
.loot-pool-hint { max-width: 42ch; margin: 4px auto; padding: 8px 12px; text-align: center; font-size: 14px; line-height: 1.4; color: var(--paper); background: #1b1d22e8; border-radius: 6px; }
#ui:has(.combat-surrender) .mentor, #ui:has(.loot) .mentor { visibility: hidden; }
.combat-stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.combat-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; padding: 6px 5px; border: 1px solid #99754666; border-radius: 6px; background: #f6edda; box-shadow: 0 2px 0 #76532933; color: var(--marker); text-align: center; }
.combat-stat-icon { width: 28px; height: 28px; object-fit: contain; }
.combat-stat-value { display: flex; align-items: baseline; justify-content: center; gap: 3px; flex-wrap: wrap; min-height: 23px; }
.combat-stat-value b { font: 21px/1.1 var(--font-display); }
.combat-stat-value small { color: #795e40; font-size: 10px; }
.combat-stat-label { display: flex; align-items: center; justify-content: center; min-height: 16px; font: 500 11px/1.3 var(--font-body); color: #6a5034; }
@media (max-width: 420px) { .combat-stat-value b { font-size: 18px; } .combat-stat-label { font-size: 10px; } }
.statline .combat-penalty { color: #a2231d; background: #d9443a18; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
@supports (scrollbar-color: red transparent) {
  * { scrollbar-width: thin; }
}
@supports not (scrollbar-color: red transparent) {
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--cardboard-dark); border-radius: 3px; }
  ::-webkit-scrollbar-button { display: none; }
}
/* pictures are never targets themselves (the button / card around them is): no browser image tools on hover
   (Yandex Browser's "search by image" bar is not allowed in Yandex Games), no dragging, no selecting.
   !important: rules like `#ui .passthrough > *` / `.hud-top > *` are more specific and would hand an <img> that sits
   directly under them its pointer events back */
img { pointer-events: none !important; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
canvas { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
#game canvas { touch-action: none; }

html, body {
  position: fixed;
  inset: 0;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background: var(--night);
  color: var(--marker);
  font: 15px/1.35 var(--font-body);
}

#game { position: fixed; inset: 0; }
#game canvas { display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
/* zero specificity: a class's own `pointer-events: none` (.hud-top, .home-delay, ...) must win over this default */
:where(#ui > *) { pointer-events: auto; }
#ui .passthrough { pointer-events: none; }
#ui .passthrough > * { pointer-events: auto; }

button { font: inherit; color: inherit; }
input, textarea { font: inherit; user-select: text; -webkit-user-select: text; }
/* text fields everywhere: a strip of paper pressed into the cardboard. :where keeps it weightless, so a place with its
   own look (the dark chat, the start screen's nick) still wins */
:where(input:not([type='checkbox'], [type='radio'], [type='range'], [type='button'], [type='submit']), textarea) {
  min-height: 44px; padding: 0 12px; border-radius: 4px; outline: none; box-sizing: border-box;
  border: 2px solid var(--cardboard-dark); background: var(--paper); color: var(--marker);
  font: 600 16px var(--font-body); box-shadow: inset 0 2px 0 #00000024, 0 1px 0 #ffffff55;
  transition: border-color 0.12s, box-shadow 0.12s;
}
:where(textarea) { padding: 10px 12px; }
:where(input, textarea)::placeholder { color: #8e6536; opacity: 0.8; font-weight: 500; }
:where(input:not([type='checkbox'], [type='radio'], [type='range']), textarea):focus {
  border-color: var(--hivis); box-shadow: inset 0 2px 0 #00000024, 0 0 0 3px #ff6a1a40;
}
/* numbers are typed, not clicked: no browser spinner arrows */
input[type='number'] { appearance: textfield; -moz-appearance: textfield; }
input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
:focus-visible { outline: 3px solid var(--hivis); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------- boot */
.boot {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(circle at 50% 40%, #3a3328, var(--night) 70%);
  color: var(--paper);
}
.boot.hidden { opacity: 0; pointer-events: none; }
.boot-logo {
  font: 72px/1 var(--font-grunge); color: var(--tape); transform: rotate(-3deg);
  text-shadow: 3px 3px 0 var(--hivis-dark);
}
.boot-bar { width: min(280px, 70vw); height: 14px; background: #0006; border-radius: 3px; overflow: hidden; }
#boot-progress { height: 100%; width: 0; background: repeating-linear-gradient(45deg, var(--hivis) 0 10px, #ffb07a 10px 20px); transition: width 0.2s; }
.boot-text { font-size: 14px; opacity: 0.8; }

/* ---------------------------------------------------------------- primitives */
.panel {
  position: relative;
  background:
    repeating-linear-gradient(90deg, #0000 0 5px, #00000008 5px 6px),
    linear-gradient(170deg, var(--cardboard-light), var(--cardboard));
  border: 2px solid var(--cardboard-dark);
  border-radius: 6px;
  box-shadow: 0 6px 0 #0004, 0 14px 30px #0006;
}
.tape-label {
  display: inline-block; padding: 4px 14px 3px;
  background: var(--tape); color: var(--marker);
  font: 19px/1.15 var(--font-display); letter-spacing: 0.3px;
  transform: rotate(-1.5deg);
  box-shadow: 0 2px 0 var(--tape-shadow);
  clip-path: polygon(2% 0, 98% 4%, 100% 50%, 97% 100%, 3% 96%, 0 55%);
}
.btn {
  min-height: 48px; min-width: 48px; padding: 8px 16px;
  border: none; border-radius: 3px; cursor: pointer;
  background: var(--tape); color: var(--marker);
  font-weight: 600; font-size: 15px;
  box-shadow: 0 3px 0 var(--tape-shadow), 0 4px 8px #0003;
  clip-path: polygon(1% 0, 99% 3%, 100% 50%, 99% 100%, 1% 97%, 0 50%);
  transition: transform 0.08s;
  touch-action: manipulation;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--tape-shadow); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--hivis); color: #fff; box-shadow: 0 3px 0 var(--hivis-dark), 0 4px 10px #0004; text-shadow: 0 1px 0 #0004; }
.btn.danger { background: var(--bad); color: #fff; box-shadow: 0 3px 0 #8a2620; }
.btn.ghost { background: #0000001f; box-shadow: none; clip-path: none; }
.btn.small { min-height: 40px; padding: 6px 10px; font-size: 14px; }
.btn.block { width: 100%; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; }
.muted { opacity: 0.7; }
.small { font-size: 13px; }
.center { text-align: center; }
.money::after { content: ' ₽'; }
/* English: «$1,500» (fmtCash does the same in text) */
html[lang='en'] .money::after { content: none; }
html[lang='en'] .money::before { content: '$'; }
.rank0 { --rank: var(--r0); } .rank1 { --rank: var(--r1); } .rank2 { --rank: var(--r2); } .rank3 { --rank: var(--r3); } .rank4 { --rank: var(--r4); } .rank5 { --rank: var(--r5); }
.rank-text { color: var(--rank); font-weight: 700; text-shadow: 0 1px 0 #0005; }

/* ---------------------------------------------------------------- HUD */
.update-banner {
  position: absolute;
  z-index: 39;
  bottom: calc(var(--hud-button-size) + 28px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - var(--safe-left) - var(--safe-right) - 20px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border: 2px solid var(--cardboard-dark);
  border-left: 6px solid var(--hivis);
  border-radius: 8px;
  background: var(--cardboard-light);
  color: var(--marker);
  box-shadow: 0 3px 0 var(--cardboard-dark), 0 6px 16px #0006;
}
.update-banner strong { font: 15px var(--font-display); }
.update-available { flex-direction: column; width: 420px; text-align: center; }
.update-available-hint { margin: 0; font-size: 13px; line-height: 1.4; text-wrap: pretty; }
.update-available-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.update-countdown { pointer-events: none; flex-direction: column; gap: 5px; width: 420px; text-align: center; }
.update-countdown strong { font-variant-numeric: tabular-nums; text-align: center; }
.update-countdown-hint { margin: 0; font-size: 12px; line-height: 1.4; text-wrap: pretty; }

.update-dismiss { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: #00000012; font-size: 25px; cursor: pointer; }
.update-banner :focus-visible { outline: 2px solid var(--hivis-dark); outline-offset: 1px; }
.update-countdown .update-dismiss { pointer-events: auto; }
@media (max-width: 600px) and (orientation: portrait) {
  .update-banner { bottom: calc(180px + var(--safe-bottom)); }
}
.updates-overlay { padding-left: max(12px, var(--safe-left)); padding-right: max(12px, var(--safe-right)); }
.updates-modal.modal { width: min(720px, 100%); min-width: 0; max-height: min(860px, 100%); }
.updates-modal .modal-head { flex: none; }
.updates-modal .modal-body {
  flex: 1 1 auto; min-height: 0; padding: 0 10px 0 0; scrollbar-gutter: stable;
  scrollbar-width: auto; scrollbar-color: var(--cardboard-dark) #8e653622;
  -webkit-overflow-scrolling: touch;
}
.updates-modal .modal-body::-webkit-scrollbar { width: 10px; }
.updates-modal .modal-body::-webkit-scrollbar-track { background: #8e653622; border-radius: 8px; }
.updates-modal .modal-body::-webkit-scrollbar-thumb { background: var(--cardboard-dark); border: 2px solid var(--cardboard-light); border-radius: 8px; }
.updates-modal :focus-visible { outline: 2px solid var(--hivis-dark); outline-offset: -2px; }
.updates-modal .modal-body:focus-visible { outline: 1px dashed var(--cardboard-dark); outline-offset: -1px; }
.update-history { display: grid; gap: 16px; min-width: 0; overflow-wrap: anywhere; }
.update-editorial { padding: 16px 20px 20px; border-bottom: 3px double var(--cardboard-dark); }
.update-kicker { font: 600 11px var(--font-body); text-transform: uppercase; letter-spacing: 3px; }
.update-editorial h2 { margin: 10px 0; font: clamp(25px, 5vw, 38px)/1.15 var(--font-grunge); }
.update-editorial p { margin: 0; max-width: 52ch; font-size: 14px; line-height: 1.6; }
.update-entry {
  position: relative; display: grid; gap: 14px; padding: 22px; margin: 0 2px 4px;
  background: repeating-linear-gradient(0deg, #8e653605 0 1px, transparent 1px 4px), var(--paper);
  border: 1px solid #8e653644; border-radius: 3px 9px 5px 3px; box-shadow: 2px 3px 0 #71502f33;
}
.update-entry.latest { border-top: 4px solid var(--hivis); }
.update-entry-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: #694824; }
.update-entry-meta time { font-weight: 600; }
.update-stamp { padding: 4px 7px; border: 2px solid var(--hivis-dark); border-radius: 3px; color: var(--hivis-dark); text-transform: uppercase; font: 11px var(--font-display); transform: rotate(-3deg); }
.update-entry h3 { font: clamp(19px, 3.5vw, 24px)/1.3 var(--font-display); }
.update-entry h3, .update-entry ul { margin: 0; }
.update-entry ul { list-style: none; padding: 0; font-size: 14px; line-height: 1.65; }
.update-entry li { position: relative; padding: 12px 0 12px 22px; border-top: 1px dashed #8e653644; }
.update-entry li::before { content: '+'; position: absolute; left: 0; color: var(--hivis-dark); font: 20px var(--font-display); }
.update-reading-progress { height: 3px; flex: none; margin: 0 0 10px; background: #8e65362a; overflow: hidden; }
.update-reading-progress > span { display: block; height: 100%; background: var(--hivis-dark); }
.update-footer { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px 0; }
.update-scroll-hint { max-width: 32ch; font-size: 12px; line-height: 1.4; color: #573a1e; }
.update-footer .btn { flex: none; min-height: 48px; }
@media (max-width: 480px) {
  .updates-modal.modal { padding: 12px 6px 8px; }
  .updates-modal .modal-head > .tape-label { font-size: 16px; }
  .update-editorial { display: none; }
  .update-entry { padding: 12px; gap: 8px; }
  .update-entry-meta { gap: 5px; font-size: 11px; }
  .update-entry h3 { font-size: 19px; }
  .update-entry li { padding: 8px 0 8px 18px; line-height: 1.45; }
  .update-footer { gap: 10px; }
  .update-footer .btn { max-width: 55%; padding-inline: 12px; font-size: 14px; }
}
@media (max-height: 480px) {
  .updates-modal.modal { padding-top: 4px; }
  .updates-modal .modal-head { margin-top: -12px; margin-bottom: 4px; }
  .update-editorial { padding: 8px 12px; }
  .update-editorial h2 { margin: 0; font-size: 23px; }
  .update-editorial .update-kicker, .update-editorial p { display: none; }
  .update-footer { padding-top: 6px; }
}

.hud-top {
  position: absolute; top: calc(6px + var(--safe-top)); left: 6px; right: 6px;
  display: flex; gap: 6px; align-items: flex-start; pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
  background: #1b1d22d9; color: var(--paper); border-radius: 18px; font-weight: 700; font-size: 15px;
  border: 2px solid #ffffff22; white-space: nowrap;
}
.hud-chips .chip[hidden] { display: none; }
.chip img { width: 22px; height: 22px; }
.chip.money-chip { color: var(--tape); }
.chip.rank-chip { color: #ffd257; }
.chip.cart-chip.full { border-color: var(--bad); color: #ffb0a8; }
.chip.danger-chip { background: #a3241ccc; border-color: var(--bad); color: #fff; font-weight: 700; }
.chip.zone-chip { padding: 0 7px; gap: 4px; font-size: 12px; }
.chip.zone-chip img { width: 18px; height: 18px; }
.chip.safe-chip { background: #203d2eeb; border-color: #81ac73; color: #e2f2d4; }
.zone-chip-label { display: inline; }
.chip.tournament-chip { background: #a3241ccc; border-color: #ff5348; color: #fff; }
.chip.clickable { cursor: pointer; }
.health-bar { display: block; width: 46px; height: 6px; background: #ffffff22; border-radius: 3px; overflow: hidden; }
.health-bar > i { display: block; height: 100%; background: #9be37a; transition: width 0.4s; }
.health-bar.big { width: 100%; height: 12px; border-radius: 6px; margin: 6px 0 4px; background: #0000002a; }
.health-critical .health-bar > i, .health-bar.health-critical > i { background: var(--bad); }
@keyframes glow-fade { 50% { opacity: 1; } }
.chip .bar { width: 46px; height: 6px; background: #ffffff22; border-radius: 3px; overflow: hidden; }
.chip .bar > i { display: block; height: 100%; background: var(--hivis); }
.chip.buff { font-size: 12px; }
.ad-skips-chip.empty { opacity: .72; }
.admin-invisibility[hidden] { display: none; }
.reward-label { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.reward-cost { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 7px; background: #fff5d1; color: #4b2d14; font-size: 12px; line-height: 1.2; white-space: nowrap; box-shadow: inset 0 0 0 1px #67432250; }
.reward-cost > img, .reward-cost > .icon { width: 23px; height: 23px; margin: 0; }
.reward-cost.video { background: #eee4cd; }
.reward-cost.compact { gap: 1px; padding: 1px 3px; font-size: 10px; }
.reward-cost.compact > img, .reward-cost.compact > .icon { width: 16px; height: 16px; }
.reward-cost.compact .reward-cost-text { display: none; }
.home-reward-cost { position: absolute; top: 3px; right: -4px; }
.hud-btn.has-reward-cost > .icon { transform: translateX(-8px); }
.skip-use-preview { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 24px; }
.skip-use-preview > img { width: 68px; height: 68px; object-fit: contain; }
.ad-skip-product { display: grid; place-items: center; position: relative; width: 100%; height: 100%; }
.ad-skip-product > img { width: 110px; height: 110px; object-fit: contain; }
.ad-skip-product-amount { position: absolute; bottom: 4px; right: 8px; padding: 1px 7px; border-radius: 8px; background: #422615; color: #fff2ce; font: 18px var(--font-display); }
/* stretches up to the minimap: only the chips themselves take taps, the gap between them goes to the game */
.hud-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-items: center; align-content: flex-start; pointer-events: none; }
.hud-chips > .hud-chips { display: contents; }
.hud-chips > :not(.hud-chips) { pointer-events: auto; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.minimap {
  position: relative; width: 112px; height: 112px; flex: none;
  border: 3px solid var(--cardboard-dark); border-radius: 8px; background: #000; overflow: hidden;
  box-shadow: 0 4px 10px #0006;
}
/* smooth downscaling: the canvas is drawn bigger than shown, nearest-neighbour turned its nicks into pixel crumbs */
.minimap canvas { width: 100%; height: 100%; display: block; }
.minimap .mm-open { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: none; color: inherit; cursor: pointer; }
.minimap .dname { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; text-align: center; background: #000a; color: var(--paper); }
.minimap .dname > span, .minimap .dname > small { display: block; line-height: 1.25; }
.minimap .dname > small { font-size: 10px; color: #f3d58d; }
.minimap { transition: width 0.2s, height 0.2s; }
.minimap.big { width: 176px; height: 176px; }
.mm-size {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; padding: 0; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px; background: #000000a0; color: #fff; cursor: pointer;
}
body.mm-big .quest, body.mm-big .goal { max-width: calc(100vw - 200px); }
/* the minimap and the emotes button under it: only the two take taps, the space beside the button goes to the game */
.hud-top > .mm-col { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; pointer-events: none; }
.mm-col > * { pointer-events: auto; }
.mm-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; max-width: 194px; gap: 6px; }
.hud-btn.mm-btn { min-width: 0; width: 44px; height: 44px; padding: 0; }
/* starter packs on sale: a gold glow (the orange ring is the story's «tap here») and the gift wiggling now and then */
.hud-btn.mm-pack { box-shadow: 0 0 0 2px #ffd34d, 0 0 12px 3px #ffc21a99; animation: pack-glow 2.4s ease-in-out infinite; }
.mm-pack > .icon { animation: pack-wiggle 4s ease-in-out infinite; }
@keyframes pack-glow { 50% { box-shadow: 0 0 0 2px #ffe58a, 0 0 18px 6px #ffc21acc; } }
@keyframes pack-wiggle { 0%, 82%, 100% { transform: none; } 86% { transform: rotate(-14deg) scale(1.1); } 90% { transform: rotate(12deg) scale(1.1); } 94% { transform: rotate(-6deg); } }

.hud-bottom {
  position: absolute; left: 50%; bottom: calc(6px + var(--safe-bottom)); transform: translateX(-50%);
  display: flex; gap: 6px;
}
.hud-btn {
  min-width: var(--hud-button-size); height: var(--hud-button-size); padding: 0 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  white-space: nowrap; letter-spacing: -0.2px;
  border: 2px solid var(--cardboard-dark); border-radius: 10px; cursor: pointer;
  background: linear-gradient(170deg, var(--cardboard-light), var(--cardboard));
  font-size: 10.5px; font-weight: 700; color: var(--marker);
  box-shadow: 0 3px 0 var(--cardboard-dark);
  position: relative;
}
.hud-btn img { width: 26px; height: 26px; }
.shortcut-anchor { position: relative; }
.shortcut-key { display: none; position: absolute; top: 2px; left: 3px; z-index: 1; min-width: 16px; padding: 1px 3px; border: 1px solid #6d522c; border-radius: 3px; background: #f8e8bd; color: #503519; box-shadow: 0 1px 0 #6d522c; font: 700 10px/13px system-ui, sans-serif; text-align: center; pointer-events: none; }
.keyboard-controls .shortcut-key { display: block; }
.minimap > .shortcut-key { left: auto; right: 3px; }
.hud-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cardboard-dark); }
.hud-btn .badge { position: absolute; z-index: 3; top: -9px; right: -3px; display: flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px; border: 2px solid #fff0c5; border-radius: 12px; background: linear-gradient(#e64b35, #ac201b); color: #fffbea; font: 800 11px/1 var(--font-body); letter-spacing: 0; text-shadow: 0 1px #6a1716; box-shadow: 0 0 0 1px #543020, 0 2px 3px #0008; }
.hud-btn .cd {
  /* a pill above the button: inside it the timer sat on top of the label */
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  padding: 0 5px; border-radius: 8px; background: var(--hivis-dark); color: #fff;
  font-size: 11px; line-height: 16px; font-variant-numeric: tabular-nums; pointer-events: none;
}
.hud-btn .cd:empty { display: none; }

/* A selected player: a small cardboard HUD panel, never a modal over the map. */
.player-target {
  position: absolute; z-index: 25; right: calc(8px + var(--safe-right)); top: var(--target-top, 190px);
  width: 296px; max-width: calc(100% - 16px - var(--safe-left) - var(--safe-right));
  padding: 6px 8px 10px; border: 2px solid var(--cardboard-dark); border-radius: 7px;
  background: repeating-linear-gradient(90deg, #0000 0 5px, #00000006 5px 6px), linear-gradient(165deg, var(--cardboard-light), var(--cardboard));
  color: var(--marker); box-shadow: 0 3px 0 #4e321d80, 0 5px 14px #0005;
}
.art-panel .player-target { background: none; border: 10px solid transparent; border-image: var(--panel-img) 25% fill / 10px stretch; padding: 0 3px 4px; }
.player-target[hidden], #ui:has(> .overlay) .player-target, #ui:has(.combat-surrender) .player-target { display: none; }
#ui:has(> .player-target:not([hidden])) > .mentor { visibility: hidden; }
.player-target-heading { display: flex; align-items: center; gap: 4px; min-height: 44px; margin-bottom: 6px; }
.player-target-who { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.player-target-nick { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 9px; font-size: 15px; }
.player-target-status { padding-left: 7px; font-size: 11px; line-height: 14px; color: #50371f; }
.player-target-close { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; touch-action: none; }
.player-target-close > .icon { width: 27px; height: 27px; }
.player-target-close:hover { background: #5b351619; }
.player-target-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.hud-btn.player-target-action { width: 100%; min-width: 0; height: 62px; padding: 3px 2px 5px; gap: 2px; font-size: 12px; line-height: 15px; letter-spacing: 0; border-radius: 6px; background: linear-gradient(#f3dfad, #e3bc7e); }
.hud-btn.player-target-action > .player-target-icon { display: block; width: 36px; height: 36px; object-fit: contain; flex: none; pointer-events: none; }
.hud-btn.player-target-action.target-attack { background: linear-gradient(#edc493, #dca16a); border-color: #885127; }
.hud-btn.player-target-action:hover { filter: brightness(1.06); }
.hud-btn.player-target-action[aria-pressed="true"] { background: var(--tape); border-color: #5c3b21; box-shadow: inset 0 0 0 1px #5c3b21, 0 3px 0 var(--cardboard-dark); }
@media (max-width: 600px) {
  .player-target, .art-panel .player-target { top: auto; bottom: calc(212px + var(--safe-bottom)); left: calc(8px + var(--safe-left)); right: calc(8px + var(--safe-right)); width: auto; max-width: none; }
}
@media (max-width: 600px) and (max-height: 740px) and (orientation: portrait) {
  .player-target, .art-panel .player-target { bottom: calc(144px + var(--safe-bottom)); right: auto; width: calc(100% - 121px - var(--safe-left) - var(--safe-right)); }
  .art-panel .player-target { padding-left: 0; padding-right: 0; }
  .player-target-actions { gap: 4px; grid-template-columns: minmax(55px, 1fr) minmax(65px, 1.2fr) minmax(51px, 1fr); }
  .hud-btn.player-target-action { padding-left: 0; padding-right: 0; font-size: 11px; }
  /* The same compact stick as landscape leaves room for readable action labels. */
  #ui > .joystick { right: calc(8px + var(--safe-right)); width: 104px; height: 104px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .player-target, .art-panel .player-target { top: auto; bottom: calc(var(--hud-button-size) + 22px + var(--safe-bottom)); left: auto; right: calc(8px + var(--safe-right)); width: 272px; }
  #ui:has(> .player-target:not([hidden])) .context-actions { right: calc(288px + var(--safe-right)); }
}

.hud-followup { display: contents; }
.hud-pins {
  position: absolute; top: calc(var(--hud-chips-h, 48px) + var(--hud-card-h, 0px) + 12px); left: 6px;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; max-width: calc(100vw - 140px);
}
.hud-pins > .pinned-recipe { position: static; }
body.mm-big .hud-pins { max-width: calc(100vw - 200px); }
.context-actions {
  /* bottom-right: the chat owns bottom-left, the minimap top-right */
  position: absolute; right: 6px; bottom: calc(var(--hud-button-size) + 20px + var(--safe-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.context-actions .btn { font-size: 16px; }
.hud-daily .daily-short { display: none; }
.hud-daily-dock {
  position: absolute; left: calc(74px + var(--safe-left, 0px)); bottom: calc(104px + var(--safe-bottom)); transform: translateY(50%);
}
.hud-daily-dock > .hud-daily {
  min-height: 40px; font-size: 14px; white-space: nowrap;
}
.hud-daily-dock > .hud-daily .daily-full { display: none; }
.hud-daily-dock > .hud-daily .daily-short { display: inline; }


.icon { width: 1.5em; height: 1.5em; object-fit: contain; vertical-align: middle; flex: none; display: inline-block; }
.btn > .icon, .btn > .btn-img { margin-right: 6px; vertical-align: -0.35em; }
.btn-img { width: 1.6em; height: 1.6em; object-fit: contain; }
.toast { display: flex; align-items: center; justify-content: center; gap: 8px; }
.toast > .icon { width: 28px; height: 28px; }
.chat-signup-toast { display: flex; align-items: center; gap: 8px; max-width: min(78vw, 340px); }
.chat-signup-toast > span { text-align: left; }
.chat-signup-toast > .btn { flex: none; white-space: nowrap; }
.goal-icon { flex: none; display: flex; }
.goal-icon .icon { width: 28px; height: 28px; }
.section-title .icon { margin-right: 4px; }
.sys-ico .icon { width: 20px; height: 20px; }
.goal-row-icon .icon { width: 36px; height: 36px; }
.goal-ok .icon { width: 26px; height: 26px; }
.goal-where { display: flex; align-items: center; justify-content: center; gap: 8px; }
.goal-where .icon { width: 36px; height: 36px; }
.unlock .icon { width: 24px; height: 24px; }
.lb-place .icon { width: 28px; height: 28px; }
.emoji-icon { font-size: 1.2em; line-height: 1.25; text-align: center; }
.hud-btn .icon { width: 28px; height: 28px; font-size: 22px; }
.chip .icon { width: 24px; height: 24px; font-size: 17px; }
.chip .emoji-icon { font-size: 18px; }
.goal {
  position: absolute; top: calc(var(--hud-chips-h, 48px) + var(--quest-h, 0px) + 12px); left: 6px; max-width: min(520px, calc(100vw - 140px));
  display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; min-height: 36px;
  background: var(--tape); color: var(--marker); border: none; cursor: pointer; text-align: left;
  font: 600 13.5px/1.25 var(--font-body); box-shadow: 0 3px 8px #0004; transform: rotate(-0.4deg);
  clip-path: polygon(0 4%, 99% 0, 100% 96%, 1% 100%);
}
.goal-help { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--marker); color: var(--tape); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.help-step { display: flex; gap: 10px; align-items: center; background: var(--paper); border-radius: 6px; padding: 8px 10px; }
.help-pic { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.help-pic img { width: 100%; height: 100%; object-fit: contain; }

/* ---- real art skins (enabled from main.ts when the files exist; slice sizes match docs/art/prompts.md) */
.item.framed { border-color: transparent; }
.item .count-tag {
  position: absolute; right: -4px; bottom: -4px; min-width: 22px; padding: 0 5px; border-radius: 9px; z-index: 2;
  background: var(--marker); color: var(--tape); font: 700 12px/18px var(--font-body); text-align: center; box-shadow: 0 0 0 2px var(--paper);
}
.item .rank-frame { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); pointer-events: none; }
.brand-title small, .boot-logo small { display: block; font: 24px/1.2 var(--font-display); margin-top: 8px; }
.logo-img { width: min(420px, 80vw); height: auto; display: block; margin: 0 auto 6px; }
.art-panel .panel { background: none; border: 16px solid transparent; border-image: var(--panel-img) 25% fill / 16px stretch; box-shadow: none; }
.art-button .btn:not(.primary):not(.danger) { background: none; border: 12px solid transparent; border-image: var(--button-img) 32 fill / 12px stretch; clip-path: none; box-shadow: none; padding: 0 6px; }

/* ---------------------------------------------------------------- toasts */
/* over the windows too: a window's own errors ("not enough toys") must be seen */
.toasts { z-index: 96; position: absolute; top: calc(140px + var(--safe-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast {
  background: var(--tape); color: var(--marker); padding: 8px 14px; font-weight: 600; text-align: center;
  box-shadow: 0 3px 8px #0005; transform: rotate(-0.7deg);
  animation: toast-in 0.25s ease-out, toast-out 0.4s ease-in 2.6s forwards;
}
.toast.bad { background: #ffd2cc; }
/* Plain feedback must not swallow taps, including while its exit animation is invisible. */
#ui .toasts > .toast { pointer-events: none; }
#ui .toasts > .toast :is(button, a, input, [role="button"]) { pointer-events: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) rotate(-0.7deg); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* Frequent loot feedback sits below the settings column, away from the player. */
.activity-toasts {
  position: absolute; z-index: 95; top: calc(var(--hud-tools-bottom, 190px) + 8px); right: calc(6px + var(--safe-right));
  width: min(240px, 46vw); display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  max-height: max(0px, calc(100dvh - var(--hud-tools-bottom, 190px) - var(--hud-button-size) - 28px - var(--safe-bottom)));
  overflow: hidden; padding: 2px 0 6px 6px; box-sizing: border-box;
}
#ui .activity-toasts, #ui .activity-toasts * { pointer-events: none; }
.activity-toast {
  position: relative; display: flex; align-items: center; gap: 7px; box-sizing: border-box; width: 100%; padding: 7px 8px;
  background: linear-gradient(120deg, #393026f2, #24211fed); color: var(--paper);
  border: 1px solid #e6c28b38; border-left: 2px solid #d9b474; border-radius: 9px;
  box-shadow: 0 3px 6px #0003, inset 0 1px 0 #fff1; font: 500 12px/1.35 var(--font-body);
  text-align: left; animation: activity-toast-life var(--activity-toast-duration, 4s) linear forwards;
}
.activity-toast::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: 0; height: 1px; background: #dfbd7c66;
  transform-origin: left; animation: activity-toast-time var(--activity-toast-duration, 4s) linear forwards;
}
.activity-toast-icon {
  display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 7px;
  background: #e9bd7014; box-shadow: inset 0 0 0 1px #eccb8c26; color: #e9ce9b; font: 600 16px/1 var(--font-body);
}
.activity-toast-icon > .icon { width: 20px; height: 20px; }
.activity-toast-copy { min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
@keyframes activity-toast-life {
  0% { opacity: 0; transform: translateX(8px); }
  8%, 89% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(4px); }
}
@keyframes activity-toast-time { to { transform: scaleX(0); } }
@media (max-height: 500px) and (orientation: landscape) {
  .activity-toast { padding: 5px 7px; font-size: 11.5px; }
  .activity-toast-copy { -webkit-line-clamp: 2; }
  .activity-toast-icon { width: 24px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .activity-toast { animation: activity-toast-fade 0.25s linear 2.15s forwards; }
  .activity-toast::after { display: none; }
}
@keyframes activity-toast-fade { to { opacity: 0; } }

/* a private message: a phone's push banner from the top edge, over the windows too; a tap opens that conversation */
.dm-push {
  position: absolute; z-index: 97; top: calc(8px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  width: min(94vw, 400px); display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px;
  background: #fffdf7; color: var(--marker); text-align: left; font: inherit; cursor: pointer;
  touch-action: none; user-select: none; translate: var(--push-x, 0px) var(--push-y, 0px);
  border: 3px solid #1e1b18; border-left: 8px solid #2a95d6; border-radius: 16px;
  box-shadow: 0 6px 0 #1e1b18, 0 10px 24px #000a;
  animation: push-in 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.dm-push:active { transform: translateX(-50%) translateY(3px); box-shadow: 0 3px 0 #1e1b18, 0 6px 16px #000a; }
.dm-push.dragging { transform: translateX(-50%); animation: none; }
.dm-push.out { pointer-events: none; animation: push-out 0.25s ease-in forwards; }
.dm-push-ico { flex: none; width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(#6cc8f4, #1f7fc4); display: grid; place-items: center; box-shadow: inset 0 -3px 0 #0003; animation: push-ring 0.5s 0.4s 2; }
.dm-push-ico .app-svg { width: 40px; height: 40px; }
.dm-push-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.dm-push-app { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: #1b6ea8; text-transform: uppercase; letter-spacing: 0.04em; }
.dm-push-app span { color: #8a8170; text-transform: none; letter-spacing: 0; font-weight: 600; }
.dm-push b { font: 17px/1.2 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-push-n { display: inline-block; margin-left: 6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #f2392b; color: #fff; font: 700 12px/20px var(--font-body); text-align: center; vertical-align: 2px; }
.dm-push-msg { font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@keyframes push-in { from { transform: translateX(-50%) translateY(-140%); } }
@keyframes push-out { to { transform: translateX(-50%) translateY(-140%); opacity: 0; } }
@keyframes push-ring { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
/* the HUD's phone shakes with it */
.hud-btn.ringing > .icon { animation: push-ring 0.4s ease-in-out 3; }

/* ---------------------------------------------------------------- modal */
.overlay {
  /* every window is its own layer: z-indexes inside one (the casino's drawn machine) never poke through the next */
  isolation: isolate;
  z-index: 40;
  position: absolute; inset: 0; background: #14161acc; display: flex; align-items: center; justify-content: center;
  padding: calc(10px + var(--safe-top)) 10px calc(10px + var(--safe-bottom));
  animation: fade 0.15s;
}
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; padding: 14px 14px 12px; }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; gap: 8px; margin: -26px 0 10px -4px; }
/* a long title wraps to a second line instead of pushing the close button off a narrow phone */
.modal-head .tape-label { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.modal-head .spacer { flex: 1; }
/* ✕: a cardboard button with the drawn crossed sticks, pressed in like the HUD buttons */
.modal-close, .modal-help {
  width: 46px; height: 46px; border-radius: 50%; flex: none; margin-top: 18px; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--marker); font-size: 20px; font-weight: 700;
  border: 2px solid var(--cardboard-dark); background: linear-gradient(170deg, var(--cardboard-light), var(--cardboard));
  box-shadow: 0 3px 0 var(--cardboard-dark), 0 4px 8px #0005;
}
.modal-close:active, .modal-help:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cardboard-dark); }
.modal-close .icon, .modal-help .icon { width: 30px; height: 30px; font-size: 20px; }
.report-topics { min-width: 0; margin: 0; padding: 0; border: 0; }
.report-topics legend { margin-bottom: 8px; padding: 0; }
.report-topic {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 10px;
  border: 2px solid var(--cardboard-dark); border-radius: 4px; background: var(--tape); cursor: pointer;
}
.report-topic input { margin: 0; accent-color: var(--hivis); }
.report-topic:has(input:checked) { border-color: var(--hivis); background: var(--paper); }
.report-topics:disabled .report-topic { cursor: default; opacity: 0.7; }
.problem-report textarea { width: 100%; resize: vertical; touch-action: pan-y; }
.problem-report [role='status']:empty { display: none; }
.modal-body { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 2px; flex: 1; min-height: 0; }
.section-title { font: 16px var(--font-display); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: 0.6px; color: #3d2a14; }

.tabs { display: flex; gap: 4px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; flex: none; cursor: grab; -webkit-overflow-scrolling: touch; }
.tabs:active { cursor: grabbing; }
.tabs::-webkit-scrollbar { display: none; }
.tabs-scroll { position: relative; min-width: 0; margin-bottom: 10px; }
.tabs-scroll > .tabs { min-width: 0; margin-bottom: 0; }
.tabs-scroll.is-overflowing { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 2px; }
.tabs-scroll-arrow { display: none; align-items: center; justify-content: center; min-height: 44px; padding: 0; border: 1px solid #927044; border-radius: 6px; background: linear-gradient(#f4dfb5, #cba670); color: #503819; font: 30px/1 var(--font-display); cursor: pointer; box-shadow: inset 0 1px 0 #fff6d788; }
.tabs-scroll.is-overflowing > .tabs-scroll-arrow { display: flex; }
.tabs-scroll-arrow:disabled { visibility: hidden; }
.tabs-scroll-arrow:hover { filter: brightness(1.1); }
.tabs-scroll::before, .tabs-scroll::after { content: ''; position: absolute; z-index: 1; top: 0; bottom: 0; width: 22px; pointer-events: none; opacity: 0; }
.tabs-scroll::before { left: 38px; background: linear-gradient(to right, #533b24a8, transparent); }
.tabs-scroll::after { right: 38px; background: linear-gradient(to left, #533b24a8, transparent); }
.tabs-scroll.is-overflowing.can-scroll-left::before, .tabs-scroll.is-overflowing.can-scroll-right::after { opacity: 1; }
.tabs-scroll .tab { max-width: 100%; overflow-wrap: anywhere; }
.tab {
  flex: none; min-height: 44px; padding: 6px 14px; font-family: var(--font-display); font-weight: 400; font-size: 14px; letter-spacing: 0.3px; border: 2px solid var(--cardboard-dark); border-radius: 6px 6px 0 0; border-bottom-width: 0;
  background: #00000014; cursor: pointer; font-weight: 700; font-size: 14px;
  /* black ink on the paper: without it a browser in dark mode draws button text white */
  color: var(--marker);
}
.tab.active { background: var(--paper); }

.card { background: var(--paper); border-radius: 6px; padding: 10px; border: 1px solid #0002; }
.card + .card { margin-top: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.kv > :nth-child(odd) { opacity: 0.7; }

/* item grid */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; }
.storage-pages { justify-content: center; }
.storage-toolbar { display: flex; align-items: center; gap: 6px; }
.storage-toolbar > .row { min-width: 0; }
.storage-toolbar > .row > .btn { max-width: 100%; }
.storage-filter { flex: 1 1 90px; min-width: 88px; max-width: 140px; }
.storage-filter-trigger.btn.small {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  width: 100%; min-height: 44px; text-align: left;
}
.art-button .storage-filter-trigger.btn.small:not(.primary):not(.danger) {
  border-width: 9px; border-image-width: 9px; padding: 0 3px 0 5px;
}
.storage-filter-value { min-width: 0; overflow-wrap: anywhere; line-height: 1.12; }
.storage-filter-arrow {
  display: grid; place-items: center; flex: none; width: 21px; height: 21px;
  border: 1px solid #8e65365c; border-radius: 50%; background: #a26f3c22; color: #603b20;
}
.storage-filter-arrow::after {
  content: ''; width: 6px; height: 6px; border-right: 2px solid; border-bottom: 2px solid;
  transform: translateY(-1px) rotate(45deg);
}
.storage-filter-trigger[aria-expanded="true"] .storage-filter-arrow::after { transform: translateY(1px) rotate(225deg); }
.storage-filter-menu {
  position: fixed; z-index: 8; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 4px;
  overflow: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 4px;
  border: 2px solid #78532f; border-radius: 3px 6px 3px 5px;
  background: repeating-linear-gradient(92deg, #0000 0 5px, #00000008 5px 6px), linear-gradient(170deg, var(--cardboard-light), var(--cardboard));
  filter: drop-shadow(0 3px 2px #2a1b12bb) drop-shadow(0 8px 12px #21140766);
}
.art-panel .storage-filter-menu {
  background: none; border: 10px solid transparent; border-image: var(--panel-img) 25% fill / 10px stretch;
}
.storage-filter-menu[hidden] { display: none; }
.storage-filter-menu.opens-above { transform: translateY(-100%); }
.storage-filter-option {
  display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; min-height: 44px; padding: 3px 8px;
  border: 0; background: var(--tape); color: var(--marker);
  clip-path: polygon(1% 3%, 98% 1%, 100% 47%, 98% 97%, 2% 100%, 0 52%);
  text-align: left; font: 700 14px/1.12 var(--font-body); overflow-wrap: anywhere; cursor: pointer;
}
.storage-filter-option[aria-checked="true"] {
  background: var(--hivis); color: #fff; text-shadow: 0 1px #672700;
}
.art-button .storage-filter-option:not([aria-checked="true"]) {
  background: none; clip-path: none; padding: 0 4px;
  border: 8px solid transparent; border-image: var(--button-img) 32 fill / 8px stretch;
}
.art-button-primary .storage-filter-option[aria-checked="true"] {
  background: none; clip-path: none; padding: 0 4px;
  border: 8px solid transparent; border-image: var(--button-primary-img) 32 fill / 8px stretch;
}
.storage-filter-check { flex: none; }
.storage-filter-option:focus-visible, .storage-filter-trigger:focus-visible { outline: 2px solid #8c4825; outline-offset: -3px; }
.storage-filter-option[aria-checked="true"]:focus-visible { outline-color: #ffedb9; }
.storage-filter-option:hover { filter: brightness(1.07); }
@media (max-width: 360px) {
  .storage-toolbar .btn.small { font-size: 13px; }
  .art-button .storage-toolbar > .row > .btn.small:not(.primary):not(.danger) {
    border-width: 9px; border-image-width: 9px; padding: 0 4px;
  }
}
.storage-pages > span { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.item {
  position: relative; aspect-ratio: 1; border-radius: 6px; cursor: pointer;
  background: radial-gradient(circle at 50% 40%, #fff8, #fff0 70%), var(--paper);
  border: 3px solid var(--rank, #999); display: flex; align-items: center; justify-content: center; padding: 4px;
}
.item img { width: 100%; height: 100%; object-fit: contain; }
.food-cooldown { position: absolute; inset: 0; z-index: 4; border-radius: inherit; display: grid; place-items: center; pointer-events: none; overflow: hidden; }
.food-cooldown[hidden] { display: none; }
.food-cooldown::before { content: ''; position: absolute; inset: 0; background: conic-gradient(from 0deg, transparent 0 var(--cooldown-elapsed, 0%), #171a21b8 var(--cooldown-elapsed, 0%) 100%); }
.food-cooldown > b { position: relative; color: #fff; font: 700 22px var(--font-display); font-variant-numeric: tabular-nums; line-height: 1; text-shadow: 0 2px 2px #000, 1px 0 2px #000, -1px 0 2px #000; }
/* the slot name sits on a strip under the picture, never over it */
.item .slot-tag {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 1px 2px; text-align: center;
  font-size: 10px; font-weight: 700; line-height: 1.3; color: var(--paper); background: #1e1b18cc; border-radius: 0 0 6px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item.empty .slot-tag { background: none; color: inherit; opacity: 0.6; top: 50%; bottom: auto; transform: translateY(-50%); }
/* chosen (for the sale…): the frame alone was lost against the rarity's; a check in the bottom-left corner and a warm
   backing say it plainly (the bottom-right is the stack's count) */
.item.selected { outline: 3px solid var(--hivis); outline-offset: 1px; background: radial-gradient(circle at 50% 40%, #fff8, #fff0 70%), #ffd9bf; }
.item.selected::after {
  content: '✓'; position: absolute; left: -5px; bottom: -5px; z-index: 3; width: 24px; height: 24px; border-radius: 50%;
  background: var(--hivis); color: #fff; font: 700 16px/24px var(--font-body); text-align: center; box-shadow: 0 0 0 2px var(--paper);
  pointer-events: none;
}
.item.empty { border-style: dashed; border-color: #0003; cursor: default; }
.item .count { position: absolute; right: 3px; bottom: 1px; font-size: 11px; font-weight: 700; }

.item-card { display: flex; gap: 10px; align-items: center; }
.item-card .item { width: 84px; flex: none; }
.item-preview { gap: 14px; }
.item-preview-head { display: flex; align-items: center; gap: 14px; }
.item-preview-head > .item { width: 88px; height: 88px; flex: none; padding: 7px; border-width: 2px; border-radius: 8px 12px 7px 10px; background: radial-gradient(ellipse at 50% 35%, #fffaf0, #e4cfaa); box-shadow: 0 3px 0 #6b4b2826, inset 0 0 0 3px #fff8; cursor: default; }
.item-preview-head > .col { min-width: 0; gap: 5px; }
.item-preview-kind { color: #806647; font: 600 10px/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 1.2px; }
.item-preview-name { color: #302319; font: 19px/1.25 var(--font-display); overflow-wrap: anywhere; }
.item-preview-rarity { align-self: flex-start; padding: 3px 7px; border: 1px solid #8b6c3e30; border-radius: 4px; background: #fff8; font-size: 12px; line-height: 1.2; }
.item-preview-meta { color: #785b39; font: 500 11px/1.3 var(--font-body); }
.item-preview-stats { padding: 11px; border: 1px solid #9a794540; border-radius: 7px; background: #fff8; box-shadow: inset 0 1px #fff9; }
.item-preview-section-title { margin-bottom: 8px; color: #806647; font: 700 10px/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 1px; }
.item-preview .statline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.item-preview .statline > span { padding: 6px 7px; border: 1px solid #80603916; border-radius: 4px; background: #8060390a; color: #46331f; font: 500 12px/1.35 var(--font-body); overflow-wrap: anywhere; }
.item-preview .statline > .combat-role { grid-column: 1 / -1; padding: 4px 7px; border: 0; border-left: 3px solid #a67a42; border-radius: 2px; background: #af82451a; color: #765124; font-weight: 700; }
.item-preview .statline > .combat-penalty { background: #c94d3910; border-color: #bc4c3426; color: #a03827; }
.panel.item-preview-modal, .art-panel .panel.item-preview-modal { width: min(460px, 100%); padding: 12px 14px 14px; border: 2px solid #76522f; border-radius: 8px 15px 9px 12px; background: repeating-linear-gradient(95deg, #fff0 0 5px, #55351804 5px 6px), linear-gradient(130deg, #f9efd6, #ecd6ad); box-shadow: 0 5px 0 #3a2619bb, 0 18px 55px #0008, inset 0 0 0 3px #fff5; }
.item-preview-modal .modal-head { flex-shrink: 0; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px dashed #9e7c4e66; }
.item-preview-modal .modal-head > .tape-label { padding: 4px 10px; font: 12px/1.3 var(--font-display); }
.item-preview-modal .modal-body { padding: 3px; }
.statline { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.statline span { background: #0000000f; padding: 1px 6px; border-radius: 4px; }
.statline .combat-role { font-weight: 700; background: #79552e1c; border: 1px solid #79552e55; }

.shop-row { display: flex; gap: 10px; align-items: center; padding: 8px; background: var(--paper); border-radius: 6px; }
.shop-row.trap-row { background: #f6edda; color: #3b2c1b; text-shadow: none; }
.shop-row.trap-row .muted { color: #604930; opacity: 1; }
.shop-row + .shop-row { margin-top: 6px; }
.shop-row .item { width: 56px; flex: none; }
/* on a narrow phone the name wraps; the button and the price never get squeezed under their own words */
.shop-row > .col { min-width: 0; overflow-wrap: anywhere; }
.shop-row > .btn, .shop-row > .small { flex: none; }
.shop-row.clickable { cursor: pointer; }
.shop-row.clickable:active { transform: scale(0.99); }
.shop-desc { display: flex; align-items: center; gap: 4px; font-size: 13px; opacity: 0.85; }
.shop-desc .icon { width: 20px; height: 20px; }
.shop-more { flex: none; font-size: 26px; opacity: 0.4; padding-left: 2px; }
.product-card { align-items: stretch; }

/* ---------------------------------------------------------------- the shop for real money (the bottom-row «Магазин») */
.prem-shop { gap: 4px; }
/* the real-money button: green, never the hi-vis orange of the game's own actions */
.btn.prem-buy { background: linear-gradient(#45d465, #1f9e3c); color: #fff; box-shadow: 0 3px 0 #156b2a, 0 4px 10px #0004; text-shadow: 0 1px 0 #0005; }
.btn.prem-buy .prem-price { margin-left: 10px; padding: 0 8px; border-radius: 6px; background: #0003; }
.reward-limit { font-size: 11px; font-weight: 600; opacity: .8; }
.ads-products .tone-instantRewards { grid-column: 1 / -1; }
.ads-products .prem-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.tone-instantRewards .prem-pic > img { width: 112px; height: 112px; }
.ads-daily-limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.ads-daily-limits > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px; border-radius: 8px; background: #0002; }
.prem-vip {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 12px;
  color: #fff6dc; background: radial-gradient(120% 90% at 100% 0, #f2b32088, transparent 60%), linear-gradient(140deg, #2a1d0c, #5b3a0e 55%, #8a5a12);
  box-shadow: 0 0 0 2px #f2b320, 0 6px 18px #0006;
}
.prem-vip::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 40%, #fff3 50%, transparent 60%); animation: prem-shine 4s ease-in-out infinite; }
@keyframes prem-shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.prem-vip-head { display: flex; align-items: center; gap: 8px; }
.prem-vip-crown { width: 52px; height: 52px; object-fit: contain; flex: none; filter: drop-shadow(0 0 8px #ffcf40); }
.prem-vip-title { font: 22px/1.1 var(--font-display); color: #ffd257; text-shadow: 0 2px 0 #0006; }
.prem-vip-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.prem-vip-duration { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 8px; background: #0003; font-size: 13px; }
.prem-vip-options .prem-buy { min-height: 44px; font: 18px/1.1 var(--font-display); }
.prem-vip-on { font-size: 12px; font-weight: 700; color: #b9f5c6; }
.prem-vip-perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 5px; }
.prem-vip-perk { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; background: #0000004d; font-weight: 600; font-size: 13px; line-height: 1.25; }
.prem-vip-perk .icon { width: 24px; height: 24px; flex: none; }
.prem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.prem-card { --tone: #6b7c93; display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; background: var(--paper); box-shadow: 0 0 0 2px var(--tone), 0 4px 10px #0003; }
.prem-card.active { box-shadow: 0 0 0 3px var(--good), 0 4px 10px #0003; }
.prem-card.clickable { cursor: pointer; }
.prem-card.clickable:active { transform: scale(0.98); }
/* the card opened: the picture big enough to look the skin over */
.prem-open { --tone: #6b7c93; gap: 10px; width: min(360px, 100%); margin: 0 auto; }
.prem-open .statline { justify-content: center; }
.prem-pic.big { height: min(340px, 50vh); border-radius: 14px; box-shadow: 0 0 0 2px var(--tone); }
.prem-pic.big > img { width: 160px; height: 160px; }
.prem-pic.big .prem-figure img { height: min(320px, 48vh); }
.prem-pic.big .nick-preview.big { font-size: 26px; padding: 6px 18px; }
.prem-pic.big .prem-heads img { width: 84px; height: 84px; }
.prem-open-desc { font-weight: 600; text-align: center; }
.prem-ready-to-ride { padding: 5px 8px; border-radius: 6px; background: #345b3620; color: #294b2b; font-size: 12px; font-weight: 700; text-align: center; }
.prem-card.has-pet-banner { grid-column: 1 / -1; border-color: #97763b; }
.prem-pet-banner { position: relative; overflow: hidden; background: #1d3026; }
.prem-pet-banner > img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.prem-pet-banner-copy { position: absolute; top: 12%; left: 4%; width: 30%; display: flex; flex-direction: column; gap: 14px; color: #fff1cf; text-shadow: 0 2px 6px #0009; }
.prem-pet-banner-copy > strong { font: 700 clamp(16px, 2.4vw, 29px)/1.15 var(--font-display); overflow-wrap: normal; }
.prem-pet-banner-price { font-size: clamp(20px, 2.6vw, 32px); font-weight: 800; color: #ffd88e; }
.has-pet-banner .prem-ready-to-ride { padding: 9px 12px; background: #315b38; color: #fff5d9; font-size: 14px; }
.prem-card.has-pet-banner .prem-body { padding: 12px; gap: 8px; }
.prem-open.has-pet-banner { width: min(640px, 100%); }
.prem-pet-banner-detail { overflow: hidden; border-radius: 12px; }
.prem-pet-banner-detail > img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
@media (max-width: 480px) { .prem-pet-banner-copy { width: 38%; gap: 8px; } .prem-pet-banner-copy > strong { font-size: 16px; } .prem-pet-banner-price { font-size: 22px; } }
.prem-pic {
  position: relative; height: 120px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 60%, #ffffff55, transparent 65%), linear-gradient(160deg, color-mix(in srgb, var(--tone) 70%, #fff), var(--tone));
}
.prem-pic > img { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 4px 6px #0005); }
.prem-figure { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.prem-figure img { height: 112px; width: auto; max-width: 100%; object-fit: contain; }
.prem-figure.pet { align-items: center; }
.prem-emote-preview { display: grid; place-items: center; width: 100%; height: 100%; }
.prem-emote-preview .icon { width: 82px; height: 82px; font-size: 72px; }
.prem-heads { display: flex; gap: 2px; }
.prem-heads img { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 3px 4px #0005); }
.nick-preview.big { font-size: 17px; padding: 4px 12px; }
.nick-preview.frame-gold { color: #ffd257; text-shadow: 0 0 6px #ffb300; box-shadow: 0 0 0 2px #ffcf40; }
.nick-preview.frame-neon { color: #7ff; text-shadow: 0 0 6px #0ff; box-shadow: 0 0 0 2px #0ff, 0 0 12px #0ff8; }
.nick-preview.frame-vip { color: #d6a0ff; text-shadow: 0 0 6px #a44dff; box-shadow: 0 0 0 2px #b56cff, 0 0 12px #a44dff80; }
.prem-badge { position: absolute; top: 6px; right: 6px; padding: 1px 8px; border-radius: 8px; background: var(--good); color: #fff; font-size: 12px; font-weight: 700; }
.prem-body { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 8px; overflow-wrap: anywhere; }
.prem-body > .btn { margin-top: auto; min-height: 42px; padding: 6px 8px; }
.prem-desc { font-size: 12px; opacity: 0.8; margin-bottom: 4px; }
.prem-note { margin-top: auto; text-align: center; font-weight: 700; opacity: 0.6; }
.tone-skin, .tone-face { --tone: #c9962a; }
/* a premium look (the VIP faces): purple and gold, a VIP tag, a slow shine across the picture */
.premium { --tone: #7a3fd0; }
.prem-card.premium { box-shadow: 0 0 0 2px #ffd257, 0 0 0 4px #7a3fd0, 0 4px 14px #7a3fd066; }
.premium .prem-pic { background: radial-gradient(circle at 50% 60%, #ffe9a855, transparent 65%), linear-gradient(160deg, #b98af0, #5a24a8); overflow: hidden; }
.premium .prem-pic::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, #ffffff55 50%, transparent 65%); transform: translateX(-100%); animation: prem-shine 3.5s ease-in-out infinite;
}
@keyframes prem-shine { 60%, 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .premium .prem-pic::after { animation: none; display: none; } }
.prem-vip-tag { position: absolute; top: 6px; left: 6px; z-index: 1; padding: 1px 8px; border-radius: 8px; background: linear-gradient(#ffe27a, #e0a81e); color: #4a2a00; font: 12px var(--font-display); box-shadow: 0 2px 0 #0003; }
.tone-frame { --tone: #8c4de0; }
.tone-petCosmetic { --tone: #e07a3a; }
.tone-storage { --tone: #3f7fd0; }
.tone-lockpicks { --tone: #5d6b7a; }
.tone-chips { --tone: #d0443a; }
.tone-classChange { --tone: #3c9a5a; }
.tone-sexChange { --tone: #d0569a; }
.prem-hint { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #0000001a; font-size: 13px; font-weight: 600; }
.prem-hint .icon { width: 28px; height: 28px; flex: none; }

/* a running event's collection thing: its doubled stats and the line saying till when */
.statline .boosted { color: #2f9e44; font-weight: 700; }
.event-boost { color: #2f9e44; font-weight: 600; }
/* the packs: the shop's cards (what's inside on the coloured top, the paper under it), two to a row, an odd last one
   alone in the middle */
.pack-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pack-variant-picker { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.pack-variant-options { display: flex; flex-wrap: wrap; gap: 4px; }
.pack-variant-options > button { flex: 1 1 90px; min-width: 0; white-space: normal; }
.pack-grid > .pack-card { flex: 0 0 calc(50% - 5px); min-width: 0; }
@media (max-width: 300px) { .pack-grid > .pack-card { flex-basis: 100%; } }
.tone-pack_newbie { --tone: #3c9a5a; }
.tone-pack_tough { --tone: #3f7fd0; }
.tone-pack_style { --tone: #c9962a; }
.tone-pack_dealer { --tone: #8c4de0; }
.pack-card .prem-pic { height: auto; min-height: 120px; padding: 30px 6px 8px; }
.pack-card .items { width: 100%; grid-template-columns: repeat(auto-fill, 40px); justify-content: center; gap: 4px; }
.pack-card .items .item { width: 40px; height: 40px; }
/* few things (the looks one): bigger tiles */
.pack-card .items.few { grid-template-columns: repeat(auto-fill, 60px); }
.pack-card .items.few .item { width: 60px; height: 60px; }
/* a look in a pack: on me, as it'll be, a tile like the things' */
.pack-look { display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; border: 0; border-radius: 8px; background: #fff6; box-shadow: inset 0 0 0 2px #fff9; cursor: pointer; }
.pack-look .prem-figure, .pack-look .prem-figure img { width: auto; height: 100%; }
.pack-look .nick-preview { font-size: 8px; padding: 1px 2px; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items.few .pack-look .nick-preview { font-size: 10px; }
/* the time left: a tag over the picture like «Надето», but red and throbbing — it runs out */
.pack-left {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 8px; border-radius: 8px; white-space: nowrap; background: #d0443a; color: #fff; font-size: 13px; font-weight: 800;
  box-shadow: 0 2px 0 #0003; animation: offer-throb 1s ease-in-out infinite;
}
.pack-left .offer-clock { font-variant-numeric: tabular-nums; }
@keyframes offer-throb { 50% { background: #ff2414; box-shadow: 0 2px 0 #0003, 0 0 10px 2px #ff3b2fbb; } }
@media (prefers-reduced-motion: reduce) { .pack-left { animation: none; } }
/* a phone's half-width card: the clock alone */
@media (max-width: 520px) { .pack-left-word { display: none; } }
.offer-clock { font-variant-numeric: tabular-nums; }
.mm-pack { position: relative; }
.mm-pack .offer-clock { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); padding: 0 4px; border-radius: 6px; background: linear-gradient(#ff3b2f, #c4140a); box-shadow: 0 0 0 1.5px #ffe14d; color: #fff; font: 11px/15px var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
/* the event's face for toys */
.event-look { align-items: center; gap: 10px; }
.event-look-pic { width: 72px; height: 72px; flex: none; padding: 0; border: 0; border-radius: 10px; background: #0000000f; cursor: pointer; overflow: hidden; }
.event-look-pic .prem-figure img { height: 72px; }
.prem-ads { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.prem-ads .icon { width: 20px; height: 20px; }
.product-pic { width: 128px; height: 128px; align-self: center; }
.product-perks { display: flex; flex-direction: column; gap: 6px; }
.product-perk { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--paper); font-weight: 600; }
.product-perk .icon { width: 32px; height: 32px; }
.product-need { display: flex; align-items: center; gap: 8px; justify-content: center; font-weight: 600; color: #8a1c14; }
.price-tag.big { font-size: 22px; padding: 2px 12px; }
.price-tag {
  align-self: flex-start;
  display: inline-block; background: var(--tape); padding: 1px 8px; font-weight: 700; transform: rotate(-2deg);
  box-shadow: 0 1px 0 var(--tape-shadow);
}

.progress { height: 18px; background: #0002; border-radius: 9px; overflow: hidden; position: relative; }
.progress > i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(45deg, var(--hivis) 0 10px, #ff8a4a 10px 20px); }
.progress > span { position: relative; display: block; text-align: center; font-size: 12px; font-weight: 700; line-height: 18px; }

.lb-row { display: flex; gap: 8px; align-items: center; padding: 6px 8px; background: var(--paper); border-radius: 5px; cursor: pointer; }
.lb-row + .lb-row { margin-top: 4px; }
.lb-row.me { outline: 2px solid var(--hivis); }
.lb-place { width: 30px; font: 20px var(--font-display); text-align: center; }
.lb-row.lb-first .lb-place { color: #b8860b; }

/* ---------------------------------------------------------------- tutorial task, highlights */
.quest {
  position: absolute; top: calc(var(--hud-chips-h, 48px) + 6px); left: 6px; max-width: min(460px, calc(100vw - 140px));
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; cursor: pointer; text-align: left; border: none; font: inherit;
  background: var(--tape); color: var(--marker); border-radius: 12px; box-shadow: 0 4px 12px #0006, inset 0 -3px 0 var(--tape-shadow);
  animation: quest-in 0.35s ease-out;
}
.quest:active { transform: translateY(1px); }
.quest-head { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.quest-count { display: none; font-weight: 700; font-size: 12px; white-space: nowrap; }
/* after the first chapter the card folds into a small tile: the task's picture and its count / reward under it (a tap
   opens the journal with the words) — the street stays free */
.quest.compact { padding: 5px 8px 4px; gap: 0; max-width: none; border-radius: 10px; }
.quest.compact .quest-sub, .quest.compact .quest-reward, .quest.compact .quest-main { display: none; }
.quest.compact .quest-count { display: block; }
.quest.compact .quest-icon { width: 40px; height: 40px; }
/* the compact card still says what it is: a caption and one line of the step, cut with an ellipsis */
.quest-caption { display: none; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.65; white-space: nowrap; }
.quest.compact .quest-caption { display: block; }
.quest.compact .quest-main { gap: 1px; }
.quest.compact .quest-text { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quest-chapter { font-size: 12px; font-weight: 700; opacity: 0.65; white-space: nowrap; }
.quest-daily { flex: none; padding: 1px 6px; border-radius: 8px; background: #ffffff8c; font-weight: 700; font-size: 12px; }
@keyframes quest-in { from { transform: translateY(-8px) scale(0.96); opacity: 0; } }
.quest-icon { width: 46px; height: 46px; flex: none; display: flex; align-items: center; justify-content: center; }
.quest-icon img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px #0004); }
.quest-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.quest-text { font: 20px/1.1 var(--font-display); }
.quest-dots { display: flex; gap: 4px; }
.quest-dots i { width: 9px; height: 9px; border-radius: 50%; background: #0002; }
.quest-dots i.done { background: #4caf50; }
.quest-dots i.now { background: var(--hivis); box-shadow: 0 0 0 2px #ff6a1a55; }
.quest-sub { display: flex; align-items: center; gap: 8px; }
.quest-progress { flex: none; padding: 1px 7px; border-radius: 8px; background: #0000001c; font-weight: 700; font-size: 13px; }
.quest-reward { flex: none; padding: 4px 8px; border-radius: 8px; background: #4caf50; color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 2px 0 #2e7d32; }
.loot-pvp {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; margin: 4px 0;
  background: #a3241ce6; color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 3px 8px #0006;
}
.loot-pvp .icon { width: 30px; height: 30px; }
.quest-pop {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; text-align: center;
  width: 390px; max-width: calc(100vw - 28px); padding: 16px 20px; border: 3px solid var(--cardboard-dark); border-radius: 4px;
  background: var(--paper); z-index: 50; color: var(--marker); font-weight: 700; font-size: 15px;
  box-shadow: 0 5px 0 #66472366, 0 10px 24px #0005; animation: pop 0.35s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.art-panel .quest-pop { border: 12px solid transparent; border-image: var(--panel-img) 25% fill / 12px stretch; background: none; padding: 10px 12px; }
.quest-pop-big { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 12px; font: clamp(24px, 5vw, 34px) var(--font-display); color: #704113; white-space: nowrap; }
.quest-pop-big img { width: 42px; height: 42px; object-fit: contain; flex: none; }
.quest-pop-items { display: grid; gap: 6px; }
.quest-pop-items:empty { display: none; }
.quest-pop-item, .quest-pop-next { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin-top: 6px; font-size: 15px; text-align: left; background: #fff7e880; border: 1px solid #92714644; border-radius: 3px; }
.quest-pop-items .quest-pop-item { margin-top: 0; }
.quest-pop-item > span { min-width: 0; overflow-wrap: anywhere; }
.quest-pop-item img, .quest-pop-next img { width: 36px; height: 36px; object-fit: contain; flex: none; }
.quest-pop-next, .quest-pop-note { color: #695039; }
.quest-pop-note { margin-top: 10px; font-size: 12px; font-weight: 400; }
.quest-pop-title { padding: 6px 10px; background: var(--tape); font: 19px/1.3 var(--font-display); color: var(--marker); margin-bottom: 8px; box-shadow: 0 2px 0 #8e653633; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } }
/* Pulse the highlight independently so tutorial markers can track a stationary control. */
:where(.attention) { position: relative; z-index: 1; }
.attention::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 4px #ff6a1acc; opacity: .25; animation: glow-fade 1.1s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .attention::after { animation-name: none; opacity: .8; } }
.goal-card { align-items: stretch; }
.goal-next { display: flex; align-items: center; justify-content: center; gap: 10px; font: 30px var(--font-display); }
.goal-next img { width: 56px; height: 56px; }
.goal-row { display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 10px; padding: 8px 10px; }
.goal-row-icon { font-size: 28px; }
.goal-row-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-weight: 600; }
.goal-ok { font-size: 22px; color: #2e7d32; font-weight: 700; }
.goal-unlocks { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.unlock { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 16px; background: #0000001a; font-weight: 600; }
.unlock-img { width: 28px; height: 28px; object-fit: contain; }
.goal-where { text-align: center; font: 18px var(--font-display); padding: 8px; }

/* ---------------------------------------------------------------- start screen */
.start {
  position: absolute; inset: 0; overflow-y: auto; touch-action: pan-y; display: flex; flex-direction: column; align-items: center;
  padding: calc(20px + var(--safe-top)) 12px calc(20px + var(--safe-bottom));
  background: radial-gradient(ellipse at 50% 0%, #4a3e2c, var(--night) 75%);
}
.start > * { flex-shrink: 0; }
.start h1 { font: 72px/1 var(--font-grunge); color: var(--tape); margin: 6px 0 2px; transform: rotate(-2deg); text-shadow: 3px 3px 0 var(--hivis-dark); }
.start-steps { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 4px 0 14px; max-width: 100%; }
.start-step {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 96px; min-width: 0; padding: 8px 4px; border-radius: 12px;
  background: #ffffff10; color: var(--paper); font: 600 13px/1.15 var(--font-body); text-align: center;
}
.start-step-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.start-step-icon img { width: 100%; height: 100%; object-fit: contain; }
.start-arrow { color: var(--hivis); font-size: 20px; font-weight: 700; }
/* A few big moments get the illustrated promo lettering, with live translated text. */
.display-gold {
  color: #ffdc38; background: linear-gradient(175deg, #fff8bb 8%, #ffe66a 31%, #ffce19 35%, #ffb20d 68%, #ffe46d 72%, #ffc028 100%);
  background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px #572300; paint-order: stroke fill;
  filter: drop-shadow(0 3px 0 #582300) drop-shadow(0 5px 0 #291405);
  font-family: var(--font-display); font-style: italic; text-shadow: none;
}
.hero-heading { margin: 0 0 12px; display: flex; flex-direction: column; align-items: center; flex-shrink: 0; transform: rotate(-2deg); text-align: center; }
.hero-heading-top {
  position: relative; z-index: 1; padding: 2px 22px; margin-bottom: -2px; background: linear-gradient(165deg, #fff7db, #f6dc9f);
  color: #49220a; font: italic 25px/1.1 var(--font-display); text-transform: uppercase;
  clip-path: polygon(2% 7%, 98% 0, 100% 88%, 3% 100%, 0 40%);
}
.hero-heading-ribbon {
  padding: 6px 25px 12px; background: linear-gradient(165deg, #ffba39 0%, #f77e15 37%, #e66407 70%, #ffac25 100%);
  clip-path: polygon(2% 8%, 97% 0, 100% 16%, 98% 32%, 100% 55%, 98% 91%, 3% 100%, 0 80%, 2% 60%, 0 35%);
  box-shadow: inset 0 2px 0 #ffe2a3; font: italic clamp(24px, 5.8vw, 42px)/1.15 var(--font-display); text-transform: uppercase;
}
.class-card.selected::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(120deg, #fff3ba45, transparent 35%, transparent 64%, #fff0b828 65%, transparent 81%);
}
.profile-modal .modal-head > .tape-label {
  background: linear-gradient(155deg, #fff9dc 10%, #ffe6a0 48%, #fff3c7 49%, #f1cc78 100%);
  color: #47240f; text-shadow: 0 1px #fff5cf; font-style: italic;
}
.sex-row { display: flex; gap: 6px; }
.sex-btn { min-width: 118px; font-weight: 700; }
.class-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(600px, 100%); }
.class-card { padding: 8px 6px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform 0.15s; position: relative; }
.class-card.selected { transform: translateY(-4px); outline: 4px solid var(--hivis); }
.class-card.selected::after {
  content: '✓'; position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--hivis); color: #fff; font: 700 16px/26px var(--font-body); text-align: center;
}
.class-card .portrait { height: 130px; display: flex; align-items: flex-end; justify-content: center; }
.class-card canvas { height: 130px; }
.class-card .name { font: 22px var(--font-display); }
.class-text { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.class-card .class-line { font: 600 13px/1.2 var(--font-body); text-align: center; min-height: 2.4em; }
.class-card .class-line .icon { width: 22px; height: 22px; margin-right: 3px; vertical-align: -6px; }
@media (max-width: 420px) {
  .class-card .portrait, .class-card canvas { height: 104px; }
  .class-card .name { font-size: 18px; }
  .class-card .class-line { font-size: 12px; }
}
.start-form {
  position: static; width: min(440px, 100%); margin-top: 14px; padding: 10px 0 calc(4px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 6px; background: linear-gradient(transparent, var(--night) 30%);
}
.nick-row { display: flex; gap: 6px; }
.nick-row input {
  flex: 1; min-width: 0; min-height: 52px; padding: 8px 14px; border: 3px solid var(--cardboard-dark); border-radius: 10px;
  background: var(--paper); font: 600 20px var(--font-body); text-align: center;
}
.nick-dice { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px; font-size: 13px; white-space: nowrap; clip-path: none; border-radius: 10px; }
.nick-dice .icon { width: 22px; height: 22px; margin-right: 0; }
@media (max-width: 500px) {
  .nick-row input { padding-inline: 8px; font-size: 16px; }
  .nick-dice { flex: 0 0 115px; font-size: 12px; white-space: normal; }
  .nick-dice .icon { display: none; }
}
.btn.big { min-height: 60px; font: 24px var(--font-display); letter-spacing: 0.5px; }
.start-go { font-size: 28px; min-height: 66px; }
.err { color: #ff8a7a; font-weight: 600; min-height: 1.2em; font-size: 14px; text-align: center; }
.start-form .err:empty { display: none; }
/* Keep the full choice and entry action visible on ordinary laptop screens too. */
@media (min-width: 601px) and (min-height: 501px) and (max-height: 800px) {
  .start { padding-top: calc(12px + var(--safe-top)); padding-bottom: calc(12px + var(--safe-bottom)); }
  .start .logo-img { width: auto; height: 88px; margin-bottom: 6px; object-fit: contain; }
  .start h1 { font-size: 48px; }
  .start-steps { margin: 0 0 6px; }
  .start-step { flex-direction: row; width: auto; gap: 6px; padding: 6px 8px; }
  .start-step-icon { width: 24px; height: 24px; }
  .hero-heading { margin-bottom: 6px; }
  .hero-heading-top { font-size: 18px; }
  .hero-heading-ribbon { font-size: 26px; padding-block: 4px 7px; }
  .class-card .portrait, .class-card canvas { height: 96px; }
  .class-card .name { font-size: 20px; }
  .start-form { margin-top: 8px; padding-top: 4px; }
  .start-go { min-height: 54px; }
}
@media (max-width: 600px) and (max-height: 740px) and (orientation: portrait) {
  .start { padding-top: calc(8px + var(--safe-top)); padding-bottom: calc(8px + var(--safe-bottom)); }
  .start .logo-img { height: 76px; width: auto; max-width: 80%; margin-bottom: 4px; object-fit: contain; }
  .start-steps { margin: 0 0 8px; }
  .start-step { flex: 1; flex-direction: row; width: auto; gap: 3px; padding: 4px; font-size: 11px; }
  .start-step-icon { width: 24px; height: 24px; flex: none; }
  .start-arrow { font-size: 14px; }
  .hero-heading { margin-bottom: 6px; }
  .hero-heading-top { font-size: 18px; }
  .hero-heading-ribbon { font-size: 24px; padding-block: 4px 7px; }
  .sex-btn { min-height: 40px; padding-block: 5px; }
  .class-card .portrait, .class-card canvas { height: 80px; }
  .class-card .name { font-size: 16px; }
  .class-card .class-line { font-size: 11px; }
  .start-form { margin-top: 8px; padding-top: 4px; }
  .nick-row input { min-height: 46px; }
  .start-go { min-height: 54px; font-size: 24px; }
}
/* The portal header, browser controls and sticky ad can leave a phone only ~500px of game height. */
@media (max-width: 600px) and (max-height: 600px) and (orientation: portrait) {
  .start .start-steps { display: none; }
  .start .logo-img { height: 48px; margin-bottom: 4px; }
  .start .hero-heading-top { font-size: 15px; }
  .start .hero-heading-ribbon { font-size: 22px; padding-block: 3px 6px; }
  .start .class-card .portrait, .start .class-card canvas { height: 64px; }
}
@media (max-width: 600px) and (max-height: 440px) and (orientation: portrait) {
  .start .hero-heading { display: none; }
}
.start.name-entry > :is(.logo-img, h1, .start-steps, .hero-heading) { display: none; }
.start.name-entry .class-card .class-line { display: none; }
.start.name-entry .class-card .portrait,
.start.name-entry .class-card canvas { height: 60px; }
/* Android can leave a fixed iframe taller than the area above its keyboard. Keep both actions at the top. */
.start.name-entry .start-form { order: -1; margin-top: 0; margin-bottom: 8px; }

/* ---------------------------------------------------------------- chat */
.chat {
  position: absolute; left: calc(4px + var(--safe-left)); bottom: calc(var(--hud-button-size) + 20px + var(--safe-bottom)); width: min(388px, calc(100vw - 8px - var(--safe-left) - var(--safe-right)));
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, rgba(31, 26, 21, 0.94), rgba(20, 17, 14, 0.94));
  border: 2px solid #6b4b28; border-radius: 14px; color: #efe6d2;
  box-shadow: 0 10px 28px #0008, inset 0 1px 0 #ffffff12;
}
.chat.collapsed { display: none; }
/* folded away: a round cardboard button where the panel's corner would be, the count of new messages on it */
.chat-bubble {
  position: absolute; left: calc(10px + var(--safe-left, 0px)); bottom: calc(var(--hud-button-size) + 20px + var(--safe-bottom)); width: var(--hud-button-size); height: var(--hud-button-size);
  display: none; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  border: 2px solid var(--cardboard-dark); border-radius: 50%;
  background: linear-gradient(170deg, var(--cardboard-light), var(--cardboard));
  box-shadow: 0 3px 0 var(--cardboard-dark), 0 8px 18px #0006;
}
.chat.collapsed ~ .chat-bubble { display: flex; }
.chat-bubble:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cardboard-dark); }
.chat-bubble img { width: 32px; height: 32px; }
.chat-bubble .icon { width: 32px; height: 32px; font-size: 26px; }
.chat-bubble .badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; box-shadow: 0 0 0 2px var(--paper);
}
.chat-bubble .badge:empty { display: none; }
/* Settings → «Счётчик кадров»: under the minimap */
.fps {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: max-content; max-width: min(360px, calc(100vw - 12px));
  padding: 4px 6px; border-radius: 6px; background: #000a; color: #fff;
  font: 700 11px/1.3 monospace; white-space: pre-line; overflow-wrap: anywhere; text-align: right; pointer-events: none;
}
.fps[hidden] { display: none; }
.chat-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; background: #0000002e; border-bottom: 1px solid #ffffff10; }
.chat-tabs button {
  position: relative; flex: none; min-height: 30px; padding: 0 6px; border: none; border-radius: 6px; cursor: pointer;
  background: transparent; color: #b9ad94; font: 11px var(--font-display); letter-spacing: 0.2px; text-transform: uppercase; white-space: nowrap;
}
.chat-tabs button:hover:not(.active) { background: #ffffff0c; color: var(--paper); }
.chat-tabs button.active { background: var(--tape); color: var(--marker); box-shadow: 0 2px 0 var(--tape-shadow); }
.chat-tabs .collapse { width: 28px; padding: 0; font-size: 18px; text-transform: none; }
/* Fight logs sit beside the conversation channels. */
.chat-tabs .tab-icon { width: 30px; padding: 0; display: flex; align-items: center; justify-content: center; }
.chat-tabs .tab-icon .icon { width: 18px; height: 18px; }
.online-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; scrollbar-color: #6b4524 #e6c38f; }
/* Native active-thumb colors can blend into the cardboard. Keep a contrasting thumb while dragging. */
@supports selector(::-webkit-scrollbar) {
  .online-list { scrollbar-color: auto; scrollbar-width: auto; }
  .online-list::-webkit-scrollbar { width: 10px; }
  .online-list::-webkit-scrollbar-track { background: #e6c38f; border-radius: 5px; }
  .online-list::-webkit-scrollbar-thumb { background: #6b4524; border: 2px solid #e6c38f; border-radius: 5px; }
  .online-list::-webkit-scrollbar-thumb:hover { background: #58351b; }
  .online-list::-webkit-scrollbar-thumb:active { background: #402510; }
  .online-list::-webkit-scrollbar-button { display: none; }
}
.online-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: none; border-radius: 10px; background: #0000001a; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.online-row:hover { background: #0000002e; }
.online-row .online-status { width: 28px; height: 28px; object-fit: contain; flex: none; }
.online-row b { flex: none; }
.chat-tabs .chat-online {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 4px 6px;
  border: 1px solid #a48047; border-radius: 8px; background: linear-gradient(180deg, #655034, #3b2e20); color: #ffe4ac;
  box-shadow: inset 0 1px 0 #ffe4ac24, 0 2px 3px #0004; font: 700 12px/1.2 Rubik, sans-serif; letter-spacing: 0; text-transform: none;
}
.chat-tabs .chat-online[hidden] { display: none; }
.chat-tabs .chat-online::before { content: ''; width: 6px; height: 6px; flex: none; border-radius: 50%; background: #a4d66a; box-shadow: 0 0 5px #a4d66a65; }
.chat-tabs .chat-online:hover:not(.active) { background: linear-gradient(180deg, #7a603c, #4b3825); border-color: #d3b273; color: #fff0d0; }
.chat-tabs .chat-online:active { transform: translateY(1px); box-shadow: inset 0 1px 3px #0004; }
.chat-tabs .chat-controls { display: flex; flex: none; align-items: center; gap: 2px; margin-left: auto; }
/* something new on the tab not open: a red dot */
.chat-tabs button.fresh:not(.active)::after { content: ''; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--bad); }
.chat-input[hidden] { display: none; }
/* the «Драки» tab */
.fight-entry { padding: 6px 8px; border-radius: 8px; background: #ffffff0a; border-left: 3px solid #8a7d64; font-size: 12px; line-height: 1.35; color: #d9cfb8; }
.fight-entry.win { border-left-color: #6fbf4a; }
.fight-entry.lose { border-left-color: var(--bad); }
.fight-head { display: flex; align-items: center; gap: 6px; }
.fight-result { flex: 1; display: flex; align-items: center; gap: 5px; font: 12px var(--font-display); letter-spacing: 0.4px; text-transform: uppercase; }
.fight-result img { width: 16px; height: 16px; }
.fight-entry.win .fight-result { color: #9be37a; }
.fight-entry.lose .fight-result { color: #ff9a8a; }
.fight-time { color: #8f846c; font-size: 11px; }
.fight-title { color: #efe6d2; }
.fight-title .nick { font-weight: 700; color: #ffd98a; cursor: pointer; }
.fight-title .nick:hover { text-decoration: underline; }
.fight-line .fight-ground { color: #ffcf6a; }
.fight-line.muted, .fight-entry .muted { color: #8f846c; }
.fight-empty { padding: 12px 4px; text-align: center; color: #8f846c; }
.chat-body {
  height: min(46vh, 400px); overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px;
  font: 13px/1.35 var(--font-body); touch-action: pan-y; overscroll-behavior: contain;
  scrollbar-color: #6b4b28 transparent;
}
.chat-body > * { flex-shrink: 0; }
.chat-msg { word-wrap: break-word; }
.chat-actions { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 26px; margin-left: 4px; padding: 0; border: none; border-radius: 7px; background: none; color: #d5c5a8; opacity: .65; font: 700 22px/1 var(--font-body); cursor: pointer; vertical-align: middle; transition: opacity .12s, background .12s; }
.chat-actions:hover, .chat-actions:focus-visible, .chat-actions[aria-expanded="true"] { opacity: 1; background: #bc775321; }
.chat-actions:focus-visible { outline: 1px solid #c6a66f; outline-offset: -1px; }
.chat-msg:has(> .chat-actions) { position: relative; min-height: 26px; padding-right: 32px; }
.chat-msg > .chat-actions { position: absolute; right: 0; top: 0; margin: 0; }
@media (hover: hover) and (pointer: fine) {
  .chat-actions { opacity: 0; }
  :is(.chat-msg, .phone-msg, .tournament-announcement):hover .chat-actions, .chat-actions:focus-visible, .chat-actions[aria-expanded="true"] { opacity: .85; }
}
.message-menu-layer { position: fixed; inset: 0; z-index: 150; background: #100c0724; }
.message-menu { position: fixed; width: 254px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; padding: 7px; border: 1px solid #9b784d; border-radius: 12px; background: linear-gradient(145deg, #3b3025, #251f19); box-shadow: 0 8px 28px #0008, inset 0 1px #ffe6b51f; color: #f3e6cb; }
.message-menu-caption { padding: 5px 9px 2px; font-weight: 700; font-size: 13px; color: #f4d28d; }
.message-menu-preview { margin: 0 9px 5px; padding-bottom: 9px; border-bottom: 1px solid #ddbb7b26; color: #bbad95; font-size: 12px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.message-menu-player { display: contents; }
.message-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 9px; border: none; border-radius: 7px; background: none; color: inherit; text-align: left; font: 13px/1.3 var(--font-body); cursor: pointer; }
.message-menu-item .icon { width: 19px; height: 19px; object-fit: contain; flex: none; }
.message-menu-item:hover, .message-menu-item:focus-visible { background: #fff0d414; outline: none; }
.message-menu-item.danger { color: #f0a387; border-top: 1px solid #ddbb7b26; border-radius: 0 0 7px 7px; margin-top: 3px; }
.message-menu-item:disabled { opacity: .45; cursor: wait; }
.chat-mute-quote { margin: 0; padding: 10px 12px; border-left: 3px solid #a47b43; border-radius: 5px; background: #9b784d12; overflow-wrap: anywhere; font-size: 13px; }
.chat-mute-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-mute-presets button { min-height: 36px; padding: 5px 12px; border: 1px solid #bca47e; border-radius: 8px; color: #5f452c; background: #f8ecd7; cursor: pointer; font-size: 13px; }
.chat-mute-presets button[aria-pressed="true"] { color: #fff4db; background: #76522f; border-color: #76522f; }
.chat-rejection { flex-shrink: 0; }
.phone-chat-warning { flex-shrink: 0; padding: 9px 11px; border: 1px solid #ca806a; border-radius: 8px; background: #ffe2cf; color: #7b3228; font-size: 12px; line-height: 1.4; }
.chat-empty { margin: auto; padding: 16px; color: #b9ad94; text-align: center; }
.chat-mute-status { padding: 6px 10px; color: #ffb488; font-size: 12px; background: #ff6a1a18; }
.chat-msg .ch {
  display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px; vertical-align: 1px;
  font: 9.5px/1.5 var(--font-display); letter-spacing: 0.4px; text-transform: uppercase; background: #ffffff14; color: #c9bd9f;
}
.chat-msg .ch-district { background: #ff6a1a33; color: #ffb488; }
.chat-msg .nick { font-weight: 700; color: #ffd98a; cursor: pointer; margin-right: 6px; }
.chat-msg .nick:hover { text-decoration: underline; }
.chat-msg .sys-player { cursor: pointer; }
.chat-msg .sys-player:hover { text-decoration: underline; }
.chat-msg.mine .nick { color: #9be37a; }
.chat-msg .nick.frame-gold { color: #ffd257; text-shadow: 0 0 6px #ffb300; }
.chat-msg .nick.frame-neon { color: #7ff; text-shadow: 0 0 6px #0ff; }
.chat-msg .nick.frame-vip { color: #d6a0ff; text-shadow: 0 0 6px #a44dff; }
.season-medal { display: inline-flex; align-items: center; justify-content: center; flex: none; height: 26px; margin-left: 4px; vertical-align: middle; white-space: nowrap; }
.season-medal .icon { width: 24px; height: 26px; object-fit: contain; }
/* Later medals cover earlier ones; one per weekly board, at most 60px. */
.season-medal-strip { display: inline-flex; flex: none; isolation: isolate; align-items: center; height: 26px; margin-left: 4px; vertical-align: middle; white-space: nowrap; }
.season-medal-strip .season-medal { position: relative; width: 24px; margin-left: 0; filter: drop-shadow(-1px 0 1px #201b1880); }
.season-medal-strip .season-medal + .season-medal { margin-left: -12px; }
.season-medal-collection { display: flex; align-items: center; margin: 3px 0; }
.season-medal-collection:empty { display: none; }
.season-medal-collection .season-medal-strip { margin-left: 0; }
.chip-light .season-medal { margin-left: 0; }
.chip-light .season-medal .icon { width: 24px; height: 26px; }
.chat-msg .text { color: #efe6d2; }
.chat-msg.system {
  display: flex; gap: 8px; align-items: flex-start; padding: 5px 8px; border-radius: 8px;
  background: #ffffff0a; border-left: 3px solid #8a7d64; font-size: 12px; line-height: 1.3;
}
.chat-msg.system .text { color: #d9cfb8; }
.chat-msg.system .sys-ico { flex: none; font-size: 14px; line-height: 1.3; }
.chat-msg.system.r2 { border-left-color: var(--r2); }
.chat-msg.system.r3 { border-left-color: var(--r3); background: #a24de014; }
.chat-msg.system.r3 .text { color: #e2c4ff; }
.chat-msg.system.r4 { border-left-color: var(--r4); background: #f2b32018; }
.chat-msg.system.r4 .text { color: #ffe08a; font-weight: 600; }
.chat-input .chat-send { display: flex; align-items: center; justify-content: center; }
.chat-input .chat-send .icon { width: 18px; height: 18px; display: block; }
.quest-daily img { width: 14px; height: 14px; vertical-align: -3px; }
.chat-input { display: flex; gap: 5px; padding: 6px; border-top: 1px solid #ffffff10; }
.chat-input input {
  flex: 1; min-width: 0; min-height: 34px; border-radius: 8px; border: 1px solid #ffffff1a; padding: 0 10px;
  background: #ffffff10; color: var(--paper); outline: none;
}
.chat-input input:focus { border-color: var(--hivis); background: #ffffff16; }
.chat-input .btn { flex: none; min-height: 34px; min-width: 34px; padding: 0; border-radius: 8px; clip-path: none; }
.chat-input { align-items: flex-end; }
.chat-editor { flex: 1; min-width: 0; min-height: 34px; max-height: 88px; overflow-y: auto; padding: 6px 9px; border: 1px solid #ffffff1a; border-radius: 8px; background: #ffffff10; color: var(--paper); font: 14px/20px var(--font-body); white-space: pre-wrap; overflow-wrap: anywhere; outline: none; -webkit-user-select: text; user-select: text; }
.chat-editor:empty::before { content: attr(data-placeholder); color: #b7af9d; pointer-events: none; }
.chat-editor:focus { border-color: var(--hivis); background: #ffffff16; }
.chat-editor[aria-disabled="true"] { opacity: .5; }
.chat-attach { position: relative; display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid #a7875266; border-radius: 8px; background: linear-gradient(#493925, #30271d); color: #e9c88e; box-shadow: inset 0 1px #fff1, 0 1px 2px #0004; cursor: pointer; }
.chat-attach-mark { position: relative; display: block; width: 16px; height: 16px; pointer-events: none; }
.chat-attach-mark::before, .chat-attach-mark::after { content: ''; position: absolute; left: 1px; top: 7px; width: 14px; height: 2px; border-radius: 1px; background: currentColor; }
.chat-attach-mark::after { transform: rotate(90deg); }
.chat-attach:hover:not(:disabled) { border-color: #c5a36c; background: #584229; color: #ffe2aa; }
.chat-attach:active:not(:disabled) { box-shadow: inset 0 2px 4px #0005; }
.chat-attach:focus-visible { outline: 2px solid #ffe1a2; outline-offset: 3px; }
.chat-attach:disabled { opacity: .45; filter: saturate(.4); cursor: default; }
.chat-item-name { font-weight: 600; text-decoration: underline; text-decoration-color: var(--rank); text-underline-offset: 3px; cursor: help; }
.chat-item-tail { display: inline-block; white-space: nowrap; }
.chat-item-info { display: inline-flex; justify-content: center; align-items: center; width: 18px; height: 18px; margin: 0 3px; padding: 0; border: 0; border-radius: 50%; background: none; color: #d0b98d; font: 16px/1 var(--font-body); vertical-align: -2px; cursor: help; }
.chat-item-info:hover { background: #b3925b20; color: #ffe2aa; }
.phone-msg .chat-item-info { color: #916c36; }
.chat-item-info:focus-visible { outline: 2px solid var(--hivis); outline-offset: 1px; }
.chat-item-tooltip { position: fixed; z-index: 130; width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow: hidden; padding: 14px; border: 1px solid #9c805650; border-top: 2px solid var(--rank, #b79359); border-radius: 9px; background: linear-gradient(145deg, #302a22, #211e19); color: #eee4d2; box-shadow: 0 12px 30px #0008, inset 0 1px #fff04; pointer-events: none; }
.item-preview-chat { gap: 12px; }
.item-preview-chat .item-preview-head { gap: 12px; }
.item-preview-chat .item-preview-head > .item { width: 68px; height: 68px; padding: 5px; border: 1px solid #c6ac7c55; border-radius: 7px; background: radial-gradient(ellipse at 50% 40%, #86765f, #4b4032); box-shadow: none; }
.item-preview-chat .item-preview-art::before { display: none; }
.item-preview-chat .item-preview-kind { color: #a99c86; font-size: 9px; letter-spacing: .8px; }
.item-preview-chat .item-preview-name { color: #f5ebd9; font: 600 16px/1.3 var(--font-body); }
.item-preview-chat .item-preview-rarity { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 0; border: 0; border-radius: 0; background: none; font-size: 11px; }
.item-preview-chat .item-preview-rarity .rank-text { font: 600 11px var(--font-body); }
.item-preview-chat .item-preview-role { color: #aa9b82; font: 11px var(--font-body); }
.item-preview-chat .item-preview-meta { color: #b4a58b; font-size: 10px; }
.item-preview-chat .item-preview-stats { padding: 8px 0 0; border: 0; border-top: 1px solid #d3b48122; border-radius: 0; background: none; box-shadow: none; }
.item-preview-chat .item-preview-section-title { display: none; }
.item-preview-chat .statline { display: flex; flex-direction: column; gap: 0; }
.item-preview-chat .statline > span { padding: 5px 0; border: 0; border-radius: 0; background: none; color: #e9dfcc; font: 12px/1.3 var(--font-body); }
.item-preview-chat .statline > .combat-penalty { color: #ed9b87; }
.panel.item-preview-modal.chat-item-card, .art-panel .panel.item-preview-modal.chat-item-card { width: min(360px, 100%); padding: 18px; border: 1px solid #9c805650; border-top: 2px solid var(--rank); border-radius: 10px; background: linear-gradient(145deg, #302a22, #211e19); box-shadow: 0 18px 55px #0009; }
.chat-item-card .modal-head { position: static; height: 0; min-height: 0; margin: 0; padding: 0; border: 0; }
.chat-item-card .modal-head > .tape-label, .chat-item-card .modal-head > .spacer { display: none; }
.chat-item-card .modal-close { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; min-height: 36px; padding: 0; border: 0; border-radius: 7px; background: none; color: #b7a588; box-shadow: none; }
.chat-item-card .modal-close > .icon { display: none; }
.chat-item-card .modal-close::before, .chat-item-card .modal-close::after { content: ''; position: absolute; top: 17px; left: 11px; width: 14px; height: 2px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.chat-item-card .modal-close::after { transform: rotate(-45deg); }
.chat-item-card .modal-close:hover { background: #fff08; color: #f6dfb3; }
.chat-item-card .item-preview-head { padding-right: 20px; }
.chat-item-card .modal-body { padding: 0; }
.chat-item-picker-modal .chat-item-picker > input { border: 1px solid #a77b45; border-radius: 8px; background: #fff6e2; color: #3d2a18; }
.chat-item-picker-list > b { padding: 5px 0; color: #795831; font: 12px var(--font-display); }
.chat-item-pick { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 10px; border: 1px solid #99774760; border-radius: 7px; background: var(--paper); color: var(--marker); text-align: left; cursor: pointer; font: 14px/1.3 var(--font-body); }
.chat-item-pick:hover { border-color: #b26b28; background: #fff0cd; }
.chat-item-pick-art { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid var(--rank); border-radius: 6px; background: #fff7e8; }
.chat-item-pick-icon { width: 44px; height: 44px; object-fit: contain; }
.phone-input .chat-editor { min-height: 42px; border-color: #d6d8dd; border-radius: 16px; background: #fff; color: #1d1f24; }
.phone-input .chat-editor:empty::before { color: #6b7280; }
.phone-input .chat-attach { width: 42px; height: 42px; border-radius: 11px; }
.phone-input .chat-attach { border-color: #d5c7ad; background: #fff7e9; color: #765529; box-shadow: none; }
.phone-input { align-items: flex-end; }
.art-button-primary .chat-input .btn.chat-send { width: 34px; border-width: 8px; border-image-width: 8px; padding: 0; }
.chat-msg .ch-gang { background: #3f7d4a55; color: #a9f0b4; }
.chat-msg.gang .text { color: #d6f5d9; }
.chat-msg.system.gang { border-left-color: #5fbf6e; }
.chat-msg .gang-tag { color: #a9f0b4; font-weight: 700; margin-right: 4px; }

/* ---------------------------------------------------------------- business & gangs */
.gang-tag { color: #2e6b39; font-weight: 700; }
.gang-tag.big { font: 700 16px/1 var(--font-display); padding: 4px 8px; border-radius: 8px; background: #3f7d4a; color: #f0fff0; }
.gang-view { min-width: 0; }
.gang-member { flex-wrap: wrap; }
.gang-member > .grow { min-width: 120px; }
.gang-member-actions { margin-left: auto; flex-wrap: wrap; }
.profile-reactions { margin-top: 4px; gap: 6px; }
.profile-reactions .btn { min-width: 52px; min-height: 36px; white-space: nowrap; }
.art-button .profile-reactions .btn:not(.primary):not(.danger),
.art-button-primary .profile-reactions .btn.primary {
  border-width: 7px; border-image-width: 7px; padding: 0 4px;
}
.tournament-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.tournament-table th, .tournament-table td { padding: 8px 4px; border-bottom: 1px solid #79552e44; text-align: right; }
.tournament-table th:first-child { text-align: left; }
.tournament-table thead { color: #604930; }
.gang-role { font-size: 12px; }
.locked-card { display: flex; gap: 8px; align-items: center; color: #6b5a40; }
.hireling-ico { width: 36px; display: flex; justify-content: center; font-size: 22px; }
.input { width: 100%; }
.row .input { flex: 1; width: auto; min-width: 0; }
.tag-input { text-transform: uppercase; letter-spacing: 2px; font-weight: 700; }
.chip-light.good { background: #bfe8b0; }
.chip.buff.debuff { background: #8a2b1d; color: #ffe2d8; }
/* the seasonal event: a round chip with the gift in it, as tall as the others */
.chip.event-chip { width: 36px; padding: 0; justify-content: center; background: #2e6b39; border-color: #ffffff33; font: inherit; }
.chip.event-chip img { width: 30px; height: 30px; object-fit: contain; margin-top: -2px; }
.event-card { display: flex; align-items: center; gap: 12px; text-align: left; }
.event-card img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.event-lines { display: flex; flex-direction: column; gap: 6px; }
/* the city's tree: gifts opened by everyone, its goals marked on the bar */
.event-tree { display: flex; flex-direction: column; gap: 5px; }
.event-tree-head { justify-content: space-between; align-items: baseline; }
.event-tree-count { font-size: 16px; }
.event-tree-bar { height: 14px; overflow: visible; margin: 4px 11px 0 0; }
.event-tree-bar > i { border-radius: 7px; background: repeating-linear-gradient(45deg, #2e8b4a 0 10px, #3fa65c 10px 20px); }
/* (the bar's own child rule would make them relative: they line up on the bar instead) */
.event-tree-bar > .event-tree-goal {
  position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  background: #d9d2c3; border: 2px solid #1e1b18; font: 700 12px/18px var(--font-body); text-align: center; color: #1e1b18;
}
.event-tree-bar > .event-tree-goal.on { background: #ffd257; box-shadow: 0 0 8px #ffd257; }
/* under each goal what it turns on and where it is, its right edge at the goal */
.event-tree-goals { display: grid; margin-right: 11px; }
.event-tree-label { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.event-tree-label b { font-size: 14px; }
.event-tree-label.on b { color: #2e7d32; }
.toy-icon { font-size: 1.3em; line-height: 0; vertical-align: -0.1em; }
.event-days { flex: none; align-self: flex-start; }
.event-collection { align-items: center; gap: 8px; }
.event-task { cursor: pointer; }
.event-toys-pill { flex: none; margin-right: 8px; padding: 3px 10px; border-radius: 14px; background: #2e6b39; color: #fff; font-size: 17px; box-shadow: 0 2px 0 #1d4a26; }
.event-lot { display: flex; flex-direction: column; gap: 4px; }
.event-price { border: none; border-radius: 8px; padding: 4px 2px; font: 700 15px/1.2 var(--font-body); text-align: center; background: #0000002a; color: #1e1b18b0; cursor: pointer; }
/* affordable: green like the rewards */
.event-price.can { background: #4caf50; color: #fff; box-shadow: 0 2px 0 #2e7d32; }
.event-price.got { background: none; color: #2e7d32; font-size: 17px; cursor: default; }
/* the skates for toys: the thing, what it is, the price */
.event-skates-buy { align-items: center; gap: 10px; }
.event-skates-buy .event-price { flex: none; padding: 4px 12px; }
.event-skates-buy .item { flex: none; width: 64px; height: 64px; }
.event-skates-reward { padding: 2px 6px; line-height: 0; }
.event-skates-reward img { width: 26px; height: 26px; object-fit: contain; }
/* a nick as the chat shows it, the frame's colours on the chat's dark */
.nick-preview { display: inline-block; padding: 1px 8px; border-radius: 8px; background: #1e1b18; color: var(--paper); font-weight: 700; }
.event-gifts .item { width: 52px; height: 52px; }
/* the «Олень года» frame (a seasonal collection's): festive red */
.chat-msg .nick.frame-deer, .nick-preview.frame-deer { color: #ff7a6b; text-shadow: 0 0 6px #ff3b2f; }

/* ---------------------------------------------------------------- profile & ratings */
.profile { container-type: inline-size; }
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.profile-textured { padding: 12px; border-radius: 12px; background-size: cover; background-position: center; }
.profile[data-profile-ink="light"] { color: #fff4de; text-shadow: 0 1px 3px #000b; }
.profile[data-profile-ink="light"] .section-title,
.profile[data-profile-ink="light"] .profile-playtime { color: #fff4de; }
.profile-textured .chip-light, .profile-textured .stat-pill, .profile-textured .profile-passive,
.profile-textured .doll-info { color: var(--marker); text-shadow: none; }
.profile-textured > .profile-head:not(.profile-banner) { background-color: #f9edcfed; color: var(--marker); text-shadow: none; }
.profile-head.card.profile-banner {
  min-height: 96px; box-sizing: border-box; padding: 10px;
  background-size: cover; background-position: center; background-color: #302a25;
  position: relative; isolation: isolate; overflow: hidden; align-items: center;
}
.profile-banner .profile-identity,
.profile-banner .profile-wealth { padding: 5px 7px; border-radius: 6px; background: #fff0d4db; }
.profile-banner .profile-status { width: 48px; height: 48px; }
.profile-banner .profile-status .icon { width: 36px; height: 36px; }
.profile-banner .profile-nick { font-size: 18px; overflow-wrap: anywhere; }
.profile-banner .profile-sub { font-size: 12px; }
.profile-banner[data-profile-ink="dark"] { color: #251e18; text-shadow: none; }
.profile-banner[data-profile-ink="light"] { color: #fff4de; text-shadow: 0 1px 3px #000; }
.profile-banner[data-profile-ink="light"] .profile-identity,
.profile-banner[data-profile-ink="light"] .profile-wealth { background: #10121bbd; }
.profile-banner[data-profile-ink="light"] .gang-tag { color: #a9e6ad; }
.profile-banner[data-profile-ink="light"] .muted { color: #ffedcd; opacity: 1; }
.profile-banner .price-tag { color: var(--marker); text-shadow: none; }
.doll-stage.profile-scenery { background-size: cover; background-position: center; overflow: hidden; }
.profile-scenery .doll-figure > .portrait > img:not(.portrait-glow) { filter: drop-shadow(0 0 2px #fff5da) drop-shadow(0 3px 3px #0009); }
.profile-status.profile-avatar { overflow: hidden; }
.profile-avatar > img { width: 100%; height: 100%; object-fit: cover; }
.profile-preview-note { padding: 7px 10px; background: var(--paper); color: var(--marker); text-shadow: none; border-radius: 6px; font-size: 13px; text-align: center; }
.profile-art-pic { width: 100%; padding: 0; border: 0; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; overflow: hidden; position: relative; background: #302a25; cursor: pointer; }
.profile-art-pic > img { width: 100%; height: 100%; object-fit: cover; }
.profile-art-pic.profileBanner { aspect-ratio: 3 / 1; }
.profile-art-pic.profileTexture { aspect-ratio: 2 / 3; max-height: 200px; }
.profile-art-pic.profileAvatar > img { width: 85%; height: 85%; border-radius: 50%; }
.profile-art-card.active { outline: 3px solid #55a556; }
.profile-art-card .prem-body { gap: 7px; }
.profile-purchase-action { position: sticky; top: 0; z-index: 3; padding: 6px; background: var(--paper); border-radius: 8px; box-shadow: 0 2px 5px #0004; }
.profile-sale-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 9px 12px; border: 1px solid #a94b14; border-radius: 8px; color: #4c270c; background: #ffe0a1; }
.profile-sale-banner[hidden] { display: none; }
.profile-sale-countdown { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; font-size: 12px; white-space: nowrap; }
.profile-sale-clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
.profile-purchase-action .profile-sale-banner { margin-bottom: 6px; }
.profile-buy-label { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 7px; }
.profile-buy-prices { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; font: 17px/1.1 var(--font-display); }
.profile-price-old { font: 14px/1.1 var(--font-display); opacity: .8; text-decoration-thickness: 2px; }
.profile-price-current { font: inherit; }
.profile-bundle-hint { padding: 8px 2px; }
.profile-bundle-pic { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: 100%; aspect-ratio: 1; padding: 0; border: 0; gap: 2px; overflow: hidden; background: #302a25; cursor: pointer; }
.profile-bundle-pic img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.profile-bundle-pic .profileAvatar { border-radius: 50%; width: 84%; height: 84%; align-self: center; justify-self: center; }
.profile-bundle-card .prem-body { gap: 7px; }
.profile-bundle-deal { color: #2b702f; font-weight: 800; }
.profile-bundle-members { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; }
.profile-bundle-members .owned { color: #2b702f; font-weight: 700; }
/* the head sits on the cardboard itself, not on a white card */
.profile-head.card { background: #00000014; border: none; box-shadow: inset 0 2px 0 #0000001a; }
.profile-status { width: 64px; height: 64px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle, #fff9e8, #e9dcc0); border: 3px solid var(--cardboard-dark); }
.profile-status .icon { width: 46px; height: 46px; font-size: 32px; }
.profile-nick { font: 22px/1.1 var(--font-display); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.profile-identity { min-width: 0; }
.profile-nick-name { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.profile-nick-text { min-width: 0; overflow-wrap: anywhere; }
.profile-nick .gang-tag { white-space: nowrap; }
.profile-rename { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 4px; border: none; background: transparent; cursor: pointer; font-size: 22px; line-height: 1; }
.profile-sub { display: flex; align-items: center; gap: 6px; font-weight: 600; margin: 2px 0; }
.profile-sub.pvp-mode { color: #d8322c; }
.profile-wealth { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: #9a9a9a; display: inline-block; }
.online-dot.on { background: #4caf50; box-shadow: 0 0 6px #4caf50; }
/* the paper doll: gear slots on both sides of the character */
.doll { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.doll-col { display: flex; flex-direction: column; gap: 8px; }
.doll-col .item { width: 64px; height: 64px; }
.doll-slot { opacity: 0.55; }
.doll-slot .slot-tag { font-size: 10px; white-space: normal; line-height: 1.1; text-align: center; padding: 0 2px; word-break: break-word; }
.doll-stage {
  position: relative; align-self: stretch; min-height: 290px; display: flex; align-items: flex-end; justify-content: center; border-radius: 14px;
  background: radial-gradient(ellipse at 50% 85%, #fff4d6 0%, #e6cf9f 45%, #b98e55 100%); box-shadow: inset 0 0 0 2px #0002, inset 0 -18px 30px #0002;
}
.doll-figure { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.doll-figure .portrait { position: relative; width: 100%; height: 100%; }
.doll-figure img { position: relative; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; display: block; }
/* Already-coloured weapon aura; rarity does not produce a halo. */
.doll-figure .portrait-glow { position: absolute; z-index: 1; inset: 0; pointer-events: none; animation: weapon-portrait-breathe 2.6s ease-in-out infinite; }
@keyframes weapon-portrait-breathe { 0%, 100% { opacity: 0.9; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .doll-figure .portrait-glow { animation: none; } }
.doll-power {
  position: absolute; z-index: 2; top: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px;
  padding: 3px 12px; border: none; border-radius: 14px; background: var(--marker); color: var(--tape); font: 20px var(--font-display); white-space: nowrap; cursor: pointer;
}
.doll-power .icon { width: 24px; height: 24px; }
.doll-power small { font: 12px var(--font-display); text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.75; }
.doll-info:empty { display: none; }
.pet-growth-chip[hidden], .pet-card-action[hidden], .pet-card-quest[hidden] { display: none; }
.pet-growth { width: 100%; min-width: 0; margin: 6px 0; }
.doll-info > .pet-growth { flex: 1 1 100%; }
.pet-growth-label { font-size: 13px; font-weight: 700; line-height: 1.4; }
.pet-growth-bar { height: 10px; margin-top: 6px; border: 1px solid #997749; border-radius: 8px; overflow: hidden; background: #57432625; }
.pet-growth-bar > i { display: block; height: 100%; background: #c18a31; }
.pet-growth.grown .pet-growth-bar > i { background: #527f36; }
.pet-growth-hint { margin-top: 5px; line-height: 1.4; color: #67573e; font-weight: 400; }
.pet-growth.grown { color: #35682b; font-weight: 700; }
.doll-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--paper); font-size: 14px; }
/* the stats: five cardboard tiles, the picture over the number (side by side they ran off a phone's screen) */
.stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stat-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; padding: 5px 2px 4px;
  border-radius: 6px; background: var(--paper); border: 1px solid #0002; box-shadow: 0 2px 0 #0000002a; font: 18px/1.05 var(--font-display); white-space: nowrap; color: var(--marker);
}
.stat-pill > span { display: flex; align-items: center; gap: 3px; }
.stat-pill .icon { width: 26px; height: 26px; }
/* what the things / buffs add to the character's own value */
/* (a pill like the rewards': green on the cardboard was lost) */
.stat-pill small { font: 13px/1 var(--font-display); padding: 2px 4px; border-radius: 6px; color: #fff; }
.stat-pill .stat-plus { background: #3d9a45; }
.stat-pill .stat-minus { background: var(--bad); }
.profile-statistics { display: grid; gap: 10px; }
.profile-aggression { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid #98744566; border-radius: 6px; background: #f6edda; color: #3b2c1b; text-shadow: none; }
.profile-aggression .muted { color: #604930; opacity: 1; }
.profile-aggression-heading { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.profile-aggression-heading span { font-variant-numeric: tabular-nums; }
.profile-aggression-track { height: 7px; overflow: hidden; border-radius: 4px; background: #bba57e55; }
.profile-aggression-track i { display: block; height: 100%; border-radius: inherit; }
.profile-combat-effects { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 7px; }
.profile-secondary-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-secondary-stats .stat-pill { padding: 9px 5px 7px; gap: 5px; }
.profile-secondary-stats .profile-stat-label { display: block; color: #6a5034; font: 500 11px/1.2 var(--font-body); white-space: normal; }
.profile-passive { text-align: left; font-size: 12px; font-weight: 400; color: #604930; background: #f6edda99; border-left: 3px solid #ae7d3b; border-radius: 3px; padding: 10px 12px; }
.profile-passive > strong { display: block; margin-bottom: 5px; color: #3b2c1b; font: 14px var(--font-display); }
.profile-passive p { margin: 4px 0 0; line-height: 1.45; }
.profile-gang { align-items: center; }
/* the gang window's button: a tape strip like the gang's own label beside it, but orange and with an arrow (it opens) */
.profile-gang .chip-btn { border: 0; font-family: inherit; cursor: pointer; background: #ffb066; box-shadow: 0 2px 0 #c46a1e; }
.profile-gang .chip-btn::after { content: '›'; font-size: 16px; line-height: 1; margin-left: 2px; }
.profile-gang .chip-btn:active { transform: translateY(2px); box-shadow: none; }
.profile-playtime { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--marker); }
.profile-playtime .icon { width: 22px; height: 22px; }
@media (max-width: 420px) {
  .doll-col .item { width: 54px; height: 54px; }
  .doll-stage { min-height: 250px; }
  .stat-pill { font-size: 16px; }
  .stat-pill .icon { width: 22px; height: 22px; }
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* a label on a strip of tape (the gang, the points, the badges…) */
.chip-light {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--marker);
  background: var(--tape); box-shadow: 0 2px 0 var(--tape-shadow); clip-path: polygon(2% 0, 98% 5%, 100% 50%, 97% 100%, 3% 95%, 0 50%);
}
.chip-light .icon, .chip-light img { width: 18px; height: 18px; }
.ranking-wins { white-space: nowrap; }
.chip-light.badge { background: var(--tape); }
.lb-row { gap: 10px; padding: 6px 10px; min-height: 52px; }
.lb-row .lb-place { width: 34px; font: 18px var(--font-display); color: #5a4126; }
.lb-row .lb-place.medal { font-size: 24px; }
.lb-row .lb-status .icon { width: 34px; height: 34px; font-size: 24px; }
.lb-row .lb-name b { font-size: 15px; }
.lb-row .price-tag { white-space: nowrap; align-self: center; flex: none; }
.lb-row .lb-name { min-width: 0; overflow-wrap: anywhere; }
.lb-row .lb-place { flex: none; width: auto; min-width: 28px; }
.lb-row.lb-podium { background: linear-gradient(90deg, #fff4cf, var(--paper) 60%); }

/* ---------------------------------------------------------------- loot overlay */
.loot { flex-direction: column; gap: 14px; overflow: hidden; justify-content: safe center; touch-action: pan-y; }
.loot-stage { position: relative; width: min(520px, 94vw); min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding-block: 4px 8px; display: flex; flex: 0 1 auto; flex-direction: column; align-items: center; gap: 12px; overscroll-behavior: contain; }
.loot-stage::-webkit-scrollbar { display: none; }
.loot-stage > * { flex-shrink: 0; }
.loot-container { width: 180px; height: 180px; }
.loot-container img { width: 100%; height: 100%; object-fit: contain; }
.loot-container.shake img { animation: shake calc(0.12s * var(--loot-time-mult, 1)) infinite; }
@keyframes shake { 0% { transform: rotate(-6deg) translateX(-3px); } 50% { transform: rotate(6deg) translateX(3px); } 100% { transform: rotate(-6deg); } }
/* burst open: squash-and-stretch, rays in the colour of the best drop, dust puffs */
.loot-container { position: relative; }
.loot-container img { position: relative; z-index: 1; }
.loot-container.burst img { animation: burst calc(0.45s * var(--loot-time-mult, 1)) cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes burst { 0% { transform: scale(1.2, 0.75); } 45% { transform: scale(0.9, 1.18) translateY(-14px); } 100% { transform: scale(1); } }
.loot-container .rays {
  position: absolute; inset: -70px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rank, #fff3c4) 55%, transparent) 0deg 9deg, transparent 9deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); mask: radial-gradient(circle, #000 25%, transparent 68%);
  animation: rays-in 0.35s ease-out, spin 6s linear infinite;
}
@keyframes rays-in { from { transform: scale(0.2); opacity: 0; } }
@keyframes spin { to { rotate: 360deg; } }
.loot-container .puff {
  position: absolute; left: 50%; top: 62%; z-index: 2; width: 26px; height: 26px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 40% 40%, #f6ecd6, #cdb994); opacity: 0;
  animation: puff calc(0.65s * var(--loot-time-mult, 1)) ease-out forwards;
}
@keyframes puff {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0.95; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.4); opacity: 0; }
}
.loot-container.gone { animation: gone calc(0.22s * var(--loot-time-mult, 1)) ease-in forwards; }
.loot-sniffer-hint { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 8px; max-width: 100%; min-height: 18px; color: #ead6a8; font: 600 12px/1.4 var(--font-body); text-align: center; }
.loot-odds .loot-sniffer-hint { margin-bottom: 8px; }
.loot-upgrade-note { color: #f5d47b; font: 700 12px/1.4 var(--font-body); white-space: nowrap; animation: loot-upgrade-tick .25s ease-out; }
.loot-upgrade-note::before { content: '↑ '; }
.loot-odds-title { margin: 0 0 8px; text-align: center; font-size: 13px; color: #e4d4af; }
.loot-container.sniffer-upgrade .rays { display: none; }
.loot-container.sniffer-upgrade img.loot-upgrade-from { position: absolute; inset: 0; z-index: 2; animation: loot-upgrade-away .25s ease-in forwards; }
.loot-container.sniffer-upgrade img.loot-upgrade-to { animation: loot-upgrade-pop .4s ease-out; }
.loot-upgrade-firework { position: absolute; z-index: 4; width: 1px; height: 1px; pointer-events: none; }
.loot-upgrade-firework i { position: absolute; width: 3px; height: 8px; margin: -4px 0 0 -1px; border-radius: 2px; background: var(--spark-color); box-shadow: 0 0 4px var(--spark-color); opacity: 0; animation: loot-upgrade-spark .44s ease-out var(--spark-delay) forwards; }
@keyframes loot-upgrade-away { to { transform: translateY(-6px) scale(.96); opacity: 0; } }
@keyframes loot-upgrade-pop { 0% { transform: scale(.96); opacity: 0; } 35% { opacity: 1; transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes loot-upgrade-tick { from { opacity: 0; transform: translateY(2px); } }
@keyframes loot-upgrade-spark { 0% { opacity: 0; transform: rotate(var(--spark-angle)) scale(.2); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--spark-x), var(--spark-y)) rotate(var(--spark-angle)) scale(.5); } }
@media (prefers-reduced-motion: reduce) {
  .loot-upgrade-note, .loot-container.sniffer-upgrade img { animation: none; }
  .loot-upgrade-firework, .loot-container.sniffer-upgrade img.loot-upgrade-from { display: none; }
}
@keyframes gone { to { transform: translateY(24px) scale(0.75); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .loot-container .rays { animation: none; } }
.ribbon { position: relative; width: 100%; height: 104px; overflow: hidden; background: #0008; border-top: 3px solid var(--tape); border-bottom: 3px solid var(--tape); }
.ribbon-track { position: absolute; left: 0; top: 8px; display: flex; gap: 8px; will-change: transform; }
.ribbon-track .item { width: 88px; height: 88px; flex: none; }
.ribbon::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--hivis); box-shadow: 0 0 10px var(--hivis); }
.loot-result { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: rise 0.5s ease-out; }
.loot-result .item { width: 132px; height: 132px; box-shadow: 0 0 40px var(--rank); }
.loot-result .name { font: 30px var(--font-grunge); color: var(--paper); text-align: center; }
/* Rare finds keep their own rarity colour; the celebration never predicts the roll. */
.loot-celebration { isolation: isolate; }
.loot-celebration-backdrop::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  inset: 0;
  background: radial-gradient(ellipse 320px 210px at 50% 42%, color-mix(in srgb, var(--reward-color) 32%, transparent), transparent 68%);
}
.loot-celebration .loot-result { position: relative; isolation: isolate; }
.loot-celebration .loot-result::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  width: 290px; height: 290px; top: -76px; left: 50%; margin-left: -145px;
  background: repeating-conic-gradient(from 10deg, color-mix(in srgb, var(--reward-color) 42%, transparent) 0deg 7deg, transparent 7deg 30deg);
  mask: radial-gradient(circle, transparent 14%, #000 30%, transparent 69%);
  animation: spin 32s linear infinite;
}
.loot-celebration .loot-result .item {
  border-color: var(--rank); box-shadow: 0 0 24px color-mix(in srgb, var(--rank) 60%, transparent), 0 0 80px color-mix(in srgb, var(--rank) 28%, transparent);
}
.loot-celebration .loot-result .name { color: #fff1c4; text-shadow: 0 3px 0 #47260e, 0 0 24px color-mix(in srgb, var(--reward-color) 70%, transparent); }
.loot-celebration .loot-result .name.display-gold { font-family: var(--font-display); text-shadow: none; }
.reward-sparks { position: absolute; inset: 0; pointer-events: none; z-index: -1; overflow: visible; }
.reward-sparks i {
  position: absolute; left: 50%; top: 68px; width: 9px; height: 15px;
  background: #fff3c8; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  transform: rotate(var(--angle)) translateY(-124px); animation: reward-spark 2.4s var(--delay) ease-in-out infinite;
}
@keyframes reward-spark {
  0%, 100% { opacity: 0.15; scale: 0.55; }
  45% { opacity: 1; scale: 1.1; }
}
@media (prefers-reduced-motion: reduce) {
  .loot-celebration .loot-result::before, .reward-sparks i { animation: none; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .loot { gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .loot-stage { gap: 6px; }
  .loot-result { gap: 4px; }
  .loot-result .item { width: 104px; height: 104px; }
  .loot-result .name { font-size: 24px; }
  .loot-actions { gap: 8px; }
  .loot-actions .btn { min-height: 44px; }
  .loot-actions .btn.primary { font-size: 21px; }
}
@keyframes rise { from { transform: translateY(70px) scale(0.3); opacity: 0; } 70% { transform: translateY(-8px) scale(1.06); opacity: 1; } }
.flash { position: absolute; inset: 0; pointer-events: none; animation: flash 0.7s ease-out forwards; }
@keyframes flash { from { opacity: 0.85; } to { opacity: 0; } }
/* the odds: a dark game panel with bars in the rank colours */
.chances { width: min(400px, 92vw); padding: 12px 14px; border-radius: 14px; background: #1b1d22e8; border: 2px solid #ffffff1a; box-shadow: 0 8px 24px #0007; }
.odds { display: flex; flex-direction: column; gap: 8px; }
.odds-row { display: grid; grid-template-columns: 7.5em 1fr 3.6em; align-items: center; gap: 10px; }
.odds-name { color: var(--rank); font-weight: 700; font-size: 15px; white-space: nowrap; }
.odds-bar { height: 10px; border-radius: 5px; background: #ffffff14; overflow: hidden; }
.odds-bar > i { display: block; height: 100%; border-radius: 5px; background: var(--rank); box-shadow: 0 0 8px var(--rank); }
.odds-pct { color: var(--paper); text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }
/* the buttons under it: one height, rounded, the main action wider */
.loot-actions { display: flex; flex: 0 0 auto; gap: 10px; width: min(520px, 94vw); }
.loot-actions .btn { flex: 1; min-height: 56px; border-radius: 12px; clip-path: none; font: 17px var(--font-display); letter-spacing: 0.3px; }
.loot-actions .reward-label { flex-wrap: wrap; gap: 6px; }
.loot-reward-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); flex: 1 1 100%; column-gap: 10px; row-gap: 4px; min-width: 0; }
.loot-reward-row.single { grid-template-columns: 1fr; }
.loot-reward-row .loot-chances, .loot-reward-row .loot-double { min-width: 0; padding: 8px 10px; font-size: clamp(14px, 4vw, 17px); letter-spacing: 0; }
.loot-reward-row .loot-chances { padding-inline: 6px; }
.loot-double .reward-double { flex-wrap: nowrap; gap: 6px; white-space: nowrap; }
.loot-double-limit { grid-column: 2; text-align: center; font-size: 12px; line-height: 1.4; color: var(--paper); opacity: .85; }
.loot-actions .loot-double .reward-cost > img, .loot-actions .loot-double .reward-cost > .icon { width: 14px; height: 14px; }
.loot-double .reward-cost-text { display: none; }
.loot-actions .reward-cost { gap: 2px; padding: 2px 4px; font-size: 11px; }
.loot-actions .reward-cost > img, .loot-actions .reward-cost > .icon { width: 20px; height: 20px; }
.loot-actions { flex-wrap: wrap; }
.loot-actions .btn.primary.full { flex: 1 1 100%; order: 2; }
/* the last row: «Выбросить» beside «В тележку» */
.dont-ask { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.dont-ask input { width: 20px; height: 20px; margin: 0; accent-color: #ff6a1a; }
.confirm-modal { width: min(480px, 100%); }
.panel.confirm-acknowledgement, .art-panel .panel.confirm-acknowledgement { background: #f5ead2; background-clip: padding-box; }
.confirm-modal .modal-head { margin-bottom: 14px; }
.confirm-modal .modal-head .tape-label { background: none; clip-path: none; box-shadow: none; transform: none; padding-left: 0; font-size: 22px; }
.confirm-content { gap: 14px; }
.saddle-confirm-pet { display: flex; align-items: center; gap: 16px; padding: 10px; border-radius: 8px; background: #0000000b; }
.saddle-confirm-pet img { width: 110px; height: 100px; object-fit: contain; }
.saddle-acknowledgement { display: flex; align-items: flex-start; gap: 10px; line-height: 1.4; cursor: pointer; }
.saddle-acknowledgement input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--hivis); }
.confirm-copy { line-height: 1.5; color: #594630; }
.confirm-items { display: flex; flex-direction: column; gap: 8px; }
.confirm-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; background: #fffaf070; border: 1px solid #b89b6a50; border-radius: 9px; }
.confirm-item .item { width: 64px; height: 64px; flex: none; pointer-events: none; }
.confirm-item b { overflow-wrap: anywhere; }
.confirm-modal .dont-ask { padding: 3px 0; color: #6c5a43; font-size: 13px; }
.confirm-actions { padding-top: 3px; gap: 10px; }
.confirm-actions .btn { min-height: 48px; }
/* Keep navigation over the scrolling content using the window's cardboard texture. */
.modal-body .tabbed-panel > :is(.tabs, .tabs-scroll) {
  position: sticky; top: 0; z-index: 3;
  /* Sample the middle of the panel, excluding its torn border. */
  background: var(--cardboard-light) var(--panel-img, none) center / 200% auto;
}
/* Nested tabs scroll with the rows. Their edge shadows still anchor to their own strip. */
.modal-body .tabbed-panel .tabbed-panel > :is(.tabs, .tabs-scroll) { top: auto; background: none; }
.modal-body .tabbed-panel .tabbed-panel > .tabs { position: static; }
.modal-body .tabbed-panel .tabbed-panel > .tabs-scroll { position: relative; }
.confirm-danger .confirm-copy { padding-left: 12px; border-left: 3px solid #c17a36; }
/* Small warm reflections on the celebratory accents, rather than on every control. */
.hero-heading-ribbon { position: relative; }
.hero-heading-ribbon::before, .hero-heading-ribbon::after, .banner.win::before {
  content: ''; position: absolute; width: 14px; height: 22px; pointer-events: none;
  background: #fff8c9; filter: drop-shadow(0 0 5px #fff2a0);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: gold-twinkle 3.8s ease-in-out infinite;
}
.hero-heading-ribbon::before { left: 8px; top: 9px; }
.hero-heading-ribbon::after { right: 8px; bottom: 7px; width: 9px; height: 15px; animation-delay: -1.9s; }
.banner.win::before { right: 8px; top: -12px; }
@keyframes gold-twinkle { 0%, 75%, 100% { opacity: 0.25; scale: 0.65; } 85% { opacity: 1; scale: 1.15; } }
@media (prefers-reduced-motion: reduce) {
  .hero-heading-ribbon::before, .hero-heading-ribbon::after, .banner.win::before { animation: none; }
}
.loot-final { display: flex; gap: 10px; flex: 1 1 100%; order: 2; }
.loot-actions .btn .icon { width: 26px; height: 26px; }
.loot-actions .btn.primary { flex: 1.7; font-size: 24px; box-shadow: 0 4px 0 var(--hivis-dark), 0 8px 16px #0006; }
.loot-actions .btn:active { transform: translateY(2px); }
.loot-pvp { width: min(400px, 92vw); justify-content: center; }
.crack-bar { width: min(320px, 80vw); }
.crack-hint { display: flex; align-items: center; gap: 8px; width: min(320px, 80vw); padding: 6px 8px; border-radius: 10px; background: #000000a0; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; }
.crack-hint .icon { width: 28px; height: 28px; flex: none; }

/* ---------------------------------------------------------------- fight banner */
.banner {
  position: absolute; top: 22%; left: 50%; transform: translateX(-50%) rotate(-2deg);
  padding: 10px 22px; font: 44px var(--font-grunge); text-align: center; pointer-events: none;
  animation: slam 0.35s cubic-bezier(.2,1.6,.4,1);
}
.banner.win { background: linear-gradient(160deg, #ffad24, #d85c0b); border: 2px solid #ffd272; border-radius: 7px; box-shadow: 0 4px 0 #71300d, 0 0 36px #ffc04455; color: var(--marker); }
/* Paint the lettering as text, so only the outer plaque has a background. */
.banner.win .banner-title {
  display: inline-block; padding: 0 5px 5px; text-transform: uppercase;
  color: #ffdc38; -webkit-text-stroke: 1px #572300; paint-order: stroke fill;
  font-family: var(--font-display); font-style: italic;
  text-shadow: 0 3px 0 #582300, 0 5px 0 #291405;
}
.banner.win .sub { color: #fff6dd; text-shadow: 0 1px 2px #71300d; }
.banner.lose { background: #4a6d8c; color: #fff; }
.banner .sub { font: 600 14px var(--font-body); }
@keyframes slam { from { transform: translateX(-50%) scale(2.2) rotate(-8deg); opacity: 0; } }

.defeat-overlay { z-index: 96; align-items: flex-end; background: #14161a33; padding-bottom: calc(90px + var(--safe-bottom)); }
.defeat-modal { width: min(360px, 100%); }
.defeat-modal .btn { width: 100%; }

/* ---------------------------------------------------------------- popups near world objects */
.popup { position: absolute; left: 50%; bottom: calc(80px + var(--safe-bottom)); transform: translateX(-50%); width: min(380px, 94vw); padding: 12px; }
.popup .title { font: 24px var(--font-display); margin-bottom: 4px; }

/* emotes */
.emote-grid { display: grid; grid-template-columns: repeat(4, 56px); gap: 6px; padding: 8px; position: absolute; bottom: calc(70px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); }
.emote-grid { grid-template-columns: repeat(4, 64px); }
.emote-grid.anchored { bottom: auto; left: auto; transform: none; }
.emote-grid button { position: relative; width: 64px; height: 64px; padding: 4px; font-size: 30px; border-radius: 12px; border: 2px solid var(--cardboard-dark); background: var(--paper); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.08s; }
.emote-grid button.is-locked { filter: grayscale(0.55); }
.emote-lock { position: absolute; right: 1px; bottom: 0; font-size: 13px; line-height: 1; }
.emote-grid button:active { transform: scale(0.92); }
.emote-grid button .icon { width: 100%; height: 100%; font-size: 30px; }

/* world map */
.worldmap { position: relative; display: flex; justify-content: center; }
/* you on the city map: a DOM dot over the canvas, pulsing by itself (the canvas is redrawn only when something changes) */
.map-me {
  position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; pointer-events: none;
  display: flex; align-items: center; justify-content: center; font: bold 13px Rubik, sans-serif; color: #fff;
  background: #2d7dff; border: 3px solid #fff; box-shadow: 0 0 0 2px #1e1b18; box-sizing: border-box;
  animation: map-me 1.4s ease-out infinite; z-index: 1;
}
@keyframes map-me { 0% { box-shadow: 0 0 0 2px #1e1b18, 0 0 0 2px #2d7dffcc; } 100% { box-shadow: 0 0 0 2px #1e1b18, 0 0 0 18px #2d7dff00; } }
/* drawn: the badge's own picture, the halo pulsing round it */
.map-me.art { width: 34px; height: 34px; margin: -17px 0 0 -17px; background: none; border: none; border-radius: 50%; }
.map-me.art img { width: 100%; height: 100%; }
/* my points: a gold ring pulsing around the diamond on the canvas */
.map-mine {
  position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; pointer-events: none;
  border: 3px solid #ffd257; box-sizing: border-box; animation: map-mine 1.4s ease-out infinite;
}
@keyframes map-mine { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.map-find { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.map-find .btn.mine { background: #ffd257; color: #1e1b18; }
/* map.ts keeps the canvas inside the available height, with a visible scrolling area below on phones. */
.worldmap canvas { display: block; border-radius: 6px; touch-action: none; cursor: pointer; }
.arena-map-wrap { display: grid; justify-items: center; gap: 8px; }
.arena-map { display: block; width: min(100%, 68vh); height: auto; image-rendering: pixelated; border: 3px solid #3b3027; border-radius: 6px; }
.arena-map-note { text-align: center; color: #46382d; font-size: 13px; }
.map-access { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--paper); border-radius: 5px; color: var(--marker); font-size: 13px; font-weight: 600; line-height: 1.5; }
.map-access .icon { flex: none; }
.status-up-notice { display: flex; flex-direction: column; gap: 5px; max-width: min(78vw, 420px); text-align: left; line-height: 1.5; }
.status-up-notice span { font-size: 13px; }
/* a hatch's window: the plan around it with numbered exits, a button per exit under it */
.hatch-plan-wrap { display: flex; justify-content: center; }
/* map.ts sets the width: the window's, at most 420px and 46% of the screen height */
.hatch-plan { display: block; border-radius: 6px; cursor: pointer; }
.hatch-dest { display: flex; align-items: center; gap: 8px; text-align: left; }
.hatch-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #ff6a1a; color: #fff; font-weight: 700; font-size: 13px; border: 2px solid #fff; box-shadow: 0 0 0 1px #1e1b18;
}
.hatch-danger { flex: none; padding: 1px 6px; border-radius: 4px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; }
/* the legend: the markers in groups under small headings, as the map draws them; beside the map on a wide screen */
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin-top: 10px; }
.legend-group, .legend-items { display: contents; }
.legend-title { display: none; font: 12px "Russo One", sans-serif; text-transform: uppercase; letter-spacing: 0.04em; color: var(--cardboard-dark); margin-bottom: 4px; }

.legend-item { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 3px 8px 3px 3px; border-radius: 16px; background: #0000000f; }
.legend-item[hidden] { display: none; }
button.legend-item { border: 1px solid #79552e33; color: var(--marker); text-align: left; cursor: pointer; }
button.legend-item > span:not(.legend-icon) { flex: 1; }
button.legend-item::after { content: '✓'; flex: none; width: 12px; font-size: 12px; color: #426332; text-align: center; }
button.legend-item[aria-pressed="false"] { background: #00000005; border-style: dashed; }
button.legend-item[aria-pressed="false"] > * { opacity: .45; }
button.legend-item[aria-pressed="false"]::after { content: '−'; color: #806d55; }
button.legend-item:hover { border-color: #79552e99; background: #79552e18; }
button.legend-item:focus-visible { outline: 2px solid #b27027; outline-offset: 2px; }
.legend i { display: inline-block; flex: none; }
.legend .legend-icon { width: 28px; height: 28px; flex: none; }
/* a badge with a HUD icon inside (the lombard, «Малина»): the same look as on the map */
.legend .legend-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #1e1b18; box-sizing: border-box; }
.legend .legend-badge img { width: 78%; height: 78%; }
.map-modal.modal.wide { width: min(760px, 100%); }
@media (max-width: 699px) {
  .map-modal.modal.wide { height: 100%; padding: 6px 4px; }
  .art-panel .panel.map-modal { border-width: 10px; border-image-width: 10px; }
  .map-modal .modal-head { flex: none; margin: 0 0 4px; }
  .map-modal .modal-head .tape-label { font-size: 17px; padding-inline: 8px; }
  .map-modal .modal-close { width: 40px; height: 40px; margin-top: 0; }
  .map-modal .map-access { gap: 4px; padding: 2px 6px; margin-bottom: 4px; font-size: 12px; line-height: 1.35; }
  .map-modal .map-access .icon { width: 20px; height: 20px; }
  /* One row of shortcuts leaves the height to the map, even with several owned businesses. */
  .map-modal .map-find { flex-wrap: nowrap; overflow-x: auto; min-width: 0; gap: 4px; padding-bottom: 4px; margin-bottom: 4px; touch-action: pan-x; }
  .map-modal .map-find .btn { flex: none; min-height: 40px; padding: 4px 8px; font-size: 13px; white-space: nowrap; }
  .art-button .map-modal .map-find .btn:not(.primary),
  .art-button-primary .map-modal .map-find .btn.primary { border-width: 8px; border-image-width: 8px; padding: 0 6px; }
  .map-modal .map-find .icon { width: 20px; height: 20px; margin-right: 4px; }
  .map-modal .legend { margin-top: 6px; }
}
@media (min-width: 700px) and (min-height: 420px) {
  .map-modal.modal.wide { width: min(1120px, 100%); }
  .map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 178px; gap: 12px; align-items: start; }
  /* beside the map the legend is a tight column; on a low screen it scrolls by itself, the map stays in view */
  .map-layout .legend { display: flex; flex-direction: column; margin-top: 0; gap: 8px; max-height: calc(100vh - 110px); overflow-y: auto; overscroll-behavior: contain; }
  .map-layout .legend-group, .map-layout .legend-title { display: block; }
  .map-layout .legend-items { display: flex; flex-direction: column; gap: 3px; }
  .map-layout .legend-item { font-size: 13px; padding: 2px 8px 2px 2px; gap: 6px; }
  .map-layout .legend .legend-icon { width: 24px; height: 24px; }
  .map-layout .legend .legend-fights { width: 18px; height: 18px; }
}
.legend .legend-fights { width: 22px; height: 22px; margin: 3px; border-radius: 2px; background: rgba(235, 45, 30, 0.45); border: 2px dashed #ff3b2a; box-sizing: border-box; }

/* Short landscape: use the width for a map and a scrolling column, rather than shrinking the map under all controls. */
@media (min-width: 500px) and (max-height: 500px) and (orientation: landscape) {
  .map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 42%); gap: 8px 12px; align-items: start; }
  .map-main { display: contents; }
  .map-layout .worldmap { grid-column: 1; grid-row: 1 / span 3; position: sticky; top: 0; align-self: start; }
  .map-access { grid-column: 2; grid-row: 1; margin-bottom: 0; font-size: 12px; }
  .map-find { grid-column: 2; grid-row: 2; margin-bottom: 0; }
  .map-find .btn { font-size: 12px; white-space: normal; }
  .map-layout .legend { grid-column: 2; grid-row: 3; display: grid; grid-template-columns: 1fr; margin-top: 0; max-height: none; overflow: visible; }
}

/* toggles */
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 4px; border-bottom: 1px solid #0002; }
.audio-volume { display: flex; flex-direction: column; gap: 8px; padding: 8px 4px 12px; border-bottom: 1px solid #0002; }
.audio-volume-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.audio-volume output { font-variant-numeric: tabular-nums; }
.audio-volume input { width: 100%; min-height: 44px; margin: 0; accent-color: var(--accent, #e87932); cursor: pointer; touch-action: none; }
.switch { flex-shrink: 0; width: 54px; height: 30px; border-radius: 15px; background: #0003; border: none; position: relative; cursor: pointer; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); transition: left 0.15s; }
.switch.on { background: var(--hivis); }
.switch.on::after { left: 27px; }

.npc-tag { font-size: 11px; padding: 1px 5px; border-radius: 3px; background: #0002; vertical-align: middle; }
.badge-list { display: flex; flex-wrap: wrap; gap: 4px; }
.badge-list span { background: var(--tape); font-size: 11px; padding: 2px 6px; border-radius: 3px; }

@media (min-width: 601px) and (min-height: 501px) and (pointer: fine) {
  /* Use the shorter side of the game viewport so an ultrawide window still has room above the controls. */
  :root { --hud-button-size: clamp(58px, 36px + 4vmin, 80px); }
  .hud-bottom, .mm-btns { gap: calc(var(--hud-button-size) * 0.12); }
  .hud-bottom .hud-btn { font-size: calc(var(--hud-button-size) * 0.2); padding-inline: 8px; }
  .hud-btn.mm-btn { width: calc(var(--hud-button-size) * 0.8); height: calc(var(--hud-button-size) * 0.8); }
  .hud-btn .icon, .chat-bubble .icon {
    width: calc(var(--hud-button-size) * 0.5); height: calc(var(--hud-button-size) * 0.5); font-size: calc(var(--hud-button-size) * 0.4);
  }
  .mm-size { width: calc(var(--hud-button-size) * 0.45); height: calc(var(--hud-button-size) * 0.45); }
  .mm-size svg { width: 62%; height: 62%; }
  .context-actions .btn {
    min-height: max(48px, var(--hud-button-size) - 10px); font-size: max(16px, var(--hud-button-size) * 0.26);
  }
  .context-actions .btn.big {
    min-height: max(60px, var(--hud-button-size) - 10px); font-size: max(24px, var(--hud-button-size) * 0.33);
  }
}

@media (max-width: 420px) {
  /* seven buttons after the tutorial: they fit across a 360 px phone */
  .hud-bottom { gap: 3px; }
  .hud-btn { min-width: 46px; height: 52px; padding: 0 2px; font-size: 10px; letter-spacing: -0.3px; }
  .hud-btn img { width: 22px; height: 22px; }
  .minimap { width: 92px; height: 92px; }
  .minimap.big { width: 150px; height: 150px; }
  body.mm-big .quest, body.mm-big .goal { max-width: calc(100vw - 172px); }
  .chip { height: 32px; font-size: 13px; padding: 0 8px; }
}
/* the start screen on a phone held sideways: everything on one screen, no scrolling to the button */
@media (max-height: 500px) and (orientation: landscape) {
  .start { padding-top: calc(6px + var(--safe-top)); padding-bottom: calc(8px + var(--safe-bottom)); }
  .start .logo-img { width: auto; height: 60px; margin-bottom: 2px; }
  .hero-heading { flex-direction: row; margin-bottom: 7px; transform: rotate(-1deg); }
  .hero-heading-top { font-size: 15px; padding: 5px 10px; margin: 0 -4px 0 0; }
  .hero-heading-ribbon { font-size: 20px; padding: 3px 14px 7px; }
  .start-steps { margin: 0 0 6px; }
  .start-step { flex-direction: row; width: auto; padding: 4px 10px; gap: 6px; }
  .start-step-icon { width: 26px; height: 26px; }
  .sex-btn { height: 40px; min-height: 40px; padding: 4px 12px; }
  .class-cards { width: min(800px, 100%); }
  .class-card { flex-direction: row; padding: 4px 6px; gap: 6px; }
  .class-card .portrait, .class-card canvas { height: 76px; }
  .class-text { align-items: flex-start; }
  .class-card.selected::after { left: 6px; right: auto; width: 22px; height: 22px; font-size: 14px; line-height: 22px; }
  .class-card .class-line { min-height: 0; font-size: 12px; text-align: left; }
  .class-card .name { font-size: 17px; }
  .start-form { position: static; flex-shrink: 0; flex-direction: row; flex-wrap: wrap; align-items: center; width: min(800px, 100%); margin-top: 8px; padding-top: 4px; }
  .start-form .nick-row { flex: 1; min-width: 0; }
  .start-form .err { order: 3; width: 100%; min-height: 0; }
  .start-go { width: auto; flex: 0 0 165px; min-height: 52px; font-size: 22px; white-space: nowrap; }
  .start-form .err:empty { display: none; }
  .nick-row input { min-height: 48px; padding-inline: 8px; font-size: 16px; }
}
@media (max-height: 360px) and (orientation: landscape) {
  .start .logo-img { height: 40px; }
  .start .start-steps { display: none; }
  .start .hero-heading { margin-bottom: 4px; }
  .start .class-card .portrait, .start .class-card canvas { height: 60px; }
  .start .start-form { margin-top: 4px; }
}

/* Browser chrome and portal panels can leave a landscape iframe much shorter than the physical screen. */
@media (max-height: 440px) {
  .start { padding-top: calc(6px + var(--safe-top)); padding-bottom: calc(8px + var(--safe-bottom)); }
  .start > :is(.logo-img, h1, .start-steps, .hero-heading) { display: none; }
  .start .start-form { order: -1; margin: 0 0 6px; padding: 0; }
  .start .start-go { min-height: 48px; height: 48px; }
  .start .class-card .class-line { display: none; }
  .start .class-card .portrait, .start .class-card canvas { height: 60px; }
}
@media (max-width: 479px) and (orientation: landscape) {
  .start .start-form { flex-direction: column; align-items: stretch; }
  .start .start-go { width: 100%; flex: none; }
}
/* Keep class, sex and entry together even when the portal leaves only 120px of height. */
@media (min-width: 540px) and (max-height: 220px) {
  .start { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; gap: 6px; }
  .start .sex-row { grid-column: 1; grid-row: 1; }
  .start .sex-btn { min-height: 44px; height: 44px; }
  .start .class-cards { grid-column: 2; grid-row: 1; width: 100%; }
  .start .class-card { justify-content: center; padding: 4px 6px; min-width: 0; }
  .start .class-card.selected { transform: none; }
  .start .class-card .portrait, .start .class-card.selected::after { display: none; }
  .start .class-text { align-items: center; }
  .start .start-form { grid-column: 1 / -1; grid-row: 2; margin: 0; }
}
@media (max-height: 220px) {
  .overlay:has(.start-name-confirm) { padding: 4px; }
  .start-name-confirm { padding: 6px 12px; }
  .start-name-confirm .modal-head { margin: 0 0 2px; }
  .start-name-confirm .modal-head .tape-label { font-size: 18px; line-height: 22px; padding: 0; }
  .start-name-confirm .modal-close { display: none; }
  .start-name-confirm .modal-body { padding: 0; }
  .start-name-confirm .confirm-content { gap: 4px; }
  .start-name-confirm .confirm-copy { font-size: 14px; line-height: 18px; }
  .start-name-confirm .confirm-actions { padding-top: 0; }
}

/* phones held sideways: little height, so nothing may stack up from the bottom. Buttons go bottom-right, the chat
   takes the bottom-left corner beside them, the goal tape shrinks to a single line. */
@media (max-height: 500px) and (orientation: landscape) {
  .hud-bottom { left: auto; right: calc(6px + var(--safe-right)); transform: none; gap: 4px; }
  .hud-btn { min-width: 48px; height: 48px; padding: 0 3px; font-size: 10px; }
  .hud-btn .icon { width: 22px; height: 22px; font-size: 18px; }
  .context-actions { bottom: calc(62px + var(--safe-bottom)); }
  .context-actions .btn { min-height: 40px; font-size: 14px; }
  .chat { bottom: calc(6px + var(--safe-bottom)); left: calc(6px + var(--safe-left)); width: min(388px, calc(100vw - 340px - var(--safe-left) - var(--safe-right))); }
  .chat-bubble { bottom: calc(8px + var(--safe-bottom)); left: calc(8px + var(--safe-left, 0px)); }
  .chat-body { height: min(26vh, 120px); }
  .chat-preview { max-height: 48px; padding: 4px 8px; font-size: 12px; }
  .chat-tabs { padding: 4px; }
  .chat-tabs button { min-height: 28px; }
  .chat-input { padding: 5px; }
  .chat-input input, .chat-input .btn { min-height: 34px; }
  .goal { max-width: min(360px, 45vw); min-height: 30px; padding: 3px 6px 3px 10px; font-size: 12px; }
  .goal > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .goal-help { width: 20px; height: 20px; }
  .quest { max-width: min(380px, 48vw); padding: 5px 10px 5px 8px; gap: 8px; }
  .quest-icon { width: 34px; height: 34px; }
  .quest-text { font-size: 16px; }
  .minimap { width: 84px; height: 84px; }
  .minimap.big { width: 140px; height: 140px; }
  .chip { height: 30px; font-size: 13px; padding: 0 8px; }
  .toasts { top: calc(84px + var(--safe-top)); }
}

@media (max-width: 720px) and (max-height: 500px) and (orientation: landscape) {
  .chat { bottom: calc(60px + var(--safe-bottom)); width: min(388px, calc(100vw - 12px - var(--safe-left) - var(--safe-right))); }
}

@media (max-width: 600px) {
  /* Optional buttons must not change the minimap column width and rewrap the HUD chips. */
  .mm-btns { display: grid; grid-template-columns: repeat(2, 44px); }
  /* Keep recipe tiles and actions in one flow, including when the recipe wraps or folds. */
  .hud-followup {
    position: absolute; top: calc(var(--hud-chips-h, 84px) + var(--hud-card-h, 0px) + 12px); left: 6px; right: 6px;
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  }
  .hud-followup > .hud-pins { position: static; max-width: 100%; }
  .context-actions { position: static; align-items: flex-start; }
  .goal { max-width: calc(100vw - 112px); font-size: 12.5px; }
  .quest { max-width: calc(100vw - 108px); }
  .quest-text { font-size: 16px; }
  .context-actions .btn { min-height: 44px; font-size: 14px; }
  .toasts { top: calc(var(--hud-chips-h, 84px) + var(--hud-card-h, 44px) + 80px); }
  /* a phone has the «Чат» button: the collapsed chat isn't shown at all; a red dot on the button says there's news */
  .chat.collapsed { display: none; }
  .chip .chip-label { display: none; }
}

/* the smallest phones (320–380 px): the windows take the whole width, their cardboard edge gets thinner */
@media (max-width: 380px) {
  .overlay { padding-left: 4px; padding-right: 4px; }
  .modal { padding: 14px 6px 8px; }
  .art-panel .panel.modal { border-width: 12px; border-image-width: 12px; }
  .lb-row { gap: 6px; padding: 6px; }
  .lb-row .lb-status .icon { width: 28px; height: 28px; }
  .story-step { gap: 6px; padding: 6px; }
}

@container (max-width: 390px) {
  .profile-head { grid-template-columns: auto minmax(0, 1fr); gap: 6px 8px; }
  .profile-head .profile-status { width: 44px; height: 44px; }
  .profile-head .profile-status .icon { width: 32px; height: 32px; }
  .profile-head .profile-nick { font-size: 16px; gap: 3px 6px; }
  .profile-head .profile-wealth { grid-column: 1 / -1; flex-flow: row wrap; align-items: center; justify-content: space-between; }
}

/* main buttons on the orange-dyed paper (built from ui/button in main.ts applyArtSkins); last, so it wins everywhere */
.art-button-primary .btn.primary,
.art-button-primary .loot-actions .btn.primary {
  background: none; border: 12px solid transparent; border-image: var(--button-primary-img) 32 fill / 12px stretch;
  clip-path: none; box-shadow: none; padding: 0 8px; color: #fff; text-shadow: 0 2px 0 #7a2a00, 0 0 8px #0006;
}
.art-button-primary .btn.primary:disabled { filter: grayscale(0.6); }

/* real money: the same paper, dyed green */
.art-button-primary .btn.primary.prem-buy { filter: hue-rotate(95deg) saturate(1.15); }
.art-button-primary .btn.primary.prem-buy .reward-cost { filter: hue-rotate(-95deg) saturate(.869565); }
/* The primary paper button's border image extends past its box. */
.art-button-primary .btn.primary.attention::after { inset: -12px; border-radius: 16px; box-shadow: 0 0 14px 2px #ffb066; }

/* what you can do to a player near you (their profile) */
.pcard-actions { display: flex; gap: 10px; flex-wrap: wrap; }
/* trade: shops and the exchange */
.stall-line { display: flex; align-items: center; gap: 10px; }
.stall-line .item { width: 56px; height: 56px; flex: none; }
.stall .grow, .trade .grow { flex: 1; min-width: 0; }
.stall-lot-icon { position: relative; width: 56px; height: 56px; flex: none; }
.stall-remove {
  position: absolute; top: -4px; right: -4px; z-index: 1; width: 24px; height: 24px; padding: 0;
  display: flex; align-items: center; justify-content: center; border: 2px solid #70492c; border-radius: 50%;
  background: #f8e4b7; color: #843326; font: 700 22px/1 Arial, sans-serif; cursor: pointer; box-shadow: 0 1px 3px #0005;
}
.stall-remove:hover { background: #ffeecb; }
.stall-remove:focus-visible { outline: 2px solid var(--hivis); outline-offset: 2px; }
.price-input { width: 96px; }
.qty-input { width: 56px; }
.trade-cols { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.trade-side { flex: 1; min-width: 200px; }
.trade .items .item, .trade-side .items .item { width: 64px; height: 64px; }
.trade > .items[hidden] { display: none; }
.pcard-btn { flex: 1; min-height: 54px; font-size: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pcard-btn .icon { width: 28px; height: 28px; }


/* ---------------------------------------------------------------- Михалыч: the mentor of the story */
.mentor {
  position: absolute; left: 50%; bottom: calc(var(--hud-button-size) + 16px + var(--safe-bottom)); transform: translateX(-50%); z-index: 95;
  width: min(560px, calc(100vw - 16px)); display: flex; align-items: flex-end; gap: 10px; padding: 10px 12px 10px 8px;
  background: var(--paper); color: var(--marker); border-radius: 14px; border: 3px solid var(--cardboard-dark);
  box-shadow: 0 8px 26px #000a; cursor: pointer; animation: mentor-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.mentor.out { animation: mentor-out 0.2s ease-in forwards; }
@keyframes mentor-in { from { transform: translate(-50%, 30px); opacity: 0; } }
@keyframes mentor-out { to { transform: translate(-50%, 20px); opacity: 0; } }
.mentor-pic {
  width: 76px; height: 76px; flex: none; margin-top: -30px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 60%, #fff4d6, #d9bd88); border: 3px solid var(--cardboard-dark); box-shadow: 0 3px 8px #0005;
}
.mentor-pic img, .mentor-pic .icon { width: 92%; height: 92%; object-fit: contain; font-size: 44px; }
.mentor-pic.small { width: 44px; height: 44px; margin: 0; border-width: 2px; }
.mentor-pic.small .icon { font-size: 26px; }
.mentor-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mentor-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mentor-close { flex: none; width: 40px; height: 40px; border: 0; border-radius: 6px; background: #0000000d; cursor: pointer; }
#ui:has(> .overlay) > .mentor { visibility: hidden; }
.mentor-name { font: 15px var(--font-display); color: var(--hivis-dark); }
.mentor-text { font-size: 17px; line-height: 1.3; min-height: 2.6em; }
.mentor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mentor-dots { flex: 1; font-size: 12px; font-weight: 700; opacity: 0.5; }
.mentor-next { min-height: 40px; padding: 0 16px; font-size: 16px; white-space: nowrap; flex: none; }
.mentor-skip { border: none; background: none; padding: 4px 0; font-size: 13px; text-decoration: underline; opacity: 0.6; cursor: pointer; text-align: left; }
.mentor-offer { cursor: default; }
.mentor-offer .mentor-actions { flex-wrap: wrap; }
.mentor-offer .mentor-skip { min-height: 40px; }
.mentor-offer .mentor-next { max-width: 100%; white-space: normal; }
@media (max-width: 420px) {
  .mentor { gap: 8px; padding: 8px 10px 8px 6px; }
  .mentor-pic { width: 60px; height: 60px; margin-top: -24px; }
  .mentor-text { font-size: 15px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .mentor { bottom: calc(62px + var(--safe-bottom)); left: calc(50% - 60px); width: min(500px, calc(100vw - 260px)); }
  .mentor-pic { width: 56px; height: 56px; margin-top: -18px; }
  .mentor-text { font-size: 15px; min-height: 0; }
}

/* ---------------------------------------------------------------- highlight of the button the story needs */
.spot { position: absolute; inset: 0; z-index: 90; }
/* only a picture over the button: the tap goes through to it */
#ui .spot, #ui .spot * { pointer-events: none; }
.spot-ring {
  position: fixed; border-radius: 12px; border: 3px solid var(--hivis); pointer-events: none;
  box-shadow: 0 0 0 4px #ff6a1a55, 0 0 22px #ff6a1aaa; transition: left 0.15s, top 0.15s, width 0.15s, height 0.15s;
}
/* the yellow blink of the border: a yellow border over it fading in and out (the ring and its shadow stay still) */
.spot-ring::after { content: ''; position: absolute; inset: -3px; border-radius: inherit; border: 3px solid #ffd257; opacity: 0; animation: glow-fade 1.1s ease-in-out infinite; }
/* inside a menu: everything else dims a little */
.spot-finger { position: fixed; width: 44px; height: 44px; margin-left: -22px; pointer-events: none; transform: translateY(-100%); animation: finger-down 0.8s ease-in-out infinite; }
.spot-finger img { width: 100%; height: 100%; transform: rotate(90deg); filter: drop-shadow(0 2px 3px #000a); }
.spot-finger.up { transform: none; animation-name: finger-up; }
.spot-finger.up img { transform: rotate(-90deg); }
@keyframes finger-down { 0%, 100% { transform: translateY(-100%); } 50% { transform: translateY(calc(-100% - 10px)); } }
@keyframes finger-up { 0%, 100% { transform: none; } 50% { transform: translateY(10px); } }

/* ---------------------------------------------------------------- the journal: story and daily tasks */
.journal-content { container-type: inline-size; min-width: 0; }
.journal-modal > .journal-tabs { margin: 0 2px 10px; }
.journal-modal > .journal-tabs > .tab { flex: 1 1 auto; min-width: 0; padding-inline: 8px; }
.npc-quest-journal > .tabs { padding: 4px; border: 1px solid #927649; border-radius: 8px; background: #674b2b24; gap: 5px; }
.npc-quest-journal > .tabs > .tab { flex: 1; min-width: 0; padding: 9px 10px; white-space: normal; border: 0; border-radius: 5px; background: transparent; font-size: 13px; color: #62482f; }
.npc-quest-journal > .tabs > .tab.active { color: #fff0ca; background: #3a5140; box-shadow: inset 0 0 0 1px #ddc38255, 0 2px 3px #3c2c2422; }
.npc-quest-list { display: grid; gap: 10px; }
.quest-catalog { display: grid; gap: 18px; }
.quest-catalog-tier-title { margin: 0 0 8px; padding: 8px 10px; border-bottom: 1px solid #b49159; font-size: 14px; color: #493b28; }
.quest-catalog-rows { display: grid; gap: 6px; }
.quest-catalog-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 1px solid #b49159; border-radius: 8px; background: #f3e4c3; color: #372e21; font: inherit; text-align: left; cursor: pointer; }
.quest-catalog-row:not(:disabled):hover { background: #faedcf; border-color: #80643a; }
.quest-catalog-row:focus-visible { outline: 2px solid #526c43; outline-offset: 2px; }
.quest-catalog-copy { display: grid; gap: 4px; min-width: 0; }
.quest-catalog-copy > strong { font-size: 14px; line-height: 1.3; }
.quest-catalog-giver { font-size: 11px; color: #766343; }
.quest-catalog-reward { font-size: 11px; color: #3c663c; }
.quest-catalog-state { max-width: 65px; font-size: 10px; text-align: right; color: #765b39; }
.quest-catalog-row.is-locked { filter: grayscale(.85); opacity: .65; background: #e5dfd2; border-color: #b9afa0; cursor: default; }
.job-quest-groups { display: grid; gap: 10px; min-width: 0; }
.job-level { min-width: 0; border: 1px solid #b49159; border-radius: 8px; background: #ead7b5; }
.job-level > summary { padding: 12px; cursor: pointer; font-weight: 700; color: #493b28; }
.job-level > .npc-quest-list { padding: 0 8px 8px; }
.job-quest-card .npc-quest-title { font-size: 17px; cursor: default; }
.job-quest-card .npc-quest-description { margin: 8px 0; }
.job-quest-card .npc-quest-requirement { margin: 6px 0; }
.job-quest-card .job-rewards { margin: 8px 0; }
.job-quest-card .job-reward-tile { padding: 6px 8px; }
.job-quest-card .job-reward-tile > .icon { width: 20px; height: 20px; }
.job-quest-card.is-complete { padding-block: 10px; }
.job-items { display: grid; gap: 4px; margin: 8px 0; }
.job-rewards { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 12px 0; }
.job-reward-tile { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 10px 8px; border-radius: 8px; background: #d8e4bb; color: #344f2d; box-shadow: inset 0 0 0 1px #82986066; }
.job-reward-tile > .icon { flex: none; width: 28px; height: 28px; object-fit: contain; }
.job-reward-tile > strong { font-size: 15px; white-space: nowrap; }
.job-reward-phone { background: #e5dbc5; color: #493b28; box-shadow: inset 0 0 0 1px #aa8b5766; }
.job-reward-phone-icon { flex: none; font-size: 26px; line-height: 28px; }
.job-progress .cq-pin-copy { display: grid; min-width: 0; text-align: left; }
.job-npc-dialogue { display: grid; gap: 12px; }
.job-npc-speaker h2 { margin: 0; }
.job-npc-greeting { margin: 0; padding: 12px; border-left: 3px solid #94753c; background: #b4986330; }
.job-npc-portrait { object-position: center; }
.npc-quest-intro { margin: 1px 0 2px; color: #645036; font-size: 12px; line-height: 1.5; }
.npc-quest-card { min-width: 0; padding: 14px; border: 1px solid #b49159; border-radius: 10px; background: #f3e4c3; box-shadow: 0 2px 4px #4f31141a; }
.npc-quest-card.is-tracked { border-color: #526c43; box-shadow: inset 3px 0 #526c43; }
.npc-quest-heading { display: flex; align-items: center; gap: 12px; }
.npc-quest-portrait { width: 66px; height: 76px; flex: none; object-fit: contain; object-position: bottom; border-radius: 9px; background: radial-gradient(ellipse at bottom, #a5ad77, #3a5140); }
.npc-quest-summary { display: grid; justify-items: start; gap: 5px; min-width: 0; }
.npc-quest-giver { font-size: 10px; color: #766343; }
.npc-quest-title { padding: 0; border: 0; background: none; text-align: left; font: 400 18px/1.2 var(--font-display); color: #372e21; cursor: pointer; }
.npc-quest-title:hover { color: #945525; }
.npc-quest-status { font-size: 10px; color: #765b39; }
.npc-quest-status.tracked { color: #355a35; font-weight: 700; }
.npc-quest-description { margin: 12px 0; font-size: 13px; line-height: 1.5; color: #4f4331; }
.npc-quest-objective { margin-bottom: 10px; padding: 7px 9px; border-left: 3px solid #8d723e; background: #d5c39b55; font-size: 12px; }
.npc-quest-requirement { font-size: 11px; line-height: 1.4; color: #796344; }
.npc-quest-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.npc-quest-actions > .btn { min-height: 40px; padding: 8px 12px; font-size: 12px; }
.npc-quest-actions > .quest-track[aria-pressed=true] { color: #355236; }
.npc-quest-details { border: 0; background: none; color: #6c4c2a; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 11px; padding: 7px 2px; }
.story-intro > summary, .riding-note > summary, .cq-context > summary { cursor: pointer; font-size: 12px; color: #725a37; }
.story-intro > p, .riding-note > p, .cq-context > p { margin: 8px 0 0; }
.npc-quest-empty { display: grid; justify-items: center; gap: 8px; padding: 18px 14px; border: 1px dashed #aa8b57; border-radius: 10px; text-align: center; background: #ecdfc355; }
.npc-quest-empty > img { width: 68px; height: 82px; object-fit: contain; }
.npc-quest-empty > strong { font: 400 17px/1.2 var(--font-display); }
.npc-quest-empty > p { margin: 0 0 5px; max-width: 34ch; color: #776145; font-size: 12px; line-height: 1.5; }
.story-control-actions { flex-wrap: wrap; }
.story-road { display: flex; align-items: center; justify-content: space-between; gap: 2px; padding: 6px 4px 2px; position: relative; }
.story-road::before { content: ''; position: absolute; left: 24px; right: 24px; top: 50%; height: 4px; margin-top: 2px; background: repeating-linear-gradient(90deg, #0003 0 10px, transparent 10px 16px); }
.story-stop { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--paper); border: 3px solid #0002; display: flex; align-items: center; justify-content: center; filter: grayscale(1); opacity: 0.6; }
.story-stop img, .story-stop .icon { width: 30px; height: 30px; object-fit: contain; }
.story-stop.done { filter: none; opacity: 1; border-color: var(--good); }
.story-stop.now { filter: none; opacity: 1; border-color: var(--hivis); box-shadow: 0 0 0 4px #ff6a1a44; transform: scale(1.12); }
.story-head { display: flex; flex-direction: column; margin-top: 6px; }
.story-head b { font: 22px var(--font-display); }
.story-intro { font-size: 14px; }
.story-step { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--paper); }
.story-step + .story-step { margin-top: 6px; }
.story-step-icon { width: 38px; height: 38px; flex: none; display: flex; align-items: center; justify-content: center; }
.story-step-icon img, .story-step-icon .icon { width: 34px; height: 34px; object-fit: contain; font-size: 24px; }
.story-step.now { outline: 3px solid var(--hivis); }
.story-step > .grow { min-width: 0; overflow-wrap: break-word; }
.point-quest-actions { grid-column: 1 / -1; }
.story-step-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.story-step-totals .quest-progress { white-space: nowrap; }
.story-step-totals .quest-reward { display: flex; flex-direction: column; align-items: center; white-space: nowrap; text-align: center; }
.story-step-totals > .small { max-width: 120px; text-align: right; }
/* Use the panel's available width, including in a narrow desktop window or at browser zoom. */
@container (max-width: 420px) {
  .story-step { grid-template-columns: 38px minmax(0, 1fr); align-items: start; }
  .story-step-totals { grid-column: 2; align-items: flex-start; }
  .story-step-totals > .small { max-width: none; text-align: left; }
}
.story-step.done { opacity: 0.7; }
.story-step.done b { text-decoration: line-through; text-decoration-thickness: 2px; }
.story-step.later { opacity: 0.55; }
.quest-reward.got { background: #0002; color: inherit; box-shadow: none; }
.story-finale { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.story-finale b { font: 22px var(--font-display); }
.progress.thin { height: 8px; margin-top: 5px; }
.daily-chest { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: #ffd25740; border: 2px dashed #b8860b; margin-top: 8px; }
.daily-chest img { width: 54px; height: 54px; object-fit: contain; flex: none; }
.daily-chest.got { border-style: solid; background: #4caf5030; border-color: var(--good); }
.journal-help { margin-top: 12px; }

/* ---------------------------------------------------------------- ratings */
.rank-places { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.rank-place { display: flex; flex-direction: column; align-items: center; padding: 6px; border-radius: 8px; background: var(--paper); text-align: center; line-height: 1.15; }
.rank-place b { font: 24px var(--font-display); }
.rank-place.main { outline: 3px solid var(--hivis); }
.chat-msg .chat-hunt { flex: none; align-self: center; margin-left: auto; padding: 3px 10px; font-size: 12px; white-space: nowrap; writing-mode: horizontal-tb; min-height: 0; }
.help-dot { width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--marker); color: var(--tape); font: 700 13px/22px Rubik, sans-serif; cursor: pointer; padding: 0; vertical-align: middle; }

/* ---------------------------------------------------------------- casino: the one-armed bandit */
/* a dark velvet hall instead of the cardboard panel (also over the drawn panel frame) */
.panel.casino-modal, .art-panel .panel.casino-modal {
  background: radial-gradient(ellipse at 50% 0%, #5a141d, #1b0a0e 75%); border: 3px solid #b8892f; border-image: none; border-radius: 10px;
  box-shadow: 0 0 0 3px #1d130f, 0 14px 30px #000a;
}
.casino-modal .modal-body { color: var(--paper); }
.casino { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.casino .btn { width: 100%; }
.casino .card { color: var(--marker); }
.slot-machine { position: relative; display: flex; align-items: center; padding: 14px 0 4px; }
.slot-cabinet {
  position: relative; width: 236px; padding: 12px 10px 14px; border-radius: 26px 26px 10px 10px;
  background: linear-gradient(180deg, #d42a35, #8e1620 70%, #6c1018); border: 4px solid #1d130f;
  box-shadow: inset 0 0 0 4px #e8b84f, inset 0 -12px 18px #0006, 0 8px 0 #0006, 0 14px 30px #000a;
}
.slot-top {
  position: relative; height: 54px; margin-bottom: 12px; border-radius: 16px 16px 6px 6px;
  background: #151012; border: 3px solid #e8b84f; display: flex; align-items: center; justify-content: center;
}
.slot-title { font: 30px/1 var(--font-display); color: #ffd257; letter-spacing: 6px; text-shadow: 0 0 10px #ff5a5a, 0 2px 0 #7a0d16; }
.slot-machine.win .slot-title { animation: pulse 0.35s infinite; }
.slot-bulbs { position: absolute; left: 6px; right: 6px; top: -10px; display: flex; justify-content: space-between; }
.bulb {
  width: 14px; height: 14px; border-radius: 50%; background: #6b4a1a; border: 2px solid #1d130f;
  box-shadow: inset 0 -2px 0 #0005; transition: background 0.08s, box-shadow 0.08s;
}
.bulb.on { background: #fff6c8; box-shadow: 0 0 8px 3px #ffd257, inset 0 -2px 0 #e8b84f; }
.slot-machine.idle .bulb { animation: bulb-blink 1.4s steps(1) infinite; }
.slot-machine.idle .bulb.odd { animation-delay: -0.7s; }
.slot-machine.win .bulb { animation: bulb-blink 0.24s steps(1) infinite; }
.slot-machine.win .bulb.odd { animation-delay: -0.12s; }
@keyframes bulb-blink {
  0% { background: #fff6c8; box-shadow: 0 0 8px 3px #ffd257, inset 0 -2px 0 #e8b84f; }
  50% { background: #6b4a1a; box-shadow: inset 0 -2px 0 #0005; }
}
.slot-window {
  position: relative; display: flex; gap: 5px; justify-content: center; padding: 5px;
  background: #151012; border-radius: 8px; border: 3px solid #1d130f; box-shadow: inset 0 0 0 3px #e8b84f;
}
.slot-reel {
  position: relative; width: 64px; height: 192px; overflow: hidden; border-radius: 4px;
  background: linear-gradient(180deg, #c8c0b0, #fffaf0 30%, #fffaf0 70%, #c8c0b0);
}
/* the curve of the drum: darker above and below the pay line */
.slot-reel::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, #0009, #0000 32%, #0000 68%, #0009); }
.slot-strip { will-change: transform; }
.slot-strip.blur { filter: blur(1.4px); }
.slot-strip.settle { transition: transform 0.09s ease-out; }
.slot-sym { height: 64px; display: flex; align-items: center; justify-content: center; font-size: 40px; line-height: 1; user-select: none; }
.slot-sym img { width: 54px; height: 54px; }
.slot-sym.seven { font: 52px/1 var(--font-display); color: #e0182b; -webkit-text-stroke: 2px #1d130f; text-shadow: 0 3px 0 #7a0d16; }
.slot-payline { position: absolute; left: 2px; right: 2px; top: 50%; height: 3px; margin-top: -1px; background: #ff3b3b; box-shadow: 0 0 6px #ff3b3b; opacity: 0.75; pointer-events: none; }
.slot-payline::before, .slot-payline::after { content: ''; position: absolute; top: -6px; border: 7px solid transparent; }
.slot-payline::before { left: -4px; border-left-color: #ffd257; }
.slot-payline::after { right: -4px; border-right-color: #ffd257; }
.slot-machine.win .slot-payline { background: #ffd257; box-shadow: 0 0 14px 2px #ffd257; opacity: 1; }
.slot-screen {
  margin-top: 10px; min-height: 34px; padding: 6px 8px; border-radius: 6px; background: #0b1a0d; border: 2px solid #1d130f;
  color: #7dff8a; font: 16px/1.25 var(--font-display); text-align: center; text-shadow: 0 0 6px #3dff5a88;
}
.slot-screen.jackpot { color: #ffd257; text-shadow: 0 0 8px #ffb000; animation: pulse 0.45s 5; }
.slot-tray { height: 16px; margin: 10px 26px 0; border-radius: 0 0 14px 14px; background: linear-gradient(#1d130f, #3a2a1a); border: 3px solid #e8b84f; border-top: none; }
/* the lever on the right side: the arm stands up from the hub; pulled, it swings down towards you and springs back */
.lever { position: relative; flex: none; width: 46px; height: 240px; margin-left: -6px; padding: 0; border: none; background: none; cursor: pointer; touch-action: manipulation; }
.lever:disabled { cursor: default; }
.lever.dead { opacity: 0.55; }
.lever-hub {
  position: absolute; left: 0; top: 50%; width: 26px; height: 44px; margin-top: -22px; border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, #8f6f2c, #f4d27a 55%, #8f6f2c); border: 3px solid #1d130f;
}
.lever-arm {
  position: absolute; left: 13px; top: 24px; width: 10px; height: 96px; transform-origin: 50% 100%;
  background: linear-gradient(90deg, #6f6f6f, #f2f2f2 40%, #7a7a7a); border: 2px solid #1d130f; border-radius: 5px;
}
.lever-ball {
  position: absolute; left: 3px; top: 9px; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9a9a, #d01c2a 45%, #7a0d16); border: 3px solid #1d130f; box-shadow: 0 3px 6px #0006;
}
.lever:not(:disabled):hover .lever-ball { filter: brightness(1.15); }
.lever.pulled .lever-arm { animation: lever-arm 1.5s both; }
.lever.pulled .lever-ball { animation: lever-ball 1.5s both; }
/* down fast (0.3 s), a moment at the bottom, back up smoothly with a little overshoot */
@keyframes lever-arm {
  0% { transform: scaleY(1); animation-timing-function: cubic-bezier(0.55, 0, 0.9, 0.7); }
  20% { transform: scaleY(-0.85); }
  30% { transform: scaleY(-0.85); animation-timing-function: cubic-bezier(0.3, 0.75, 0.35, 1.06); }
  100% { transform: scaleY(1); }
}
@keyframes lever-ball {
  0% { transform: translateY(0); animation-timing-function: cubic-bezier(0.55, 0, 0.9, 0.7); }
  20% { transform: translateY(var(--travel, 178px)); }
  30% { transform: translateY(var(--travel, 178px)); animation-timing-function: cubic-bezier(0.3, 0.75, 0.35, 1.06); }
  100% { transform: translateY(0); }
}
.slot-machine .flash { border-radius: 26px; }
.slot-coins { position: absolute; left: calc(50% - 20px); bottom: 14px; width: 0; height: 0; pointer-events: none; }
.coin {
  position: absolute; width: 18px; height: 18px; margin: -9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2b0, #ffd257 50%, #c98a1a); border: 2px solid #7a5a12;
  animation: coin 1.6s both;
}
@keyframes coin {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
  40% { transform: translate(calc(var(--dx) * 0.6), var(--dy)) rotate(calc(var(--r) * 0.5)); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.5); }
  100% { opacity: 0; transform: translate(var(--dx), 160px) rotate(var(--r)); }
}
.casino-chips { display: flex; align-items: center; gap: 8px; font: 18px var(--font-display); color: #ffd257; }
.casino-chips b { font-size: 26px; }
/* the casino hall behind (drawn), dimmed towards the bottom so the bar stands out; no gold frame, a dark edge */
.panel.casino-modal.hall, .art-panel .panel.casino-modal.hall {
  background: linear-gradient(180deg, #0003, #0009 80%), var(--hall) center / cover; border: none; border-radius: 14px;
  box-shadow: 0 0 0 3px #1d130f, 0 18px 40px #000c;
}
/* under the machine: chips · jackpot · button, in one dark bar */
.casino-bar { display: flex; align-items: center; gap: 14px; width: min(100%, 440px); padding: 8px 10px 8px 14px; border-radius: 14px; background: #000b; }
.casino .casino-bar .btn { width: auto; flex: 1; min-height: 52px; font: 20px var(--font-display); }
.casino-bar .casino-chips .icon { width: 30px; height: 30px; font-size: 24px; }
.casino-empty { font-size: 13px; opacity: 0.75; text-align: center; }
/* the pay table: small tiles of the line (pictures) and its prize; the one that just paid lights up */
.casino-pays { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: min(100%, 440px); }
.casino-pay { display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 5px; border-radius: 10px; background: #000a; color: #fff; transition: background 0.2s, transform 0.2s; }
.casino-pay b { font: 15px var(--font-display); color: #ffd257; }
.casino-pay.top { box-shadow: inset 0 0 0 2px #ffd25788; }
.casino-pay.top b { font-size: 17px; text-shadow: 0 0 8px #ffb00088; }
.casino-pay.hit { background: #3d9a45; transform: scale(1.08); box-shadow: 0 0 12px #8cff7a; }
.casino-pay-line { display: flex; gap: 1px; }
.casino-pay .slot-sym { width: 22px; height: 22px; font-size: 17px; }
.casino-pay .slot-sym img { width: 22px; height: 22px; }
.casino-pay .slot-sym.seven { font-size: 20px; -webkit-text-stroke-width: 1px; text-shadow: 0 1px 0 #7a0d16; }
.casino-pay .slot-sym.any { color: #fff8; font-size: 14px; }
/* the drawn machine: the cabinet picture over the reels (they show through its window), our lights over its bulbs, the
   lever on its hub; everything is placed in parts of the cabinet (CABINET in casino.ts), sizes follow its width --mw */
.slot-machine.art { display: block; width: min(260px, 60vw, calc(60vh * 0.5596)); aspect-ratio: 573 / 1024; margin: 4px auto 0; padding: 0; }
.slot-machine.art > * { position: absolute; }
.slot-cabinet-img { width: 100%; height: 100%; left: 0; top: 0; z-index: 2; }
.slot-machine.art .slot-window { display: flex; gap: 0; padding: 0; border: none; border-radius: 0; box-shadow: none; background: #151012; z-index: 1; }
.slot-machine.art .slot-reel { flex: 1; width: auto; height: 100%; border-radius: 0; }
.slot-machine.art .slot-reel + .slot-reel { border-left: 2px solid #1d130f; }
.slot-machine.art .slot-sym { height: var(--cell, 50px); font-size: calc(var(--cell, 50px) * 0.6); }
.slot-machine.art .slot-sym img { width: 84%; height: auto; }
.slot-machine.art .slot-sym.seven { font-size: calc(var(--cell, 50px) * 0.75); -webkit-text-stroke-width: 1.5px; }
.slot-machine.art .bulb {
  width: calc(var(--mw, 250px) * 0.16); height: calc(var(--mw, 250px) * 0.16); margin: calc(var(--mw, 250px) * -0.08) 0 0 calc(var(--mw, 250px) * -0.08);
  border: none; border-radius: 50%; box-shadow: none; z-index: 3; pointer-events: none; mix-blend-mode: screen; opacity: 0; transition: opacity 0.08s;
  background: radial-gradient(circle, #fffbe0 0 16%, #ffd257aa 34%, #ffb00000 70%);
}
.slot-machine.art .bulb.on { opacity: 1; box-shadow: none; background: radial-gradient(circle, #fffbe0 0 16%, #ffd257aa 34%, #ffb00000 70%); }
.slot-machine.art.idle .bulb { animation: glow-blink 1.4s steps(1) infinite; }
.slot-machine.art.win .bulb { animation: glow-blink 0.24s steps(1) infinite; }
@keyframes glow-blink { 0% { opacity: 1; } 50% { opacity: 0; } }
.slot-machine.art .slot-title { z-index: 3; display: flex; align-items: center; justify-content: center; font-size: calc(var(--mw, 250px) * 0.11); letter-spacing: calc(var(--mw, 250px) * 0.02); }
.slot-machine.art .slot-screen {
  z-index: 3; margin: 0; min-height: 0; padding: 0 4%; display: flex; align-items: center; justify-content: center; gap: 0.3em;
  background: none; border: none; border-radius: 0; font-size: calc(var(--mw, 250px) * 0.052); line-height: 1.1;
}
.slot-machine.art .lever { width: 0; height: 0; margin: 0; z-index: 4; }
.slot-machine.art .lever-arm {
  left: calc(var(--rod) / -12); top: calc(var(--rod) * -0.9167); width: calc(var(--rod) / 6); height: var(--rod);
  transform-origin: 50% 91.67%; background: none; border: none; border-radius: 0;
}
.slot-machine.art .lever-ball {
  left: calc(var(--rod) / 6 * -1.1); top: calc(var(--reach) * -1 - var(--rod) / 6 * 1.1); width: calc(var(--rod) / 6 * 2.2); height: calc(var(--rod) / 6 * 2.2);
  background: none; border: none; border-radius: 0; box-shadow: none;
}
/* what the finger hits: the rod and the knob (the pictures themselves let taps through) */
.lever-hit { position: absolute; left: calc(var(--rod) / 6 * -1.6); top: calc(var(--reach) * -1 - var(--rod) / 6 * 1.6); width: calc(var(--rod) / 6 * 3.2); height: calc(var(--reach) + var(--rod) / 6 * 2.2); }
.slot-machine.art .slot-coins { z-index: 3; }
.slot-machine.art .flash { z-index: 3; border-radius: 30%; }
.loot-chip {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 10px; padding: 8px 14px; border-radius: 10px; text-align: left;
  background: #1b0a0e; color: #ffd257; border: 2px solid #e8b84f; box-shadow: 0 0 16px #ffd25766; animation: rise 0.6s ease-out both;
}
.loot-chip .btn .icon { width: 28px; height: 28px; font-size: 22px; }
.loot-chip-tut { color: var(--paper); }
.loot-chip-tut b { color: #ffd257; }
.loot-chip-locked { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--paper); font-weight: 700; }
.loot-chip-locked .icon { width: 22px; height: 22px; font-size: 18px; }

/* Composite the touch controls separately from the redraws of the game canvas. */
.touch-controls > :is(.hud-bottom, .joystick) { will-change: transform; }
/* the on-screen stick (touch only): bottom-right above the buttons on a phone held upright (the chat owns the left) */
.joystick {
  position: absolute; right: calc(14px + var(--safe-right)); bottom: calc(84px + var(--safe-bottom)); width: 120px; height: 120px;
  border-radius: 50%; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle, #0000 52%, #00000038 53%, #00000038 70%, #0000 71%), #1e1b1840;
  border: 2px solid #f3e3a666; box-shadow: inset 0 0 18px #0006;
}
.joy-knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; pointer-events: none;
  background: linear-gradient(170deg, var(--cardboard-light), var(--cardboard)); border: 2px solid var(--cardboard-dark);
  box-shadow: 0 3px 0 var(--cardboard-dark), 0 6px 14px #0006; transition: transform 0.12s ease-out;
}
.joystick.on { border-color: #f3e3a6aa; }
.joystick.on .joy-knob { transition: none; }
/* held sideways: the buttons are bottom-right, so the stick goes bottom-left, beside the chat button */
@media (max-height: 500px) and (orientation: landscape) {
  .hud-daily-dock { left: calc(8px + var(--safe-left, 0px)); bottom: calc(122px + var(--safe-bottom)); transform: none; }
  .joystick { right: auto; left: calc(76px + var(--safe-left)); bottom: calc(10px + var(--safe-bottom)); width: 104px; height: 104px; }
}
@media (max-width: 620px) and (max-height: 500px) and (orientation: landscape) {
  .touch-controls > .joystick { bottom: calc(70px + var(--safe-bottom)); }
}

/* Mythic rarity keeps its frame and serial number, without an animated halo. */
.item .serial-tag { position: absolute; top: 2px; right: 3px; font-size: 10px; font-weight: 700; color: #fff; background: #b3123fcc; border-radius: 6px; padding: 0 4px; line-height: 15px; pointer-events: none; }
/* a bound thing (no trades): a small lock in the top-left corner */
.item .bound-tag { position: absolute; top: 1px; left: 2px; font-size: 11px; line-height: 15px; pointer-events: none; filter: drop-shadow(0 0 1px #fff); }
.serial-line { font-weight: 700; color: var(--r5); }

/* houses */
.house-card .link { text-decoration: underline; cursor: pointer; font-weight: 700; }
.house-clock { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.house-bids { display: flex; flex-direction: column; gap: 2px; }
.house-bid { display: flex; gap: 8px; padding: 4px 6px; border-radius: 4px; background: #0000000d; }
.house-bid.top { background: #f2b32033; }
.house-bid.me { outline: 2px solid var(--hivis); }
.house-bid span { cursor: pointer; }
.house-rent { display: flex; gap: 6px; align-items: center; font-weight: 700; padding: 8px 10px; border-radius: 6px; }
.house-rent.ok { background: #4caf5026; }
.house-rent.due { background: #d9483b26; color: #8a2620; }
.house-ico { font-size: 26px; width: 44px; text-align: center; }
.attention-card { outline: 3px solid var(--hivis); }
.good { color: #2e7d32; font-weight: 700; }
.bad { color: #b3261e; font-weight: 700; }
.chip.rent-chip { background: #c98a12; color: #fff; }
.chip.rent-chip.late { background: #b3261e; }

/* Shelter: cardboard dossiers, dark ink and tape, with the rules behind a fold. */
.shelter-view { display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: 1.4; }
.shelter-view .card { background: linear-gradient(115deg, #d1a467, #bb8a4d); border: 2px solid #79552e; border-radius: 3px 8px 3px 3px; padding: 14px; box-shadow: 2px 3px 0 #67421e45, inset 0 0 22px #79552e20; }
.shelter-view .card + .card { margin-top: 0; }
.shelter-view .section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 16px; }
.shelter-view .section-title > .icon { width: 28px; height: 28px; object-fit: contain; }
.shelter-intro { padding: 7px 0 9px; border-bottom: 2px dashed #79552e; font-weight: 600; color: #3d2a14; }
.shelter-kicker { font: 12px var(--font-display); text-transform: uppercase; letter-spacing: 0.8px; color: #5a3a1b; }
.shelter-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.shelter-fact { flex: 1 1 100px; display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid #74502f; background: #f3dfab70; border-radius: 2px; }
.shelter-fact > b { font: 20px/1.3 var(--font-display); }
.shelter-fact > span { font-size: 13px; color: #553b20; }
.shelter-lead { font-weight: 600; font-size: 14px; }
.shelter-hint { font-size: 13px; color: #56391d; }
.shelter-details { font-size: 14px; }
.shelter-details > summary { padding: 8px 0; color: #4e341b; font-weight: 600; cursor: pointer; }
.shelter-details > p { margin: 0; padding: 10px 12px; background: #f3dfab60; border-left: 3px solid #79552e; color: #382716; }
.shelter-view .shop-row { background: #e0b97b; border: 1px solid #79552e80; border-radius: 3px; }
.shelter-view .small { font-size: 13px; }
.shelter-view .muted { color: #624625; }
.shelter-view .btn:disabled { opacity: 0.65; }
.status-view .status-identity { display: flex; align-items: center; gap: 16px; background: radial-gradient(ellipse at 0 0, #604627, #33291f); color: var(--tape); border-color: #44301c; padding: 20px 16px; }
.status-identity > .icon { width: 70px; height: 70px; object-fit: contain; font-size: 50px; }
.status-identity .shelter-kicker { color: #c7a875; }
.status-name { font: 26px/1.2 var(--font-display); }
.status-ranks { display: flex; gap: 5px; }
.status-ranks i { width: 24px; height: 7px; border: 1px solid #c7a87560; background: #0003; transform: skew(-12deg); }
.status-ranks .earned { background: #f0c567; border-color: #ffe4a0; }
.status-max { padding: 4px 9px; border: 2px solid #d2b36f; color: #f0d28c; font: 13px var(--font-display); transform: rotate(-7deg); }
.character-setting { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 0; width: 100%; border: 0; border-bottom: 1px dashed #79552e90; background: none; color: var(--marker); text-align: left; cursor: pointer; font: inherit; }
.character-setting > span:first-child { flex: 0 0 62px; color: #624625; }
.character-setting > b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.character-edit { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; background: var(--tape); border: 1px solid #79552e; box-shadow: 1px 2px 0 #79552e70; transform: rotate(-4deg); font-size: 20px; }
.character-passive { font-size: 14px; color: #51391e; padding: 0 0 6px; }
.business-section > .card { gap: 10px; }
.business-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.business-view > .shelter-intro, .business-view > :nth-child(2), .business-view > .small { grid-column: 1 / -1; }
.business-section .card .shelter-details > summary { padding-bottom: 0; }
.hire-role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hire-role { display: flex; flex-direction: column; gap: 10px; padding: 12px 10px 10px; background: #493623; color: #f1dcae; border: 1px solid #6e4e28; border-radius: 3px; box-shadow: inset 0 0 20px #0002; }
.shelter-role-title { display: flex; align-items: center; gap: 8px; font: 17px var(--font-display); }
.shelter-role-title .icon { width: 36px; height: 36px; object-fit: contain; }
.shelter-role-benefit { font-size: 14px; flex: 1; }
.hire-role .btn { padding-left: 8px; padding-right: 8px; font-size: 13px; }
.house-district-picker { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.house-district-picker label { font: 14px var(--font-display); }
.house-district-select { flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; background: var(--tape); border: 2px solid #79552e; border-radius: 3px; color: var(--marker); font: 14px var(--font-display); }
.house-catalogue { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.house-type .shelter-facts { flex-direction: column; gap: 0; }
.house-type .shelter-fact { flex-basis: auto; border: 0; border-bottom: 1px dashed #79552e70; padding: 7px 0; background: none; }
.house-type .shelter-role-title { padding-bottom: 8px; border-bottom: 2px solid #79552e; }
.house-type .shelter-fact:first-child b { font-size: 23px; }
.house-type .shelter-fact:nth-child(2) b { font-size: 17px; }
.house-type .btn { margin-top: auto; }
.house-address { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: left; color: var(--marker); font: inherit; background: #d4ad70; border: 2px solid #79552e; border-radius: 3px; cursor: pointer; }
.house-address > .icon { width: 36px; height: 36px; object-fit: contain; }
.house-address > span:last-child { font-size: 24px; }
.modal:has(.shelter-view) .tab.active { background: #edcf91; box-shadow: inset 0 3px 0 #79552e; }
.buffet-bag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0 12px; border-bottom: 2px dashed #79552e; font-size: 14px; }
.buffet-bag .icon { width: 30px; height: 30px; object-fit: contain; }
.buffet-bag > span:last-child { color: #5c3f22; }
.buffet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.buffet-product { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.buffet-product > .item { width: 76px; height: 76px; flex: none; }
.buffet-product-name { font: 16px/1.3 var(--font-display); overflow-wrap: anywhere; }
.buffet-effects { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; color: #493018; }
.buffet-product .btn { width: 100%; min-height: 44px; margin-top: auto; font-size: 18px; }
@media (max-width: 520px) {
  .shelter-view .card { padding: 12px; }
  .status-identity { flex-wrap: wrap; }
  .status-name { font-size: 23px; }
  .status-max { margin-left: auto; }
  .hire-role-grid, .house-catalogue { grid-template-columns: 1fr; }
  .business-view { grid-template-columns: 1fr; }
  .shelter-fact > b { font-size: 18px; }
}
@media (max-width: 380px) {
  .buffet-grid { gap: 8px; }
  .buffet-grid .card { padding: 10px 6px; }
  .buffet-product > .item { width: 64px; height: 64px; }
  .buffet-product-name { font-size: 14px; }
}

/* Pawnshop: ink stamps, tape labels and a recipe on aged paper. */
.lombard { display: flex; flex-direction: column; gap: 10px; }
.lombard > :empty { display: none; }
.lombard-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lombard-rule { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 4px; text-align: center; border: 2px solid #79552e; border-radius: 3px; background: #f3e3a6ba; box-shadow: 2px 3px 0 #63421e40; }
.lombard-rule:first-child { transform: rotate(-1deg); }
.lombard-rule:last-child { transform: rotate(1deg); }
.lombard-rule > .icon { width: 30px; height: 30px; object-fit: contain; }
.lombard-rule b { font: 16px/1.2 var(--font-display); }
.lombard-rule:first-child b, .lombard-rule:last-child b { font-size: 23px; }
.lombard-rule > span { font-size: 11px; font-weight: 600; color: #674722; }
.lombard-rarities { height: 30px; display: flex; align-items: center; gap: 4px; }
.lombard-rarities i { width: 12px; height: 17px; background: var(--rank); border: 1px solid #392713; box-shadow: inset 0 0 0 2px #ffffff40, 0 2px 0 #0003; transform: rotate(-8deg); }
.lombard-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; color: #3d2a14; }
.lombard-section-head b { font: 16px var(--font-display); }
.lombard-section-head > span { font-size: 11px; font-weight: 600; padding: 3px 6px; background: #f3e3a6b0; }
.lombard-recipes { display: flex; flex-direction: column; gap: 12px; border-top: 2px dashed #765027; padding-top: 12px; }
.lombard-recipe { position: relative; padding: 14px 12px 12px; background: linear-gradient(115deg, #f1dfb5, #e3c58e); border: 2px solid #79552e; border-radius: 3px 9px 3px 3px; box-shadow: 3px 4px 0 #68472150, inset 0 0 22px #9e723b30; }
.lombard-recipe::before { content: ''; position: absolute; top: -7px; left: 38%; width: 64px; height: 13px; background: #f6e8b5b8; transform: rotate(-4deg); box-shadow: 0 1px 2px #67472230; }
.lombard-recipe .item-card { align-items: center; }
.lombard-recipe .item-card > .col { gap: 5px; min-width: 0; }
.lombard-recipe .item-card b { font: 16px/1.25 var(--font-display); }
.lombard-recipe .rank-text { font-size: 12px; color: #a01e49; text-shadow: none; }
.lombard-stats { display: flex; flex-wrap: wrap; gap: 5px; }
.lombard-stats > span { padding: 3px 6px; border: 1px solid #94703f70; background: #ffefc770; font: 13px var(--font-display); border-radius: 3px; white-space: nowrap; }
.lombard-collection { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; justify-content: space-between; font-size: 12px; }
.lombard-collection > span { font-size: 10px; color: #674722; }
.lombard-progress { height: 7px; border: 1px solid #79552e; background: #79552e30; overflow: hidden; transform: rotate(-0.4deg); }
.lombard-progress i { display: block; height: 100%; background: repeating-linear-gradient(110deg, #5e7535 0 8px, #799547 8px 12px); }
.lombard-recipe .craft-ings { gap: 10px; padding: 2px 0 5px; }
.lombard-recipe .craft-ing { opacity: 1; }
.lombard-recipe .craft-ing:not(.ok) .item > img:not(.rank-frame) { filter: saturate(0.65); }
.lombard-recipe .craft-n { bottom: -4px; font-size: 12px; background: #513820; border: 1px solid #e7cd96; }
.lombard-recipe .craft-ing.ok .craft-n { background: #3e642e; }
.lombard-recipe-status { font-size: 12px; font-weight: 600; color: #784624; }
.lombard-recipe-status.good { color: #355b25; }
.lombard-recipe .btn.primary:disabled { opacity: 1; background: #b49b72; color: #493820; text-shadow: none; box-shadow: 0 2px 0 #79552e; cursor: default; }
@media (max-width: 380px) {
  .lombard-rules { gap: 5px; }
  .lombard-rule b { font-size: 12px; }
  .lombard-rule > span { font-size: 10px; }
  .lombard-recipe { padding: 12px 8px 10px; }
  .lombard-recipe .craft-ings { gap: 6px; }
  .lombard-recipe .item-card b { font-size: 14px; }
}

/* mythic crafting */
.craft-card.locked { opacity: 0.85; }
.craft-ings { display: flex; flex-wrap: wrap; gap: 6px; }
.craft-ing { position: relative; width: 58px; opacity: 0.55; }
.craft-ing.ok { opacity: 1; }
.craft-ing .item { width: 58px; height: 58px; min-height: 0; }
.craft-n { position: absolute; left: 0; right: 0; bottom: -2px; text-align: center; font-size: 11px; font-weight: 700; color: #fff; background: #1e1b18cc; border-radius: 0 0 6px 6px; pointer-events: none; }
.craft-ing.ok .craft-n { background: #2e7d32dd; }
.craft-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.craft-actions > :first-child { flex: 1; }
.craft-pin { flex: none; }
.craft-card.pinned { outline: 3px solid var(--hivis); }
/* a thing of the pinned recipe: a pin in the corner of its tile, wherever it is shown */
.item .pin-tag { position: absolute; top: -6px; right: -6px; z-index: 2; width: 20px; height: 20px; border-radius: 50%; background: var(--tape); box-shadow: 0 0 0 2px var(--hivis); font-size: 11px; line-height: 20px; text-align: center; pointer-events: none; }
/* the pinned recipe on the street: under the task card and the hint, a card of the same tape as the task's, its things
   in a row of small tiles like the storage's (a missing one faded), the count on a pill under each */
.pinned-recipe {
  position: absolute; top: calc(var(--hud-chips-h, 48px) + var(--hud-card-h, 0px) + 12px); left: 6px; max-width: calc(100vw - 140px);
  display: flex; flex-wrap: wrap; gap: 5px; padding: 5px; cursor: pointer; border: none; font: inherit;
  background: var(--tape); color: var(--marker); border-radius: 12px; box-shadow: 0 4px 12px #0006, inset 0 -3px 0 var(--tape-shadow);
}
.pinned-recipe:active { transform: translateY(1px); }
.riding-pin-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; max-width: 170px; font-size: 11px; text-align: left; }
.pinned-recipe.ready { box-shadow: 0 4px 12px #0006, inset 0 -3px 0 var(--tape-shadow), 0 0 0 3px #6fd06a; }
.pin-ing { position: relative; width: 40px; height: 40px; border-radius: 8px; background: var(--paper); box-shadow: inset 0 0 0 1.5px #0000001f; }
.pin-ing img { position: absolute; inset: 2px 3px 10px; width: calc(100% - 6px); height: calc(100% - 12px); object-fit: contain; filter: drop-shadow(0 1px 1px #0004); }
.pin-ing:not(.ok):not(.pin-goal) img { opacity: 0.45; filter: grayscale(0.7); }
.pin-n {
  position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%); padding: 0 5px; border-radius: 7px; white-space: nowrap;
  font-size: 10px; font-weight: 700; line-height: 14px; background: var(--marker); color: var(--tape);
}
.pin-ing.ok .pin-n, .pinned-recipe.ready .pin-goal .pin-n { background: #2e7d32; color: #fff; }
/* the thing being made: first, on a hi-vis tile */
.pin-goal { background: #ffd9c2; box-shadow: inset 0 0 0 2px var(--hivis); margin-right: 3px; }
body.mm-big .pinned-recipe { max-width: calc(100vw - 200px); }
.house-district { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.house-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- the phone: a cheap smartphone with apps */
/* a plastic handset instead of the cardboard panel (also over the drawn panel frame), with its side buttons; the
   screen inside looks like a phone's, not like the game's cardboard windows: a wallpaper with app icons, apps with a
   coloured header, white lists, chat bubbles. The bomzh touch: a strip of tape over a cracked corner */
.panel.phone-modal, .art-panel .panel.phone-modal {
  /* the ✕ sits on the handset's top-right corner: a little room on both sides for the half of it that sticks out */
  width: min(380px, calc(100% - 44px)); margin-left: auto; margin-right: auto; padding: 9px; border-radius: 34px; border: 3px solid #0d0e10; border-image: none;
  background: linear-gradient(160deg, #474b55, #1c1d22 55%, #2a2c33); box-shadow: inset 0 0 0 2px #ffffff1c, inset 0 2px 0 #ffffff26, 0 14px 30px #000a;
  position: relative; overflow: visible;
}
/* the side buttons: volume on the left, power on the right */
.panel.phone-modal::before, .panel.phone-modal::after {
  content: ''; position: absolute; width: 4px; border: 2px solid #0d0e10; background: #2c2e35; pointer-events: none;
}
.panel.phone-modal::before { left: -7px; top: 110px; height: 58px; border-radius: 3px 0 0 3px; border-right: none; }
.panel.phone-modal::after { right: -7px; top: 150px; height: 74px; border-radius: 0 3px 3px 0; border-left: none; }
/* no tape label: the handset speaks for itself; only the ✕ is left, on the top-right corner of the handset */
.phone-modal .modal-head { position: absolute; top: -14px; right: -14px; margin: 0; z-index: 4; }
.phone-modal .modal-head .tape-label, .phone-modal .modal-head .spacer { display: none; }
.phone-modal .modal-close { margin-top: 0; }
.phone-modal .modal-body { padding: 0; overflow: visible; position: relative; }
/* a cracked corner, taped over: the bottom-left one, clear of the input and the buttons */
.phone-modal .modal-body::after {
  content: ''; position: absolute; left: -20px; bottom: 6px; width: 58px; height: 18px; transform: rotate(42deg); z-index: 3; pointer-events: none;
  background: var(--tape); opacity: 0.93; box-shadow: 0 1px 0 var(--tape-shadow);
  clip-path: polygon(3% 0, 97% 8%, 100% 50%, 96% 100%, 4% 92%, 0 50%);
}
.phone {
  --app: #1f2937; --app-dark: #111827; --app-soft: #e5e7eb;
  position: relative; display: flex; flex-direction: column; height: min(620px, calc(100dvh - 60px)); min-height: 320px;
  border-radius: 26px; overflow: hidden; color: #1d1f24; box-shadow: inset 0 0 0 2px #000; background: #f1f2f5;
  font-family: var(--font-body);
}
.phone > * { position: relative; z-index: 1; }
.phone[data-app='chats'] { --app: #2a95d6; --app-dark: #1b6ea8; --app-soft: #d8ecfa; }
.phone[data-app='market'] { --app: #f07c1d; --app-dark: #b8560c; --app-soft: #ffe7cf; }
.phone[data-app='pager'] { --app: #574935; --app-dark: #342f26; --app-soft: #d2dbac; background: #292a25; }
.phone[data-app='pager'] .phone-top { border-bottom: 3px solid #c69b4d; box-shadow: 0 3px 0 #191b17; }
.phone[data-app='pager'] .phone-title-text { color: #f5d397; font-family: var(--font-display); font-weight: 400; letter-spacing: .5px; }
.phone-screen.scr-pager { padding: 12px 10px; gap: 10px; background: repeating-linear-gradient(0deg, #0000 0 3px, #0000000a 3px 4px), linear-gradient(130deg, #414239, #292c25); }
.phone[data-app='pager'] .phone-home::after { background: #928b70; }
.app-pager { --ico-a: #f0d187; --ico-b: #a47630; }
.pager-push { top: calc(90px + var(--safe-top)); padding: 12px; gap: 11px; border: 3px solid #181b16; border-radius: 13px 18px 14px 11px; background: linear-gradient(145deg, #67634f, #3c3e32 55%, #32362c); box-shadow: inset 0 2px 0 #b5ac7b88, inset 0 -3px 0 #191e19, 0 5px 0 #11150f, 0 12px 24px #0007; }
.pager-push::before, .pager-push::after { content: ''; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: linear-gradient(135deg, #b5ac87, #4b4e3d); border: 1px solid #23271e; }
.pager-push::before { left: 5px; top: 6px; }
.pager-push::after { right: 5px; bottom: 6px; }
.pager-push .dm-push-ico { width: 48px; height: 54px; border: 1px solid #23281d; border-radius: 7px; background: repeating-linear-gradient(0deg, #252b21 0 2px, #5c604b 2px 4px); box-shadow: inset 0 1px 2px #0009; animation: none; }
.pager-push .dm-push-ico .app-svg { width: 46px; height: 46px; filter: drop-shadow(0 2px 1px #0005); }
.pager-push .dm-push-text { gap: 6px; }
.pager-push .dm-push-app { color: #f1ca7c; font: 400 12px/1.1 var(--font-display); letter-spacing: 1px; }
.pager-push .dm-push-app span { color: #c4bea1; font: 400 10px/1.2 var(--font-body); letter-spacing: 0; }
.pager-push .dm-push-msg { display: block; padding: 9px 11px; border: 2px solid #20291c; border-radius: 4px; background: repeating-linear-gradient(0deg, #0000 0 2px, #4254350a 2px 3px), linear-gradient(135deg, #d9e3ad, #b7ca8e); color: #283a24; box-shadow: inset 1px 2px 3px #273b3250, 0 1px 0 #8b9371; font: 600 14px/1.35 var(--font-body); text-shadow: 0 1px #eef4c94d; }
.pager-push-footer { display: flex; align-items: center; justify-content: space-between; height: 14px; padding: 0 3px; color: #e2b864; }
.pager-push-footer > span:last-child { font: 700 24px/12px var(--font-body); }
.pager-product-icon { display: grid; place-items: center; width: 100%; height: 100%; }
.pager-product-icon .app-svg { width: 112px; height: 112px; }
.tone-pager .prem-pic { background: radial-gradient(ellipse at 40% 30%, #fae7b8, #baa477); }
.pager-memory { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 3px 0; color: #c1baa1; font: 400 10px/1.2 var(--font-display); letter-spacing: .6px; text-transform: uppercase; }
.pager-memory b { font: 500 10px/1.2 var(--font-body); font-variant-numeric: tabular-nums; color: #e6c783; }
.pager-list { display: flex; flex-direction: column; gap: 10px; padding: 0 0 6px; }
.pager-notice { position: relative; padding: 12px; border: 2px solid #1e291b; border-radius: 4px 7px 5px 4px; background: repeating-linear-gradient(0deg, #0000 0 2px, #4353320a 2px 3px), linear-gradient(120deg, #dae4b0, #c4d49b); box-shadow: inset 0 2px 3px #4a643b44, 0 1px 0 #7f8963, 0 3px 0 #1f241b; color: #2d4027; }
.pager-notice-top { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #52673a40; padding-bottom: 7px; }
.pager-seq { color: #324c2b; font: 700 11px/1.2 var(--font-body); font-variant-numeric: tabular-nums; }
.pager-notice time { flex: 1; font: 500 11px/1.2 var(--font-body); color: #4c603d; font-variant-numeric: tabular-nums; }
.pager-notice p { margin: 9px 0 0; font: 600 14px/1.4 var(--font-body); text-shadow: 0 1px #f0f4ce55; }
.pager-bars { display: inline-flex; flex: none; width: 25px; height: 17px; align-items: flex-end; justify-content: space-between; gap: 3px; color: #304d29; }
.pager-bars i { display: block; flex: 1; min-width: 0; height: 5px; border: 1px solid currentColor; border-radius: 1px; background: currentColor; }
.pager-bars i:nth-child(2) { height: 10px; }
.pager-bars i:nth-child(3) { height: 16px; }
.signal-weak .pager-bars i:nth-child(3), .signal-veryWeak .pager-bars i:nth-child(n+2) { background: transparent; opacity: .3; }
.pager-push .pager-bars { height: 12px; width: 20px; color: #e2b864; }
.pager-push .pager-bars i:nth-child(2) { height: 8px; }
.pager-push .pager-bars i:nth-child(3) { height: 12px; }
.pager-filter { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 9px 10px; border: 1px solid #1c241b; border-radius: 6px; background: linear-gradient(#605e4c, #4c4d3e); box-shadow: inset 0 1px 0 #a5a08055, 0 2px 0 #20261b; color: #e7dfbd; font: 500 11px/1.35 var(--font-body); text-align: left; cursor: pointer; }
.pager-filter-toggle { flex: none; width: 32px; height: 18px; border: 1px solid #1e251b; border-radius: 4px; background: #282d23; padding: 2px; box-shadow: inset 0 1px 3px #0009; }
.pager-filter-toggle::after { content: ''; display: block; width: 12px; height: 12px; border: 1px solid #302e22; border-radius: 2px; background: linear-gradient(#b9af85, #8a8366); box-shadow: 0 1px 2px #0008; transition: transform .15s; }
.pager-filter.on .pager-filter-toggle { background: #a4bb70; }
.pager-filter.on .pager-filter-toggle::after { transform: translateX(14px); background: linear-gradient(#f0dca2, #bf9e58); }
.pager-status { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font: 500 10px/1.3 var(--font-body); color: #385030; }
.pager-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #385030; }
.pager-notice.status-cracked, .pager-notice.status-lost { background: repeating-linear-gradient(0deg, #0000 0 2px, #00000006 2px 3px), linear-gradient(120deg, #b5b9a0, #a3aa91); color: #49523f; }
.status-cracked .pager-status, .status-lost .pager-status { color: #525d48; }
.status-cracked .pager-status::before, .status-lost .pager-status::before { background: transparent; border: 1px solid #525d48; }
.scr-pager .phone-hint { border: 1px dashed #777c5c; border-radius: 5px; padding: 24px 12px; color: #d0cbae; font-size: 13px; }
.pager-push:focus-visible, .pager-filter:focus-visible { outline: 3px solid #efc66d; outline-offset: 3px; }
/* the wallpaper: an evening over the city outskirts — the sky, the sun going down behind the roofs and a chimney */
.phone[data-app='home'] {
  background:
    radial-gradient(circle at 72% 70%, #ffd38a 0 26px, #ffb35a55 27px, #0000 80px),
    linear-gradient(180deg, #1f2a55 0%, #4a3f7d 38%, #c8607a 70%, #f39a5f 88%);
}
.phone[data-app='home']::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 24%; pointer-events: none; z-index: 0;
  background: #1a1726;
  clip-path: polygon(0 40%, 9% 40%, 9% 22%, 20% 22%, 20% 48%, 29% 48%, 29% 10%, 33% 10%, 33% 0, 36% 0, 36% 10%, 41% 10%, 41% 36%, 55% 36%, 55% 18%, 68% 18%, 68% 44%, 78% 44%, 78% 26%, 90% 26%, 90% 50%, 100% 50%, 100% 100%, 0 100%);
}
.phone-bar {
  display: flex; align-items: center; justify-content: space-between; padding: 5px 18px 3px; flex: none;
  background: var(--app-dark); color: #fff; font: 700 12px/16px var(--font-body); font-variant-numeric: tabular-nums;
}
.phone[data-app='home'] .phone-bar { background: transparent; }
.phone-notch { width: 70px; height: 14px; border-radius: 0 0 10px 10px; background: #0d0e10; margin-top: -5px; }
.phone-signal { letter-spacing: -1px; font-size: 10px; opacity: 0.9; }
.phone-top {
  display: flex; align-items: center; gap: 6px; min-height: 50px; padding: 4px 12px 6px 6px; flex: none;
  background: var(--app); color: #fff; box-shadow: 0 2px 6px #0003; z-index: 2;
}
.phone-back {
  width: 38px; height: 38px; flex: none; border: none; border-radius: 50%; cursor: pointer; background: transparent;
  color: #fff; font: 700 34px/1 var(--font-body); padding: 0 0 5px;
}
.phone-back:active { background: #ffffff2e; }
.phone-title { flex: 1; min-width: 0; }
.phone-title-text { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 700 19px/1.2 var(--font-body); }
.phone-peer { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; border: none; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.phone-screen { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.phone-screen.scr-home { padding: 0; overflow: hidden; }
.phone-screen.scr-chat { overflow: hidden; padding: 0; gap: 0; background: #e8e1d6; }
.phone-home { flex: none; height: 22px; border: none; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.phone-home::after { content: ''; width: 120px; height: 5px; border-radius: 3px; background: #1d1f24aa; }
.phone[data-app='home'] .phone-home::after { background: #ffffffcc; }
.phone[data-app='chats'] .phone-home { background: #f6f6f6; }

/* the home screen: the clock widget, then the apps */
.phone-home-screen { display: flex; flex-direction: column; gap: 6px; padding: 26px 14px 10px; }
.phone-widget { text-align: center; color: #fff; text-shadow: 0 2px 8px #0007; padding-bottom: 18px; }
.phone-widget-time { font: 700 60px/1 var(--font-body); letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.phone-widget-date { font: 600 15px/1.3 var(--font-body); opacity: 0.92; margin-top: 4px; }
.phone-widget-date::first-letter { text-transform: uppercase; }
.phone-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 10px; padding: 6px 4px; }
.phone-app { display: flex; flex-direction: column; align-items: center; gap: 7px; border: none; background: none; cursor: pointer; padding: 0; }
/* an app icon: a glossy rounded square in the app's colour, outlined like everything in the game */
.phone-app-ico {
  position: relative; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #1e1b18; border-radius: 17px; background: linear-gradient(160deg, var(--ico-a), var(--ico-b));
  box-shadow: inset 0 2px 0 #ffffff59, inset 0 -3px 0 #0000002e, 0 4px 10px #0007;
}
.phone-app-ico::before {
  content: ''; position: absolute; inset: 3px 6px auto; height: 42%; border-radius: 12px 12px 30px 30px; pointer-events: none;
  background: linear-gradient(180deg, #ffffff40, #fff0);
}
/* Болтушка sky blue; Барахолка's caps on a cardboard tile */
.app-chat { --ico-a: #6cc8f4; --ico-b: #1f7fc4; }
.app-market { --ico-a: #f0d29c; --ico-b: #c48d4c; }
.app-stall { --ico-a: #8fc4ff; --ico-b: #3a6fd8; }
.phone-app:active .phone-app-ico { transform: scale(0.94); }
.phone-app-ico .icon { width: 44px; height: 44px; font-size: 32px; filter: drop-shadow(0 2px 1px #0005); }
.phone-app-ico .app-svg { width: 52px; height: 52px; }
.app-svg { display: inline-block; }
.app-svg svg { display: block; width: 100%; height: 100%; }
.phone-app .badge { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px; background: #f2392b; color: #fff; font: 700 12px/22px var(--font-body); box-shadow: 0 0 0 2px #fff; z-index: 1; }
.phone-app-label { font: 600 13px/1.2 var(--font-body); color: #fff; text-shadow: 0 1px 3px #000c; }
.phone-none { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 40px 14px 16px; color: #fff; text-shadow: 0 1px 3px #000c; }
.phone-none b { font: 700 20px var(--font-body); }
.phone-none-ico { font-size: 52px; line-height: 1; }
.phone-none .phone-apps { grid-template-columns: repeat(3, 66px); justify-content: center; margin-top: 10px; }

.phone-hint { text-align: center; font-size: 14px; font-weight: 600; color: #6b7280; padding: 22px 10px; }
.phone-list { display: flex; flex-direction: column; gap: 6px; }
.phone-thread, .phone-lot {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: none; border-radius: 14px;
  background: #fff; box-shadow: 0 1px 2px #0000001f; text-align: left; cursor: pointer; font: inherit; color: #1d1f24;
}
.phone-thread:active, .phone-lot:active { background: #f3f4f6; }
.phone-thread.unread { background: var(--app-soft); }
.phone-thread .badge { flex: none; min-width: 22px; height: 22px; border-radius: 11px; padding: 0 6px; background: var(--app); color: #fff; font: 700 12px/22px var(--font-body); text-align: center; }
.phone-ava { width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--app-soft); padding: 3px; }
.phone-staff-thread { flex-shrink: 0; }
.phone-staff-thread .phone-ava { display: grid; place-items: center; font-size: 24px; }
.phone-thread-text, .phone-lot-text { min-width: 0; gap: 2px; }
.phone-thread-text .row { gap: 6px; align-items: center; flex-wrap: nowrap; }
.phone-thread-text b, .phone-lot-text b { font: 700 15px var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-preview { display: block; font-size: 13px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-thread.unread .phone-preview { color: #1d1f24; font-weight: 600; }
.phone-lot .item { width: 50px; height: 50px; flex: none; padding: 2px; }
.phone-market-detail { padding: 0; overflow: hidden; }
.phone-lot-detail { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.phone-lot-detail-scroll { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain; padding: 10px; }
.phone-lot-detail-scroll > * { flex-shrink: 0; }
.phone-lot-return { align-self: flex-start; min-height: 44px; padding: 4px 0; border: 0; background: none; color: var(--app-dark); font: 600 14px var(--font-body); text-align: left; cursor: pointer; }
.phone-lot-detail .item-preview { padding: 12px; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px #0000001f; }
.phone-lot-detail .item-preview-head { flex-direction: column; align-items: stretch; }
.phone-lot-detail .item-preview-head > .item { align-self: center; width: 88px; height: 88px; }
.phone-lot-detail .item-preview-name { font: 700 19px/1.3 var(--font-body); }
.phone-lot-detail .card { background: #f3f4f6; border: 0; }
.phone-lot-go { flex: none; min-height: 48px; margin: 0 10px 10px; padding: 12px; border: 0; border-radius: 11px; background: var(--app-dark); color: #fff; font: 600 15px var(--font-body); cursor: pointer; }
/* a price in the phone is just a number in the app's colour, not the game's tape tag */
.phone .price-tag { flex: none; align-self: center; background: none; box-shadow: none; transform: none; padding: 0; color: var(--app-dark); font: 700 15px var(--font-body); white-space: nowrap; }
/* «Продают / Скупают»: a segmented switch */
.phone-seg { display: flex; flex: none; padding: 3px; border-radius: 11px; background: #e2e4e9; }
.phone-seg-btn { flex: 1; border: none; border-radius: 8px; padding: 7px 4px; background: none; cursor: pointer; font: 600 14px var(--font-body); color: #4b5563; }
.phone-seg-btn.on { background: #fff; color: var(--app-dark); box-shadow: 0 1px 3px #0003; }
.phone-search { flex: none; width: 100%; border: none; border-radius: 11px; padding: 9px 12px; background: #e2e4e9; font: 15px var(--font-body); color: #1d1f24; box-shadow: none; }
.phone-search:focus { outline: 2px solid var(--app); outline-offset: 0; background: #fff; }

.phone-msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; }
/* messages are bubbles: theirs white on the left, mine in the app's colour on the right */
.phone-msg {
  align-self: flex-start; max-width: 80%; padding: 7px 10px 6px; border-radius: 16px 16px 16px 4px;
  background: #fff; box-shadow: 0 1px 1px #0000002a; font-size: 14.5px; line-height: 1.3; word-wrap: break-word; color: #1d1f24;
}
.phone-msg.mine { align-self: flex-end; background: var(--app-soft); border-radius: 16px 16px 4px 16px; }
.phone-msg:has(> .chat-actions) { position: relative; padding-right: 38px; }
.phone-msg > .chat-actions { position: absolute; right: 3px; top: 4px; margin: 0; color: #776b58; }
.phone-msg-time { font-size: 10px; color: #6b7280; margin-left: 8px; white-space: nowrap; }
.phone-msg-author { display: block; font-size: 12px; margin-bottom: 3px; }
.phone-input { display: flex; align-items: center; gap: 8px; padding: 7px 8px; background: #f6f6f6; border-top: 1px solid #0000001a; flex: none; }
.phone-input input { flex: 1; min-width: 0; border: 1px solid #d6d8dd; border-radius: 20px; padding: 9px 14px; background: #fff; font: 15px var(--font-body); box-shadow: none; }
.phone-send {
  width: 42px; height: 42px; flex: none; border: none; border-radius: 50%; cursor: pointer; background: var(--app);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px #0003;
}
.phone-send:active { transform: scale(0.94); }
.phone-send img, .phone-send .icon { width: 24px; height: 24px; display: block; }
.phone-screen.scr-chat > .phone-hint { flex: none; background: #f6f6f6; border-top: 1px solid #0000001a; }
@media (max-height: 500px) and (orientation: landscape) {
  .phone { height: calc(100dvh - 40px); min-height: 0; }
  .phone-home-screen { padding-top: 8px; }
  .phone-widget { padding-bottom: 6px; }
  .phone-widget-time { font-size: 40px; }
  .phone-apps { padding: 4px; gap: 14px 10px; }
}

.tournament-power-warning { color: #b42318; font-weight: 700; }

/* Tournament pavilion: a compact fight-club board instead of generic lines in a cardboard modal. */
.arena-modal .modal-body { padding: 5px 10px 12px; }
.arena-panel { display: flex; flex-direction: column; gap: 11px; color: var(--marker); }
.arena-event {
  padding: 13px 15px 12px; border: 1px solid #8d6138; border-left: 6px solid var(--hivis); border-radius: 9px;
  background: linear-gradient(135deg, #f8efd9, #e9d8b8); box-shadow: 0 3px 0 #6c472b35, inset 0 1px #fff9;
}
.arena-event-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.arena-phase { padding: 3px 8px; border-radius: 12px; background: #6f5742; color: #fff2d0; font: 700 10px/1.25 var(--font-body); letter-spacing: .06em; }
.arena-phase.open { background: #477248; }
.arena-phase.live { background: #a83226; }
.arena-time { color: #5d4b39; font: 700 14px var(--font-display); white-space: nowrap; }
.arena-mode { margin-top: 6px; font: 26px/1.1 var(--font-display); }
.arena-event-detail { margin-top: 5px; color: #75634e; font-size: 12px; line-height: 1.35; }
.arena-power { padding: 10px 13px; border: 1px solid #96765380; border-radius: 8px; background: #4b382314; }
.arena-power-copy { display: flex; align-items: baseline; gap: 8px; }
.arena-power-title { font-weight: 700; }
.arena-power-copy b { font: 24px/1 var(--font-display); }
.arena-power-need { margin-left: auto; color: #78664f; font-size: 12px; }
.arena-power-track { height: 7px; margin-top: 7px; overflow: hidden; border-radius: 6px; background: #533a2a2b; }
.arena-power-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #547b48, #91a84d); }
.arena-power.low .arena-power-track i { background: linear-gradient(90deg, #b7402d, #d68b43); }
.arena-power-warning { margin-top: 7px; color: #a33327; font-size: 12px; font-weight: 700; }
.arena-signup { display: flex; flex-direction: column; gap: 5px; }
.arena-signup-button { width: 100%; min-height: 46px; font-size: 16px; }
.arena-signup-help { color: #69543f; font-size: 12px; text-align: center; line-height: 1.35; }
.arena-signup-help.low { color: #a33327; font-weight: 700; }
.arena-schedule { padding: 8px 12px 5px; border: 1px solid #89654165; border-radius: 8px; background: #fff4df78; }
.arena-section-title { margin-bottom: 4px; color: #806747; font: 700 10px var(--font-body); letter-spacing: .08em; }
.arena-schedule-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13px; }
.arena-schedule-row + .arena-schedule-row { border-top: 1px dashed #8c6b4850; }
.arena-schedule-row b { font: 700 15px var(--font-display); }
.arena-rules { padding: 0 3px 2px; color: #66543f; font-size: 12px; line-height: 1.4; }
@media (max-width: 520px) {
  .arena-modal .modal-body { padding: 3px 5px 8px; }
  .arena-mode { font-size: 23px; }
  .arena-event { padding: 11px 12px; }
}

.mm-btn.timed-ability { position: relative; touch-action: none; }
.timed-ability .ability-timer { position: absolute; right: -3px; bottom: -3px; padding: 1px 5px; border-radius: 7px; color: #fff; background: #292638; font: bold 16px/20px var(--font-display); font-variant-numeric: tabular-nums; }
.timed-ability .ability-timer:empty { display: none; }
.timed-ability:disabled { opacity: 0.75; }
.timed-ability.ability-active { opacity: 1; box-shadow: 0 0 12px #56e6ff; border-color: #56e6ff; }
.timed-ability.ability-active .ability-timer { background: #087c91; }
.riding-sprint-ability.ability-active { box-shadow: 0 0 12px #ffc766; border-color: #ffc766; }
.riding-sprint-ability.ability-active .ability-timer { background: #9a5100; }

.ability-coach-target { position: relative; z-index: 110; outline: 3px solid var(--tape); outline-offset: 4px; animation: ability-coach-pulse 1.3s ease-in-out infinite; }
.emote-grid button.ability-coach-target { background: #fff2b2; border-color: var(--hivis); outline-color: var(--hivis); }
@keyframes ability-coach-pulse { 50% { box-shadow: 0 0 0 9px #ffd77845; } }
.ability-coach { position: fixed; z-index: 111; pointer-events: auto; width: min(300px, calc(100vw - 24px)); padding: 14px; border: 2px solid var(--cardboard-dark); border-radius: 9px; background: var(--paper, #ead4a8); color: #352b23; box-shadow: 3px 5px 0 #3a281c70; }
.ability-coach-heading { display: flex; align-items: center; gap: 10px; font: 18px var(--font-display); }
.ability-coach-heading img { width: 38px; height: 38px; object-fit: contain; }
.ability-coach p { margin: 10px 0; font-size: 14px; line-height: 1.45; }
.ability-coach-times { display: flex; flex-wrap: wrap; gap: 6px; }
.ability-coach-times span { padding: 4px 7px; border: 1px solid #997747; border-radius: 5px; background: #c5a16a40; font-weight: 700; font-size: 12px; }
.ability-coach .ability-coach-warning { padding-left: 9px; border-left: 3px solid #9d6537; font-size: 12px; }
.riding-coach .ability-coach-heading small { margin-left: auto; white-space: nowrap; }
.riding-coach-inline { position: static; width: 100%; box-sizing: border-box; box-shadow: none; }
.enchant-coach-inline { position: static; width: 100%; box-sizing: border-box; box-shadow: none; margin-bottom: 12px; }
.enchant-coach-inline .ability-coach-heading { font-size: 16px; }
.enchant-coach-inline p { margin: 7px 0; font-size: 12px; }
.items > .enchant-coach { grid-column: 1 / -1; }
@media (prefers-reduced-motion: reduce) { .ability-coach-target { animation: none; } }
.royale-bar { position: fixed; bottom: calc(var(--hud-button-size) + 32px); left: 50%; transform: translateX(-50%); width: min(360px, 92vw); padding: 10px 12px; color: var(--marker); background: linear-gradient(135deg, var(--cardboard-light), var(--cardboard)); border: 2px solid var(--cardboard-dark); border-radius: 5px; box-shadow: 3px 4px 0 #37261970, inset 0 1px 0 #fff6; pointer-events: auto; z-index: 35; }
.royale-bar[hidden] { display: none; }
.royale-spectator { display: flex; align-items: center; gap: 12px; padding: 6px; }
.royale-spectator[hidden], .royale-skills[hidden] { display: none; }
.tournament-announcement { display: grid; gap: 12px; width: 100%; min-width: 0; box-sizing: border-box; padding: 14px; margin: 4px 0; border: 1px solid #a27c42; border-left: 3px solid #e7ae38; border-radius: 9px; background: linear-gradient(135deg, #352c22, #231f1a); color: #f3e7cd; text-align: left; max-width: 430px; overflow-wrap: anywhere; }
.tournament-announcement-heading { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.tournament-announcement-emblem { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #bd945044; border-radius: 8px; background: #e7ae3812; }
.tournament-announcement-emblem > .icon { width: 24px; height: 24px; object-fit: contain; }
.tournament-announcement-copy { display: grid; min-width: 0; gap: 3px; line-height: 1.3; }
.tournament-announcement-copy small { color: #bdac8d; font-size: 10px; letter-spacing: .7px; text-transform: uppercase; }
.tournament-announcement-copy b { color: #ffdb87; font: 15px/1.3 var(--font-display); }
.tournament-announcement-heading .chat-actions { align-self: start; margin: -4px -5px 0 0; }
.tournament-announcement-body { display: grid; gap: 5px; min-width: 0; }
.tournament-announcement-body strong { color: #edcc8a; font-size: 12px; font-weight: 600; }
.tournament-announcement-body p { margin: 0; font-size: 13px; line-height: 1.5; font-weight: 400; }
.tournament-announcement-prize { display: grid; gap: 3px; margin: 3px 0 6px; font-size: 13px; line-height: 1.5; }
.tournament-announcement-prize b { color: #ffdb87; }
.tournament-announcement .tournament-travel { width: 100%; min-width: 0; min-height: 44px; margin: 0; justify-self: stretch; }
.tournament-announcement .tournament-travel[hidden] { display: none; }
.toast:has(> .tournament-announcement) { width: 100%; box-sizing: border-box; padding: 0; background: none; border: none; box-shadow: none; transform: none; animation-delay: 0s, 9.6s; }
.toast > .tournament-announcement { margin: 0; }
.tournament-announcement.finished { border-left-color: #9ed783; }
.tournament-podium { display: grid; gap: 10px; list-style: none; padding: 0; margin: 5px 0 0; }
.tournament-podium li { display: grid; gap: 3px; min-width: 0; }
.tournament-podium b { color: #ffdb87; font-size: 13px; }
.tournament-podium span { font-size: 12px; }
.tournament-announcement.cancelled { border-left-color: #ec9787; }
.quest-catalog-row.quest-highlight, .npc-quest-card.quest-highlight { outline: 3px solid #f2ba46; outline-offset: 3px; box-shadow: 0 0 18px #f2ba4644; scroll-margin-block: 20px; }
.quest-catalog-row.quest-highlight.is-locked { opacity: 1; filter: none; }
.quest-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; min-width: 0; }
.quest-item { display: inline-flex; align-items: center; gap: 7px; padding: 4px 7px; max-width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid #947c4f66; border-radius: 6px; background: #00000012; font-size: 12px; line-height: 1.35; vertical-align: middle; text-align: left; }
.quest-item.ready { border-color: #769a5d; }
.quest-item-icon { width: 32px; height: 32px; object-fit: contain; flex: none; }
.quest-item-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.quest-item-name { overflow-wrap: anywhere; }
.quest-item-count { white-space: nowrap; }
.quest-catalog-row .quest-item-icon, .pinned-recipe .quest-item-icon { width: 24px; height: 24px; }
.pinned-recipe .quest-items { margin: 4px 0 0; gap: 4px; }
.pinned-recipe .quest-item { padding: 2px 4px; font-size: 11px; }
.royale-bar-heading { display: flex; align-items: center; justify-content: space-between; font: 14px var(--font-display); }
.royale-bar-heading .btn { padding: 2px 10px; }
.royale-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 7px 0; }
.royale-slot { position: relative; min-height: 90px; border: 2px solid var(--cardboard-dark); border-radius: 4px; background: var(--paper); color: var(--marker); box-shadow: 1px 2px 0 #6c472b50; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; }
.royale-slot:disabled { cursor: default; }
.royale-slot:not(:disabled):active { transform: translateY(2px); box-shadow: none; background: var(--tape); }
.royale-slot:focus-visible { outline: 3px solid var(--hivis); outline-offset: 2px; }
.royale-slot small { position: absolute; top: 3px; left: 6px; color: var(--cardboard-dark); }
.royale-item-art { width: 64px; height: 64px; object-fit: contain; }
.royale-effects { display: flex; gap: 5px; flex-wrap: wrap; font-size: 12px; }
.royale-effects span { color: var(--marker); background: var(--tape); border: 1px solid var(--tape-shadow); border-radius: 3px; padding: 3px 6px; }
.royale-bar > small { display: block; margin-top: 5px; font-size: 10px; opacity: .8; }
.royale-guide-hero { padding: 22px; color: var(--marker); background: var(--cardboard-light); border: 2px solid var(--cardboard-dark); border-radius: 5px; }
.royale-guide-hero small { color: #69543f; font-weight: 700; letter-spacing: 1px; }
.royale-guide-hero h2 { margin: 8px 0; color: var(--marker); font: 30px var(--font-display); }
.royale-guide p { line-height: 1.6; }
.royale-guide-steps { padding: 6px 16px; }
.royale-guide-item { display: flex; gap: 18px; align-items: center; padding: 16px; margin: 9px 0; color: var(--marker); border: 1px solid var(--cardboard-dark); border-radius: 4px; background: var(--paper); }
.royale-guide-item .royale-item-art { width: 88px; height: 88px; flex-shrink: 0; }
.royale-guide-item h3 { margin: 0 0 5px; color: var(--marker); font-family: var(--font-display); }
.royale-guide-item p { margin: 0; }
.royale-guide-footer { padding: 12px; opacity: .8; }
.mode-guide .tabs { margin-bottom: 12px; }
.mode-guide .tab { font-size: 14px; padding: 8px 12px; white-space: normal; }
.mode-guide .royale-guide { font-size: 15px; gap: 12px; }
.mode-guide .royale-guide-hero { padding: 18px; }
.mode-guide .royale-guide-hero h2 { font-size: 26px; }
.mode-guide .royale-guide-item { margin: 0; background: #dbb67a; }
.mode-guide .royale-guide-steps p { margin: 8px 0; }
.mode-guide-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.mode-guide-facts b { padding: 6px 10px; background: #493623; color: #f3e3a6; font-size: 14px; border-radius: 3px; }
.royale-blind .minimap, .royale-blind .arena-map, .royale-blind .worldmap { visibility: hidden; pointer-events: none; }
body.royale-blind .minimap { display: none !important; }
@media (max-width: 600px) { .royale-bar { bottom: 76px; width: 290px; } .royale-slot { min-height: 76px; } .royale-slot .royale-item-art { width: 48px; height: 48px; } .royale-guide-item { gap: 10px; padding: 10px; } }

/* Compact consumable bar: stable buttons so a HUD refresh cannot swallow a tap. */
.royale-bar { width: auto; max-width: calc(100vw - 24px); padding: 6px; }
.royale-skills { display: flex; align-items: center; gap: 6px; }
#ui:has(.royale-bar:not([hidden])) .combat-surrender { bottom: calc(var(--hud-button-size) + 118px + var(--safe-bottom)); }
#ui:has(.royale-bar:not([hidden])) .combat-targets { bottom: calc(var(--hud-button-size) + 172px + var(--safe-bottom)); }
/* Keep surrender away from the bottom pickup area on phones. */
@media (max-width: 600px) and (min-height: 501px) {
  .btn.combat-surrender { bottom: calc(var(--hud-button-size) + 88px + var(--combat-targets-height, 0px) + var(--safe-bottom)); }
  #ui:has(.royale-bar:not([hidden])) .combat-surrender { bottom: calc(var(--hud-button-size) + 182px + var(--combat-targets-height, 0px) + var(--safe-bottom)); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .btn.combat-surrender { left: calc(10px + var(--safe-left)); right: auto; }
}
.royale-slot { width: 58px; min-height: 58px; height: 58px; padding: 3px; }
.royale-slot .royale-item-art { width: 46px; height: 46px; }
.royale-help { min-width: 36px; min-height: 44px; padding: 4px 8px; }
.royale-slot.pending { opacity: .55; }
.royale-effects:empty { display: none; }
.royale-effects:not(:empty) { margin-top: 5px; max-width: 228px; }
.royale-sand-vision {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  backdrop-filter: blur(22px) brightness(.22) saturate(.4);
  -webkit-backdrop-filter: blur(22px) brightness(.22) saturate(.4);
  mask-image: radial-gradient(circle at var(--sand-x) var(--sand-y), transparent 0, transparent calc(var(--sand-radius) * .8), #000 calc(var(--sand-radius) * 1.35));
  -webkit-mask-image: radial-gradient(circle at var(--sand-x) var(--sand-y), transparent 0, transparent calc(var(--sand-radius) * .8), #000 calc(var(--sand-radius) * 1.35));
}
.royale-sand-vision[hidden] { display: none; }

/* A rent bill pinned to the same warm paper as the rest of the game. */
.rent-notice { position: relative; padding: 22px 18px 18px; border: 2px dashed #94632e; border-radius: 8px; background: linear-gradient(135deg, #fff0c9, #e9c68e); color: #493019; box-shadow: 0 3px 0 #68401d26; }
.rent-notice-stamp { float: right; width: 64px; height: 64px; margin: 0 0 12px 12px; transform: rotate(8deg); }
.rent-notice-stamp .icon { width: 100%; height: 100%; }
.rent-notice-kicker { font: 12px var(--font-display); letter-spacing: 1px; text-transform: uppercase; color: #8a5222; }
.rent-notice h3 { clear: both; margin: 8px 0 12px; font: 24px var(--font-display); }
.rent-notice p { margin: 0 0 16px; line-height: 1.5; }
.rent-notice-deadline { clear: both; padding: 10px 0 16px; border-top: 1px solid #94632e55; font-size: 13px; font-weight: 700; color: #8a3020; }

/* Short landscape screens: keep the figure and the prize table on screen. */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-head { flex-shrink: 0; }
  .profile-modal.modal { width: min(900px, 100%); height: 100%; }
  .profile-modal .modal-body { display: flex; overflow: hidden; }
  .profile-modal .profile-purchase { flex: 1; min-height: 0; }
  .profile-modal .profile-purchase-action { flex-shrink: 0; }
  .profile-modal .profile { flex: 1; min-width: 0; min-height: 0; gap: 6px; }
  .profile-modal .profile-textured { padding: 8px; }
  .profile-modal .profile-head { flex-shrink: 0; gap: 8px; padding: 6px 8px; }
  .profile-modal .profile-head.profile-banner { min-height: 64px; padding: 4px 8px; }
  .profile-modal .profile-status { width: 40px; height: 40px; }
  .profile-modal .profile-status .icon { width: 30px; height: 30px; }
  .profile-modal .profile-nick { font-size: 16px; }
  .profile-modal .profile-sub { font-size: 11px; }
  .profile-modal .profile-layout {
    display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1fr);
    gap: 12px; flex: 1; min-height: 0;
  }
  .profile-modal .doll { min-height: 0; gap: 6px; align-items: stretch; }
  .profile-modal .doll-col { justify-content: space-between; gap: 4px; }
  .profile-modal .doll-col .item {
    width: clamp(24px, calc((100dvh - 240px) / 4), 52px);
    height: clamp(24px, calc((100dvh - 240px) / 4), 52px);
  }
  .profile-modal .doll-stage { min-height: 0; }
  .profile-modal .doll-figure { min-height: 0; }
  .profile-modal .doll-figure .portrait { height: 100%; max-width: 100% !important; }
  .profile-modal .doll-figure .portrait > img { height: 100%; object-fit: contain; object-position: center bottom; }
  .profile-modal .doll-power { top: 4px; gap: 4px; padding: 3px 6px; font-size: 16px; }
  .profile-modal .doll-power small { font-size: 10px; }
  .profile-modal .doll-power .icon { width: 18px; height: 18px; }
  .profile-modal .profile-details { min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; gap: 6px; }
  .profile-modal .profile-details > * { flex-shrink: 0; }
  .profile-modal .stat-row { gap: 4px; }
  .profile-modal .stat-pill { font-size: 14px; }
  .profile-modal .stat-pill .icon { width: 20px; height: 20px; }
  .profile-modal .stat-pill > span { max-width: 100%; flex-wrap: wrap; justify-content: center; }
  .profile-modal .stat-pill small { font-size: 11px; padding: 2px 3px; }
  .profile-modal .profile-passive { font-size: 12px; padding: 10px; }
  .profile-modal .profile-secondary-stats .stat-pill .icon { width: 30px; height: 30px; }
  .profile-modal .section-title { margin-top: 4px; font-size: 13px; }
  .profile-modal .profile-playtime { font-size: 12px; }

  .casino-modal .casino {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 1.2fr);
    align-items: center; gap: 10px 18px;
  }
  .casino-modal .slot-machine { grid-column: 1; grid-row: 1 / span 3; }
  .casino-modal .slot-machine.art { width: min(205px, calc((100dvh - 120px) * 0.5596)); margin: 0 auto; }
  .casino-modal .casino-bar, .casino-modal .casino-pays, .casino-modal .casino-empty { grid-column: 2; width: 100%; }
  .casino-modal .casino-bar { gap: 8px; padding: 6px 8px; }
  .casino-modal .casino-bar .btn { min-height: 44px; font-size: 16px; }
  .casino-modal .casino-pays { gap: 8px; }
  .casino-modal .casino-pay { flex: 1 0 40%; justify-content: center; }
  .casino-modal .casino-empty { font-size: 12px; }
  .casino-modal .casino:not(.is-empty) .casino-empty { display: none; }
}

@media (max-height: 400px) and (orientation: landscape) {
  .profile-modal .modal-head, .casino-modal .modal-head { margin: -12px 0 4px -4px; }
  .profile-modal .modal-close, .casino-modal .modal-close { width: 36px; height: 36px; margin-top: 0; }
}

/* Kostya's workshop docket and the riding test. */
.riding-list { padding: 6px 0; }
.riding-entry {
  display: flex; align-items: center; text-align: start; width: 100%; gap: 14px;
  padding: 12px 15px; border: 1px solid #b58c50; border-radius: 14px;
  background: linear-gradient(120deg, #f4e2b8, #ebc78e); color: #2f3026; cursor: pointer;
}
.riding-entry:hover { border-color: #6a7450; }
.riding-entry img { width: 68px; height: 68px; object-fit: contain; background: #293b36; border-radius: 10px; }
.riding-entry small, .riding-entry span > span { font-size: .8rem; color: #544a33; }
.riding-entry strong { font-family: 'Russo One', sans-serif; font-weight: 400; }
.riding-chevron { font-size: 1.8rem; color: #67532f; }
.riding-panel .modal-body { padding: 0; }
.pet-panel { width: min(420px, 100%); }
.pet-panel .modal-body { padding: 0; }
.pet-card { background: #f7eedb; color: #302a23; }
.pet-card-scene { position: relative; display: grid; place-items: center; min-height: 224px; padding: 30px 18px 28px; overflow: hidden; background: radial-gradient(ellipse at 50% 90%, #a0ac76 0, #526b4d 38%, #263c33 85%); }
.pet-card-scene::before { content: ''; position: absolute; inset: 15px; border: 1px solid #e3c68b40; border-radius: 50% 50% 12px 12px; pointer-events: none; }
.pet-card-picture { position: relative; width: 100%; max-width: 360px; height: 200px; object-fit: contain; filter: drop-shadow(0 8px 6px #15271f55); }
.pet-card-tag { position: absolute; top: 14px; left: 16px; z-index: 1; background: #f0d094; color: #453420; padding: 5px 10px; border-radius: 5px; font-weight: 700; font-size: 12px; transform: rotate(-3deg); }
.pet-card-status { position: absolute; bottom: 12px; color: #fff1cb; font-size: 13px; }
.pet-card-details { display: flex; flex-direction: column; gap: 14px; padding: 18px 22px 20px; text-align: center; }
.pet-card-details h2 { margin: 0; font: 400 22px/1.2 var(--font-display); }
.pet-card-growth .pet-growth { margin: 0; }
.pet-card-copy { margin: 0; font-size: 14px; line-height: 1.5; }
.pet-card-action { width: 100%; min-height: 46px; }
.pet-card-details > :is(.pet-card-action, .pet-card-wardrobe, .pet-card-quest) { width: 100%; min-height: 46px; margin: 0; align-self: stretch; box-sizing: border-box; }
.pet-search-setting { display: flex; align-items: center; justify-content: center; gap: 8px; font: 14px/1.3 var(--font-body); cursor: pointer; }
.pet-search-setting input { flex: none; width: 17px; height: 17px; min-height: 0; margin: 0; padding: 0; accent-color: #597632; }
.phone-conversation-actions { display: flex; flex: none; flex-wrap: wrap; justify-content: space-between; gap: 4px; padding: 5px 10px; background: #f6f6f6; border-bottom: 1px solid #00000010; }
.phone-clear-history { min-height: 44px; }
.phone-top { position: relative; z-index: 3; }
.phone-header-actions { flex: none; position: relative; }
.phone-more, .phone-power { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: #ffffff1f; color: #fff; font: 700 28px/1 var(--font-body); cursor: pointer; }
.phone-power { font-size: 25px; }
.phone-power.on { background: #e0ffd9; color: #39742a; }
.phone-power.off { background: #ffffff28; color: #ffe1d7; box-shadow: inset 0 0 0 1px #ffffff66; }
.phone-power:disabled, .phone-enable:disabled { opacity: .5; cursor: wait; }
.phone-more:focus-visible, .phone-power:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.phone-conversation-menu { position: absolute; z-index: 5; top: calc(100% + 7px); right: 0; width: 205px; padding: 5px; border: 1px solid #0002; border-radius: 10px; background: #fffdf8; box-shadow: 0 5px 18px #0005; }
.phone-conversation-menu button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px; padding: 9px 11px; border: 0; border-radius: 6px; background: transparent; color: #513d30; text-align: left; font: 14px/1.35 var(--font-body); cursor: pointer; }
.phone-conversation-menu button:hover, .phone-conversation-menu button:focus-visible { background: #eee7da; outline: none; }
.phone-screen.scr-chats { padding: 0; overflow: hidden; gap: 0; }
.phone-dialogs-stage { position: relative; flex: 1; min-height: 0; }
.phone-dialogs-content { height: 100%; overflow-y: auto; padding: 10px; box-sizing: border-box; }
.phone-dialogs-stage.disabled .phone-dialogs-content { filter: grayscale(1); }
.phone-app-disabled { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 22px; background: #141c29c7; color: #fff; text-align: center; font: 13px/1.4 var(--font-body); }
.phone-disabled-icon { font-size: 44px; line-height: 1; color: #c0cad7; }
.phone-app-disabled b { font-size: 17px; }
.phone-app-disabled > span:not(.phone-disabled-icon) { color: #c9d2dc; }
.phone-enable { margin-top: 6px; min-height: 40px; padding: 9px 20px; border: 1px solid #ffffff70; border-radius: 8px; background: #fff; color: #246b9c; font: 600 14px/1.3 var(--font-body); cursor: pointer; }
.phone-thread.ignored, .phone-thread.ignored:active { border-color: #bfc0c2; background: #dddfe2; color: #676c73; }
.phone-thread.ignored .phone-ava { filter: grayscale(1); opacity: .7; }
.phone-thread.ignored .phone-preview { color: #727780; font-weight: 400; }
.phone-lock-art { flex: none; width: 28px; height: 28px; object-fit: contain; }
.phone-thread-lock { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 28px; }
.phone-thread-lock .phone-lock-art { width: 26px; height: 26px; }
@media (max-height: 500px) {
  .phone-app-disabled { padding: 10px; gap: 5px; font-size: 11px; }
  .phone-app-disabled .phone-disabled-icon { display: none; }
  .phone-app-disabled b { font-size: 14px; }
  .phone-enable { min-height: 32px; margin-top: 2px; padding: 5px 12px; font-size: 12px; }
}
.phone-block { border: 0; padding: 4px 6px; background: transparent; color: #775849; font: 12px/1.3 var(--font-body); cursor: pointer; }
.phone-blocked-hint { flex: none; padding: 12px; background: #e8dfd1; }
.pet-card-hint { margin: 0; color: #70644e; font-size: 12px; line-height: 1.4; }
.pet-card-hint:empty { display: none; }
@media (max-width: 480px) and (max-height: 700px) {
  .pet-card-scene { min-height: 148px; padding: 22px 12px 26px; }
  .pet-card-picture { height: 100px; }
  .pet-card-details { padding: 12px 14px; }
  .pet-card-details h2 { font-size: 20px; }
  .pet-card-copy { font-size: 13px; line-height: 1.4; }
}
@media (max-width: 600px), (max-height: 500px) and (orientation: landscape) {
  .pet-card:has(.riding-coach-inline) .pet-card-scene { min-height: 0; padding: 10px 12px 26px; }
  .pet-card:has(.riding-coach-inline) .pet-card-picture { height: 80px; max-width: 140px; }
  .pet-card:has(.riding-coach-inline) .pet-card-tag { top: 8px; left: 10px; font-size: 10px; padding: 4px 6px; }
  .pet-card:has(.riding-coach-inline) .pet-card-status { bottom: 8px; font-size: 12px; }
  .pet-card:has(.riding-coach-inline) .pet-card-details { padding: 12px 14px 16px; }
  .pet-card:has(.riding-coach-inline) h2 { font-size: 18px; }
  .pet-card:has(.riding-coach-inline) :is(.pet-card-growth, .pet-card-copy, .pet-card-wardrobe, .pet-search-setting) { display: none; }
  .riding-coach-inline { padding: 10px; }
  .riding-coach-inline .ability-coach-heading { gap: 8px; font-size: 16px; }
  .riding-coach-inline .ability-coach-heading img { display: none; }
  .riding-coach-inline p { margin: 8px 0 10px; line-height: 1.35; }
}
.riding-dossier { padding: 12px; background: #ecdfc0; color: #272e28; }
.riding-hero {
  display: flex; align-items: end; min-height: 116px; gap: 13px; padding: 10px 12px 0;
  color: #fff3d5; background: linear-gradient(110deg, #1c302e, #41594b); border-radius: 12px;
  overflow: hidden; box-shadow: inset 0 0 0 1px #40594c, 0 3px 0 #b99b6c;
}
.riding-portrait { width: clamp(86px, 25vw, 136px); height: 104px; object-fit: contain; object-position: center bottom; align-self: end; }
.riding-headline { padding-bottom: 12px; min-width: 0; }
.riding-headline small { color: #ecc98c; }
.riding-headline h2 { margin: 4px 0 8px; font: 400 clamp(1rem, 4vw, 1.36rem)/1.15 'Russo One', sans-serif; }
.riding-stamp { display: inline-block; background: #eac17a; color: #302c20; border-radius: 4px; padding: 4px 8px; font-weight: 700; font-size: .74rem; }
.riding-dialogue { margin: 14px 0; padding: 10px 12px; border-left: 3px solid #a46e3e; background: #f8ebcc; border-radius: 0 7px 7px 0; }
.riding-dialogue b { color: #6b4126; }
.riding-dialogue p { margin: 5px 0 0; font-size: .93rem; }
.riding-parts { display: grid; gap: 6px; }
.riding-part { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 5px 10px; background: #f7edd5; border: 1px solid #cab995; border-radius: 8px; }
.riding-part.ready { background: #dce7ca; border-color: #91a078; }
.riding-part small { color: #525345; }
.riding-part-icon { width: 46px; height: 46px; flex: 0 0 46px; object-fit: contain; border-radius: 7px; background: #ead8b2; }
.riding-count { font-variant-numeric: tabular-nums; color: #4c6239; }
.riding-note { margin: 10px 0; color: #504634; font-size: .87rem; }
.riding-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.riding-loot-note { display: flex; align-items: center; gap: 9px; text-align: start; }
.riding-exam-overlay { padding: max(4px, var(--safe-top)) max(4px, var(--safe-right)) max(4px, var(--safe-bottom)) max(4px, var(--safe-left)); }
.riding-exam-overlay .modal { width: min(96vw, 980px); max-width: 100%; height: min(100%, calc(min(96vw, 980px) * 9 / 16 + 160px)); }
.riding-exam-overlay .modal-body { display: flex; overflow: hidden; padding: 0; }
.riding-exam { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; width: 100%; gap: 7px; padding: 8px; background: #212e2a; color: #f7e2b1; }
.riding-meter { display: flex; gap: 9px; align-items: center; font-variant-numeric: tabular-nums; }
.riding-meter progress { width: 100%; height: 10px; accent-color: #e2af60; }
.riding-meter b { min-width: 3ch; text-align: end; }
.riding-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #31423b; border-radius: 8px; }
.riding-stage canvas { display: block; width: 100%; height: 100%; object-fit: contain; touch-action: manipulation; }
.riding-exam-card {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: 6px; padding: 10px; color: #fff0cc; text-align: center; background: #1b2222ba;
}
.riding-exam-card[hidden] { display: none; }
.riding-exam-card p { max-width: 45ch; margin: 0; font-size: clamp(.76rem, 2.3vw, .95rem); }
.riding-exam-card strong { font: 400 clamp(.88rem, 2.8vw, 1.24rem) 'Russo One', sans-serif; }
.riding-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.riding-controls button { flex-shrink: 0; }
.riding-controls .riding-jump { min-width: 7.5rem; touch-action: manipulation; }
.riding-rotate { display: none; margin: 0; font-size: .75rem; }
@media (orientation: portrait) and (max-width: 650px) {
  .riding-rotate { display: block; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .riding-exam-overlay .modal { height: 100%; padding: 6px 10px; }
  .riding-exam-overlay .modal-head { padding-block: 0; min-height: 33px; margin: 0 0 5px; }
  .riding-exam-overlay .modal-close { width: 32px; height: 32px; }
  .riding-exam-overlay .modal-close .icon { width: 24px; height: 24px; }
  .riding-exam { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); padding: 5px; gap: 4px; }
  .riding-meter { grid-column: 1 / -1; }
  .riding-controls { flex-direction: column; align-self: center; align-items: stretch; }
  .riding-controls button { min-height: 34px; padding-block: 4px; }
}
.staff-badge { display: inline-flex; align-items: center; margin: 0 4px; padding: 0 5px; border: 1px solid #a48655; border-radius: 3px; box-shadow: inset 0 1px 0 #fff3; font: 600 9px/1.6 var(--font-body); letter-spacing: .25px; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.staff-admin { color: #c73529; background: #ffe2cf; }
.staff-moderator { color: #653b25; border-color: #a87845; background: linear-gradient(180deg, #ebd1a3, #d7af76); }
.staff-helper { color: #434d2d; border-color: #8c9065; background: linear-gradient(180deg, #dbd4ad, #c3bb8b); }
.loot-guarantee-banner { position: absolute; z-index: 5; right: -26px; bottom: 3px; width: max-content; padding: 4px 5px; color: #11110d; transform: rotate(-9deg); font: 400 20px/1.2 'Rubik Wet Paint', var(--font-display); letter-spacing: -.6px; word-spacing: 3px; white-space: nowrap; -webkit-text-stroke: 3px #ffda19; paint-order: stroke fill; filter: drop-shadow(1px 2px 0 #070706) drop-shadow(-1px -1px 0 #070706); pointer-events: none; }
.loot-guarantee-banner::before { content: ''; position: absolute; z-index: -1; inset: 0; background: radial-gradient(circle at 3px 15px, #ffda19 0 2px, transparent 2.5px), radial-gradient(circle at 10px 5px, #ffda19 0 1.5px, transparent 2px), radial-gradient(circle at calc(100% - 3px) 24px, #ffda19 0 2px, transparent 2.5px), radial-gradient(circle at calc(100% - 9px) 4px, #ffda19 0 1px, transparent 1.5px); }
.loot-guarantee-banner::after { content: ''; position: absolute; right: 18%; top: 2px; width: 17px; height: 5px; border-top: 1px solid #fff4d1; border-radius: 70% 50% 0 0; transform: rotate(-12deg); }
.loot-guarantee-art { position: relative; margin-bottom: 12px; }
.loot-guarantee-art .loot-guarantee-banner { right: -35px; bottom: -3px; }
.staff-panel label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.staff-panel select { font: inherit; padding: 8px 10px; border: 2px solid var(--cardboard-dark); border-radius: 4px; color: var(--marker); background: #f7efdb; }
.staff-panel input[type=number] { width: 90px; }
.staff-panel .row, .staff-actions { flex-wrap: wrap; }


/* Pet wardrobe: companion stage, equipment slots and illustrated paper cards. */

.mount-wardrobe-panel.modal { width: min(1000px, 100%); }
.mount-wardrobe { display: grid; grid-template-columns: minmax(280px, .92fr) minmax(360px, 1.12fr); gap: 22px; align-items: start; }
.mount-wardrobe-stage { display: block; min-width: 0; padding: 0; overflow: hidden; border: 2px solid #665133; border-radius: 12px 8px 10px 14px; background: radial-gradient(ellipse at 50% 65%, #7b8c61, #3c5744 48%, #24372e 90%); color: #fff0c9; box-shadow: inset 0 0 0 3px #ddc89322, inset 0 -12px 28px #0c241844; }
.mount-wardrobe-stage-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 0; }
.mount-wardrobe-pet-state { display: block; margin-bottom: 4px; color: #d1c89d; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; }
.mount-wardrobe-pet-name { display: block; font: 21px/1.2 var(--font-display); color: #fff0c9; }
.mount-wardrobe-reset { flex: 0 0 82px; border: 0; padding: 4px; min-height: 34px; background: transparent; color: #e0d3b5; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 11px; }
.mount-wardrobe-reset:disabled { opacity: .35; cursor: default; }
.mount-wardrobe-pet-scene { position: relative; display: grid; place-items: center; min-height: 350px; padding: 0 5px 22px; }
.mount-wardrobe-preview { display: block; width: 100%; height: 340px; object-fit: contain; filter: drop-shadow(0 10px 10px #152b1966); }
.mount-wardrobe-scene-note { position: absolute; bottom: 9px; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: #dfd7ae; }
.mount-wardrobe-animals { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; width: 100%; padding: 12px 10px; border-top: 1px solid #d6c58c44; background: #132b2255; }
.mount-wardrobe-animal { position: relative; display: block; height: 44px; min-width: 0; padding: 0; border: 2px solid #a18b5a80; border-radius: 50%; background: #1d302b; cursor: pointer; box-shadow: inset 0 1px 4px #0005; }
.mount-wardrobe-animal-portrait { display: block; width: 100%; height: 100%; padding: 3px; overflow: hidden; border-radius: inherit; }
.mount-wardrobe-animal img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.mount-wardrobe-animal:hover { border-color: #f2d58f; }
.mount-wardrobe-animal.active { border-color: #f6c65d; background: #7e673b; box-shadow: 0 0 0 2px #ffdd851f; }
.mount-wardrobe-animal-owned { position: absolute; right: -1px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: #f0dba6; color: #355130; font: 700 11px/15px var(--font-body); }
.mount-wardrobe-catalog { min-width: 0; }
.mount-wardrobe-sections { display: flex; gap: 5px; margin-bottom: 14px; border-bottom: 2px solid #77543266; }
.mount-wardrobe-section { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; padding: 10px 8px 12px; border: 0; border-bottom: 4px solid transparent; background: #79592f21; color: #523b26; cursor: pointer; font-weight: 700; border-radius: 8px 8px 0 0; }
.mount-wardrobe-section .icon { width: 23px; height: 23px; object-fit: contain; }
.mount-wardrobe-section.active { border-bottom-color: #a4491f; background: #f1dfa9; color: #2b251c; }
.mount-wardrobe-slots { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; padding: 3px 0 9px; }
.mount-wardrobe-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 5px 2px; border: 2px solid #80603f; border-radius: 6px; background: linear-gradient(#6c5339, #483a2d); color: #f4e1b8; box-shadow: inset 0 1px 0 #e1cda644, 0 2px 0 #604a30; cursor: pointer; }
.mount-wardrobe-slot-image { width: 36px; height: 36px; object-fit: contain; }
.mount-wardrobe-slot:not(.filled) > img { opacity: .65; filter: saturate(.5); }
.mount-wardrobe-slot span { font-size: 9px; font-weight: 600; white-space: nowrap; }
.mount-wardrobe-slot i { position: absolute; right: 2px; top: 1px; font-size: 10px; color: #ffdc85; font-style: normal; }
.mount-wardrobe-slot:hover { border-color: #d3a951; }
.mount-wardrobe-slot.active { border-color: #ffdb83; background: linear-gradient(#9b723e, #67502f); box-shadow: 0 0 0 2px #6b3f21, inset 0 1px 0 #fff2ca66; }
.mount-wardrobe-category-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 12px 0 9px; }
.mount-wardrobe-category { margin: 0; font: 21px/1.2 var(--font-display); }
.mount-wardrobe-count { flex-shrink: 0; font-size: 11px; color: #715b3d; }
.mount-wardrobe-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mount-wardrobe-choice { position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: start; gap: 7px; min-width: 0; padding: 3px 5px 8px; border: 9px solid transparent; border-image: var(--wardrobe-paper) 25% fill / 9px stretch; border-radius: 0; background: none; color: var(--marker); text-align: left; cursor: pointer; box-shadow: 0 3px 5px #3c241222; }
.mount-wardrobe-choice:hover { filter: brightness(1.035); }
.mount-wardrobe-choice.active { outline: 2px solid #a66e25; outline-offset: 1px; background: none; }
.mount-wardrobe-choice > strong { font-size: 13px; line-height: 1.25; }
.mount-wardrobe-product-art { position: relative; display: grid; place-items: center; height: 100px; flex: none; overflow: hidden; border-radius: 0; background: radial-gradient(ellipse, #c9a16528, transparent 70%); }
.mount-wardrobe-product-art > img { position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 2px 2px #4f301e44); }
.mount-wardrobe-product-art > .icon { width: 40px; height: 40px; }
.mount-wardrobe-product-selected { position: absolute; right: -3px; bottom: 0; padding: 3px 6px; border-radius: 3px; background: #3e5d3a; color: #fff1c9; font-size: 10px; line-height: 1.2; }
.mount-wardrobe-product-price { margin-top: auto; align-self: start; padding: 3px 8px; color: #67401d; background: #d3af6b44; border-radius: 3px; font-weight: 700; font-size: 12px; }
.mount-wardrobe-product-price.owned { background: none; padding-left: 0; color: #49633b; font-weight: 600; font-size: 11px; }
.mount-wardrobe-choice.rarity-legendary { border-bottom-color: #bd8c36; }
.mount-wardrobe-choice.rarity-epic { border-bottom-color: #84618e; }
.mount-wardrobe-rarity { position: absolute; left: 0; top: 0; padding: 3px 6px; border-radius: 3px; font-size: 10px; line-height: 1.2; color: #fff7df; background: #725080; }
.mount-wardrobe-rarity.rarity-legendary { background: #805511; }
.mount-wardrobe-offers { padding: 10px; border: 1px solid #a57c45; background: #3c2923; border-radius: 8px; margin-bottom: 14px; box-shadow: inset 0 0 0 2px #e4bd6f18, 0 3px 8px #40251525; }
.mount-wardrobe-offers[hidden] { display: none; }
.mount-wardrobe-offer-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; color: #fff1c9; }
.mount-wardrobe-offer-caption { display: grid; gap: 3px; min-width: 0; }
.mount-wardrobe-offer-caption > strong { font-size: 13px; line-height: 1.2; }
.mount-wardrobe-offer-eyebrow { font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #efbb68; }
.mount-wardrobe-countdown { display: grid; justify-items: center; gap: 2px; padding: 5px 10px; border: 1px solid #e1aa5c70; border-radius: 5px; background: #1c1413; color: #ffe0a1; box-shadow: inset 0 1px 8px #0006; }
.mount-wardrobe-countdown-label { font-size: 9px; line-height: 1.1; }
.mount-wardrobe-countdown-digits { font: 400 23px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: 1px; white-space: nowrap; }
.mount-wardrobe-offer-track { height: 3px; overflow: hidden; margin: 8px 0 9px; border-radius: 2px; background: #120e0d; }
.mount-wardrobe-offer-track > span { display: block; height: 100%; width: var(--offer-left, 100%); background: linear-gradient(90deg, #a65535, #ffd68d); }
.mount-wardrobe-offers.is-urgent { border-color: #e38658; }
.mount-wardrobe-offers.is-urgent .mount-wardrobe-countdown { border-color: #ff9f71; color: #ffd4bf; background: #601f17; }
.mount-wardrobe-offers.is-urgent .mount-wardrobe-offer-track > span { background: #ffac7e; }
.mount-wardrobe-bundles { display: grid; gap: 8px; }
.mount-wardrobe-bundle { position: relative; isolation: isolate; overflow: hidden; min-width: 0; width: 100%; min-height: 108px; padding: 12px 14px; border: 1px solid #baa7c0; border-radius: 5px; background-color: #101924; background-size: 100% 100%; background-position: center; text-align: left; color: #fff6e4; cursor: pointer; box-shadow: 0 2px 4px #0005; }
.mount-wardrobe-bundle.rarity-legendary { border-color: #d9aa59; background-color: #23100b; }
.mount-wardrobe-bundle::before { content: ''; position: absolute; inset: 3px; z-index: -1; pointer-events: none; border-radius: 3px; background: linear-gradient(90deg, #0a0b13a6, #0a0b1333 58%, transparent 76%); }
.mount-wardrobe-bundle:hover { filter: brightness(1.13); }
.mount-wardrobe-bundle:focus-visible { outline: 3px solid #fff1b6; outline-offset: 2px; }
.mount-wardrobe-bundle.active { outline: 2px solid #f5ce7a; outline-offset: 1px; }
.mount-wardrobe-bundle-copy { position: relative; z-index: 2; display: grid; justify-items: start; gap: 3px; width: 70%; text-shadow: 0 1px 3px #000; }
.mount-wardrobe-bundle-rarity { font-size: 9px; font-weight: 700; letter-spacing: .6px; color: #d5bce8; text-transform: uppercase; }
.mount-wardrobe-bundle.rarity-legendary .mount-wardrobe-bundle-rarity { color: #f5cc85; }
.mount-wardrobe-bundle-name { font: 400 16px/1.15 var(--font-display); }
.mount-wardrobe-bundle-contents { font-size: 10px; color: #e7dcca; }
.mount-wardrobe-bundle-prices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; line-height: 1.1; }
.mount-wardrobe-bundle-prices b { color: #fff0c6; font-size: 19px; }
.mount-wardrobe-bundle-prices s { color: #d9caba; font-size: 11px; font-weight: 400; }
.mount-wardrobe-bundle-prices em { padding: 3px 5px; border: 1px solid #f5cd8d66; border-radius: 3px; background: #6c3d24; color: #ffe2a3; font-size: 10px; font-weight: 700; font-style: normal; }
.mount-wardrobe-bundle-owned { font-size: 9px; color: #dbd8c9; }
.mount-wardrobe-bundle-pet { position: absolute; z-index: 1; right: -7px; top: -5%; width: 43%; height: 110%; object-fit: contain; filter: drop-shadow(0 3px 4px #000c); pointer-events: none; }
.mount-wardrobe-bundle-select { position: absolute; z-index: 3; right: 8px; bottom: 8px; display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid #e4c47e88; border-radius: 50%; background: #241b16cc; color: #ffdda1; font-size: 17px; line-height: 1; }
.mount-wardrobe-bundle.active .mount-wardrobe-bundle-select { background: #edc578; color: #3b2613; font-size: 13px; }
.mount-wardrobe-choice.is-empty { border: 1px dashed #9d8156; padding: 11px 13px 16px; background: #d6bd8c26; box-shadow: none; }
.mount-wardrobe-choice.is-empty .mount-wardrobe-product-art { opacity: .45; background: none; }
.mount-wardrobe-empty { margin: 14px 0 0; padding: 10px; font-size: 12px; color: #725c42; }
.mount-wardrobe-empty[hidden] { display: none; }
.mount-wardrobe-help { width: 100%; margin-top: 16px; font-size: 11px; color: #69543a; }
.mount-wardrobe-help summary { cursor: pointer; }
.mount-wardrobe-help p { line-height: 1.5; }
.mount-wardrobe-actions { flex-shrink: 0; display: flex; align-items: center; flex-wrap: nowrap; gap: 18px; margin-top: 14px; padding: 12px 2px 0; border-top: 2px solid #76523255; }
.mount-wardrobe-action-copy { flex: 1; min-width: 0; }
.mount-wardrobe-action-copy strong { display: block; font-size: 14px; margin-bottom: 3px; }
.mount-wardrobe-action-copy span { display: block; font-size: 11px; line-height: 1.4; color: #604b32; }
.mount-wardrobe-actions > .btn { flex: 0 0 auto; min-width: 210px; min-height: 48px; }
.mount-wardrobe button:disabled { cursor: default; }
.mount-wardrobe-preview-notice { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; color: #fff0c9; font-size: 12px; }
.mount-wardrobe-preview-notice[hidden] { display: none; }
.mount-shop { display: grid; gap: 14px; min-width: 0; }
.mount-shop-banners { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mount-shop-banners[hidden] { display: none; }
.mount-shop-banner { position: relative; display: flex; align-items: center; min-width: 0; min-height: 146px; padding: 16px; border: 1px solid #ae8eb7; border-radius: 6px; background-color: #15121d; background-size: cover; background-position: center; color: #fff1d9; text-align: left; cursor: pointer; box-shadow: 0 3px 6px #3d2b2444; overflow: hidden; }
.mount-shop-banner.legendary { border-color: #d39b52; background-color: #260d0a; }
.mount-shop-banner:hover { filter: brightness(1.1); }
.mount-shop-banner-copy { display: grid; gap: 6px; width: 70%; min-width: 0; text-shadow: 0 1px 4px #000; }
.mount-shop-banner-copy > small { color: #d6b9e5; text-transform: uppercase; letter-spacing: .6px; font-size: 9px; font-weight: 700; }
.mount-shop-banner.legendary small { color: #f5c77f; }
.mount-shop-banner-copy > strong { font: 17px/1.15 var(--font-display); }
.mount-shop-banner-contents { max-width: 170px; font-size: 10px; line-height: 1.4; color: #f1e6d8; }
.mount-shop-banner-price { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 3px; color: #ffe9b4; font: 18px/1.2 var(--font-display); }
.mount-shop-banner-price em { padding: 3px 5px; border-radius: 3px; background: #f1d48d; color: #3a2615; font: 700 10px var(--font-body); text-shadow: none; }
.mount-shop-banner-open { position: absolute; right: 12px; bottom: 9px; font-size: 26px; color: #ffe6ad; text-shadow: 0 1px 5px #000; }
.mount-shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mount-shop-animals { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.mount-shop-animals .mount-wardrobe-animal { width: 42px; height: 42px; }
.shop-category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.shop-category-button { display: flex; align-items: center; gap: 10px; min-height: 112px; padding: 18px; border: 2px solid #987444; border-radius: 8px; background: linear-gradient(135deg, #f3dfb8, #cfad77); color: #433019; text-align: left; cursor: pointer; box-shadow: inset 0 0 12px #fff3d666, 0 3px 6px #35220e33; }
.shop-category-button:hover { filter: brightness(1.07); border-color: #60401d; }
.shop-category-button img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.shop-category-costumes { position: relative; width: 64px; height: 84px; flex: none; }
.shop-category-costumes .prem-figure { position: absolute; bottom: 0; left: 0; width: 48px; height: 84px; }
.shop-category-costumes .prem-figure + .prem-figure { left: 16px; }
.shop-category-costumes .prem-figure img { width: 48px; height: 84px; max-width: none; }
.shop-category-button strong { flex: 1; font: 19px/1.25 var(--font-display); }
.shop-category-button > span { font-size: 30px; }
.shop-section-heading { display: flex; align-items: center; gap: 14px; }
.shop-section-heading h3 { margin: 0; font: 20px var(--font-display); }
.mount-product-preview-visual { min-width: 0; }
.mount-shop-animals .mount-wardrobe-animal { position: relative; }
.mount-shop-animals .mount-wardrobe-animal.locked .mount-wardrobe-animal-portrait { opacity: .6; }
.mount-pet-lock { position: absolute; right: -3px; bottom: -3px; font-size: 13px; line-height: 18px; }
.mount-product-target { font-weight: 700; }
.mount-shop-filter { max-width: 100%; padding: 8px 10px; border: 1px solid #9d7b4d; border-radius: 4px; background: #f4e6c8; color: #44311d; font: 12px var(--font-body); }
.mount-shop .mount-wardrobe-slots { padding-bottom: 2px; }
.mount-shop .mount-wardrobe-category { margin: 0; }
.mount-shop .mount-wardrobe-product-art { height: 114px; }
.mount-product-preview-panel.modal.wide { width: min(860px, 100%); }
.mount-product-preview { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(240px, .8fr); gap: 22px; align-items: start; }
.mount-product-preview-stage { padding-bottom: 12px; }
.mount-product-preview-image { display: block; width: 100%; height: 320px; object-fit: contain; }
.mount-product-preview-stage > .btn { margin: 0 12px; }
.mount-product-preview-error { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 0 12px 8px; color: #f7e6c3; font-size: 12px; }
.mount-product-preview-error[hidden] { display: none; }
.mount-product-preview-details { min-width: 0; }
.mount-product-preview-details h3 { margin: 5px 0 10px; font: 21px/1.25 var(--font-display); }
.mount-product-preview-details p { font-size: 12px; line-height: 1.5; }
.mount-product-preview-kind { margin: 0; color: #775b3c; text-transform: uppercase; letter-spacing: 1px; font-size: 10px !important; }
.mount-product-preview-contents { display: grid; gap: 5px; margin-top: 14px; }
.mount-product-preview-contents > div { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 6px; background: #fff3d65c; border-bottom: 1px solid #94734033; }
.mount-product-preview-contents img { width: 30px; height: 30px; flex: none; object-fit: contain; }
.mount-product-preview-contents span { font-size: 11px; line-height: 1.3; }
.mount-product-preview-action { display: grid; gap: 9px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #94734066; }
.mount-product-preview-action p { margin: 0; color: #725438; }
.mount-product-preview-purchase { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.mount-product-preview-countdown { position: static; transform: none; }
.mount-product-preview-price { font: 24px var(--font-display); color: #60401e; }
.mount-product-preview-action .btn { width: 100%; min-height: 45px; }
@media (max-width: 700px) {
  .mount-wardrobe { grid-template-columns: 1fr; gap: 13px; }
  .mount-wardrobe-stage-heading { padding: 11px 12px 0; }
  .mount-wardrobe-pet-name { font-size: 19px; }
  .mount-wardrobe-pet-scene { min-height: 186px; padding-bottom: 17px; }
  .mount-wardrobe-preview { height: 182px; }
  .mount-wardrobe-offers { padding: 8px; margin-bottom: 10px; }
  .mount-wardrobe-offer-caption > strong { font-size: 11px; }
  .mount-wardrobe-countdown { padding: 5px 7px; }
  .mount-wardrobe-countdown-digits { font-size: 21px; }
  .mount-wardrobe-bundle { min-height: 102px; padding: 10px; }
  .mount-wardrobe-bundle-copy { width: 74%; }
  .mount-wardrobe-bundle-name { font-size: 14px; }
  .mount-wardrobe-bundle-contents { font-size: 9px; }
  .mount-wardrobe-bundle-prices { gap: 6px; }
  .mount-wardrobe-bundle-prices b { font-size: 17px; }
  .mount-wardrobe-bundle-pet { width: 44%; right: -12px; }
  .mount-wardrobe-animals { gap: 6px; padding: 8px 12px; }
  .mount-wardrobe-animal { height: 36px; }
  .mount-wardrobe-sections { margin-bottom: 9px; }
  .mount-wardrobe-section { padding: 8px 4px; font-size: 13px; }
  .mount-wardrobe-slots { grid-template-columns: repeat(8, 48px); gap: 5px; overflow-x: auto; padding: 3px 2px 9px; }
  .mount-wardrobe-slot span { font-size: 10px; }
  .mount-wardrobe-category { font-size: 18px; }
  .mount-wardrobe-product-art { height: 95px; }
  .mount-wardrobe-choice { gap: 6px; padding-bottom: 5px; }
  .mount-wardrobe-choice > strong { font-size: 12px; }
  .mount-wardrobe-actions { gap: 8px; padding-top: 9px; margin-top: 9px; }
  .mount-wardrobe-actions > .btn { min-width: 132px; max-width: 56%; flex-basis: auto; font-size: 12px; }
  .mount-wardrobe-action-copy strong { font-size: 12px; }
  .mount-wardrobe-action-copy span { font-size: 10px; }
}
@media (max-width: 620px) {
  .mount-shop-banners { grid-template-columns: 1fr; gap: 10px; }
  .mount-shop-banner { min-height: 134px; }
  .mount-product-preview { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .mount-product-preview-image { height: 218px; }
  .mount-product-preview-details h3 { font-size: 19px; }
  .mount-product-preview-contents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mount-shop .mount-wardrobe-product-art { height: 100px; }
}
@media (min-width: 701px) {
  .mount-wardrobe-stage { position: sticky; top: 0; }
}
@media (min-width: 701px) and (max-height: 650px) {
  .mount-wardrobe-pet-scene { min-height: 235px; }
  .mount-wardrobe-preview { height: 230px; }
}
/* The long class-change investigation uses the existing paper journal and quest cards. */
.cq-choice{display:flex;flex-direction:column;gap:8px;border:1px solid #a18358;border-radius:6px;padding:12px}.cq-choice .btn{width:100%}
.cq-panel{max-width:680px}.cq-dossier{display:flex;flex-direction:column;gap:14px;padding:4px 2px 12px}.cq-dossier p{margin:0;line-height:1.55}.cq-speaker{display:flex;align-items:center;gap:18px;border-bottom:2px solid #80684b;padding-bottom:12px}.cq-speaker>img{width:94px;height:126px;object-fit:contain;flex-shrink:0}.cq-speaker h2{margin:6px 0}.cq-chapter{font-weight:700;color:var(--accent,#d59a40)}.cq-dossier progress{width:100%;height:9px;accent-color:#b98338}.cq-dossier h3{margin:2px 0}.cq-dialogue{padding:14px 16px;border-left:4px solid #b58b50;background:rgba(139,105,62,.12);border-radius:4px}.cq-actions{display:flex;flex-direction:column;gap:9px}.cq-note{padding:12px;border:1px dashed #a18358;border-radius:7px}.cq-history{border-top:1px solid #80684b;padding-top:12px}.cq-history summary{cursor:pointer;font-weight:700}.cq-history p{padding:10px 0;border-bottom:1px solid rgba(128,104,75,.25)}.cq-card .npc-quest-portrait{object-fit:contain;object-position:center}.cq-progress{display:flex;align-items:center;gap:9px;text-align:left;max-width:270px}.cq-progress[hidden]{display:none!important}.cq-progress>img{width:36px;height:36px;object-fit:contain}.cq-pin-copy{display:flex;flex-direction:column;gap:3px;min-width:0}.cq-pin-copy b{font-size:12px}.cq-pin-copy>span{font-size:11px;white-space:normal}@media(max-width:480px){.cq-speaker>img{width:70px;height:104px}.cq-speaker{gap:10px}.cq-dossier .btn{min-height:44px;white-space:normal}.cq-progress{max-width:210px}.cq-dossier{gap:12px}.cq-dialogue{padding:11px}}

.cq-panel.modal { width: min(560px, 100%); }
.cq-dossier { gap: 10px; padding: 2px; }
.cq-speaker { gap: 14px; padding-bottom: 9px; border-bottom: 1px solid #a1835860; }
.cq-speaker > img { width: 64px; height: 86px; }
.cq-speaker h2 { font-size: 21px; margin: 3px 0; }
.cq-chapter { color: #7c5b33; font-weight: 500; }
.cq-dialogue { line-height: 1.5; background: #fff8e860; border-left: 3px solid #b58b50; padding: 12px 14px; }
.cq-actions:empty { display: none; }
.cq-actions .btn { min-height: 44px; white-space: normal; }
.cq-actions:has(.cq-choice) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cq-choice { background: #fff8e840; border-color: #a1835860; }
.cq-choice > .btn { margin-top: auto; }
.cq-method, .cq-passive { font-size: 14px; color: #745634; }

/* Underground trips: painted signs, a lamp-lit tunnel and a cart that rattles along. */
.travel-overlay { background: #17120ff2; z-index: 210; }
.travel-panel { width: min(460px, calc(100vw - 24px)); text-align: center; }
.travel-panel .modal-body { padding: 12px 20px 25px; }
.travel-journey { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.travel-scene { width: 100%; aspect-ratio: 2 / 1; position: relative; overflow: hidden; border: 3px solid #533a26; border-radius: 10px; background: #241c14; box-shadow: 0 3px 0 #b28b55; }
.travel-scene::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 18px #100c0855; }
.travel-art { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; animation: travel-drift 5s ease-in-out alternate infinite; }
.is-metro .travel-art { animation-duration: 4s; }
.travel-caption { margin: 8px 0 0; font-family: 'Russo One', sans-serif; font-size: clamp(18px, 4.8vw, 23px); line-height: 1.4; color: #44301d; min-height: 2.8em; display: grid; place-content: center; }
.travel-flavour { margin: 0; font-size: 14px; color: #785a37; }
.travel-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@keyframes travel-drift { from { transform: scale(1.02) translateX(-.3%); } to { transform: scale(1.08) translateX(.3%); } }
@media (prefers-reduced-motion: reduce) {
  .travel-art { animation: none; }
}
.cq-method > summary, .cq-passive > summary { cursor: pointer; padding: 6px 0; }
.cq-method > .btn { width: 100%; margin-top: 8px; }
@media (max-width: 480px) {
  .cq-actions:has(.cq-choice) { grid-template-columns: 1fr; }
  .cq-speaker > img { width: 58px; height: 76px; }
  .cq-dossier { gap: 9px; }
}

.item .enchant-tag { position: absolute; top: 2px; left: 3px; color: #ffe38d; background: #26201fe6; border: 1px solid #ad8243; border-radius: 5px; padding: 0 4px; font-size: 12px; font-weight: 800; line-height: 17px; pointer-events: none; }

/* A recipe is a physical sheet with a faint image of its crafting result. */
.item .recipe-paper { position: relative; display: grid; place-items: center; width: 69%; height: 80%; margin: auto; border: 1px solid #9b713b; border-radius: 2px 2px 5px 2px; background: repeating-linear-gradient(0deg, transparent 0 8px, #8c62301c 8px 9px), linear-gradient(120deg, #fff0c9, #ddbd83); box-shadow: 1px 2px 3px #24150780; transform: rotate(-6deg); clip-path: polygon(0 1%, 88% 0, 100% 13%, 98% 99%, 2% 100%); }
.item .recipe-paper::after { content: ''; position: absolute; right: 0; top: 0; width: 14%; height: 14%; background: #b58e56; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.item .recipe-paper .recipe-result { width: 90%; height: 90%; object-fit: contain; opacity: .42; filter: sepia(.3); }

.item.recipe-item { border: 0; background: none; box-shadow: none; }

.buyer-dialogue .quest-items{display:grid;grid-template-columns:1fr;gap:6px}
.buyer-dialogue .quest-item{width:100%;box-sizing:border-box;padding:5px 8px}
.buyer-dialogue .quest-item-copy{flex:1;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px}
.buyer-dialogue .quest-item-name{font-size:13px}
.buyer-dialogue .quest-item-count{white-space:nowrap}
.buyer-dialogue .quest-item-icon{width:36px;height:36px}
.buyer-dialogue p{margin:0}
.buyer-dialogue .buyer-reward{padding:12px}
.buyer-dialogue .buyer-reward h2{margin:6px 0;font-size:22px}
.buyer-profile-buff{font-size:13px;color:#ffe09a;text-align:center}
@media(max-height:620px){
  .buyer-dialogue{gap:6px}
  .buyer-dialogue .col{gap:6px}
  .buyer-dialogue .quest-item{padding:3px 6px}
  .buyer-dialogue .quest-item-icon{width:28px;height:28px}
  .buyer-dialogue .buyer-reward{padding:8px}
}

.item .sale-lock-tag { position: absolute; top: -5px; left: -5px; z-index: 3; width: 24px; height: 24px; pointer-events: none; filter: drop-shadow(0 1px 1px #281a0c); }
.item-cart-actions { display: inline-flex; align-items: center; gap: 6px; }
.btn.item-sale-lock { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 6px; }
.art-button .btn.item-sale-lock:not(.primary):not(.danger) { padding: 0; border-width: 8px; }
.item-sale-lock img { width: 100%; height: 100%; object-fit: contain; }
.item-sale-lock:focus-visible { outline: 2px solid var(--hivis); border-radius: 5px; }
.item-sale-lock:disabled { opacity: .5; cursor: wait; }
.btn[aria-disabled="true"] { opacity: .45; cursor: default; }

.ny-offer select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.ny-preview { display: flex; justify-content: center; gap: 4px; height: clamp(76px, 19vh, 145px); }
.ny-preview img { min-width: 0; max-width: 100%; object-fit: contain; }

#ui > .chat.chat-keyboard {
  z-index: 30;
  bottom: var(--chat-keyboard-bottom);
  max-height: max(0px, calc(var(--chat-visible-height) - 16px - var(--safe-top)));
}
.chat-keyboard > :not(.chat-body) { flex-shrink: 0; }
.chat-keyboard > .chat-body { min-height: 0; }
