/* ============================
   World Panel (root container)
   ============================ */
#world-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0; /* always behind UI panels */
}

#world-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("assets/bg_main.png") no-repeat center center;
  background-size: cover;
  z-index: -1; /* background layer */
}

body {
  background: #0d1b2a;
  color: #fff;
  font-family: sans-serif;
  margin: 0;
  overflow: hidden;
  cursor: none; /* hide OS cursor */
}

/* ============================
   Default for most panels
   ============================ */
.panel {
  position: absolute;
  background: rgba(114, 141, 235, 0.65);
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
  color: #fff;
  background-size: cover;
  background-position: top center;
  cursor: none;
  display: none; /* 🔹 hidden by default, toggled by hotkeys */
}

/* Gardens: always visible */
#garden,
#darkgarden,
#herogarden {
  display: block !important; /* 🔹 force gardens visible */
}

/* Preserve opaque backgrounds for focus + arenas (gardens use images) */
#focus-panel,
#race-arena-panel,
#karate-arena-panel,
#class-arena-panel,
#adventure-arena-panel {
  background: #1b263b;
}

/* ============================
   Banner panels: true pixel sizes + above arenas
   ============================ */
#race-banner-panel {
  width: 498px;
  height: 147px;
  background: url("assets/banners/banner_chaorace.png") no-repeat center center;
  background-size: 100% 100%;
  z-index: 5;
}
#karate-banner-panel {
  width: 482px;
  height: 125px;
  background: url("assets/banners/banner_chaokarate.png") no-repeat center center;
  background-size: 100% 100%;
  z-index: 5;
}
#class-banner-panel {
  width: 497px;
  height: 108px;
  background: url("assets/banners/banner_kindergarten.png") no-repeat center center;
  background-size: 100% 100%;
  z-index: 5;
}
#adventure-banner-panel {
  width: 539px;
  height: 102px;
  background: url("assets/banners/banner_adventure.png") no-repeat center center;
  background-size: 100% 100%;
  z-index: 5;
}

/* ============================
   Panel headers SA2B-style
   ============================ */
.panel h3 {
  font-size: 18px;
  font-weight: bold;
  color: #fffc00;
  text-shadow: 2px 2px 0px #000;
  margin: 0 0 8px 0;
  text-align: center;
  letter-spacing: 1px;
}

/* ============================
   Garden Wrappers (draggable / collide)
   ============================ */
#garden-wrapper,
#darkgarden-wrapper,
#herogarden-wrapper {
  position: absolute;
  display: block; /* ✅ wrappers always present */
  z-index: 1;
  background: transparent;
}

/* Neutral Garden (top-left) */
#garden-wrapper {
  top: 20px;
  left: 20px;
  width: 800px;
  height: 450px;
}

/* Dark Garden (top-right) */
#darkgarden-wrapper {
  top: 20px;
  right: 20px;
  width: 1181px;
  height: 672px;
}

/* Hero Garden (bottom-center) */
#herogarden-wrapper {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 1181px;
  height: 672px;
}

/* ============================
   Gardens (inside wrappers)
   ============================ */
#garden,
#darkgarden,
#herogarden {
  width: 100%;
  height: 100%;
  border: 2px solid #415a77;
  border-radius: 12px;
  cursor: none;
  background-size: cover;
  background-position: center center;
}

/* Neutral Garden */
#garden {
  background: url("assets/bgs/bg_nGarden.png") no-repeat center center;
  background-size: cover;
}

/* Dark Garden */
#darkgarden {
  background: url("assets/bgs/bg_darkGarden.png") no-repeat center center;
  background-size: cover;
}

/* Hero Garden */
#herogarden {
  background: url("assets/bgs/bg_heroGarden.png") no-repeat center center;
  background-size: cover;
}

/* ============================
   Canvases inside gardens
   ============================ */
#garden-canvas,
#darkgarden-canvas,
#herogarden-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* ============================
   Stats + Focus
   ============================ */
.stats-page { display: none; }
.stats-page.active { display: block; }

.stat-block { margin-bottom: 6px; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2px 0;
  font-size: 14px;
}

