/* ============================
   World Panel (root container)
   ============================ */
#world-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#world-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("assets/bg_main.png") no-repeat center center;
  transition: background-position 2s linear;
  background-size: cover;
}

body {
  background: #0d1b2a;
  color: #fff;
  font-family: sans-serif;
  margin: 0;
  overflow: hidden;
}

/* ============================
   Garden Banner Anchors
   ============================ */
#banner-group {
  position: fixed;
  top: 8px;
  left: 265px; /* adjust to match sidebar width */
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  z-index: 200;
  pointer-events: none;
}

.garden-banner {
  width: 250px;
  height: auto;
  image-rendering: pixelated;
  opacity: 0.9;
}

/* ============================
   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;
  display: none;
}

/* PATCH: Allow interactivity for form controls inside panels */
.panel select,
.panel input,
.panel button,
.panel option {
  pointer-events: auto !important;
}


/* Gardens: always visible */
#garden,
#darkgarden,
#herogarden {
  display: block !important; 
}

/* 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%;
}
#karate-banner-panel {
  width: 482px;
  height: 125px;
  background: url("assets/banners/banner_chaokarate.png") no-repeat center center;
  background-size: 100% 100%;
}
#class-banner-panel {
  width: 497px;
  height: 108px;
  background: url("assets/banners/banner_kindergarten.png") no-repeat center center;
  background-size: 100% 100%;
}
#adventure-banner-panel {
  width: 539px;
  height: 102px;
  background: url("assets/banners/banner_adventure.png") no-repeat center center;
  background-size: 100% 100%;
}

/* ============================
   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; 
  background: transparent;
  pointer-events: none;
}

/* Neutral Garden */
#garden-wrapper {
  width: 1500px;
  height: 850px;
}

/* Dark Garden (top-right) */
#darkgarden-wrapper {
  width: 1181px;
  height: 672px;
}

/* Hero Garden (bottom-center) */
#herogarden-wrapper {
  width: 1181px;
  height: 672px;
}

/* ============================
   Gardens (inside wrappers)
   ============================ */
#garden,
#darkgarden,
#herogarden {
  width: 100%;
  height: 100%;
  border: 2px solid #415a77;
  border-radius: 12px;
  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;
  pointer-events: none;   /* ✅ visuals only */
}

/* ============================
   Stats + Focus
   ============================ */
#stats-panel {
  width: 250px;
  min-height: 260px;
}


.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;
}

/* ============================
   Chao Titles (Stats Page + Focus Panel)
   ============================ */
#chao-title {
  display: block;
  font-size: 14px;
  color: #ffd60a;
  text-align: center;
  margin: 4px 0;
  text-shadow: 1px 1px 2px #000;
}

#select-title-btn {
  display: inline-block;
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  padding: 4px 8px;
  margin-top: 4px;
  transition: background 0.2s, transform 0.1s;
}

#select-title-btn:hover {
  background: #5b63ff;
  transform: scale(1.05);
}

.focus-title-line {
  color: #ffd60a;
  font-size: 13px;
  font-style: italic;
  margin-top: 2px;
  text-shadow: 1px 1px 2px #000;
}

.title-highlight {
  color: #ffd60a;
  text-shadow: 1px 1px 2px #000;
}


/* Snap-On Debug Panel (keep this, NOT #debug-panel) */
#stats-debug-panel {
  position: absolute;
  z-index: 3000;
  width: 425px;
  height: 400px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
  color: #fff;
  display: none; /* hidden by default, toggled by stats.js */
}
#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: 160px;
  overflow-y: auto;
}

#stats-debug-panel .debug-header {
  font-weight: bold;
  color: #5bcefa;
  text-align: center;
  margin-bottom: 4px;
  font-size: 13px;
}



/* ============================
   Journal
   ============================ */
#journal-panel {
  width: 300px;
  height: 350px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  box-sizing: border-box;
}

.journal-page {
  display: none;
}

.journal-page.active {
  display: block;
}

#journal-panel .tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

#journal-panel #journal-chaoregon-attempts,
#journal-panel #journal-chaoregon-wins {
  color: #ffd60a;
  font-weight: bold;
}

/* ============================
   Chao Preview inside Journal
   ============================ */
#journal-chao-preview {
  width: 96px;
  height: 96px;
  margin: 6px auto;
  border: 2px solid #415a77;
  border-radius: 8px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#journal-chao-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* ============================
   Chao Trainer Styles
   ============================ */
#chao-trainer-panel {
  background: rgba(10, 20, 30, 0.95);
  border: 2px solid #415a77;
  border-radius: 10px;
  overflow: hidden;
}

#trainer-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, #0b1c2c, #122b45);
}

#trainer-bar,
#trainer-zone,
#trainer-cursor {
  transition: all 0.1s linear;
}

#trainer-container .btn {
  margin: 0 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #1b263b;
  color: #fff;
  border: 1px solid #778da9;
}
#trainer-container .btn:hover {
  background: #415a77;
}

/* ============================
   Obstacle Garden Styles (final with HUD + teleport flow)
   ============================ */
#obstacle-garden-panel {
  background: rgba(10, 15, 25, 0.9);
  border: 2px solid #415a77;
  border-radius: 10px;
  overflow: hidden;
  position: absolute;
}

/* ✅ Root container for background + Chao + obstacles */
#obstacle-garden-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ✅ Background layer */
#obstacle-garden-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background: url("assets/bgs/obstacleground_temp.png") repeat-x bottom;
  background-size: cover;
  background-position-y: bottom;
  z-index: 0;
}

/* ✅ Injected gameplay entities (Chao + obstacles) */
#obstacle-garden-container .chao,
#obstacle-garden-container .obstacle-block {
  position: absolute;
  z-index: 1;
}

/* ✅ Obstacle appearance */
.obstacle-block {
  background: #c22;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

/* ✅ UI button bar */
.obstacle-ui {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 2;
}

.obstacle-ui .btn {
  margin: 0 8px;
  padding: 6px 14px;
  border-radius: 6px;
  background: #1b263b;
  border: 1px solid #778da9;
  color: #fff;
  transition: background 0.2s ease;
}

.obstacle-ui .btn:hover {
  background: #415a77;
}

/* ============================
   HUD Overlay
   ============================ */
#obstacle-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #fff;
  z-index: 3;
  font-family: "Arial", sans-serif;
  font-size: 16px;
  text-shadow: 1px 1px 2px black;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#obstacle-lives {
  margin-bottom: 6px;
}

.hp-icon {
  width: 28px;
  height: 28px;
  margin-right: 4px;
  filter: drop-shadow(0 0 2px black);
  transition: opacity 0.2s ease;
}


/* ============================
   Tag Arena Styles (v1.9 Final — Up/Down + Persistent HUD + Flash)
   ============================ */
#tag-arena-panel {
  background: rgba(15,25,35,0.95);
  border: 2px solid #415a77;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  user-select: none;
}

/* ✅ Arena background */
#tag-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: url("assets/bgs/bg_tagarena.png") center bottom no-repeat;
  background-size: cover;
  overflow: hidden;
  z-index: 1;
  outline: none;
}
#tag-container:focus {
  outline: none;
}

/* ✅ Persistent HUD */
#tag-hud {
  position: absolute;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  display: flex !important;
  justify-content: space-between;
  color: #fff;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 15px;
  text-shadow: 1px 1px 2px #000;
  z-index: 9999 !important;
  pointer-events: none;
}

/* ✅ Chao and CPU placeholders */
.tag-chao,
.tag-fakechao {
  position: absolute;
  width: 48px;
  height: 48px;
  transition: left 0.05s linear, top 0.05s linear;
  z-index: 2;
}
.tag-fakechao {
  background: #aaa;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ✅ Flash effect on tag */
.tag-flash {
  animation: flash-green 0.3s ease;
}
@keyframes flash-green {
  0%   { box-shadow: 0 0 0px #0f0; }
  50%  { box-shadow: 0 0 20px #0f0; }
  100% { box-shadow: 0 0 0px #0f0; }
}

/* ✅ Exit button + HUD controls */
.tag-ui {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 3;
}
.tag-ui .btn {
  margin: 0 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #1b263b;
  color: #fff;
  border: 1px solid #778da9;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 14px;
  transition: background 0.15s ease;
}
.tag-ui .btn:hover {
  background: #415a77;
}

/* ✅ Prevent page scroll interference */
html, body {
  overscroll-behavior: contain;
}

/* ============================
   Treasure Hunt Styles
   ============================ */
#treasure-hunt-panel {
  background: rgba(12, 20, 30, 0.95);
  border: 2px solid #415a77;
  border-radius: 10px;
  overflow: hidden;
}

#treasure-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1a2b3a, #0a1620);
  overflow: hidden;
}

#treasure-hottext {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 6px #000;
  pointer-events: none;
}

.dig-marker {
  border: 1px solid #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.treasure-ui .btn {
  margin: 0 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #1b263b;
  color: #fff;
  border: 1px solid #778da9;
}
.treasure-ui .btn:hover {
  background: #415a77;
}




/* ============================
   Trash Panel
   ============================ */
#trash-panel {
  width: 140px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(13, 27, 42, 0.85);
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  text-align: center;
}

#trash-panel .trash-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

#trash-panel .trash-tip {
  font-size: 12px;
  color: #a5b3cf;
  margin-top: 6px;
}

/* ============================
   Inventory Panel
   ============================ */
#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;
}

#inventory-panel .tabs button.active {
  outline: 2px solid #ffd60a;
  background: #1b263b;
}

/* ============================
   Inventory Ring Counter
   ============================ */
#ring-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #ffd60a;
  margin-bottom: 6px;
  padding-left: 2px;
  flex-shrink: 0;
}

#ring-counter img {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
  vertical-align: middle;
}

/* ============================
   Inventory Grids
   ============================ */
#inventory-panel .grid,
#inventory-panel .equip-grid {
  display: grid;
  grid-template-columns: repeat(5, 60px); /* ✅ locked to 5 columns */
  gap: 5px;
}

#inventory-panel .slot {
  width: 60px;
  height: 60px;
  background: #415a77;
  display: flex;
  align-items: center;
  justify-content: center;
}

#inventory-panel .slot.empty {
  background: #222;
}

#inventory-panel .equip-grid .slot img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}


/* ============================
   Quest Board Styles (Final Expanded v1.5)
   ============================ */
#quest-board-panel {
  background: rgba(15, 20, 35, 0.94);
  border: 2px solid #2b4b7e;
  border-radius: 10px;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-ui, "Verdana", sans-serif);
  display: none;
  width: 650px;          /* ✅ wider */
  height: 550px;         /* ✅ taller */
  position: absolute;
  z-index: 1200;
  display: flex;
  flex-direction: column;
}

