/* Ash, iron, and ember. System fonts only, so a local file still opens with no network.
   Gold marks a choice, a milestone, or a reward. Ember marks danger. Iron carries the rest. */
:root {
  --soot: #0c0b0a;
  --coal: #11100f;
  --iron: #1b1917;
  --raised: #24211e;
  --line: #484039;
  --iron-bright: #6d655c;
  --parchment: #d7cbb5;
  --ash: #a69a88;
  --slate: #8d8680;
  --gold: #c79a50;
  --gold-bright: #e7d3a4;
  --copper: #a86a45;
  --ember: #c47a4a;
  --rust: #8f4536;
  --moss: #82906a;
  --danger-text: #c4a090;
  --pewter: #9a9184;
  --frame: rgba(199, 154, 80, 0.22);
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --font-display: Cambria, "Palatino Linotype", Palatino, Georgia, serif;
  --font-story: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-ui: "Segoe UI", Candara, Tahoma, sans-serif;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
::selection { background: #3c3428; color: var(--parchment); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--parchment);
  background:
    radial-gradient(ellipse at 50% -12%, rgba(199, 154, 80, 0.1), transparent 42%),
    radial-gradient(ellipse at 100% 110%, rgba(143, 69, 54, 0.09), transparent 34%),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(215, 203, 181, 0.015) 3px, rgba(215, 203, 181, 0.015) 4px),
    var(--soot);
  font-family: var(--font-story);
  font-size: 16px;
  line-height: 1.6;
}

button, input, select, label { font-family: var(--font-ui); }
button {
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--parchment);
  padding: 9px 12px;
  min-height: 40px;
  cursor: pointer;
  border-radius: 0;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
button:hover { background: #2c2925; border-color: var(--gold); }
button:disabled,
button:disabled:hover {
  background: var(--iron);
  border-color: var(--line);
  color: var(--ash);
  cursor: not-allowed;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: inset 0 0 0 2px var(--gold);
}
#beginBtn,
button[data-action="attack"],
.notice-actions button { border-color: var(--gold); color: var(--gold-bright); }
button[data-action="boss"],
button[data-action="deep-boss"] { border-color: #6a4036; }
button[data-action="boss"] strong,
button[data-action="deep-boss"] strong { color: #e7c2a4; }
button[data-action="new-game"] { border-color: var(--rust); color: var(--danger-text); }
button[data-action="new-game"]:hover { border-color: var(--danger-text); background: #2a1c19; }

header {
  padding: 22px 20px 16px;
  text-align: center;
  background:
    linear-gradient(var(--gold), var(--gold)) 0 0 / 18px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 0 / 1px 18px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 18px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 1px 18px no-repeat,
    var(--iron);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -1px 0 rgba(199, 154, 80, 0.35);
}
.banner-rule {
  width: min(220px, 46%);
  height: 7px;
  margin: 12px auto 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid rgba(199, 154, 80, 0.35);
}
header .eyebrow {
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-family: var(--font-ui);
  font-size: 11px;
}
h1 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: normal;
  letter-spacing: 0.14em;
  line-height: 1.1;
  color: var(--parchment);
}
.brand-mark {
  display: block;
  width: min(100%, 320px);
  height: auto;
  aspect-ratio: 2157 / 729;
  object-fit: contain;
  margin: 0 auto;
}
header p {
  margin: 8px 0 0;
  color: var(--ash);
  font-family: var(--font-story);
  font-style: italic;
  font-size: 15px;
}

.wrap {
  max-width: 1200px;
  margin: auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}
.sidebar, .main { display: flex; flex-direction: column; gap: 14px; }

.panel {
  position: relative;
  border: 1px solid var(--line);
  background: var(--iron);
  padding: 16px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(154, 145, 132, 0.16), inset 0 1px 0 rgba(215, 203, 181, 0.04);
}
.panel h2, .panel h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: normal;
  color: var(--parchment);
  letter-spacing: 0.03em;
}
.panel h2 {
  font-size: 22px;
  line-height: 1.2;
  padding-bottom: 10px;
  border-bottom: 0;
  background:
    linear-gradient(var(--gold), var(--gold)) left bottom / 28px 1px no-repeat,
    linear-gradient(var(--line), var(--line)) 36px bottom / calc(100% - 36px) 1px no-repeat;
}
.panel h3 {
  font-family: var(--font-ui);
  font-size: 12px;
  margin-top: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
#heroName { color: var(--gold); }
#heroClass {
  margin: 2px 0 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
}
#region {
  font-family: var(--font-display);
  font-weight: normal;
  color: var(--gold-bright);
}

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat {
  background: var(--soot);
  padding: 8px;
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}
.stat small {
  display: block;
  color: var(--ash);
  font-family: var(--font-ui);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.stat strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--parchment);
}