.stat-name {
  color: #ffffff;
  font-weight: bold;
  text-shadow: 2px 2px 0px #000;
}

.stat-points {
  color: #ffffff;
  font-family: monospace;
  text-shadow: 2px 2px 0px #000;
  min-width: 45px;
  text-align: right;
}

.stat-level {
  color: #fffc00;
  text-shadow: 2px 2px 0px #000;
  font-weight: bold;
  margin-right: 6px;
  min-width: 50px;
  text-align: left;
}

.stat-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: 6px;
}

/* Pixel-Perfect Stat Bars */
.upper-bar {
  width: 194px;
  height: 15px;
  background: #848a83;
  border: 4px solid #000;
  border-bottom: 2px solid #000;
  box-sizing: border-box;
  overflow: hidden;
}
.upper-bar .bar-fill {
  height: 100%;
  width: 0%;
  background: yellow;
  transition: width 0.3s, background-color 0.3s;
}

.lower-bar {
  width: 194px;
  height: 15px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  background: #000;
  border: 4px solid #000;
  border-top: 2px solid #000;
  box-sizing: border-box;
}
.lower-bar .pip {
  background: #848a83;
  height: 100%;
}
.lower-bar .pip.filled { background: #5b63ff; }

/* Grades */
#stats-panel [id$="-grade"] {
  color: #ffd60a;
  font-weight: bold;
}

/* Snap-On Debug Panel (keep this, NOT #debug-panel) */
#stats-debug-panel {
  width: 200px;
  min-height: 120px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
  color: #fff;
  z-index: 1500;
  display: block;
}
#stats-debug-panel h3 {
  font-size: 16px;
  font-weight: bold;
  color: #ffd60a;
  text-shadow: 2px 2px 0px #000;
  margin: 0 0 6px 0;
  text-align: center;
}
#stats-debug-panel p {
  margin: 4px 0;
  font-size: 13px;
}
#debug-output {
  font-size: 12px;
  font-family: monospace;
  white-space: pre;
  background: #0d1b2a;
  border: 1px solid #415a77;
  border-radius: 6px;
  padding: 4px;
  margin-top: 6px;
  max-height: 120px;
  overflow-y: auto;
}

/* ============================
   Journal
   ============================ */
.journal-page { display: none; }
.journal-page.active { display: block; }
#journal-panel .tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}
#journal-panel #journal-adventures {
  color: #ffd60a;
  font-weight: bold;
}

/* ============================
   Trash + Inventory
   ============================ */
#trash-panel h3 img,
#inventory-panel h3 img {
  height: 24px;
  vertical-align: middle;
}
#inventory-panel .tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}
#inventory-panel .tabs button {
  flex: 1;
  padding: 4px;
  background: #415a77;
  border: none;
  border-radius: 6px;
  color: #fff;
    cursor: none;
}
#inventory-panel .tabs button.active {
  outline: 2px solid #ffd60a;
  background: #1b263b;
}
#inventory-panel .grid {
  display: grid;
  grid-template-columns: repeat(3, 60px);
  gap: 5px;
}
#inventory-panel .slot {
  width: 60px;
  height: 60px;
  background: #415a77;
  display: flex;
  align-items: center;
  justify-content: center;
    cursor: none;
}
#inventory-panel .slot.empty { background: #222; }

/* ============================
   Shop
   ============================ */
#shop-panel .tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}
#shop-panel .shop-item {
  padding: 5px;
  background: #415a77;
  margin-bottom: 5px;
    cursor: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
#shop-panel .shop-item img { flex-shrink: 0; }

/* ============================
   Race + Karate Arenas
   ============================ */
#race-canvas,
#race-banner-canvas,
#karate-canvas {
  border: 2px solid #415a77;
  background: #1b263b;
  display: block;
  margin: 10px 0;
}

/* ============================
   Karate Results Panel
   ============================ */
#karate-results-panel {
  position: absolute;
  width: 500px;
  height: 300px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  z-index: 20;
  padding: 20px;
  color: white;
  text-align: center;
}

