/* theme-ui.css — интерфейс раздела «Оформление»: карточки миров и настройки. */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 12px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.theme-card.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset, 0 10px 28px rgba(0, 0, 0, .3);
}

.theme-card.is-preview {
  border-color: #6ea8ff;
  box-shadow: 0 0 0 1px #6ea8ff inset;
}

.theme-swatch {
  position: relative;
  height: 96px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 22% 26%, var(--sw-c) 0, transparent 42%),
    radial-gradient(circle at 82% 74%, var(--sw-a) 0, transparent 46%),
    linear-gradient(135deg, var(--sw-b), var(--sw-a));
  overflow: hidden;
}

.theme-swatch-glow {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent, var(--sw-c), transparent 45%);
  opacity: .35;
  animation: themeSpin 9s linear infinite;
}

.theme-swatch-mark {
  position: relative;
  font-size: 34px;
  color: rgba(255, 255, 255, .88);
  text-shadow: 0 3px 14px rgba(0, 0, 0, .5);
}

.theme-card-body {
  padding: 12px 13px 13px;
}

.theme-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.theme-card-desc {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.theme-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
  min-height: 0;
}

.theme-card-tags:empty {
  display: none;
}

.theme-motion-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.theme-motion-row .is-on {
  border-color: var(--gold);
  background: rgba(245, 197, 66, .18);
  color: var(--gold2);
  font-weight: 800;
}

@keyframes themeSpin {
  to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------------ анимация */

:root {
  --motion-scale: 1;
}

body[data-motion="off"] *,
body[data-motion="off"] *::before,
body[data-motion="off"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

body[data-motion="min"] {
  --motion-scale: .35;
}

body[data-motion="standard"] {
  --motion-scale: 1;
}

body[data-motion="max"] {
  --motion-scale: 1.45;
}

body[data-motion="max"] .theme-swatch-glow {
  animation-duration: 4.5s;
}

body[data-effects="off"] .theme-swatch-glow,
body[data-effects="off"] body::before,
body[data-effects="off"] body::after {
  animation: none !important;
}

/* «Лёгкий режим» для больших столов */
body[data-density="high"] .theme-swatch-glow,
body[data-density="high"] .seat,
body[data-density="high"] .panel {
  animation: none !important;
  transition: none !important;
}

body[data-density="high"] .seat {
  width: 96px;
}

body[data-density="high"] .seat .avatar {
  width: 30px;
  height: 30px;
  font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
