/* ============================================================
   CHAO RPG FAMILY
   Extracted from style.css as a safe-first domain split.
   This file owns the main ChaoRPG arena/HUD/subpanel family,
   class/talents/equip/inventory/shop/run-end shells, and
   later authoritative shell/HUD cleanup passes.
============================================================ */

/* ============================================================
   CHAO RPG — BASE
============================================================ */

/* REAL BANNER (image-only, like Class / Race / Karate) */

/* ALL GAME PANELS */
/* ============================================================
   HEADERS (NON-BANNER PANELS ONLY)
============================================================ */

/* ============================================================
   LEGACY BODY CLASS (SAFE TO KEEP — NO BG PANEL NOW)
============================================================ */

.chaorpg-banner-body {
  padding: 8px;
}

.chaorpg-status {
  font-size: 14px;
  color: #ffd86b;
}

/* ============================================================
   CHAO RPG — ARENA (AUTHORITATIVE VISUAL OWNER)
============================================================ */



/* ============================================================
   CHAO RPG — VIEWPORT CLIP (CANVAS + DOM CHAO OVERLAY)
   - Canvas renders the world.
   - Live Chao DOM nodes are positioned in world space and offset by camera.
     When far away, they can go negative/huge; the viewport must clip them.
============================================================ */



.chaorpg-chao-container {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Let clicks pass through unless a child explicitly enables them. */
  pointer-events: none;
}

/* Re-enable pointer events on children (if you ever want to click Chao in RPG). */
.chaorpg-chao-container * {
  pointer-events: auto;
}

.chaorpg-hpbar-outer {
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
  width: 28px;
  height: 4px;
  background: #000;
  border: 1px solid #000;
  pointer-events: none;
}

.chaorpg-hpbar-inner {
  height: 100%;
  background: #44ff66;
  width: 100%;
}

/* ============================================================
   CHAO RPG — ARENA PARTY SIDEBAR
============================================================ */





.chaorpg-party-title {
  font: 16px monospace;
  color: #ffffff;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-align: left;
}

.chaorpg-party-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Mini map (4x4 grid) */
.chaorpg-party-minimap-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;

  padding: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #000;
}

.chaorpg-party-minimap-title {
  font: 12px monospace;
  color: #ffffff;
  letter-spacing: 1px;
  opacity: 0.9;
}

.chaorpg-party-minimap {
  width: 112px;
  height: 112px;
  border: 1px solid #000;
  background: rgba(255, 255, 255, 0.06);
  image-rendering: pixelated;
}





.chaorpg-party-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chaorpg-party-line {
  font: 12px monospace;
  color: #ffffff;
  line-height: 1.1;
}

.chaorpg-party-line.small {
  font-size: 11px;
  color: #d7d7d7;
}

.chaorpg-party-bars {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}



.chaorpg-bar-fill {
  height: 100%;
  width: 0%;
}

.chaorpg-bar.hp .chaorpg-bar-fill {
  background: #00ff66;
}

.chaorpg-bar.mp .chaorpg-bar-fill {
  background: #4aa3ff;
}

.chaorpg-party-slotlabel {
  font: 11px monospace;
  color: #bbbbbb;
  margin-bottom: 2px;
}

/* ============================================================
   CHAO RPG — SKILL HUD
============================================================ */



/* -----------------------------
   Skill slots
----------------------------- */



/* Hotkey label under the icon */


/* Potion count badge */


/* Cooldown overlay */
.skill-slot.cooldown::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  clip-path: inset(calc(var(--cd) * 100%) 0 0 0);
}

/* MP locked */
.skill-slot.disabled {
  filter: grayscale(1) brightness(0.6);
  pointer-events: none;
}

/* -----------------------------
   Key press flash
----------------------------- */

.skill-slot.flash {
  animation: skill-flash 0.15s ease-out;
}

@keyframes skill-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9);
  }
  100% {
    box-shadow: 0 0 8px 4px rgba(255, 255, 255, 0);
  }
}

/* -----------------------------
   HP / MP Gauges
----------------------------- */





.gauge-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
}

