/* VeilBorn — Phase 1 Styles */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg:      #0d0d14;
  --panel:   #13131f;
  --panel2:  #1a1a2a;
  --border:  #2a2a42;
  --text:    #d4d0c8;
  --muted:   #7a7a9a;
  --gold:    #c9a84c;
  --red:     #d94040;
  --blue:    #4070d9;
  --teal:    #33bb77;
  --green:   #44dd88;

  --r-common:   #a0a0a0;
  --r-uncommon: #44bb44;
  --r-rare:     #4488ff;
  --r-epic:     #aa44ff;
  --r-mythical: #ff8800;
  --r-divine:   #ffd700;
  --r-unique:   #e49b0f;
}

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── AUTH ──────────────────────────────────────────────── */

#auth-screen, #create-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-box {
  width: 340px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-title {
  font-size: 2.2rem;
  letter-spacing: 5px;
  text-align: center;
  color: var(--gold);
  text-transform: uppercase;
}

.game-subtitle { text-align: center; color: var(--muted); font-size: 0.82rem; }
.create-heading { text-align: center; font-size: 1rem; color: var(--muted); }

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab.active, .auth-tab:hover { color: var(--gold); border-bottom-color: var(--gold); }

.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}
.auth-form input:focus { border-color: var(--gold); }

.form-error { color: var(--red); font-size: 0.8rem; min-height: 18px; }

/* ─── BUTTONS ───────────────────────────────────────────── */

.btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color 0.1s, background 0.1s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--gold); background: #1f1f30; }
.btn:disabled, .btn.disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary { border-color: var(--gold); color: var(--gold); background: #191928; }
.btn-primary:hover:not(:disabled) { background: #22223a; }

.btn-quick  { border-color: var(--gold);  color: var(--gold); }
.btn-brace  { border-color: var(--blue);  color: #7ea8f0; }
.btn-run    { border-color: var(--red);   color: #e07070; }
.btn-attack { border-color: var(--gold);  color: var(--gold); padding: 4px 10px; font-size: 0.8rem; }

.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

/* ─── GAME LAYOUT ───────────────────────────────────────── */

#game-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 860px;
  margin: 0 auto;
}

/* ─── HEADER ─────────────────────────────────────────────── */

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.hdr-left, .hdr-right { display: flex; gap: 14px; align-items: center; }
.hdr-name   { font-weight: bold; color: var(--gold); flex: 1; }
.hdr-hp     { color: var(--red);  font-size: 0.82rem; }
.hdr-silver { color: var(--gold); font-size: 0.88rem; }
.hdr-gold   { color: var(--r-unique); font-size: 0.88rem; display: flex; align-items: center; gap: 3px; }
.gold-icon  { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }

.hamburger-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 2px 6px;
  font-family: inherit;
  flex-shrink: 0;
}
.hamburger-btn:hover { color: var(--gold); }

/* ─── SIDEBAR ────────────────────────────────────────────── */

#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100vh;
  background: var(--panel);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
#sidebar.open { transform: translateX(0); }

#sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
#sidebar-overlay.visible { opacity: 1; pointer-events: all; }

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  font-family: inherit;
  flex-shrink: 0;
}
.sidebar-close-btn:hover { color: var(--text); }

.sidebar-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.sb-char-name {
  color: var(--gold);
  font-weight: bold;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-realm { color: var(--muted); font-size: 0.75rem; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  flex: 1;
}

.nav-item {
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  padding: 10px 16px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  text-align: left;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.nav-item:hover:not(:disabled) { color: var(--gold); background: rgba(201,168,76,0.07); }
.nav-item.active { color: var(--gold); border-left-color: var(--gold); background: rgba(201,168,76,0.08); }
.nav-item.locked, .nav-item:disabled { color: var(--border); cursor: not-allowed; }
.nav-logout { color: var(--muted); }
.nav-logout:hover { color: var(--red) !important; background: rgba(217,64,64,0.07) !important; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 16px;
}

/* ─── PAGE CONTENT ───────────────────────────────────────── */

.page-content { flex: 1; padding: 16px; padding-bottom: 80px; }
.page { animation: fadein 0.1s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ─── PROFILE CARD ───────────────────────────────────────── */

.profile-card {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 0;
}

.profile-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar svg { width: 100%; height: 100%; display: block; }

.profile-name {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--gold);
  letter-spacing: 2px;
}

.profile-realm {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 10px;
  margin-top: -10px;
}

.profile-stats {
  display: flex;
  gap: 10px;
}

.stat-box {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 10px;
  text-align: center;
}
.stat-value { font-size: 1.1rem; color: var(--text); font-weight: bold; margin-bottom: 4px; }
.stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.profile-hp { display: flex; flex-direction: column; gap: 4px; }

.profile-location {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.85rem;
}
.profile-loc-label { color: var(--muted); flex-shrink: 0; }
.profile-loc-name  { color: var(--text); }

/* ─── PROFILE BUTTON ROW ─────────────────────────────────── */

.profile-btn-row {
  display: flex;
  gap: 8px;
}

.profile-action-btn {
  flex: 1;
}

/* ─── MODAL ──────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  padding: 0 4px;
  line-height: 1;
}
.modal-close-btn:hover { color: var(--text); }

.modal-body {
  overflow-y: auto;
  flex: 1;
}

/* ─── SKILL MODAL ROWS ───────────────────────────────────── */

.skill-modal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.skill-modal-row:last-child { border-bottom: none; }

.smr-icon {
  font-size: 1.3rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.smr-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.smr-name { font-size: 0.88rem; color: var(--text); }
.smr-xp   { font-size: 0.78rem; color: var(--muted); }

/* ─── SECTION TITLE ─────────────────────────────────────── */

.section-title {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 16px 0 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.section-title:first-child { margin-top: 0; }

/* ─── BATTLE AREAS — CAPSULE ACCORDION ───────────────────── */

.area-list { display: flex; flex-direction: column; gap: 10px; }

.area-capsule {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.area-capsule[data-area] .area-capsule-header {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.area-capsule[data-area]:not(.open) .area-capsule-header:hover {
  background: rgba(201,168,76,0.05);
}

.area-capsule.open {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(201,168,76,0.15);
}

.area-capsule-header {
  text-align: center;
  padding: 16px 18px;
}

.area-capsule-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 3px;
  letter-spacing: 0.01em;
}

.area-capsule-sub {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.area-capsule.open .area-capsule-name { color: var(--gold); }
.area-capsule.open .area-capsule-header { border-bottom: 1px solid var(--border); }

.area-body {
  padding: 4px 0 6px;
}

.area-body .enemy-card {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  margin: 0;
  padding: 12px 18px;
}
.area-body .enemy-list > .enemy-card:first-child { border-top: none; }

.area-body-empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 18px;
  font-size: 0.85rem;
}

.area-capsule-locked {
  opacity: 0.55;
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0,
      transparent 12px,
      rgba(0,0,0,0.18) 12px,
      rgba(0,0,0,0.18) 13px
    ),
    var(--panel);
}
.area-capsule-locked .area-capsule-header { cursor: not-allowed; }
.area-capsule-locked .area-capsule-name {
  color: var(--muted);
  font-weight: 600;
}
.area-capsule-locked .area-capsule-sub {
  font-style: italic;
}

.enemy-list { display: flex; flex-direction: column; gap: 8px; }

.enemy-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.enemy-info  { flex: 1; display: flex; gap: 10px; align-items: baseline; }
.enemy-name  { font-weight: bold; }
.enemy-level { color: var(--muted); font-size: 0.8rem; }
.enemy-stats  { display: grid; grid-template-columns: 5em 5em 5em; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.enemy-stats span { text-align: right; }
.enemy-kills  { color: var(--border); }

/* ─── COMBAT ─────────────────────────────────────────────── */

.no-combat { text-align: center; padding: 40px 20px; }
.no-combat p { color: var(--muted); }
.out-hp-wrap { margin: 16px auto; max-width: 280px; }
.out-hp-label { font-size: 0.82rem; color: var(--red); display: block; margin-bottom: 4px; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 10px; }

.combat-arena {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.combatant {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 16px;
}
.combatant-name { font-weight: bold; margin-bottom: 6px; }
.combatant-lvl  { color: var(--muted); font-size: 0.78rem; font-weight: normal; }
.bar-label { font-size: 0.78rem; color: var(--muted); margin-bottom: 3px; margin-top: 6px; }

.vs-divider { text-align: center; color: var(--border); font-size: 1.1rem; }

.combat-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}


/* ─── BARS ───────────────────────────────────────────────── */

.bar-track {
  background: #0d0d1a;
  border: 1px solid var(--border);
  border-radius: 3px;
  height: 8px;
  overflow: hidden;
}
.bar-fill   { height: 100%; border-radius: 2px; transition: width 0.18s ease; }
.hp-bar     { background: var(--red); }
.shield-bar { background: var(--blue); }
.xp-bar     { background: var(--teal); }

/* ─── SKILLS ─────────────────────────────────────────────── */

.skills-list { display: flex; flex-direction: column; gap: 12px; }

.skill-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 16px;
}
.skill-hdr  { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.skill-name { font-weight: bold; color: var(--gold); }
.skill-lvl  { font-size: 0.82rem; color: var(--teal); }
.skill-max  { color: var(--gold); font-size: 0.72rem; }
.skill-desc { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.xp-label   { font-size: 0.75rem; color: var(--muted); margin-bottom: 3px; }

/* ─── INVENTORY ──────────────────────────────────────────── */

.empty-note    { color: var(--muted); font-style: italic; padding: 10px 0; }
.inv-size-note { font-size: 0.78rem; color: var(--muted); margin-bottom: 10px; }

.inv-list { display: flex; flex-direction: column; gap: 4px; }
.inv-row  {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 4px; padding: 8px 10px; font-size: 0.83rem;
  cursor: pointer; transition: border-color 0.1s;
}
.inv-row:hover   { border-color: var(--gold); }
.inv-name        { flex: 1; }
.inv-qty         { color: var(--muted); font-size: 0.78rem; min-width: 28px; text-align: right; }
.inv-chevron     { color: var(--border); font-size: 1rem; line-height: 1; }

.eq-list      { display: flex; flex-direction: column; gap: 4px; }
.eq-slot      { display: flex; align-items: center; gap: 8px; font-size: 0.83rem; padding: 4px 0; }
.eq-label     { color: var(--muted); width: 80px; flex-shrink: 0; }
.eq-item-name { flex: 1; }
.eq-stat      { color: var(--muted); font-size: 0.75rem; }
.eq-empty     { color: var(--border); flex: 1; }

/* ─── MARKET ─────────────────────────────────────────────── */

.market-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.market-tab  {
  background: none; border: none; color: var(--muted);
  padding: 7px 14px; cursor: pointer; font-size: 0.88rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.market-tab.active        { color: var(--gold); border-bottom-color: var(--gold); }
.market-tab:hover:not(.active) { color: var(--text); }

.market-content { display: flex; flex-direction: column; gap: 8px; }

.market-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 14px; gap: 12px;
}
.market-item.locked { opacity: 0.5; }
.market-item.owned  { border-color: var(--teal); }

.market-item-info { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.market-item-name { font-weight: bold; font-size: 0.9rem; }
.market-item-desc { font-size: 0.8rem; color: var(--muted); }
.market-item-req  { font-size: 0.76rem; color: var(--r-uncommon); }

.market-item-right  { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 96px; }
.market-item-cost   { font-size: 0.83rem; color: var(--gold); }
.market-btn-owned   { color: var(--teal) !important; cursor: default; }

/* ─── GOLD MARKET — FarmRPG list style ───────────────────── */

.gm-cat-label {
  font-size: 0.72rem; font-weight: bold; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
  margin: 12px 0 4px;
}
.gm-cat-label:first-child { margin-top: 0; }

.gm-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 2px; overflow: hidden;
}

.gm-list { list-style: none; margin: 0; padding: 0; }

.gm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.gm-row:last-child { border-bottom: none; }
.gm-row.gm-locked  { opacity: 0.45; }
.gm-row.gm-owned   { background: rgba(51, 187, 119, 0.04); }

.gm-icon {
  font-size: 1.25rem; width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--teal); border-radius: 6px;
  background: rgba(51, 187, 119, 0.08);
}

.gm-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gm-name { font-weight: bold; font-size: 0.87rem; }
.gm-desc { font-size: 0.78rem; color: var(--muted); }
.gm-req  { font-size: 0.73rem; color: var(--r-uncommon); }

.gm-action { flex-shrink: 0; }

.gm-btn { font-size: 0.78rem; padding: 4px 10px; white-space: nowrap; }
.gm-btn-owned  { color: var(--teal) !important; border-color: var(--teal) !important; cursor: default; }
.gm-btn-locked { opacity: 0.7; }
.gm-btn-buy    { display: flex; align-items: center; gap: 4px; }

/* ─── VENDOR ─────────────────────────────────────────────── */

.vendor-section       { margin-bottom: 18px; }
.vendor-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.vendor-section-title { font-weight: bold; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.vendor-sell-btns     { flex-direction: row; gap: 4px; }
.vendor-empty         { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 12px 0; }

/* ─── WORKSHOP ───────────────────────────────────────────── */

.recipe-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.recipe-ing {
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.recipe-ing.ok      { color: var(--teal);  border-color: rgba(51,187,119,0.4); }
.recipe-ing.missing { color: var(--muted); }
.recipe-have        { color: var(--muted); }

/* ─── LOOT PILLS ─────────────────────────────────────────── */

#loot-pill-container {
  position: fixed; bottom: 72px; left: 50%;
  pointer-events: none; z-index: 200;
  width: 0; height: 0;
}

.loot-pill {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--teal); color: var(--teal);
  border-radius: 999px; padding: 5px 16px;
  font-size: 0.82rem; font-weight: 600; white-space: nowrap;
  animation: pill-fade 2.4s ease-in-out forwards;
}

.loot-pill-uncommon { border-color: var(--r-uncommon); color: var(--r-uncommon); }
.loot-pill-rare     { border-color: var(--r-rare);     color: var(--r-rare);     }
.loot-pill-epic     { border-color: var(--r-epic);     color: var(--r-epic);     }
.loot-pill-mythical { border-color: var(--r-mythical); color: var(--r-mythical); }
.loot-pill-warning  { border-color: var(--red);        color: var(--red);        }

@keyframes pill-fade {
  0%   { opacity: 0; transform: translateX(-50%); }
  12%  { opacity: 1; transform: translateX(-50%); }
  72%  { opacity: 1; transform: translateX(-50%); }
  100% { opacity: 0; transform: translateX(-50%); }
}

/* ─── BOTTOM BAR ─────────────────────────────────────────── */

.game-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--panel); border-top: 1px solid var(--border);
  padding: 8px 14px; z-index: 50;
  display: flex; gap: 10px; justify-content: space-between;
}

.footer-chip {
  flex: 1; display: flex; align-items: center;
  gap: 8px; padding: 6px 14px; border-radius: 20px;
  background: var(--panel2); color: var(--text); font-size: 0.8rem;
  min-width: 0; overflow: hidden;
  border: 1px solid var(--border);
}

.footer-chip-icon  { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; }
.footer-chip-content { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.footer-chip-label { font-weight: 600; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.footer-hp-bar  { height: 4px; background: #0d0d1a; border-radius: 2px; overflow: hidden; }
.footer-hp-fill { height: 100%; background: var(--red); border-radius: 2px; transition: width 0.18s ease; }

.footer-chip-btn { cursor: pointer; text-align: left; }
.footer-chip-btn:hover:not(:disabled) { border-color: var(--gold); }
.footer-chip-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── RARITY ─────────────────────────────────────────────── */

.rarity-common   { color: var(--r-common);   }
.rarity-uncommon { color: var(--r-uncommon); }
.rarity-rare     { color: var(--r-rare);     }
.rarity-epic     { color: var(--r-epic);     }
.rarity-mythical { color: var(--r-mythical); }
.rarity-divine   { color: var(--r-divine);   }
.rarity-unique   { color: var(--r-unique);   }

/* ─── COMBAT — ACTIVE ───────────────────────────────────────── */

/* Active skill bar */
.active-skill-bar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
}

.asb-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.asb-info { font-size: 0.88rem; color: var(--text); }
.asb-lvl  { font-size: 0.8rem; color: var(--teal); margin-left: 6px; }
.asb-xp   { font-size: 0.78rem; color: var(--muted); }
.asb-track { height: 6px; }

.combat-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.kill-counter {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.kill-counter span { color: var(--gold); }

/* HP bar with heart icon and text inside */
.player-hp-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
}

.hp-bar-outer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hp-heart { font-size: 1.3rem; flex-shrink: 0; line-height: 1; }

.hp-bar-track-inner {
  flex: 1;
  position: relative;
  background: #0d0d1a;
  border: 1px solid var(--border);
  border-radius: 4px;
  height: 28px;
  overflow: hidden;
}

.hp-bar-fill-inner {
  position: absolute;
  inset: 0;
  background: var(--red);
  border-radius: 3px;
  transition: width 0.18s ease;
  height: 100%;
}

.hp-bar-label-inside {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 1;
}

/* ─── SPEED DISPLAY ──────────────────────────────────────────── */

.speed-display {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.speed-box {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.speed-label {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: bold;
}
.speed-label.enemy { color: var(--red); }

.speed-track { height: 8px; }

@keyframes speed-charge {
  from { width: 0%; }
  to   { width: 100%; }
}

.player-speed-fill {
  background: var(--teal);
  animation: speed-charge linear 1 forwards;
  transition: none;
}
.enemy-speed-fill {
  background: var(--red);
  animation: speed-charge linear 1 forwards;
  transition: none;
}

.speed-hit {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.speed-hit.enemy { color: var(--red); opacity: 0.8; }

/* ─── STANCE ROW ─────────────────────────────────────────────── */

.stance-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stance-btn {
  flex: 1;
  min-width: 80px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 6px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  text-align: center;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.stance-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--text); }
.stance-btn.stance-locked { opacity: 0.3; cursor: not-allowed; }
.stance-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
}

/* ─── SESSION LOOT PANEL ─────────────────────────────────────── */

.session-loot-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
}

.session-loot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.session-loot-title {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.session-loot-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
}

.loot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.83rem;
  padding: 3px 0;
}

.loot-name { flex: 1; }

.loot-qty {
  color: var(--muted);
  font-size: 0.78rem;
  min-width: 30px;
  text-align: right;
}

/* ─── BOTTOM SHEET ───────────────────────────────────────────── */

.bottom-sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}

.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  max-height: 75vh;
  overflow-y: auto;
  z-index: 201;
  max-width: 860px;
  margin: 0 auto;
}

.bottom-sheet-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 10px auto 0;
}

.bottom-sheet-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.bottom-sheet-title {
  font-size: 0.88rem;
  font-weight: bold;
  color: var(--gold);
}

.bottom-sheet-body { padding-bottom: 16px; }

/* ─── SHEET LIST (slot picker / food picker) ──────────────── */

.sheet-list { display: flex; flex-direction: column; }

.sheet-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.sheet-row:last-child { border-bottom: none; }
.sheet-row:hover { background: rgba(201,168,76,0.06); }
.sheet-row-active { border-left: 3px solid var(--gold); padding-left: 15px; }
.sheet-row-danger { color: var(--red); }
.sheet-row-danger:hover { background: rgba(217,64,64,0.06); }

.sheet-row-icon { font-size: 1.2rem; flex-shrink: 0; width: 28px; text-align: center; }
.sheet-row-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sheet-row-name { font-size: 0.88rem; }
.sheet-row-sub  { font-size: 0.75rem; color: var(--muted); }
.sheet-row-qty  { color: var(--muted); font-size: 0.82rem; margin-left: auto; }
.sheet-row-badge { font-size: 0.72rem; color: var(--teal); white-space: nowrap; }
.sheet-empty { padding: 20px 18px; color: var(--muted); font-size: 0.85rem; font-style: italic; }

/* ─── ITEM DETAIL SHEET ───────────────────────────────────── */

.item-detail { display: flex; flex-direction: column; }

.item-detail-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.item-detail-row:last-of-type { border-bottom: none; }
.item-detail-label { color: var(--muted); }
.item-detail-value { color: var(--text); font-weight: bold; }

.item-detail-actions {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.item-detail-modal-title {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--text);
}

/* ─── EQUIPMENT GRID ─────────────────────────────────────── */

.eq-grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.eq-row  { display: flex; gap: 8px; }

.eq-tile {
  flex: 1; min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 4px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer;
  transition: border-color 0.12s;
  text-align: center;
}
.eq-tile:hover         { border-color: var(--gold); }
.eq-tile.eq-tile-empty { opacity: 0.45; }

.eq-tile-icon  { font-size: 1.4rem; line-height: 1; }
.eq-tile-name  {
  font-size: 0.66rem; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 4px;
}
.eq-tile-label { font-size: 0.6rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ─── FOOD BAR (equipment page) ──────────────────────────── */

.eq-food-bar {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 6px; padding: 12px 16px;
  cursor: pointer; font-family: inherit; font-size: 0.85rem; color: var(--text);
  text-align: left;
  transition: border-color 0.12s;
}
.eq-food-bar:hover  { border-color: var(--gold); }
.eq-food-bar.empty  { opacity: 0.55; }
.eq-food-icon       { font-size: 1.2rem; }

/* ─── COMBAT LOG ─────────────────────────────────────────────── */

.combat-log-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 14px;
}

.combat-log-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 160px;
  overflow-y: auto;
}

.log-entry   { font-size: 0.76rem; padding: 2px 0; }
.log-info    { color: var(--muted); }
.log-hit     { color: var(--teal); }
.log-damage  { color: var(--red); }
.log-kill    { color: var(--gold); }
.log-levelup { color: var(--r-rare); font-weight: bold; }
.log-death   { color: var(--red); font-weight: bold; }

/* ─── ENEMY CARD ACTIONS ─────────────────────────────────────── */

.enemy-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.weakness-icon {
  font-size: 1rem;
  opacity: 0.75;
  cursor: help;
  width: 1.6em;
  text-align: center;
  flex-shrink: 0;
}

/* ─── TYPE BADGES (RPS weak / resist) ───────────────────── */
.type-badges {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-shrink: 0;
}

.type-badge {
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 3px;
  cursor: help;
  line-height: 1.4;
}

.type-badge.type-weak {
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--gold);
}

