:root {
  --bg-deep: #0b0c10;
  --panel: #1f2833;
  --neon-primary: #00f5d4;
  --neon-magenta: #ff007f;
  --text-main: #ffffff;
  --text-muted: #c5c6c7;
  --header-float-h: 3.75rem;
  --header-gap: 0.5rem;
  --header-top: calc(env(safe-area-inset-top, 0px) + var(--header-gap));
  --header-bottom-gap: 0.65rem;
  --main-pad-top: calc(var(--header-top) + var(--header-float-h) + var(--header-bottom-gap));
}

html, body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
}

html {
  position: relative;
}

body {
  touch-action: pan-y pinch-zoom;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  z-index: 50;
  padding: var(--header-top) 1rem var(--header-bottom-gap);
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(11, 12, 16, 0.92) 0%,
    rgba(11, 12, 16, 0.55) 70%,
    transparent 100%
  );
}

.header-bar {
  max-width: 28rem;
  margin: 0 auto;
  min-height: var(--header-float-h);
  padding: 0.7rem 0.65rem 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  pointer-events: auto;
  box-sizing: border-box;
}

.lang-select {
  width: 100%;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  padding: 0.65rem 2.15rem 0.65rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 245, 212, 0.22);
  background-color: rgba(0, 0, 0, 0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2300f5d4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lang-select:hover,
.lang-select:focus {
  outline: none;
  border-color: rgba(0, 245, 212, 0.45);
  box-shadow: 0 0 0 2px rgba(0, 245, 212, 0.12);
}

.lang-select option {
  color: #0b0c10;
  background: #fff;
}

.lang-select--header {
  width: auto;
  min-width: 6.75rem;
  max-width: 9.5rem;
  padding: 0.38rem 1.85rem 0.38rem 0.6rem;
  font-size: 0.72rem;
  border-radius: 0.65rem;
}

.header-float {
  background: rgba(14, 18, 26, 0.78);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border: 1px solid rgba(0, 245, 212, 0.12);
  border-radius: 1.125rem;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 48px rgba(0, 245, 212, 0.05);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.1rem 0;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.brand-wordmark {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  color: var(--neon-primary);
  text-shadow: 0 0 24px rgba(0, 245, 212, 0.25);
}

.brand-tagline {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1;
  color: rgba(197, 198, 199, 0.88);
}

.main-shell {
  padding-top: var(--main-pad-top);
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

@supports (height: 100svh) {
  .main-shell {
    height: 100svh;
    max-height: 100svh;
  }
}

.hero-glow {
  background: radial-gradient(ellipse 100% 45% at 50% -5%, rgba(0, 245, 212, 0.1), transparent 50%);
}

/* Discovery — kitölti a main-shell maradék magasságát (ne számoljuk kétszer a fejlécet) */
.discovery-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-x: clip;
  box-sizing: border-box;
}

.discovery-top {
  flex-shrink: 0;
  padding: 0.5rem 1rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.discovery-subtitle {
  margin: 0;
  padding: 0 0.25rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.35;
  color: rgba(197, 198, 199, 0.92);
}

.gender-filters {
  display: flex;
  gap: 0.4rem;
  padding: 0 0 0.5rem;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: hidden;
}

.gender-chip {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid rgba(197, 198, 199, 0.14);
  background: rgba(31, 40, 51, 0.35);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.gender-chip.active {
  color: var(--neon-primary);
  border-color: rgba(0, 245, 212, 0.45);
  background: rgba(0, 245, 212, 0.1);
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.1);
}

.discovery-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 0.5rem;
  overscroll-behavior-x: contain;
  padding: 0.15rem 0 0.35rem;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  scrollbar-width: none;
}

.discovery-filters::-webkit-scrollbar {
  display: none;
}

.discovery-filters::before,
.discovery-filters::after {
  content: "";
  flex: 0 0 0.125rem;
}

.discovery-swipe {
  flex: 1;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: clip;
}

.swipe-slot {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 0 0 max(0.5rem, env(safe-area-inset-bottom, 0px));
  display: flex;
  box-sizing: border-box;
  overflow: hidden;
  overflow-x: clip;
}

/* Swipe kártya — kitölti a rendelkező magasságot */
.swipe-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: min(28rem, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  border-radius: 1.35rem;
  overflow: hidden;
  border: 1px solid rgba(0, 245, 212, 0.16);
  background: #0e1218;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.55),
    0 0 32px rgba(0, 245, 212, 0.08);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  touch-action: none;
  will-change: transform;
}

.swipe-card.swipe-out-right {
  transform: translate3d(108%, 0, 0) rotate(6deg);
  opacity: 0;
}
.swipe-card.swipe-out-left {
  transform: translate3d(-108%, 0, 0) rotate(-6deg);
  opacity: 0;
}

.swipe-card-photo {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.swipe-card-photo .photo-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-photo {
  z-index: 1;
}

.photo-fallback {
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swipe-card-photo .photo-letter {
  font-size: clamp(5rem, 22vw, 9rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.07);
  line-height: 1;
  user-select: none;
}

.swipe-card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 2rem 1rem 1rem;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(11, 12, 16, 0.55) 35%,
    rgba(11, 12, 16, 0.92) 100%
  );
  pointer-events: none;
}

.swipe-card-overlay h3 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.swipe-card-overlay h3 span {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 1rem;
}

.swipe-card-overlay p {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swipe-card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(11, 12, 16, 0.65);
  border: 1px solid rgba(0, 245, 212, 0.22);
  color: var(--neon-primary);
  backdrop-filter: blur(8px);
}

.swipe-card-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-primary);
  box-shadow: 0 0 8px var(--neon-primary);
}