/* Header row: title left, tabs center, close right */
#quest-board-panel .panel-header {
  background: linear-gradient(90deg, #1b273d, #2b4b7e);
  color: #fff;
  font-weight: bold;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #415a77;
  position: relative;
}

#quest-board-panel .panel-title {
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
}

#quest-board-panel .close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

#quest-board-panel .close-btn:hover {
  color: #5da9f1;
}

/* Tabs container directly under title bar */
#quest-board-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex: 1;
}

.quest-tab {
  padding: 6px 10px;
  background: rgba(10, 15, 25, 0.6);
  border: 1px solid #324a6f;
  border-radius: 4px;
  color: #bbb;
  font-weight: bold;
  transition: color 0.2s, background 0.2s, border 0.2s;
}

.quest-tab:hover {
  color: #fff;
  background: rgba(60, 90, 130, 0.5);
}

.quest-tab.active {
  color: #fff;
  background: rgba(70, 120, 180, 0.4);
  border: 1px solid #5da9f1;
}

/* Scrollable content area below header */
.quest-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background: rgba(10, 15, 25, 0.85);
}

.quest-list {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.quest-list.visible {
  display: flex;
}

/* ============================
   Quest Entry Box (Expanded)
   ============================ */
.quest-entry {
  background: rgba(25, 35, 55, 0.92);
  border: 1px solid #324a6f;
  border-radius: 8px;
  padding: 14px 18px;
  transition: background 0.2s, transform 0.1s, border-color 0.2s;
  font-size: 14px;
  line-height: 1.5;
}

.quest-entry:hover {
  background: rgba(50, 80, 120, 0.9);
  border-color: #5da9f1;
  transform: scale(1.02);
}

.quest-title {
  font-weight: bold;
  color: #5da9f1;
  margin-bottom: 6px;
  font-size: 1.05em;
}

.quest-desc {
  font-size: 0.9em;
  color: #ddd;
  line-height: 1.4;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

/* ✅ Step list display */
.quest-steps {
  margin: 6px 0 4px 0;
  padding: 10px 12px;
  color: #ccc;
  font-size: 0.9em;
  line-height: 1.4;
  background: rgba(15, 25, 40, 0.75);
  border-radius: 6px;
}

.quest-step {
  display: block;
  margin-bottom: 8px;
}

.quest-step-status {
  font-size: 0.95em;
  margin-right: 4px;
  color: #8fffa8;
}

.quest-step-title {
  font-weight: 600;
  color: #fff;
}

.quest-step-desc {
  margin-left: 24px;
  margin-top: 2px;
  color: #b8c9e3;
  font-size: 0.85em;
  line-height: 1.35;
  opacity: 0.9;
  white-space: pre-wrap;
}

/* ✅ Progress + Reward footer */
.quest-status,
.quest-progress,
.quest-reward {
  font-size: 0.85em;
  color: #8fd3ff;
  margin-top: 6px;
  text-align: right;
  opacity: 0.9;
}

/* Locked / Completed styling */
.quest-entry.locked {
  opacity: 0.55;
  filter: grayscale(0.6);
}

.quest-entry.completed {
  border-color: #4caf50;
  background: rgba(40, 60, 40, 0.9);
}

/* ✅ Mini-banner (active quest indicator) */
#quest-minibanner {
  display: none;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 30, 50, 0.92);
  border: 1px solid #5da9f1;
  border-radius: 6px;
  padding: 4px 10px;
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  z-index: 1500;
  text-align: center;
  box-shadow: 0 0 6px rgba(93, 169, 241, 0.5);
}



/* ============================
   Shop Panel (Fixed Dimensions + BUY/SELL, Scroll Fixed)
   ============================ */
#shop-panel {
  display: none;              /* ✅ Hidden by default like all panels */
  width: 700px;
  height: 500px;
  background: rgba(13, 27, 42, 0.9);
  border: 2px solid #415a77;
  border-radius: 12px;
  overflow: hidden;
  box-sizing: border-box;
}

/* ✅ When visible, apply flex layout */
#shop-panel.visible {
  display: flex;
  flex-direction: row;
}

/* Left side (image) */
#shop-panel .shop-left {
  width: 275px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid #415a77;
  flex-shrink: 0;
}

#shop-panel #shop-keeper {
  width: 250px;
  height: 250px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

/* Right side (BUY/SELL column) */
#shop-panel .shop-right {
  width: 275px;
  height: 300px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  color: #fff;
  box-sizing: border-box;
  flex-shrink: 0;
  overflow: hidden; /* contains scrollable inner section */
}

/* ============================
   Shop Ring Display
   ============================ */
#shop-ring-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #ffd60a;
  margin-bottom: 6px;
  padding-left: 2px;
  flex-shrink: 0;
}

#shop-ring-display img {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
  vertical-align: middle;
}

/* Mode tabs (BUY / SELL) */
.mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.mode-tabs .mode-btn {
  flex: 1;
  padding: 4px;
  border: none;
  border-radius: 6px;
  background: #415a77;
  color: #fff;
}

.mode-tabs .mode-btn.active {
  background: #1b263b;
  outline: 2px solid #ffd60a;
}

/* Shop mode containers */
.shop-mode {
  display: none;
  flex: 1;
  min-height: 0; /* allows scrolling */
}

.shop-mode.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* BUY mode category tabs */
#shop-panel .tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

#shop-panel .tabs button {
  flex: 1;
  padding: 4px;
  background: #415a77;
  border: none;
  border-radius: 6px;
  color: #fff;
}

#shop-panel .tabs button.active {
  outline: 2px solid #ffd60a;
  background: #1b263b;
}

/* Scrollable BUY list */
#shop-list {
  flex: 1;
  overflow-y: auto;
  background: #0d1b2a;
  border-radius: 8px;
  padding: 4px;
  min-height: 0;
}

#shop-panel .shop-item {
  padding: 5px;
  background: #415a77;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#shop-panel .shop-item img {
  flex-shrink: 0;
}

#shop-panel .shop-item.equip img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}

/* SELL mode layout */
#sell-box {
  width: 100%;
  height: 100%;
  background: #0d1b2a;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #415a77;
  flex-grow: 1;
  min-height: 0;
}

#sell-dropzone {
  width: 64px;
  height: 64px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 8px;
  margin-bottom: 8px;
}

#sell-label {
  font-size: 14px;
  color: #a5b3cf;
  margin: 0;
}

#sell-info {
  font-size: 12px;
  color: #ffd60a;
  text-align: center;
  margin-top: 6px;
}

.hidden {
  display: none;
}


/* ============================
   Shop Confirm Panel
   ============================ */
#shop-confirm-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 360px;
  transform: translate(-50%, -50%);
  display: none;
  background: rgba(10, 20, 30, 0.95);
  border: 2px solid #00b4d8;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  color: #fff;
  z-index: 10010;
}

.shop-confirm-header {
  font-size: 18px;
  font-weight: bold;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.shop-confirm-body {
  padding: 16px;
  text-align: center;
}

.shop-confirm-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 12px 0 16px 0;
}

.shop-confirm-buttons .ui-btn {
  background: rgba(0, 180, 216, 0.25);
  border: 1px solid #00b4d8;
  color: #fff;
  border-radius: 6px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.shop-confirm-buttons .ui-btn:hover {
  background: rgba(0, 180, 216, 0.45);
}

/* ============================
   Race + Karate Arenas
   ============================ */
#race-canvas,
#race-banner-canvas,
#karate-canvas {
  border: 2px solid #415a77;
  background: #1b263b;
  display: block;
  margin: 10px 0;
}

/* ============================
   Race2 Panels
   ============================ */
#race2-banner-panel {
  width: 498px;
  height: 147px;
  background: url("assets/banners/banner_chaorace2.png") no-repeat center center;
  background-size: 100% 100%;
}
#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;
}
#race2-chao-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#race2-arena-panel .arena-footer {
  position: absolute;
  bottom: 5px;
  width: 100%;
  text-align: center;
}
#race2-arena-panel .arena-footer button {
  margin: 0 8px;
  padding: 4px 12px;
  background: #ffd60a;
  border: none;
  border-radius: 6px;
  font-weight: bold;
}
#race2-arena-panel .arena-footer button:hover {
  background: #ffea55;
}


/* ============================
   Race3 Panels
   ============================ */
#race3-banner-panel {
  width: 498px;
  height: 147px;
  background: url("assets/banners/banner_chaorace3.png") no-repeat center center;
  background-size: 100% 100%;
}

#race3-arena-panel {
  width: 1920px;
  height: 462px;
  position: absolute !important;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
}

#race3-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 462px;
  border: 2px solid #415a77;
}

#race3-chao-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#race3-arena-panel .arena-footer {
  position: absolute;
  bottom: 5px;
  width: 100%;
  text-align: center;
}

#race3-arena-panel .arena-footer button {
  margin: 0 8px;
  padding: 4px 12px;
  background: #ffd60a;
  border: none;
  border-radius: 6px;
  font-weight: bold;
}

#race3-arena-panel .arena-footer button:hover {
  background: #ffea55;
}


/* ============================
   Karate Arena (absolute positioning)
   ============================ */
#karate-arena-panel {
  width: 500px;
  height: 300px;
  position: absolute !important; /* anchor in world space */
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

/* ============================
   Arena Panels (true sizes)
   ============================ */

#race-arena-panel {
  width: 874px;
  height: 266px;
}
#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,
#race3-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;
}

.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 */
}

/* ============================
   Karate VS Transition Overlay
   ============================ */
#karate-vs-panel {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.5s ease;
  opacity: 0;
}

#karate-vs-text {
  font-size: 64px;
  font-weight: bold;
  color: #ffcc00;
  text-shadow: 3px 3px 0 #000;
  margin-bottom: 30px;
}

#karate-vs-panel canvas {
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  image-rendering: pixelated;
}

#karate-vs-left {
  border: 3px solid #ff3333;
}

#karate-vs-right {
  border: 3px solid #33aaff;
}

#karate-vs-panel .vs-label {
  font-size: 72px;
  font-weight: bold;
  color: #ffcc00;
  text-shadow: 3px 3px 0 #000;
  margin: 0 30px;
}

/* ============================
   Karate Round Tracker
   ============================ */
#karate-round-tracker {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  z-index: 61;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid #fff;
}

#karate-round-tracker .round-dot {
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s, border-color 0.2s;
}

#karate-round-tracker .round-dot.player {
  background: #0099ff;
  border-color: #0099ff;
}

#karate-round-tracker .round-dot.cpu {
  background: #ff4444;
  border-color: #ff4444;
}


