/* ============================================================
   HUD
   ============================================================ */

#hud {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(20,14,8,0.85), rgba(10,7,4,0.95));
  border-top: 2px solid #8a6d2b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
  pointer-events: none;
}

.hud-stat {
  text-align: center;
  color: #e8d5b7;
  font-size: 0.9rem;
}

.hud-stat .value {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

.hud-stat .value.hp { color: #c44; }
.hud-stat .value.gold { color: #c9a84c; }
.hud-stat .value.level { color: #7cafc2; font-size: 1.4rem; }
.hud-stat .value.ac { color: #a8a8a8; }

/* XP Bar */
.hud-level-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
}

#xp-bar {
  width: 100%;
  height: 6px;
  background: #1a140c;
  border: 1px solid #5a4520;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}

#xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8a6d2b, #c9a84c, #f0d878);
  border-radius: 3px;
  transition: width 0.3s ease;
}

#xp-label {
  font-size: 0.55rem;
  color: #8a6d2b;
  margin-top: 1px;
}

/* Pending ability points indicator */
.hud-ability-indicator {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(201, 168, 76, 0.2);
  border: 1px solid #c9a84c;
  color: #f0d878;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 4px;
  animation: pulse 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 101;
}

/* ============================================================
   MESSAGES
   ============================================================ */

#messages {
  position: fixed;
  bottom: 90px;
  left: 1rem;
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}

.msg {
  color: #e8d5b7;
  font-size: 0.85rem;
  text-shadow: 0 1px 3px #000;
  opacity: 1;
  transition: opacity 0.5s;
}

.msg.combat { color: #c44; }
.msg.loot { color: #c9a84c; }
.msg.info { color: #7cafc2; }
.msg.fading { opacity: 0; }

/* ============================================================
   INTERACTION PROMPT
   ============================================================ */

#interaction-prompt {
  position: fixed;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 60px);
  color: #c9a84c;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 50;
}

#interaction-prompt.visible {
  opacity: 1;
}

/* ============================================================
   TITLE SCREEN
   ============================================================ */

#title-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0a0806;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #e8d5b7;
  cursor: default;
  padding: 1rem;
}

#title-screen h1 {
  font-family: 'Cinzel', serif;
  font-size: 4rem;
  background: linear-gradient(180deg, #f0d878, #c9a84c, #8a6d2b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

#title-screen .sub {
  font-size: 1rem;
  color: #8a6d2b;
  letter-spacing: 0.3em;
  margin-bottom: 2rem;
  text-align: center;
}

/* Title buttons */
.title-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.btn-parchment {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  padding: 0.6rem 2rem;
  min-height: 44px;
  min-width: 120px;
  border: 2px solid #8a6d2b;
  border-radius: 4px;
  background: linear-gradient(180deg, #3a2a14, #2a1c0c);
  color: #e8d5b7;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s, border-color 0.2s;
  pointer-events: auto;
}

.btn-parchment:hover {
  background: linear-gradient(180deg, #4a3a24, #3a2c1c);
  border-color: #c9a84c;
  color: #f0d878;
}

.btn-parchment:active {
  background: linear-gradient(180deg, #2a1c0c, #1a0e04);
}

#title-screen .prompt {
  font-size: 1.2rem;
  animation: pulse 2s ease-in-out infinite;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

#title-screen .controls {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: #665533;
  text-align: center;
  line-height: 1.8;
}

/* Title changelog */
.title-changelog {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin: 1rem 0 0.5rem;
  max-width: 400px;
}

.changelog-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a6d2b;
  margin-bottom: 4px;
}

.changelog-item {
  font-size: 0.75rem;
  color: #665533;
  line-height: 1.4;
}

/* Title links */
.title-links {
  margin-top: 0.8rem;
  font-size: 0.75rem;
}
.title-links a {
  color: #8a6d2b;
  text-decoration: none;
}
.title-links a:hover {
  color: #c9a84c;
}

/* Title version */
.title-version {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  font-size: 0.65rem;
  color: #443322;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.1em;
}

/* Show desktop controls by default, hide touch controls */
.controls-touch { display: none; }
.controls-desktop { display: block; }

/* On touch-primary devices, swap */
@media (pointer: coarse) {
  .controls-touch { display: block; }
  .controls-desktop { display: none; }
}

/* ============================================================
   DEATH SCREEN
   ============================================================ */

#death-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #c44;
  cursor: default;
  padding: 1rem;
}