.type-badge.type-resist {
  background: rgba(217, 64, 64, 0.08);
  border: 1px solid rgba(217, 64, 64, 0.2);
  color: #8a4848;
}

/* ─── COUNTERS MODAL ─────────────────────────────────────── */
.modal-counters {
  max-width: 280px;
}

.counters-circle {
  position: relative;
  width: 200px;
  height: 155px;
  margin: 8px auto 4px;
}

.counters-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.ct-node-item {
  position: absolute;
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.25;
  transform: translate(-50%, -50%);
  color: var(--text);
}
.ct-node-item small {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.ct-top { top: 13%; left: 50%;  }
.ct-bl  { top: 76%; left: 22%;  }
.ct-br  { top: 76%; left: 78%;  }

.counters-note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding-bottom: 10px;
}

.hdr-counters-btn {
  font-size: 0.8rem;
  padding: 3px 7px;
}

/* ─── SIDEBAR SKILL ACTIVE INDICATOR ────────────────────── */

.nav-item.nav-mining-active::after {
  content: '●';
  margin-left: auto;
  font-size: 0.55rem;
  color: var(--teal);
  animation: skill-active-pulse 1.6s ease-in-out infinite;
}

@keyframes skill-active-pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1;   }
}

/* ─── MINING ─────────────────────────────────────────────── */

