/* ============ alapok ============ */
:root {
  --bg: #0d0e12;
  --bg-elev: #13151b;
  --surface: #181b22;
  --surface-2: #20242d;
  --surface-3: #2a2f3a;
  --border: #272b35;
  --border-strong: #363b48;
  --text: #eceef3;
  --text-2: #c3c8d3;
  --muted: #8d94a3;
  --accent: #ffb627;
  --accent-2: #ff7a1a;
  --accent-soft: rgba(255, 182, 39, 0.14);
  --on-accent: #1b1204;
  --nsfw: #ff3d6e;
  --nsfw-soft: rgba(255, 61, 110, 0.14);
  --ok: #3ddc97;
  --danger: #ff5a5a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --header-h: 64px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  /* A lábléc mindig az oldal alján van: rövid oldalon (vagy betöltés közben) a <main> tölti ki a helyet. */
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img, video { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.container { max-width: 1680px; margin: 0 auto; padding: 20px 16px 64px; }
/* A body flex oszlop: a width kell, mert az auto margó a flex elemet tartalomszélességűre szűkítené. */
main.container { flex: 1 0 auto; width: 100%; }
main:focus { outline: none; }

.icon { flex: none; display: inline-block; vertical-align: middle; }

/* ============ gombok, űrlapok ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, color .15s;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: var(--on-accent);
}
.btn-primary:hover { background: linear-gradient(135deg, #ffc54d, #ff8c38); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; border-color: rgba(255, 90, 90, .45); color: var(--danger); }
.btn-danger:hover { background: rgba(255, 90, 90, .12); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 16px; }
.btn-icon { width: 38px; padding: 0; }
.btn-block { width: 100%; }

.input, .textarea, .select {
  width: 100%; height: 42px; padding: 0 14px;
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 14px; resize: vertical; }
.select { padding-right: 32px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.is-invalid, .textarea.is-invalid, .ti.is-invalid { border-color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-weight: 600; font-size: 14px; color: var(--text-2); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.field-error { font-size: 13px; color: var(--danger); min-height: 0; }
.field-error:empty { display: none; }
.req { color: var(--accent); }

.form { display: flex; flex-direction: column; gap: 16px; }
.form-error {
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(255, 90, 90, .1); border: 1px solid rgba(255, 90, 90, .35); color: #ffb3b3; font-size: 14px;
}
.form-error:empty { display: none; }

/* kapcsoló */
.switch {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 4px 2px; font-size: 13px; font-weight: 700; color: var(--text-2);
}
.switch-track {
  position: relative; width: 36px; height: 20px; border-radius: 999px;
  background: var(--surface-3); transition: background .2s;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.switch[aria-checked="true"] .switch-track { background: var(--accent); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(16px); }
.switch.is-nsfw[aria-checked="true"] .switch-track { background: var(--nsfw); }

/* szegmentált választó */
.seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--muted);
  height: 32px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--surface-3); color: var(--text); }

/* ============ fejléc ============ */
.header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(13, 14, 18, .82); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1680px; margin: 0 auto; padding: 0 16px; height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
}
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; flex: none; }
.logo:hover { color: var(--text); }
.logo-img { width: 34px; height: 34px; border-radius: 9px; display: block; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.logo-es { color: var(--accent); }

.search { position: relative; flex: 1; max-width: 620px; }
.search .input { height: 40px; padding-left: 40px; border-radius: 999px; background: var(--surface); }
.search > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nsfw-controls { display: flex; align-items: center; gap: 10px; padding: 0 4px; }

.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 3px; border-radius: 999px; }
.user-btn:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; z-index: 70;
}
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head b { display: block; }
.menu-head span { font-size: 13px; color: var(--muted); }
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 8px; border: 0; background: none; text-align: left; font-size: 14px;
}
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); }

/* nyelvválasztó */
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  font-size: 12.5px; font-weight: 800; letter-spacing: .03em;
}
.lang-btn:hover { color: var(--text); border-color: var(--muted); }
.lang-menu { min-width: 240px; }
.lang-menu .lang-code { width: 24px; flex: none; font: 700 11.5px/1 var(--mono); color: var(--muted); }
.lang-menu button.is-current { color: var(--accent); }
.lang-menu button > .icon:last-child { margin-left: auto; }

@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .upload-label { display: none; }
  .header .btn-upload { width: 38px; padding: 0; }
}
@media (max-width: 480px) {
  .logo { font-size: 18px; }
  .logo-text { display: none; }
  .header-actions { gap: 6px; }
  .nsfw-controls { gap: 6px; }
  .guest-register { display: none; }
  .lang-btn { width: 34px; padding: 0; justify-content: center; }
  .lang-btn-code { display: none; }
  .seg button { padding: 0 10px; gap: 5px; font-size: 13.5px; }
  .seg button .icon { display: none; }
  .switch-track { width: 32px; }
  .switch[aria-checked="true"] .switch-thumb { transform: translateX(12px); }
}