.gauge-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  width: 120px;
  text-align: center;
  font-size: 12px;
  line-height: 1;
  color: #fff;
  text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;
  pointer-events: none;
  z-index: 2;
  image-rendering: pixelated;
}

.gauge.hp .gauge-fill {
  background: #ff3a3a;
}

.gauge.mp .gauge-fill {
  background: #3aa8ff;
}

/* ============================================================
   PARTY PANEL
============================================================ */

.chaorpg-party-body {
  padding: 8px;
}

.chaorpg-party-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chaorpg-party-entry {
  display: flex;
  justify-content: space-between;
  padding: 4px 6px;
  background: #252a34;
  border: 1px solid #333;
  font-size: 13px;
}

/* ============================================================
   ACTION PANEL (KEPT — SAFE)
============================================================ */

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

.chaorpg-action-btn {
  background: #3a4254;
  border: 1px solid #555;
  color: #fff;
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
}

.chaorpg-action-btn:hover {
  background: #4a5370;
}

/* ============================================================
   LOG PANEL
============================================================ */

.chaorpg-log-body {
  padding: 6px;
  height: 220px;
  overflow-y: auto;
}

.chaorpg-log-entries {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chaorpg-log-line {
  font-size: 12px;
  color: #ddd;
  background: #232733;
  padding: 4px 6px;
  border-left: 3px solid #ffd86b;
}

/* ============================================================
   CHAO RPG — CLASS SELECT PANEL
============================================================ */

/* =========================
   HEADER
========================= */

/* =========================
   PANEL BODY
========================= */

#rpg-class-panel .panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* =========================
   PLAYER NAME ROW (MP)
========================= */

#rpg-player-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 6px 12px;
  border-bottom: 1px solid #394057;
}

.rpg-player-name {
  text-align: center;
  font-weight: bold;
  color: #ffffff;
}

/* =========================
   CLASS GRID
========================= */

#rpg-class-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px;
}

/* =========================
   CLASS SLOT
========================= */

.rpg-class-slot {
  background: #232733;
  border: 1px solid #394057;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* =========================
   CLASS SELECT ROW
========================= */

.rpg-class-select-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.rpg-class-select-row button {
  background: #3a4254;
  border: 1px solid #555;
  color: #fff;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 14px;
}

.rpg-class-select-row button:hover {
  background: #4a5370;
}

.rpg-class-name {
  min-width: 80px;
  text-align: center;
  font-size: 14px;
  color: #ffd86b;
}

/* =========================
   PORTRAIT
========================= */

.rpg-class-portrait {
  width: 72px;
  height: 72px;
  background: #111;
  border: 1px solid #444;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rpg-class-portrait canvas {
  image-rendering: pixelated;
}

/* =========================
   CHAO NAME
========================= */

.rpg-chao-name {
  font-weight: bold;
  color: #ffffff;
  margin-top: 4px;
}

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

.rpg-class-stats {
  width: 100%;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.3;
  color: #ff4b4b;
  text-align: left;
}

/* =========================
   TALENTS BUTTON (PER SLOT)
   (placed under stats and above Ready in markup)
========================= */

.rpg-talents-open,
.rpg-equip-open,
.rpg-inventory-open {
  width: 100%;
  margin-top: 6px;
  background: #3a4254;
  border: 1px solid #555;
  color: #fff;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
}

.rpg-talents-open:hover,
.rpg-equip-open:hover,
.rpg-inventory-open:hover {
  background: #4a5370;
}

/* ============================================================
   CHAO RPG — EQUIP / INVENTORY PANELS
============================================================ */

.rpg-equip-summary,
.rpg-inventory-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 13px;
}

.rpg-equip-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rpg-equip-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  font-size: 13px;
}

.rpg-equip-slot {
  color: #ffd86b;
}

.rpg-equip-item {
  color: #fff;
  text-align: right;
  word-break: break-word;
}

/* Icon + text layout (Equip + Inventory) */
.rpg-item-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.rpg-item-text {
  text-align: right;
  word-break: break-word;
}

.rpg-item-icon {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  object-fit: contain;
  flex: 0 0 auto;
}

.rpg-inv-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.rpg-inv-equipable {
  cursor: pointer;
}

