:root {
  color-scheme: dark;
  --bg: #10130f;
  --panel: #181d17;
  --panel-2: #20261f;
  --ink: #eef2df;
  --muted: #aab39a;
  --line: #3b4437;
  --gold: #d4b15f;
  --side-width: 360px;
  --green: #65b66d;
  --blue: #6fa7c8;
  --red: #d97866;
  --shadow: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 15% 10%, rgba(101, 182, 109, 0.12), transparent 24rem),
    linear-gradient(135deg, #0d110e, #171711 48%, #101716);
  color: var(--ink);
  font-family:
    "Segoe UI",
    system-ui,
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid #c5a75a;
  border-radius: 6px;
  background: linear-gradient(180deg, #d8bd6c, #9c7834);
  color: #12100a;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--shadow);
}

button.has-unread {
  border-color: #f4da7b;
  box-shadow:
    0 0 0 1px rgba(244, 218, 123, 0.28),
    0 10px 24px var(--shadow);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f140f;
  color: var(--ink);
  padding: 0 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 5.2rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  font-size: 1.05rem;
  letter-spacing: 0;
}

h3 {
  color: var(--gold);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-shell,
.screen {
  min-height: 100vh;
}

.screen {
  width: 100%;
}

.is-hidden {
  display: none !important;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-screen {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 32px;
}

.portal-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.95;
}

#portalCanvas {
  width: min(88vw, 520px);
  aspect-ratio: 1;
  filter: drop-shadow(0 0 40px rgba(101, 182, 109, 0.28));
}

.login-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(430px, 100%);
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(212, 177, 95, 0.34);
  border-radius: 8px;
  background: rgba(16, 19, 15, 0.82);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}

.login-status {
  min-height: 1.2em;
  margin: -4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.login-status.good {
  color: #8de68a;
}

.login-status.warn {
  color: #ff9c7c;
}

.gateway-logo {
  display: grid;
  gap: 6px;
  font-size: clamp(3.6rem, 10vw, 5.9rem);
}

.gateway-logo span {
  display: block;
}

.gateway-logo strong {
  display: inline-grid;
  width: fit-content;
  padding: 0 0.16em 0.08em;
  border: 1px solid rgba(212, 177, 95, 0.46);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 236, 174, 0.22), rgba(182, 132, 35, 0.18)),
    rgba(212, 177, 95, 0.08);
  color: var(--gold);
  font-size: 1.18em;
  line-height: 0.82;
  text-shadow: 0 0 22px rgba(212, 177, 95, 0.3);
}

.funding-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(212, 177, 95, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(212, 177, 95, 0.08), rgba(15, 20, 15, 0.74)),
    rgba(15, 20, 15, 0.82);
}

.funding-line {
  color: var(--ink);
  font-weight: 800;
}

.review-link {
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.review-link:hover {
  text-decoration: underline;
}

.donate-row {
  display: grid;
  grid-template-columns: 1fr 104px;
  gap: 10px;
  align-items: end;
}

.donate-row label {
  gap: 5px;
}

.brand-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.brand-row span {
  min-height: 44px;
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 8px;
  border: 1px solid rgba(111, 167, 200, 0.22);
  border-radius: 6px;
  background: rgba(10, 14, 11, 0.66);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.2;
}

.brand-row strong {
  color: var(--gold);
  font-size: 0.82rem;
}

.review-page {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 40px 18px;
}

.review-card {
  display: grid;
  gap: 18px;
  width: min(820px, 100%);
  padding: 28px;
  border: 1px solid rgba(212, 177, 95, 0.34);
  border-radius: 8px;
  background: rgba(16, 19, 15, 0.88);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
}

.review-card h1 {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
}

.review-card h2 {
  color: var(--gold);
  font-size: 1.05rem;
}

.review-card p {
  color: var(--muted);
  line-height: 1.62;
}

.review-card a {
  color: var(--gold);
}

.review-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.review-details div {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(7, 12, 11, 0.62);
}

.review-details dt {
  color: var(--gold);
  font-weight: 800;
}

.review-details dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.review-button {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  padding: 0 16px;
  border: 1px solid #c5a75a;
  border-radius: 6px;
  background: linear-gradient(180deg, #d8bd6c, #9c7834);
  color: #12100a !important;
  font-weight: 800;
  text-decoration: none;
}

.review-button.secondary {
  background: #101710;
  color: var(--gold) !important;
}

.mobile-bank-screen {
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 20%, rgba(212, 177, 95, 0.14), transparent 36%),
    var(--bg);
}

.mobile-bank-card {
  display: grid;
  gap: 18px;
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid rgba(212, 177, 95, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(28, 34, 26, 0.98), rgba(13, 18, 14, 0.98)),
    var(--panel);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}

.mobile-bank-card h1 {
  margin: -8px 0 0;
  font-size: clamp(2.4rem, 14vw, 4.2rem);
  line-height: 0.9;
}

.mobile-bank-name,
.mobile-bank-meta,
.mobile-bank-lock {
  color: var(--muted);
  line-height: 1.45;
}

.mobile-bank-total {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(212, 177, 95, 0.32);
  border-radius: 8px;
  background: rgba(9, 13, 10, 0.82);
}

.mobile-bank-total span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
}