.results-header {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

.results-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chao-slot {
  width: 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-label {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 6px;
}

.chao-preview img {
  width: 64px;
  height: 64px;
}

.results-footer button {
  padding: 6px 16px;
  background: #ffd60a;
  border: none;
  border-radius: 6px;
  font-weight: bold;
    cursor: none;
}

.results-footer button:hover {
  background: #ffea55;
}

/* ============================
   Race2 Panels
   ============================ */
#race2-banner-panel {
  width: 498px;
  height: 147px;
  background: url("assets/banners/banner_chaorace2.png") no-repeat center center;
  background-size: 100% 100%;
  z-index: 5;
}
#race2-arena-panel {
  width: 1920px;
  height: 462px;
  position: absolute !important;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
}
#race2-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 462px;
  border: 2px solid #415a77;
  z-index: 1;
}
#race2-chao-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
#race2-arena-panel .arena-footer {
  position: absolute;
  bottom: 5px;
  width: 100%;
  text-align: center;
  z-index: 3;
}
#race2-arena-panel .arena-footer button {
  margin: 0 8px;
  padding: 4px 12px;
  background: #ffd60a;
  border: none;
  border-radius: 6px;
  font-weight: bold;
    cursor: none;
}
#race2-arena-panel .arena-footer button:hover {
  background: #ffea55;
}

/* ============================
   Race2 Results Panel
   ============================ */
#race2-results-panel {
  position: absolute;
  width: 800px;
  max-width: 95%;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  z-index: 30;
  padding: 20px;
  color: white;
  text-align: center;
  display: none; /* hidden until race ends */
}
#race2-results-panel h2 {
  font-size: 22px;
  margin-bottom: 15px;
}
#race2-results-list.results-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}
.result-card {
  background: rgba(0,0,0,0.6);
  border: 2px solid #ffd60a;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  width: 100px;
}
.result-card img {
  display: block;
  margin: 0 auto;
  width: 64px;
  height: 64px;
}
.result-label {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
}
.result-name {
  font-size: 13px;
  margin-bottom: 4px;
}
#race2-results-close-btn {
  padding: 6px 16px;
  background: #ffd60a;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: none;
}
#race2-results-close-btn:hover {
  background: #ffea55;
}

/* ============================
   Arena Panels (true sizes)
   ============================ */
#karate-arena-panel {
  width: 500px;
  height: 300px;
  position: relative; /* ✅ Needed for HUD overlay */
}
#race-arena-panel {
  width: 442px;
  height: 133px;
}
#class-arena-panel {
  width: 690px;
  height: 437px;
  position: absolute !important;
}
#adventure-arena-panel {
  width: 480px;
  height: 220px;
}

/* ============================
   Arena Overrides (no ghost box)
   ============================ */
#race-arena-panel,
#race2-arena-panel,
#karate-arena-panel {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* ============================
   Karate HUD Overlay
   ============================ */
#karate-ui-overlay {
  position: absolute;
  top: 10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
  z-index: 10;
}

.fighter-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
}

.fighter-ui .name {
  font-weight: bold;
  font-size: 16px;
  color: white;
  text-shadow: 1px 1px 2px black;
  margin-bottom: 4px;
}

.fighter-ui .hp-bar {
  width: 100px;
  height: 10px;
  background: #333;
  border: 1px solid #000;
  position: relative;
}

.fighter-ui .hp-fill {
  height: 100%;
  background: red;
  width: 100%; /* dynamically updated */
}

/* ============================
   Class Progress
   ============================ */
#class-progress {
  width: 100%;
  height: 20px;
  border: 2px solid #415a77;
  border-radius: 6px;
  background: #222;
  margin-bottom: 6px;
  overflow: hidden;
}
#class-progress-fill {
  height: 100%;
  width: 0%;
  background: #5b63ff;
  transition: width 1s linear;
}
#class-status-box {
  position: absolute;
  right: 10px;
  top: 40px;
  width: 200px;
  padding: 6px;
  background: rgba(0,0,0,0.65);
  border: 2px solid #415a77;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
}
#class-status-box p { margin: 2px 0; }

/* ============================
   Toolbar Panel
   ============================ */
