* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #111214;
  --fg: #e8e8ea;
  --muted: #9a9aa2;
  --accent: #4f8cff;
  --gap: 6px;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

h1 { font-size: 1.2rem; font-weight: 600; letter-spacing: 0.02em; }

.header-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; border: 1px solid #3a3a40; color: var(--muted); }
.btn-ghost:hover { color: var(--fg); border-color: var(--muted); }
.btn-small { padding: 4px 10px; font-size: 0.8rem; }

.hidden { display: none !important; }

.admin-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 20px 12px;
  padding: 10px 14px;
  background: rgba(79, 140, 255, 0.12);
  border: 1px solid rgba(79, 140, 255, 0.35);
  border-radius: 8px;
  font-size: 0.9rem;
}

#gallery {
  padding: 0 20px 40px;
}

.g-row {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.g-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #1c1d21;
  flex: 0 0 auto;
}

.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.g-item:hover img { transform: scale(1.03); }

.g-item .overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.g-item:hover .overlay { opacity: 1; pointer-events: auto; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}
.icon-btn:hover { background: #fff; }
.icon-btn.danger { background: rgba(255, 90, 90, 0.9); color: #fff; }

/* admin drag & drop */
.admin .g-item { cursor: grab; }
.admin .g-item.dragging { opacity: 0.4; }
.admin .g-item.drop-target { outline: 3px solid var(--accent); outline-offset: -3px; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  padding: 40px;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  border-radius: 6px;
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
}
