:root {
  --bg: #0f0f14;
  --card: #1b1b24;
  --like: #22c55e;
  --nope: #ef4444;
  --accent: #fd267d;
  --text: #f5f5f7;
  --muted: #9ca3af;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at top, #23232f 0%, var(--bg) 60%);
  color: var(--text);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-left)) 12px
    max(16px, env(safe-area-inset-right));
  flex: 0 0 auto;
}
.logo { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; flex: 0 0 auto; }
.topbar-actions { display: flex; gap: 8px; align-items: center; min-width: 0; }
#authBtn {
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-btn {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}
.ghost-btn:hover { background: rgba(255,255,255,0.16); }

.stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px max(10px, env(safe-area-inset-left)) 8px max(10px, env(safe-area-inset-right));
}

.deck {
  position: relative;
  width: min(92vw, 400px);
  height: 100%;
  max-height: 560px;
}

.card {
  position: absolute;
  inset: 0;
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  cursor: grab;
  will-change: transform;
  user-select: none;
  touch-action: none;
}
.card:active { cursor: grabbing; }

.card img, .card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

.card-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 40px 18px 18px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  font-size: 18px;
  font-weight: 600;
}

.badge {
  position: absolute;
  top: 26px;
  font-size: 32px;
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 12px;
  border: 4px solid;
  opacity: 0;
  transition: opacity 0.1s;
}
.badge.like { left: 22px; color: var(--like); border-color: var(--like); transform: rotate(-18deg); }
.badge.nope { right: 22px; color: var(--nope); border-color: var(--nope); transform: rotate(18deg); }

.controls {
  flex: 0 0 auto;
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  padding: 14px 0 calc(18px + env(safe-area-inset-bottom));
}
.action-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  font-size: 28px;
  cursor: pointer;
  background: var(--card);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  transition: transform 0.12s;
}
.action-btn:active { transform: scale(0.9); }
.action-btn.nope { color: var(--nope); }
.action-btn.like { color: var(--accent); }
.action-btn.info { width: 52px; height: 52px; font-size: 20px; align-self: center; }

.empty, .loading {
  position: absolute;
  text-align: center;
  color: var(--muted);
}
.empty h2 { color: var(--text); margin: 8px 0; }
.empty-emoji { font-size: 56px; }
.empty p { margin-bottom: 18px; }

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.hidden { display: none !important; }

/* Kedveltek panel */
.panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 0 max(16px, env(safe-area-inset-left))
    calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
  overscroll-behavior: contain;
}
.panel-head {
  position: sticky;
  top: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 0 14px;
  margin-bottom: 4px;
  z-index: 2;
}
.likes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.likes-grid .tile {
  aspect-ratio: 3/4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}
.likes-grid .tile img, .likes-grid .tile video {
  width: 100%; height: 100%; object-fit: cover;
}
.likes-empty { color: var(--muted); text-align: center; margin-top: 40px; }

/* ===== Részlet panel ===== */
.detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}
.detail-media {
  width: 100%;
  max-height: 46vh;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  display: flex;
  justify-content: center;
}
.detail-media img, .detail-media video {
  max-width: 100%;
  max-height: 46vh;
  object-fit: contain;
}
.detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.detail-link {
  background: rgba(253,38,125,0.15);
  color: var(--accent);
  border-radius: 999px;
  padding: 9px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

/* ===== Kommentek ===== */
.comments-title { font-size: 16px; margin: 18px 0 12px; }
.comments-list { display: flex; flex-direction: column; gap: 10px; }
.comment {
  background: var(--card);
  border-radius: 12px;
  padding: 10px 12px;
}
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-author { font-weight: 700; font-size: 14px; }
.comment-date { color: var(--muted); font-size: 12px; }
.comment-del {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.comment-body { font-size: 15px; word-break: break-word; }
.comment-hint { color: var(--muted); font-size: 14px; }

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.comment-form input {
  flex: 1;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 15px;
}
.linklike {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

/* ===== Auth modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--card);
  border-radius: 18px;
  padding: 26px 24px;
  width: 100%;
  max-width: 380px;
  max-height: 90dvh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: var(--muted);
  font-size: 18px; cursor: pointer;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active { background: var(--accent); color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
}
.auth-error { color: var(--nope); font-size: 14px; text-align: center; }
.auth-note { color: var(--muted); font-size: 12px; text-align: center; margin-top: 16px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

/* ===== Mobil finomhangolás ===== */
@media (max-width: 480px) {
  .logo { font-size: 20px; }
  .action-btn { width: 60px; height: 60px; font-size: 26px; }
  .action-btn.info { width: 48px; height: 48px; font-size: 18px; }
  .controls { gap: 20px; }
  .card-caption { font-size: 16px; padding: 34px 16px 16px; }
  .detail-media, .detail-media img, .detail-media video { max-height: 40vh; }
}

/* Alacsony magasságú kijelzők (pl. fekvő mód, kis telefon) */
@media (max-height: 620px) {
  .action-btn { width: 52px; height: 52px; font-size: 22px; }
  .action-btn.info { width: 44px; height: 44px; font-size: 16px; }
  .controls { padding: 10px 0 calc(12px + env(safe-area-inset-bottom)); gap: 18px; }
  .badge { font-size: 26px; top: 18px; }
}

/* Egérrel ne legyen "ragadós" hover a gombokon érintőn */
@media (hover: none) {
  .ghost-btn:hover { background: rgba(255,255,255,0.08); }
}

/* ===== Google belépés ===== */
.google-wrap { margin-top: 16px; }
.google-btn { display: flex; justify-content: center; }
.auth-sep {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 14px;
}
.auth-sep::before, .auth-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.12);
}
.auth-sep span { padding: 0 12px; }

/* ===== Címke-szűrő sáv ===== */
.filter-bar {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px max(16px, env(safe-area-inset-left)) 8px max(16px, env(safe-area-inset-right));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.chip.active { background: var(--accent); color: #fff; }
.chip.small { padding: 5px 11px; font-size: 13px; }

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