.swipe-card-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  padding: 0.65rem 1rem max(1rem, calc(env(safe-area-inset-bottom, 0px) + 0.35rem));
  background: #0e1218;
  border-top: 1px solid rgba(0, 245, 212, 0.08);
}

.btn-pass {
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 999px;
  border: 1.5px solid rgba(197, 198, 199, 0.3);
  background: rgba(31, 40, 51, 0.5);
  color: var(--text-muted);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}
.btn-pass:active {
  transform: scale(0.94);
}

.btn-like {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 999px;
  border: none;
  background: var(--neon-primary);
  color: var(--bg-deep);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 28px rgba(0, 245, 212, 0.4);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-like:active {
  transform: scale(0.96);
}

.glass-panel {
  background: rgba(31, 40, 51, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 245, 212, 0.1);
}

.menu-btn {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 245, 212, 0.18);
  background: rgba(0, 245, 212, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.menu-btn:active {
  transform: scale(0.96);
}
.menu-btn span {
  display: block;
  width: 1rem;
  height: 2px;
  background: var(--neon-primary);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}
.menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.menu-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.menu-drawer[hidden] { display: none !important; }
.menu-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  max-width: 100%;
  overflow-x: clip;
}

.modal-backdrop,
#auth-modal,
#premium-modal,
#gallery-modal,
#photo-lightbox {
  max-width: 100%;
  overflow-x: clip;
}

/* ——— Betöltéskori 18+ és társválasztás ——— */
.onboarding-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1rem max(1rem, env(safe-area-inset-bottom, 0px));
  background: rgba(11, 12, 16, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.onboarding-gate[hidden] {
  display: none !important;
}

.onboarding-gate-inner {
  width: 100%;
  max-width: 22rem;
  min-width: 0;
}

.onboarding-panel {
  width: 100%;
  padding: 1.5rem 1.25rem 1.35rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(0, 245, 212, 0.18);
  text-align: center;
}

.onboarding-badge {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--neon-magenta);
  border: 1px solid rgba(255, 0, 127, 0.35);
  background: rgba(255, 0, 127, 0.08);
}

