.combo-adopted-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 270;
  pointer-events: none;
}

.combo-adopted-backdrop {
  position: fixed;
  inset: 0;
  z-index: 260;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(15, 23, 42, 0.52);
  cursor: default;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.combo-adopted-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

body.combo-adopted-panel-open {
  overflow: hidden;
}

body.combo-adopted-panel-open .site-shell {
  pointer-events: none;
  user-select: none;
}

body.combo-adopted-panel-open .combo-adopted-dock {
  pointer-events: none;
}

body.combo-adopted-panel-open .combo-adopted-dock .combo-adopted-panel {
  pointer-events: auto;
}

body.combo-has-adopted-dock .site-main {
  padding-bottom: calc(var(--combo-adopted-dock-h, 52px) + 0.75rem);
}

body.combo-has-adopted-dock .site-sidebar {
  padding-bottom: calc(var(--combo-adopted-dock-h, 52px) + 0.75rem);
}

.combo-adopted-dock .combo-adopted-panel {
  pointer-events: auto;
  margin: 0;
  border: 1px solid #bfdbfe;
  border-bottom: none;
  border-radius: 0.75rem 0.75rem 0 0;
  background: #f8fbff;
  box-shadow: 0 -6px 28px rgba(15, 23, 42, 0.14);
  max-height: min(58vh, 440px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.combo-adopted-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: #1e3a8a;
}

.combo-adopted-summary::-webkit-details-marker {
  display: none;
}

.combo-adopted-summary::before {
  content: '▶';
  font-size: 0.75rem;
  margin-right: 0.5rem;
  transition: transform 0.15s ease;
}

.combo-adopted-panel[open] .combo-adopted-summary::before {
  transform: rotate(90deg);
}

.combo-adopted-title {
  flex: 1;
}

.combo-adopted-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb;
}

.combo-adopted-count--warn {
  color: #b45309;
}

.combo-adopted-warn {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.45;
}

.combo-adopt-blocked-note {
  margin-top: 0.35rem;
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 600;
}

.combo-adopted-member-dupe .cc-portrait {
  box-shadow: 0 0 0 2px #dc2626;
}

.combo-adopted-member-dupe .combo-adopted-member-fallback {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.combo-adopted-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #dbeafe;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.combo-adopted-dock .combo-adopted-body {
  max-height: calc(min(58vh, 440px) - 3.1rem);
}

.combo-adopted-empty {
  margin: 0.75rem 0 0;
}

.combo-adopted-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.combo-adopted-item {
  border: 1px solid #bfdbfe;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.75rem;
}

.combo-adopted-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.combo-adopted-item-rank {
  font-size: 0.8rem;
  font-weight: 800;
  color: #1d4ed8;
}

.combo-adopted-item-meta {
  flex: 1;
  font-size: 0.8rem;
  color: #374151;
}

.combo-adopted-legacy-note {
  margin: 0 0 0.5rem;
  color: #6b7280;
}

.combo-adopted-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.combo-adopted-item.is-new {
  animation: combo-adopted-pop 0.55s ease-out;
  box-shadow: 0 0 0 2px #2563eb, 0 8px 20px rgba(37, 99, 235, 0.18);
}

@keyframes combo-adopted-pop {
  0% {
    opacity: 0.35;
    transform: translateY(8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.combo-adopted-member-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.combo-adopted-member-slot {
  min-width: 0;
  display: block;
  color: inherit;
  text-decoration: none;
}

a.combo-adopted-member-slot:hover .cc-portrait {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.combo-adopted-member-slot--add {
  display: block;
  border: 2px dashed #c4b5fd;
  border-radius: 0.55rem;
  background: #faf5ff;
  color: #6d28d9;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.combo-adopted-member-slot--add:hover {
  background: #f3e8ff;
  border-color: #a78bfa;
  color: #5b21b6;
}

.combo-adopted-support-add-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.combo-adopted-support-add-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 2.75rem;
  margin: 0.35rem 0.35rem 0;
  border-radius: 0.35rem;
  background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: #8b5cf6;
}

.combo-adopted-support-add-label {
  display: block;
  padding: 0.35rem 0.25rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.combo-adopted-item-link {
  color: inherit;
  text-decoration: none;
}

.combo-adopted-item-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.combo-adopted-member-grid--with-support {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.35rem;
}

.combo-adopted-member-grid--with-support .combo-adopted-member-slot {
  min-width: 0;
}

.combo-adopted-member-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 1.25rem;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  color: #6d28d9;
  user-select: none;
}

@media (min-width: 640px) {
  .combo-adopted-member-grid:not(.combo-adopted-member-grid--with-support) {
    grid-template-columns: repeat(4, 1fr);
  }

  .combo-adopted-member-plus {
    width: 1.5rem;
    font-size: 1.35rem;
  }
}

.combo-adopted-member-grid .cc-portrait {
  height: 100%;
}

.combo-adopted-member-fallback {
  padding: 0.45rem 0.55rem;
  border: 1px solid #dbeafe;
  border-radius: 0.4rem;
  background: #eff6ff;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e3a8a;
  text-align: center;
}

.combo-adopted-dock .combo-btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
}

.combo-adopted-dock .combo-btn-outline {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #374151;
}

/* ===== M4: 対戦チートシート（採用部隊を縦1スクリーンに圧縮） ===== */

.combo-cheatsheet {
  position: fixed;
  inset: 0;
  z-index: 420;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.combo-cheatsheet[hidden] {
  display: none;
}

body.combo-cheatsheet-open {
  overflow: hidden;
}

.combo-cheat-card {
  background: #fff;
  width: 100%;
  max-width: 560px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

@media (min-width: 960px) {
  .combo-cheat-card {
    height: auto;
    max-height: 92vh;
    margin: auto;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  }
}

.combo-cheat-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #e5e7eb;
  flex: none;
}

.combo-cheat-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #1f2937;
}

.combo-cheat-save {
  margin-left: auto;
  border: none;
  border-radius: 999px;
  background: #0d9488;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  flex: none;
}

.combo-cheat-save:disabled {
  opacity: 0.6;
  cursor: wait;
}

.combo-cheat-close {
  margin-left: 0.4rem;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #374151;
  font-size: 1.1rem;
  cursor: pointer;
  flex: none;
}

/* 画像保存ボタンが無い（採用0件）ときは×を右端へ */
.combo-cheat-title + .combo-cheat-close {
  margin-left: auto;
}

.combo-cheat-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.combo-cheat-squad {
  border: 1px solid #dbe3db;
  border-radius: 10px;
  padding: 0.4rem 0.55rem 0.45rem;
  flex: none;
}

.combo-cheat-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.combo-cheat-rank {
  font-weight: 800;
  color: #1f2937;
}

.combo-cheat-gattai {
  background: #e8f1ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 0 0.55em;
  font-weight: 600;
}

.combo-cheat-score {
  margin-left: auto;
  font-weight: 800;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}

.combo-cheat-score--raw {
  color: #1f2937;
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.combo-cheat-faces {
  display: flex;
  gap: 0.35rem;
  margin: 0.35rem 0 0.1rem;
  align-items: flex-start;
}

.combo-cheat-face-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 50px;
  flex: none;
}

.combo-cheat-face {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  background: #eef4ee;
}

.combo-cheat-face-badge {
  position: absolute;
  top: 32px;
  right: 0;
  background: #7c3aed;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0 0.3em;
  border-radius: 6px;
}

.combo-cheat-face-name {
  max-width: 50px;
  font-size: 0.58rem;
  line-height: 1.3;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-cheat-note {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: #f6f9f6;
  border-radius: 7px;
  color: #475569;
  font-size: 0.74rem;
  line-height: 1.4;
  padding: 0.28rem 0.5rem;
  margin-top: 0.32rem;
  cursor: pointer;
}

.combo-cheat-note--empty {
  color: #94a3b8;
}

.combo-cheat-note-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.8rem;
  padding: 0.28rem 0.5rem;
  margin-top: 0.32rem;
  border: 1px solid #86b386;
  border-radius: 7px;
}

.combo-cheat-empty {
  padding: 1rem 0.6rem;
  color: #475569;
  font-size: 0.85rem;
}

.combo-cheat-hint {
  margin: 0;
  padding: 0.25rem 0.6rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.66rem;
  color: #94a3b8;
  text-align: center;
  flex: none;
}

.combo-cheat-open-btn {
  margin-left: 0.5rem;
  flex: none;
}
