.umadle-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.tips {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: #4b5563;
}
body.dark-mode .tips {
  color: #cbd5e1;
}
.umadle-grid .row.card {
  background: #ffffff;
  border: 1px solid #cbd5e0;
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
body.dark-mode .umadle-grid .row.card {
  background: #1e1e1e;
  border-color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.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: #1f2937;
}
body.dark-mode .section-title {
  color: #e5e7eb;
}
.section,
.group {
  min-width: 0;
}
.group-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: #374151;
  margin-top: 0.2rem;
}
body.dark-mode .group-title {
  color: #cbd5e1;
}
.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: #f7fafc;
  border: 1px solid #cbd5e0;
  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: #d1fae5;
  border-color: #16a34a;
  color: #065f46;
}
.cell.up {
  background: #fff7ed;
  border-color: #fb923c;
  color: #9a3412;
}
.cell.down {
  background: #eef2ff;
  border-color: #818cf8;
  color: #3730a3;
}
body.dark-mode .cell {
  background: #232634;
  border-color: #3b4556;
  color: #ddd;
}
body.dark-mode .cell.up {
  background: #3b2f24;
  border-color: #eab308;
  color: #fbbf24;
}
body.dark-mode .cell.down {
  background: #2a2f4a;
  border-color: #6b7280;
  color: #c7d2fe;
}
body.dark-mode .cell.match {
  background: #14532d;
  border-color: #16a34a;
  color: #d1fae5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  z-index: 80;
  padding: 1rem;
}
.modal-backdrop.open {
  display: flex;
}

@media (max-width: 700px) {
  .tips {
    display: none;
  }
  .umadle-grid .row.card {
    padding: 0.5rem 0.55rem;
    gap: 0.4rem;
    align-items: center;
  }
  .umadle-grid .uma-name,
  .umadle-grid .uma-nick,
  .group-title,
  .section-title {
    width: 100%;
    text-align: center;
  }

  .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;
  }
}
