/* Extracted from style.css: trail family foundation + late safe-first trail authority blocks */

/* ============================
   Chaoregon Trail
   ============================ */

/* === MAIN CHAOREGON BG PANEL === */


/* Legacy split support (kept) */
#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;
}

/* === AWAY PARTY === */
#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)
   ============================ */


#chaoregon-map-panel > .panel-body.chaoregon-map-panel-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: row;
  min-height: 0;
  padding: 0;
}

/* --- Left: Map Area --- */
#chaoregon-map-panel .map-area {
  flex: 0 0 800px;
  height: 100%;
  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;
  image-rendering: pixelated;
  pointer-events: none;
  transition: right 0.4s linear;
}

/* --- Right: Sidebar Split --- */
#chaoregon-sidebar {
  flex: 0 0 600px;
  height: 100%;
  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;
  z-index: 81 !important;
}

/* --- Left Half --- */
#chaoregon-sidebar-left {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #415a77;
  box-sizing: border-box;
  min-height: 0;
  z-index: 81 !important;
}

/* Divider */
.chaoregon-divider {
  height: 2px;
  background: #415a77;
  margin: 4px 0;
}

/* Day Controls */
#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);
}

/* 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;
  min-height: 0;
}

/* --- Right Half --- */
#chaoregon-sidebar-right {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  overflow-y: auto;
  box-sizing: border-box;
  min-height: 0;
  z-index: 81 !important;
}

#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;
}

/* Party Left */
#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);
}

/* Party 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
   ============================ */


#trail-screen-panel h3 {
  color: #ffd60a;
  margin-bottom: 6px;
  font-size: 18px;
  text-align: center;
}

/* Canvas */


/* ============================
   Trail HUD
   ============================ */


/* Left HUD */
#trail-hud-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #415a77;
  box-sizing: border-box;
  min-height: 0;
  overflow: hidden;
}

.trail-divider {
  height: 2px;
  background: #415a77;
  margin: 4px 0;
}

/* Controls */
#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 */
#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 */
#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;
  height: 0;              /* CRITICAL for flex scrolling */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  font-size: 13px;
  line-height: 1.3em;
  word-wrap: break-word;
  word-break: break-word;
}

/* Right HUD */


#trail-hud-right h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #ffd60a;
  text-align: center;
}

/* Party */




#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,
#trail-party-stats > .party-member > canvas {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  border: 2px solid #415a77;
  border-radius: 6px;
  background: rgba(0,0,0,0.5);
  flex: 0 0 auto;
}

#trail-party-stats .party-stats {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  font-size: 11px;
  line-height: 1.25em;
  margin-left: 0;
  min-width: 0;
}

/* ============================
   Chaoregon Minigame Panels
   ============================ */

/* Tree Shake */


#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;
}



#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.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(6, 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 */


#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;
}



/* ✅ 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)
   ============================ */


/* Scene area */


/* 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-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;
}