#toolbar-panel {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: inline-flex;      /* ✅ fixes infinite stretch */
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: fit-content;        /* ✅ shrink wrap */
  height: fit-content;       /* ✅ shrink wrap */
  background: transparent;
  border: none;
  padding: 0;
  z-index: 3000 !important;
}

#toolbar-panel button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: #1b263b;
  cursor: none; /* ✅ never show pointer */
  padding: 0;
  flex-shrink: 0;
}

#toolbar-panel button.off {
  opacity: 0.5;
  background: #555;
}

#toolbar-panel button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none; /* ✅ only the button, not the img, takes clicks */
}

#toolbar-panel button.active {
  outline: 2px solid #ffd60a;
  background: #415a77;
}


/* ============================
   Cursor + Wheel
   ============================ */
#cursor {
  position: fixed;
  width: 32px;
  height: 32px;
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 2147483647;
  background-image: url("assets/ui/cursor-select.png");
  image-rendering: pixelated;
}
#cursor-wheel {
  display: none;
  position: fixed;
  width: 100px;
  height: 100px;
  background: url("assets/icons/wheel1.png") no-repeat center center;
  background-size: contain;
  pointer-events: none;
  z-index: 2147483646;
}
#cursor-wheel .quadrant { 
  position: absolute; 
  width: 50%; 
  height: 50%; 
  pointer-events: auto; 
}
#cursor-wheel .quadrant:nth-child(1) { left: 0; top: 0; }
#cursor-wheel .quadrant:nth-child(2) { left: 50%; top: 0; }
#cursor-wheel .quadrant:nth-child(3) { left: 0; top: 50%; }
#cursor-wheel .quadrant:nth-child(4) { left: 50%; top: 50%; }
#cursor-wheel .quadrant:hover { background: rgba(255, 214, 10, 0.2); }


/* ============================
   Debug Panels
   ============================ */
#stats-debug-panel {
  width: 200px;
  min-height: 120px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
  color: #fff;
  z-index: 1500;
  display: block;
}
#stats-debug-panel h3 {
  font-size: 16px;
  font-weight: bold;
  color: #ffd60a;
  text-shadow: 2px 2px 0px #000;
  margin: 0 0 6px 0;
  text-align: center;
}
#stats-debug-panel p {
  margin: 4px 0;
  font-size: 13px;
}
#debug-output {
  font-size: 12px;
  font-family: monospace;
  white-space: pre;
  background: #0d1b2a;
  border: 1px solid #415a77;
  border-radius: 6px;
  padding: 4px;
  margin-top: 6px;
  max-height: 120px;
  overflow-y: auto;
}

/* ============================
   Debug Help Panel
   ============================ */
#debug-help-panel {
  width: 300px;
  min-height: 150px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  z-index: 1600;
  display: block;
  position: absolute;
  top: 20px;
  right: 20px;
}

#debug-help-panel .panel-header {
  font-size: 16px;
  font-weight: bold;
  color: #ffd60a;
  text-shadow: 2px 2px 0px #000;
  margin: 0 0 8px 0;
  text-align: center;
}

#debug-help-panel .panel-content {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 10px;
  max-height: 200px;
  overflow-y: auto;
}

#debug-help-panel .panel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#debug-help-panel .panel-nav button {
  background: #415a77;
  border: none;
  border-radius: 6px;
  color: #fff;
  padding: 4px 10px;
  cursor: none;
  font-weight: bold;
}

#debug-help-panel .panel-nav button:hover {
  background: #5b63ff;
}

#debug-page-indicator {
  font-size: 12px;
  color: #ffd60a;
  text-shadow: 1px 1px 0px #000;
}


/* ============================
   Chao + Items + Eggs
   ============================ */
#chao-container,
#darkchao-container,
#herochao-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}
.chao,
.egg,
.garden-item {
  position: absolute;
  width: 32px;
  height: 32px;
  pointer-events: auto;
  image-rendering: pixelated;
}
.chao-label {
  font-size: 10px;
  text-align: center;
  color: white;
  text-shadow: 1px 1px 2px black;
}
.dot {
  position: absolute;
  top: -6px;
  left: 35%;
  transform: translateX(-50%) scale(2.0);
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}
.garden-item.picked { opacity: 0.7; }

