:root {
  --brand: #ff4f7b;
  --brand-2: #ff8a4c;
  --brand-3: #8b5cf6;
  --grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  --rainbow: linear-gradient(90deg, #e40303, #ff8c00, #ffed00, #008026, #24408e, #732982);
  --bg: #fff7f8;
  --surface: #ffffff;
  --surface-2: #f6eef0;
  --text: #1f1720;
  --muted: #7a6b72;
  --line: #eadde1;
  --like: #22c55e;
  --nope: #ef4444;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(80, 20, 40, .12);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
/* Sötét téma: a data-theme attribútumot az app.html fejében lévő szkript állítja
   (a felhasználó választása, vagy „Automatikus” esetén a rendszerbeállítás alapján). */
:root[data-theme="dark"] {
  --bg: #140f13;
  --surface: #1e171c;
  --surface-2: #2a2027;
  --text: #f6ecf0;
  --muted: #b09fa8;
  --line: #3a2d35;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
.theme-toggle { background: none; border: 1.5px solid var(--line); border-radius: 999px; width: 40px; height: 40px; display: inline-grid; place-items: center; cursor: pointer; font-size: 1.1rem; }
.landing header .right { display: flex; gap: .5rem; align-items: center; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Logó ---------- */
.logo { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; text-decoration: none; color: var(--text); }
.logo-mark { width: 34px; height: 34px; border-radius: 11px; position: relative; flex: none; box-shadow: 0 4px 14px rgba(255, 79, 123, .35);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 21s-8.5-5.2-8.5-11.2A4.8 4.8 0 0 1 12 6.6a4.8 4.8 0 0 1 8.5 3.2C20.5 15.8 12 21 12 21z'/%3E%3C/svg%3E") center 42%/62% no-repeat, var(--grad); }
.logo-mark::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 12%; height: 9%; border-radius: 3px; background: var(--rainbow); }
.logo-mark.big { width: 72px; height: 72px; border-radius: 22px; }
.boot { min-height: 100vh; display: grid; place-items: center; }

/* ---------- Gombok, űrlapok ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; border-radius: 999px; padding: .85rem 1.4rem; font-weight: 700; cursor: pointer;
  background: var(--surface-2); color: var(--text); text-decoration: none; transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(255, 79, 123, .3); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.danger { background: transparent; color: var(--nope); border: 1.5px solid color-mix(in srgb, var(--nope) 40%, transparent); }
.btn.block { width: 100%; }
.btn.sm { padding: .5rem .9rem; font-size: .9rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }

.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.input, textarea.input, select.input {
  width: 100%; padding: .8rem 1rem; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--brand); }
textarea.input { resize: vertical; min-height: 96px; }
.row { display: flex; gap: .75rem; }
.row > * { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: .55rem 1rem;
  cursor: pointer; font-weight: 600; user-select: none; transition: all .15s;
}
.chip[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; margin: .5rem 0 1.2rem; }
.check input { margin-top: .2rem; accent-color: var(--brand); width: 18px; height: 18px; }
.range-row { display: flex; align-items: center; gap: .75rem; }
.range-row input[type=range] { flex: 1; accent-color: var(--brand); }
.range-row output { min-width: 4.5em; text-align: right; font-weight: 700; }

.card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.section { margin-bottom: 1.25rem; }
.section h3 { font-size: 1rem; margin-bottom: .9rem; }
.error { color: var(--nope); font-size: .9rem; min-height: 1.2em; margin: .25rem 0 .75rem; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); transform: translateX(-50%) translateY(20px);
  background: #241a20; color: #fff; padding: .7rem 1.1rem; border-radius: 12px; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Kezdőlap ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing header { display: flex; justify-content: space-between; align-items: center; padding: calc(1rem + var(--safe-t)) 1.25rem 1rem; max-width: 1100px; width: 100%; margin: 0 auto; }
.hero { flex: 1; display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem 3rem; width: 100%; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); letter-spacing: -.03em; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero .cta { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.pairs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pair { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; font-weight: 600; font-size: .92rem; }
.hero-visual { position: relative; height: 420px; display: none; }
.hero-visual .ph { position: absolute; width: 230px; height: 320px; border-radius: 24px; box-shadow: var(--shadow); display: flex; align-items: flex-end; padding: 1rem; color: #fff; font-weight: 700; font-size: 1.1rem; }
.hero-visual .ph:nth-child(1) { left: 6%; top: 40px; transform: rotate(-8deg); background: linear-gradient(160deg, #8b5cf6, #ec4899); }
.hero-visual .ph:nth-child(2) { left: 32%; top: 0; transform: rotate(3deg); background: linear-gradient(160deg, #ff8a4c, #ff4f7b); z-index: 2; }
.hero-visual .ph:nth-child(3) { left: 58%; top: 60px; transform: rotate(10deg); background: linear-gradient(160deg, #06b6d4, #3b82f6); }
.features { display: grid; gap: 1rem; max-width: 1100px; margin: 0 auto 3rem; padding: 0 1.25rem; grid-template-columns: 1fr; }
.features .card h3 { font-size: 1.05rem; }
.landing footer { text-align: center; padding: 1.5rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.1fr 1fr; }
  .hero-visual { display: block; }
  .features { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Auth oldalak ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: calc(1.5rem + var(--safe-t)) 1.25rem 1.5rem; }
.auth .card { width: 100%; max-width: 440px; }
.auth h1 { font-size: 1.6rem; }
.auth .top { display: flex; justify-content: center; margin-bottom: 1.25rem; }

/* ---------- App váz ---------- */
.shell { min-height: 100vh; }
.main { padding: calc(.75rem + var(--safe-t)) 1rem calc(var(--nav-h) + var(--safe-b) + 1rem); max-width: 560px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; min-height: 44px; }
.topbar h2 { margin: 0; font-size: 1.35rem; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); z-index: 20;
}
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; position: relative; }
.nav a svg { width: 26px; height: 26px; }
.nav a.active { color: var(--brand); }
.nav .brand { display: none; }
.badge { position: absolute; top: 8px; left: calc(50% + 6px); background: var(--brand); color: #fff; font-size: .68rem; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
@media (min-width: 900px) {
  .nav { top: 0; right: auto; width: 240px; height: 100vh; flex-direction: column; justify-content: flex-start; gap: .25rem; padding: 1.5rem 1rem; border-top: 0; border-right: 1px solid var(--line); }
  .nav .brand { display: flex; margin: 0 .5rem 1.5rem; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: .8rem; padding: .8rem 1rem; border-radius: 14px; font-size: 1rem; }
  .nav a.active { background: color-mix(in srgb, var(--brand) 12%, transparent); }
  .badge { position: static; margin-left: auto; }
  .main { margin-left: max(240px, calc(50vw - 280px + 120px)); padding-bottom: 2rem; padding-top: 1.5rem; }
  #toast { bottom: 24px; }
}

/* ---------- Felfedezés: kártyák ---------- */
.deck { position: relative; height: min(68vh, 620px); margin: 0 auto; max-width: 440px; touch-action: none; }
.pcard {
  position: absolute; inset: 0; border-radius: 22px; overflow: hidden; background: #2b2228 center/cover no-repeat;
  box-shadow: var(--shadow); user-select: none; will-change: transform; cursor: grab;
}
.pcard:active { cursor: grabbing; }
.pcard .photo { position: absolute; inset: 0; background: center/cover no-repeat; }
.pcard .bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.pcard .bars i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .4); }
.pcard .bars i.on { background: #fff; }
.pcard .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 4rem 1.25rem 1.25rem; color: #fff; background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, 0)); }
.pcard .info h2 { font-size: 1.8rem; margin: 0 0 .2rem; }
.pcard .info h2 span { font-weight: 400; }
.pcard .info .meta { opacity: .9; font-size: .92rem; display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.pcard .info .bio { margin-top: .6rem; font-size: .95rem; opacity: .95; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.pcard .stamp { position: absolute; top: 40px; font-size: 2rem; font-weight: 900; padding: .2rem .8rem; border: 4px solid; border-radius: 10px; opacity: 0; z-index: 3; letter-spacing: .05em; }
.pcard .stamp.like { left: 24px; color: var(--like); transform: rotate(-15deg); }
.pcard .stamp.nope { right: 24px; color: var(--nope); transform: rotate(15deg); }
.pcard .tap { position: absolute; top: 0; bottom: 35%; width: 50%; z-index: 1; }
.pcard .tap.l { left: 0; } .pcard .tap.r { right: 0; }
.actions { display: flex; justify-content: center; gap: 1.5rem; margin-top: 1.25rem; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; transition: transform .12s; }
.round:active { transform: scale(.9); }
.round svg { width: 30px; height: 30px; }
.round.nope { color: var(--nope); } .round.like { color: #fff; background: var(--grad); }
.round.info-btn { width: 48px; height: 48px; align-self: center; color: var(--brand-3); }
.round.info-btn svg { width: 22px; height: 22px; }
.empty { text-align: center; padding: 3rem 1rem; }
.empty .icon { font-size: 3rem; margin-bottom: .5rem; }

/* ---------- Matchek ---------- */
.newmatches { display: flex; gap: .9rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: 1.25rem; scrollbar-width: none; }
.newmatches a { flex: none; width: 76px; text-align: center; text-decoration: none; color: var(--text); font-size: .85rem; font-weight: 600; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2) center/cover no-repeat; flex: none; }
.newmatches .avatar { width: 72px; height: 72px; margin: 0 auto .35rem; border: 3px solid var(--brand); }
.convs { list-style: none; margin: 0; padding: 0; }
.convs a { display: flex; gap: .9rem; align-items: center; padding: .75rem .25rem; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.convs .txt { flex: 1; min-width: 0; }
.convs .name { font-weight: 700; display: flex; justify-content: space-between; gap: .5rem; }
.convs .name time { font-weight: 400; font-size: .8rem; color: var(--muted); }
.convs .last { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .93rem; }
.convs .unread .last { color: var(--text); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex: none; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--nav-h) - var(--safe-b) - var(--safe-t) - 1.5rem); }
@media (min-width: 900px) { .chat { height: calc(100dvh - 3rem); } }
.chat-head { display: flex; align-items: center; gap: .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.chat-head .avatar { width: 44px; height: 44px; cursor: pointer; }
.chat-head .who { flex: 1; font-weight: 700; cursor: pointer; }
.icon-btn { background: none; border: 0; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; }
.msgs { flex: 1; overflow-y: auto; padding: 1rem 0; display: flex; flex-direction: column; gap: .35rem; }
.msg { max-width: 78%; padding: .6rem .9rem; border-radius: 18px; background: var(--surface-2); white-space: pre-wrap; word-wrap: break-word; align-self: flex-start; }
.msg.mine { background: var(--grad); color: #fff; align-self: flex-end; }
.msg-time { font-size: .72rem; color: var(--muted); align-self: center; margin: .6rem 0 .2rem; }
.seen { font-size: .72rem; color: var(--muted); align-self: flex-end; }
.composer { display: flex; gap: .5rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; min-height: 46px; max-height: 120px; border-radius: 23px; padding: .7rem 1rem; }
.composer .btn { padding: 0; width: 46px; height: 46px; flex: none; }

/* ---------- Profil ---------- */
.photos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.photo-slot { aspect-ratio: 3/4; border-radius: 14px; background: var(--surface-2) center/cover no-repeat; position: relative; border: 2px dashed var(--line); display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 2rem; }
.photo-slot.filled { border: 0; cursor: default; }
.photo-slot .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.photo-slot .star { position: absolute; left: 6px; bottom: 6px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .72rem; padding: .25rem .55rem; cursor: pointer; }
.photo-slot .main-tag { position: absolute; left: 6px; bottom: 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .72rem; padding: .25rem .55rem; font-weight: 700; }
.photo-slot.loading::after { content: ""; width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.list-actions { display: grid; gap: .6rem; }

/* ---------- Modál ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 8, 12, .65); z-index: 50; display: grid; place-items: center; padding: 1rem; animation: fade .2s; }
.modal { background: var(--surface); border-radius: 22px; max-width: 440px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 1.5rem; animation: pop .25s; }
.modal.profile-modal { padding: 0; }
.modal.profile-modal .pm-photos { aspect-ratio: 3/4; max-height: 60vh; width: 100%; background: #222 center/cover no-repeat; position: relative; }
.modal.profile-modal .pm-body { padding: 1.25rem; }
.match-modal { text-align: center; background: linear-gradient(160deg, #ff4f7b, #8b5cf6); color: #fff; }
.match-modal h2 { font-size: 2.4rem; margin: .5rem 0; }
.match-modal .duo { display: flex; justify-content: center; margin: 1.5rem 0; }
.match-modal .duo .avatar { width: 110px; height: 110px; border: 4px solid #fff; }
.match-modal .duo .avatar + .avatar { margin-left: -20px; }
.match-modal .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }

.report-list .card { margin-bottom: 1rem; }
.report-list .who { display: flex; gap: .8rem; align-items: center; margin-bottom: .6rem; }
.prose { max-width: 720px; margin: 0 auto; padding: calc(1.5rem + var(--safe-t)) 1.25rem 3rem; }
.prose h2 { margin-top: 1.5rem; font-size: 1.2rem; }
