*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --surface: #14141f;
  --accent: #ff2d6a;
  --accent-glow: rgba(255, 45, 106, 0.4);
  --gold: #ffd700;
  --text: #f0f0f5;
  --muted: #8888a0;
  --nav-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --card-size: 340px;
  --content-max: 720px;
}

html,
body {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 45, 106, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(100, 50, 255, 0.1) 0%, transparent 50%),
    var(--bg);
}

header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1.2rem 1rem 0.8rem;
}

h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  letter-spacing: 0.06em;
  line-height: 1;
}

h1 span {
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow);
}

.cats-btn {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.cats-btn:hover,
.cats-btn.open {
  color: var(--accent);
  border-color: rgba(255, 45, 106, 0.45);
}

.cats-btn svg {
  width: 22px;
  height: 22px;
}

main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.4rem 0.75rem calc(var(--nav-h) + var(--safe-bottom) + 0.5rem);
  width: 100%;
}

.view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.view.hidden {
  display: none;
}

#view-vote {
  overflow: hidden;
}

.view-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  margin: 0.4rem 0 0.8rem;
  color: var(--text);
}

/* ---------- arena ---------- */

.loading {
  text-align: center;
  color: var(--muted);
  padding: 2rem 0;
}

.spinner {
  width: 46px;
  height: 46px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

.error {
  text-align: center;
  color: #ff6b6b;
  padding: 1.2rem;
  background: rgba(255, 80, 80, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 80, 80, 0.3);
  max-width: 500px;
  margin: 1rem;
}

.hidden {
  display: none !important;
}

.cats-btn.share-btn {
  right: 0.8rem;
  left: auto;
}

.versus {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  max-width: none;
  height: 100%;
  overflow: hidden;
  padding: 0.25rem 0;
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.versus.switching {
  opacity: 0;
  transform: translateY(-16px) scale(0.98);
}

.versus.switching .photo-card {
  pointer-events: none;
}

.photo-wrap {
  flex: 0 0 auto;
  width: var(--card-size, 340px);
  height: var(--card-size, 340px);
  max-width: 100%;
}

.photo-card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.3s;
  padding: 0;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s, filter 0.3s;
}

.photo-card:hover {
  transform: scale(1.02);
  box-shadow: 0 0 40px var(--accent-glow);
}

.photo-card:hover img {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.photo-card.chosen {
  box-shadow: 0 0 50px var(--accent-glow);
  outline: 3px solid var(--accent);
  animation: fc-pulse 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

.photo-card.rejected {
  opacity: 0.4;
  filter: grayscale(0.8);
  transform: scale(0.96);
  animation: fc-wilt 0.4s ease forwards;
}

.photo-card.rejected img {
  filter: grayscale(0.8);
}

@keyframes fc-pulse {
  0% { transform: scale(1); }
  55% { transform: scale(1.06); }
  100% { transform: scale(1.02); }
}

@keyframes fc-wilt {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.4; transform: scale(0.94); }
}

.photo-card .stamp {
  top: 16px;
  font-size: 1.7rem;
  padding: 0.12rem 0.7rem;
  pointer-events: none;
}

.photo-card .stamp-pick {
  left: 20px;
  color: #2ee57b;
  border-color: #2ee57b;
  text-shadow: 0 0 12px rgba(46, 229, 123, 0.6);
}

.photo-card .stamp-nope {
  right: 20px;
  color: #ff5252;
  border-color: #ff5252;
  text-shadow: 0 0 12px rgba(255, 82, 82, 0.6);
}

.photo-wrap {
  position: relative;
}

.cat-chip {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 3;
  background: rgba(10, 10, 15, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.44rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  max-width: 44%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Плэйсхолдер-шиммер пока картинка грузится (без битой иконки) */
.photo-wrap.img-loading .photo-card img,
.swipe-front.img-loading > img {
  visibility: hidden;
}

.photo-wrap.img-loading .photo-card,
.swipe-front.img-loading {
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0) 60%),
    var(--surface);
  background-size: 240% 100%;
  animation: fc-shimmer 1.1s linear infinite;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes fc-shimmer {
  from { background-position: 135% 0; }
  to { background-position: -135% 0; }
}

.score-badge {
  /* temporarily hidden — keep markup/styles for later */
  display: none !important;
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 3;
  background: rgba(10, 10, 15, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.44rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

/* ---------- swipe mode ---------- */

.swipe {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.swipe-stage {
  --swipe-size: min(92vw, 72vh, 560px);
  position: relative;
  width: var(--swipe-size);
  height: var(--swipe-size);
  max-width: 100%;
  flex-shrink: 0;
}

.swipe-card {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  will-change: transform;
}

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

/* Не показываем браузерную «битую картинку» для ещё не заданного src. */
.swipe-card img[src=""],
.swipe-card img:not([src]) {
  visibility: hidden;
}

/* Лоадер на месте карточки, пока грузится следующая картинка */
.swipe-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 4;
}

.swipe-loader.hidden {
  display: none;
}

.swipe-back {
  transform: translateY(14px) scale(0.95);
  filter: brightness(0.75);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s;
}

.swipe-back.pop {
  transform: translateY(0) scale(1);
  filter: brightness(1);
}

.swipe-front {
  transform: translate(0, 0) rotate(0deg) scale(1);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
  z-index: 2;
}

.swipe-card img {
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.swipe-front.dragging {
  transition: none;
  cursor: grabbing;
}

.swipe-front.fly-right {
  transform: translate(160%, -10%) rotate(24deg);
  opacity: 0;
}

.swipe-front.fly-left {
  transform: translate(-160%, -10%) rotate(-24deg);
  opacity: 0;
}

.swipe-card .cat-chip {
  bottom: 12px;
  left: 12px;
}

.swipe-card .header-badge {
  bottom: 12px;
  right: 12px;
}

.stamp {
  position: absolute;
  top: 42px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.9rem;
  border-radius: 10px;
  border: 3px solid;
  transform: rotate(-12deg);
  z-index: 4;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease, scale 0.18s ease;
}

.stamp.show {
  opacity: 1;
  scale: 1.05;
}

.stamp-like {
  left: 22px;
  color: #2ee57b;
  border-color: #2ee57b;
  text-shadow: 0 0 12px rgba(46, 229, 123, 0.6);
}

.stamp-nope {
  right: 22px;
  color: #ff5252;
  border-color: #ff5252;
  text-shadow: 0 0 12px rgba(255, 82, 82, 0.6);
}

/* Штампы свайпа лежат на stage (поверх карточки), а не внутри улетающей карточки,
   поэтому они не гаснут вместе с полётом и видны даже пока грузится следующая карточка. */
#swipe-stage .stamp.show {
  animation: swipe-stamp-pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes swipe-stamp-pop {
  0% { transform: rotate(-12deg) scale(0.7); opacity: 0; }
  60% { transform: rotate(-8deg) scale(1.15); opacity: 1; }
  100% { transform: rotate(-12deg) scale(1.05); opacity: 1; }
}

.swipe-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding-bottom: 0.2rem;
}

.swipe-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.swipe-btn:hover {
  transform: scale(1.08);
}

.swipe-btn:active {
  transform: scale(0.9);
}

.swipe-btn-like {
  color: #2ee57b;
  border-color: rgba(46, 229, 123, 0.5);
}

.swipe-btn-like:hover {
  box-shadow: 0 0 24px rgba(46, 229, 123, 0.4);
  border-color: #2ee57b;
}

.swipe-btn-nope {
  color: #ff5252;
  border-color: rgba(255, 82, 82, 0.5);
}

.swipe-btn-nope:hover {
  box-shadow: 0 0 24px rgba(255, 82, 82, 0.4);
  border-color: #ff5252;
}

/* ---------- grids ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.4rem;
  width: 100%;
  max-width: var(--content-max);
  padding: 6px 2px 0.5rem;
  overflow: visible;
}

.grid img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}

.g-item {
  position: relative;
  border-radius: 10px;
  overflow: visible;
}

.g-item img:hover {
  transform: scale(1.04);
  box-shadow: 0 0 16px var(--accent-glow);
  z-index: 1;
  position: relative;
}

#view-liked {
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.g-chip {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 2;
  background: rgba(10, 10, 15, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-size: 0.47rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.14rem 0.32rem;
  border-radius: 999px;
  pointer-events: none;
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-score {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 2;
  background: rgba(10, 10, 15, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 0.08rem 0.32rem;
  border-radius: 999px;
  pointer-events: none;
}

.liked-loader {
  padding: 0.8rem 0;
  display: flex;
  justify-content: center;
}

.liked-loader .spinner {
  width: 30px;
  height: 30px;
  margin: 0;
}

.liked-end {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.8rem 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.empty-note {
  color: var(--muted);
  padding: 2rem 0;
  text-align: center;
}

/* ---------- profile ---------- */

.profile-body {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow: visible;
}

.profile-menu {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.menu-row:hover {
  border-color: rgba(255, 45, 106, 0.35);
}

.menu-row span {
  flex: 1;
}

.menu-chevron {
  color: var(--muted);
}

.subview-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 560px;
  margin-bottom: 1.4rem;
}

.subview-head .back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.subview-head .view-title {
  margin: 0;
  text-align: center;
  flex: 1;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.back-btn:hover {
  color: var(--accent);
}

.settings-body,
.about-body {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-bottom: 1rem;
}

.settings-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.settings-label {
  font-size: 0.95rem;
  font-weight: 600;
}

.settings-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.seg-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.seg-btn.active {
  color: #fff;
  background: rgba(255, 45, 106, 0.22);
  border-color: rgba(255, 45, 106, 0.55);
}

.settings-danger {
  margin-top: 0.3rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 82, 82, 0.35);
  background: rgba(255, 82, 82, 0.08);
  color: #ff8a8a;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.settings-danger:hover {
  background: rgba(255, 82, 82, 0.16);
}

.about-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem;
  letter-spacing: 0.06em;
}

.about-brand span {
  color: var(--accent);
}

.about-tagline {
  color: var(--muted);
  margin-top: -0.4rem;
}

.about-ver {
  font-size: 0.8rem;
  color: var(--muted);
}

.about-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(20, 20, 32, 0.96);
  border: 1px solid rgba(255, 82, 82, 0.45);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.35;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.22s ease;
}

.toast.info {
  border-color: rgba(255, 255, 255, 0.14);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.p-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.8rem 0.4rem;
  text-align: center;
}

.p-card .num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9rem;
  color: var(--accent);
}

.p-card .cap {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.p-block {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.8rem;
}

.p-block h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.p-block ol {
  list-style: none;
  counter-reset: lb;
}

.p-block li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  counter-increment: lb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lb-item, .lb-row, .lb-cat {
  cursor: pointer;
  transition: background 0.15s ease;
}

.lb-item:hover, .lb-row:hover, .lb-cat:hover {
  background: rgba(255, 255, 255, 0.06);
}

.p-block li::before {
  content: counter(lb);
  color: var(--muted);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  min-width: 1.2rem;
}

.p-block li img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 6px;
}

.p-block li .meta {
  color: var(--muted);
  margin-left: auto;
  font-size: 0.75rem;
}

.p-ip {
  color: var(--muted);
  font-family: monospace;
  font-size: 0.75rem;
  text-align: center;
  opacity: 0.7;
}

/* ---------- categories panel ---------- */

.cats-panel {
  position: absolute;
  top: calc(4.2rem);
  left: 0.6rem;
  width: min(320px, calc(100vw - 1.2rem));
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0.9rem;
  z-index: 50;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cats-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-shrink: 0;
}

.cats-head h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  flex: 1;
}

.cats-head button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

.cats-head button:hover {
  color: var(--text);
}

.cats-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: none;
}

