/* ============================================================
   10-party-shared-mp.css
   Extracted PartyModeMP + Shared Garden MP family.
   Safe-first pass: keeps mixed arena/lobby/social leftovers in style.css
   when they still share selectors with other domains.
   ============================================================ */

/* ============================================================
   PARTY MODE PANEL (MP meta loop)
   ============================================================ */
#party-mode-panel {
  overflow: hidden;
}

#party-mode-panel .party-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

#party-mode-panel .party-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

#party-mode-panel .party-subline {
  font-size: 12px;
  opacity: 0.82;
  margin-top: 2px;
}

#party-mode-panel .party-subtitle {
  font-size: 12px;
  opacity: 0.8;
  flex: 0 1 auto;
  margin-left: auto;
  margin-right: 8px;
}

#party-mode-panel .party-round-info {
  padding: 8px 12px;
  font-size: 13px;
  opacity: 0.95;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

#party-mode-panel .party-next {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.14);
}

#party-mode-panel .party-next-header {
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.78;
  margin-bottom: 4px;
}

#party-mode-panel .party-next-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

#party-mode-panel .party-next-controls {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 6px;
}

#party-mode-panel .party-next-desc {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.25;
}

#party-mode-panel .party-body {
  display: flex;
  gap: 12px;
  padding: 12px;
  flex: 1;
  min-height: 0;
}

#party-mode-panel .party-left {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

#party-mode-panel .party-right {
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  min-height: 0;
}

#party-mode-panel .party-player-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* PartyModeMP: unified vote / chosen / tally dock */
#party-mode-panel .party-round-dock {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  padding: 10px;
}

#party-mode-panel .party-dock-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

#party-mode-panel .party-dock-title {
  font-size: 14px;
  font-weight: 800;
}

#party-mode-panel .party-dock-sub {
  font-size: 12px;
  opacity: 0.8;
}

#party-mode-panel .party-next-countdown {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
  opacity: 0.95;
}

#party-mode-panel .party-next-countdown-num {
  font-size: 16px;
  font-weight: 900;
}

#party-mode-panel .party-vote-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#party-mode-panel .party-vote-tile2,
#party-mode-panel .party-chosen-card {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px;
  background: rgba(0,0,0,0.22);
}

#party-mode-panel .party-vote-tile2.winner {
  outline: 2px solid rgba(255,255,255,0.60);
}

#party-mode-panel .party-tile-title {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 4px;
}

#party-mode-panel .party-tile-meta {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 8px;
}

#party-mode-panel .party-tile-desc {
  font-size: 12px;
  opacity: 0.88;
  line-height: 1.25;
  margin-bottom: 8px;
}

#party-mode-panel .party-tile-points {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 10px;
}

#party-mode-panel .party-dock-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

#party-mode-panel .party-demo-video-inline {
  width: 100%;
  height: 170px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(0,0,0,0.25);
}

#party-mode-panel .party-slot {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px;
  background: rgba(0,0,0,0.22);
}

#party-mode-panel .party-slot.winner {
  outline: 2px solid rgba(255,255,255,0.60);
}

#party-mode-panel .party-slot-title {
  font-size: 12px;
  letter-spacing: 0.6px;
  opacity: 0.85;
  margin-bottom: 4px;
}

#party-mode-panel .party-slot-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#party-mode-panel .party-slot-chao {
  font-size: 12px;
  opacity: 0.85;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#party-mode-panel .party-slot-pts {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.92;
}

#party-mode-panel .party-slot-pts span {
  font-weight: 800;
  font-size: 16px;
}

/* Player slot accent colors */
#party-mode-panel .party-slot.p1 { border-left: 6px solid rgba(220, 60, 60, 0.85); }
#party-mode-panel .party-slot.p2 { border-left: 6px solid rgba(70, 120, 220, 0.85); }
#party-mode-panel .party-slot.p3 { border-left: 6px solid rgba(230, 200, 70, 0.85); }
#party-mode-panel .party-slot.p4 { border-left: 6px solid rgba(70, 200, 120, 0.85); }

/* Setup */
#party-mode-panel .party-section {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  padding: 10px;
}

#party-mode-panel .party-section-title {
  font-size: 12px;
  letter-spacing: 0.6px;
  opacity: 0.78;
  margin-bottom: 6px;
}

#party-mode-panel .party-checklist {
  display: grid;
  /* EXACTLY two columns (no scroll list). */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

/* PartyModeMP: per-minigame row w/ Controls button */
#party-mode-panel .party-game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#party-mode-panel .party-game-row .party-check {
  flex: 1;
  min-width: 0;
}