#death-screen h1 {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  margin-bottom: 1rem;
}

#death-screen .prompt {
  color: #e8d5b7;
  font-size: 1.1rem;
  animation: pulse 2s ease-in-out infinite;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem;
}

#death-screen .stats {
  color: #8a6d2b;
  margin-top: 1rem;
  text-align: center;
  line-height: 1.8;
}

/* ============================================================
   TOUCH CONTROLS
   ============================================================ */

#touch-controls {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: auto;
  touch-action: none;
}

.touch-joystick-base {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.15);
  border: 2px solid rgba(201, 168, 76, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.touch-joystick-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(240, 216, 120, 0.6), rgba(201, 168, 76, 0.4));
  border: 1px solid rgba(201, 168, 76, 0.5);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.3);
  will-change: transform;
}

/* ============================================================
   PANEL SYSTEM
   ============================================================ */

#panels-container {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100%;
  background: linear-gradient(135deg, #1a140c 0%, #2a1c0c 50%, #1a140c 100%);
  border-left: 2px solid #8a6d2b;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.7);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  pointer-events: auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 151;
}

.panel.panel-open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #5a4520;
}

.panel-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: #f0d878;
  margin: 0;
}

.panel-close {
  background: none;
  border: 1px solid #5a4520;
  color: #e8d5b7;
  font-size: 1.6rem;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}

.panel-close:hover {
  color: #f0d878;
  border-color: #c9a84c;
}

/* ============================================================
   EQUIPMENT SLOTS — paper doll layout
   ============================================================ */

#equipment-slots {
  padding: 0.8rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.equip-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.equip-slot {
  width: 56px;
  height: 56px;
  background: rgba(138, 109, 43, 0.1);
  border: 1px solid #5a4520;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}

.equip-slot:hover {
  border-color: #c9a84c;
  background: rgba(138, 109, 43, 0.2);
}

.equip-slot-empty {
  width: 56px;
  height: 56px;
}

.equip-slot-label {
  font-size: 0.5rem;
  color: #665533;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.equip-slot-filled {
  background: rgba(138, 109, 43, 0.2);
  border-color: #8a6d2b;
}

.equip-slot-valid {
  border-color: #c9a84c;
  background: rgba(201, 168, 76, 0.15);
  box-shadow: 0 0 6px rgba(201, 168, 76, 0.3);
}

.equip-item-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 3px rgba(201, 168, 76, 0.4));
  pointer-events: none;
}

/* ============================================================
   INVENTORY GRID
   ============================================================ */

#inventory-grid {
  padding: 0.8rem 1.2rem;
  display: grid;
  grid-template-columns: repeat(8, 48px);
  grid-template-rows: repeat(4, 48px);
  gap: 2px;
  justify-content: center;
}

.inv-cell {
  width: 48px;
  height: 48px;
  background: rgba(10, 8, 6, 0.6);
  border: 1px solid #3a2a14;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.inv-cell:hover {
  border-color: #8a6d2b;
  background: rgba(138, 109, 43, 0.1);
}

.inv-cell-occupied {
  background: rgba(138, 109, 43, 0.08);
  border-color: #5a4520;
}

.inv-cell-item-origin {
  overflow: visible;
}

.inv-item-icon {
  font-size: 1.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.3));
  pointer-events: none;
  z-index: 2;
}

.inv-stack-badge {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 0.6rem;
  color: #f0d878;
  background: rgba(10, 8, 6, 0.85);
  border: 1px solid #5a4520;
  border-radius: 3px;
  padding: 0 3px;
  pointer-events: none;
  z-index: 3;
}