/* вложенные группы «категория → коллекции» */
.cat-group {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  flex-shrink: 0;
}

.cat-group-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.5rem 0.5rem 0.7rem;
  cursor: pointer;
  user-select: none;
}

.cat-group-head:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cat-group-head .cat-group-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.cat-group-expand {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.1rem 0.3rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.cat-group-head.open .cat-group-expand {
  transform: rotate(180deg);
}

.cat-group-head .toggle {
  width: 36px;
  height: 20px;
}

.cat-group-head .toggle::after {
  width: 14px;
  height: 14px;
}

.cat-group-head.on .toggle {
  background: var(--accent);
}

.cat-group-head.on .toggle::after {
  transform: translateX(16px);
  background: #fff;
}

/* частично включена — полупрозрачная «полоска» */
.cat-group-head.partial .toggle {
  background: rgba(255, 45, 106, 0.35);
}

.cat-group-head.partial .toggle::after {
  transform: translateX(8px);
  background: #ffd;
}

.cat-group-body {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.3rem;
}

.cat-group-body .cat-row {
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  margin-bottom: 0.15rem;
}

.cat-group-body .cat-row .cat-tags {
  padding-left: 0.1rem;
}

.cat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.03);
}

.cat-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.cat-row .cat-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cat-row .cat-name {
  font-size: 0.88rem;
}