#party-mode-panel .party-btn-mini {
  padding: 6px 10px;
  font-size: 12px;
}

/* PartyModeMP: Controls panel */
#party-controls-panel {
  overflow: hidden;
}

#party-controls-panel > .panel-header {
  min-width: 0;
  flex: 0 0 auto;
}

#party-controls-panel > .panel-header > .panel-title {
  min-width: 0;
}

#party-controls-panel > .panel-header > .panel-header-controls {
  flex: 0 0 auto;
}

#party-controls-panel .party-controls-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  padding: 10px;
  height: calc(100% - 38px);
  overflow: auto;
  scrollbar-gutter: stable;
}

#party-controls-panel .party-controls-section {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  background: rgba(0,0,0,0.20);
}

#party-controls-panel .party-controls-label {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#party-controls-panel .party-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0;
}

#party-controls-panel .party-controls-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#party-controls-panel .party-controls-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 2px;
}

#party-controls-panel .party-demo-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 10px 0;
}

#party-controls-panel .party-demo-tab {
  cursor: pointer;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.20);
  color: #fff;
  opacity: 0.9;
}

#party-controls-panel .party-demo-tab.active {
  opacity: 1;
  border-color: rgba(255,255,255,0.32);
  background: rgba(255,255,255,0.08);
}

#party-controls-panel .party-demo-wrap {
  position: relative;
  width: 100%;
}

#party-controls-panel .party-demo-video {
  width: 100%;
  height: 210px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.10);
}

#party-controls-panel .party-demo-hint {
  margin-top: 8px;
  font-size: 11px;
  opacity: 0.65;
}

#party-controls-panel .party-controls-section,
#party-controls-panel .party-controls-row,
#party-controls-panel .party-controls-right,
#party-controls-panel .party-demo-wrap,
#party-controls-panel .party-demo-video {
  min-width: 0;
  min-height: 0;
}

#party-controls-panel .party-demo-wrap {
  overflow: auto;
  scrollbar-gutter: stable;
}

#party-controls-panel .party-demo-tabs,
#party-controls-panel .party-demo-hint {
  flex: 0 0 auto;
}

#party-mode-panel .party-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  opacity: 0.95;
}

#party-mode-panel .party-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#party-mode-panel .party-select {
  width: 90px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.22);
  color: #fff;
}

#party-mode-panel .party-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

#party-mode-panel .party-flow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

#party-mode-panel .party-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

#party-mode-panel .party-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(70, 120, 220, 0.55);
  color: #fff;
  cursor: pointer;
}

#party-mode-panel .party-btn:hover { filter: brightness(1.1); }

#party-mode-panel .party-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

#party-mode-panel .party-btn-danger {
  background: rgba(180, 60, 60, 0.65);
}

/* Tally overlay */
#party-mode-panel .party-tally {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

#party-mode-panel .party-tally-card {
  width: 520px;
  max-width: 95%;
  background: rgba(20, 24, 30, 0.96);
  border: 2px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  padding: 12px;
}

#party-mode-panel .party-tally-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
}

#party-mode-panel .party-tally-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

#party-mode-panel .party-tally-row {
  display: grid;
  grid-template-columns: 1fr 70px 120px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(0,0,0,0.20);
}

#party-mode-panel .party-tally-row.winner {
  outline: 2px solid rgba(255,255,255,0.55);
}

#party-mode-panel .party-tally-mid {
  font-weight: 800;
  text-align: center;
}

#party-mode-panel .party-tally-right {
  text-align: right;
  opacity: 0.92;
}

#party-mode-panel .party-pill {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 6px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.18);
}

#party-mode-panel .party-pill.p1 { background: rgba(220, 60, 60, 0.35); }
#party-mode-panel .party-pill.p2 { background: rgba(70, 120, 220, 0.35); }
#party-mode-panel .party-pill.p3 { background: rgba(230, 200, 70, 0.35); }
#party-mode-panel .party-pill.p4 { background: rgba(70, 200, 120, 0.35); }

#party-mode-panel .party-tally-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Vote overlay */
#party-mode-panel .party-vote {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

#party-mode-panel .party-vote-card {
  width: 760px;
  max-width: 96%;
  background: rgba(20, 24, 30, 0.96);
  border: 2px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  padding: 12px;
}

#party-mode-panel .party-vote-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

#party-mode-panel .party-vote-title {
  font-size: 16px;
  font-weight: 800;
}