/* ============================
   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 (Fixed Top-Left, beside Sidebar)
   ============================ */
#toolbar-panel {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  background: url("assets/ui/toolbar_bg.png") no-repeat center center;
  background-size: cover;
  border: 2px solid #415a77;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.6);
  padding: 8px 12px 12px 12px;
  width: fit-content;
  height: fit-content;
  box-sizing: border-box;
  overflow: visible;
  z-index: 3000;
}

/* ============================
   Toolbar Buttons Row
   ============================ */
#toolbar-buttons {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  max-width: 90vw;
  padding-bottom: 2px;
}

#toolbar-buttons::-webkit-scrollbar {
  height: 6px;
}

#toolbar-buttons::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* ============================
   Toolbar Buttons
   ============================ */
#toolbar-panel button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: #1b263b;
  padding: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#toolbar-panel button img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

#toolbar-panel button.active {
  outline: 2px solid #ffd60a;
  background: #415a77;
}

/* ============================
   Ring HUD
   ============================ */
#toolbar-ringhud {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1b263b;
  border: 2px solid #ffd60a;
  border-radius: 10px;
  padding: 2px 12px;
  margin: 4px auto 0 auto;
  min-width: 110px;
  width: auto;
  max-width: 200px;
  box-shadow: 0 0 6px rgba(255, 214, 10, 0.35);
}

#toolbar-ringhud img {
  width: 18px;
  height: 18px;
  margin-right: 4px;
  image-rendering: pixelated;
}

#ringhud-count {
  font-family: monospace;
  font-size: 15px;
  color: #ffd60a;
  text-shadow: 0 0 3px #ffd60a;
  letter-spacing: 0.5px;
  line-height: 1;
  text-align: center;
}

#hud-clock {
  font-size: 18px;
  color: #ffd700;
  margin-left: 12px;
  text-shadow: 1px 1px 2px #000;
  font-family: monospace;
}


/* ============================
   Cursor + Wheel
   ============================ */
#cursor {
  position: fixed;
  width: 48px;        /* unified size */
  height: 48px;       /* unified size */
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  background-image: url("assets/ui/cursor-select.png"); /* default only; JS overrides per-mode */
  image-rendering: pixelated;
  transform: translate(-50%, -90%);  /* center on pointer */
  z-index: 10050;
}

#cursor-wheel {
  display: none;
  position: fixed;
  width: 200px;       /* doubled from 100 */
  height: 200px;      /* doubled from 100 */
  background: url("assets/icons/wheel1.png") no-repeat center center;
  background-size: contain;
  pointer-events: none;
  z-index: 10000;
}

#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); }

/* ============================
   Entity Highlight + Selector (Hover/Focus)
   ============================ */

/* --- unified highlight visuals --- */
.entity-hover {
  outline: 2px solid #ffd60a;
  outline-offset: -2px;
  box-shadow: 0 0 8px rgba(255,214,10,0.6);
}

.entity-focus {
  outline: 2px solid #00ff88;
  outline-offset: -2px;
  box-shadow: 0 0 10px rgba(0,255,136,0.55);
}

/* overlay boxes that follow entities (singletons) */
#focus-outline,
#hover-outline {
  position: absolute;
  pointer-events: none;
  border-radius: 6px;
  image-rendering: pixelated;
  z-index: 2147483000; /* below cursor, above panels */
  display: none;
}

#hover-outline {
  border: 2px solid #ffd60a;
  box-shadow: 0 0 8px rgba(255,214,10,0.6);
}

#focus-outline {
  border: 2px solid #00ff88;
  box-shadow: 0 0 10px rgba(0,255,136,0.55);
}

/* selector sprite that floats above the focused entity */
#ui-selector {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  image-rendering: pixelated;
  z-index: 2147483001;
  display: none;
  transform: translate(-50%, -100%); /* center X, place above */
}


/* ============================
   Debug Help Panel
   ============================ */
#debug-help-panel {
  width: 300px;
  min-height: 150px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  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;
  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 (Expanded hitbox, label/title raised and consistent with zoom)
   ============================ */
#chao-container,
#darkchao-container,
#herochao-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Chao: local anchor for dot, name, title */
.chao {
  position: relative;
  width: 48px;
  height: 48px;
  pointer-events: auto;
  image-rendering: pixelated;
  z-index: 1;
  overflow: visible;
}

/* Eggs and items remain absolute */
.egg,
.garden-item {
  position: absolute;
  width: 48px;
  height: 48px;
  pointer-events: auto;
  image-rendering: pixelated;
  z-index: 1;
}

/* Expanded invisible click zone */
.chao::before,
.egg::before,
.garden-item::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -8px;
  width: 64px;
  height: 64px;
  background: transparent;
  pointer-events: auto;
  z-index: 0;
}

/* Sprite layer */
.chao > img,
.egg > img,
.garden-item > img {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

/* Dot above head */
.dot {
  position: absolute;
  bottom: -8px; /* adjust this value to lower/raise */
  left: 50%;
  transform: translateX(-50%) scale(2.0);
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 3;
}

/* Raised name and title labels */
.chao-label {
  position: absolute;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.chao-title {
  position: absolute;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #ffd60a;
  text-shadow: 1px 1px 2px #000;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

/* Picked transparency */
.garden-item.picked {
  opacity: 0.7;
}

/* ============================
   Focus Panel (fixed size + hidden scroll)
   ============================ */
#focus-panel {
  width: 220px;
  height: 260px;
  overflow: hidden;
  display: none;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  text-align: center;
  padding: 6px;
}

#focus-image {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border: 2px solid #415a77;
  border-radius: 8px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#focus-details {
  max-height: 60px;
  overflow-y: auto;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE/Edge */
  text-align: center;
  margin-top: 4px;
}
#focus-details::-webkit-scrollbar { display: none; } /* Chrome/Safari */
#focus-details p {
  margin: 2px 0;
  font-size: 14px;
  line-height: 1.1em;
}


/* ============================
   Chaoregon Trail
   ============================ */
#chaoregon-banner-panel {
  width: 539px;
  height: 102px;
  background: url("assets/banners/banner_chaoregontrail.png") no-repeat center center;
  background-size: 100% 100%;
}

#chaoregon-bg-panel {
  width: 640px;
  height: 360px;
  background-size: cover;
  position: absolute !important;
  display: flex;
  flex-direction: column;
}

#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-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;
}

#chaoregon-footer-controls button {
  background: #ffd60a;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  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;
}

#chaoregon-top-controls .mode-toggle button.active {
  background: #ffd60a;
  color: #0d1b2a;
  border: 2px solid #ffd60a;
  font-weight: bold;
}

/* ============================
   Chaoregon Map Panel (Expanded Layout)
   ============================ */
#chaoregon-map-panel {
  width: 1400px;
  height: 600px;
  display: flex;
  flex-direction: row;
  border: 2px solid #415a77;
  border-radius: 8px;
  overflow: hidden;
  background: #0d1b2a;
}

/* --- Left: Map Area --- */
#chaoregon-map-panel .map-area {
  flex: 0 0 800px;
  height: 600px;
  background: url("assets/bgs/ChaoregonMap.png") no-repeat center center;
  background-size: contain;
  position: relative;
}

#chaoregon-party-icon {
  position: absolute;
  width: 48px;
  height: 48px;
  top: 40px;
  right: 0;
  left: auto;
  image-rendering: pixelated;
  pointer-events: none;
  transition: right 0.4s linear;
}

/* --- Right: Sidebar Split --- */
#chaoregon-sidebar {
  flex: 0 0 600px;
  height: 600px;
  display: flex;
  flex-direction: row;
  background: rgba(0,0,0,0.7);
  border-left: 2px solid #415a77;
  color: white;
  font-size: 14px;
  overflow: hidden;
  box-sizing: border-box;
}

/* --- Left Half (Controls + Log) --- */
#chaoregon-sidebar-left {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #415a77;
  box-sizing: border-box;
}

/* Divider line */
.chaoregon-divider {
  height: 2px;
  background: #415a77;
  margin: 4px 0;
}

/* Day + Miles + Next Day */
#chaoregon-day-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(0,0,0,0.5);
}

#chaoregon-day-controls span {
  color: #ffd60a;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
  font-size: 13px;
}

#chaoregon-nextday-btn {
  padding: 4px 10px;
  background: #ffd60a;
  border: none;
  border-radius: 6px;
  font-weight: bold;
}

#chaoregon-nextday-btn:hover {
  background: #ffea55;
}

/* Travel Options */
#chaoregon-travel-options {
  padding: 6px 10px;
  font-size: 13px;
  background: rgba(0,0,0,0.4);
  line-height: 1.6em;
}

#chaoregon-travel-options select,
#chaoregon-travel-options button {
  margin-left: 6px;
  border-radius: 4px;
  border: 1px solid #415a77;
  background: #1b263b;
  color: white;
  font-size: 13px;
}

#chaoregon-travel-options button {
  background: #ffd60a;
  color: #000;
  font-weight: bold;
}

/* Resource UI */
#chaoregon-resource-ui {
  padding: 6px 8px;
  text-align: left;
  font-weight: bold;
  font-size: 13px;
  background: rgba(0,0,0,0.6);
}

/* Party Wagon */
#chaoregon-wagon {
  text-align: center;
  font-size: 18px;
  padding: 6px;
  border-top: 2px solid #415a77;
  border-bottom: 2px solid #415a77;
  background: rgba(0,0,0,0.5);
}

#chaoregon-log-output {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  font-size: 13px;
  line-height: 1.3em;
}

/* --- Right Half (Party Members) --- */
#chaoregon-sidebar-right {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  overflow-y: auto;
  box-sizing: border-box;
}

#chaoregon-sidebar-right h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #ffd60a;
  text-align: center;
}

/* Party Members */
#chaoregon-sidebar-party .party-member,
#chaoregon-party-stats .party-member {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

/* Left column (name, hp, sprite) */
#chaoregon-sidebar-party .party-left,
#chaoregon-party-stats .party-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#chaoregon-sidebar-party .party-left .name,
#chaoregon-party-stats .party-left .name {
  font-weight: bold;
  font-size: 13px;
  color: #fff;
  margin-bottom: 2px;
}

#chaoregon-sidebar-party .party-left .hp,
#chaoregon-party-stats .party-left .hp {
  color: #00ff80;
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 4px;
}

#chaoregon-sidebar-party .party-left canvas,
#chaoregon-party-stats .party-left canvas {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  border: 2px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.5);
}

/* Right column (stats) */
#chaoregon-sidebar-party .party-stats,
#chaoregon-party-stats .party-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 12px;
  line-height: 1.3em;
  margin-left: 40px;
}