.mobile-bank-total strong {
  color: var(--gold);
  font-size: clamp(1.5rem, 7vw, 2.5rem);
  line-height: 1.1;
}

.mobile-bank-lock {
  padding: 12px;
  border-left: 3px solid var(--gold);
  background: rgba(212, 177, 95, 0.08);
}

.create-screen {
  padding: 28px;
}

.create-header {
  max-width: 1120px;
  margin: 0 auto 24px;
}

.creator-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.creator-form,
.selection-panel,
.side-panel,
.map-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 29, 23, 0.94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.creator-form {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 20px;
}

.stat-creator,
.physical-creator {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.stat-controls {
  display: grid;
  gap: 8px;
}

.stat-row {
  display: grid;
  grid-template-columns: 86px 1fr 42px 78px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.stat-row input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.stat-row output {
  color: var(--ink);
  font-weight: 800;
  text-align: right;
}

#cpLeft {
  color: var(--gold);
  font-size: 0.86rem;
}

#trainingCpLeft {
  color: var(--gold);
  font-size: 0.86rem;
}

#cpLeft.negative,
#trainingCpLeft.negative {
  color: var(--red);
}

.selection-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.selection-panel h2 {
  color: var(--ink);
  font-size: 1.8rem;
}

.character-preview-panel {
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(212, 177, 95, 0.08), transparent),
    #111611;
}

#characterPreview {
  width: min(180px, 100%);
  height: auto;
  image-rendering: pixelated;
}

.cp-chart {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111611;
}

.game-screen {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 16px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 0 4px;
}

.top-bar h1 {
  font-size: clamp(1.6rem, 4vw, 3.1rem);
}

.player-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
}

.player-strip span {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #141914;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6px var(--side-width);
  gap: 10px;
  min-height: 0;
}

.map-panel {
  position: relative;
  min-height: 560px;
  overflow: hidden;
}

.map-actions {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(520px, calc(100% - 24px));
}

.map-actions .small-button {
  background: rgba(17, 22, 17, 0.9);
}

#mapCanvas {
  display: block;
  width: 100%;
  height: calc(100vh - 126px);
  min-height: 560px;
  background: #0b100d;
}

.map-footer {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  pointer-events: none;
}

.side-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  max-height: calc(100vh - 126px);
  padding: 0;
  overflow: hidden;
}

.command-readout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.command-readout p {
  color: var(--muted);
  line-height: 1.45;
}

.side-resize-handle {
  width: 6px;
  min-height: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: col-resize;
  background: linear-gradient(90deg, transparent, rgba(212, 177, 95, 0.28), transparent);
}

