/* =========================
   QUESTFORGE DASHBOARD CSS
   ========================= */

:root {
  --bg: #0f1116;
  --panel: #181c24;
  --panel-2: #1f2530;
  --line: #2e3644;

  --text: #eef2f7;
  --muted: #aeb7c5;

  --gold: #d7b36a;
  --red: #cf5b5b;
  --blue: #67a5ff;
  --green: #6fcb8b;
  --purple: #b38cff;

  --radius: 16px;
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
}

/* =========================
   BASE
   ========================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: linear-gradient(180deg, #0b0d12, #12161d);
  color: var(--text);
}

/* =========================
   LAYOUT
   ========================= */

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

/* =========================
   TYPOGRAPHY
   ========================= */

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 10px;
  font-weight: 800;
}

.small {
  font-size: 0.9rem;
  color: var(--muted);
}

/* =========================
   TOP BAR
   ========================= */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.title {
  font-size: 1.5rem;
  font-weight: 800;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--muted);
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
}

/* =========================
   HP BLOCK
   ========================= */

.hp-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.hp-main {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(207,91,91,0.3);
  background: rgba(207,91,91,0.08);
}

.hp-current {
  font-size: 2rem;
  font-weight: 900;
}

.hp-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.number-input {
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

/* =========================
   BUTTONS
   ========================= */

.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 8px;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn.red { border-color: var(--red); }
.btn.green { border-color: var(--green); }
.btn.blue { border-color: var(--blue); }

/* =========================
   STATS
   ========================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 800;
}

/* =========================
   DEFENSE STRIP
   ========================= */

.defense-item {
  border-left: 4px solid var(--blue);
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--panel-2);
  border-radius: 10px;
}

/* =========================
   ATTACK BLOCK
   ========================= */

.attack-box {
  border: 1px solid rgba(215,179,106,0.3);
  background: rgba(215,179,106,0.08);
  border-radius: var(--radius);
  padding: 12px;
}

.attack-line {
  font-size: 1.1rem;
  font-weight: 800;
}

/* =========================
   ACTIONS
   ========================= */

.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.action-block {
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.action-btn {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.action-btn:hover {
  border-color: var(--gold);
}

.action-btn.selected {
  border-color: var(--blue);
  background: rgba(103, 165, 255, 0.14);
  box-shadow: 0 0 8px rgba(103, 165, 255, 0.35);
}

.common-actions-panel {
  opacity: 0.92;
}

.common-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.common-action-btn {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  text-align: center;
}

.common-action-btn:hover {
  border-color: var(--gold);
  background: rgba(215, 179, 106, 0.08);
}

.common-action-btn.selected {
  border-color: var(--blue);
  background: rgba(103, 165, 255, 0.14);
  box-shadow: 0 0 8px rgba(103, 165, 255, 0.35);
}

.reaction-strip {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* =========================
   TAGS
   ========================= */

.tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  margin-bottom: 6px;
}

.tag.action { border-color: var(--red); }
.tag.bonus { border-color: var(--blue); }
.tag.reaction { border-color: var(--purple); }
.tag.passive { border-color: var(--green); }
.tag.locked { border-color: var(--gold); }

/* =========================
   CARDS
   ========================= */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel-2);
}

/* =========================
   RESOURCE PIPS
   ========================= */

.pips {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.pip {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #0d1016;
  cursor: pointer;
}

.pip.filled {
  background: var(--gold);
}

.resource-divider {
  height: 1px;
  margin: 20px 0 14px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.10),
    transparent
  );
}
.card + .card {
  margin-top: 8px;
}

/* =========================
   WORLD METER
   ========================= */

.meter {
  display: flex;
  gap: 4px;
  margin: 10px 0;
}

.meter-segment {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0c1015;
}

.meter-segment.active {
  background: var(--gold);
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .actions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .hp-box {
    grid-template-columns: 1fr;
  }
}