.owned-app {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.owned-panel {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1rem 1.25rem;
}

.owned-panel h2,
.owned-panel h3 {
  margin: 0 0 0.75rem;
  color: #111827;
}

.owned-banner-url {
  background: #fef9c3;
  border: 2px solid #facc15;
  border-radius: 0.5rem;
  padding: 1rem;
}

.owned-stats-total {
  background: linear-gradient(to right, var(--primary-dark), var(--primary), var(--primary-light));
  color: #fff;
  border-radius: 0.5rem;
  padding: 1.25rem;
  text-align: center;
}

.owned-stats-total-num {
  font-size: 2rem;
  font-weight: 800;
}

.owned-stats-bar {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  height: 0.5rem;
  margin-top: 0.75rem;
  overflow: hidden;
}

.owned-stats-bar-fill {
  background: #fff;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s;
}

.owned-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem;
}

.owned-stat-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.75rem;
}

.owned-stat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.owned-stat-bar {
  background: #e5e7eb;
  border-radius: 999px;
  height: 0.35rem;
  overflow: hidden;
}

.owned-stat-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.owned-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.owned-btn {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0.375rem;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  min-height: 2.75rem;
}

.owned-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.owned-btn-green {
  background: #22c55e;
  color: #fff;
}

.owned-btn-red {
  background: #ef4444;
  color: #fff;
}

.owned-btn-blue {
  background: #3b82f6;
  color: #fff;
}

.owned-btn-purple {
  background: #a855f7;
  color: #fff;
}

.owned-btn-image {
  background: #0d9488;
  color: #fff;
}

.owned-btn-gray {
  background: #6b7280;
  color: #fff;
  margin-left: auto;
}

.owned-btn-share {
  background: #22c55e;
  color: #fff;
}

.owned-btn-share.copied {
  background: #16a34a;
}

.owned-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.owned-filters label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.owned-filters select,
.owned-filters input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
}

.owned-share-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #1e40af;
}

.owned-shozoku-section {
  margin-bottom: 2rem;
}

.owned-shozoku-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.owned-shozoku-title {
  font-size: 1.25rem;
  font-weight: 800;
}

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

@media (min-width: 640px) {
  .owned-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .owned-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1100px) {
  .owned-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.owned-import-cta {
  background: linear-gradient(to right, #facc15, #eab308);
  border-radius: 0.5rem;
  padding: 1.25rem;
  text-align: center;
  margin-top: 1.5rem;
}

.owned-import-cta .owned-btn {
  background: #fff;
  color: #854d0e;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  margin-top: 0.75rem;
}

/* selection card */
.cc-sel {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s;
  opacity: 0.65;
}

.cc-sel:hover {
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cc-sel-on {
  opacity: 1;
  outline: 3px solid #22c55e;
  outline-offset: 1px;
}

.cc-sel-check {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  background: #22c55e;
  color: #fff;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  z-index: 2;
}

.cc-sel-img-wrap {
  aspect-ratio: 1;
  margin-bottom: 0.35rem;
}

.cc-sel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.25rem;
}

.cc-sel-kana {
  font-size: 0.65rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-sel-name {
  font-weight: 700;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-sel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.25rem;
  align-items: center;
}

.cc-sel-rare {
  color: #ca8a04;
  font-size: 0.7rem;
  font-weight: 700;
}

.cc-sel-shozoku {
  color: #fff;
  font-size: 0.65rem;
  padding: 0 0.25rem;
  border-radius: 0.15rem;
  font-weight: 700;
}

.cc-sel-meisho {
  background: #eab308;
  color: #fff;
  font-size: 0.65rem;
  padding: 0 0.25rem;
  border-radius: 0.15rem;
  font-weight: 700;
}

.owned-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1100;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===== 星数登録（編成検索の実戦目安スコア用） ===== */

.owned-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.owned-card-wrap > .cc-sel {
  flex: 1;
}

.owned-star-ctl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.15rem 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.35rem;
}

.owned-star-btn {
  width: 1.5rem;
  height: 1.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.3rem;
  background: #fff;
  color: #334155;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.owned-star-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.owned-star-btn:not(:disabled):hover {
  background: #e2e8f0;
}

.owned-star-val {
  min-width: 2.2rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
}

.owned-star-val--set {
  color: #b45309;
}

/* データのバックアップ */
.wiki-backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.wiki-backup-import-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.wiki-backup-paste {
  margin-top: 0.5rem;
}

.wiki-backup-paste summary {
  font-size: 0.8rem;
  color: #475569;
  cursor: pointer;
}

.wiki-backup-paste textarea {
  width: 100%;
  box-sizing: border-box;
  margin: 0.5rem 0;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.5rem;
}

/* アカウント同期 */
.owned-sync-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
  margin: 0.6rem 0;
}

.owned-sync-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.owned-sync-field input {
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 14rem;
}

.owned-sync-user {
  margin: 0.4rem 0;
  font-size: 0.9rem;
}

.owned-sync-small {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  margin-left: 0.4rem;
}

.owned-sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

/* QRで引き継ぎ */
.owned-btn-qr {
  background: #0ea5e9;
  color: #fff;
}

.owned-btn-qr:hover:not(:disabled) {
  background: #0284c7;
}

.owned-btn-qr.is-active {
  background: #0369a1;
}

.owned-qr-box {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border: 2px solid #bae6fd;
  border-radius: 12px;
  background: linear-gradient(160deg, #f0f9ff 0%, #fff 100%);
}

.owned-qr-code {
  flex: 0 0 auto;
  width: min(220px, 60vw);
  padding: 0.4rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.owned-qr-code svg {
  display: block;
  width: 100%;
  height: auto;
}

.owned-qr-text {
  flex: 1 1 14rem;
  min-width: 0;
}

.owned-qr-text strong {
  display: block;
  margin-bottom: 0.3rem;
}
