/* Guild Master — 중세 판타지 테마 임시 스타일 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a1209;
  --surface: #2c1f0e;
  --border: #5c3d1a;
  --gold: #d4a017;
  --text: #e8d5a3;
  --text-muted: #8c7a55;
  --success: #4caf50;
  --danger: #e53935;
  --rarity-n: #9e9e9e;
  --rarity-r: #42a5f5;
  --rarity-sr: #ab47bc;
  --rarity-ssr: #ffa726;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Georgia", serif;
  min-height: 100vh;
}

/* HUD */
header {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 10px 20px;
  display: flex;
  gap: 30px;
  align-items: center;
}
.hud-item { display: flex; flex-direction: column; align-items: center; }
.hud-label { font-size: 11px; color: var(--text-muted); }
.hud-value { font-size: 18px; font-weight: bold; color: var(--gold); }

/* Tabs */
.tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--border); }
.tab-btn {
  flex: 1; padding: 12px; border: none; background: none;
  color: var(--text-muted); cursor: pointer; font-size: 14px;
}
.tab-btn.active { color: var(--gold); border-bottom: 2px solid var(--gold); }

/* Tab content */
.tab-content { padding: 20px; }
.tab-content.hidden { display: none; }

/* Cards */
.facility-card, .unit-card, .quest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.facility-card h3 { color: var(--gold); margin-bottom: 8px; }
.lv-badge {
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Addons */
.addon-chip {
  display: inline-block;
  background: #3a2a10;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  margin: 2px;
}
.addon-chip.locked { opacity: 0.4; }

/* Buttons */
button {
  background: var(--gold);
  color: #1a1209;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: bold;
  font-size: 13px;
}
button:hover { opacity: 0.85; }
.card-actions { margin-top: 10px; display: flex; gap: 8px; }

/* Quest status */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--border);
}
.status-in_progress .status-badge { background: #1565c0; }
.status-completed .status-badge { background: var(--success); }
.status-failed .status-badge { background: var(--danger); }

/* Gacha */
.gacha-section { margin-bottom: 20px; }
.gacha-section h3 { color: var(--gold); margin-bottom: 10px; }
.result-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.result-card {
  width: 80px; height: 80px;
  border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 11px; text-align: center;
  border: 2px solid transparent;
}
.rarity-n { border-color: var(--rarity-n); background: #2a2a2a; }
.rarity-r { border-color: var(--rarity-r); background: #0d2a3d; }
.rarity-sr { border-color: var(--rarity-sr); background: #2a0d3d; }
.rarity-ssr { border-color: var(--rarity-ssr); background: #3d2000; }
.result-card .rarity { font-weight: bold; font-size: 14px; }

/* Select Modal */
.select-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 900;
}
.select-modal {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  min-width: 280px; max-width: 420px; width: 90%;
  max-height: 70vh;
  display: flex; flex-direction: column;
}
.select-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.select-modal-header h3 { color: var(--gold); font-size: 16px; }
.btn-modal-close {
  background: none; color: var(--text-muted);
  font-size: 16px; padding: 2px 6px;
}
.select-modal-list {
  list-style: none;
  overflow-y: auto;
  padding: 8px 0;
}
.select-modal-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(92,61,26,0.3);
  transition: background 0.15s;
}
.select-modal-item:hover { background: rgba(212,160,23,0.1); }
.select-modal-item:last-child { border-bottom: none; }
.item-label { color: var(--text); font-size: 14px; }
.item-sub { color: var(--text-muted); font-size: 12px; }

/* Unit card extras */
.unit-status { color: var(--text-muted); font-size: 12px; }
.unit-talent { color: var(--gold); font-size: 13px; }

/* Quest extras */
.quest-timer { color: var(--text-muted); font-size: 12px; display: block; margin: 4px 0; }
.quest-unit  { color: var(--text-muted); font-size: 12px; display: block; }

/* Offline popup */
.offline-popup {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.popup-inner {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  min-width: 300px;
}
.popup-inner h2 { color: var(--gold); margin-bottom: 16px; }
.gold-amount { font-size: 28px; color: var(--gold); margin: 10px 0; }
.cap-warning { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

/* Quest slot header */
.quest-slot-header {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: inline-block;
}

/* Facility add button */
.btn-add-facility {
  background: var(--border);
  color: var(--text);
  margin-bottom: 14px;
  width: 100%;
}
.btn-add-facility:hover { background: var(--gold); color: #1a1209; }

/* Disabled button */
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:disabled:hover { opacity: 0.4; }

/* Facility staff display */
.facility-staff { font-size: 13px; color: var(--gold); margin: 4px 0 6px; }
.facility-staff.empty { color: var(--text-muted); }

/* Disabled modal item */
.select-modal-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.select-modal-item.disabled:hover { background: none; }