.inv-grid-holding .inv-cell:hover {
  border-color: #c9a84c;
  background: rgba(201, 168, 76, 0.15);
}

/* ============================================================
   ITEM TOOLTIP
   ============================================================ */

#item-tooltip {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 8, 6, 0.95);
  border: 1px solid #8a6d2b;
  border-radius: 6px;
  padding: 0.8rem 1rem;
  max-width: 300px;
  min-width: 180px;
  z-index: 160;
  pointer-events: none;
}

#item-tooltip.hidden {
  display: none;
}

.tooltip-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: #f0d878;
  margin-bottom: 4px;
}

.tooltip-category {
  font-size: 0.7rem;
  color: #665533;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.tooltip-stats {
  font-size: 0.8rem;
  color: #7cafc2;
  margin-bottom: 6px;
}

.tooltip-desc {
  font-size: 0.75rem;
  color: #a8967a;
  line-height: 1.4;
  margin-bottom: 4px;
}

.tooltip-stack {
  font-size: 0.7rem;
  color: #8a6d2b;
}

/* ============================================================
   SHOP PANEL
   ============================================================ */

.shop-header {
  padding: 0.8rem 1.2rem;
  text-align: center;
  border-bottom: 1px solid #5a4520;
}

.shop-gold {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: #c9a84c;
  font-weight: 700;
}

.shop-coin {
  font-size: 1em;
  margin-right: 2px;
}

.shop-stock-list {
  padding: 0.4rem 0.8rem;
  overflow-y: auto;
  max-height: 40vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-empty {
  text-align: center;
  color: #665533;
  padding: 1rem;
  font-style: italic;
}

.shop-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(138, 109, 43, 0.06);
  border: 1px solid #3a2a14;
  border-radius: 4px;
  transition: background 0.15s, border-color 0.15s;
}

.shop-item-row:hover {
  background: rgba(138, 109, 43, 0.15);
  border-color: #8a6d2b;
}

.shop-item-dim {
  opacity: 0.45;
}

.shop-item-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
  filter: drop-shadow(0 0 3px rgba(201, 168, 76, 0.3));
}

.shop-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shop-item-name {
  color: #e8d5b7;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-item-stat {
  color: #7cafc2;
  font-size: 0.7rem;
}

