/* ═══════════════════════════════════════════════════════════════
   REALM OF ECHOES — PUBLIC BUILD STYLES
═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   THEME VARIABLES
═══════════════════════════════════════════════════════════════ */
:root {
  --gold: #c8a84b;
  --gold-bright: #ffd86b;
  --purple: #7744ff;
  --cyan: #00ccff;
  --red: #ff5555;
  --green: #55cc88;
  --blue: #55aaff;
  --pink: #ff88cc;
  --orange: #ffaa44;

  --bg-deep: #080810;
  --bg-mid: #0e0e1a;
  --bg-low: #0a0a12;
  --panel: #07070f;
  --panel-soft: #0c0c1a;

  --border: #2a2a4a;
  --border-low: #1a1a30;

  --text: #e0d8c8;
  --muted: #5a5070;

  --rarity-common: #b0b0b0;
  --rarity-uncommon: #55cc88;
  --rarity-rare: #55aaff;
  --rarity-legendary: #c8a84b;
  --rarity-scorched: #ff6622;
}

/* ═══════════════════════════════════════════════════════════════
   RESET / BASE
═══════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: "Courier New", monospace;
  min-height: 100vh;
  padding: 16px;
  overflow-x: hidden;
}

/* Prevent double-tap weirdness on mobile buttons */
button {
  touch-action: manipulation;
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY MODES
═══════════════════════════════════════════════════════════════ */
body.large-text {
  font-size: 18px;
}

body.high-contrast {
  --bg-deep: #000;
  --bg-mid: #050505;
  --bg-low: #000;
  --panel: #000;
  --panel-soft: #111;
  --text: #fff;
  --gold: #ffd84a;
  --border: #fff;
  --border-low: #777;
  --muted: #d0d0d0;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN LAYOUT
═══════════════════════════════════════════════════════════════ */
#app-shell {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  gap: 0;
}

/* ═══════════════════════════════════════════════════════════════
   SIDE ART PANELS
═══════════════════════════════════════════════════════════════ */
.side-art {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: sticky;
  top: 16px;
  align-self: flex-start;
  padding: 8px 6px;
  gap: 8px;
}

.side-art canvas {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border-radius: 12px;
  display: block;
  box-shadow: 0 0 32px rgba(80, 40, 160, 0.22);
  border: 1px solid rgba(42, 42, 74, 0.35);
  background: #030309;
}

.side-art-label {
  color: #3a3050;
  font-size: 0.6rem;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════════
   GAME CONTAINER
═══════════════════════════════════════════════════════════════ */
#game-container {
  flex: 0 0 min(760px, 100%);
  max-width: 760px;
  width: 100%;
  background: linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-low) 100%);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#game-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--purple),
    var(--cyan),
    var(--purple),
    transparent
  );
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER / TITLE
═══════════════════════════════════════════════════════════════ */
.game-header {
  text-align: center;
}

.game-title h1 {
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  color: var(--gold);
  text-shadow: 0 0 20px rgba(200, 168, 75, 0.6);
  letter-spacing: 4px;
  font-weight: bold;
}

.tagline {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 2px;
  margin-top: 4px;
}

.version-label {
  color: #3a3050;
  font-size: 0.62rem;
  margin-top: 4px;
  letter-spacing: 1px;
}

.title-divider {
  border: none;
  border-top: 1px solid #2a2040;
  margin: 12px 0;
  position: relative;
}

.title-divider::after {
  content: "⚜";
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 1rem;
  background: var(--bg-mid);
  padding: 0 8px;
}

/* ═══════════════════════════════════════════════════════════════
   BARS
═══════════════════════════════════════════════════════════════ */
#bars-panel {
  background: #090914;
  border: 1px solid #1e1e36;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-row {
  display: grid;
  grid-template-columns: 58px 1fr 80px;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
}

