/* Kings of Emboria – UI styles */

:root {
  --gold: #f2c46d;
  --text: #ece6dc;
  --muted: #a89f92;
  --panel: rgba(18, 15, 13, 0.88);
  --border: rgba(242, 196, 109, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #07080a;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* No scrolling, zooming or text selection while playing on iPad */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100%; height: 100%; }

/* Show only the controls that match the device */
body.is-touch .pc-only { display: none !important; }
body:not(.is-touch) .touch-only { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
#hud > div {
  position: absolute;
  font-size: 13px;
  color: var(--muted);
  text-shadow: 0 1px 3px #000;
}
#hud-area {
  top: calc(12px + env(safe-area-inset-top));
  left: calc(14px + env(safe-area-inset-left));
  font-size: 16px !important;
  font-weight: 600;
  color: var(--gold) !important;
  letter-spacing: 0.04em;
}
#hud-fps { top: calc(12px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); }
#hud-version { bottom: calc(8px + env(safe-area-inset-bottom)); left: calc(14px + env(safe-area-inset-left)); opacity: 0.7; }
body.is-touch #hud-version { left: 50%; transform: translateX(-50%); }

/* ---------- Panels ---------- */
#overlay, #message, #error {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 4, 6, 0.6);
  z-index: 3;
  padding: 16px;
}
#overlay[hidden], #message[hidden], #error[hidden] { display: none; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 30px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.card h1, .card h2 { margin: 0 0 4px; color: var(--gold); letter-spacing: 0.03em; }
.card h1 { font-size: 26px; }
.card h2 { font-size: 22px; margin-bottom: 10px; }
.subtitle { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.goal { color: var(--muted); font-size: 14px; margin: 16px 0 18px; line-height: 1.4; }

.controls { display: grid; gap: 6px; text-align: left; font-size: 14px; }
.controls div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 5px; }
.controls b { color: var(--text); font-weight: 600; }
.controls span { color: var(--muted); text-align: right; }

button {
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  color: #1a130a;
  background: var(--gold);
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  width: 100%;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }

/* ---------- Touch controls ---------- */
#touch-ui { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
#touch-ui[hidden] { display: none; }