.shop-item-qty {
  color: #665533;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.shop-item-price {
  color: #c9a84c;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}

.shop-btn-buy {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  padding: 3px 10px;
  min-height: 28px;
  border: 1px solid #8a6d2b;
  border-radius: 3px;
  background: linear-gradient(180deg, #4a3a14, #3a2a0c);
  color: #f0d878;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.shop-btn-buy:hover {
  background: linear-gradient(180deg, #5a4a24, #4a3a1c);
  border-color: #c9a84c;
}

.shop-btn-buy.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.shop-divider {
  padding: 0.5rem 1.2rem;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  color: #8a6d2b;
  text-align: center;
  border-top: 1px solid #5a4520;
  border-bottom: 1px solid #3a2a14;
  letter-spacing: 0.1em;
}

.shop-inventory-grid {
  padding: 0.6rem 1.2rem;
  display: grid;
  grid-template-columns: repeat(8, 36px);
  grid-template-rows: repeat(4, 36px);
  gap: 2px;
  justify-content: center;
}

.shop-inv-cell {
  width: 36px;
  height: 36px;
  background: rgba(10, 8, 6, 0.6);
  border: 1px solid #3a2a14;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.shop-inv-cell-occupied {
  background: rgba(138, 109, 43, 0.08);
  border-color: #5a4520;
}

.shop-inv-cell-occupied:hover {
  border-color: #c9a84c;
  background: rgba(201, 168, 76, 0.15);
}

.shop-inv-cell-selected {
  border-color: #c9a84c;
  background: rgba(201, 168, 76, 0.25);
  box-shadow: 0 0 6px rgba(201, 168, 76, 0.4);
}

.shop-inv-icon {
  font-size: 1.1rem;
  pointer-events: none;
  filter: drop-shadow(0 0 3px rgba(201, 168, 76, 0.3));
}

.shop-inv-stack {
  position: absolute;
  bottom: 0;
  right: 1px;
  font-size: 0.55rem;
  color: #f0d878;
  background: rgba(10, 8, 6, 0.85);
  border: 1px solid #5a4520;
  border-radius: 2px;
  padding: 0 2px;
  pointer-events: none;
}

.shop-sell-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.6rem 1rem;
  background: rgba(138, 109, 43, 0.1);
  border-top: 1px solid #5a4520;
  color: #e8d5b7;
  font-size: 0.85rem;
}

.shop-btn-sell {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  padding: 3px 12px;
  min-height: 28px;
  border: 1px solid #8a6d2b;
  border-radius: 3px;
  background: linear-gradient(180deg, #4a3a14, #3a2a0c);
  color: #f0d878;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.shop-btn-sell:hover {
  background: linear-gradient(180deg, #5a4a24, #4a3a1c);
  border-color: #c9a84c;
}

.shop-btn-cancel {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  padding: 3px 10px;
  min-height: 28px;
  border: 1px solid #5a4520;
  border-radius: 3px;
  background: linear-gradient(180deg, #2a1c0c, #1a0e04);
  color: #a8967a;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.shop-btn-cancel:hover {
  border-color: #8a6d2b;
  color: #e8d5b7;
}

/* ============================================================
   INVENTORY HUD BUTTON (touch / always visible)
   ============================================================ */

.btn-inventory-hud {
  position: fixed;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 110;
  width: 44px;
  height: 44px;
  background: linear-gradient(180deg, #3a2a14, #2a1c0c);
  border: 2px solid #8a6d2b;
  border-radius: 6px;
  font-size: 1.3rem;
  color: #e8d5b7;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: border-color 0.2s;
}

.btn-inventory-hud:hover {
  border-color: #c9a84c;
}

/* ============================================================
   MOBILE RESPONSIVE — small screens
   ============================================================ */

@media (max-width: 500px) {
  #hud {
    height: 60px;
    padding: 0 0.75rem;
  }

  .hud-stat {
    font-size: 0.7rem;
  }

  .hud-stat .value {
    font-size: 1.3rem;
  }

  #messages {
    bottom: 68px;
    left: 0.5rem;
    right: 0.5rem;
    max-width: 60%;
  }

  .msg {
    font-size: 0.75rem;
  }

  #title-screen h1 {
    font-size: 2.5rem;
  }

  #title-screen .sub {
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
  }

  #title-screen .controls {
    font-size: 0.7rem;
  }

  #death-screen h1 {
    font-size: 2rem;
  }

  /* Panel: slide from bottom on mobile */
  .panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: 80vh;
    border-left: none;
    border-top: 2px solid #8a6d2b;
    transform: translateY(100%);
  }

  .panel.panel-open {
    transform: translateY(0);
  }

  /* Larger grid cells on mobile for touch targets */
  #inventory-grid {
    grid-template-columns: repeat(8, 40px);
    grid-template-rows: repeat(4, 40px);
    padding: 0.5rem;
  }

  .inv-cell {
    width: 40px;
    height: 40px;
  }

  .equip-slot {
    width: 48px;
    height: 48px;
  }

  .shop-inventory-grid {
    grid-template-columns: repeat(8, 32px);
    grid-template-rows: repeat(4, 32px);
    padding: 0.4rem;
  }

  .shop-inv-cell {
    width: 32px;
    height: 32px;
  }

  .shop-item-row {
    padding: 5px 6px;
    gap: 6px;
  }

  .shop-stock-list {
    max-height: 30vh;
  }
}

@media (max-width: 350px) {
  .hud-stat .value {
    font-size: 1.1rem;
  }

  #title-screen h1 {
    font-size: 2rem;
  }
}

/* ============================================================
   PORTRAIT vs LANDSCAPE
   ============================================================ */