/* ============================
   Focus Panel as Camera Viewport
   ============================ */
#focus-image {
  width: 160px;
  height: 160px;
  overflow: hidden;
  position: relative;
  border: 2px solid #415a77;
  border-radius: 8px;
  background: #000;
}
#focus-image .focus-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 800px;
  height: 450px;
  transform-origin: top left;
}
#focus-details { text-align: center; margin-top: 4px; }

/* ============================
   Chaoregon Trail
   ============================ */
#chaoregon-banner-panel {
  width: 539px;
  height: 102px;
  background: url("assets/banners/banner_chaoregontrail.png") no-repeat center center;
  background-size: 100% 100%;
  z-index: 5;
}
#chaoregon-bg-panel {
  width: 640px;
  height: 360px;
  background-size: cover;
  position: absolute !important;
  display: flex;
  flex-direction: column;
  z-index: 6;
}
#chaoregon-bg-panel .split {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  float: left;
}
#chaoregon-bg-panel .split button {
  font-size: 20px;
  padding: 10px 20px;
}
#chaoregon-log-panel {
  width: 300px;
  height: 200px;
  overflow-y: auto;
}
#chaoregon-wagon {
  text-align: center;
  font-size: 24px;
  margin-bottom: 10px;
}
#chaoregon-away-party {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
}
#chaoregon-away-party .party-slots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  justify-items: center;
  align-items: center;
}
#chaoregon-away-party .party-slots .slot {
  width: 80px;
  height: 80px;
  background: rgba(0,0,0,0.3);
  border: 2px dashed #415a77;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#chaoregon-away-party .party-slots .slot .chao-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ============================
   Chaoregon Footer Controls
   ============================ */
#chaoregon-footer-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-top: 2px solid #ffd60a;
  background: rgba(0,0,0,0.4);
  margin-top: auto; /* pushes it to the bottom of the flex column */
}
#chaoregon-footer-controls button {
  background: #ffd60a;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: none;
  font-weight: bold;
}
#chaoregon-footer-controls button:hover {
  background: #ffea55;
}

/* ============================
   Chaoregon Top Controls
   ============================ */
#chaoregon-top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
#chaoregon-top-controls .mode-toggle {
  display: flex;
  gap: 5px;
}
#chaoregon-top-controls .mode-toggle button {
  background: #333;
  color: #ffd60a;
  border: 2px solid #555;
  padding: 6px 12px;
  cursor: none;
}
#chaoregon-top-controls .mode-toggle button.active {
  background: #ffd60a;
  color: #0d1b2a;
  border: 2px solid #ffd60a;
  font-weight: bold;
}


/* ============================
   Party Hub (main hub)
   ============================ */
#partyhub-panel {
  width: 800px;
  height: 800px;
  max-width: 95%;
  max-height: 95%;
  background: url("assets/ui/partyhub.png") no-repeat center center;
  background-size: cover;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  border: 2px solid #415a77;
  border-radius: 12px;
}
#partyhub-panel.wide {
  width: 1000px;
  max-width: 95%;
}
.party-hub-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 40px;
  position: absolute;
  top: 15%;
  left: 15%;
  right: 15%;
  bottom: 15%;
}
.party-hub-buttons .hub-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 38, 59, 0.7);
  border: 3px solid #ffd60a;
  border-radius: 12px;
  cursor: none;
  transition: transform 0.1s, background 0.2s;
  overflow: hidden;
}
.party-hub-buttons .hub-btn:hover {
  background: rgba(65, 90, 119, 0.9);
  transform: scale(1.08);
}
.party-hub-buttons .hub-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* ============================
   Party Hub Sub-Pages
   ============================ */
#partyhub-panel .party-page {
  width: 100%;
  min-height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  padding: 20px;
  background: rgba(0,0,0,0.5);
  display: none;
  overflow-y: auto;
}
#partyhub-panel .party-page:not(.hidden) { display: block; }
#partyhub-panel .back-btn {
  margin-top: 10px;
  margin-bottom: 20px;
  padding: 6px 12px;
  background: #415a77;
  color: #fff;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  cursor: none;
}
#partyhub-panel .back-btn:hover { background: #5b63ff; }