/* ============================
   Trail Screen Panel (Full Fixed with Bottom HUD Integration)
   ============================ */
#trail-screen-panel {
  width: 720px;
  height: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #0d1b2a;
  border: 2px solid #415a77;
  border-radius: 12px;
  color: white;
  padding: 10px;
  box-sizing: border-box;
}

#trail-screen-panel h3 {
  color: #ffd60a;
  margin-bottom: 6px;
  font-size: 18px;
  text-align: center;
}

/* Top section: scrolling canvas */
#trail-canvas {
  width: 640px;
  height: 320px;
  background: #0d1b2a;
  border: 2px solid #415a77;
  border-radius: 8px;
  display: block;
  image-rendering: pixelated;
  margin-bottom: 6px;
}

/* ============================
   Trail HUD (Bottom 40%)
   ============================ */
#trail-hud {
  flex: 0 0 40%;
  width: 100%;
  display: flex;
  flex-direction: row;
  background: rgba(0,0,0,0.7);
  border-top: 2px solid #415a77;
  color: white;
  font-size: 14px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Left side: controls + log */
#trail-hud-left {
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #415a77;
  box-sizing: border-box;
}

.trail-divider {
  height: 2px;
  background: #415a77;
  margin: 4px 0;
}

/* Day / Miles / Next Day */
#trail-day-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(0,0,0,0.5);
}

#trail-day-controls span {
  color: #ffd60a;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000;
  font-size: 13px;
}

#trail-nextday-btn {
  padding: 4px 10px;
  background: #ffd60a;
  border: none;
  border-radius: 6px;
  font-weight: bold;
}

#trail-nextday-btn:hover {
  background: #ffea55;
}

/* Travel Options */
#trail-travel-options {
  padding: 6px 10px;
  font-size: 13px;
  background: rgba(0,0,0,0.4);
  line-height: 1.6em;
}

#trail-travel-options select,
#trail-travel-options button {
  margin-left: 6px;
  border-radius: 4px;
  border: 1px solid #415a77;
  background: #1b263b;
  color: white;
  font-size: 13px;
}

#trail-travel-options button {
  background: #ffd60a;
  color: #000;
  font-weight: bold;
}

/* Resource UI */
#trail-resource-ui {
  padding: 6px 8px;
  text-align: left;
  font-weight: bold;
  font-size: 13px;
  background: rgba(0,0,0,0.6);
}

/* Log */
#trail-log-output {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  font-size: 13px;
  line-height: 1.3em;
}

/* Right side: party members */
#trail-hud-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px;
  overflow-y: auto;
  box-sizing: border-box;
}

#trail-hud-right h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #ffd60a;
  text-align: center;
}

/* Party Members */
#trail-party-stats .party-member {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

#trail-party-stats .party-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#trail-party-stats .party-left .name {
  font-weight: bold;
  font-size: 13px;
  color: #fff;
  margin-bottom: 2px;
}

#trail-party-stats .party-left .hp {
  color: #00ff80;
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 4px;
}

#trail-party-stats .party-left canvas {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  border: 2px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.5);
}

#trail-party-stats .party-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 12px;
  line-height: 1.3em;
  margin-left: 40px;
}

/* ============================================================
   MP Race Panel 
   ============================================================ */
#race-mp-panel {
  position: fixed;
  width: 1320px;
  height: 840px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 20, 30, 0.95);
  border: 3px solid #3a4f69;
  border-radius: 12px;
  padding: 0;
  z-index: 99999;
  display: none;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
}

#race-mp-banner {
  width: 100%;
  height: 100px;
  background-image: url("assets/banners/banner_chaorace3.png");
  background-size: cover;
  background-position: center;
  border-bottom: 3px solid #3a4f69;
}

#race-mp-arena {
  position: relative;
  width: 1280px;
  height: 720px;
  margin: 0 auto;
  background: #1a1a1a;
}

#race-mp-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 1;
}

#race-mp-chao-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  pointer-events: none;
  z-index: 2;
}

#race-mp-controls {
  width: 100%;
  padding: 10px;
  display: flex;
  justify-content: center;
  gap: 12px;
  border-top: 3px solid #3a4f69;
  background: rgba(0, 0, 0, 0.35);
}

#race-mp-controls .ui-btn {
  width: 160px;
  padding: 8px 12px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  background: #2a4158;
  color: #fff;
  cursor: pointer;
}

#race-mp-controls .ui-btn:hover {
  background: #3c5875;
}


/* ============================================================
   MULTIPLAYER MINIGAME PANEL
   ============================================================ */
#mp-minigame-panel {
  box-shadow: 0 0 14px #000;
}


/* ------------------------------------------------------------
   Minigame Buttons
   ------------------------------------------------------------ */
.mp-mg-button {
  width: 160px;
  height: 260px;
  position: relative;
  border: 2px solid #345;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #0f1a24;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mp-mg-button:hover {
  border-color: #6af;
}

.mp-mg-img {
  width: 150px;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

/* Vote pucks container */
.mp-mg-pucks {
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  height: 48px;
  display: flex;
  gap: 4px;
  pointer-events: none;
}

/* ------------------------------------------------------------
   Vote Pucks
   ------------------------------------------------------------ */
.mp-puck {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-size: cover;
  background-repeat: no-repeat;
  border: 3px solid #fff;
  box-shadow: 0 0 6px #000;
}

/* Player colors (sync with JS PLAYER_COLORS) */
.mp-color-host { border-color: #ff3333 !important; }
.mp-color-p2   { border-color: #3399ff !important; }
.mp-color-p3   { border-color: #33cc33 !important; }
.mp-color-p4   { border-color: #ffdd33 !important; }
.mp-color-p5   { border-color: #bb33ff !important; }
.mp-color-p6   { border-color: #ff9933 !important; }

/* Karate disabled when >2 players */
.mp-mg-disabled {
  filter: grayscale(1) brightness(0.4);
  cursor: not-allowed;
  opacity: 0.55;
}


/* ------------------------------------------------------------
   Player Rows
   ------------------------------------------------------------ */
.mp-player-row {
  width: 100%;
  min-height: 48px;
  background: #1c2735;
  border: 1px solid #2f3e4e;
  border-radius: 6px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  color: #fff;
  gap: 15px;
}

.mp-player-name {
  flex: 1;
  font-weight: bold;
  font-size: 14px;
}

.mp-player-select {
  flex: 1;
}

.mp-player-ready {
  flex: 1;
  display: flex;
  justify-content: center;
}


/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
#mp-mg-start-btn {
  transition: opacity 0.15s;
}


/* ------------------------------------------------------------
   Scrollbars for player list
   ------------------------------------------------------------ */
#mp-chao-player-list::-webkit-scrollbar {
  width: 6px;
}
#mp-chao-player-list::-webkit-scrollbar-track {
  background: #0d141c;
}
#mp-chao-player-list::-webkit-scrollbar-thumb {
  background: #2c3b4b;
  border-radius: 3px;
}
#mp-chao-player-list::-webkit-scrollbar-thumb:hover {
  background: #3c4f63;
}


/* =========================================================
   MP CONNECT — OPEN LOBBY BUTTON
   ========================================================= */
#mpc-open-lobby-btn {
  margin-left: 10px;
  background: #5a8cff;
  border: 2px solid #2b4ea8;
  color: #fff;
  font-weight: bold;
}

#mpc-open-lobby-btn:hover {
  background: #80a8ff;
}


/* ============================
   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;
  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;
}
#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);
  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: 310px 310px 320px; /* Available | Formation | Minigames */
  gap: 16px;
  margin-top: 10px;
}
.party-column { flex: 1; }

/* Compact spacing: Available Chao grid (left column only) */
#party-status #party-chao-grid {
  display: grid;
  grid-template-columns: repeat(3, 94px);
  justify-content: start;
  align-content: start;
  gap: 5px;
  padding: 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid #415a77;
  border-radius: 6px;
  max-height: 320px;
  overflow-y: auto;
}

#party-status #party-chao-grid .chao-slot {
  width: 90px;
  height: 88px;
  padding: 4px;
  border: 1px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border 0.2s;
}

#party-status #party-chao-grid .chao-slot.selected {
  border: 2px solid #00ff88;
  box-shadow: 0 0 6px #00ff88;
  background-color: rgba(0,255,136,0.1);
}

#party-status #party-chao-grid .sprite-wrap {
  width: 42px;
  height: 42px;
  margin-bottom: 2px;
}
#party-status #party-chao-grid .sprite-wrap img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* ============================
   Party Formation Grid (Fixed 3x2 Boxes)
   ============================ */
#party-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 94px); /* match Available Chao grid columns */
  grid-template-rows: repeat(2, 94px);     /* force 2 rows, same vertical size */
  justify-content: start;
  align-content: start;
  gap: 5px; /* same spacing as Available Chao */
  padding: 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid #415a77;
  border-radius: 6px;
  width: 310px;
  height: auto;
}

/* Empty box (slot) visuals — identical to Available Chao boxes */
#party-slot-grid .slot {
  width: 90px;
  height: 88px;
  border: 1px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border 0.2s;
  position: relative;
}

/* Hover only shows highlight (no selection color) */
#party-slot-grid .slot:hover {
  background: rgba(91, 99, 255, 0.25);
  border-color: #5b63ff;
}

/* Ensure image fits within the slot, identical to Available Chao */
#party-slot-grid .sprite-wrap {
  width: 42px;
  height: 42px;
  margin-bottom: 2px;
}

#party-slot-grid .sprite-wrap img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* Empty slot text style (optional, can remove) */
#party-slot-grid .slot.empty::after {
  content: "—";
  color: rgba(255,255,255,0.2);
  font-size: 14px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Send button alignment */
#send-party-btn {
  display: block;
  margin: 10px auto 0 auto;
  padding: 8px 16px;
  background: #00ccff;
  border: none;
  border-radius: 6px;
  color: #000;
  font-weight: bold;
  transition: background 0.2s;
}
#send-party-btn:hover {
  background: #00e6ff;
}


/* ============================
   Minigame Banners (Party Status)
   ============================ */
#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);
  text-align: center;
  overflow: hidden;
  height: 64px;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}
#party-status-minigames .minigame-banner:hover {
  background: rgba(255,214,10,0.1);
  border-color: #ffd60a;
}
#party-status-minigames .minigame-banner.selected {
  border: 4px solid #ffd60a;
  box-shadow: 0 0 10px #ffd60a;
  background: rgba(255,214,10,0.15);
}
#party-status-minigames .minigame-banner img {
  height: 100%;
  width: auto;
  object-fit: contain;
  image-rendering: pixelated;
}