.onboarding-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.onboarding-lead {
  margin: 0 0 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.onboarding-label {
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(197, 198, 199, 0.85);
}

.onboarding-gender-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.onboarding-gender-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 3.25rem;
  padding: 0.55rem 0.4rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(197, 198, 199, 0.18);
  background: rgba(31, 40, 51, 0.55);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.onboarding-gender-btn.active {
  color: var(--neon-primary);
  border-color: rgba(0, 245, 212, 0.5);
  background: rgba(0, 245, 212, 0.1);
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.12);
}

.onboarding-gender-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.onboarding-age {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0 0 1rem;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
  cursor: pointer;
}

.onboarding-age input {
  margin-top: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  accent-color: var(--neon-primary);
}

.onboarding-continue {
  width: 100%;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bg-deep);
  background: var(--neon-primary);
  box-shadow: 0 0 24px rgba(0, 245, 212, 0.28);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, filter 0.2s;
}

.onboarding-continue:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.onboarding-continue:not(:disabled):active {
  transform: scale(0.98);
}

.onboarding-legal {
  margin: 0.85rem 0 0;
  font-size: 0.68rem;
  line-height: 1.45;
  color: rgba(197, 198, 199, 0.75);
}

body.onboarding-active .main-shell,
body.onboarding-active .site-header,
body.onboarding-active .menu-drawer {
  pointer-events: none;
  user-select: none;
}
.menu-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 12, 16, 0.72);
  backdrop-filter: blur(4px);
}
.menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(18rem, 88vw);
  height: 100%;
  padding: calc(var(--main-pad-top) + 0.5rem) 1.25rem 1.5rem;
  background: linear-gradient(165deg, #151b24 0%, #0b0c10 100%);
  border-left: 1px solid rgba(0, 245, 212, 0.15);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}
.menu-drawer.is-open .menu-panel { transform: translateX(0); }

.menu-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 0.875rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.menu-nav-item.is-active {
  color: var(--neon-primary);
  background: rgba(0, 245, 212, 0.08);
  border-color: rgba(0, 245, 212, 0.2);
}

a.menu-nav-item {
  text-decoration: none;
}

.menu-settings-label {
  margin: 0.35rem 0 0.4rem;
  padding: 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(197, 198, 199, 0.75);
}

.menu-lang-select {
  margin-bottom: 0.65rem;
}

.menu-gender-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.menu-gender-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(197, 198, 199, 0.16);
  background: rgba(31, 40, 51, 0.45);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.menu-gender-btn.active {
  color: var(--neon-primary);
  border-color: rgba(0, 245, 212, 0.45);
  background: rgba(0, 245, 212, 0.1);
}