.meter { margin: 12px 0; }
.meter-label, .enemy-vitals {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--ash);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.enemy-vitals .bar { flex: 1 0 100%; }
.meter-label span, .enemy-vitals strong {
  font-variant-numeric: tabular-nums;
  color: var(--parchment);
  font-weight: 600;
}
.bar {
  height: 10px;
  margin-top: 5px;
  background: var(--soot);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
}
.bar span { display: block; height: 100%; width: 50%; background: var(--rust); }
.bar.mp span { background: var(--pewter); }
.bar.xp span { background: var(--gold); }
.enemy .bar span { background: var(--rust); }

.purse {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--ash);
  font-family: var(--font-ui);
  font-size: 13px;
}
.purse strong {
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 6px 0;
  background: var(--soot);
}
.tab { flex: 1; min-width: 90px; }
.tab.active {
  background: #2c261c;
  color: var(--gold-bright);
  border-color: var(--gold);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.view { display: none; }
.view.active { display: block; }
.story {
  font-family: var(--font-story);
  font-size: 17px;
  line-height: 1.7;
  color: var(--parchment);
}
.scene {
  min-height: 95px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--gold), var(--gold)) 0 0 / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 0 / 1px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 1px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 100% / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 100% / 1px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 100% / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 100% / 1px 12px no-repeat,
    var(--raised);
}
.scene.dungeon { border-color: #6a5a3e; }
.scene.deep { box-shadow: inset 0 0 0 1px rgba(143, 69, 54, 0.28); }
.scene.sanctum { border-color: #6a4036; }
.scene.veins { border-color: #5c3a32; box-shadow: inset 0 0 0 1px rgba(176, 92, 48, 0.35); }
.scene.coast { border-color: #3d4c56; box-shadow: inset 0 0 0 1px rgba(120, 148, 160, 0.35); }
.scene.reach { border-color: #4a3c32; box-shadow: inset 0 0 0 1px rgba(168, 124, 72, 0.32); }
.scene .location, .floor {
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.floor { margin-top: 4px; }
.floor:empty { display: none; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.log {
  max-height: 250px;
  overflow: auto;
  padding: 12px;
  background: var(--coal);
  border: 1px solid var(--line);
  color: var(--parchment);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  scrollbar-color: var(--line) var(--coal);
}
.log p { margin: 0 0 8px; }
.log p:first-child {
  margin-bottom: 10px;
  padding-left: 8px;
  border-left: 2px solid var(--gold);
}
.log .good { color: var(--moss); }
.log .bad { color: var(--danger-text); }
.log .gold { color: var(--gold); }

.enemy {
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--rust);
  background: #211816;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.enemy .bar { height: 12px; }
.enemy.boss { box-shadow: inset 0 0 0 1px var(--frame); }
.enemy.turned { box-shadow: inset 0 3px 0 var(--gold); }
.enemy.telegraph {
  border-color: var(--ember);
  background: #2a1c16;
  animation: telegraph 1.8s ease-in-out infinite;
}
.enemy.opening { border-color: #627053; background: #1a1d16; }
.enemy.pressing { border-color: var(--gold); }
.stance, .phase-note {
  margin: 10px 0 0;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.02em;
}
.stance-kicker {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border: 1px solid currentColor;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.stance.raised { color: #e7c2a4; }
.stance.open { color: var(--moss); }
.stance.press, .phase-note { color: var(--gold); }
.combat-self {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
#combat.live { border-color: #6a4036; }
.combat-log { max-height: 148px; margin-top: 12px; }
@keyframes telegraph {
  50% { border-color: var(--copper); }
}
.enemy h3 {
  margin: 0 0 4px;
  color: var(--danger-text);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: normal;
}
.enemy-vitals { margin-top: 12px; }
.tier-note { margin-top: 6px; color: var(--pewter); font-size: 13px; }
.tier-note.warn { color: var(--gold); }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice {
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--raised);
  text-align: left;
  color: inherit;
}
.choice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--parchment);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
}
.choice small {
  color: var(--ash);
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.4;
}
.choice:hover { border-color: var(--gold); background: #2c2925; }
.choice.selected { border-color: var(--gold); background: #2c261c; box-shadow: inset 3px 0 0 var(--gold); }
.choice.selected strong { color: var(--gold-bright); }
.choice:disabled, .choice:disabled:hover {
  background: var(--iron);
  border-color: var(--line);
  cursor: not-allowed;
}
.choice:disabled strong, .choice:disabled small { color: var(--ash); }

.item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 14px;
}
.item:last-child { border-bottom: 0; }
.quest {
  align-items: flex-start;
  margin-left: 0;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}
.quest-active { border-left-color: var(--gold); }
.quest-completed { border-left-color: var(--moss); }
.quest-available { border-left-color: var(--parchment); }
.quest-unavailable { border-left-color: var(--line); }
.item strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.muted { color: var(--ash); }
.small { font-family: var(--font-ui); font-size: 12px; line-height: 1.45; }
.tag {
  display: inline-block;
  flex: none;
  border: 1px solid var(--line);
  color: var(--ash);
  padding: 2px 6px;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tag-active, .tag-equipped { color: var(--gold-bright); border-color: var(--gold); }
.tag-completed { color: var(--moss); border-color: #627053; }
.tag-available { color: var(--parchment); border-color: var(--line); }
.tag-unavailable { color: var(--ash); border-color: var(--line); }

label { display: block; color: var(--ash); font-size: 12px; letter-spacing: 0.04em; }
input, select {
  width: 100%;
  margin: 4px 0 10px;
  padding: 9px;
  background: var(--soot);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--parchment);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}
.create-screen { max-width: 720px; margin: 18px auto; }
.slot-row { position: relative; margin-top: 8px; }
.slot-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.slot-list { display: grid; gap: 8px; margin-top: 8px; }
.slot-card { width: 100%; min-width: 0; text-align: left; }
.slot-card small, .slot-card strong { display: block; overflow-wrap: anywhere; }
.slot-card .tag { margin-top: 6px; }
.save-note { margin: 10px 0 0; }

.footer {
  max-width: 1200px;
  margin: 8px auto 0;
  padding: 14px 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  color: var(--ash);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.notice-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 16, 15, 0.72);
}
.notice {
  width: min(440px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--gold), var(--gold)) 0 0 / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 0 / 1px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 0 / 1px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 100% / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 100% / 1px 12px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 100% / 12px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 100% 100% / 1px 12px no-repeat,
    var(--iron);
  box-shadow: var(--shadow);
}
.notice-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 12px 14px 4px; }
.notice-card + .notice-card { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.notice-card.victory { border-left: 2px solid var(--iron-bright); padding-left: 10px; }
.notice-card.level { border-left: 2px solid var(--gold); padding-left: 10px; }
.notice-card.rite { border-left: 2px solid var(--slate); padding-left: 10px; }
.notice-kicker {
  margin: 0 0 4px;
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.notice h2, .notice h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: normal;
  color: var(--parchment);
}
.notice h2 { font-size: 24px; letter-spacing: 0.04em; }
.notice h3 {
  margin-top: 14px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.notice-who, .notice-level, .notice-now, .notice-item, .notice-empty {
  margin: 0 0 6px;
  font-family: var(--font-ui);
  font-size: 14px;
}
.notice-level, .notice-now { color: var(--parchment); }
.notice-empty { color: var(--ash); }
.notice-list { margin: 8px 0 0; }
.notice-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; border-bottom: 1px solid rgba(72, 64, 57, 0.7); }
.notice-item, .notice-name, .notice-fit, .notice-desc { overflow-wrap: anywhere; }
.notice-name, .notice-fit, .notice-desc, .notice-item p { margin: 0 0 4px; }
.notice-fit { color: var(--parchment); }
.notice-desc { color: var(--ash); }
.notice-row dt { color: var(--ash); font-family: var(--font-ui); font-size: 13px; }
.notice-row dd { margin: 0; color: var(--parchment); font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-weight: 600; }
.notice-stats { margin: 8px 0; padding-left: 18px; color: var(--parchment); font-family: var(--font-ui); font-size: 14px; }
.notice-stats li { margin: 3px 0; }
.notice-actions { padding: 8px 14px 12px; }
@media (max-height: 640px) {
  .notice-layer { padding: 8px; }
  .notice { max-height: calc(100vh - 16px); }
  .notice h2 { font-size: 20px; margin-bottom: 4px; }
  .notice h3 { margin-top: 8px; }
  .notice-body { padding: 8px 12px 2px; }
  .notice-actions { padding: 6px 12px 8px; }
}
.gear-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.gear-slot, .bag-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  text-align: left;
}
.gear-slot {
  background: linear-gradient(180deg, rgba(215, 203, 181, 0.04), transparent 42%), var(--soot);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(109, 101, 92, 0.45);
}
.slot-mark { width: 28px; height: 28px; display: block; color: var(--pewter); }
.slot-copy { min-width: 0; }
.gear-slot strong, .bag-row strong { display: block; overflow-wrap: anywhere; margin-bottom: 0; }
.slot-stat {
  display: block;
  margin-top: 2px;
  color: var(--ash);
  font-family: var(--font-ui);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.gear-slot.empty {
  border-style: dashed;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(109, 101, 92, 0.28);
}
.gear-slot.empty .slot-mark { color: var(--slate); }
.gear-slot.empty strong { color: var(--ash); font-weight: normal; }
.gear-slot:not(.empty) { border-color: var(--iron-bright); }
.gear-slot:not(.empty) .slot-mark { color: var(--parchment); }
.gear-slot:has(.rarity-rare) { border-color: rgba(199, 154, 80, 0.75); }
.gear-slot:has(.rarity-rare) .slot-mark { color: var(--gold); }
.gear-slot:has(.rarity-ultraRare) { border-color: #8a5a48; background: #211816; }
.gear-slot:has(.rarity-ultraRare) .slot-mark { color: #d2a48a; }
.gear-slot:has(.rarity-uncommon) { border-color: #5e5953; }
.gear-slot.selected {
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55), inset 3px 0 0 var(--gold), inset 0 0 0 1px var(--gold);
}
.item-head { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 8px; }
.item-name { margin: 0; font-family: var(--font-display); font-size: 20px; line-height: 1.2; }
.item-name strong { font-weight: normal; }
.item-meta { margin: 3px 0 0; font-family: var(--font-ui); font-size: 12px; }
.item-meta .tag, .item-meta .rarity-name { margin-right: 6px; }
.item-stats, .item-req, .item-perk, .item-desc, .item-lore { margin: 0 0 6px; overflow-wrap: anywhere; }
.item-stats { font-family: var(--font-ui); font-variant-numeric: tabular-nums; color: var(--parchment); }
.item-req { font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ash); }
.perk-name { color: var(--gold); }
.item-lock {
  margin: 0 0 8px;
  padding: 6px 8px;
  border: 1px solid var(--rust);
  color: var(--danger-text);
  font-family: var(--font-ui);
  font-size: 14px;
}
.item-detail { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); background: var(--coal); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(154, 145, 132, 0.12); }
.item-detail h3 { margin: 10px 0 6px; font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: normal; }
.item-detail p { margin: 0 0 6px; }
.diff-up { color: var(--moss); }
.diff-down { color: var(--danger-text); }
.rarity-common { color: var(--parchment); }
.rarity-uncommon { color: var(--pewter); }
.rarity-rare { color: var(--gold); }
.rarity-quest { color: var(--moss); }
.rarity-ultraRare { color: #d2a48a; }
.rarity-epic { color: #d7b08a; }
.rarity-relic { color: #c4b8a4; }
.rarity-legendary { color: #e4c7a2; }
.rarity-unknown { color: var(--parchment); }
.gear-slot:has(.rarity-epic) { border-color: rgba(215, 176, 138, 0.7); }
.gear-slot:has(.rarity-relic) { border-color: rgba(196, 184, 164, 0.7); }
.gear-slot:has(.rarity-legendary) { border-color: rgba(228, 199, 162, 0.85); }
.notice-ultra { margin-top: 8px; padding: 8px 10px; border: 1px solid #6e4638; background: #1a1412; box-shadow: inset 3px 0 0 var(--copper); }
.notice-ultra p { margin: 0 0 4px; }
.bag-row { margin-bottom: 8px; }
.notice-actions button { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  button, .enemy { transition: none; }
  .enemy.telegraph { animation: none; }
}
.exchange { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.exchange h3 { margin: 0 0 8px; font-size: 16px; letter-spacing: 0.06em; }
.exchange .actions { margin: 8px 0 10px; }
@media (max-height: 720px) {
  header { padding: 12px 14px 10px; }
  h1 { font-size: 28px; }
  .brand-mark { width: min(100%, 240px); }
  header p { margin-top: 4px; }
  .banner-rule { margin-top: 8px; }
  .wrap { padding: 10px; gap: 10px; }
  .panel h2 { margin-bottom: 8px; }
  .log, .combat-log { max-height: 120px; }
}
@media (max-width: 760px) {
  .wrap { grid-template-columns: 1fr; padding: 10px; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .sidebar .panel:first-child { grid-column: 1 / -1; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 12px; }
}
@media (max-width: 440px) {
  .sidebar { display: flex; }
  .choice-grid, .gear-grid, .combat-self { grid-template-columns: 1fr; }
  .actions button { flex: 1; }
  h1 { letter-spacing: 0.08em; }
  .brand-mark { width: min(100%, 280px); }
}