/* ============================
   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;
  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;
}
#party-move .move-buttons button:hover {
  background: #5b63ff;
}


/* ============================
   Solo-Party Maker (Standalone, Final Fixed)
   ============================ */
#party-status-panel {
  background: rgba(25, 35, 60, 0.9);
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
  color: white;
  width: 720px;
  height: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

#party-status-panel h3 {
  text-align: center;
  color: #ffee66;
  margin: 0 0 8px 0;
  width: 100%;
}

#party-status-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
}

/* Section headers */
#party-status-panel h4 {
  margin: 4px 0 8px 0;
  font-size: 14px;
  color: #9dc0ff;
  text-align: center;
}

/* Left: Available Chao */
#party-status-available {
  flex: 1.3;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

/* Match Party Hub grid exactly */
#party-status-chaolist {
  display: grid;
  grid-template-columns: repeat(3, 94px);
  justify-content: start;
  align-content: start;
  gap: 5px;
  padding: 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid #415a77;
  border-radius: 6px;
  max-height: 320px;
  overflow-y: auto;
  width: 100%;
}

/* Individual Chao box */
#party-status-chaolist .chao-slot {
  width: 90px;
  height: 88px;
  padding: 4px;
  border: 1px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

#party-status-chaolist .chao-slot:hover {
  background: rgba(91, 99, 255, 0.25);
  border-color: #5b63ff;
}

/* ✅ Green highlight for selected Chao */
#party-status-chaolist .chao-slot.selected {
  border: 2px solid #00ff88;
  box-shadow: 0 0 6px #00ff88;
  background-color: rgba(0,255,136,0.1);
}

/* Sprite + Name */
#party-status-chaolist .sprite-wrap {
  width: 42px;
  height: 42px;
  margin-bottom: 2px;
}
#party-status-chaolist .sprite-wrap img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

#party-status-chaolist .chao-name {
  font-size: 11px;
  color: #fff;
  margin-top: 2px;
  text-align: center;
  width: 100%;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* Right: Selected Chao grid */
#party-status-selected {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

#party-status-slots {
  display: grid;
  grid-template-columns: repeat(3, 94px);
  grid-template-rows: repeat(2, 94px);
  justify-content: start;
  align-content: start;
  gap: 5px;
  padding: 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid #415a77;
  border-radius: 6px;
  width: 310px;
  height: auto;
  margin-bottom: 6px;
}

#party-status-slots .slot {
  width: 90px;
  height: 88px;
  border: 1px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border 0.2s;
  box-sizing: border-box;
}
#party-status-slots .slot:hover {
  background: rgba(91, 99, 255, 0.25);
  border-color: #5b63ff;
}

#party-status-slots .sprite-wrap {
  width: 42px;
  height: 42px;
  margin-bottom: 2px;
}
#party-status-slots .sprite-wrap img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

#party-status-slots .chao-name {
  font-size: 11px;
  color: #fff;
  margin-top: 2px;
  text-align: center;
  width: 100%;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

/* Button directly below Selected grid */
#party-status-send-btn {
  display: block;
  margin-top: 8px;
  padding: 8px 16px;
  background: #00ccff;
  border: none;
  border-radius: 6px;
  color: #000;
  font-weight: bold;
  transition: background 0.2s;
}
#party-status-send-btn:hover {
  background: #00e6ff;
}

/* Scrollbar */
#party-status-chaolist::-webkit-scrollbar {
  width: 6px;
}
#party-status-chaolist::-webkit-scrollbar-thumb {
  background: #415a77;
  border-radius: 6px;
}


/* ============================
   Entity Containers
   ============================ */
#chao-container,
#egg-container,
#item-container,
#darkchao-container,
#darkegg-container,
#darkitem-container,
#herochao-container,
#heroegg-container,
#heroitem-container {
  pointer-events: auto; /* ✅ entities clickable */
}

/* ============================
   Z-Index Hierarchy
   ============================ */
#world-panel { z-index: 0 !important; }
#world-bg    { z-index: -1 !important; }

/* Neutral Garden */
#garden-wrapper   { z-index: 10 !important; }
#garden-canvas    { z-index: 11 !important; }
#chao-container,
#egg-container,
#item-container   { z-index: 12 !important; }

/* Dark Garden */
#darkgarden-wrapper   { z-index: 20 !important; }
#darkgarden-canvas    { z-index: 21 !important; }
#darkchao-container,
#darkegg-container,
#darkitem-container   { z-index: 22 !important; }

/* Hero Garden */
#herogarden-wrapper   { z-index: 30 !important; }
#herogarden-canvas    { z-index: 31 !important; }
#herochao-container,
#heroegg-container,
#heroitem-container   { z-index: 32 !important; }

/* Arenas */
#race-arena-panel,
#race2-arena-panel,
#race3-arena-panel,
#karate-arena-panel,
#class-arena-panel,
#obstacle-garden-panel,
#chao-trainer-panel,
#tag-arena-panel,
#treasure-hunt-panel,
#chaoregon-bg-panel,
#adventure-arena-panel { z-index: 50 !important; }

/* Arena internals (above canvas, below banners) */
#race-chao-container,
#race2-chao-container,
#karate-chao-container,
#class-chao-container,
#obstacle-garden-container,
#trainer-container,
#tag-container,
#treasure-container,
#chaoregon-party-container { z-index: 51 !important; }

#karate-ui-overlay,
#class-progress,
#class-status-box { z-index: 52 !important; }

/* Arena banners */
#race-banner-panel,
#race2-banner-panel,
#race3-banner-panel,
#karate-banner-panel,
#class-banner-panel,
#chaoregon-banner-panel,
#adventure-banner-panel { z-index: 60 !important; }

/* ✅ Party Status Panel (above banners, below main UI) */
#party-status-panel { z-index: 70 !important; }

/* Chaoregon Map Layer */
#chaoregon-map-panel {
  z-index: 80 !important;
  pointer-events: auto;
}
#chaoregon-sidebar,
#chaoregon-sidebar-left,
#chaoregon-sidebar-right {
  z-index: 81 !important;
}

/* Trail HUD + background */
#trail-screen-panel { z-index: 100 !important; }

/* Arena + Mini-Game Results (UI layer) */
#chaoregon-results-panel,
#chaoregon-rewards {
  z-index: 2000 !important;
}

/* General UI panels */
#inventory-panel,
#shop-panel,
#stats-panel,
#focus-panel,
#journal-panel,
#trash-panel,
#partyhub-panel,
#paperdoll-panel,
#chaojanken-panel,
#chaoregon-log-panel {
  z-index: 150 !important;
}

/* ✅ Chaoregon Mini-Games — above everything except results/rewards */
#tree-shake-panel,
#toy-hunt-panel,
#bubble-pop-panel,
#fishing-panel,
#repair-panel,
#story-panel {
  position: absolute !important;
  z-index: 1800 !important; /* above camp, shop, river, trail */
}

/* ✅ Camp and Trail Shop Panels */
#trailshop-panel      { z-index: 1500 !important; }
#river-panel          { z-index: 1550 !important; }
#chaoregon-camp-panel { z-index: 1600 !important; }

/* ✅ Setup panel above all others except rewards */
#chaoregon-setup-panel {
  z-index: 1900 !important;
}
#chaoregon-setup-panel button { cursor: pointer !important; }

/* Debug + Toolbar */
#stats-debug-panel,
#global-log-panel,
#minigame-log-panel,
#debug-help-panel { z-index: 2500 !important; }
#toolbar-panel    { z-index: 3000 !important; }

/* Cursor */
#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;
}

/* ============================
   Chaoregon Minigame Panels
   ============================ */

/* Tree Shake */
#tree-shake-panel {
  background: url("assets/camp/forest.png") no-repeat center;
  background-size: cover;
  color: #fff;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
}

#treeHUD {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  padding: 6px;
  font-family: monospace;
  font-weight: bold;
  color: #fff;
  margin-bottom: 8px;
}

#treeHUD div {
  display: flex;
  justify-content: space-around;
  width: 100%;
}

#treeHUD span {
  margin: 0 8px;
}

#treeHUD small,
#treeHUD .controls-text {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  color: #ffd60a;
}

#treeGameZone {
  width: 360px;
  height: 240px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border: 2px solid #183d1c;
  background: #1b263b;
  border-radius: 8px;
}

#chaoCatcher {
  position: absolute;
  bottom: 10px;
  width: 32px;
  height: 32px;
  background-size: cover;
}

.fallingFruit {
  position: absolute;
  width: 24px;
  height: 24px;
  background-size: cover;
}

/* ✅ Results Summary */
.tree-results {
  color: #fff;
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 16px;
  border-radius: 8px;
  font-family: monospace;
}

.tree-results h3 {
  color: #ffd60a;
  margin-bottom: 8px;
}

.tree-results button {
  margin-top: 10px;
  padding: 6px 12px;
  background: #415a77;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
}

.tree-results button:hover {
  background: #537fa3;
}

/* ============================
   Toy Hunt Minigame
   ============================ */

#toy-hunt-panel {
  background: url("assets/camp/clearing.png") no-repeat center;
  background-size: cover;
  color: #fff;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
}

#toyHUD {
  text-align: center;
  font-family: monospace;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  padding: 4px;
  margin-bottom: 6px;
  color: #ffd60a;
}

#toy-instructions {
  text-align: center;
  font-size: 14px;
  margin-bottom: 8px;
}

#bushGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.bush {
  font-size: 20px;
  text-align: center;
  line-height: 28px;
  border: 1px solid #4a6fa5;
  border-radius: 6px;
  background: rgba(30, 30, 50, 0.6);
  transition: transform 0.1s ease;
}

.bush:hover {
  transform: scale(1.05);
}

.bush.searched {
  pointer-events: none;
  transform: scale(0.95);
  opacity: 0.7;
}

/* Results Section */
.toy-results {
  display: none;
  text-align: center;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  font-family: monospace;
}

.toy-results h3 {
  color: #ffd60a;
  margin-bottom: 6px;
}

.toy-results p {
  margin: 4px 0;
}

#toy-exit {
  margin-top: 10px;
  padding: 6px 12px;
  background: #415a77;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
}

#toy-exit:hover {
  background: #537fa3;
}

/* Bubble Pop */
#bubble-pop-panel {
  background: url("assets/camp/river.png") no-repeat center;
  background-size: cover;
  color: #fff;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
}

#bubbleHUD {
  display: flex;
  justify-content: space-around;
  align-items: center;
  color: #fff;
  font-weight: bold;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  padding: 4px;
  font-family: monospace;
  font-size: 14px;
}

#bubbleZone {
  border: 2px solid #4a6fa5;
  border-radius: 8px;
  background: #001f3f;
  position: relative;
  margin: 0 auto;
  overflow: hidden;
}

