
:root {
  --bg: #08090d;
  --bg-elevated: #0e1018;
  --surface: #141824;
  --surface-2: #1c2233;
  --surface-3: #252c40;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text: #f2f4f8;
  --text-muted: #8b93a7;
  --primary: #6c8cff;
  --primary-hover: #5a7af0;
  --primary-soft: rgba(108, 140, 255, 0.14);
  --accent: #c084fc;
  --success: #34d399;
  --danger: #fb7185;
  --danger-hover: #f43f5e;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 12px 40px rgba(0,0,0,0.45);
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.25);
  --glow: 0 0 40px rgba(108, 140, 255, 0.15);
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(108, 140, 255, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(192, 132, 252, 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 0% 80%, rgba(52, 211, 153, 0.04), transparent);
  background-attachment: fixed;
}
.app { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 9, 13, 0.92);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  max-width: 100%;
  box-sizing: border-box;
}
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.logo-icon {
  font-size: 1.35rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-soft), rgba(192,132,252,0.2));
  border-radius: 10px;
  border: 1px solid var(--border);
}
.user-area {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
}

/* Instagram-style bottom nav */
/* ===== Instagram-style bottom menu ===== */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  height: auto;
  background: #000;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-scroll {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 640px;
  margin: 0 auto;
  min-height: 52px;
}
.bottom-nav-scroll::-webkit-scrollbar { display: none; }