/* ============================
   Party Scroll Grid (Chao List & Move)
   ============================ */
.party-scroll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #415a77;
  border-radius: 8px;
  background: rgba(0,0,0,0.4);
}
.party-scroll-grid .chao-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  border: 2px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
  cursor: none;
  transition: background 0.2s, border 0.2s;
}
.party-scroll-grid .chao-slot:hover {
  background: rgba(91, 99, 255, 0.2);
  border-color: #5b63ff;
}
.party-scroll-grid .sprite-wrap {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.party-scroll-grid .sprite-wrap img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* ============================
   Party Status Builder
   ============================ */
.party-builder-grid {
  display: grid;
  grid-template-columns: 1fr 260px 200px; /* Available | Formation | Minigames */
  gap: 20px;
  margin-top: 10px;
}
.party-column { flex: 1; }
.chao-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.slot-grid,
#party-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  grid-template-rows: repeat(2, 80px);
  gap: 10px;
  justify-content: center;
  margin: 0 auto;
  background: rgba(0,0,0,0.2);
  border: 1px solid #415a77;
  border-radius: 6px;
  padding: 6px;
}

#party-status {
  width: 1000px;
  height: 1000px;
  max-width: 95%;
  margin: 0 auto;
  overflow-y: auto;
}

#party-status .chao-slot {
  padding: 8px;
  border: 2px solid #415a77;
  border-radius: 8px;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  height: 64px;
    cursor: none;
  transition: background 0.2s, border 0.2s;
}
#party-status .chao-slot.selected {
  border-left: 4px solid #00ccff;
  background-color: rgba(0, 204, 255, 0.1);
}
.slot {
  width: 80px;
  height: 80px;
  background: rgba(0,0,0,0.4);
  border: 2px dashed #415a77;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
}
#send-party-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: #00ccff;
  border: none;
  border-radius: 6px;
  color: #000;
  font-weight: bold;
    cursor: none;
  transition: background 0.2s;
}
#send-party-btn:hover { background: #00e6ff; }

/* Minigame Banners (Party Status) */
#party-minigames {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#party-minigames .minigame-banner {
  padding: 6px;
  font-size: 12px;
  border: 2px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.4);
    cursor: none;
  text-align: center;
  color: #fff;
  font-weight: bold;
}
#party-minigames .minigame-banner.selected {
  border-color: #00ccff;
  background-color: rgba(0, 204, 255, 0.1);
}

/* Active Party List */
#party-status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.status-entry {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: rgba(0,0,0,0.4);
  border: 2px solid #415a77;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  gap: 12px;
}
.status-entry .status-party {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}
.status-entry .status-info {
  min-width: 140px;
  text-align: right;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.status-entry .cancel-btn {
  background: #a02020;
  border: none;
  border-radius: 4px;
  color: #fff;
    cursor: none;
  padding: 4px 8px;
}
.status-entry .cancel-btn:hover { background: #d03030; }

/* ============================
   Party Status Mini Banners
   ============================ */
#party-status-minigames {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#party-status-minigames .minigame-banner {
  border: 2px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.4);
    cursor: none;
  text-align: center;
  overflow: hidden;
  height: 64px;
}
#party-status-minigames .minigame-banner img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

/* ============================
   Party Move Page
   ============================ */
#party-move {
  width: 1000px;
  max-width: 95%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
#party-move .party-tabs {
  margin-bottom: 10px;
}

/* 🔹 FIX: Add tab button styling back */
.party-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}
.party-tabs .tab {
  padding: 6px 12px;
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 6px;
    cursor: none;
  color: #fff;
  font-weight: bold;
  transition: background 0.2s, transform 0.1s;
}
.party-tabs .tab:hover {
  background: #5b63ff;
  transform: scale(1.05);
}
.party-tabs .tab.active {
  background: #ffd60a;
  color: #000;
}
/* 🔹 END FIX */

#party-move .party-scroll-grid {
  max-height: 300px;
}
#party-move .move-center-slot {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border: 2px dashed #ffd60a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
}
#party-move .move-center-slot .chao-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#party-move .move-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
#party-move .move-buttons button {
  padding: 6px 12px;
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  color: #fff;
    cursor: none;
}
#party-move .move-buttons button:hover {
  background: #5b63ff;
}