/* ✅ Post-Game Results */
.bubble-results {
  color: #fff;
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 16px;
  border-radius: 8px;
  font-family: monospace;
}

.bubble-results button {
  margin-top: 10px;
  padding: 6px 12px;
  background: #415a77;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: bold;
}

.bubble-results button:hover {
  background: #537fa3;
}

/* ============================
   Fishing Minigame Panel (Final Fixed)
   ============================ */
#fishing-panel {
  width: 700px;
  height: 450px;
  background: rgba(13, 27, 42, 0.95);
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  z-index: 1000 !important;
}

/* Scene area */
#fishing-scene {
  position: relative;
  width: 100%;
  height: 320px;
  background: url("assets/bgs/fishing_water.png") center/cover no-repeat;
  overflow: hidden;
  border-bottom: 2px solid #415a77;
}

/* Party leader Chao holder */
#fishing-chao-holder {
  position: absolute;
  bottom: 18px;
  right: 46px;
  width: 96px;
  height: 96px;
  pointer-events: none;
  overflow: visible;
  transform: scale(1.15);
  transform-origin: center bottom;
}
.fishing-chao-visible {
  position: absolute;
  bottom: 0;
  left: 0;
  transform: scale(1.2);
  transform-origin: center bottom;
}

/* Bobble */
#bobble {
  position: absolute;
  bottom: 140px;
  left: 150px;
  width: 16px;
  height: 16px;
  background: url("assets/ui/bobble.png") center/contain no-repeat;
  display: none;
  pointer-events: none;
}

/* Ripple */
#ripple {
  position: absolute;
  bottom: 140px;
  left: 150px;
  width: 32px;
  height: 32px;
  background: url("assets/ui/ripple.png") center/contain no-repeat;
  opacity: 0;
  display: none;
  pointer-events: none;
}
#ripple.active {
  display: block;
  animation: rippleFade 1s ease-out forwards;
}

/* Bite alert */
#bite-alert {
  position: absolute;
  bottom: 160px;
  left: 150px;
  font-size: 28px;
  font-weight: bold;
  color: #ff3;
  text-shadow: 0 0 6px #000;
  display: none;
  pointer-events: none;
}
#bite-alert.active {
  display: block;
  animation: alertFlash 0.8s ease-in-out;
}

/* Gameplay UI */
#fishing-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 130px;
  background: rgba(13, 27, 42, 0.95);
  border-top: 2px solid #415a77;
  text-align: center;
}

/* Catch text */
#catchResult {
  height: 24px;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 0 4px #000;
}

/* Buttons (shared) */
.ui-btn {
  background: #1b263b;
  border: 1px solid #415a77;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.ui-btn:hover {
  background: #415a77;
}

/* Results panel (appears only at end) */
#fishing-results {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(13, 27, 42, 0.95);
  border-top: 2px solid #415a77;
  height: 130px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
#fishing-results.active {
  display: flex;
  visibility: visible;
  opacity: 1;
}
#fishing-results h3 {
  margin: 6px 0;
  font-size: 18px;
  color: #ffd60a;
}
#fishing-results p {
  margin: 4px 0;
  color: #fff;
}
#fishing-results .ui-btn {
  margin-top: 8px;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Animations */
@keyframes rippleFade {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.8); }
}
@keyframes alertFlash {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ============================
   Repair Minigame (Reflex Bar Edition)
   ============================ */
#repair-panel {
  width: 440px;
  height: 280px;
  background: rgba(13, 27, 42, 0.95);
  border: 2px solid #415a77;
  border-radius: 10px;
  color: #fff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: 12px;
}

#repair-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Main horizontal hitbar */
#repair-hitbar {
  position: relative;
  width: 100%;
  height: 20px;
  display: flex;
  border: 1px solid #415a77;
  border-radius: 6px;
  overflow: hidden;
}

/* Color sections: total 100 pips ratioed to widths */
#repair-hitbar .bar-section.red {
  background: #a4161a;
  flex: 25;
}
#repair-hitbar .bar-section.yellow.left {
  background: #ffcc00;
  flex: 15;
}
#repair-hitbar .bar-section.green {
  background: #2ecc71;
  flex: 20;
}
#repair-hitbar .bar-section.yellow.right {
  background: #ffcc00;
  flex: 15;
}
#repair-hitbar .bar-section.red:last-child {
  background: #a4161a;
  flex: 25;
}

/* Moving marker */
#repair-marker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #fff;
  box-shadow: 0 0 4px #fff;
  left: 0%;
  pointer-events: none;
}

/* Results display */
#repair-result {
  font-size: 16px;
  color: #fff;
  min-height: 20px;
}

/* Start button */
#repair-start {
  background: #1b263b;
  border: 1px solid #415a77;
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
}
#repair-start:hover {
  background: #415a77;
}

/* Summary (end screen) */
.repair-summary {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(13, 27, 42, 0.95);
  border-top: 2px solid #415a77;
  padding: 10px;
  gap: 6px;
}
.repair-summary p {
  margin: 4px 0;
  color: #ffd60a;
}

/* Story Panel */
#story-panel {
  background: url("assets/camp/story_bg.png") no-repeat center;
  background-size: cover;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
}
#storyContent {
  margin-top: 10px;
  font-size: 14px;
  text-align: left;
}
#storyContent h3 {
  margin-bottom: 6px;
  color: #ffda77;
}

/* ============================
   Trail Camp Overlay + Campfire visuals
   ============================ */
#trail-camp-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
  z-index: 50 !important;
  transition: opacity 0.4s ease;
  opacity: 1;
}

#trail-camp-overlay.fade-out {
  opacity: 0;
}


/* ============================
   River Crossing Panel
   ============================ */
#river-panel {
  width: 400px;
  min-height: 300px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  color: #fff;
  display: none;
}
#river-panel h3 {
  font-size: 18px;
  color: #ffd60a;
  margin-bottom: 10px;
}
#river-panel p {
  margin: 8px 0 14px 0;
  font-size: 14px;
}
#river-panel button {
  display: block;
  width: 80%;
  margin: 6px auto;
  padding: 6px 12px;
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  transition: background 0.2s;
}
#river-panel button:hover {
  background: #5b63ff;
}

/* ============================
   Paper Doll Panel
   ============================ */
#paperdoll-panel {
  width: 320px;
  min-height: 300px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
  color: #fff;
  display: none; /* hidden until toggled */
}

#paperdoll-panel h3 {
  font-size: 16px;
  font-weight: bold;
  color: #ffd60a;
  text-shadow: 2px 2px 0px #000;
  margin: 0 0 8px 0;
  text-align: center;
}

#paperdoll-chao-select {
  width: 100%;
  margin-bottom: 10px;
  padding: 4px;
  background: #415a77;
  border: none;
  border-radius: 6px;
  color: #fff;
  pointer-events: auto !important;
}


#paperdoll-preview {
  width: 160px;
  height: 160px;
  margin: 0 auto 10px auto;
  border: 2px solid #415a77;
  border-radius: 8px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#paperdoll-preview canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

#paperdoll-slots {
  display: flex;
  justify-content: space-around;
  margin-top: 10px;
}

/* Slot styling (always squares, empty or filled) */
.equip-slot {
  width: 64px;
  height: 64px;
  border: 2px dashed #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
}

.equip-slot.empty {
  background: rgba(0,0,0,0.6); /* darker when empty */
  border: 2px dashed #415a77;
}

.equip-slot.dragover {
  border-color: #ffd60a;        /* highlight when dragging */
  background: rgba(255, 214, 10, 0.2);
}

.equip-slot img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* ============================
   Trail Shop Panel
   ============================ */
#trailshop-panel {
  width: 420px;
  min-height: 320px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  display: none; /* hidden until opened */
  z-index: 1500 !important;
}

#trailshop-panel h3 {
  font-size: 18px;
  font-weight: bold;
  color: #ffd60a;
  text-shadow: 2px 2px 0px #000;
  margin: 0 0 10px 0;
  text-align: center;
}

#trailshop-rings {
  text-align: center;
  font-weight: bold;
  margin-bottom: 10px;
  color: #ffd60a;
}

/* Tabs */
#trailshop-panel .tab-header {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}
.trailshop-tab {
  padding: 6px 12px;
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  transition: background 0.2s;
}
.trailshop-tab:hover {
  background: #5b63ff;
}
.trailshop-tab.active {
  background: #ffd60a;
  color: #000;
}

/* Inventory List */
#trailshop-inventory {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.trailshop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: rgba(0,0,0,0.4);
  border: 2px solid #415a77;
  border-radius: 6px;
}
.trailshop-item span {
  flex: 1;
}
.trailshop-item button {
  min-width: 60px;
  background: #ffd60a;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-weight: bold;
  transition: background 0.2s;
}
.trailshop-item button:hover {
  background: #ffea55;
}

/* Exit Button */
#trailshop-exit {
  display: block;
  margin: 12px auto 0 auto;
  padding: 6px 14px;
  background: #a02020;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  color: #fff;
  transition: background 0.2s;
}
#trailshop-exit:hover {
  background: #d03030;
}

/* ============================
   Chaoregon Camp Panel
   ============================ */
#chaoregon-camp-panel {
  width: 420px;
  min-height: 360px;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  display: none;
  z-index: 1600 !important;
  text-align: center;
}

#chaoregon-camp-panel h3 {
  font-size: 18px;
  font-weight: bold;
  color: #ffd60a;
  text-shadow: 2px 2px 0px #000;
  margin: 0 0 10px 0;
}

#chaoregon-camp-panel .camp-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  transition: background 0.2s, transform 0.1s;
}

#chaoregon-camp-panel .camp-btn:hover:not(:disabled) {
  background: #5b63ff;
  transform: scale(1.03);
}

#chaoregon-camp-panel .camp-btn:disabled {
  opacity: 0.5;
  background: #222;
}

#camp-exit-btn {
  margin-top: 10px;
  background: #a02020;
  border: none;
  border-radius: 6px;
  color: white;
  padding: 6px 12px;
  font-weight: bold;
  transition: background 0.2s;
}
#camp-exit-btn:hover {
  background: #d03030;
}

/* ============================
   Anchored Sidebar
   ============================ */
#anchored-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100vh;
  background: rgba(13, 27, 42, 0.85);
  border-right: 2px solid #415a77;
  z-index: 9998; /* below cursor, above all panels */
  overflow: hidden;
}

.sidebar-scroll {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 10px;
  scrollbar-width: thin;
  scrollbar-color: #415a77 #0d1b2a;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 8px;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background-color: #415a77;
  border-radius: 8px;
}