.nav-btn {
  flex: 1 0 auto;
  min-width: 56px;
  max-width: 80px;
  height: 52px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  color: #a8a8a8;
  padding: 6px 4px 8px !important;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none !important;
  box-sizing: border-box;
}
a.nav-btn:visited { color: #a8a8a8; }
a.nav-btn.active:visited { color: #fff !important; }
.nav-btn[style*="display: none"] {
  display: none !important;
}
.nav-btn .nav-ico {
  font-size: 1.45rem;
  line-height: 1;
  display: block;
  filter: grayscale(0.2);
}
.nav-btn .nav-label {
  white-space: nowrap;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.6rem;
  letter-spacing: 0.01em;
}
.nav-btn:hover {
  color: #f5f5f5;
  background: transparent !important;
}
.nav-btn.active {
  color: #fff !important;
  background: transparent !important;
}
.nav-btn.active .nav-ico {
  transform: scale(1.06);
  filter: none;
}
/* jemný bod pod aktívnou ikonou */
.nav-btn.active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
}

/* priestor pre spodné menu */
.main {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}
.app { padding-bottom: 0; }

.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 0;
  max-width: min(200px, 42vw);
}
.user-badge > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.user-badge .role { background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.user-badge .role.admin { background: #5b2c6f; color: #e8daef; }
.user-badge .role.organizer { background: #1a5276; color: #d4e6f1; }
.section { display: none; }
.section.active { display: block; }
.section-desc { color: var(--text-muted); margin-bottom: 20px; font-size: 0.95rem; }
.hero { text-align: center; margin-bottom: 36px; }
.hero {
  text-align: center;
  margin-bottom: 28px;
  padding: 12px 0 8px;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #93b4ff 0%, #c4b5fd 50%, #f0abfc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle { color: var(--text-muted); font-size: 1.02rem; max-width: 560px; margin: 0 auto; }
.search-panel { background: var(--surface); border-radius: var(--radius); padding: 26px; border: 1px solid var(--border); margin-bottom: 36px; }
.face-input-area { margin-bottom: 24px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab { background: var(--surface-2); border: none; color: var(--text-muted); padding: 9px 16px; border-radius: 8px; cursor: pointer; font-weight: 500; transition: all 0.2s; }
.tab.active { background: var(--primary); color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.camera-container { position: relative; width: 100%; max-width: 460px; margin: 0 auto 14px; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4/3; }
#video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.face-guide { width: 58%; height: 72%; max-width: 150px; max-height: 180px; border: 2px dashed rgba(255,255,255,0.45); border-radius: 50%; }
.camera-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 36px 18px; text-align: center; cursor: pointer; transition: all 0.2s; background: var(--surface-2); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: rgba(91,141,239,0.08); }
.upload-zone.large { padding: 46px 18px; }
.upload-icon { font-size: 2.3rem; margin-bottom: 10px; }
.upload-zone p { color: var(--text-muted); font-size: 0.92rem; }
.face-preview { margin-top: 20px; text-align: center; }
.face-preview h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 10px; }
#face-preview-img { width: 88px; height: 88px; object-fit: cover; border-radius: 50%; border: 3px solid var(--primary); box-shadow: var(--shadow); }
.face-preview.hidden, .face-refs-panel.hidden { display: none; }
.face-refs-panel {
  margin-top: 16px; padding: 14px; border-radius: 14px;
  background: var(--bg-card, #1a1d27); border: 1px solid var(--border, #2e3345);
  text-align: center;
}
.face-refs-title { margin: 0 0 10px; font-size: 0.9rem; color: var(--text-muted, #9aa0b0); font-weight: 600; }
.face-refs-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
}
.face-ref-main { position: relative; }
.face-ref-add {
  width: 64px; height: 64px; border-radius: 12px; border: 2px dashed var(--border, #3a4055);
  background: transparent; color: var(--text-muted, #9aa0b0); font-size: 1.6rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.face-ref-add:hover { border-color: var(--primary, #5b8def); color: var(--primary, #5b8def); }
.face-detect-status { margin: 10px 0 0; font-size: 0.88rem; color: #34c759; }
.face-refs-actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px;
}
.face-refs-hint { text-align: center; margin: 8px 0 0; font-size: 0.8rem; }
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, #6c8cff 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(108, 140, 255, 0.35);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(108, 140, 255, 0.45);
  filter: brightness(1.05);
}
.btn-success { background: var(--success); color: #042f1a; }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: rgba(255,255,255,0.2);
}
.btn-danger {
  background: rgba(251, 113, 133, 0.15);
  color: #fda4af;
  border: 1px solid rgba(251, 113, 133, 0.35);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(251, 113, 133, 0.28);
}
.btn-small { padding: 6px 12px; font-size: 0.82rem; min-height: 34px; }
.btn-large { padding: 14px 28px; font-size: 1.02rem; }
.btn-block { width: 100%; padding: 12px; }
.search-actions { text-align: center; }
.hint { margin-top: 10px; color: var(--text-muted); font-size: 0.82rem; }
.results { margin-top: 18px; }
.results h2 { margin-bottom: 18px; font-size: 1.3rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.photo-card { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); aspect-ratio: 1; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-card .badge { position: absolute; bottom: 7px; left: 7px; background: rgba(0,0,0,0.72); color: white; font-size: 0.72rem; padding: 3px 7px; border-radius: 5px; max-width: calc(100% - 14px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-card .match-score { position: absolute; top: 7px; right: 7px; background: var(--success); color: white; font-size: 0.68rem; font-weight: 600; padding: 2px 6px; border-radius: 5px; }
.photo-card .btn-delete-photo { position: absolute; top: 7px; left: 7px; background: rgba(255,69,58,0.9); color: white; border: none; width: 28px; height: 28px; border-radius: 6px; font-size: 0.9rem; cursor: pointer; opacity: 0; transition: opacity 0.2s; display: flex; align-items: center; justify-content: center; z-index: 2; }
.photo-card:hover .btn-delete-photo { opacity: 1; }
.no-results { text-align: center; color: var(--text-muted); padding: 36px; }
.loading { text-align: center; padding: 50px 20px; }
.loading.hidden { display: none; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.albums-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.album-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; text-decoration: none; color: inherit; display: block; }
a.album-card:visited { color: inherit; }
.album-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.album-cover { height: 130px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 2.8rem; overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-info { padding: 14px; }
.album-info h3 { font-size: 1rem; margin-bottom: 3px; }
.album-info p { color: var(--text-muted); font-size: 0.82rem; }
.album-owner { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.album-owner .profile-owner-link {
  color: var(--primary, #5b8def);
  cursor: pointer;
  text-decoration: underline;
}
.empty-state { color: var(--text-muted); text-align: center; padding: 36px; grid-column: 1 / -1; }
.album-detail.hidden { display: none; }
.album-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 18px; flex-wrap: wrap; }
.album-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; max-width: 580px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 7px; font-weight: 500; font-size: 0.92rem; }
.form-group input[type="text"], .form-group input[type="password"] { width: 100%; padding: 11px 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.98rem; font-family: inherit; }
.form-group input:focus { outline: none; border-color: var(--primary); }
.photos-preview { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.photos-preview img { width: 74px; height: 74px; object-fit: cover; border-radius: 7px; border: 1px solid var(--border); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.admin-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.admin-hint { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 14px; }
.admin-searches { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; }
.search-entry { display: flex; gap: 12px; align-items: center; background: var(--surface-2); padding: 10px; border-radius: 8px; border: 1px solid var(--border); }
.search-entry img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; border: 2px solid var(--primary); flex-shrink: 0; }
.search-entry-info { flex: 1; min-width: 0; }
.search-entry-info .time { font-size: 0.78rem; color: var(--text-muted); }
.search-entry-info .matches { font-size: 0.88rem; font-weight: 500; }
.admin-albums-list, .admin-users-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 0.9rem; }
.admin-row .meta { color: var(--text-muted); font-size: 0.8rem; }
.admin-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-box { background: var(--surface-2); border-radius: 8px; padding: 14px; text-align: center; border: 1px solid var(--border); }
.stat-box .num { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.stat-box .label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.82); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal.hidden { display: none; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; max-width: 420px; width: 100%; position: relative; box-shadow: var(--shadow); }
.modal-content.auth-modal { max-width: 400px; }
.modal-close { position: absolute; top: 12px; right: 14px; background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal > img { max-width: 95%; max-height: 90vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.auth-tab { flex: 1; background: var(--surface-2); border: none; color: var(--text-muted); padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.auth-tab.active { background: var(--primary); color: white; }
.auth-form.hidden { display: none; }
.auth-info { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.45; }
.auth-demo { margin-top: 14px; font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.auth-demo code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; }
.confirm-modal { text-align: center; max-width: 340px; }
.confirm-modal p { margin-bottom: 20px; font-size: 1.05rem; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.footer { margin-top: 50px; text-align: center; color: var(--text-muted); font-size: 0.82rem; padding-top: 20px; border-top: 1px solid var(--border); }
.hidden { display: none !important; }
@media (max-width: 640px) {
  .hero h1 { font-size: 1.55rem; }
  .header { flex-direction: row; align-items: center; }
  .camera-container { max-width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }
}


/* ===== Events ===== */
.filters-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 28px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-item { flex: 1 1 140px; min-width: 0; margin-bottom: 0; }
.filter-actions { flex: 0 0 auto; min-width: auto; }

.filters-panel select,
.filters-panel input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}

.filters-panel select:focus,
.filters-panel input:focus {
  outline: none;
  border-color: var(--primary);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.events-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
a.event-card:visited { color: inherit; }

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.event-cover {
  height: 150px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
  position: relative;
}

.event-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.event-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }

.event-body h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  line-height: 1.3;
}

.event-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.event-meta span { margin-right: 10px; }

.event-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 10px;
}

.event-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: auto;
}

.event-detail.hidden { display: none; }

.event-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 16px;
}

.event-detail-card h2 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.event-detail-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.event-detail-meta strong { color: var(--text); }

.event-detail-desc {
  margin-bottom: 20px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.event-detail-cover {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 0;
}

textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.98rem;
  font-family: inherit;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
}

select {
  width: 100%;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.98rem;
  font-family: inherit;
}

select:focus {
  outline: none;
  border-color: var(--primary);
}

.badge-photos {
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
}

.nav-btn { position: relative; }
.nav-badge {
  position: absolute;
  top: 0;
  right: 4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}
.notif-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}
.notif-item.unread {
  border-color: var(--primary);
  background: rgba(91, 141, 239, 0.08);
}
.notif-item .notif-title { font-weight: 600; font-size: 0.92rem; }
.notif-item .notif-msg { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.notif-item .notif-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }
.notif-item .notif-actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.notify-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
  width: 100%;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.contact-card h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.contact-card p {
  font-size: 1.02rem;
  word-break: break-word;
}
.contact-card a { color: var(--primary); text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }
.contact-social {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.contact-social a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}
.contact-social a:hover { border-color: var(--primary); color: var(--primary); }

/* Footer */
.footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  padding: 36px 0 20px;
  text-align: left;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  margin-bottom: 28px;
}
.footer-brand .logo { margin-bottom: 10px; }
.footer-brand p, .footer-contact p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 6px;
}
.footer-contact h4, .footer-links h4 {
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: var(--text);
}
.footer-contact a { color: var(--primary); text-decoration: none; }
.footer-social { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.footer-social a { color: var(--text-muted); font-size: 0.88rem; text-decoration: none; }
.footer-social a:hover { color: var(--primary); }
.footer-link {
  display: block;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 4px 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
}
a.footer-link:visited { color: var(--text-muted); }
.footer-link:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  text-align: center;
}
.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Venues */
.venues-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.venue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.venue-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.venue-cover {
  height: 140px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
  position: relative;
}
.venue-cover img { width: 100%; height: 100%; object-fit: cover; }
.venue-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.venue-body h3 { font-size: 1.05rem; margin-bottom: 6px; }
.stars {
  color: #ffb020;
  letter-spacing: 1px;
  font-size: 0.95rem;
}
.stars .empty { color: #4a4f63; }
.stars-input {
  display: flex;
  gap: 4px;
  font-size: 1.6rem;
  cursor: pointer;
  user-select: none;
}
.stars-input span { color: #4a4f63; transition: color 0.15s; }
.stars-input span.on { color: #ffb020; }
.review-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.review-item .rev-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.review-form {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 20px;
}

.venues-map-wrap { margin-bottom: 24px; }
.venues-map {
  height: 360px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  z-index: 1;
}
.venue-detail-map {
  height: 260px;
  width: 100%;
  border-radius: 10px;
  margin: 16px 0;
  border: 1px solid var(--border);
  z-index: 1;
}
.venue-form-map {
  height: 220px;
  width: 100%;
  border-radius: 8px;
  margin-top: 10px;
  border: 1px solid var(--border);
  z-index: 1;
}

/* Reels – Instagram style */
.reels-feed {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 40px;
}
.reel-card {
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.reel-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
}
.reel-card-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.reel-card-header .meta { flex: 1; min-width: 0; }
.reel-card-header .meta strong {
  display: block;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reel-card-header .meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.reel-media {
  position: relative;
  background: #111;
  aspect-ratio: 9 / 16;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.reel-media .reel-fallback {
  text-align: center;
  padding: 24px;
  color: #eee;
}
.reel-media .reel-fallback .platform-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.12);
  font-size: 0.8rem;
  margin-bottom: 12px;
}
.reel-media .reel-fallback a {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 20px;
  background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af);
  color: #fff;
  text-decoration: none;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.9rem;
}
.reel-card-footer {
  padding: 12px 14px 16px;
  background: var(--surface);
}
.reel-card-footer p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.reel-card-footer .btn { margin-top: 8px; }
.ev-reels-list { margin-bottom: 8px; }
.ev-reel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.ev-reel-row a { color: var(--primary); word-break: break-all; flex: 1; }
.event-reels-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.event-reels-inline a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
}
.event-reels-inline a:hover { border-color: var(--primary); color: var(--primary); }

/* Instagram-style full vertical reels */
#section-reels .hero { padding-bottom: 12px; }
.reels-feed {
  max-width: 480px;
  margin: 0 auto;
  height: calc(100vh - 160px);
  min-height: 520px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #000;
  -webkit-overflow-scrolling: touch;
}
.reels-feed .empty-state { color: #aaa; padding: 40px 20px; }
.reel-slide {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: 100%;
  min-height: 100%;
  position: relative;
  background: #000;
  display: flex;
  flex-direction: column;
}
.reel-slide-media {
  flex: 1;
  position: relative;
  min-height: 0;
  background: #0a0a0a;
}
.reel-slide-media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.reel-slide-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 48px 16px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: #fff;
  pointer-events: none;
  z-index: 2;
}
.reel-slide-overlay a,
.reel-slide-overlay button {
  pointer-events: auto;
}
.reel-slide-overlay .event-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.reel-slide-overlay .event-sub {
  font-size: 0.82rem;
  opacity: 0.85;
  margin-bottom: 10px;
}
.reel-slide-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.reel-slide-actions .btn {
  pointer-events: auto;
  font-size: 0.8rem;
  padding: 8px 12px;
}
.reel-progress {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 10px;
}
.reel-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}


/* ========== RESPONSIVE / ALL DEVICES ========== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe {
  max-width: 100%;
  height: auto;
}
input, select, textarea, button {
  font-size: 16px; /* iOS zoom prevent */
  max-width: 100%;
}
textarea { resize: vertical; }
.form-group input,
.form-group select,
.form-group textarea,
.filters-panel select,
.filters-panel input {
  width: 100%;
}
table { width: 100%; overflow-x: auto; display: block; }

/* Touch-friendly */
.btn, .nav-btn, .footer-link {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn {
  min-height: 44px;
  padding-left: 16px;
  padding-right: 16px;
}
.btn-small { min-height: 36px; }

/* Sticky header + safe area */
.header {
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
  padding-bottom: 0;
}
.main {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.hero h1 { font-size: clamp(1.45rem, 4vw, 2rem); word-wrap: break-word; }
.subtitle { font-size: clamp(0.9rem, 2.5vw, 1.02rem); }

.events-list,
.venues-list,
.albums-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.event-card,
.venue-card,
.album-card {
  max-width: 100%;
}

.event-detail-card,
.upload-form,
.modal-content {
  max-width: min(100%, 640px);
}

.venues-map,
.venue-detail-map,
.venue-form-map {
  height: min(360px, 50vh);
  width: 100%;
}

.reels-feed {
  height: calc(100dvh - 180px);
  min-height: 420px;
  max-width: min(100%, 420px);
}

/* Tablet */
@media (max-width: 900px) {
  .filters-row {
    flex-wrap: wrap;
  }
  .filter-item {
    min-width: calc(50% - 10px);
    flex: 1 1 calc(50% - 10px);
  }
  .form-row {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .form-row .form-group {
    min-width: calc(50% - 10px);
    flex: 1 1 calc(50% - 10px);
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .header {
    margin-bottom: 12px;
    padding: 10px 0;
  }
  .logo span:last-child { font-size: 1rem; }
  .user-badge {
    font-size: 0.8rem;
    max-width: 42vw;
    overflow: hidden;
  }
  .user-badge span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 28vw;
    display: inline-block;
  }
  .btn-small { font-size: 0.8rem; padding: 6px 10px; }

  .hero { margin-bottom: 18px; text-align: left; }
  .hero h1 { font-size: 1.4rem; }
  .subtitle { margin-left: 0; }

  .filters-panel { padding: 12px; }
  .filters-row { flex-direction: column; gap: 10px; }
  .filter-item {
    min-width: 100%;
    flex: 1 1 100%;
  }
  .filter-actions { width: 100%; }
  .filter-actions .btn { width: 100%; }

  .form-row { flex-direction: column; }
  .form-row .form-group {
    min-width: 100%;
    width: 100%;
  }

  .upload-form,
  .event-detail-card,
  .review-form {
    padding: 16px;
  }

  .events-list,
  .venues-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .event-detail-meta {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 12px;
    align-items: flex-end;
  }
  .modal-content {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    max-height: 92vh;
    overflow-y: auto;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .camera-container { max-width: 100%; }

  .nav-btn {
    min-width: 56px;
    padding: 8px 8px 6px;
  }
  .nav-btn .nav-ico { font-size: 1.4rem; }
  .nav-btn .nav-label { font-size: 0.62rem; max-width: 64px; }

  .venues-map,
  .venue-detail-map {
    height: 240px;
  }

  .reels-feed {
    height: calc(100dvh - 160px);
    min-height: 360px;
    border-radius: 12px;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .admin-row {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-row > span {
    width: 100%;
  }

  .notify-box input,
  .notify-box .btn {
    width: 100%;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .logo span:not(.logo-icon) {
    /* keep name visible but smaller */
    font-size: 0.92rem;
  }
  .nav-btn { min-width: 52px; }
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large desktop */
@media (min-width: 1200px) {
  .app { max-width: 1200px; }
  .events-list,
  .venues-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Landscape phone – bottom nav still usable */
@media (max-height: 480px) and (orientation: landscape) {
  .reels-feed {
    height: calc(100dvh - 100px);
    min-height: 240px;
  }
  .bottom-nav { padding-top: 2px; padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px)); }
  .nav-btn .nav-label { display: none; }
  .nav-btn { min-width: 48px; padding: 6px; }
  .main { padding-bottom: 64px; }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Upload progress */
.upload-progress-wrap {
  margin-top: 16px;
}
.upload-progress-wrap.hidden { display: none; }
.upload-progress-bar {
  height: 10px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #7aa8ff);
  border-radius: 6px;
  transition: width 0.15s ease;
}
.upload-progress-text {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.photos-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.photos-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}


/* ========== MODERN DESIGN POLISH ========== */
.subtitle {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

.filters-panel,
.upload-form,
.event-detail-card,
.admin-card,
.contact-card,
.review-form,
.notify-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.filters-panel {
  padding: 18px;
  margin-bottom: 22px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elevated) 100%);
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea,
.filters-panel select,
.filters-panel input[type="text"],
.filters-panel input[type="email"],
.filters-panel input[type="url"],
.filters-panel input[type="password"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="datetime-local"],
select,
textarea {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
  padding: 11px 14px !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.filters-panel select:focus,
.filters-panel input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-soft) !important;
}

.event-card,
.venue-card,
.album-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  box-shadow: var(--shadow-sm);
}

.event-card:hover,
.venue-card:hover,
.album-card:hover {
  transform: translateY(-4px);
  border-color: rgba(108, 140, 255, 0.35);
  box-shadow: var(--shadow), var(--glow);
}

.event-cover,
.venue-cover,
.album-cover {
  background: linear-gradient(145deg, var(--surface-2), var(--surface-3));
}

.event-cat {
  background: rgba(0,0,0,0.55) !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-pill) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.event-body h3,
.venue-body h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.event-detail-card {
  padding: 24px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elevated) 100%);
}

.event-detail-card h2 {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.5rem;
}

.upload-zone {
  border: 1.5px dashed var(--border-strong) !important;
  border-radius: var(--radius) !important;
  background: var(--bg-elevated) !important;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  box-shadow: var(--glow);
}

.modal {
  background: rgba(4, 6, 12, 0.72) !important;
  backdrop-filter: blur(8px);
}

.modal-content {
  background: var(--surface) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 20px !important;
  box-shadow: var(--shadow), var(--glow) !important;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding: 36px 0 28px;
}

.footer-inner {
  gap: 32px;
}

.stars {
  color: #fbbf24;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.35));
}

.admin-card {
  padding: 20px;
  background: linear-gradient(160deg, var(--surface), var(--bg-elevated));
}

.admin-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.stat-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.stat-box .num {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.contact-card {
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}

.contact-card:hover {
  border-color: rgba(108, 140, 255, 0.3);
  transform: translateY(-2px);
}

.contact-social a {
  background: var(--surface) !important;
  border-radius: var(--radius-pill) !important;
  transition: transform 0.15s, border-color 0.15s;
}

.contact-social a:hover {
  transform: translateY(-2px);
  border-color: var(--primary) !important;
}

.user-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 4px 4px 12px;
  border-radius: var(--radius-pill);
}

.user-badge .role {
  border-radius: var(--radius-pill) !important;
  padding: 3px 10px !important;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 36px 16px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 18px;
}

.photo-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.reel-slide {
  border-radius: 0;
}

.reels-feed {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Smooth selection */
::selection {
  background: var(--primary-soft);
  color: var(--text);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* ========== NO HORIZONTAL SCROLL + FULL RESPONSIVE ========== */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  position: relative;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overscroll-behavior-x: none;
}
.app, .main, .section, .header, .footer {
  max-width: 100%;
  overflow-x: clip;
}
.app {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

/* Všetky široké prvky drž v šírke displeja */
img, video, iframe, canvas, svg {
  max-width: 100% !important;
  height: auto;
}
table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* Filtre a formuláre – zalamovanie */
.filters-row,
.form-row,
.filters-panel,
.upload-form,
.event-detail-card,
.admin-grid,
.footer-inner,
.contact-grid {
  max-width: 100%;
  box-sizing: border-box;
}
.filters-row,
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.filter-item,
.form-row .form-group {
  flex: 1 1 100%;
  min-width: 0 !important;
  max-width: 100%;
}
@media (min-width: 641px) {
  .filter-item,
  .form-row .form-group {
    flex: 1 1 calc(50% - 12px);
  }
}
@media (min-width: 900px) {
  .filter-item {
    flex: 1 1 140px;
  }
}

input, select, textarea, button, .btn {
  max-width: 100%;
  box-sizing: border-box;
}

/* Karty v gridoch */
.events-list,
.venues-list,
.albums-grid,
.photo-grid {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  box-sizing: border-box;
}
@media (min-width: 480px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 641px) {
  .events-list,
  .venues-list,
  .albums-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 960px) {
  .events-list,
  .venues-list,
  .albums-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.event-card,
.venue-card,
.album-card,
.event-detail-card,
.upload-form {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Bottom nav – len vnútri sa posúva, stránka nie */
.bottom-nav {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow: hidden;
}
.bottom-nav-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Mapy a reels */
.venues-map,
.venue-detail-map,
.venue-form-map,
.leaflet-container {
  width: 100% !important;
  max-width: 100% !important;
}
.reels-feed {
  width: 100%;
  max-width: min(100%, 420px);
  margin-left: auto;
  margin-right: auto;
}

/* Text a dlhé reťazce */
h1, h2, h3, p, .subtitle, .event-body, .venue-body {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Modal */
.modal {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}
.modal-content {
  max-width: min(100%, 420px);
  box-sizing: border-box;
}

/* Hover translate nesmie vytvárať scrollbar */
.event-card:hover,
.venue-card:hover,
.album-card:hover,
.photo-card:hover {
  transform: translateY(-2px);
}

/* User badge na úzkom displeji */
.header {
  max-width: 100%;
  box-sizing: border-box;
}
.user-area {
  max-width: 50%;
  min-width: 0;
}
.user-badge {
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 640px) {
  .hero { text-align: left; padding: 4px 0; }
  .hero h1 { font-size: 1.35rem; }
  .filters-panel { padding: 12px; }
  .upload-form,
  .event-detail-card { padding: 14px; }
  .filter-actions .btn,
  .btn-block { width: 100%; }
}


/* Face detect progress */
.face-detect-progress {
  margin: 16px 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.face-detect-progress.hidden { display: none; }
.face-detect-progress .upload-progress-bar { margin-bottom: 8px; }


.desc-search-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.desc-search-box label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.desc-search-box textarea {
  width: 100%;
  min-height: 88px;
  margin-bottom: 10px;
  resize: vertical;
}
.desc-search-box .btn { margin-top: 8px; }


/* ===== TikTok-style Reels (fullscreen) ===== */
#section-reels.section.active.section-reels-tiktok {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #000;
  margin: 0;
  padding: 0;
  max-width: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
/* skryť header keď sú reels aktívne – body class */
body.reels-mode .header,
body.reels-mode .footer,
body.reels-mode .app > .footer {
  visibility: hidden;
  pointer-events: none;
}
body.reels-mode .bottom-nav {
  z-index: 120;
  background: rgba(0,0,0,0.75);
}
body.reels-mode .app {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
body.reels-mode .main {
  padding-bottom: 0;
}

.reels-feed {
  position: absolute;
  inset: 0;
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  max-width: none !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  background: #000;
}
.reels-feed .empty-state {
  color: #aaa;
  padding: 40vh 24px;
  text-align: center;
}

.reel-slide {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #000;
  flex-shrink: 0;
}
.reel-slide-media {
  position: absolute;
  inset: 0;
  background: #000;
}
.reel-slide-media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.reel-slide-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 48px 16px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: #fff;
  pointer-events: none;
}
.reel-slide-overlay a,
.reel-slide-overlay button {
  pointer-events: auto;
}
.reel-slide-overlay .event-name {
  font-weight: 700;
  font-size: 1.05rem;
}
.reel-slide-overlay .event-sub {
  font-size: 0.8rem;
  opacity: 0.85;
  margin: 4px 0 10px;
}
.reel-slide-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.reels-ui-hint {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0.85;
}
body:not(.reels-mode) .reels-ui-hint { display: none; }


/* Collapsible filters */
.filters-collapsible {
  padding: 0;
  overflow: hidden;
}
.filters-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.filters-toggle:hover {
  background: rgba(255,255,255,0.03);
}
.filters-toggle-icon {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.filters-toggle.open .filters-toggle-icon {
  transform: rotate(180deg);
}
.filters-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  animation: filtersIn 0.2s ease;
}
.filters-body[hidden] {
  display: none !important;
}
@keyframes filtersIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}


.adm-contact-fields { display: flex; flex-direction: column; gap: 8px; }
.adm-contact-row {
  display: grid;
  grid-template-columns: 1fr 120px 1.2fr auto;
  gap: 8px;
  align-items: center;
}
@media (max-width: 700px) {
  .adm-contact-row { grid-template-columns: 1fr; }
}


.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
.lang-switch {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-btn.active {
  background: linear-gradient(135deg, #6c8cff, #8b5cf6);
  color: #fff;
}


a.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  max-width: min(220px, 48vw);
}
a.logo:hover {
  opacity: 0.9;
}
.logo-img {
  height: 36px;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
}
@media (max-width: 480px) {
  .logo-img { height: 28px; }
}


.inapp-browser-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(135deg, #5c3d00, #3d2a00);
  color: #ffd78a;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.9rem;
  text-align: center;
  border-bottom: 1px solid #8a6a20;
}
.inapp-browser-banner.hidden { display: none !important; }
.inapp-browser-banner p { margin: 0; flex: 1 1 200px; }


.extra-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
  align-items: center;
}
.extra-ref-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
}
.extra-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.extra-ref-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}


.search-scope {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.search-scope-title {
  margin: 0 0 12px;
  font-size: 1rem;
}
.search-no-album {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 183, 77, 0.08);
  border: 1px solid rgba(255, 183, 77, 0.35);
  color: var(--text);
}
.search-no-album.hidden { display: none !important; }
.search-notify-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.search-notify-row input {
  flex: 1;
  min-width: 180px;
}


/* ===== Lightbox galéria ===== */
.sv-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px 56px;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.sv-lightbox-stage {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sv-lightbox-img {
  max-width: min(96vw, 1200px);
  max-height: min(82vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  user-select: none;
  -webkit-user-drag: none;
}
.sv-lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.sv-lightbox-close:hover { background: rgba(255,255,255,0.28); }
.sv-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sv-lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.sv-lightbox-prev { left: 10px; }
.sv-lightbox-next { right: 10px; }
.sv-lightbox-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  background: rgba(0,0,0,0.45);
  padding: 6px 14px;
  border-radius: 20px;
}
@media (max-width: 600px) {
  .sv-lightbox { padding: 40px 8px 48px; }
  .sv-lightbox-nav { width: 40px; height: 40px; font-size: 28px; }
  .sv-lightbox-prev { left: 4px; }
  .sv-lightbox-next { right: 4px; }
  .sv-lightbox-img { max-height: 75vh; }
}


/* header responsive login */
@media (max-width: 640px) {
  .header {
    padding: 8px 0;
    gap: 6px;
  }
  a.logo {
    max-width: min(140px, 38vw);
  }
  .logo-img {
    height: 26px !important;
  }
  .header-right {
    gap: 6px;
  }
  .user-badge {
    max-width: min(120px, 36vw);
    font-size: 0.72rem;
  }
  .user-badge .role {
    display: none; /* šetrí miesto – meno stačí */
  }
  .user-area .btn-small {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .lang-switch {
    flex-shrink: 0;
  }
}
@media (max-width: 380px) {
  a.logo {
    max-width: 110px;
  }
  .logo-img {
    height: 22px !important;
  }
  .user-badge {
    max-width: 90px;
  }
}


#contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.contact-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-2, #1a1d27);
  border: 1px solid var(--border, #2e3345);
  color: #fff;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.contact-social-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.35);
}
.contact-social-facebook { color: #1877f2; }
.contact-social-instagram { color: #e1306c; }
.contact-social-tiktok { color: #fff; }
.contact-social-youtube { color: #ff0000; }
.contact-card-social {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.contact-social-wrap { margin: 0; }
.contact-social-label {
  font-size: 0.8rem;
  color: var(--text-muted, #9aa0b0);
}


.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.footer-social .contact-social-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
.footer-social a:not(.contact-social-btn) {
  /* starý textový odkaz – skryť ak by ostal */
}


.btn-load-more {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 16px auto 8px;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 10px;
  padding: 4px 0;
}
.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border, #2e3345);
  background: var(--bg-card, #1a1d27);
  color: var(--text, #e8eaf0);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
a.pagination-btn:hover:not(.active):not(.disabled) {
  border-color: var(--primary, #5b8def);
  color: #8eb6ff;
}
.pagination-btn.active {
  background: var(--primary, #5b8def);
  border-color: var(--primary, #5b8def);
  color: #fff;
}
.pagination-btn:disabled,
.pagination-btn.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.pagination-ellipsis {
  color: var(--text-muted, #9aa0b0);
  padding: 0 2px;
  user-select: none;
}
.pagination-info {
  margin-left: 6px;
  font-size: 0.8rem;
  color: var(--text-muted, #9aa0b0);
}
.album-card, .event-card, .photo-card {
  content-visibility: auto;
  contain-intrinsic-size: 200px 220px;
}
.photo-card img {
  content-visibility: auto;
}


.select-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.select-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, #2e3345);
  background: var(--surface-2, #12141c);
  color: var(--text, #eee);
  font-size: 0.9rem;
}
.select-search-input:focus {
  outline: none;
  border-color: var(--primary, #5b8def);
}
.select-search-wrap select {
  width: 100%;
}


/* Public photographer profile */
.public-profile { max-width: 900px; margin: 0 auto; }
.profile-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.profile-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  font-size: 2rem;
}
.profile-handle { color: var(--text-muted); margin: 4px 0; }
.profile-url-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.9rem; }
.profile-bio { margin-top: 10px; line-height: 1.45; }
.profile-fields {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.profile-field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.profile-field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.admin-field-row input[type="text"],
.admin-field-row select {
  flex: 1;
  min-width: 90px;
}
.profile-edit-card { max-width: 560px; }


.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.profile-avatar-preview {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface-2);
}
.avatar-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}


.terms-content {
  max-width: 720px;
  line-height: 1.55;
  color: var(--text);
}
.terms-body {
  white-space: normal;
  font-size: 0.95rem;
}


/* On-page toasts (no window.alert) */
.sv-toasts {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}
.sv-toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: #1c1f2a;
  border: 1px solid rgba(255,255,255,0.12);
  color: #f2f3f7;
  font-size: 0.92rem;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.sv-toast-show {
  opacity: 1;
  transform: translateY(0);
}
.sv-toast-success {
  border-color: rgba(52, 199, 89, 0.45);
  background: #13281a;
}
.sv-toast-error {
  border-color: rgba(255, 69, 58, 0.5);
  background: #2a1212;
}
.sv-toast-info {
  border-color: rgba(91, 141, 239, 0.45);
}

.sv-prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 12100;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sv-prompt-box {
  width: min(400px, 100%);
  background: var(--surface, #151821);
  border: 1px solid var(--border, #2e3345);
  border-radius: 14px;
  padding: 18px;
}
.sv-prompt-title {
  margin: 0 0 12px;
  font-weight: 600;
}
.sv-prompt-input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2, #0f1118);
  color: var(--text);
}
.sv-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}


.photo-card {
  position: relative;
}
.btn-photo-download {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  backdrop-filter: blur(4px);
}
.btn-photo-download:hover {
  background: rgba(91, 141, 239, 0.9);
}
.btn-delete-photo {
  z-index: 4;
}
.sv-lightbox-download {
  position: absolute;
  top: 12px;
  right: 64px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
}
.sv-lightbox-download:hover {
  background: rgba(255,255,255,0.28);
}


.upload-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 10px 0 8px;
  flex-wrap: wrap;
}
.photos-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 8px;
}
.pending-photo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface, #151821);
  border: 1px solid var(--border, #2e3345);
  position: relative;
}
.pending-photo img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.pending-photo-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pending-photo-name {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pending-photo-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.btn-remove-pending {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.btn-remove-pending:hover { background: rgba(255,69,58,0.4); }
.pending-photo-status {
  font-size: 0.85rem;
  min-width: 1.2em;
  text-align: center;
}
.pending-photo-status.ok { color: #34c759; }
.pending-photo-status.err { color: #ff453a; }
.upload-file-status {
  max-height: 140px;
  overflow-y: auto;
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.upload-progress-wrap {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.upload-progress-bar {
  height: 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5b8def, #a78bfa);
  transition: width 0.15s ease;
}
.upload-zone.dragover {
  border-color: var(--primary, #5b8def);
  background: rgba(91, 141, 239, 0.08);
}


.profile-albums .album-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2, #1a1d27);
  border-radius: 12px 12px 0 0;
}
.profile-albums .album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* Face capture stages – one place, no scroll */
.face-stage {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  max-height: min(280px, 42vh);
  border-radius: 16px;
  overflow: hidden;
  background: #0a0b10;
  border: 1px solid var(--border, #2e3345);
}
.face-stage .camera-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  border: none;
  max-height: none;
}
.face-stage .camera-container.hidden {
  display: none !important;
}
.face-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.stage-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 11, 16, 0.92);
}
.stage-process-inner {
  width: 80%;
  text-align: center;
}
.stage-result-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stage-result-badge {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.65);
  color: #e8ffe8;
  font-size: 0.9rem;
  text-align: center;
  backdrop-filter: blur(6px);
}
.camera-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.face-preview-compact {
  max-width: 420px;
  margin: 12px auto 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.face-preview-compact h3 {
  font-size: 0.95rem;
  margin: 0 0 8px;
}
.face-preview-compact #face-preview-img {
  display: none; /* hlavný náhľad je v stage */
}
#face-detect-progress.hidden { display: none; }
/* progress pod stage nie je potrebný keď máme stage-process – skryť duplicitu */
.face-input-area > #face-detect-progress {
  max-width: 420px;
  margin: 8px auto 0;
}


.face-stage .camera-container.stage-panel:not(.hidden) {
  display: flex !important;
  z-index: 2;
}
.face-stage #stage-result:not(.hidden) {
  display: block !important;
  z-index: 3;
}
.face-stage #stage-result .stage-result-img {
  display: block !important;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}
.face-preview-compact #face-preview-img {
  display: block !important;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 auto;
}


.album-upload-progress {
  margin: 12px 0 16px;
}
.album-upload-progress .upload-progress-title {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
}


.search-inline-progress {
  max-width: 420px;
  margin: 12px auto 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface, #151821);
  border: 1px solid var(--border, #2e3345);
}
.search-inline-progress.hidden { display: none !important; }
#btn-search-stage {
  min-width: min(100%, 280px);
  font-size: 0.95rem;
  padding: 12px 16px;
}


/* ===== Simplified search flow – one screen ===== */
.search-app {
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 12px 88px;
}
.search-app-header { text-align: center; margin-bottom: 12px; }
.search-app-header h1 { font-size: 1.35rem; margin: 0 0 4px; font-weight: 700; }
.search-app-header p { margin: 0; font-size: 0.88rem; color: var(--text-muted, #9aa0b0); }
.search-card {
  background: var(--surface, #151821);
  border: 1px solid var(--border, #2e3345);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.search-view.hidden { display: none !important; }
.tabs-pill {
  display: flex; gap: 6px; margin-bottom: 12px;
  background: rgba(0,0,0,0.25); padding: 4px; border-radius: 12px;
}
.tabs-pill .tab {
  flex: 1; border: none; background: transparent; color: var(--text-muted);
  padding: 8px 6px; border-radius: 10px; font-size: 0.82rem; cursor: pointer;
}
.tabs-pill .tab.active { background: var(--primary, #5b8def); color: #fff; font-weight: 600; }
.search-scope-details {
  margin-top: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(91, 141, 239, 0.16), rgba(91, 141, 239, 0.06));
  border: 1.5px solid rgba(91, 141, 239, 0.45);
  box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.12), 0 6px 18px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  font-size: 0.9rem;
}
.search-scope-details summary {
  cursor: pointer;
  color: #8eb6ff;
  font-weight: 700;
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-scope-details summary::-webkit-details-marker { display: none; }
.search-scope-icon {
  display: inline-flex;
  width: 28px; height: 28px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(91, 141, 239, 0.25);
  font-size: 1rem;
}
.search-scope-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted, #9aa0b0);
  line-height: 1.35;
}
.search-scope-body { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.search-scope-body .form-group label {
  font-weight: 600;
  color: #c5d4f5;
}
.search-progress-panel {
  min-height: 280px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  text-align: center; padding: 24px 12px;
}
.search-progress-bar { width: 100%; max-width: 280px; }
.search-progress-label { margin: 0; font-weight: 600; font-size: 1rem; }
.spinner-lg { width: 48px; height: 48px; border-width: 3px; }
.search-match-live {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 22px; border-radius: 16px;
  background: rgba(91, 141, 239, 0.12); border: 1px solid rgba(91, 141, 239, 0.35);
}
.search-match-live-num {
  font-size: 2.4rem; font-weight: 800; line-height: 1.1;
  color: #5b8def; font-variant-numeric: tabular-nums;
}
.search-match-live-label {
  font-size: 0.85rem; color: var(--text-muted, #9aa0b0); text-transform: lowercase;
}
.search-results-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
.search-results-header h2 { margin: 0; font-size: 1.05rem; }
#search-view-results .photos-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  max-height: min(55vh, 420px); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
#search-view-results .photo-card { border-radius: 12px; overflow: hidden; }
@media (min-width: 480px) {
  #search-view-results .photos-grid { grid-template-columns: repeat(3, 1fr); }
}


.social-nick-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border, #2e3345);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2, #0f1118);
}
.social-nick-prefix {
  flex-shrink: 0;
  padding: 10px 10px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted, #9aa0b0);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border, #2e3345);
  white-space: nowrap;
}
.social-nick-row input {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  flex: 1;
  min-width: 0;
}
.social-nick-field .hint {
  margin-top: 6px;
  font-size: 0.78rem;
}


/* ========== RESPONSIVE – všetky zariadenia ========== */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}
body {
  min-height: 100dvh;
}
.app {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 max(12px, env(safe-area-inset-left)) calc(72px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right));
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Header */
.header {
  width: 100%;
  max-width: 100%;
  gap: 8px;
  padding-top: max(8px, env(safe-area-inset-top));
}
.header .logo-img,
.header img.logo,
#logo-home img {
  max-height: 40px;
  width: auto;
  max-width: min(140px, 42vw);
  object-fit: contain;
}
.header-right {
  gap: 6px;
}
.user-area .btn,
.header-right .btn {
  font-size: 0.82rem;
  padding: 8px 12px;
  white-space: nowrap;
}
.user-badge {
  max-width: min(140px, 36vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bottom nav – always usable */
.bottom-nav {
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
}
.bottom-nav-scroll {
  width: 100%;
  max-width: 100%;
  justify-content: space-around;
}
.nav-btn {
  flex: 1 0 auto;
  min-width: 56px;
  max-width: 88px;
  padding: 6px 4px 8px;
  font-size: 0.65rem;
}
.nav-btn .nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* Forms & cards */
input, select, textarea, button, .btn {
  max-width: 100%;
  font-size: 16px; /* iOS zoom prevent */
}
@media (min-width: 641px) {
  input, select, textarea, .btn {
    font-size: inherit;
  }
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}
.form-row .form-group {
  flex: 1 1 160px;
  min-width: 0;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  box-sizing: border-box;
}
.card, .admin-card, .upload-form, .event-card, .album-card, .venue-card {
  max-width: 100%;
  box-sizing: border-box;
}

/* Grids */
.photos-grid,
.albums-list,
.events-grid,
.venues-grid {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.albums-list,
.events-grid,
.venues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

/* Search flow */
.search-app {
  width: 100%;
  max-width: min(480px, 100%);
  padding-left: 0;
  padding-right: 0;
}
.search-card {
  width: 100%;
  box-sizing: border-box;
}
.face-stage {
  width: 100%;
  max-width: min(280px, 100%);
}

/* Tables */
table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Modals */
.modal, .confirm-modal, .sv-prompt-modal, .sv-lightbox {
  max-width: 100vw;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.sv-prompt-box, .modal-content {
  width: min(400px, 100%);
  max-width: 100%;
  box-sizing: border-box;
}

/* Footer */
.footer, .site-footer {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding-bottom: 8px;
}

/* --- Phone --- */
@media (max-width: 640px) {
  .app {
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
  .header {
    flex-direction: row;
    align-items: center;
  }
  h1, .section h2 {
    font-size: 1.25rem;
    word-break: break-word;
  }
  .hero h1 {
    font-size: 1.35rem;
  }
  .section-desc, .subtitle {
    font-size: 0.9rem;
  }
  .btn-large {
    width: 100%;
  }
  .camera-controls {
    width: 100%;
  }
  .camera-controls .btn {
    flex: 1 1 auto;
  }
  .admin-grid {
    grid-template-columns: 1fr !important;
  }
  .profile-edit-card,
  .upload-form {
    padding: 14px;
  }
}

/* --- Small phone --- */
@media (max-width: 380px) {
  .nav-btn {
    min-width: 48px;
    font-size: 0.6rem;
  }
  .header-right .btn {
    padding: 7px 10px;
    font-size: 0.78rem;
  }
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Tablet --- */
@media (min-width: 641px) and (max-width: 960px) {
  .app {
    padding-left: 20px;
    padding-right: 20px;
  }
  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* --- Desktop --- */
@media (min-width: 961px) {
  .bottom-nav-scroll {
    max-width: 720px;
    justify-content: center;
  }
  .nav-btn {
    min-width: 72px;
  }
  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* Landscape phone – less vertical chrome */
@media (max-height: 500px) and (orientation: landscape) {
  .face-stage {
    aspect-ratio: 1 / 1;
    max-width: 220px;
    max-height: 40vh;
  }
  .search-progress-panel {
    min-height: 160px;
  }
  .bottom-nav .nav-btn span:not(.nav-icon) {
    display: none;
  }
}

/* Touch */
@media (hover: none) and (pointer: coarse) {
  .btn, .nav-btn, .tab, .footer-link {
    min-height: 44px;
  }
  .photo-card, .album-card {
    -webkit-tap-highlight-color: transparent;
  }
}


/* Kompaktná kamera */
.search-card .face-stage {
  max-width: 260px;
  max-height: min(260px, 40vh);
}
@media (max-width: 380px) {
  .search-card .face-stage {
    max-width: 220px;
    max-height: min(220px, 38vh);
  }
}

/* ===== Cookie / GDPR banner ===== */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10050;
  padding: 12px;
  background: transparent;
  pointer-events: none;
}
.cookie-banner.hidden { display: none !important; }
.cookie-banner-inner {
  pointer-events: auto;
  max-width: 920px;
  margin: 0 auto;
  background: var(--surface, #1a1a22);
  color: var(--text, #f2f2f5);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  padding: 16px 18px;
}
.cookie-banner-text {
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 12px;
}
.cookie-banner-text strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.cookie-banner-text p { margin: 0; opacity: 0.92; }
.cookie-link {
  color: var(--primary, #a78bfa);
  text-decoration: underline;
  cursor: pointer;
}
.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.cookie-settings-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(255,255,255,.1));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cookie-settings-panel.hidden { display: none !important; }
.cookie-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  cursor: pointer;
}
.cookie-opt input { margin-top: 3px; }
.legal-content {
  max-width: 800px;
  line-height: 1.55;
  font-size: 0.98rem;
}
.legal-content h3 {
  margin: 1.4em 0 0.5em;
  font-size: 1.15rem;
}
.legal-content ul {
  padding-left: 1.2em;
  margin: 0.4em 0 0.8em;
}
.legal-content li { margin: 0.25em 0; }
@media (max-width: 600px) {
  .cookie-banner { padding: 8px; bottom: 56px; /* nad bottom nav */ }
  .cookie-banner-actions { justify-content: stretch; }
  .cookie-banner-actions .btn { flex: 1 1 auto; }
}

/* Album promo / find */
.album-promo-panel {
  margin: 12px 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--surface-2, rgba(255,255,255,.04));
}
.album-promo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.promo-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.promo-row input {
  flex: 1;
  min-width: 180px;
}
.album-promo-panel textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.album-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Events map – zbaliť / rozbaliť */
.events-map-details {
  margin: 0 0 18px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: 12px;
  background: var(--surface, rgba(255,255,255,.03));
  overflow: hidden;
}
.events-map-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  font-weight: 600;
  user-select: none;
}
.events-map-summary::-webkit-details-marker { display: none; }
.events-map-hint {
  font-weight: 400;
  font-size: 0.85rem;
  opacity: 0.7;
}
.events-map-details[open] .events-map-summary {
  border-bottom: 1px solid var(--border, rgba(255,255,255,.1));
}
.events-map-body {
  padding: 10px 12px 14px;
}
.events-map {
  width: 100%;
  height: 320px;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a22;
}
@media (max-width: 600px) {
  .events-map { height: 260px; }
}


/* Event cover zoom + share */
.event-detail-cover-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 14px;
  border: none;
  background: transparent;
  cursor: zoom-in;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.event-detail-cover-btn .event-detail-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: transform 0.25s ease;
}
.event-detail-cover-btn:hover .event-detail-cover {
  transform: scale(1.02);
}
.event-cover-zoom-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 8px;
  pointer-events: none;
}
.event-share-box {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--surface-2, rgba(255,255,255,.04));
}
.event-share-box label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  opacity: 0.9;
}

/* Discover / Tinder swipe */
.discover-mode-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.discover-stage {
  position: relative;
  max-width: 380px;
  height: min(520px, 70vh);
  margin: 0 auto 16px;
}
.discover-stack {
  position: relative;
  width: 100%;
  height: 100%;
}
.discover-card {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface, #1a1a22);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  touch-action: none;
  user-select: none;
}
.discover-card.dragging { cursor: grabbing; }
.discover-card-img {
  height: 78%;
  background: #0d0d12;
}
.discover-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.discover-noimg {
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 3rem;
  opacity: 0.5;
}
.discover-card-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.discover-stamp {
  position: absolute;
  top: 24px;
  padding: 8px 14px;
  border: 3px solid;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
}
.discover-stamp-yes {
  left: 18px;
  color: #34c759;
  border-color: #34c759;
  transform: rotate(-12deg);
}
.discover-stamp-no {
  right: 18px;
  color: #ff453a;
  border-color: #ff453a;
  transform: rotate(12deg);
}
.discover-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}
.discover-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border, rgba(255,255,255,.2));
  background: var(--surface, #1a1a22);
  font-size: 1.6rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.discover-btn:active { transform: scale(0.94); }
.discover-yes { border-color: rgba(52,199,89,.5); }
.discover-no { border-color: rgba(255,69,58,.5); }
.discover-skip { width: 48px; height: 48px; font-size: 1.1rem; opacity: 0.85; }

.vote-badges {
  display: flex;
  gap: 10px;
  font-size: 0.9rem;
  margin: 4px 0;
}
.vote-up { color: #34c759; }
.vote-down { color: #ff6b6b; }
.photo-votes {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  z-index: 2;
}
.photo-card { position: relative; }

/* =========================================================
   MAIN CONTENT – responzívny stred stránky (2026-08)
   ========================================================= */

.main {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  min-width: 0;
}

.section.active {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Search (úvod) – stred */
.search-app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

.search-app-header {
  text-align: center;
  margin: 0 auto 16px;
  max-width: 36rem;
  padding: 0 4px;
}

.search-app-header h1 {
  font-size: clamp(1.25rem, 4.5vw, 1.65rem);
  line-height: 1.25;
  word-break: break-word;
}

.search-app-header p {
  font-size: clamp(0.85rem, 3.2vw, 0.95rem);
  line-height: 1.45;
  color: var(--text-muted, #9aa0b0);
}

.search-card {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(14px, 3.5vw, 22px);
  border-radius: clamp(12px, 2.5vw, 18px);
  box-sizing: border-box;
  overflow: hidden;
}

/* Tabs – scroll na úzkom displeji */
.tabs,
.tabs-pill {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 12px;
  padding-bottom: 2px;
}
.tabs::-webkit-scrollbar,
.tabs-pill::-webkit-scrollbar { display: none; }
.tabs .tab,
.tabs-pill .tab {
  flex: 1 1 auto;
  white-space: nowrap;
  min-width: 0;
  text-align: center;
  font-size: clamp(0.78rem, 2.8vw, 0.9rem);
  padding: 10px 12px;
}

/* Kamera / stage – centrovanie + fluidná veľkosť */
.face-stage {
  width: 100%;
  max-width: min(360px, 100%);
  margin: 0 auto 12px;
  aspect-ratio: 3 / 4;
  max-height: min(420px, 52vh);
}

.search-card .face-stage {
  max-width: min(340px, 100%);
  max-height: min(400px, 50vh);
}

.face-stage .camera-container,
.camera-container {
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: auto;
}

.camera-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.camera-controls .btn {
  flex: 1 1 auto;
  min-width: min(140px, 100%);
}

/* Scope (kde hľadať) */
.search-scope-details,
.search-scope {
  width: 100%;
  box-sizing: border-box;
}

.search-scope-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 520px) {
  .search-scope-body {
    grid-template-columns: 1fr 1fr;
  }
  .search-scope-body .form-group:last-child {
    grid-column: 1 / -1;
  }
}

/* Výsledky + albumy + eventy – fluid grid */
.photo-grid,
.photos-grid,
#results-grid,
#album-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
  gap: clamp(8px, 2vw, 14px);
  width: 100%;
}

.events-list,
.venues-list,
#albums-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: clamp(12px, 2.5vw, 18px);
  width: 100%;
}

.hero {
  text-align: center;
  margin: 0 auto clamp(16px, 4vw, 28px);
  max-width: 40rem;
  padding: 0 4px;
}

.hero h1 {
  font-size: clamp(1.3rem, 5vw, 1.85rem);
  line-height: 1.2;
}

.subtitle,
.section-desc {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(0.88rem, 3vw, 1rem);
}

/* Formuláre na stred */
.upload-form,
#event-form-wrap,
.profile-edit-card {
  width: 100%;
  max-width: min(640px, 100%);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-row .form-group {
  flex: 1 1 200px;
  min-width: 0;
}

/* Mobile – stred stránky */
@media (max-width: 640px) {
  .app {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .main {
    padding-bottom: 8px;
  }

  .search-app {
    max-width: 100%;
  }

  .search-card {
    padding: 12px;
    border-radius: 14px;
  }

  .search-card .face-stage,
  .face-stage {
    max-width: min(300px, 88vw);
    max-height: min(360px, 48vh);
  }

  .tabs .tab,
  .tabs-pill .tab {
    padding: 9px 8px;
    font-size: 0.8rem;
  }

  .photo-grid,
  .photos-grid,
  #results-grid,
  #album-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .events-list,
  .venues-list,
  #albums-list {
    grid-template-columns: 1fr;
  }

  .event-detail-card,
  .album-detail {
    padding: 0;
  }

  .filters-panel {
    padding: 12px;
  }

  .btn-block,
  #btn-search-stage,
  #btn-search-desc {
    width: 100%;
  }

  .discover-stage {
    max-width: min(100%, 360px);
    height: min(480px, 62vh);
  }
}

/* Veľmi malé telefóny */
@media (max-width: 380px) {
  .search-card {
    padding: 10px;
  }
  .search-card .face-stage,
  .face-stage {
    max-width: 92vw;
    max-height: 42vh;
  }
  .tabs .tab span[data-i18n],
  .tabs-pill .tab span {
    /* ikona + skrátený text ostane */
  }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 960px) {
  .search-app {
    max-width: 520px;
  }
  .photo-grid,
  .photos-grid,
  #results-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .events-list,
  .venues-list,
  #albums-list {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* Desktop – širší stred, ale obsah hľadania ostáva čitateľný */
@media (min-width: 961px) {
  .search-app {
    max-width: 580px;
  }
  .search-card .face-stage,
  .face-stage {
    max-width: 360px;
    max-height: 440px;
  }
  .main .section.active > .hero {
    margin-bottom: 28px;
  }
}

/* Landscape telefón – stlačiť výšku stage */
@media (max-height: 500px) and (orientation: landscape) {
  .search-app-header {
    margin-bottom: 8px;
  }
  .search-app-header p {
    display: none;
  }
  .search-card .face-stage,
  .face-stage {
    max-width: 200px;
    max-height: 38vh;
    aspect-ratio: 1;
  }
  .search-card {
    padding: 10px;
  }
}