.bar-label {
  color: #8878aa;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  background: #141420;
  border: 1px solid #29294a;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.hp-fill {
  background: linear-gradient(90deg, #8b1e1e, var(--red));
}

.xp-fill {
  background: linear-gradient(90deg, #1e6b44, var(--green));
}

.enemy-fill {
  background: linear-gradient(90deg, #6b1e1e, #ff8844);
}

.bar-value {
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.enemy-bar-row {
  display: none;
}

.enemy-bar-row.visible {
  display: grid;
}

/* ═══════════════════════════════════════════════════════════════
   STATS GRID
═══════════════════════════════════════════════════════════════ */
#stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 4px;
  background: #0a0a14;
  border: 1px solid #1e1e36;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 0.72rem;
}

.stat-item {
  color: #6a6080;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}

.stat-item span {
  color: var(--text);
  font-weight: bold;
}

.stat-name {
  min-width: 0;
}

#s-name {
  display: inline-block;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.val-hp {
  color: var(--red) !important;
}

.val-gold {
  color: var(--gold) !important;
}

.val-xp {
  color: var(--green) !important;
}

.val-lvl {
  color: #7788ff !important;
}

.val-str {
  color: #ff8844 !important;
}

.val-int {
  color: #88aaff !important;
}

.val-agi {
  color: #44ffcc !important;
}

.val-ste {
  color: #aa88ff !important;
}

.val-cha {
  color: var(--pink) !important;
}

.val-vit {
  color: #88ff44 !important;
}

/* ═══════════════════════════════════════════════════════════════
   WORLD INFO
═══════════════════════════════════════════════════════════════ */
#world-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-bottom: 8px;
}

#weather-banner,
#objective-banner {
  background: #090914;
  border: 1px solid #1e1e36;
  border-radius: 6px;
  padding: 7px 10px;
  color: #9988bb;
  font-size: 0.74rem;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   OUTPUT LOG
═══════════════════════════════════════════════════════════════ */
#output {
  background: var(--panel);
  border: 1px solid var(--border-low);
  border-radius: 8px;
  padding: 14px;
  height: 310px;
  overflow-y: auto;
  margin-bottom: 10px;
  font-size: 0.83rem;
  line-height: 1.85;
  scroll-behavior: smooth;
  flex-shrink: 0;
}

#output::-webkit-scrollbar {
  width: 4px;
}

#output::-webkit-scrollbar-track {
  background: #0a0a14;
}

#output::-webkit-scrollbar-thumb {
  background: #2a2050;
  border-radius: 4px;
}

/* Message types */
.msg-story {
  color: #c8c0b0;
}

.msg-action {
  color: var(--blue);
}

.msg-combat {
  color: var(--red);
}

.msg-reward {
  color: var(--gold);
}

.msg-heal {
  color: var(--green);
}

.msg-system {
  color: var(--muted);
  font-style: italic;
}

.msg-death {
  color: #ff2222;
  font-weight: bold;
}

.msg-level {
  color: #aaffaa;
  font-weight: bold;
}

.msg-title {
  color: var(--gold);
  font-weight: bold;
  font-size: 1.08em;
}

.msg-welcome {
  color: #e8d898;
}

.msg-lore {
  color: #9988bb;
  font-style: italic;
}

.msg-quest {
  color: var(--orange);
}

.msg-enemy {
  color: #ff8866;
  font-style: italic;
}

.msg-warn {
  color: #ffcc44;
}

.msg-unlock {
  color: #99ffcc;
  font-weight: bold;
}

.msg-save {
  color: #88aaff;
}

/* ═══════════════════════════════════════════════════════════════
   INPUT AREAS
═══════════════════════════════════════════════════════════════ */
#name-input-area {
  display: none;
  gap: 8px;
  margin: 8px 0 10px;
}

#name-input-area input {
  flex: 1;
  background: #09090f;
  border: 1px solid #252540;
  border-radius: 6px;
  color: var(--gold);
  font-family: "Courier New", monospace;
  font-size: 0.84rem;
  padding: 10px 12px;
  outline: none;
  min-width: 0;
}

#name-input-area input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(200, 168, 75, 0.18);
}

#name-input-area input::placeholder {
  color: #2a2040;
}

#name-input-area button {
  background: #1a1208;
  color: var(--gold);
  border: 1px solid #664422;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 0.84rem;
  transition: all 0.15s;
  white-space: nowrap;
}

#name-input-area button:hover {
  background: #241a0e;
  border-color: var(--gold);
  color: #fff0aa;
}

/* ═══════════════════════════════════════════════════════════════
   STAT ALLOCATOR
═══════════════════════════════════════════════════════════════ */
#stat-allocator {
  display: none;
  margin-bottom: 10px;
}

#points-left {
  text-align: center;
  color: var(--gold);
  font-size: 0.8rem;
  margin: 5px 0;
  font-weight: bold;
}

.alloc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0;
}

.alloc-row {
  display: flex;
  align-items: center;
  background: #0c0c1a;
  border: 1px solid #1e1e36;
  border-radius: 6px;
  padding: 7px 10px;
  gap: 6px;
}

.alloc-label {
  font-size: 0.75rem;
  color: #9988bb;
  flex: 1;
}

.alloc-val {
  font-size: 0.88rem;
  font-weight: bold;
  color: var(--text);
  width: 24px;
  text-align: center;
}

.alloc-btn {
  background: #1a1a2e;
  border: 1px solid #333;
  color: #aaa;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  flex-shrink: 0;
}

.alloc-btn:hover {
  background: #252540;
  border-color: var(--purple);
  color: #fff;
}

#confirm-stats {
  width: 100%;
  background: #1a0e2e;
  color: #cc88ff;
  border: 1px solid #4a2888;
  border-radius: 6px;
  padding: 11px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 0.84rem;
  transition: all 0.15s;
  margin-top: 5px;
}

