/* Trail panel window controls intentionally use the global .std-panel-controls contract. */
/* Bubble Pop keeps the upgraded shell here; Chaoregon setup is owned by the later setup authority block. */
#bubble-pop-panel {
  background:
    linear-gradient(180deg, rgba(18, 29, 44, 0.96), rgba(9, 15, 25, 0.985)) !important;
  border: 2px solid rgba(96, 131, 171, 0.82) !important;
  border-radius: 24px !important;
  box-shadow:
    0 18px 38px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.035) !important;
}

#bubble-pop-panel > .panel-header {
  min-height: 54px !important;
  height: 54px !important;
  padding: 0 14px 0 18px !important;
  background:
    linear-gradient(180deg, rgba(66, 100, 139, 0.92), rgba(26, 42, 64, 0.96)) !important;
  border-bottom: 1px solid rgba(255,255,255,0.10) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 -1px 0 rgba(0,0,0,0.22);
}

#bubble-pop-panel > .panel-header .panel-title {
  color: #eef6ff !important;
  font-weight: 800;
  letter-spacing: 0.35px;
}

#bubble-pop-panel > .panel-body.bubble-pop-body {
  padding: 16px !important;
  background:
    radial-gradient(circle at top center, rgba(64, 104, 145, 0.14), transparent 48%),
    linear-gradient(180deg, rgba(15, 24, 37, 0.95), rgba(8, 14, 24, 0.98)) !important;
}

#bubble-pop-panel .bubble-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(114, 153, 196, 0.20);
  background: linear-gradient(180deg, rgba(21, 34, 51, 0.94), rgba(10, 17, 27, 0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

#bubble-pop-panel .bubble-hud > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: #e9f3ff;
  font-weight: 700;
}

#bubble-pop-panel #bubbleZone {
  margin-top: 14px;
  border-radius: 20px;
  border: 1px solid rgba(118, 158, 201, 0.18);
  background:
    radial-gradient(circle at top center, rgba(94, 148, 215, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(20, 31, 48, 0.92), rgba(9, 16, 27, 0.97));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

#chaoregon-setup-panel #chaoregon-leader,
#chaoregon-setup-panel #setup-party-preview,
#chaoregon-setup-panel #setup-shop {
  padding: 14px;
}

#chaoregon-setup-panel #chaoregon-starting-rings,
#chaoregon-setup-panel .setup-rings-left {
  padding: 12px 14px;
}

#chaoregon-setup-panel .shop-row {
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

#chaoregon-setup-panel .shop-row:first-of-type {
  border-top: 0;
}

/* ============================================================
   Panel style pass 8 — results/header cleanup + remaining Chaoregon family
   + classroom duplicate controls/seat alignment
   ============================================================ */

/* Results panel duplicate body/list authority block trimmed here.
   Later global-results layout + root-shell blocks remain authoritative. */

/* Remaining Chaoregon Trail subpanels / minigame family */
#toy-hunt-panel.panel {
  position: absolute !important;
  z-index: 1800 !important; /* above camp, shop, river, trail */
}

:is(#tree-shake-panel,
    #toy-hunt-panel,
    #fishing-panel,
    #repair-panel,
    #river-panel,
    #trailshop-panel,
    #chaoregon-camp-panel) {
  min-width: 0;
  min-height: 0;
}

:is(#tree-shake-panel,
    #toy-hunt-panel,
    #fishing-panel,
    #repair-panel,
    #river-panel,
    #trailshop-panel,
    #chaoregon-camp-panel) > .panel-header {
  flex: 0 0 auto;
  min-width: 0;
}

:is(#tree-shake-panel,
    #toy-hunt-panel,
    #fishing-panel,
    #repair-panel,
    #river-panel,
    #trailshop-panel,
    #chaoregon-camp-panel) > .panel-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

:is(#tree-shake-panel,
    #toy-hunt-panel,
    #fishing-panel,
    #repair-panel,
    #river-panel,
    #trailshop-panel,
    #chaoregon-camp-panel) > .panel-body > * {
  min-width: 0;
}

#tree-shake-panel .tree-shake-body,
#toy-hunt-panel .toy-hunt-body,
#repair-panel .repair-panel-body,
#river-panel .river-panel-body,
#trailshop-panel .trailshop-panel-body,
#chaoregon-camp-panel .chaoregon-camp-body,
#trailshop-panel .trail-shop-shell,
#chaoregon-camp-panel #chaoregon-log-output {
  min-width: 0;
  min-height: 0;
}

#fishing-panel #fishing-scene,
#fishing-panel #fishing-ui,
#fishing-panel #fishing-results,
#repair-panel #repair-zone,
#repair-panel .repair-summary,
#river-panel p,
#river-panel button,
#chaoregon-camp-panel .camp-btn {
  min-width: 0;
  min-height: 0;
}

/* ============================
   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: 100%;
  object-fit: none;          /* ✅ */
  object-position: 0 0;      /* ✅ */
  image-rendering: pixelated;
}