.sidebar-btn {
  display: block;
  width: 239px;
  height: 76px;
  margin: 6px auto;
  image-rendering: pixelated;
  user-select: none;
  transition: transform 0.1s ease, filter 0.1s ease;
}

.sidebar-btn:hover {
  transform: scale(1.03);
  filter: brightness(1.2);
}

.sidebar-btn:active {
  transform: scale(0.97);
  filter: brightness(0.8);
}

/* ============================
   Global Results Panel (Universal Minigame Results)
   ============================ */
#global-results-panel {
  width: 700px;
  min-height: 400px;
  background: rgba(13, 27, 42, 0.95);
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 0;
  color: #fff;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  overflow: hidden;
  z-index: 1000 !important;
}

/* Top banner strip */
#global-results-banner {
  width: 100%;
  height: 90px;
  background-size: cover;
  background-position: center;
  border-bottom: 2px solid #415a77;
  border-radius: 10px 10px 0 0;
}

/* Title text */
#global-results-title {
  font-size: 22px;
  font-weight: bold;
  margin: 10px 0;
  color: #ffd60a;
  text-shadow: 2px 2px 0 #000;
}

/* Body / content zone */
#global-results-body {
  flex: 1;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  padding: 10px;
  box-sizing: border-box;
}

/* Reward / summary list */
#global-results-list {
  width: 90%;
  text-align: left;
  margin-bottom: 10px;
  font-size: 14px;
}

.reward-block h4 {
  text-align: center;
  color: #ffd60a;
  margin-bottom: 4px;
  text-shadow: 1px 1px 2px #000;
}
.reward-block p {
  margin: 2px 0;
  text-align: center;
}

/* Chao result cards */
.result-chao-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 120px;
  text-align: center;
  color: white;
}
.result-chao-card .chao-wrap {
  width: 96px;
  height: 96px;
  position: relative;
}
.result-chao-card .placement {
  margin-top: 6px;
  font-weight: bold;
}

/* Footer / Finish button */
#global-results-footer {
  width: 100%;
  text-align: center;
  padding: 10px 0 16px 0;
  border-top: 2px solid #415a77;
}
#global-results-finish {
  background: #ffd60a;
  border: none;
  border-radius: 8px;
  padding: 8px 30px;
  font-weight: bold;
  font-size: 16px;
  transition: background 0.2s;
}
#global-results-finish:hover {
  background: #ffea55;
}

/* Responsive scale fallback */
@media (max-width: 800px) {
  #global-results-panel {
    width: 95%;
    transform: scale(0.9);
  }
}

/* ============================
   Karate Results — Fixed Layout
   ============================ */
#global-results-panel.karate-results #global-results-list {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 100px;
  margin-top: 20px;
  text-align: center;
  position: relative;
}

#global-results-panel.karate-results .result-chao-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 150px;
  position: relative;
  transform: none;
}

#global-results-panel.karate-results .result-chao-card img,
#global-results-panel.karate-results .result-chao-card div[data-chaoid],
#global-results-panel.karate-results .result-chao-card .chao-sprite {
  transform: scale(1.8);
  margin-bottom: 8px;
}

#global-results-panel.karate-results .placement {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  font-size: 15px;
  color: #ffea00;
  text-shadow: 1px 1px 2px #000;
}

#global-results-panel.karate-results .chao-name {
  font-size: 14px;
  color: #ffffff;
  text-shadow: 1px 1px 2px #000;
  margin-top: 6px;
}

/* ============================
   Race Results — Tiered Grid Layout
   ============================ */
#global-results-panel.race-results #global-results-list,
#global-results-panel.race2-results #global-results-list,
#global-results-panel.race3-results #global-results-list,
#global-results-panel.race2-league-results #global-results-list,
#global-results-panel.race3-league-results #global-results-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-top: 20px;
}

/* First-place row (single centered) */
.tier-first {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

/* Remaining rows (3 per row) */
.tier-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  justify-content: center;
  align-items: start;
  gap: 36px;
  width: 90%;
  max-width: 640px;
  margin: 0 auto;
}

.tier-row .result-chao-card,
.tier-first .result-chao-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#global-results-panel.race-results .placement {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  font-size: 15px;
  color: #ffd60a;
  text-shadow: 1px 1px 2px #000;
}

#global-results-panel.race-results .chao-name {
  font-size: 13px;
  color: #ffffff;
  text-shadow: 1px 1px 2px #000;
  margin-top: 6px;
}
/* ============================
   Class Results — Centered Title Only
   ============================ */
#global-results-panel.class-results #global-results-title {
  font-size: 26px;
  color: #ffea00;
  margin-top: 14px;
  text-shadow: 2px 2px 4px #000;
}

#global-results-panel.class-results #global-results-list {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 50px;
  margin-top: 40px;
  text-align: center;
}

#global-results-panel.class-results .result-chao-card {
  width: 120px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

#global-results-panel.class-results .placement {
  display: none; /* no ranks or winner labels */
}

#global-results-panel.class-results .chao-name {
  font-size: 14px;
  margin-top: 6px;
  color: #ffffff;
  text-shadow: 1px 1px 2px #000;
}

/* ============================
   Result Chao Visual Layers (Dot + Name + Title + Equip)
   ============================ */
.result-chao-card .chao-wrap .dot {
  position: absolute;
  top: -12px; /* slightly closer to head for scaled 1.5x Chao */
  left: 22%;
  transform: translateX(-50%) scale(1.8);
  z-index: 3;
  pointer-events: none;
}

.result-chao-card .chao-wrap .equip,
.result-chao-card .chao-wrap .equip-slot img {
  position: absolute;
  bottom: 0;
  left: 0;
  transform: scale(1.5);
  transform-origin: center bottom;
  pointer-events: none;
  z-index: 4;
}

.result-chao-card .chao-name {
  font-size: 13px;
  margin-top: 4px;
  color: #ffffff;
  text-shadow: 1px 1px 2px #000;
}

.result-chao-card .chao-title {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #ffd60a;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
  z-index: 5;
}


/* ============================
   Karate Dual Buttons (Standalone Panel)
   ============================ */
#party-karate-2p,
#party-karate-cpu {
  display: none; /* hidden by default, shown only when mode === karate */
  margin-top: 8px;
  padding: 8px 16px;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  background: #415a77;
  color: #fff;
  font-weight: bold;
  transition: background 0.2s, transform 0.1s;
}

#party-karate-2p:hover,
#party-karate-cpu:hover {
  background: #5b63ff;
  transform: scale(1.05);
}

#party-karate-2p {
  margin-right: 6px;
}

#party-karate-cpu {
  background: #006bff;
}

/* ============================
   Global Log Panel (Expanded)
   ============================ */
#global-log-panel {
  width: 700px;
  height: 550px;
  background: rgba(13, 27, 42, 0.9);
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  padding: 10px;
  display: none;
  flex-direction: column;
  overflow: visible; /* ✅ allow internal scroll areas */
  z-index: 1500 !important;
}

#global-log-panel h3 {
  text-align: center;
  color: #ffd60a;
  margin: 0 0 6px 0;
  font-weight: bold;
}

#global-log-panel .tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 6px;
}

#global-log-panel .tabs button {
  padding: 4px 8px;
  background: #415a77;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  transition: background 0.2s;
}

#global-log-panel .tabs button.active {
  background: #ffd60a;
  color: #000;
}

#global-log-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0; /* ✅ enables scrolling inside flex column */
  background: rgba(0,0,0,0.4);
  border: 1px solid #415a77;
  border-radius: 6px;
  padding: 6px;
  font-size: 13px;
  line-height: 1.3em;
  font-family: monospace;
}

#clear-global-log {
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  color: #fff;
  padding: 4px 10px;
  font-weight: bold;
  margin-top: 8px;
}

#clear-global-log:hover {
  background: #5b63ff;
}

/* ============================
   Mini-Game Log Panel (Mirror of Global, scroll fixed)
   ============================ */
#minigame-log-panel {
  width: 420px;
  height: 400px;
  background: rgba(13, 27, 42, 0.9);
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  padding: 10px;
  display: none;          /* hidden by default */
  flex-direction: column; /* stack children vertically */
  overflow: hidden;       /* contain scroll area like global log */
  z-index: 1500 !important;
}

#minigame-log-panel h3 {
  text-align: center;
  color: #ffd60a;
  margin: 0 0 6px 0;
  font-weight: bold;
  flex-shrink: 0;
}

#minigame-log-body {
  flex: 1 1 auto;         /* fill remaining space */
  min-height: 0;          /* enable scrolling in flex column */
  overflow-y: auto;       /* scrolling here */
  overflow-x: hidden;
  background: rgba(0,0,0,0.4);
  border: 1px solid #415a77;
  border-radius: 6px;
  padding: 6px;
  font-size: 13px;
  line-height: 1.3em;
  font-family: monospace;
}

#clear-minigame-log {
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  color: #fff;
  padding: 4px 10px;
  font-weight: bold;
  margin-top: 8px;
  flex-shrink: 0;         /* stays fixed below the scroll box */
}

#clear-minigame-log:hover {
  background: #5b63ff;
}

.xp-popup {
  font-family: "Arial", sans-serif;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
  animation: xpFloat 1.6s ease-out forwards;
}

.xp-popup.swim { color: #00ff88; }
.xp-popup.fly { color: #33ccff; }
.xp-popup.run { color: #ffd600; }
.xp-popup.power { color: #ff5555; }
.xp-popup.stamina { color: #bb66ff; }

@keyframes xpFloat {
  0%   { opacity: 0; transform: translate(-50%, 20px); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -40px); }
}

/* ============================
   Janken HUD + Layout Final Pass (Fixed)
   ============================ */
#chaojanken-panel {
  width: 540px;
  height: 460px;
  background: rgba(13, 27, 42, 0.95);
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
  color: #fff;
  position: absolute;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

/* Visibility toggle class (Option A) */
.hidden {
  display: none !important;
}

/* Play zone (larger) */
#janken-field {
  position: relative;
  width: 500px;
  height: 270px;
  margin: 0 auto 12px auto;
  border: 2px solid #415a77;
  border-radius: 8px;
  background: #000;
  overflow: hidden;
}

/* Hand row now lower */
#janken-hand {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
  margin-bottom: 20px;
}

.janken-card {
  width: 64px;
  height: 64px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
}

.janken-card .selector {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid #ffd60a;
  border-radius: 8px;
  display: none;
}

/* Projectile card (fired upward) */
.janken-shot {
  width: 64px;
  height: 64px;
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 20;
}

/* HUD — larger boxes, bottom-left corner */
#janken-ui {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  transform: scale(1.4);
  transform-origin: bottom left;
}

.janken-box {
  position: relative;
  width: 96px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-family: monospace;
  font-size: 16px;
  font-weight: bold;
  color: #ffd60a;
}

.janken-box .box-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.janken-box .box-icon {
  position: absolute;
  left: 6px;
  top: 4px;
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
}

/* HUD text fix — visible above background */
.janken-box span {
  position: relative;
  z-index: 2;
  color: #ffd60a;
  text-shadow: 1px 1px #000;
  font-family: monospace;
  font-size: 18px;
  font-weight: bold;
  right: 4px;
}

/* Controls centered and lower */
#janken-controls {
  margin-top: auto;
  text-align: center;
}