.cat-row .cat-count {
  color: var(--muted);
  font-size: 0.75rem;
  font-family: monospace;
}

.cat-tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  width: 100%;
  padding-left: 0;
}

.cat-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.cat-tag.nsfw {
  color: #ff7b9c;
  border-color: rgba(255, 123, 156, 0.4);
  background: rgba(255, 123, 156, 0.1);
}

.cat-chip-nsfw {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ff7b9c;
  border: 1px solid rgba(255, 123, 156, 0.45);
  background: rgba(255, 123, 156, 0.12);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.cat-row .cat-info {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.cat-row .cat-info:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.cat-row.empty {
  opacity: 0.6;
}

.cat-row.empty .toggle {
  opacity: 0.45;
}

.cat-empty-note {
  font-size: 0.65rem;
  color: var(--muted);
  font-style: italic;
}

.cat-empty {
  padding: 1rem 0.8rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.cat-meta-info {
  width: 100%;
  padding: 0.4rem 0.6rem;
  margin-top: 0.2rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.cat-meta-line {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.12rem 0;
}

.cat-meta-line b {
  color: var(--text);
  font-weight: 600;
}

.cat-meta-link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--accent);
}

.toggle {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #333;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #888;
  transition: transform 0.2s, background 0.2s;
}

.cat-row.on .toggle {
  background: var(--accent);
}

.cat-row.on .toggle::after {
  transform: translateX(16px);
  background: #fff;
}

/* ---------- bottom nav ---------- */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(12, 12, 20, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}

.bottom-nav-inner {
  width: 100%;
  max-width: var(--content-max);
  height: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 52px;
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
  flex: 0 0 auto;
}

.nav-btn svg,
.nav-icon {
  display: block;
  pointer-events: none;
}

.nav-btn:hover {
  color: var(--text);
}

.nav-btn:active {
  transform: scale(0.88);
}

.nav-btn.active {
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav-btn {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 12px;
  object-fit: contain;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  z-index: 210;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.lb-prev {
  left: 0.8rem;
}

.lb-next {
  right: 0.8rem;
}

.lb-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.lb-counter {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 210;
}

.lb-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.lb-actions {
  position: absolute;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 210;
}

.lb-album {
  flex: 0 1 auto;
  min-width: 0;
  width: min(60vw, 17rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 3.1rem;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.lb-remove {
  flex: 0 0 3.1rem;
  width: 3.1rem;
  height: 3.1rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 82, 82, 0.22);
  color: #ff7a7a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

/* ---------- responsive ---------- */

@media (min-width: 601px) {
  .versus {
    gap: 1.2rem;
  }
}

@media (max-width: 600px) {
  .versus {
    gap: 0.75rem;
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ================================================================ */
/* Аккаунт, онбординг, пейвол, регистрация                          */
/* ================================================================ */

.menu-badge {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #8b8b98;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.menu-badge.premium-badge.active {
  color: #ffd24a;
  background: rgba(255, 210, 74, 0.16);
}
.menu-badge.premium-badge.cta {
  color: #ffd24a;
  background: rgba(255, 210, 74, 0.1);
}

/* modal (auth) — общий стиль поверх приложения */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.8);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: #16161f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  color: #f2f2f7;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: pw-pop .28s cubic-bezier(.2,.9,.3,1.2);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #8b8b98;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.modal-title {
  margin: 0 0 2px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: .5px;
}
.modal-title span { color: #ff4d7d; }
.modal-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: #8b8b98;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #8b8b98;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active {
  background: #ff4d7d;
  color: #fff;
}

.field-label {
  display: block;
  font-size: 12px;
  color: #8b8b98;
  margin: 12px 0 4px;
}
.field-input {
  width: 100%;
  box-sizing: border-box;
  background: #0d0d14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #f2f2f7;
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
}
.field-input:focus { border-color: #ff4d7d; }

.auth-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.auth-col { flex: 1; }
.auth-send-code {
  padding: 11px 12px;
  border: 1px solid rgba(255,77,125,0.4);
  border-radius: 10px;
  background: rgba(255,77,125,0.1);
  color: #ff7d9c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.auth-send-code:disabled { opacity: .5; }

.auth-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #8b8b98;
  line-height: 1.4;
}
.auth-submit {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff4d7d, #ff6a3d);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.auth-submit:disabled { opacity: .5; }

.auth-oauth {
  margin-top: 16px;
}
.auth-oauth-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5c5c68;
  font-size: 12px;
  margin-bottom: 10px;
}
.auth-oauth-sep::before, .auth-oauth-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: #20202b;
  color: #eee;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.oauth-btn:disabled { opacity: .5; }
.google-btn-attach {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
}
.google-btn-attach iframe {
  border-radius: 10px;
}
.auth-token-field { margin-top: 12px; }

/* share modal */
.share-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.share-link-input {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}
.share-copy {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 77, 125, 0.4);
  border-radius: 10px;
  background: rgba(255, 77, 125, 0.1);
  color: #ff7d9c;
  cursor: pointer;
}
.share-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.share-native {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff4d7d, #ff6a3d);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.share-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #20202b;
  color: #eee;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.share-social:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

/* paywall */
.paywall {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}
.paywall-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(8px);
}
.paywall-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, #1c1424, #16161f);
  border: 1px solid rgba(255, 210, 74, 0.25);
  border-radius: 24px;
  padding: 28px 22px 22px;
  text-align: center;
  color: #f2f2f7;
  box-shadow: 0 30px 90px rgba(0,0,0,0.7);
  animation: pw-pop .32s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pw-pop {
  from { transform: scale(.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.paywall-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.paywall-crown { display: flex; align-items: center; justify-content: center; color: #ffd24a; filter: drop-shadow(0 6px 18px rgba(255,210,74,.35)); }
.paywall-title {
  margin: 6px 0 2px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: .5px;
}
.paywall-title span { color: #ffd24a; }
.paywall-sub { margin: 0 0 18px; font-size: 13px; color: #b9b9c5; line-height: 1.5; }

.paywall-plans { display: flex; gap: 8px; }
.pay-plan {
  flex: 1;
  background: #20202b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #eee;
  position: relative;
}
.pay-plan.selected { border-color: #ffd24a; background: #2a2330; }
.pay-plan.featured { border-color: rgba(255,210,74,.45); }
.pay-plan-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffd24a;
  color: #1a1206;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
}
.pay-plan-name { font-size: 12px; color: #b9b9c5; }
.pay-plan-price { font-size: 17px; font-weight: 700; }
.pay-plan-per { font-size: 11px; color: #7b7b88; }

.paywall-methods {
  margin: 16px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pay-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: #20202b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #eee;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pay-method.selected { border-color: #ff4d7d; }
.pay-method-name { font-size: 14px; }
.paywall-legal {
  font-size: 11px;
  color: #7b7b88;
  margin: 10px 0 12px;
  line-height: 1.5;
}
.paywall-cta {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffd24a, #ff9d3d);
  color: #1a1206;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.paywall-cta:disabled { opacity: .5; }

/* onboarding */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: #0a0a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}
.ob-screen { width: 100%; max-width: 420px; text-align: center; color: #f2f2f7; }
.ob-screen h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  letter-spacing: .5px;
  margin: 0 0 4px;
}
.ob-hint { color: #8b8b98; font-size: 13px; margin: 0 0 18px; }

.ob-sex-cards {
  display: flex;
  gap: 14px;
  margin-top: 20px;
}
.ob-sex-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 12px;
  background: #16161f;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  color: #f2f2f7;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.ob-sex-card .ob-sex-icon { font-size: 34px; }
.ob-sex-card:hover { border-color: #ff4d7d; }

.ob-confirm-stage {
  max-width: 300px;
  margin: 0 auto 16px;
  perspective: 900px;
}
.ob-confirm-card {
  height: 210px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff4d7d, #ff6a3d);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  transition: transform .25s;
}
.ob-confirm-card.fly-right { transform: translateX(140%) rotate(18deg); opacity: 0; transition: transform .4s, opacity .4s; }
.ob-confirm-card.fly-left { transform: translateX(-140%) rotate(-18deg); opacity: 0; transition: transform .4s, opacity .4s; }
.ob-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 40px;
}
.ob-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.ob-btn-nope { background: rgba(255,82,82,0.25); color: #ff7a7a; }
.ob-btn-yes { background: rgba(80,227,194,0.25); color: #50e3c2; }

.ob-terms-text {
  color: #b9b9c5;
  font-size: 14px;
  line-height: 1.6;
  margin: 14px 0 20px;
}
.ob-terms-text a { color: #ff4d7d; }
.ob-modes {
  display: flex;
  gap: 14px;
}
.ob-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 8px;
  background: #16161f;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  color: #f2f2f7;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ob-cards-icon { font-size: 24px; }
.ob-done-btn {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff4d7d, #ff6a3d);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* reg prompt (registration card in-game) */
.reg-prompt {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5,5,10,0.9);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}
.reg-choose-view {
  max-width: 420px;
  width: 100%;
  text-align: center;
  color: #f2f2f7;
}
.reg-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  margin: 0 0 6px;
  letter-spacing: .5px;
}
.reg-sub { color: #8b8b98; font-size: 14px; margin: 0 0 20px; line-height: 1.5; }
.reg-cards {
  display: flex;
  gap: 14px;
}
.reg-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 10px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.1);
  background: #16161f;
  color: #f2f2f7;
  cursor: pointer;
}
.reg-card-label { font-size: 28px; font-weight: 800; }
.reg-card-sub { font-size: 12px; color: #8b8b98; }
.reg-card:hover { border-color: #ff4d7d; }
.reg-card-no .reg-card-label { color: #ff7a7a; } 
