/* ===== Pick Uma button ===== */
.pick-uma-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px dashed var(--border, #d1d5db);
  border-radius: 10px;
  background: var(--surface-2, #f9fafb);
  color: var(--muted, #6b7280);
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.pick-uma-btn:hover {
  border-color: var(--primary, #3b82f6);
  background: var(--surface-1, #fff);
}

body.dark .pick-uma-btn {
  background: #111827;
}

body.dark .pick-uma-btn:hover {
  background: #1a1a2e;
}

/* ===== Character Picker Modal (shared with deck builder) ===== */
.support-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.support-modal[hidden] {
  display: none;
}

.support-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.support-modal-content {
  position: relative;
  width: 90vw;
  max-width: 560px;
  max-height: 80vh;
  background: var(--surface-1, #fff);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

body.dark .support-modal-content {
  background: #1a1a2e;
}

.support-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

body.dark .support-modal-header {
  border-color: #334155;
}

.support-modal-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-1, #111827);
}

.support-modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--muted, #9ca3af);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  line-height: 1;
}

.support-modal-close:hover {
  color: #ef4444;
}

.support-modal-filters {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

body.dark .support-modal-filters {
  border-color: #334155;
}

.support-modal-filters input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  background: var(--surface-2, #f9fafb);
  color: var(--text-1, #111827);
  font-size: 0.8rem;
}

body.dark .support-modal-filters input {
  background: #111827;
  border-color: #334155;
}

.support-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem;
  min-height: 200px;
}

.modal-card-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.modal-card-item:hover {
  background: var(--surface-2, #f3f4f6);
}

body.dark .modal-card-item:hover {
  background: #111827;
}

.modal-card-item.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.modal-card-item.disabled:hover {
  background: transparent;
}

.modal-card-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.modal-card-initials {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--surface-2, #e6f0ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--primary-foreground, #1e40af);
  flex-shrink: 0;
}

body.dark .modal-card-initials {
  background: #1e293b;
  color: #93c5fd;
}

.modal-card-name {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-1, #1f2937);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-card-nick {
  color: var(--muted, #6b7280);
}

.modal-card-rarity {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted, #6b7280);
  flex-shrink: 0;
}

.char-stars {
  color: #eab308;
}

.modal-card-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted, #9ca3af);
  font-size: 0.8rem;
}

/* ===== Umadle grid ===== */
.umadle-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tips {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.umadle-grid .row.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  box-shadow: 0 12px 24px -20px rgb(var(--shadow-rgb) / 0.3);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.guess-details {
  width: 100%;
}

.guess-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  cursor: pointer;
  list-style: none;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

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

.guess-summary::marker {
  content: '';
}

.guess-summary-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.guess-summary-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.guess-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.guess-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.guess-thumb .guess-initials {
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text-1);
}

.guess-summary-meta {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding-right: 1.1rem;
}

.guess-summary-meta::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-50%) rotate(45deg);
  transition: transform 0.2s ease;
}

.guess-details[open] .guess-summary-meta::after {
  transform: translateY(-50%) rotate(-135deg);
}

.guess-details > .section {
  margin-top: 0.5rem;
}

.umadle-grid .uma-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.umadle-grid .uma-nick {
  font-size: 0.95rem;
  opacity: 0.85;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.section-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-1);
}

.section,
.group {
  min-width: 0;
}

.group-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-2);
  margin-top: 0.2rem;
}

.group {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.1rem;
}

.cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.95rem;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 110px;
}

.cell .k {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell .sym {
  flex: 0 0 auto;
  font-weight: 700;
}

.cell.match {
  background: rgb(var(--success-rgb) / 0.16);
  border-color: rgb(var(--success-rgb) / 0.5);
  color: var(--success);
}

.cell.up {
  background: rgb(var(--warning-rgb) / 0.16);
  border-color: rgb(var(--warning-rgb) / 0.5);
  color: var(--warning);
}

.cell.down {
  background: rgb(var(--info-rgb) / 0.16);
  border-color: rgb(var(--info-rgb) / 0.5);
  color: var(--info);
}

@media (max-width: 700px) {
  .tips {
    display: none;
  }

  .umadle-grid .row.card {
    padding: 0.5rem 0.55rem;
    gap: 0.4rem;
    align-items: center;
  }

  .guess-summary {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .guess-summary-meta {
    display: none;
  }

  .umadle-grid .uma-name,
  .umadle-grid .uma-nick,
  .group-title,
  .section-title {
    width: 100%;
    text-align: left;
  }

  .guess-thumb {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
    align-content: flex-start;
    overflow-x: visible;
    min-width: 0;
  }

  .cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.35rem;
    padding: 0.22rem 0.38rem;
    font-size: 0.82rem;
    border-radius: 7px;
    flex: 0 0 auto !important;
    width: auto;
    min-width: unset;
    white-space: nowrap;
    max-width: 100%;
  }

  .cell .k {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cell .sym {
    flex: 0 0 auto;
    font-size: 0.85rem;
  }
}

@media (max-width: 420px) {
  .umadle-grid .row.card {
    padding: 0.4rem;
  }
  .cell {
    font-size: 0.78rem;
    padding: 0.18rem 0.32rem;
  }
}