.joy-base {
  position: absolute;
  width: 130px;
  height: 130px;
  margin: -65px 0 0 -65px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: opacity 0.12s;
}
.joy-base.active { opacity: 1; }
.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: rgba(242, 196, 109, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.tbtn {
  position: absolute;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px #000;
}
.tbtn.pressed { transform: scale(0.92); filter: brightness(1.4); }
.tbtn-attack {
  width: 96px;
  height: 96px;
  right: calc(28px + env(safe-area-inset-right));
  bottom: calc(36px + env(safe-area-inset-bottom));
  background: rgba(170, 50, 40, 0.55);
  font-size: 17px;
}
.tbtn-jump {
  width: 68px;
  height: 68px;
  right: calc(140px + env(safe-area-inset-right));
  bottom: calc(30px + env(safe-area-inset-bottom));
  background: rgba(60, 110, 170, 0.5);
  font-size: 14px;
}

/* ---------- v0.2: health, boss bar, combat feedback ---------- */
#hp {
  position: absolute;
  left: calc(14px + env(safe-area-inset-left));
  top: calc(40px + env(safe-area-inset-top));
  width: min(240px, 42vw);
}
.hp-track, .boss-track {
  height: 14px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(#e2574a, #a8281f);
  transition: width 0.15s;
}
.hp-text {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
#boss {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(14px + env(safe-area-inset-top));
  width: min(440px, 60vw);
  text-align: center;
}
#boss[hidden], #toast[hidden] { display: none; }
.boss-name {
  font-size: 15px !important;
  font-weight: 700;
  color: var(--gold) !important;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}
.boss-track { height: 12px; }
.boss-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(#e08a3a, #b04a1a);
  transition: width 0.15s;
}
#toast {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  font-size: 24px !important;
  font-weight: 700;
  color: var(--gold) !important;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 8px #000;
  animation: toast-in 0.3s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

#floaters { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.float-num {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
  font-size: 20px;
  color: #fff6d8;
  text-shadow: 0 2px 3px #000, 0 0 2px #000;
  will-change: transform, opacity;
}
.float-num.hurt { color: #ff5a4a; font-size: 22px; }
.float-num.heal { color: #7ee07a; }
.enemy-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: 56px;
  height: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.enemy-bar div { height: 100%; width: 100%; background: linear-gradient(#ef6a5c, #b8322a); transition: width 0.12s; }

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(160, 0, 0, 0) 45%, rgba(160, 0, 0, 0.55) 100%);
  transition: opacity 0.25s;
}
#vignette.hit { opacity: 1; transition: none; }
#vignette.low { opacity: 0.6; }

/* v0.2.1: on narrow screens the boss bar sits below the player's health bar */
@media (max-width: 900px) {
  #boss { top: calc(118px + env(safe-area-inset-top)); width: min(440px, 80vw); }
}

/* v0.2.2: sound buttons */
.hud-btn {
  position: absolute;
  pointer-events: auto;
  top: calc(34px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  width: auto;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}
.hud-btn:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.secondary-btn {
  margin-bottom: 10px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

/* ---------- v0.3: level, XP, gold, loot ---------- */
#hp { width: min(270px, 46vw); }
.hp-row { display: flex; align-items: center; gap: 8px; }
.hp-bars { flex: 1; min-width: 0; }
.lvl-badge {
  flex: none;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #1a130a;
  background: radial-gradient(circle at 35% 30%, #ffe29a, #d79a32);
  border: 2px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
}
.lvl-badge.pop { animation: lvl-pop 0.6s ease-out; }
@keyframes lvl-pop { 30% { transform: scale(1.45); filter: brightness(1.4); } }
.xp-track {
  margin-top: 4px;
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.xp-fill { height: 100%; width: 0; background: linear-gradient(#ffe08a, #c9902c); transition: width 0.25s; }
.hp-text { display: flex; justify-content: space-between; gap: 8px; padding-left: 42px; }
.xp-text { color: var(--muted); }
.gold-text {
  margin-top: 4px;
  padding-left: 42px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.coin {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff0b0, #d69a2c);
  border: 1px solid #7a5418;
}
#area-level { font-size: 13px; font-weight: 600; color: var(--gold); }
#area-level.easy { color: #8c8c8c; }

#loot-feed {
  left: calc(14px + env(safe-area-inset-left));
  top: calc(124px + env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 14px !important;
  font-weight: 700;
  max-width: 60vw;
}
.feed-line { animation: feed-in 0.25s ease-out; transition: opacity 0.6s; }
.feed-line.fade { opacity: 0; }
.feed-line small { font-weight: 500; color: var(--muted); }
@keyframes feed-in { from { opacity: 0; transform: translateX(-12px); } }

.float-num.xp { color: #ffd45a; font-size: 18px; }
.float-num.easy { color: #9a9a9a; font-size: 15px; }
.float-num.gold { color: var(--gold); font-size: 17px; }
.float-num.item { font-size: 16px; }

.char-line { margin: -8px 0 16px; font-size: 14px; color: var(--text); }
.char-line b { color: var(--gold); }
.link-btn {
  margin-top: 12px;
  padding: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  text-decoration: underline;
}

/* Run summary */
#message .card { max-width: 420px; }
#message-text { margin: 0 0 18px; text-align: left; font-size: 14px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sum-row span:first-child { color: var(--muted); }
.sum-row b { font-variant-numeric: tabular-nums; }
.sum-note { margin: 10px 0 0; color: #a8a8a8; font-size: 13px; line-height: 1.4; }
.sum-note.good { color: #ffd45a; }
.sum-items { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 30vh; overflow-y: auto; }
.sum-items li { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.sum-items li small { font-weight: 500; color: var(--muted); white-space: nowrap; }
@media (max-width: 900px) {
  #loot-feed { top: calc(160px + env(safe-area-inset-top)); }
}

/* ---------- v0.4: inventory ---------- */
#bag-btn { right: calc(110px + env(safe-area-inset-right)); }
.bag-new {
  display: inline-block;
  margin-left: 6px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 16px;
  color: #1a130a;
  background: var(--gold);
}
.bag-new[hidden] { display: none; }
.btn-row { display: flex; gap: 8px; }
.btn-row .secondary-btn { flex: 1; }
#message .secondary-btn { margin-bottom: 10px; }

#inventory {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  background: rgba(4, 4, 6, 0.72);
}
#inventory[hidden] { display: none; }
.inv-panel {
  width: 100%;
  max-width: 900px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.inv-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.inv-head h2 { margin: 0; font-size: 20px; color: var(--gold); letter-spacing: 0.03em; }
.inv-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.inv-count.full { color: #ff8a5a; font-weight: 700; }
.inv-gold { display: flex; align-items: center; gap: 5px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.inv-close {
  margin-left: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 17px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.inv-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  padding: 14px 18px;
  min-height: 0;
  flex: 1;
}
.inv-left, .inv-right { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.inv-stats {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
}
.inv-stat { display: flex; align-items: baseline; gap: 6px; }
.inv-stat span { color: var(--muted); flex: 1; }
.inv-stat b { font-variant-numeric: tabular-nums; }
.inv-stat small { color: #7ee07a; font-size: 12px; }
.inv-slots { display: grid; gap: 6px; }
.inv-slot, .inv-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  position: relative;
}
.inv-slot.selected, .inv-tile.selected { background: rgba(242, 196, 109, 0.14); box-shadow: 0 0 0 2px var(--gold) inset; }
.inv-slot-name, .inv-tile-slot { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.inv-item-name { font-weight: 700; font-size: 14px; }
.inv-item-stat { font-size: 12px; color: var(--muted); }
.inv-empty { color: #6f6a62; font-style: italic; }
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  min-height: 120px;
  max-height: 46vh;
  padding-right: 4px;
  touch-action: pan-y; /* allow scrolling the bag on iPad */
  -webkit-overflow-scrolling: touch;
}
.inv-up { font-size: 11px; font-weight: 700; color: #7ee07a; }
.inv-new {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #1a130a;
  background: var(--gold);
  border-radius: 6px;
  padding: 1px 5px;
}
.inv-hint { color: var(--muted); font-size: 13px; margin: 4px 0; }
.inv-warn { color: #ff8a5a; font-size: 13px; font-weight: 700; margin: 6px 0 0; }
.inv-btn {
  width: auto;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.inv-btn.primary { color: #1a130a; background: var(--gold); border-color: var(--gold); }
.inv-btn.confirm { color: #1a130a; background: #ff9a5a; border-color: #ff9a5a; }
.inv-btn:disabled { opacity: 0.4; cursor: default; filter: none; }
#inv-sell-common { align-self: flex-start; }
.inv-detail {
  min-height: 92px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}
.inv-detail-name { font-size: 17px; font-weight: 800; }
.inv-detail-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.inv-detail-stat { font-size: 14px; margin-top: 6px; }
.inv-compare { font-size: 13px; color: var(--muted); margin-top: 2px; }
.inv-compare.up { color: #7ee07a; }
.inv-compare.down { color: #ff8a7a; }
.inv-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* Narrow screens (iPad portrait, phones): stack the columns */
@media (max-width: 700px) {
  .inv-body { grid-template-columns: 1fr; overflow-y: auto; touch-action: pan-y; }
  .inv-slots { grid-template-columns: repeat(2, 1fr); }
  .inv-grid { max-height: none; overflow: visible; }
}
@media (max-height: 560px) {
  .inv-grid { max-height: 34vh; }
}

/* ---------- v0.5: travel fade, town buttons ---------- */
#fade {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity 0.3s;
}
#fade.on { opacity: 1; }
.town-btn, .leave-btn { margin: 10px 0 0; }
.leave-btn[hidden], .town-btn[hidden] { display: none; }

/* ---------- v0.5.2: compact start screen, Controls panel, panels scroll on small screens ---------- */
#help {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  background: rgba(4, 4, 6, 0.6);
}
#help[hidden] { display: none; }
/* Panels scroll when they don't fit. margin: auto keeps them centred but never cut off at the top. */
#overlay, #message, #error, #help {
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}
#overlay > .card, #message > .card, #error > .card, #help > .card { margin: auto; }
.goal { margin: 0 0 16px; }
.char-line { margin: -8px 0 12px; }
.menu-row { margin-top: 10px; flex-wrap: wrap; }
.menu-row .secondary-btn { margin-bottom: 0; min-width: 96px; }
#leave-btn { margin: 10px 0 0; }
.help-card { max-width: 440px; text-align: left; }
.help-card h2 { text-align: center; }
.help-card h3 { margin: 18px 0 6px; font-size: 15px; color: var(--gold); }
.howto { margin: 0 0 18px; padding-left: 18px; font-size: 14px; line-height: 1.45; color: var(--text); }
.howto li { margin-bottom: 6px; }
.howto b { color: var(--gold); font-weight: 600; }
@media (max-height: 520px) {
  .card { padding: 18px 20px; }
  .card h1 { font-size: 22px; }
}

/* ---------- v0.6: log in / create account ---------- */
#auth-box[hidden], #menu-box[hidden], #connecting[hidden], .reg-only[hidden], .login-only[hidden] { display: none; }
.auth-tabs { display: flex; gap: 6px; margin: 4px 0 14px; }
.auth-tab {
  flex: 1;
  padding: 9px 10px;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.auth-tab.active { color: #1a130a; background: var(--gold); border-color: var(--gold); }
#auth-form { display: grid; gap: 10px; text-align: left; }
.auth-field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text); }
.auth-field small { font-weight: 400; color: var(--muted); font-size: 12px; }
.auth-field input {
  font: inherit;
  font-size: 16px; /* 16px stops iPad Safari from zooming into the field */
  font-weight: 400;
  color: var(--text);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  user-select: text;
  -webkit-user-select: text;
  touch-action: manipulation;
}
.auth-field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242, 196, 109, 0.25); }
.auth-field input.bad { border-color: #ff8a5a; }
.auth-msg { min-height: 18px; margin: 0; font-size: 13px; font-weight: 600; color: #ff9a7a; }
.auth-msg.info { color: var(--muted); font-weight: 400; }
.auth-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
#auth-submit:disabled, #start-btn:disabled { opacity: 0.6; cursor: default; filter: none; }
.demo-note { margin: 0 0 12px; font-size: 12px; color: #ffb36a; }

/* Inventory waits for the server */
#inventory.busy .inv-panel { cursor: progress; }
#inventory.busy .inv-btn { opacity: 0.6; }

/* ---------- v0.6.1: inventory fits every screen ----------
   The head and the item details stay in place; everything between them scrolls as one area.
   Before, the equipment column could grow taller than its space and draw over the details. */
.inv-head { flex: none; }
.inv-body {
  flex: 1 1 auto;
  min-height: 0;
  align-items: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y; /* scroll with a finger on iPad */
  -webkit-overflow-scrolling: touch;
}
.inv-grid { max-height: none; min-height: 0; overflow: visible; padding-right: 0; }
.inv-detail {
  flex: none;
  max-height: 42%;
  overflow-y: auto;
  touch-action: pan-y;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.inv-detail-info { flex: 1 1 240px; min-width: 0; }
.inv-detail-name { overflow-wrap: anywhere; }
.inv-actions { flex: none; margin-top: 0; }
.inv-detail > .inv-hint, .inv-detail > .inv-warn { flex: 1 1 100%; margin: 0; }
.inv-tile .inv-item-name { padding-right: 34px; } /* room for the "new" tag */
@media (max-width: 700px) {
  .inv-actions { flex: 1 1 100%; }
  .inv-actions .inv-btn { flex: 1; }
}
@media (max-height: 560px) {
  .inv-head { padding: 8px 14px; }
  .inv-body { padding: 10px 14px; }
  .inv-detail { padding: 8px 14px 10px; }
  .inv-slot, .inv-tile { padding: 6px 9px; }
}
/* Tall enough screens: the equipment column stays in view while the bag scrolls */
@media (min-width: 701px) and (min-height: 700px) {
  .inv-left { position: sticky; top: 0; }
}