.side-resize-handle:hover,
.side-resize-handle.is-dragging {
  background: linear-gradient(90deg, transparent, rgba(212, 177, 95, 0.75), transparent);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.small-button,
.icon-button,
.secondary-button {
  min-height: 34px;
  box-shadow: none;
}

.small-button {
  padding: 0 12px;
  font-size: 0.82rem;
}

.icon-button {
  width: 36px;
  border-color: var(--line);
  background: #111611;
  color: var(--ink);
}

.secondary-button {
  border-color: var(--line);
  background: #111611;
  color: var(--ink);
}

.contents-list,
.target-list {
  display: grid;
  gap: 8px;
}

.contents-panel {
  max-width: 560px;
}

.contents-panel .contents-list {
  max-height: min(62vh, 640px);
  overflow: auto;
}

.content-card,
.target-card {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111611;
}

.content-card strong,
.target-card strong {
  color: var(--ink);
}

.content-card span,
.target-card span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.content-card.monster-card {
  cursor: crosshair;
}

.content-card.monster-card span {
  display: none;
}

.content-card.dim-card,
.inventory-item.dim-card {
  filter: brightness(0.76) saturate(0.82);
}

.content-card.dark-card {
  border-color: rgba(95, 85, 59, 0.62);
  background:
    linear-gradient(135deg, rgba(212, 177, 95, 0.06), transparent),
    #070a09;
  color: #8f947f;
  cursor: pointer;
}

.content-card.dark-card strong {
  color: #b9b08a;
}

.content-card.dark-card span {
  display: block;
  color: #858a78;
}

.target-card {
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.target-card:hover {
  border-color: rgba(212, 177, 95, 0.7);
}

.combat-content {
  cursor: crosshair;
}

.combat-content:hover,
.combat-content:focus-visible {
  border-color: rgba(217, 120, 102, 0.85);
  outline: none;
}

.exit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.exit {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #6f7769;
  background: #111611;
  font-size: 0.76rem;
  font-weight: 800;
}

.exit.open {
  color: var(--ink);
  border-color: rgba(101, 182, 109, 0.52);
  background: rgba(101, 182, 109, 0.12);
}

#commandLog {
  display: block;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  color: var(--muted);
  font-family:
    Consolas,
    "Courier New",
    monospace;
  font-size: 0.86rem;
  line-height: 1.35;
  cursor: copy;
}

.command-form {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f140f;
  color: var(--green);
  font-family:
    Consolas,
    "Courier New",
    monospace;
}

.command-form input {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

#commandLog li {
  margin-bottom: 8px;
  padding: 8px 9px;
  border-left: 3px solid var(--line);
  background: #111611;
  white-space: pre-wrap;
}

#commandLog li.good {
  border-left-color: var(--green);
}

#commandLog li.warn {
  border-left-color: var(--red);
}

.combat-window,
.inventory-window {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 5, 0.62);
}

.chat-window {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 18;
  width: min(520px, calc(100vw - 40px));
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(180px, 340px) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(212, 177, 95, 0.4);
  border-radius: 8px;
  background: rgba(20, 26, 19, 0.96);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.58);
}

.chat-log {
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  font-family:
    Consolas,
    "Courier New",
    monospace;
  font-size: 0.86rem;
  line-height: 1.35;
}

.chat-log li {
  margin-bottom: 7px;
  padding: 8px 9px;
  border-left: 3px solid var(--gold);
  background: #101610;
  white-space: pre-wrap;
}

.chat-log li.local {
  border-left-color: var(--green);
}

.chat-log li.yell {
  border-left-color: var(--red);
}

.chat-log li.whisper {
  border-left-color: var(--blue);
}

.gossip-form {
  display: grid;
  grid-template-columns: 104px 1fr 82px;
  gap: 8px;
  align-items: center;
}

.gossip-form button {
  min-height: 42px;
}

.combat-panel,
.inventory-panel {
  display: grid;
  gap: 16px;
  width: min(980px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  padding: 18px;
  border: 1px solid rgba(212, 177, 95, 0.4);
  border-radius: 8px;
  background: #181d17;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.62);
  overflow-y: auto;
  overflow-x: hidden;
}

.inventory-layout {
  display: grid;
  grid-template-columns: 360px minmax(360px, 1fr);
  gap: 16px;
}

.encumbrance-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111611;
}

.purse-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101510;
  color: var(--muted);
}

.purse-panel strong {
  color: var(--ink);
}

.encumbrance-bar span {
  width: 0%;
}

.paperdoll-panel {
  display: grid;
  gap: 12px;
}

#inventoryAvatar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(212, 177, 95, 0.14), transparent 42%),
    #0f140f;
  image-rendering: pixelated;
}

.pack-list,
.equipment-slots {
  display: grid;
  gap: 8px;
}

.equipment-stage {
  position: relative;
  min-height: 552px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 45%, rgba(212, 177, 95, 0.12), transparent 34%),
    #0f140f;
}

.pack-list {
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  align-content: start;
  min-height: 552px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f140f;
}

.pack-list .inventory-item {
  grid-template-columns: 50px;
  justify-items: center;
  min-height: 92px;
  padding: 7px 5px;
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.12;
  cursor: pointer;
  user-select: none;
}

.pack-list .inventory-item span {
  display: none;
}

.pack-list .inventory-item strong {
  max-width: 58px;
  margin: 0;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.inventory-item,
.equip-slot {
  min-height: 62px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111611;
  color: var(--muted);
}

.pack-empty-slot {
  min-height: 62px;
  border: 1px solid rgba(59, 68, 55, 0.8);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.025), transparent),
    #0b100d;
}

.inventory-item {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px;
  align-items: center;
  cursor: grab;
}