.rpg-inv-equipable:hover {
  background: rgba(255,255,255,0.08);
}

/* ChaoRPG: DOM overlay equipment sprites on Chao */
.rpg-equip-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.rpg-equip-sprite {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  object-fit: contain;
  pointer-events: none;
}

.rpg-equip-empty,
.rpg-inv-empty {
  padding: 8px 10px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  font-size: 13px;
}

.rpg-inventory-loot-title {
  margin: 6px 0 6px 0;
  font-weight: bold;
  font-size: 13px;
  color: #ffd86b;
}

.rpg-inventory-loot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rpg-inv-move-btn {
  width: 100%;
  padding: 8px 10px;
  margin: 0 0 6px 0;
  background: #26324a;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

/* Per-item export buttons in RPG inventory */
.rpg-inv-move-one {
  margin-left: 8px;
  padding: 4px 6px;
  background: #2a2f3a;
  border: 1px solid #444;
  color: #fff;
  font-family: "Verdana", sans-serif;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
}

.rpg-inv-move-one:hover {
  background: #343b49;
}

.rpg-inv-move-btn:hover {
  background: #334363;
}

.rpg-inv-move-note {
  font-size: 12px;
  opacity: 0.9;
  margin: 0 0 10px 0;
}

.rpg-inv-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  font-size: 13px;
}

.rpg-inv-item {
  color: #fff;
  word-break: break-word;
}

.rpg-inv-qty {
  color: #ff4b4b;
  min-width: 40px;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.rpg-equip-note,
.rpg-inventory-note {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.9;
}

/* =========================
   FOOTER
========================= */

.rpg-class-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid #394057;
  display: flex;
  justify-content: center;
}

#rpg-class-start {
  background: #4a7c59;
  border: 1px solid #6aa07a;
  color: #fff;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}

#rpg-class-start:hover {
  background: #5f9a6f;
}

/* ============================================================
   CHAO RPG — TALENTS PANEL
============================================================ */

#rpg-talents-panel .panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 10px;
}

/* Top info row */
.rpg-talents-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border: 1px solid #394057;
  background: #232733;
  padding: 8px;
  border-radius: 6px;
}

.rpg-talents-top .line {
  font-size: 13px;
  color: #ddd;
}

.rpg-talents-top .label {
  color: #ffffff;
  font-weight: bold;
}

/* TP display */
.rpg-talents-tp {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #394057;
  background: #232733;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
}

.rpg-talents-tp strong {
  color: #ffd86b;
}

/* Tabs */
#rpg-talents-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.rpg-talents-tab {
  background: #3a4254;
  border: 1px solid #555;
  color: #fff;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 13px;
}

.rpg-talents-tab:hover {
  background: #4a5370;
}

.rpg-talents-tab.active {
  border-color: #ffd86b;
  color: #ffd86b;
}

/* List */
#rpg-talents-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rpg-talents-empty {
  font-size: 13px;
  color: #bbb;
  padding: 10px;
  border: 1px dashed #394057;
  border-radius: 6px;
}

/* Row layout */
.rpg-talent-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #394057;
  background: #232733;
  padding: 8px;
  border-radius: 6px;
}

.rpg-talent-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rpg-talent-name {
  font-size: 13px;
  font-weight: bold;
  color: #ffffff;
}

.rpg-talent-desc {
  font-size: 12px;
  color: #d7d7d7;
  line-height: 1.2;
}

.rpg-talent-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  min-width: 140px;
}

.rpg-talent-cost {
  font-size: 12px;
  color: #ffd86b;
}

.rpg-talent-rank {
  font-size: 12px;
  color: #ffffff;
}

.rpg-talent-controls {
  display: flex;
  gap: 6px;
}

.rpg-talent-btn {
  width: 28px;
  height: 24px;
  background: #3a4254;
  border: 1px solid #555;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.rpg-talent-btn:hover {
  background: #4a5370;
}

.rpg-talent-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Footer note */
#rpg-talents-note {
  font-size: 12px;
  color: #bbb;
  border-top: 1px solid #394057;
  padding-top: 8px;
}