.typing-dot { animation: typing-bounce 1.2s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.view-hidden { display: none !important; }

.filter-chip {
  flex-shrink: 0;
  scroll-snap-align: start;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid rgba(197, 198, 199, 0.14);
  background: rgba(31, 40, 51, 0.45);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.filter-chip:active {
  transform: scale(0.97);
}
.filter-chip:hover:not(.active) {
  border-color: rgba(0, 245, 212, 0.35);
}
.filter-chip.active {
  background: rgba(0, 245, 212, 0.12);
  border-color: rgba(0, 245, 212, 0.55);
  color: var(--neon-primary);
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.12);
}

.chat-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.35rem;
  padding: max(0.45rem, env(safe-area-inset-top, 0px)) max(0.5rem, env(safe-area-inset-right, 0px)) 0.5rem max(0.5rem, env(safe-area-inset-left, 0px));
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.chat-header-center {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.chat-header-text {
  flex: 1;
  min-width: 0;
}

.chat-nav-btn {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(31, 40, 51, 0.55);
  color: var(--neon-primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.15s;
}

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

.chat-nav-btn--back {
  justify-self: start;
}

.chat-nav-btn--inbox {
  justify-self: end;
}

.chat-nav-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.chat-nav-chevron {
  font-size: 1.65rem;
  font-weight: 300;
  line-height: 1;
  margin-top: -0.15rem;
}

.chat-header-gallery {
  display: none;
}

.gift-sheet {
  position: fixed;
  inset: 0;
  z-index: 92;
  max-width: 100%;
  overflow: hidden;
}

.gift-sheet[hidden] {
  display: none !important;
}

.gift-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(11, 12, 16, 0.75);
  backdrop-filter: blur(4px);
}

.gift-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1rem max(1.25rem, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #151b24 0%, #0b0c10 100%);
  border-top: 1px solid rgba(0, 245, 212, 0.2);
  border-radius: 1.25rem 1.25rem 0 0;
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.gift-sheet.is-open .gift-sheet-panel {
  transform: translateY(0);
}

.gift-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.gift-sheet-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.gift-sheet-close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.gift-sheet-lead {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.gift-scene-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.gift-scene-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.7rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(31, 40, 51, 0.8);
  background: rgba(11, 12, 16, 0.55);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gift-scene-btn:hover {
  border-color: rgba(0, 245, 212, 0.35);
  background: rgba(0, 245, 212, 0.08);
}

.gift-scene-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.chat-gift-media {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  max-width: min(280px, 100%);
  min-width: 0;
}

.chat-gift-caption {
  margin: 0;
}

.chat-gift-image-btn {
  display: block;
  padding: 0;
  border: none;
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  background: #1f2833;
  box-shadow: 0 0 0 1px rgba(0, 245, 212, 0.15);
}

.chat-gift-image-btn:focus-visible {
  outline: 2px solid rgba(0, 245, 212, 0.65);
  outline-offset: 2px;
}

.chat-gift-image {
  display: block;
  width: 100%;
  max-width: min(280px, 78vw);
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 18%;
  filter: none !important;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

.chat-picker {
  position: fixed;
  inset: 0;
  z-index: 90;
  max-width: 100%;
  overflow: hidden;
}

.chat-picker[hidden] {
  display: none !important;
}

.chat-picker-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(11, 12, 16, 0.72);
  backdrop-filter: blur(4px);
}

.chat-picker-panel {
  position: absolute;
  top: 50%;
  right: max(0px, env(safe-area-inset-right, 0px));
  left: auto;
  width: min(20.5rem, 92vw);
  height: min(26rem, calc(100dvh - 5.5rem));
  padding: 0.85rem 0.75rem max(0.75rem, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(165deg, #151b24 0%, #0b0c10 100%);
  border: 1px solid rgba(0, 245, 212, 0.18);
  border-right: none;
  border-radius: 1.1rem 0 0 1.1rem;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transform: translate(108%, -50%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-picker.is-open .chat-picker-panel {
  transform: translate(0, -50%);
}

.chat-picker-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.chat-picker-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.chat-picker-close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.chat-picker-new {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-bottom: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(0, 245, 212, 0.35);
  background: rgba(0, 245, 212, 0.1);
  color: var(--neon-primary);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.chat-picker-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 0.75rem;
  background: rgba(11, 12, 16, 0.35);
  border: 1px solid rgba(31, 40, 51, 0.5);
}

.chat-picker-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0.2rem 0;
}

.chat-convo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.65rem;
  border: none;
  border-bottom: 1px solid rgba(31, 40, 51, 0.45);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-convo-item:last-child {
  border-bottom: none;
}

.chat-convo-item:hover {
  background: rgba(11, 12, 16, 0.55);
}

.chat-convo-item.is-active {
  background: rgba(0, 245, 212, 0.1);
  box-shadow: inset 3px 0 0 var(--neon-primary);
}

.chat-convo-avatar {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.chat-convo-avatar .chat-peer-avatar {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.chat-convo-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.chat-convo-name {
  display: block;
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-convo-bubble {
  display: block;
  max-width: 100%;
  font-size: 0.75rem;
  line-height: 1.35;
  padding: 0.4rem 0.7rem;
  border-radius: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-convo-bubble--bot {
  background: var(--panel);
  border: 1px solid rgba(0, 245, 212, 0.12);
  color: var(--text-muted);
  border-bottom-left-radius: 0.3rem;
}

.chat-convo-bubble--user {
  background: linear-gradient(135deg, #5a189a 0%, #3c096c 100%);
  border: 1px solid rgba(255, 0, 127, 0.2);
  color: #fff;
  border-bottom-right-radius: 0.3rem;
}

.photo-lightbox-img {
  max-width: min(100%, 28rem);
  max-height: min(90dvh, 36rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}

@media (max-width: 767px) {
  body.view-chat {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.view-chat .site-header {
    display: none !important;
  }

  body.view-chat .main-shell {
    padding: 0;
    margin: 0;
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
  }

  body.view-chat [data-view="chat"] {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    z-index: 30;
    overflow: hidden;
    overflow-x: clip;
    touch-action: manipulation;
    transform: translate3d(0, 0, 0);
    box-sizing: border-box;
  }

  body.view-chat .chat-thread {
    height: 100%;
    max-height: 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    touch-action: manipulation;
    overflow: hidden;
    overflow-x: clip;
  }

  body.view-chat #chat-messages {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  body.view-chat .chat-composer {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.65rem max(0.65rem, env(safe-area-inset-right, 0px)) max(0.65rem, env(safe-area-inset-bottom, 0px)) max(0.65rem, env(safe-area-inset-left, 0px));
  }

  body.view-chat.keyboard-open [data-view="chat"] {
    max-height: none;
  }

  body.view-chat .chat-composer-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.view-chat .chat-composer-input {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.25;
    padding: 0.65rem 0.85rem;
    border-radius: 1.125rem;
    border: 1px solid transparent;
    background: #1f2833;
    color: #fff;
    outline: none;
  }

  body.view-chat .chat-composer-input:focus {
    border-color: rgba(0, 245, 212, 0.4);
  }

  body.view-chat .chat-composer-input::placeholder {
    color: rgba(197, 198, 199, 0.5);
  }

  body.view-chat .chat-composer-icon,
  body.view-chat .chat-composer-send {
    flex: 0 0 2.75rem;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
  }

  body.view-chat .chat-composer-icon {
    border: 1px solid #1f2833;
    background: transparent;
    color: rgba(255, 0, 127, 0.9);
    font-size: 1.05rem;
  }

  body.view-chat .chat-composer-send {
    border: none;
    background: var(--neon-primary);
    color: var(--bg-deep);
    font-weight: 700;
    font-size: 1rem;
  }

  .chat-header-gallery {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .chat-header {
    padding: 0.65rem 0.85rem;
    grid-template-columns: 1fr auto;
  }

  .chat-nav-btn--inbox,
  .chat-nav-btn--back {
    display: none;
  }

  .chat-header-center {
    justify-self: start;
  }

  .chat-header-gallery {
    display: inline-flex !important;
    justify-self: end;
  }

  .chat-picker {
    display: none !important;
  }
}

.chat-header-avatar-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  flex-shrink: 0;
  border: none;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #151b24;
  box-shadow: 0 0 0 1px rgba(0, 245, 212, 0.22);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.chat-header-avatar-wrap:focus-visible {
  outline: 2px solid rgba(0, 245, 212, 0.65);
  outline-offset: 2px;
}

.chat-header-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.chat-header-avatar-wrap[data-letter]::after {
  content: attr(data-letter);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}

/* Kis kerek profilkép — buborék mellett (NEM nagy négyzet) */
.chat-avatar {
  position: relative;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #1f2833, #151b24);
  box-shadow: 0 0 0 1px rgba(0, 245, 212, 0.2);
}

.chat-avatar--sm {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
}

.chat-avatar--md {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
}

.chat-avatar--lg {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
}

.chat-avatar-photo,
.chat-avatar .chat-avatar-img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 50%;
  position: static !important;
}

.chat-avatar[data-letter]::after {
  content: attr(data-letter);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
}

.chat-peer-avatar--initial {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5a189a 0%, #3c096c 100%) !important;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 36px;
  text-align: center;
}

/* Szöveges buborék */
.chat-bubble {
  max-width: min(78%, 17.5rem);
  padding: 0.6rem 0.95rem;
  font-size: 0.875rem;
  line-height: 1.45;
  border-radius: 1.125rem;
}

.chat-bubble--bot {
  border-bottom-left-radius: 0.3rem;
  color: var(--text-muted);
}

.chat-bubble--user {
  border-bottom-right-radius: 0.3rem;
  color: #fff;
}

.chat-bubble--typing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
}

.chat-user-bubble {
  background: linear-gradient(135deg, #5a189a 0%, #3c096c 100%);
  border: 1px solid rgba(255, 0, 127, 0.2);
}

.chat-bot-bubble {
  background: var(--panel);
  border: 1px solid rgba(0, 245, 212, 0.12);
}

.chat-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
}

#chat-messages .chat-avatar {
  align-self: flex-end;
}

#chat-messages .chat-avatar img {
  pointer-events: none;
}

.modal-backdrop {
  background: rgba(11, 12, 16, 0.88);
  backdrop-filter: blur(10px);
}
.premium-blur { filter: blur(18px); }

/* Chat — flex layout, nincs position:fixed (iOS overflow bug) */
[data-view="chat"] {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

.chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: clip;
}

#chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overscroll-behavior: contain;
  padding: 1rem 0.75rem 0.5rem;
}

.chat-msg-row {
  min-width: 0;
  max-width: 100%;
}

.chat-msg-row .chat-bubble {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-composer {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom, 0px));
  background: rgba(11, 12, 16, 0.96);
  backdrop-filter: blur(12px);
}

.chat-composer-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.chat-composer-row .chat-composer-input,
.chat-composer-row input {
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.75rem;
  max-height: 2.75rem;
  box-sizing: border-box;
  line-height: 1.25;
  padding: 0.65rem 0.85rem;
}

@media (max-width: 767px) {
  .chat-composer,
  #chat-messages,
  [data-view="chat"] .chat-thread {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
  }
}

[data-view="profile"] {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
}

#discovery-grid {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

#discovery-grid .character-card {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 768px) {
  html, body {
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior-x: none;
  }
  .main-shell {
    height: auto;
    max-height: none;
    overflow-x: clip;
    overflow-y: visible;
  }
  .discovery-view {
    height: auto;
    max-height: none;
    overflow-x: clip;
    overflow-y: visible;
  }
  .discovery-swipe {
    display: none !important;
  }

  /* Desktop chat — kitölti a viewportot, composer alul marad (mobil érintetlen) */
  body.view-chat {
    overflow: hidden;
  }

  body.view-chat .main-shell {
    height: 100svh;
    max-height: 100svh;
    overflow: hidden;
  }

  body.view-chat [data-view="chat"] {
    flex: 1 1 auto;
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
  }

  body.view-chat .chat-thread {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
  }
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(197, 198, 199, 0.85);
}

.auth-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(197, 198, 199, 0.18);
  background: rgba(11, 12, 16, 0.55);
  color: var(--text-main);
  font-size: 0.875rem;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(0, 245, 212, 0.45);
  box-shadow: 0 0 0 2px rgba(0, 245, 212, 0.12);
}

.auth-submit {
  margin-top: 0.25rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: var(--neon-primary);
  color: var(--bg-deep);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--neon-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.auth-switch {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.auth-or {
  margin: 0.75rem 0;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(197, 198, 199, 0.55);
}

.auth-message {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.auth-message.is-ok {
  color: var(--neon-primary);
  background: rgba(0, 245, 212, 0.08);
  border: 1px solid rgba(0, 245, 212, 0.2);
}

.auth-message.is-error {
  color: #ffb4c8;
  background: rgba(255, 0, 127, 0.08);
  border: 1px solid rgba(255, 0, 127, 0.22);
}