#confirm-stats:hover {
  background: #240e40;
  border-color: #cc88ff;
}

/* ═══════════════════════════════════════════════════════════════
   CHOICES / BUTTONS
═══════════════════════════════════════════════════════════════ */
.section-label {
  color: #3a3050;
  font-size: 0.66rem;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 5px;
  text-transform: uppercase;
}

#choices {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.choice-btn,
.control-btn {
  background: #0e0e1e;
  color: #b0c0e0;
  border: 1px solid #252540;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 0.81rem;
  text-align: left;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.choice-btn {
  width: 100%;
}

.choice-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.15s;
}

.choice-btn:hover:not(:disabled),
.control-btn:hover:not(:disabled) {
  background: #161628;
  border-color: #5544aa;
  color: #fff;
}

.choice-btn:hover:not(:disabled)::before {
  background: var(--purple);
}

.choice-btn:disabled,
.control-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.choice-btn:active:not(:disabled),
.control-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.choice-btn:focus-visible,
.control-btn:focus-visible,
#name-input-area input:focus-visible,
#name-input-area button:focus-visible,
#music-volume-slider:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Quest / Combat button variants */
.choice-btn.quest-btn {
  border-color: #664422;
  color: #ffaa55;
  background: #120e08;
}

.choice-btn.quest-btn:hover:not(:disabled) {
  background: #1a1208;
  border-color: var(--gold);
}

.choice-btn.quest-btn::before {
  background: var(--gold);
}

.choice-btn.combat-btn {
  border-color: #442222;
  color: #ff8888;
  background: #110808;
}

.choice-btn.combat-btn:hover:not(:disabled) {
  background: #1a0e0e;
  border-color: var(--red);
}

.choice-btn.combat-btn::before {
  background: var(--red);
}

.choice-btn.gear-btn {
  border-color: #334422;
  color: #bbffaa;
  background: #0b1208;
}

.choice-btn.gear-btn:hover:not(:disabled) {
  background: #101a0c;
  border-color: var(--green);
}

.choice-btn.danger-btn,
.control-btn.danger {
  color: #ff6666;
  border-color: #552222;
  background: #110808;
}

.choice-btn.danger-btn:hover:not(:disabled),
.control-btn.danger:hover:not(:disabled) {
  background: #1a0e0e;
  border-color: var(--red);
}

.lock-badge {
  color: #ff6666;
  font-weight: bold;
}

.stat-lock-badge {
  color: #ffaa44;
  font-weight: bold;
}

/* ═══════════════════════════════════════════════════════════════
   DIFFICULTY / CARD GRIDS
═══════════════════════════════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.game-card {
  background: #0c0c1a;
  border: 1px solid #252540;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}

.game-card:hover {
  border-color: var(--purple);
  background: #12122a;
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(119, 68, 255, 0.2);
}

.game-card .card-icon {
  font-size: 1.9rem;
  margin-bottom: 5px;
}

.game-card .card-title {
  color: var(--gold);
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.game-card .card-desc {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.game-card .card-meta {
  color: #8878aa;
  font-size: 0.66rem;
  margin-top: 6px;
  line-height: 1.45;
}

/* Specific difficulty styling */
.diff-intermediate {
  border-color: #335577;
}

.diff-hard {
  border-color: #885522;
}

.diff-insane {
  border-color: #883333;
}

.diff-hellfire {
  border-color: #aa3300;
  box-shadow: 0 0 20px rgba(255, 80, 20, 0.12);
}

.diff-hellfire:hover {
  box-shadow: 0 0 28px rgba(255, 80, 20, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   CHARACTER CARDS
═══════════════════════════════════════════════════════════════ */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.char-card {
  background: #0c0c1a;
  border: 1px solid #252540;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}

.char-card:hover {
  border-color: var(--purple);
  background: #12122a;
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(119, 68, 255, 0.2);
}

.char-card .char-icon {
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.char-card .char-name {
  color: var(--gold);
  font-weight: bold;
  font-size: 0.84rem;
  margin-bottom: 3px;
}

.char-card .char-desc {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

.char-card .char-stats {
  color: #7766aa;
  font-size: 0.64rem;
  margin-top: 5px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   CONTROL BAR / SAVE / MUSIC
═══════════════════════════════════════════════════════════════ */
#control-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.control-btn {
  padding: 6px 12px;
  font-size: 0.72rem;
  text-align: center;
}

#save-status {
  font-size: 0.7rem;
  color: var(--green);
  font-family: "Courier New", monospace;
  font-style: italic;
  margin-left: 2px;
}

#music-volume-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-family: "Courier New", monospace;
}

#music-volume-slider {
  width: 90px;
  accent-color: var(--gold);
  cursor: pointer;
}

#music-toggle-btn.muted {
  color: #ff6666;
  border-color: #552222;
  background: #110808;
}

#music-toggle-btn.muted:hover {
  background: #1a0e0e;
  border-color: var(--red);
}