#party-mode-panel .party-vote-countdown {
  font-size: 12px;
  opacity: 0.85;
}

#party-mode-panel .party-vote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#party-mode-panel .party-vote-choice-body {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(0,0,0,0.20);
  padding: 10px;
  min-height: 130px;
  margin-bottom: 8px;
}

#party-mode-panel .party-vote-choice-body.winner {
  outline: 2px solid rgba(255,255,255,0.55);
}

#party-mode-panel .party-vote-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

#party-mode-panel .party-vote-gm { font-weight: 800; }
#party-mode-panel .party-vote-rt { opacity: 0.85; }

#party-mode-panel .party-vote-teams {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  opacity: 0.95;
}

#party-mode-panel .party-vote-status {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.9;
}

/* ============================
   Shared Garden Panel
   ============================ */
.shared-garden-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
}
.shared-garden-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shared-garden-row label,
.shared-garden-roster-title,
.shared-garden-status {
  font-weight: 700;
}
.shared-garden-code-row {
  display: flex;
  gap: 8px;
}
#shared-garden-code,
#shared-garden-chao-select {
  width: 100%;
  min-height: 32px;
  box-sizing: border-box;
}
.shared-garden-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.shared-garden-actions button {
  flex: 1 1 120px;
}
.shared-garden-status {
  min-height: 18px;
  color: #d7ecff;
}
.shared-garden-roster-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.shared-garden-roster {
  min-height: 120px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0,0,0,0.18);
}
.shared-garden-player-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.shared-garden-player-row:last-child {
  border-bottom: none;
}
.shared-garden-player-meta {
  opacity: 0.8;
  font-size: 12px;
}

.shared-garden-empty {
  opacity: 0.8;
  padding: 8px 6px;
}
.shared-garden-player-name {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  font-weight:700;
}
.shared-garden-player-chao {
  font-size:12px;
  opacity:0.9;
}
.shared-garden-role-badges {
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-left:8px;
}
.shared-garden-badge {
  display:inline-flex;
  align-items:center;
  min-height:20px;
  padding:0 6px;
  border:1px solid rgba(255,255,255,0.22);
  border-radius:999px;
  font-size:11px;
  line-height:18px;
}
.shared-garden-badge.is-host {
  font-weight:700;
}
.shared-garden-badge.is-mod {
  font-weight:700;
}
.shared-garden-player-actions {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
}
.shared-garden-mini-btn {
  min-width:74px;
  padding:4px 8px;
}
.shared-garden-mini-btn.is-danger {
  font-weight:700;
}

/* =========================
   Shared Garden World
   ========================= */
#shared-garden-world-panel {
  min-width: 960px;
  min-height: 640px;
  overflow: hidden;
  z-index: 9051;
}

#shared-garden-world-panel .panel-body.shared-garden-world-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: calc(100% - 34px);
  padding: 0;
  box-sizing: border-box;
}

.shared-garden-world-hint {
  display: none;
}

#shared-garden-world-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 420px;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
  border: 0;
}

.shared-garden-world-stage {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  image-rendering: pixelated;
}

.shared-garden-avatar {
  --sg-scale: 1.5;
  position: absolute;
  width: 96px;
  height: 128px;
  pointer-events: none;
}

.shared-garden-avatar-visual {
  position: relative;
  width: 48px;
  height: 48px;
  overflow: visible;
  transform: scale(var(--sg-scale));
  transform-origin: top left;
}

.shared-garden-world-ctl-btn,
.shared-garden-world-minimize-btn {
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  font-size: 14px;
  line-height: 1;
}

.shared-garden-world-minimize-btn {
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  font-size: 18px;
  line-height: 1;
}

.shared-garden-avatar-equip {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  display: none;
  image-rendering: pixelated;
  object-fit: none;
  transform-origin: top left;
}
.shared-garden-avatar-equip.equip-body {
  z-index: 2;
  transform: translate(0px, 4px) scale(0.5);
}
.shared-garden-avatar-equip.equip-head {
  z-index: 3;
  transform: translate(11px, -4px) scale(0.5);
}
.shared-garden-avatar-equip.equip-face {
  z-index: 4;
  transform: translate(10px, 7px) scale(0.5);
}
.shared-garden-avatar-equip.equip-medal {
  z-index: 4;
  transform: translate(5px, 10px) scale(0.5);
}

.shared-garden-avatar-img,
.shared-garden-avatar-eyes,
.shared-garden-avatar-mouth {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  transform-origin: top left;
}

