:root {
  --bg: #202030;
  --text: #EAE2B7;
  --card: #26263a;
  --muted: rgba(234, 226, 183, 0.8);
  --accent1: #E15216;
  --accent2: #E67B26;
  --accent3: #CB0F03;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  --bg: #EAE2B7;
  --text: #202030;
  --card: #f2ead2;
  --muted: rgba(32, 32, 48, 0.7);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}
/* ---- Gallery ---- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.card {
  position: relative;
  background: #242131;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Real image thumbnail */
.card img.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity .3s;
}

/* Hover dark overlay */
.card .hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
}

.card:hover .hover-overlay {
  opacity: 1;
}

/* View button */
.view-btn {
  padding: 10px 16px;
  background: #E67B26;
  border-radius: 6px;
  font-weight: bold;
  color: white;
  border: none;
  cursor: pointer;
  transition: transform .2s;
}

.view-btn:hover {
  transform: scale(1.05);
}

/* Sign out button */
.btn.danger {
  background: #cb0f03;
  color: white;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: var(--shadow);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 42px;
  width: 42px;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.5px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  border: none;
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
  background: var(--card);
}

.btn:hover {
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(1px);
}

.btn.accent1 { background: var(--accent1); }
.btn.accent2 { background: var(--accent2); }
.btn.accent3 { background: var(--accent3); }
.btn.full-width { width: 100%; }

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(234, 226, 183, 0.4);
  color: var(--text);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.username {
  font-weight: 700;
}

.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  background: linear-gradient(135deg, rgba(225,82,22,0.12), rgba(230,123,38,0.1));
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.hero-card {
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.hero-logo {
  width: 96px;
  margin: 0 auto;
}

.eyebrow {
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}

.lede {
  margin-top: 0;
  color: var(--muted);
}

.hero h1 {
  margin: 0 0 8px 0;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.gallery-section h2 {
  margin: 4px 0 0 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.legend {
  font-size: 13px;
  color: var(--muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
  isolation: isolate;
}

.card:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.card img,
.card .placeholder-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.placeholder-thumb {
  background: rgba(234,226,183,0.12);
}

.card .meta {
  padding: 10px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.badge {
  background: rgba(225,82,22,0.2);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.icon-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0.2;
  mix-blend-mode: lighten;
}

[data-theme="light"] .watermark {
  mix-blend-mode: multiply;
  opacity: 0.25;
}

.watermark img {
  width: 70%;
  max-width: 160px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

.empty-state,
.error {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(234, 226, 183, 0.08);
}

.error {
  border: 1px solid var(--accent3);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-content {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  width: min(420px, 90%);
  box-shadow: var(--shadow);
  position: relative;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.file-label {
  display: inline-block;
  padding: 10px 14px;
  background: rgba(234,226,183,0.08);
  border-radius: var(--radius);
  border: 1px dashed rgba(234, 226, 183, 0.4);
  cursor: pointer;
  margin-bottom: 10px;
}

#file-input {
  width: 100%;
  margin-bottom: 12px;
  color: var(--text);
}

.status {
  margin-top: 10px;
  min-height: 20px;
  font-size: 14px;
}

.auth-complete {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.auth-message {
  background: var(--card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  align-items: center;
  justify-items: center;
}

.auth-logo {
  width: 80px;
}

@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .nav-right {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .hero {
    padding: 18px;
  }
}
