:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1020;
  color: #f7f4ec;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #a8b1c4;
  --panel: #151d30;
  --line: #29344c;
  --accent: #e4b767;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -12%, #283354 0, transparent 48%),
    #0b1020;
}

button, input, select { font: inherit; }

.shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
}

.topbar { display: flex; align-items: center; gap: 13px; margin: 8px 0 23px; }
.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #705b35;
  border-radius: 14px;
  background: linear-gradient(145deg, #3b3022, #1e2333);
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 26px;
}
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 10px; letter-spacing: .16em; }
h1 { margin: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 600; }
h2 { margin: 0 0 16px; font-family: Georgia, serif; font-size: 23px; }

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(155deg, #192238, var(--panel) 58%);
  box-shadow: 0 16px 40px #0004;
}

.muted, .footer, .hint { color: var(--muted); }
.footer { padding: 0 8px; text-align: center; font-size: 12px; }
.hint { margin: 8px 0 0; font-size: 13px; line-height: 1.45; }
.identity { margin: 0 0 5px; font-size: 21px; font-weight: 650; }
.subtitle { margin: 0 0 18px; color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #0e1627aa;
}
.stat-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.stat-value { overflow-wrap: anywhere; font-size: 16px; font-weight: 600; }
.wide { grid-column: 1 / -1; }

.field { display: grid; gap: 7px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.field input, .field select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid #36425e;
  border-radius: 12px;
  outline: none;
  background: #0c1425;
  color: #fff;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.button {
  width: 100%;
  min-height: 50px;
  margin-top: 10px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(120deg, #efc875, #c68b3c);
  color: #21180d;
  font-weight: 750;
}
.button:disabled { opacity: .6; }
.button.secondary {
  border: 1px solid #36425e;
  background: #222d43;
  color: #f7f4ec;
}
.nav-actions, .skill-list { display: grid; gap: 9px; margin-top: 14px; }
.gear-list, .item-list, .category-list { display: grid; gap: 9px; margin: 12px 0 18px; }
.gear-slot, .item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e1627aa;
}
.gear-slot { color: var(--muted); font-size: 13px; }
.gear-slot strong { color: #f7f4ec; text-align: right; }
.item-card > div:first-child { min-width: 0; }
.item-card strong, .item-card small { display: block; overflow-wrap: anywhere; }
.item-card small { margin-top: 5px; color: var(--muted); line-height: 1.35; }
.item-actions, .category-list { display: flex; flex-wrap: wrap; gap: 7px; }
.small-button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #705b35;
  border-radius: 10px;
  background: #3b3022;
  color: #f4d899;
  font-size: 12px;
  font-weight: 650;
}
.small-button.secondary { border-color: #36425e; background: #222d43; color: #f7f4ec; }
.small-button.selected { border-color: var(--accent); }
.small-button:disabled { opacity: .55; }
h3 { margin: 18px 0 8px; font-size: 15px; }
.destination-list { display: grid; gap: 9px; margin: 15px 0; }
.destination {
  display: flex;
  width: 100%;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #0e1627aa;
  color: #f7f4ec;
  text-align: left;
}
.destination:disabled { opacity: .55; }
.destination strong, .destination small { display: block; }
.destination small { margin-top: 5px; color: var(--muted); line-height: 1.35; }
.notice {
  padding: 11px 13px;
  border: 1px solid #705b35;
  border-radius: 12px;
  background: #322a1d;
  color: #f4d899;
  font-size: 13px;
  line-height: 1.45;
}
.combat-bars { margin: 18px 0; }
.bar-label { display: flex; justify-content: space-between; margin: 12px 0 5px; font-size: 13px; }
progress { width: 100%; height: 12px; accent-color: #6abd85; }
progress.enemy-bar { accent-color: #da716b; }
.action-button { margin-top: 0; font-size: 13px; }
.battle-log {
  max-height: 230px;
  overflow-y: auto;
  margin-top: 17px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1220;
  font-size: 13px;
  line-height: 1.65;
}
.message { margin: 14px 0 0; color: #ffb5a7; font-size: 14px; }
.message:empty { display: none; }

@media (max-width: 360px) {
  .shell { padding-right: 12px; padding-left: 12px; }
  .panel { padding: 16px; }
  .stat { padding: 11px; }
}