.shared-garden-avatar-img {
  object-fit: none;
  z-index: 1;
}

.shared-garden-avatar-eyes,
.shared-garden-avatar-mouth {
  background-repeat: no-repeat;
  background-size: 144px 192px;
}

.shared-garden-avatar-eyes {
  z-index: 2;
  transform: translate(10px, 10px) scale(0.54);
}

.shared-garden-avatar-mouth {
  z-index: 3;
  transform: translate(16px, 18px) scale(0.24);
}

.shared-garden-avatar-dot {
  position: absolute;
  width: 48px;
  height: 48px;
  left: calc(50% + 10px);
  top: -24px;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 10;
  object-fit: none;
  object-position: 0px 0px;
  transform: translateX(-50%) translateX(-3px) scale(0.75);
  transform-origin: center top;
}

.shared-garden-avatar-label {
  margin-top: 32px;
  padding: 1px 4px;
  min-width: max-content;
  font-size: 10px;
  line-height: 1.2;
  color: #fff;
  background: rgba(0,0,0,0.55);
  border-radius: 4px;
  transform: translateX(-8px);
}

.shared-garden-avatar.is-local .shared-garden-avatar-label {
  background: rgba(44, 136, 255, 0.72);
}

#party-mode-panel {
  width: 1120px;
  height: 680px;
  min-width: 0;
  min-height: 0;
  max-width: min(1120px, calc(var(--app-authored-width) - 24px));
  max-height: min(680px, calc(var(--app-authored-height) - 24px));
  z-index: 9800;
}

#party-mode-panel > .panel-body.party-panel-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;

  min-width: 0;
  min-height: 0;
}

#party-mode-panel .party-round-info,
#party-mode-panel .party-next {
  flex: 0 0 auto;
}

#party-mode-panel .party-body,
#party-mode-panel .party-left,
#party-mode-panel .party-right,
#party-mode-panel .party-round-dock {
  min-height: 0;
  min-width: 0;
}

#party-mode-panel .party-right {
  width: 340px;
}

#party-mode-panel .party-checklist {
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

#party-mode-panel .party-vote-card,
#party-mode-panel .party-tally-card {
  max-height: calc(var(--app-authored-height) - 72px);
  display: flex;
  flex-direction: column;
}

#party-mode-panel .party-vote-grid,
#party-mode-panel .party-tally-body {
  min-height: 0;
  overflow: auto;
}


#party-mode-panel .party-header,
#party-mode-panel .party-actions,
#party-mode-panel .party-round-info,
#party-mode-panel .party-next {
  flex: 0 0 auto;
  min-width: 0;
}

#party-mode-panel .party-body,
#party-mode-panel .party-left,
#party-mode-panel .party-right,
#party-mode-panel .party-vote,
#party-mode-panel .party-tally {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

#party-mode-panel .party-title-wrap,
#party-mode-panel .party-subtitle,
#party-mode-panel .panel-header-controls {
  min-width: 0;
}

#party-mode-panel .party-title-wrap {
  flex: 1 1 auto;
}

#party-mode-panel .panel-header-controls {
  flex: 0 0 auto;
  margin-left: 0;
}

#party-mode-panel .party-vote,
#party-mode-panel .party-tally {
  overflow: auto;
  scrollbar-gutter: stable;
}


/* === moved from 03-panel-contract.css in pass25: party-status-builder === */
/* ============================
   Party Status Builder
   ============================ */
.party-builder-grid {
  display: grid;
  grid-template-columns: minmax(290px, 1fr) minmax(290px, 1fr) minmax(260px, 320px);
  gap: 16px;
  margin-top: 10px;
  align-items: start;
}
.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;
  object-fit: none;          /* ✅ */
  object-position: 0 0;      /* ✅ */
  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;
  object-fit: none;          /* ✅ */
  object-position: 0 0;      /* ✅ */
  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: 14px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  padding-right: 4px;
  border-radius: 18px;
  border: 1px solid rgba(112, 151, 193, 0.18);
  background: linear-gradient(180deg, rgba(18, 28, 43, 0.9), rgba(10, 16, 26, 0.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
#party-status-minigames .minigame-banner {
  border: 1px solid rgba(116, 156, 198, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 28, 43, 0.94), rgba(10, 16, 26, 0.97));
  text-align: center;
  overflow: hidden;
  height: 64px;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 10px 20px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.04);
}
#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;
  color: white;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#party-status-panel .panel-title {
  color: #ffee66;
}