/* ═══════════════════════════════════════════════════════════════
   INVENTORY / GEAR PANEL
═══════════════════════════════════════════════════════════════ */
#inventory-panel {
  background: #0a0a14;
  border: 1px solid #1e1e36;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.72rem;
  color: #8878aa;
  margin-bottom: 8px;
  display: grid;
  gap: 4px;
  line-height: 1.45;
}

#inventory-panel b {
  color: #3a3050;
}

#s-inv,
#s-gear {
  color: #aa99cc;
}

/* ═══════════════════════════════════════════════════════════════
   GEAR / RARITY DISPLAY
═══════════════════════════════════════════════════════════════ */
.gear-line {
  padding: 6px 8px;
  border-radius: 6px;
  background: #090914;
  border: 1px solid #1e1e36;
  margin: 4px 0;
  line-height: 1.45;
}

.gear-name {
  font-weight: bold;
}

.rarity-common {
  color: var(--rarity-common);
}

.rarity-uncommon {
  color: var(--rarity-uncommon);
}

.rarity-rare {
  color: var(--rarity-rare);
}

.rarity-legendary {
  color: var(--rarity-legendary);
  text-shadow: 0 0 8px rgba(200, 168, 75, 0.35);
}

.rarity-scorched {
  color: var(--rarity-scorched);
  text-shadow: 0 0 10px rgba(255, 100, 30, 0.45);
}

.gear-meta {
  color: var(--muted);
  font-size: 0.7rem;
}

.gear-compare {
  background: #090914;
  border: 1px solid #252540;
  border-radius: 8px;
  padding: 10px;
  margin: 8px 0;
}

.gear-compare-title {
  color: var(--gold);
  font-weight: bold;
  margin-bottom: 6px;
}

.gear-better {
  color: var(--green);
}

.gear-worse {
  color: var(--red);
}

.gear-neutral {
  color: #aaa;
}

/* ═══════════════════════════════════════════════════════════════
   WEATHER / COOLDOWN / TOAST-LIKE ELEMENTS
═══════════════════════════════════════════════════════════════ */
.weather-clear {
  color: #ffe8a0;
}

.weather-rain {
  color: #88aaff;
}

.weather-storm {
  color: #aa88ff;
}

.weather-ashfall {
  color: #ff8844;
}

.weather-fog {
  color: #cccccc;
}

.weather-bloodMoon {
  color: #ff5555;
}

.weather-eclipse {
  color: #cc88ff;
}

.cooldown-text {
  color: #ffcc44;
  font-style: italic;
}

.toast-line {
  border-left: 3px solid var(--gold);
  padding-left: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */
.game-footer {
  text-align: center;
  margin-top: 10px;
  font-size: 0.66rem;
  color: #2a2040;
  letter-spacing: 2px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-low);
  margin: 8px 0;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  body {
    padding: 10px;
  }

  #app-shell {
    flex-direction: column;
    align-items: center;
  }

  .side-art {
    position: relative;
    top: 0;
    flex-direction: row;
    justify-content: center;
    width: 100%;
    max-width: 740px;
    padding: 4px 0;
  }

  .side-art canvas {
    width: 42vw;
    max-width: 230px;
    border-radius: 8px;
  }

  #game-container {
    flex: 1;
    max-width: 100%;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 8px;
  }

  #game-container {
    padding: 16px 12px;
  }

  .game-title h1 {
    font-size: 1.18rem;
    letter-spacing: 2px;
  }

  .tagline {
    font-size: 0.62rem;
  }

  #stats-bar {
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
    font-size: 0.66rem;
    padding: 7px 8px;
  }

  #s-name {
    max-width: 100px;
  }

  #output {
    height: 250px;
    font-size: 0.78rem;
    padding: 12px;
  }

  .choice-btn {
    font-size: 0.76rem;
    padding: 9px 10px;
  }

  .alloc-grid {
    grid-template-columns: 1fr;
  }

  .char-grid,
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #name-input-area {
    flex-direction: column;
  }

  #name-input-area button {
    width: 100%;
  }

  .side-art canvas {
    width: 38vw;
    max-width: 175px;
  }

  #control-bar {
    gap: 5px;
  }

  .control-btn {
    flex: 1 1 auto;
    text-align: center;
    padding: 7px 8px;
  }

  #music-volume-wrap {
    width: 100%;
    justify-content: center;
  }

  #music-volume-slider {
    flex: 1;
    max-width: 190px;
  }

  .bar-row {
    grid-template-columns: 50px 1fr 64px;
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .char-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  #stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  #s-name {
    max-width: 88px;
  }

  .side-art-label {
    display: none;
  }

  #inventory-panel {
    font-size: 0.68rem;
  }
}