.mining-status {
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.mining-status-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
}

.mining-progress-track {
  height: 10px;
}

.mining-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  /* no transition — updated via requestAnimationFrame */
}

.mining-status-idle {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 0;
  margin-bottom: 10px;
}

.mining-shaft-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.mining-shaft-active {
  border-color: var(--gold) !important;
}

.btn-stop {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  align-self: flex-start;
}

.btn-stop:hover { opacity: 0.85; }

/* ─── OFFLINE SUMMARY MODAL ──────────────────────────────── */

.offline-hero {
  background: linear-gradient(135deg, rgba(201,168,76,0.08) 0%, transparent 70%);
  border: 1px solid rgba(201,168,76,0.18);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  text-align: center;
  margin-bottom: 1.1rem;
}

.offline-hero-time {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 0.3rem;
  text-shadow: 0 0 24px rgba(201,168,76,0.35);
}

.offline-hero-kills {
  font-size: 0.83rem;
  color: var(--muted);
}
.offline-hero-kills strong { color: var(--text); }

.offline-death {
  background: rgba(217,64,64,0.1);
  border: 1px solid rgba(217,64,64,0.25);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  padding: 0.55rem 0.8rem;
  font-size: 0.81rem;
  color: #e07070;
  margin-bottom: 1rem;
}

.offline-section { margin-bottom: 0.9rem; }

.offline-section-hdr {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}
.offline-section-hdr span {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}
.offline-section-hdr::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.offline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.28rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(42,42,66,0.5);
}
.offline-row:last-child { border-bottom: none; }

.offline-xp-val  { color: var(--teal);  font-weight: 600; font-variant-numeric: tabular-nums; font-size: 0.82rem; }
.offline-sil-val { color: var(--gold);  font-weight: 600; font-variant-numeric: tabular-nums; }
.offline-qty-val { color: var(--text);  font-variant-numeric: tabular-nums; }

.offline-empty {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  padding: 0.2rem 0;
}

.offline-claim-btn {
  width: 100%;
  padding: 0.65rem;
  background: var(--gold);
  border: none;
  border-radius: 5px;
  color: #0d0d14;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: opacity 0.15s, transform 0.1s;
}
.offline-claim-btn:hover  { opacity: 0.85; transform: translateY(-1px); }
.offline-claim-btn:active { opacity: 0.7;  transform: translateY(0); }

/* ─── SCROLLBAR ──────────────────────────────────────────── */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
