/* Styles owned by the battle-dome section. */
.battle-dome-builder-panel {
  --pokemon-card-width: 341px;
  box-sizing: border-box;
  display: grid;
  justify-self: center;
  max-width: 100%;
  padding: 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-panel);
  background: var(--surface-panel);
}

.battle-dome-team-grid {
  --pokemon-card-width: 341px;
  box-sizing: border-box;
  display: grid;
  justify-self: center;
  max-width: 100%;
  padding: 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-panel);
  background: var(--surface-panel);
}

.battle-dome-builder-panel {
  width: fit-content;
  max-width: 100%;
  padding-left: 30px;
  padding-right: 30px;
}

.battle-dome-team-grid {
  width: min(var(--section-width), 100%);
  overflow: hidden;
}

.battle-dome-team-grid {
  grid-template-columns: repeat(3, var(--pokemon-card-width));
  justify-content: center;
  align-items: stretch;
}

.battle-dome-builder-panel {
  width: min(var(--section-width), 100%);
  gap: 16px;
}

.battle-dome-builder-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.battle-dome-builder-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.battle-dome-builder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.battle-dome-builder-move-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.battle-dome-builder-moves {
  display: grid;
  gap: 10px;
}

.battle-dome-builder-panel label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.battle-dome-builder-panel input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(31, 37, 40, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.battle-dome-builder-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1150px) {
.battle-dome-team-grid {
    width: min(var(--section-width), 100%);
    padding: 16px;
    align-items: stretch;
  }

.battle-dome-builder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.battle-dome-builder-panel {
    padding: 16px;
  }

}

@media (max-width: 680px) {
.battle-dome-team-grid {
    padding: 12px;
  }

.battle-dome-builder-panel {
    padding: 12px;
  }

.battle-dome-builder-grid {
    grid-template-columns: minmax(0, 1fr);
  }

.battle-dome-builder-move-row {
    grid-template-columns: minmax(0, 1fr);
  }

}
.battle-dome-sections-panel .panel-inner {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.battle-dome-sections-panel .panel-inner {
  padding: 10px;
}
.scene-content-battle-dome {
  display: grid;
  justify-items: center;
}

.scene-content-battle-dome > * {
  width: min(var(--box-layout-width), 100%);
}

.battle-dome-sections-panel .panel-inner {
  padding: 10px;
}

.battle-dome-info-panel,
.battle-dome-sections-panel {
  margin-bottom: 16px;
}

.battle-dome-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.battle-dome-team-block {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.battle-dome-team-block > h2 {
  margin: 0;
  text-align: center;
}

.battle-dome-team-grid {
  grid-template-columns: repeat(3, var(--pokemon-card-width));
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
}

.battle-dome-team-grid > .pokemon-card-frame {
  justify-self: center;
}

.battle-dome-builder-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
}

.battle-dome-builder-panel .battle-dome-builder-actions {
  justify-content: center;
}

.battle-dome-add-button,
.battle-dome-builder-panel .battle-dome-builder-actions .button {
  min-width: min(280px, 100%);
  min-height: 44px;
  padding: 10px 24px;
  font-size: 14px;
}

.battle-dome-builder-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.battle-dome-split-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  padding: 0;
}

.battle-dome-split-section {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 22px;
}

.battle-dome-split-section + .battle-dome-split-section {
  border-left: 1px solid var(--border-soft);
}

.battle-dome-split-section h2 {
  margin: 0;
}

.battle-dome-list-panel .battle-dome-split-section {
  min-height: 260px;
}

.battle-dome-lobby-row,
.battle-dome-battle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.battle-dome-lobby-row .button,
.battle-dome-battle-row .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.battle-dome-battle-row.is-own {
  border: 1px solid #d47b25;
  background: linear-gradient(135deg, rgba(255, 230, 191, 0.96), rgba(250, 175, 87, 0.82));
}

.battle-dome-link-row {
  display: flex;
  gap: 8px;
}

.battle-dome-link-row input {
  box-sizing: border-box;
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(31, 37, 40, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.battle-dome-link-row input[data-battle-dome-invite-code],
.battle-dome-link-row input[data-battle-dome-join-code] {
  letter-spacing: 0.16em;
  text-align: center;
}

.battle-dome-copy-wrapper {
  position: relative;
  display: inline-flex;
}

.battle-dome-copy-tooltip {
  display: none;
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 50%;
  padding: 4px 8px;
  border-radius: 4px;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
}

.battle-dome-copy-wrapper.is-copy-confirmed .battle-dome-copy-tooltip {
  display: block;
}

.battle-dome-scroll {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.battle-dome-note {
  opacity: 0.82;
}

.battle-dome-error {
  color: #a52e25;
}

.scene-content-battle-dome-leads {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.scene-content-battle-dome-leads > * {
  width: min(var(--box-layout-width), 100%);
}

.battle-dome-lead-intro .panel-inner {
  text-align: center;
}

.battle-dome-lead-intro p {
  margin: 4px 0;
}

.battle-dome-lead-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.battle-dome-lead-team {
  min-width: 0;
}

.battle-dome-lead-team h2 {
  margin-top: 0;
  text-align: center;
}

.battle-dome-lead-grid {
  grid-template-columns: repeat(2, minmax(0, var(--pokemon-card-width)));
  grid-auto-rows: auto auto;
  row-gap: 12px;
  justify-content: center;
}

.battle-dome-lead-entry {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 2;
  row-gap: 12px;
  min-width: 0;
  padding-bottom: 0;
}

.battle-dome-lead-entry:has(.pokemon-card-external) {
  padding-bottom: 0;
}

.battle-dome-lead-entry > .pokemon-card-external {
  position: static;
  grid-row: 2;
  align-self: start;
}

.battle-dome-create-button {
  justify-self: center;
  width: fit-content;
  min-width: 160px;
  min-height: 42px;
  padding: 10px 22px;
  border-radius: var(--radius-control);
}

.battle-dome-lead-selected {
  box-shadow: 0 0 0 3px rgba(25, 125, 115, 0.68), var(--shadow-soft);
}

.battle-dome-lead-abandon {
  display: flex;
  justify-content: center;
}

@media (max-width: 1150px) {
  .battle-dome-team-grid {
    grid-template-columns: repeat(2, var(--pokemon-card-width));
  }

  .battle-dome-lead-grid {
    grid-template-columns: minmax(0, min(var(--pokemon-card-width), 100%));
  }
}

@media (max-width: 700px) {
  .battle-dome-builder-primary {
    grid-template-columns: 1fr;
  }

  .battle-dome-split-panel {
    grid-template-columns: 1fr;
  }

  .battle-dome-split-section + .battle-dome-split-section {
    border-top: 1px solid var(--border-soft);
    border-left: 0;
  }

  .battle-dome-list-panel .battle-dome-split-section {
    min-height: 0;
  }

  .battle-dome-team-grid {
    grid-template-columns: minmax(0, min(var(--pokemon-card-width), 100%));
  }

  .battle-dome-lead-teams {
    grid-template-columns: 1fr;
  }

  .battle-dome-link-row {
    flex-wrap: wrap;
  }

  .battle-dome-link-row input {
    flex-basis: 100%;
  }
}