#party-status-panel .panel-body {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
  background:
    radial-gradient(circle at top center, rgba(61, 100, 139, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(14, 22, 35, 0.94), rgba(8, 13, 21, 0.97));
}

#party-status-wrapper {
  display: flex;
  flex: 1 1 auto;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
}

/* Section headers */
#party-status-panel h4 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #dceafb;
  text-align: center;
}

/* Left: Available Chao */
#party-status-available {
  flex: 1.3;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100%;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(112, 151, 193, 0.18);
  background: linear-gradient(180deg, rgba(18, 28, 43, 0.9), rgba(10, 16, 26, 0.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Match Party Hub grid exactly */
#party-status-chaolist {
  display: grid;
  grid-template-columns: repeat(3, 94px);
  justify-content: center;
  align-content: start;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(8, 13, 21, 0.52), rgba(7, 12, 18, 0.74));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  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 rgba(117, 156, 198, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(24, 38, 58, 0.94), rgba(12, 20, 31, 0.96));
  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;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

#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: 1px solid rgba(111, 219, 171, 0.8);
  box-shadow: 0 0 0 1px rgba(111, 219, 171, 0.25), 0 10px 20px rgba(0,0,0,0.16);
  background: linear-gradient(180deg, rgba(27, 67, 59, 0.96), rgba(11, 29, 25, 0.98));
}

/* Sprite + Name */
#party-status-chaolist .sprite-wrap {
  width: 42px;
  height: 42px;
  margin-bottom: 2px;
}
#party-status-chaolist .sprite-wrap img {
  width: 100%;
  height: auto;
  object-fit: none;          /* ✅ */
  object-position: 0 0;      /* ✅ */
  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;
  min-width: 0;
  height: 100%;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(112, 151, 193, 0.18);
  background: linear-gradient(180deg, rgba(18, 28, 43, 0.9), rgba(10, 16, 26, 0.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

#party-status-slots {
  display: grid;
  grid-template-columns: repeat(3, 94px);
  grid-template-rows: repeat(2, 94px);
  justify-content: start;
  align-content: start;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(8, 13, 21, 0.52), rgba(7, 12, 18, 0.74));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  width: 310px;
  max-width: 100%;
  height: auto;
  margin-bottom: 6px;
}

#party-status-slots .slot {
  width: 90px;
  height: 88px;
  border: 1px solid rgba(117, 156, 198, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(24, 38, 58, 0.94), rgba(12, 20, 31, 0.96));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border 0.2s;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
#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;
  object-fit: none;          /* ✅ */
  object-position: 0 0;      /* ✅ */
  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);
}

/* Action buttons */
#party-status-selected .party-status-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding-top: 8px;
}

#party-status-send-btn {
  display: block;
  margin-top: 0;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(182, 214, 247, 0.42);
  background: linear-gradient(180deg, rgba(88, 131, 179, 0.98), rgba(33, 55, 84, 0.98));
  color: #f7fbff;
  font-weight: bold;
  transition: background 0.2s;
  box-shadow: 0 10px 22px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}
#party-status-send-btn:hover {
  background: linear-gradient(180deg, rgba(103, 149, 201, 0.98), rgba(40, 66, 98, 0.98));
}

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




@media (max-width: 1500px) {
  .party-builder-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  #party-status-minigames {
    max-height: 220px;
  }

  #party-status-wrapper {
    flex-wrap: wrap;
  }

  #party-status-available,
  #party-status-selected {
    flex: 1 1 100%;
  }

  #party-status-selected {
    align-items: stretch;
  }

  #party-status-slots {
    margin-left: auto;
    margin-right: auto;
  }
}


@media (max-width: 980px) {
  .party-builder-grid {
    grid-template-columns: 1fr;
  }

  #party-slot-grid,
  #party-status-slots {
    width: 100%;
    grid-template-columns: repeat(3, minmax(80px, 1fr));
    justify-items: center;
  }

  #party-status-chaolist {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  }
}


@media (max-width: 1220px), (max-height: 760px) {
  .party-builder-grid {
    grid-template-columns: 1fr;
  }
}


/* pass12: responsive ownership migrated from 19-panel-fit-helpers.css */
@media (max-width: 1360px), (max-height: 860px) {
  #party-mode-panel .party-body {
    flex-direction: column;
  }

  #party-mode-panel .party-right {
    width: auto;
    max-height: 260px;
  }

  #party-mode-panel .party-player-grid,
  #party-mode-panel .party-vote-grid,
  #party-mode-panel .party-vote-grid2 {
    grid-template-columns: 1fr;
  }
}