/* ============================
   Z-Index Hierarchy
   ============================ */
#world-panel { z-index: 0 !important; }
#garden-wrapper,
#darkgarden-wrapper,
#herogarden-wrapper { z-index: 1 !important; }
#chao-container,
#darkchao-container,
#herochao-container { z-index: 2 !important; }
#race-arena-panel,
#race2-arena-panel,
#karate-arena-panel,
#class-arena-panel,
#adventure-arena-panel { z-index: 3 !important; }
#race-banner-panel,
#race2-banner-panel,
#karate-banner-panel,
#class-banner-panel,
#adventure-banner-panel,
#chaoregon-banner-panel { z-index: 4 !important; }
#inventory-panel,
#shop-panel,
#stats-panel,
#focus-panel,
#journal-panel,
#trash-panel,
#partyhub-panel { z-index: 5 !important; }
#stats-debug-panel { z-index: 2000 !important; }
#cursor,
#cursor-wheel { z-index: 2147483647 !important; }

/* ============================
   Utilities
   ============================ */
.hidden { display: none !important; }

/* Party Move: only one button row visible per tab */
.neutral-buttons,
.hero-buttons,
.dark-buttons {
  display: none;
}

/* ============================
   Minigame Styling (Chaoregon)
   ============================ */

/* Tree Shake MG */
.tree-shake-game {
  position: relative;
  width: 320px;
  height: 300px;
  background: url('/assets/camp/forest.png') no-repeat center;
  background-size: cover;
  overflow: hidden;
}
#treeGameZone {
  position: relative;
  width: 100%;
  height: 100%;
}
#chaoCatcher {
  position: absolute;
  bottom: 10px;
  width: 40px;
  height: 40px;
  background-size: contain;
}
.fallingFruit {
  position: absolute;
  width: 24px;
  height: 24px;
  background-size: cover;
}

/* Toy Hunt MG */
.toy-hunt-game {
  text-align: center;
  width: 320px;
  padding: 10px;
  background: url('/assets/camp/clearing.png') no-repeat center;
  background-size: cover;
}
#bushGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.bush {
  font-size: 24px;
    cursor: none;
  padding: 10px;
  background: #cfc;
  border-radius: 8px;
  transition: transform 0.2s;
}
.bush.searched {
  pointer-events: none;
  transform: scale(0.95);
}

/* Bubble Pop MG */
.bubble-pop-game {
  position: relative;
  width: 320px;
  height: 300px;
  background: url('/assets/camp/river.png') no-repeat center;
  background-size: cover;
  overflow: hidden;
}
#bubbleCanvas {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

/* Fishing MG */
.fishing-game {
  text-align: center;
  width: 320px;
  padding: 10px;
  background: url('/assets/camp/minigame_bg.png') no-repeat center;
  background-size: cover;
}
#fishingZone { margin-top: 20px; }
#castBtn {
  padding: 8px 16px;
  font-size: 16px;
  background: #88c;
  color: white;
  border: none;
  border-radius: 6px;
    cursor: none;
}
#catchResult {
  margin-top: 10px;
  font-weight: bold;
}

/* Story Panel MG */
.story-panel-game {
  width: 320px;
  padding: 20px;
  background: url('/assets/camp/story_bg.png') no-repeat center;
  background-size: cover;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
}
#storyContent h3 {
  margin-bottom: 10px;
  font-size: 18px;
}
#storyContent p {
  font-size: 14px;
  line-height: 1.4;
}

/* Repair MG */
.repair-game {
  text-align: center;
  width: 320px;
  padding: 10px;
  background: url('/assets/camp/repair_bg.png') no-repeat center;
  background-size: cover;
}
#repairZone { margin-top: 20px; }
#repairBtn {
  padding: 8px 16px;
  font-size: 16px;
  background: #c66;
  color: white;
  border: none;
  border-radius: 6px;
    cursor: none;
}
#repairResult {
  margin-top: 10px;
  font-weight: bold;
}