@media (orientation: portrait) and (max-width: 500px) {
  #messages {
    bottom: 68px;
    max-width: 55%;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  #hud {
    height: 50px;
    padding: 0 1rem;
  }

  .hud-stat .value {
    font-size: 1.2rem;
  }

  #messages {
    bottom: 58px;
  }

  #minimap {
    width: 80px;
    height: 80px;
    top: 0.5rem;
    right: 0.5rem;
  }
}

/* ============================================================
   QUEST / BOUNTY BOARD
   ============================================================ */

#quest-content {
  padding: 0.8rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
  flex: 1;
}

.quest-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quest-section-title {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: #c9a84c;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-bottom: 1px solid #5a4520;
  padding-bottom: 4px;
  margin: 0;
}

.quest-card {
  background: linear-gradient(135deg, rgba(58, 42, 20, 0.6), rgba(42, 28, 12, 0.8));
  border: 1px solid #5a4520;
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quest-card-complete {
  border-color: #c9a84c;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.2);
}

.quest-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quest-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.quest-title {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: #f0d878;
  flex: 1;
}

.quest-stars {
  color: #c9a84c;
  font-size: 0.8rem;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.quest-desc {
  font-size: 0.75rem;
  color: #a8967a;
  line-height: 1.4;
}

.quest-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-progress-bar {
  flex: 1;
  height: 8px;
  background: #1a140c;
  border: 1px solid #5a4520;
  border-radius: 4px;
  overflow: hidden;
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8a6d2b, #c9a84c, #f0d878);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.quest-progress-text {
  font-size: 0.7rem;
  color: #c9a84c;
  font-family: 'Cinzel', serif;
  white-space: nowrap;
}

.quest-rewards {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
}

.quest-reward-gold {
  color: #c9a84c;
}

.quest-reward-xp {
  color: #7cafc2;
}

.quest-action {
  display: flex;
  justify-content: flex-end;
}

.quest-accept-btn {
  font-size: 0.8rem;
  padding: 0.3rem 1rem;
  min-height: 32px;
  min-width: 80px;
}

.quest-claim-btn {
  font-size: 0.8rem;
  padding: 0.3rem 1rem;
  min-height: 32px;
  min-width: 100px;
  border-color: #c9a84c;
  background: linear-gradient(180deg, #4a3a14, #3a2a0c);
  color: #f0d878;
  animation: pulse 2s ease-in-out infinite;
}

.quest-claim-btn:hover {
  background: linear-gradient(180deg, #5a4a24, #4a3a1c);
  border-color: #f0d878;
}

.quest-full-msg {
  font-size: 0.7rem;
  color: #665533;
  font-style: italic;
}

.quest-empty {
  text-align: center;
  color: #665533;
  font-size: 0.85rem;
  padding: 2rem 1rem;
}

/* ============================================================
   STATS / CHARACTER SHEET
   ============================================================ */
.stats-grid {
  padding: 0.5rem;
}

.stats-section {
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(138,109,43,0.3);
}

.stats-section-title {
  font-family: 'Cinzel', serif;
  color: #c9a84c;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.15rem 0;
  font-size: 0.8rem;
  color: #e8d5b7;
}

.stats-label {
  color: #a89070;
}

.stats-value {
  font-family: 'Cinzel', serif;
  color: #e8d5b7;
}

.stats-mod {
  color: #8a8060;
  font-size: 0.75rem;
}

.stats-pending {
  color: #c9a84c;
  font-size: 0.75rem;
  font-style: italic;
  margin-bottom: 0.3rem;
}

.stats-levelup {
  background: rgba(201,168,76,0.15);
  border: 1px solid #c9a84c;
  color: #c9a84c;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
  text-align: center;
}

.stats-levelup-btn {
  display: block;
  width: 100%;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  padding: 0.4rem;
}

.btn-ability-up {
  background: rgba(201,168,76,0.2);
  border: 1px solid #8a6d2b;
  color: #c9a84c;
  width: 24px;
  height: 24px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  margin-left: 0.4rem;
}

.btn-ability-up:hover {
  background: rgba(201,168,76,0.4);
}

.stats-meta {
  border-bottom: none;
}

.stats-meta .stats-value {
  font-size: 0.75rem;
  color: #8a8060;
}
