/* ============================================
   GLOBAL RESET & BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a0a url("assets/iron-texture.jpg") repeat;
  background-size: 512px;
  color: #e6e2d3;
  font-family: "Cinzel", serif;
  padding-bottom: 80px;
}

/* ============================================
   LAYOUT CONTAINER
   ============================================ */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

/* ============================================
   HEADER PANEL — PALADIN CHARACTER SHEET
   ============================================ */
.header-panel {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #1a1a1a url("assets/iron-texture.jpg") repeat;
  border: 3px solid #5a4a2f;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(255, 200, 100, 0.15);
  margin-bottom: 1rem;
}

.portrait-frame {
  width: 96px;
  height: 96px;
  border: 4px solid #bfa76f;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(255, 215, 100, 0.3);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-stats {
  flex: 1;
}

.hero-name {
  font-size: 1.2rem;
  color: #f4e7c2;
  text-shadow: 0 0 6px #8b6f3a;
  margin-bottom: 0.5rem;
}

.hero-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.meta-block {
  text-align: center;
}

.meta-label {
  display: block;
  font-size: 0.7rem;
  color: #c9b89a;
}

.meta-value {
  font-size: 1rem;
  font-weight: bold;
  color: #f4e7c2;
}

/* ============================================
   XP BAR — BLOOD RED WITH GOLD TRIM
   ============================================ */
.xp-bar-frame {
  width: 100%;
  height: 12px;
  background: #3a1a1a;
  border: 2px solid #bfa76f;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7a0000, #d10000);
  transition: width 0.3s ease-out;
}

.xp-bar-text {
  font-size: 0.75rem;
  color: #c9b89a;
  display: flex;
  justify-content: space-between;
}

/* ============================================
   PANELS (EXPORT, LEDGER, LOOT)
   ============================================ */
.panel {
  background: #1a1a1a url("assets/iron-texture.jpg") repeat;
  border: 3px solid #5a4a2f;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 12px rgba(255, 200, 100, 0.1);
}

/* ============================================
   BUTTONS — IRON + GOLD
   ============================================ */
.btn-iron {
  background: #3a2f1f;
  border: 2px solid #bfa76f;
  color: #f4e7c2;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: "Cinzel", serif;
  cursor: pointer;
  transition: 0.2s;
}

.btn-iron:hover {
  background: #4a3a26;
}

.btn-import input {
  display: none;
}

.btn-holy {
  width: 100%;
  background: #bfa76f;
  color: #1a1a1a;
  border: 2px solid #e6d7a8;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.btn-holy:hover {
  background: #d8c48a;
}

/* ============================================
   LEDGER — WEEKLY XP DUNGEON LOG
   ============================================ */
.ledger-header {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  color: #f4e7c2;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.ledger-body {
  display: none;
  margin-top: 0.5rem;
}

.ledger-body.open {
  display: block;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.ledger-table th,
.ledger-table td {
  padding: 0.25rem;
  border-bottom: 1px solid #4a3a26;
  text-align: right;
}

.ledger-table th:first-child,
.ledger-table td:first-child {
  text-align: left;
}

.ledger-bars {
  display: flex;
  gap: 0.25rem;
  height: 40px;
  margin-bottom: 0.5rem;
}

.ledger-bar {
  flex: 1;
  background: #2a1a1a;
  border: 1px solid #5a4a2f;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.ledger-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #d10000, #7a0000);
  height: 0%;
  transition: height 0.3s ease-out;
}

.ledger-bar-label {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: #e6e2d3;
}

.ledger-summary {
  font-size: 0.75rem;
  color: #c9b89a;
}

/* ============================================
   QUEST LOG — SCROLL‑STYLE CARDS
   ============================================ */
.quest-section {
  background: #2a2418 url("assets/parchment.jpg") repeat;
  border: 3px solid #5a4a2f;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4);
}

.quest-title {
  font-size: 1rem;
  color: #f4e7c2;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 4px #8b6f3a;
}

.quest-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quest-item {
  font-size: 0.85rem;
  color: #e6e2d3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quest-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #bfa76f;
}

/* ============================================
   LOOT GRID — PRODUCT CARDS
   ============================================ */
.loot-title {
  font-size: 1rem;
  color: #f4e7c2;
  margin-bottom: 0.5rem;
}

.loot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.loot-card {
  display: flex;
  gap: 0.5rem;
  background: #1a1a1a;
  border: 2px solid #5a4a2f;
  border-radius: 6px;
  padding: 0.5rem;
}

.loot-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 2px solid #bfa76f;
  border-radius: 4px;
}

.loot-info {
  flex: 1;
}

.loot-name {
  font-size: 0.85rem;
  font-weight: bold;
  color: #f4e7c2;
}

.loot-meta {
  font-size: 0.75rem;
  color: #c9b89a;
}

.loot-link {
  font-size: 0.75rem;
  color: #d8c48a;
  text-decoration: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer-panel {
  position: sticky;
  bottom: 0;
  background: #0a0a0a;
  padding: 1rem 0;
  text-align: center;
}

.btn-save {
  width: 100%;
}