.inventory-item strong,
.equip-slot strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.equip-slot {
  position: absolute;
  width: 74px;
  min-height: 64px;
  padding: 6px;
  border-style: dashed;
  font-size: 0.74rem;
}

.equip-slot.filled {
  display: grid;
  grid-template-columns: 50px;
  gap: 4px;
  justify-items: center;
  align-items: center;
}

.equip-slot.filled span {
  display: none;
}

.item-sprite {
  width: 50px;
  height: 50px;
  border: 1px solid #394234;
  border-radius: 6px;
  background: #0d120e;
  image-rendering: pixelated;
}

.item-compare-tooltip {
  position: fixed;
  z-index: 60;
  width: min(430px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid rgba(212, 177, 95, 0.5);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(212, 177, 95, 0.08), transparent 42%),
    #111611;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.68);
  color: var(--ink);
  pointer-events: none;
}

.item-tip-preview {
  display: grid;
  grid-template-columns: 132px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 136px;
  margin-bottom: 10px;
}

.item-tip-preview canvas {
  width: 132px;
  height: 132px;
  border: 1px solid rgba(212, 177, 95, 0.38);
  border-radius: 7px;
  background: #0b100d;
  image-rendering: pixelated;
}

.item-tip-zoom {
  align-self: end;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.item-tip-title {
  font-weight: 900;
  color: var(--gold);
}

.item-tip-sub,
.item-tip-compare,
.item-tip-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.item-compare-tooltip table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.item-compare-tooltip th,
.item-compare-tooltip td {
  padding: 4px 0;
  border-bottom: 1px solid rgba(59, 68, 55, 0.72);
  text-align: right;
}

.item-compare-tooltip th {
  color: var(--muted);
  text-align: left;
  font-weight: 700;
}

.item-compare-tooltip .plus {
  color: var(--green);
}

.item-compare-tooltip .minus {
  color: var(--red);
}

.equip-slot.drag-over {
  border-color: var(--gold);
  background: rgba(212, 177, 95, 0.12);
}

.equip-slot .equipped {
  display: block;
  color: var(--green);
  font-weight: 700;
}

.pickup-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.78rem;
  box-shadow: none;
}

.shop-meta {
  color: var(--muted);
  line-height: 1.4;
}

.shop-inventory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.shop-item {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111611;
}

.shop-item strong {
  color: var(--ink);
}

.shop-item span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.shop-item button {
  grid-column: 1 / -1;
}

.top-character-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-character-list li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111611;
  color: var(--muted);
}

.top-character-list strong {
  color: var(--ink);
}

.stats-panel {
  width: min(780px, 100%);
}

.training-panel {
  width: min(1040px, 100%);
}

.training-layout {
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
  gap: 18px;
}

.training-form {
  box-shadow: none;
}

.training-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.stats-sheet {
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f140f;
  color: var(--ink);
  font-family:
    Consolas,
    "Courier New",
    monospace;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre;
}

.context-menu {
  position: fixed;
  z-index: 80;
  display: grid;
  min-width: 140px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111611;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
}

.context-menu button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  text-align: left;
}

.context-menu button:hover {
  background: rgba(212, 177, 95, 0.16);
}

.active-combat {
  display: grid;
  gap: 14px;
}

.combat-bars {
  display: grid;
  gap: 10px;
}

.combat-bars > div {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.bar {
  height: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0f140f;
}

.bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #65b66d, #d4b15f);
}

.bar.hostile span {
  background: linear-gradient(90deg, #d97866, #d4b15f);
}

.combat-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.combat-log {
  display: flex;
  flex-direction: column-reverse;
  gap: 7px;
  min-height: 180px;
  max-height: 260px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  color: var(--muted);
  font-family:
    Consolas,
    "Courier New",
    monospace;
  font-size: 0.85rem;
}

.combat-log li {
  padding: 7px 8px;
  border-left: 3px solid var(--line);
  background: #111611;
}

.combat-log li.good {
  border-left-color: var(--green);
}

.combat-log li.warn {
  border-left-color: var(--red);
}

@media (max-width: 980px) {
  .creator-layout,
  .game-layout {
    grid-template-columns: 1fr;
  }

  .side-panel,
  #mapCanvas {
    max-height: none;
    height: auto;
  }

  .side-resize-handle {
    display: none;
  }

  #mapCanvas {
    min-height: 440px;
  }

  .inventory-layout {
    grid-template-columns: 1fr;
  }

  .gossip-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .login-screen,
  .create-screen,
  .game-screen {
    padding: 12px;
  }

  .top-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .player-strip {
    justify-content: flex-start;
  }
}