.banner {
  background: linear-gradient(90deg, rgba(255, 182, 39, .14), rgba(255, 122, 26, .08));
  border-bottom: 1px solid rgba(255, 182, 39, .25);
  font-size: 14px;
}
.banner-inner { max-width: 1680px; margin: 0 auto; padding: 9px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.banner-inner .spacer { flex: 1; }
.banner-text { flex: 1 1 240px; min-width: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ============ autocomplete ============ */
.ac {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 80;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; max-height: 340px; overflow-y: auto;
}
.ac-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.ac-item.is-active { background: var(--surface-2); }
.ac-item .ac-meta { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.ac-item.is-create { color: var(--accent); }
.ac-item.is-nsfw { color: var(--nsfw); }
.ac-user { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }

/* A keresés oldalon a keresett szóra illő felhasználók */
.user-strip { margin: 4px 0 14px; }
.user-strip-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.user-strip-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: 14px;
}
.user-chip:hover { background: var(--surface-2); text-decoration: none; }
.user-chip-meta { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.ac-section { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ============ tag & kiterjesztés címkék ============ */
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent;
}
.tag:hover { color: var(--text); background: var(--surface-3); }
.tag-nsfw { background: var(--nsfw-soft); color: var(--nsfw); border-color: rgba(255, 61, 110, .35); font-weight: 700; }
.tag-nsfw:hover { color: #ff7597; background: rgba(255, 61, 110, .22); }
.tag-count { margin-left: 6px; color: var(--muted); font-size: 11.5px; }
.ext {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px;
  font: 600 12px/1 var(--mono); color: var(--accent); border: 1px solid rgba(255, 182, 39, .35); background: var(--accent-soft);
}
.ext:hover { color: #ffd27a; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 11px; border-radius: 999px;
  background: var(--surface-3); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.chip-nsfw { background: var(--nsfw-soft); color: var(--nsfw); }
.chip-x {
  width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--muted);
  display: inline-grid; place-items: center; font-size: 16px; line-height: 1;
}
.chip-x:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
.chip-plain { padding: 0 11px; }

/* tag beviteli mező */
.ti {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 42px; padding: 6px 8px; background: var(--bg-elev);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: text;
}
.ti:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ti-chips { display: contents; }
.ti-input { flex: 1; min-width: 140px; height: 28px; border: 0; background: transparent; outline: none; padding: 0 4px; }
.ti-count { font-size: 12px; color: var(--muted); padding: 0 4px; }

/* ============ oldal fejlécek, szűrők ============ */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { color: var(--muted); font-size: 14px; }

.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 22px 24px; margin-bottom: 20px; border-radius: 20px;
  background:
    radial-gradient(600px 180px at 0% 0%, rgba(255, 182, 39, .18), transparent 70%),
    radial-gradient(500px 200px at 100% 100%, rgba(255, 61, 110, .12), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
}
.hero h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; }
.hero p { color: var(--text-2); margin-top: 4px; }
.hero-actions { display: flex; gap: 10px; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.tag-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 8px; scrollbar-width: thin; }
.tag-strip .tag { height: 30px; padding: 0 13px; font-size: 13.5px; }

.filters {
  display: grid; gap: 12px; padding: 16px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.filters-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filters-row > .ti { flex: 1; min-width: 240px; }
.filters .select { width: auto; min-width: 180px; height: 38px; background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.notice {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; margin-bottom: 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--text-2);
}
.notice-nsfw { background: var(--nsfw-soft); border-color: rgba(255, 61, 110, .35); color: #ffc2d1; }
.notice .spacer { flex: 1; }

/* ============ masonry feed ============ */
.masonry { display: flex; gap: 16px; align-items: flex-start; }
.masonry-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.feed-status { display: grid; place-items: center; padding: 28px 0; color: var(--muted); text-align: center; gap: 12px; }
.feed-status:empty { display: none; }
.feed-sentinel { height: 1px; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-emoji { font-size: 44px; display: block; margin-bottom: 8px; }

/* 404 oldal (ismeretlen oldal, törölt mém, nem létező felhasználó) */
.not-found { max-width: 720px; margin: 0 auto; padding: 28px 0 56px; text-align: center; }
.not-found-img {
  display: block; width: 100%; height: auto; margin-bottom: 26px;
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.not-found-text { color: var(--muted); margin: 8px 0 22px; }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ mém kártya ============ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color .15s, transform .15s;
  animation: card-in .25s ease-out both;
}
.card:hover { border-color: var(--border-strong); }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } }

.card-media, .viewer-media {
  position: relative; display: block; overflow: hidden; background: var(--surface-2);
  isolation: isolate;
}
.card-media { width: 100%; }
.ph {
  position: absolute; inset: -8%; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(14px) saturate(1.1);
}
.media-el {
  position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center;
  background: transparent;
}
.card-media.is-blurred .ph { filter: blur(22px) saturate(1.3) brightness(.7); }
.nsfw-cover {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(10, 10, 14, .35); color: #fff; text-align: center; padding: 12px; cursor: pointer;
}
.nsfw-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--nsfw); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .04em;
}
.nsfw-hint { font-size: 13px; font-weight: 600; opacity: .9; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

.card-badge, .card-kind {
  position: absolute; top: 10px; z-index: 4;
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; backdrop-filter: blur(8px);
}
.card-badge { left: 10px; background: rgba(0, 0, 0, .55); color: #fff; }
.card-badge.badge-hot { background: rgba(255, 90, 40, .88); }
.card-badge.badge-new { background: rgba(61, 220, 151, .88); color: #062014; }
.card-badge.badge-top { background: rgba(120, 110, 255, .88); }
.card-badge.badge-loved { background: rgba(255, 70, 120, .88); }
.card-kind { right: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-family: var(--mono); }

/* A szöveg a felület nyelvén, a kártya data-tall-hint attribútumából jön. */
.card-media.is-tall::after {
  content: attr(data-tall-hint); position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 36px 12px 10px; font-size: 12.5px; font-weight: 700; text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, .85));
}
.card-media.is-blurred.is-tall::after { display: none; }

.card-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-weight: 700; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.card-meta { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); min-width: 0; }
.card-author { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-weight: 600; min-width: 0; }
.card-author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-views { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
/* Mentés (könyvjelző) gomb: a kártyán csak ikon, a mém oldalon felirattal */
.save-btn-sm {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 30px; margin-right: -6px; border: 0;
  border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.save-btn-sm:hover { color: var(--text); background: var(--surface-3); }
.save-btn.is-on { color: var(--accent); }
.save-btn.is-on .icon { fill: currentColor; }
.card-foot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

/* értékelés (fel / le) */
.vote {
  display: inline-flex; align-items: center; gap: 1px; flex: none;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
}
.vote-btn {
  display: inline-grid; place-items: center; width: 30px; height: 28px; padding: 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
}
.vote-btn:hover { color: var(--text); background: var(--surface-3); }
.vote-up.is-on { color: var(--accent-2); }
.vote-down.is-on { color: #8b93ff; }
.vote-btn.is-on .icon { fill: currentColor; }
.vote-score { min-width: 20px; text-align: center; font-weight: 700; font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.vote.is-up .vote-score { color: var(--accent-2); }
.vote.is-down .vote-score { color: #8b93ff; }
.vote.is-own .vote-btn { opacity: .4; cursor: default; }
.vote.is-own .vote-btn:hover { background: transparent; color: var(--muted); }
.vote-lg .vote-btn { width: 40px; height: 36px; }
.vote-lg .vote-score { min-width: 30px; font-size: 17px; }
.vote-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.vote-detail { font-size: 13.5px; color: var(--muted); }

/* Discord */
.dlink { max-width: 560px; margin: 32px auto; }
.tag-discord { background: rgba(88, 101, 242, .18); border-color: rgba(88, 101, 242, .45); color: #aab2ff; }

/* avatar */
.avatar {
  flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden;
  background: var(--surface-3); color: #fff; font-weight: 800; object-fit: cover;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============ mém oldal ============ */
.meme-page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.meme-main { min-width: 0; }
.viewer {
  position: relative; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  display: grid; place-items: center; min-height: 240px;
}
.viewer-media { width: 100%; display: grid; place-items: center; }
.viewer-media .media-el { width: 100%; height: auto; max-height: 82vh; object-fit: contain; margin: 0 auto; }
.viewer-media.is-blurred { min-height: 360px; }
.viewer-media.is-blurred .ph { filter: blur(30px) saturate(1.3) brightness(.6); }
.viewer-media .nsfw-cover { gap: 12px; }
.viewer-media.is-tall-full .media-el { max-height: none; }
/* Lapozó nyilak a mém két szélén (←/→ és húzás is lapoz) */
.viewer-nav {
  position: absolute; top: 50%; z-index: 6; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%;
  display: grid; place-items: center; border: 0; background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer;
  opacity: .7; transition: opacity .15s, background .15s;
}
.viewer-nav:hover, .viewer-nav:focus-visible { opacity: 1; background: rgba(0, 0, 0, .75); }
.viewer-prev { left: 10px; }
.viewer-next { right: 10px; }
@media (hover: none) { .viewer-nav { width: 38px; height: 38px; margin-top: -19px; opacity: .55; } }

.meme-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 16px); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.meme-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.meme-title.is-untitled { color: var(--muted); font-weight: 600; font-style: italic; }
.meme-desc { margin-top: 8px; color: var(--text-2); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.author-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.author-row .name { font-weight: 700; }
.author-row .when { font-size: 13px; color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin-top: 16px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.meme-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.meme-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.section-title { font-size: 20px; font-weight: 800; margin: 36px 0 16px; letter-spacing: -.01em; }

@media (max-width: 1000px) {
  .meme-page { grid-template-columns: 1fr; }
  .meme-side { position: static; }
}

/* ============ radio kártyák (NSFW választó) ============ */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong); background: var(--bg-elev); cursor: pointer; transition: border-color .15s, background .15s;
}
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card b { font-size: 15px; }
.radio-card span { font-size: 12.5px; color: var(--muted); }
.radio-card:hover { border-color: var(--muted); }
.radio-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.radio-card:has(input:checked) { border-color: var(--ok); background: rgba(61, 220, 151, .08); }
.radio-card.is-nsfw:has(input:checked) { border-color: var(--nsfw); background: var(--nsfw-soft); }
.radio-cards.is-invalid .radio-card { border-color: var(--danger); }

/* ============ feltöltés ============ */
.upload-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1200px; margin: 0 auto; }
.dropzone {
  position: relative; display: grid; place-items: center; text-align: center; gap: 10px;
  min-height: 380px; padding: 30px; border-radius: 18px; cursor: pointer;
  border: 2px dashed var(--border-strong); background: var(--surface);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-invalid { border-color: var(--danger); }
.dropzone-inner { display: grid; justify-items: center; gap: 10px; }
.dropzone-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.dropzone h2 { font-size: 20px; }
.dropzone p { color: var(--muted); font-size: 14px; }
.dropzone.has-file { padding: 12px; cursor: default; border-style: solid; }
.preview-media { max-width: 100%; max-height: 60vh; border-radius: 10px; display: block; margin: 0 auto; background: #000; }
.file-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 13.5px; color: var(--text-2); justify-content: center; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
.suggested { display: flex; flex-wrap: wrap; gap: 6px; }
.suggested .tag { cursor: pointer; border: 0; }

/* előfeltöltés + AI elemzés állapota a feltöltés oldalon */
.chip-ai { background: var(--accent-soft); color: var(--accent); }
.stage-status { display: grid; justify-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; color: var(--text-2); text-align: center; }
.stage-status:empty { display: none; }
.stage-status .progress { width: min(320px, 100%); height: 6px; }
.stage-status.is-ok .stage-line:first-child { color: var(--ok); }
.stage-status.is-error { color: var(--danger); }
.stage-line { display: inline-flex; align-items: center; gap: 8px; }
.stage-line.is-nsfw { color: var(--nsfw); }
.spinner-sm { width: 14px; height: 14px; border-width: 2px; flex: none; }
.tag-ai { background: var(--accent-soft); color: var(--accent); }
.tag-ai:hover { filter: brightness(1.15); }
.ai-hint { color: var(--nsfw); margin-top: 6px; }
.ai-hint:empty { display: none; }

/* tömeges feltöltés és a korábbi feltöltések listája */
.up-bulk { padding: 8px; }
.up-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.up-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--border); }
.up-row.is-error { border-color: rgba(255, 90, 90, .35); }
.up-row.is-ok { border-color: rgba(61, 220, 151, .3); }
.up-thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.up-main { display: grid; gap: 4px; min-width: 0; }
.up-main .progress { height: 5px; }
.up-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.up-row.is-error .up-status { color: var(--danger); }

/* Feltöltéseim: elutasítás oka, felülvizsgálat, NSFW-zárolt mémek */
.my-uploads { display: flex; flex-direction: column; gap: 16px; }
.my-uploads .up-row { align-items: start; }
.up-locked h2 { font-size: 17px; margin-bottom: 4px; }
.up-locked .field-hint { margin-bottom: 10px; }
.up-reason { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.up-appeal { gap: 8px; flex-wrap: wrap; }
.up-thumb img.is-blurred { filter: blur(6px); transform: scale(1.2); }
a.up-name { color: var(--text); }
.up-recent-head { justify-content: space-between; margin-bottom: 8px; }
.up-recent-head .up-recent-title { margin-bottom: 0; }
.appeal-status { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.appeal-status.is-open b { color: var(--accent); }
.appeal-status.is-approved b { color: var(--ok); }
.appeal-status.is-denied b { color: var(--danger); }
.appeal-form p { color: var(--text-2); font-size: 14px; }
.appeal-message { border-left: 3px solid var(--accent); padding-left: 8px; }
.sfw-request { display: flex; align-items: center; }
.up-row.is-ok .up-status { color: var(--ok); }
.up-meta { color: var(--muted); }
.up-meta::before { content: '·'; margin-right: 6px; }
.up-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.up-recent { max-width: 1200px; margin: 24px auto 0; }
.up-recent-title { font-size: 17px; margin-bottom: 12px; }
@media (max-width: 520px) {
  .up-row { grid-template-columns: 44px minmax(0, 1fr); }
  .up-thumb { width: 44px; height: 44px; }
  .up-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 900px) {
  .upload-page { grid-template-columns: 1fr; }
  .dropzone { min-height: 240px; }
}

/* ============ auth oldalak ============ */
.auth-card {
  max-width: 440px; margin: 32px auto; padding: 30px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
}
.auth-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); margin-bottom: 22px; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; gap: 10px; }
.btn-google:hover { background: #f1f3f4; color: #1f1f1f; }
.divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 13px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.google-badge {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 18px;
  border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--border);
}
.auth-alt a { color: var(--accent); font-weight: 600; }
.auth-forgot { align-self: flex-end; margin-top: -6px; font-size: 13.5px; color: var(--muted); }
.auth-forgot:hover { color: var(--accent); }
.auth-legal { margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.auth-legal a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

/* ============ jogi oldalak ============ */
.legal { max-width: 760px; margin: 12px auto 0; line-height: 1.65; color: var(--text-2); }
.legal .page-title { color: var(--text); margin-bottom: 4px; }
.legal-updated { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.legal section { margin-top: 26px; }
.legal h2 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.legal p { margin: 0 0 10px; }
.legal ul { margin: 0 0 10px; padding-left: 22px; }
.legal li { margin-bottom: 6px; }

/* ============ lábléc ============ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elev); }
.footer-inner {
  max-width: 1680px; margin: 0 auto; padding: 18px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  color: var(--muted); font-size: 13.5px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }
.site-footer { flex-shrink: 0; }
.social-link { display: inline-flex; align-items: center; gap: 7px; }
.social-link .icon { flex-shrink: 0; }
.footer-links .social-link:hover { color: var(--text); }
.footer-links .social-tiktok:hover .icon { color: #ff2a55; filter: drop-shadow(1.5px 1px 0 #25f4ee); }
.footer-links .social-instagram:hover .icon { color: #e1306c; }
.footer-links .social-discord:hover .icon { color: #5865f2; }

/* ============ profil ============ */
.profile-head {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 24px; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
}
.profile-head .avatar { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent); }
.profile-info { flex: 1; min-width: 220px; }
.profile-info h1 { font-size: 28px; font-weight: 800; }
.profile-bio { color: var(--text-2); margin-top: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.profile-stats { display: flex; gap: 22px; margin-top: 12px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.profile-stats b { color: var(--text); font-size: 16px; }

/* Követés gomb: követve visszafogott, rámutatva a leállítást jelzi */
.follow-btn.is-following:hover { color: var(--danger); border-color: rgba(255, 90, 90, .45); }
.tag-actions { gap: 8px; flex-wrap: wrap; }

/* Követések kezelése */
.following { display: flex; flex-direction: column; gap: 16px; }
.following .panel h2 { font-size: 17px; margin-bottom: 10px; }
.follow-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.follow-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.follow-list li:first-child { border-top: 0; }
.follow-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); }
.follow-who:hover { text-decoration: none; }
.follow-who > span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }

/* ============ beállítások ============ */
.settings { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.settings .panel h2 { font-size: 17px; margin-bottom: 14px; }
.settings .settings-hint { margin: -6px 0 12px; }
.hidden-users { display: flex; flex-wrap: wrap; gap: 6px; }
.hidden-users .chip a { color: inherit; }
.hidden-users .field-hint { margin: 0; }
.settings .panel.danger { border-color: rgba(255, 90, 90, .35); }
.avatar-edit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .spacer { flex: 1; }
.pill-ok { color: var(--ok); font-weight: 700; }
.pill-warn { color: var(--accent); font-weight: 700; }
.settings-switch { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 10px 0; }
.settings-switch + .settings-switch { border-top: 1px solid var(--border); }
.settings-switch p { font-size: 13px; color: var(--muted); }

/* ============ tagek oldal ============ */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud .tag { height: 32px; padding: 0 14px; font-size: 14px; }

/* ============ toast, modal ============ */
.toasts {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 300;
  display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 460px); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 14px; font-weight: 500; animation: toast-in .2s ease-out;
}
.toast.is-error { border-color: rgba(255, 90, 90, .5); }
.toast.is-ok { border-color: rgba(61, 220, 151, .5); }
.toast a { color: var(--accent); font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 250; background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px; animation: fade .15s;
}
.modal {
  width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 24px; box-shadow: var(--shadow);
}
.modal h2 { font-size: 20px; margin-bottom: 8px; }
.modal p { color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ bejelentés (DSA) ============ */
.report-modal { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.report-modal h2 { margin-bottom: 0; }
.report-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (max-width: 520px) { .report-reasons { grid-template-columns: 1fr; } }
.report-reason {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-elev); cursor: pointer; font-size: 14px;
}
.report-reason:hover { border-color: var(--muted); }
.report-reason:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.report-reason.is-severe:has(input:checked) { border-color: var(--nsfw); background: var(--nsfw-soft); }
.report-reason input { accent-color: var(--accent); }
.report-hint { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--nsfw-soft); color: #ffc2d1; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.checkbox input { margin-top: 3px; accent-color: var(--accent); flex: none; }

.report-cards { display: flex; flex-direction: column; gap: 14px; }
.report-card { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: start; }
.report-preview {
  position: relative; width: 160px; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center; isolation: isolate;
}
.report-preview .ph { filter: blur(18px) brightness(.6); }
.report-preview .btn { position: relative; z-index: 2; }
.report-preview .media-el { position: absolute; inset: 0; z-index: 3; }
.report-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.report-title { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.report-reasons-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.report-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.report-list li { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--border); }
.report-details { margin-top: 4px; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.report-actions { gap: 8px; }
.url-list { margin: 12px 0 0; padding-left: 18px; font-size: 12.5px; overflow-wrap: anywhere; }
.url-list code { font-family: var(--mono); }

.user-btn { position: relative; }
.avatar-badge {
  position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--nsfw); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.menu-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--nsfw); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center;
}

/* ---- admin postafiók ---- */
.inbox-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.inbox-list:has(.empty) { border: 0; }
.inbox-item {
  display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 11px 14px; background: var(--surface); border-top: 1px solid var(--border); color: var(--text-2);
}
.inbox-item:first-child { border-top: 0; }
.inbox-item:hover { background: var(--surface-2); text-decoration: none; }
.inbox-item.is-unread { color: var(--text); }
.inbox-item.is-unread .inbox-from, .inbox-item.is-unread .inbox-subject { font-weight: 800; }
.inbox-item.is-unread .inbox-from::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent);
}
.inbox-from, .inbox-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-snippet { color: var(--muted); }
.inbox-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.inbox-more { margin: 14px auto 0; display: flex; }
.inbox-back { display: inline-block; margin-bottom: 12px; color: var(--muted); }
.inbox-message, .inbox-message > .panel { display: flex; flex-direction: column; gap: 14px; }
.inbox-title { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.inbox-head { display: flex; flex-direction: column; gap: 3px; font-size: 14px; overflow-wrap: anywhere; }
.inbox-head-label { color: var(--muted); margin-right: 6px; }
.inbox-actions { gap: 8px; flex-wrap: wrap; }
/* A levél HTML-je a saját (többnyire világos) színeivel jelenik meg. */
.inbox-frame { width: 100%; height: 70vh; min-height: 360px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.inbox-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; }
.inbox-files h2, .inbox-replies h2, .inbox-reply h2 { font-size: 16px; margin-bottom: 8px; }
.inbox-files ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.inbox-files a { display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.inbox-files .is-missing { color: var(--muted); text-decoration: line-through; }
.inbox-reply { display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 640px) {
  .report-card { grid-template-columns: 1fr; }
  .report-preview { width: 100%; aspect-ratio: 16 / 9; }
  .inbox-item { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .inbox-main { grid-column: 1 / -1; grid-row: 2; }
}

/* Admin: látogatók forrása (/admin/traffic) */
.stats-page { display: flex; flex-direction: column; gap: 14px; }
.stats-page h2 { font-size: 16px; margin-bottom: 10px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.stats-table th, .stats-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: right; }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; overflow-wrap: anywhere; }
.stats-table th { color: var(--muted); font-weight: 600; }
.stats-table tr:last-child td { border-bottom: 0; }
.stats-bars { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.stats-bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 56px; align-items: center; gap: 10px; }
.stats-bar-day { color: var(--muted); }
.stats-bar-track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.stats-bar { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.stats-bar-n { text-align: right; font-variant-numeric: tabular-nums; }

/* AI állapot: sáv a feltöltés oldalakon, és az admin /admin/ai oldal */
.ai-status { --ai: var(--muted); display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
.ai-status[hidden] { display: none; }
.ai-status-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ai-status-body b { color: var(--ai); }
.ai-status-meta { color: var(--muted); font-size: 13px; }
.ai-dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: var(--ai); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ai) 22%, transparent); }
:is(.ai-status, .ai-head).is-ok { --ai: var(--ok); }
:is(.ai-status, .ai-head):is(.is-paused, .is-starting) { --ai: var(--accent); }
:is(.ai-status, .ai-head).is-offline { --ai: var(--danger); }
.ai-status.is-paused, .ai-status.is-starting { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.ai-status.is-offline { border-color: rgba(255, 90, 90, .35); }
.ai-head { display: flex; flex-direction: column; gap: 14px; }
.ai-head h2 { color: var(--ai); font-size: 18px; margin-bottom: 4px; }
.ai-status-row { display: flex; gap: 14px; align-items: flex-start; }
.ai-status-row .ai-dot { margin-top: 6px; }
.ai-controls { display: flex; flex-direction: column; gap: 10px; }
.ai-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; font-size: 14.5px; }
.ai-kv dt { color: var(--muted); }
.ai-kv dd { margin: 0; overflow-wrap: anywhere; }
.ai-history { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.ai-history li { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 10px; align-items: center; }
.ai-history time { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .ai-kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ai-kv dd { margin-bottom: 8px; }
  .ai-history li { grid-template-columns: minmax(0, 1fr) max-content; }
  .ai-history li > span:last-child { grid-column: 1 / -1; }
}

/* ============ jelvények, szint, ranglista ============ */
/* Ritkaság színei: --r a fő szín, --r2 a mélyebb árnyalat (keret, ragyogás, átmenet) */
[data-rarity] { --r: #a3abba; --r2: #6b7280; }
[data-rarity="rare"] { --r: #4ea1ff; --r2: #2563eb; }
[data-rarity="epic"] { --r: #b57cff; --r2: #7c3aed; }
[data-rarity="legendary"] { --r: #ffb627; --r2: #ff7a1a; }
[data-rarity="mythic"] { --r: #ff4d6d; --r2: #c026d3; }
[data-rarity="limited"] { --r: #2ee6c5; --r2: #3b82f6; }

.level-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; margin-left: 10px; vertical-align: middle;
  border-radius: 999px; font-size: 12.5px; font-weight: 800; letter-spacing: .01em; white-space: nowrap;
  color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.level-box { display: flex; align-items: center; gap: 10px; min-width: 0; }
.level-box .level-chip { margin-left: 0; }
.level-bar { width: 140px; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; flex: none; }
.level-bar-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.level-xp { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.badges-panel { margin-bottom: 20px; }
.badges-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.badges-head h2 { font-size: 18px; display: flex; align-items: baseline; gap: 8px; }
.badges-head .spacer { flex: 1; }
.badges-count { color: var(--muted); font-size: 14px; font-weight: 600; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.badge-empty { grid-column: 1 / -1; color: var(--muted); padding: 6px 0; }
/* Összecsukva nagyjából egy sor (a szélességtől függően 8 / 6 / 4 kártya) */
.badge-grid.is-collapsed > .badge-card:nth-child(n + 9) { display: none; }
@media (max-width: 1000px) { .badge-grid.is-collapsed > .badge-card:nth-child(n + 7) { display: none; } }
@media (max-width: 520px) { .badge-grid.is-collapsed > .badge-card:nth-child(n + 5) { display: none; } }

/* A kártya: elöl ritkaság, sorszám, ikon, név; kattintásra megfordul */
.badge-card {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-align: center; cursor: pointer; perspective: 900px;
  animation: badge-in .45s cubic-bezier(.2, .9, .3, 1.2) both;
}
.badge-card:focus-visible { outline: 2px solid var(--r); outline-offset: 3px; border-radius: 14px; }
.badge-inner { position: absolute; inset: 0; transition: transform .55s cubic-bezier(.3, .7, .2, 1), translate .2s; transform-style: preserve-3d; }
.badge-card.is-flipped .badge-inner { transform: rotateY(180deg); }
.badge-card:hover .badge-inner { translate: 0 -3px; }
.badge-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 10px 12px; border-radius: 14px; overflow: hidden; backface-visibility: hidden;
  border: 1px solid color-mix(in srgb, var(--r) 55%, transparent);
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--r) 28%, transparent), transparent 70%),
    linear-gradient(170deg, color-mix(in srgb, var(--r2) 30%, var(--surface)) 0%, var(--surface) 65%);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--r) 18%, transparent), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.badge-back { transform: rotateY(180deg); justify-content: center; gap: 10px; padding: 14px 12px; }
.badge-head { align-self: stretch; display: flex; justify-content: space-between; align-items: center; }
.badge-rarity { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--r); }
.badge-no { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.badge-emblem {
  flex: 1; display: grid; place-items: center; width: 64px; max-height: 64px; aspect-ratio: 1; margin: 2px 0;
  border-radius: 50%; color: var(--r);
  background: radial-gradient(circle, color-mix(in srgb, var(--r) 30%, transparent), color-mix(in srgb, var(--r) 8%, transparent) 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--r) 45%, transparent), 0 0 24px color-mix(in srgb, var(--r) 35%, transparent);
}
.badge-q { font-size: 30px; font-weight: 900; }
.badge-name { font-weight: 800; font-size: 13.5px; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; }
.badge-foot { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.badge-bar { flex: 1 0 100%; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.badge-bar-fill { display: block; height: 100%; background: var(--r); }
.badge-desc { font-weight: 700; font-size: 14px; line-height: 1.3; }
.badge-meta { font-size: 12px; color: var(--muted); line-height: 1.3; }

/* Még meg nem szerzett: szürke, halvány (a hátoldal olvasható marad) */
.badge-card.is-locked .badge-front { filter: grayscale(.85) brightness(.7); box-shadow: none; }

/* Legendás: átsuhanó fény; limitált: holografikus csillogás; mitikus: forgó szivárványos keret */
.badge-card:not(.is-locked)[data-rarity="legendary"] .badge-front::after,
.badge-card:not(.is-locked)[data-rarity="limited"] .badge-front::after {
  content: ""; position: absolute; inset: -40%; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .22) 50%, transparent 60%);
  animation: badge-shine 4.5s ease-in-out infinite;
}
.badge-card:not(.is-locked)[data-rarity="limited"] .badge-front::after {
  background: linear-gradient(115deg, transparent 30%, rgba(46, 230, 197, .25) 42%, rgba(255, 120, 220, .22) 50%, rgba(255, 220, 90, .2) 58%, transparent 70%);
  animation-duration: 3.5s;
}
.badge-card:not(.is-locked)[data-rarity="mythic"] .badge-front { border-color: transparent; }
.badge-card:not(.is-locked)[data-rarity="mythic"] .badge-front::before {
  content: ""; position: absolute; inset: 0; padding: 2px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--spin, 0deg), #ff4d6d, #ffb627, #2ee6c5, #4ea1ff, #c026d3, #ff4d6d);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: badge-spin 4s linear infinite;
}
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes badge-spin { to { --spin: 360deg; } }
@keyframes badge-shine { 0%, 55% { translate: -60% 0; } 100% { translate: 60% 0; } }
@keyframes badge-in { from { opacity: 0; transform: scale(.85) translateY(8px); } }

/* Új jelvény ablak */
.badge-modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; text-align: center; }
.badge-modal h2 { font-size: 24px; }
.badge-modal .modal-actions { justify-content: center; }
.badge-reveal { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 150px)); justify-content: center; gap: 12px; margin: 14px 0 12px; }
.badge-reveal.is-single { grid-template-columns: 170px; }
.badge-reveal .badge-card { animation-duration: .6s; }
.badge-more { font-weight: 800; color: var(--accent); }

/* Ranglista */
.lb-title { display: flex; align-items: center; gap: 10px; }
.lb-title .icon { color: var(--accent); }
.lb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .lb-layout { grid-template-columns: minmax(0, 1fr); } }
.lb-me { color: var(--text-2); font-weight: 700; margin-bottom: 10px; }
.lb-me:empty { display: none; }
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.lb-row:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface-2); }
.lb-rank { width: 34px; flex: none; text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-row.is-top .lb-rank { display: grid; place-items: center; width: 30px; height: 30px; margin: 0 2px; border-radius: 50%; color: #1b1204; }
.lb-row.is-top1 { border-color: rgba(255, 196, 0, .45); }
.lb-row.is-top1 .lb-rank { background: linear-gradient(135deg, #ffe066, #f5b700); }
.lb-row.is-top2 .lb-rank { background: linear-gradient(135deg, #f1f3f6, #a9b1bd); }
.lb-row.is-top3 .lb-rank { background: linear-gradient(135deg, #f0b27a, #b8682e); }
.lb-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lb-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-who > span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.lb-who .level-chip { margin-left: 0; height: 20px; font-size: 11.5px; }
.lb-badges { display: flex; gap: 5px; }
.lb-badge {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--r);
  background: color-mix(in srgb, var(--r) 16%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--r) 45%, transparent);
}
.lb-score { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) {
  .lb-badges { display: none; }
  .lb-row { padding: 10px; gap: 10px; }
  .level-bar { width: 90px; }
}
.lb-rules h2 { font-size: 16px; margin-bottom: 10px; }
.lb-rules h3 { font-size: 14px; margin: 14px 0 8px; color: var(--text-2); }
.lb-rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.lb-rules li { display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); }
.lb-rules li b { color: var(--text); white-space: nowrap; }
.rarity-chip { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--r); }

/* A szerver által a <main>-be írt, keresőknek szóló tartalom (server.js, snapshotFor). A JavaScript nélküli látogató ezt
   látja, ezért az oldal saját kinézetét követi; a router induláskor lecseréli. */
.ssr { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; border-radius: 20px;
  background: radial-gradient(600px 180px at 0% 0%, rgba(255, 182, 39, .14), transparent 70%), var(--surface);
  border: 1px solid var(--border); }
.ssr h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.ssr h2 { font-size: 16px; font-weight: 800; margin-top: 6px; color: var(--text-2); }
.ssr p { color: var(--text-2); max-width: 720px; }
.ssr a { color: var(--text); text-decoration: none; }
.ssr a:hover { color: var(--accent); }
.ssr-media { display: block; max-width: min(100%, 720px); max-height: 70vh; width: auto; height: auto; border-radius: var(--radius); background: var(--bg-elev); }
.ssr-list, .ssr-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ssr-list a { display: block; padding: 7px 12px; border-radius: var(--radius-sm); background: var(--bg-elev);
  border: 1px solid var(--border); font-size: 14px; }
.ssr-tags a { display: block; padding: 5px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13.5px; font-weight: 600; }
/* JavaScripttel az SPA rajzolja ki az oldalt, ezért a pillanatkép addig rejtve marad: különben betöltéskor egy
   pillanatra felvillant, majd hirtelen kicserélődött (2026. nov.). Ha az SPA 4 mp alatt sem indul el (hiba, nagyon
   lassú hálózat), a pillanatkép mégis megjelenik. Ez nem mozgás, ezért a csökkentett mozgás beállítása (fent, minden
   animációt kikapcsol) sem tilthatja le: az !important és a nagyobb specifikusság miatt ez nyer. A JavaScript nélküli
   böngészőben a (scripting: enabled) nem teljesül, ott azonnal látszik. */
@keyframes ssr-hold { from, to { visibility: hidden; } }
@media (scripting: enabled) {
  .ssr { animation: ssr-hold 4s step-end !important; }
}