#janken-controls button {
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 8px;
  color: #fff;
  font-weight: bold;
  padding: 6px 18px;
  margin: 0 8px;
  transition: background 0.2s;
}

#janken-controls button:hover {
  background: #5b63ff;
}

/* Optional: disabled button style */
#janken-controls button:disabled {
  opacity: 0.5;
}

/* ============================
   Race Mode Select Panels
   ============================ */
.racemode-panel,
.racecourse-panel {
  width: 900px;
  height: 520px;
  background: radial-gradient(circle at center, rgba(20,40,60,0.95), rgba(10,15,25,0.95));
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  text-align: center;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.racemode-title {
  font-size: 26px;
  font-weight: bold;
  margin: 20px 0;
  color: #ffedb5;
  text-shadow: 0 0 8px #223;
}

.racemode-mainwrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 80px;
  margin-top: 80px;
}

.racemode-bigbtn {
  width: 260px;
  height: 120px;
  border: 2px solid #778;
  border-radius: 14px;
  background: linear-gradient(180deg, #1e2a3a, #111a24);
  font-size: 32px;
  font-weight: bold;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
}
.racemode-bigbtn:hover {
  background: linear-gradient(180deg, #28384c, #151e2a);
  transform: scale(1.05);
}

.racecourse-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 40px;
  padding: 10px;
}

.racemode-btn {
  width: 250px;
  height: 220px;
  border: 2px solid #415a77;
  border-radius: 12px;
  background: rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
}
.racemode-btn img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.racemode-btn span {
  font-size: 16px;
  font-weight: bold;
  padding: 6px 0;
  color: #fff;
  background: rgba(65,90,119,0.6);
  width: 100%;
}
.racemode-btn:hover {
  transform: scale(1.05);
  border-color: #aaf;
}

.racemode-back {
  position: absolute;
  top: 12px;
  left: 16px;
  background: #223;
  color: #fff;
  border: 1px solid #556;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
}
.racemode-back:hover { background: #334; }

/* ============================
   Custom Garden Editor Styles (Grid Checkerboard Fix)
   ============================ */
#garden-editor-panel {
  width: 1020px;
  height: 1100px;
  background: rgba(10,15,20,0.95);
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  padding: 8px;
  overflow: hidden;
  top: 40px;
  left: 40px;
  z-index: 9999;
}

#editor-toolbar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  background: rgba(20,30,40,0.9);
  padding: 5px;
  border-radius: 6px;
}

#editor-toolbar button {
  background: #1b263b;
  color: #fff;
  border: 1px solid #415a77;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  user-select: none;
}
#editor-toolbar button.active {
  background: #778da9;
  color: #000;
}

#editor-grid {
  width: 1500px;
  height: 850px;
  display: grid;
  grid-template-columns: repeat(100, 10px);
  grid-template-rows: repeat(100, 10px);
  margin: 0 auto;
  cursor: crosshair;
  border: 2px solid #415a77;
  background-color: #00C000;
  background-image:
    linear-gradient(45deg, #00C000 25%, transparent 25%),
    linear-gradient(-45deg, #00C000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #00C000 75%),
    linear-gradient(-45deg, transparent 75%, #00C000 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.tile {
  width: 10px;
  height: 10px;
  box-sizing: border-box;
}

.tile:hover {
  outline: 1px solid yellow !important;
} 

/* Override default tile colors */
.tile.grass { background: transparent; }
.tile.water { background: #2196f3; }
.tile.climb { background: #8d6e63; }
.tile.wall { background: #555555; }
.tile.border { background: #212121; }
.tile.sky { background: #81d4fa; }

.garden-decor {
  image-rendering: pixelated;
}

.garden-decor.shake {
  animation: treeShake 0.4s ease-in-out infinite alternate;
}
@keyframes treeShake {
  from { transform: rotate(-3deg); }
  to { transform: rotate(3deg); }
}

.tree-fruit {
  image-rendering: pixelated;
  z-index: 1;
}

#grid-overlay {
  z-index: 20;
  pointer-events: none;
}

/* ============================================================
   GLOBAL MULTIPLAYER VISUAL LAYERS
   ============================================================ */

#mp-cursor-layer,
#mp-avatar-layer,
#mp-chatbubble-layer {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

#mp-cursor-layer  { z-index: 5000; }
#mp-avatar-layer  { z-index: 5001; }
#mp-chatbubble-layer { z-index: 5002; }

/* Chat bubble base style */
#mp-chatbubble-layer div {
  font-size: 13px;
  background: rgba(255,255,255,0.9);
  color: #000;
  border-radius: 12px;
  padding: 4px 8px;
  pointer-events: none;
  transition: opacity 0.3s linear;
  white-space: nowrap;
}

/* ============================================================
   MP PANELS SHARED AESTHETIC
   ============================================================ */

.panel {
  position: absolute;
  background: rgba(13, 27, 42, 0.92);
  border: 2px solid #415a77;
  border-radius: 12px;
  padding: 10px;
  color: #fff;
  z-index: 2000;
}

.panel h2, .panel h3 {
  margin: 0 0 8px 0;
  padding: 0;
  color: #fff;
  text-shadow: 0 0 3px #000;
}

/* Close buttons */
.panel button {
  background: #415a77;
  color: #fff;
  border: 1px solid #778da9;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  font-size: 14px;
}

.panel button:hover {
  background: #527aa3;
}

/* Draggable cursor (optional override) */
.panel.draggable {
  cursor: move;
}

/* ============================================================
   TOP-LEVEL MP BUTTONS
   ============================================================ */

.panel-btn {
  background: #415a77;
  border: 2px solid #778da9;
  border-radius: 8px;
  padding: 6px 10px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  z-index: 2500;
}

.panel-btn:hover {
  background: #527aa3;
}

/* ============================================================
   MP CONNECT PANEL
   ============================================================ */

#mp-connect-panel {
  width: 360px;
  background: rgba(13,27,42,0.95);
}

#mp-connect-panel input {
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #415a77;
  background: rgba(0,0,0,0.5);
  color: #fff;
}

#mp-status-box {
  background: rgba(255,255,255,0.1);
  border: 1px solid #415a77;
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
}

/* ============================================================
   MP CHAT PANEL
   ============================================================ */

#mp-chat-panel {
  width: 300px;
  background: rgba(13,27,42,0.95);
}

#mp-chat-log {
  background: rgba(0,0,0,0.35);
  border-radius: 6px;
  border: 1px solid #415a77;
  font-size: 13px;
}

#mp-chat-input {
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  background: rgba(0,0,0,0.5);
  border: 1px solid #415a77;
  color: #fff;
}

/* ============================================================
   MP ARENAS HUB PANEL
   ============================================================ */

#mp-arenas-panel {
  width: 300px;
  background: rgba(13,27,42,0.95);
}

#mp-arenas-panel button {
  width: 100%;
  margin-bottom: 8px;
}

/* ============================================================
   MP RACE PANEL
   ============================================================ */

#mp-race-panel {
  width: 420px;
  background: rgba(13,27,42,0.95);
}

#mp-race-panel button {
  width: auto;
}

#mp-track-vote-options button {
  width: 100%;
}

#mp-track-vote-tally {
  background: rgba(0,0,0,0.3);
  border: 1px solid #415a77;
  border-radius: 6px;
  padding: 6px;
  font-size: 13px;
}

#mp-race-selected div {
  background: rgba(255,255,255,0.05);
}

/* ============================================================
   MP KARATE PANEL
   ============================================================ */

#mp-karate-panel {
  width: 420px;
  background: rgba(13,27,42,0.95);
}

#mp-karate-selected {
  background: rgba(0,0,0,0.3);
}

#mp-karate-selected div {
  background: rgba(255,255,255,0.05);
}

/* ============================================================
   MP CHAOREGON TRAIL PANEL
   ============================================================ */

#mp-trail-panel {
  width: 440px;
  background: rgba(13,27,42,0.95);
}

#mp-trail-selected {
  background: rgba(0,0,0,0.35);
}

#mp-trail-selected div {
  background: rgba(255,255,255,0.05);
}

#mp-trail-mode button {
  width: 100%;
}

#mp-trail-mode-display {
  background: rgba(0,0,0,0.25);
  font-size: 14px;
}




/* === FINAL OVERRIDE: Force Toolbar Top-Left beside Sidebar === */
#toolbar-panel {
  position: fixed !important;
  top: 1px !important;
  left: 1035px !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  margin: 0 !important;
}

/* ============================
   ABSOLUTE GLOBAL CURSOR SUPPRESSION (vFinal + Native UI Fix)
   ============================ */

/* Disable OS cursor on every visual layer */
html, body, *, *::before, *::after {
  cursor: none !important;
}

/* Scrollable and interactive UI regions */
html, body,
#anchored-sidebar,
#anchored-sidebar *,
.sidebar-scroll,
.sidebar-scroll *,
.panel,
.panel *,
.tabs,
.tabs *,
.tab,
.tab *,
button,
button *,
a,
a *,
label,
label *,
input,
input *,
select,
select *,
option,
textarea,
textarea * {
  cursor: none !important;
}

/* Force cursor suppression inside scrollbars + shadow regions */
::-webkit-scrollbar,
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-track,
::-webkit-resizer,
::-webkit-scrollbar-corner {
  cursor: none !important;
}

/* Suppress native dropdown cursors */
select:focus,
select:active,
option:focus,
option:active {
  cursor: none !important;
}

/* Shadow-root workaround for internal form UIs */
:host,
:root {
  cursor: none !important;
}

/* ============================
   Remove native dropdown + scrollbar UI
   ============================ */

/* Replace OS dropdown with custom-styled box */
select {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-color: #415a77 !important;
  border: 2px solid #ffd60a !important;
  border-radius: 6px !important;
  padding: 2px 10px !important;
  color: #fff !important;
}
select::-ms-expand {
  display: none;
}

/* Scrollbar removal (still scrollable by wheel/drag) */
* {
  scrollbar-width: none !important; /* Firefox */
}
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent !important;
  cursor: none !important;
}
