:root {
  --navy-900: #07132b;
  --navy-850: #0a1836;
  --navy-800: #0d1f47;
  --navy-750: #112a5c;
  --surface: #0f2350;
  --surface-2: #14305f;
  --border: rgba(255, 255, 255, 0.10);
  --border-gold: rgba(216, 178, 76, 0.30);
  --text: #f5f8ff;
  --text-dim: #b6c3df;
  --text-faint: #7f8db2;
  --gold: #d8b24c;
  --gold-soft: #f0d691;
  --gold-deep: #b8912f;
  --danger: #f08a8a;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 16px 40px rgba(3, 8, 22, 0.55);
  --radius: 16px;
  --radius-sm: 11px;
  --max: 1180px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 640px at 50% -300px, rgba(216, 178, 76, 0.16), transparent 68%),
    linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  background-attachment: fixed;
}

a { color: var(--gold-soft); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #fff; }
img { max-width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  background: rgba(10, 24, 54, 0.72);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(216, 178, 76, 0.12);
}
.site-header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-logo {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 2px 10px rgba(216, 178, 76, 0.25));
  flex-shrink: 0;
}
.brand-text { display: flex; align-items: baseline; gap: 9px; line-height: 1; }
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.24rem;
  letter-spacing: 0.01em;
  color: var(--text);
}
.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.nav { display: flex; gap: 8px; }
.nav a {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* ---------- Layout ---------- */
.container { display: block; max-width: var(--max); margin: 0 auto; padding: 44px 24px 80px; }

.hero { margin-bottom: 42px; }
.hero-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.hero-title .accent {
  background: linear-gradient(120deg, var(--gold-soft), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--text-dim); font-size: 1.05rem; max-width: 580px; margin: 0; }

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 8px 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-gold), transparent);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 22px;
}
.back:hover { color: var(--gold-soft); }

/* ---------- Programme grid (albums) ---------- */
.night-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.night-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.night-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-gold);
}
.night-card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.night-card:hover .night-card-media { transform: scale(1.05); }
.night-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 2.4rem;
  color: rgba(240, 214, 145, 0.6);
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(216, 178, 76, 0.18), transparent 60%),
    linear-gradient(160deg, var(--surface-2), var(--navy-850));
}
.night-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 15, 34, 0) 36%, rgba(7, 15, 34, 0.9) 100%);
}
.night-card-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.night-card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}
.night-card-count { font-size: 0.82rem; color: rgba(245, 248, 255, 0.78); font-weight: 450; }

/* ---------- Media grid ---------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.media-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.media-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s ease; }
.media-tile:hover img { transform: scale(1.06); }
.play-badge {
  position: absolute;
  bottom: 9px; right: 9px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 15, 34, 0.66);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(240, 214, 145, 0.5);
  color: var(--gold-soft);
  font-size: 0.7rem;
  padding-left: 2px;
}

/* ---------- Viewer ---------- */
.viewer { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.viewer-frame {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 10px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(4, 9, 24, 0.6), rgba(4, 9, 24, 0.35));
  border: 1px solid var(--border);
}
.viewer img, .viewer video {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 10px;
  display: block;
  background: #000;
  box-shadow: var(--shadow-md);
}
.viewer-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  color: #1a1204;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 6px 18px rgba(216, 178, 76, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); color: #1a1204; box-shadow: 0 10px 26px rgba(216, 178, 76, 0.4); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.75; cursor: default; transform: none; filter: none; }
.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border-gold);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(216, 178, 76, 0.12); color: var(--gold-soft); border-color: var(--gold); }
.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(240, 138, 138, 0.5);
  box-shadow: none;
}
.btn.danger:hover { background: rgba(240, 138, 138, 0.12); color: #ffc0c0; }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }

/* ---------- Share bar ---------- */
.share-bar { display: flex; gap: 10px; width: 100%; max-width: 560px; }
.share-bar input {
  flex: 1; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 11px 18px;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 0.85rem;
}
.share-bar input:focus { outline: none; border-color: var(--gold); color: var(--text); }

/* ---------- Panels / forms ---------- */
.panel {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  max-width: 520px;
  margin-bottom: 34px;
}
.panel.wide { max-width: 720px; }
.field { margin-bottom: 18px; }
.field:last-of-type { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.field input[type="text"],
.field input[type="date"],
.field input[type="password"],
.field input[type="file"] {
  width: 100%;
  background: var(--navy-900);
  border: 1px solid var(--border-gold);
  border-radius: 11px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.98rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 178, 76, 0.18); }
.field input[type="file"] { padding: 11px 12px; color: var(--text-dim); cursor: pointer; }
.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: none;
  background: rgba(216, 178, 76, 0.16);
  color: var(--gold-soft);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
}
.hint { color: var(--text-faint); font-size: 0.82rem; margin: 12px 0 0; }
.error-msg {
  background: rgba(240, 138, 138, 0.12);
  border: 1px solid rgba(240, 138, 138, 0.4);
  color: #ffc0c0;
  padding: 12px 16px;
  border-radius: 11px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* ---------- Page header row ---------- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 26px;
}
.page-head h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.page-head .meta { color: var(--text-dim); font-size: 0.95rem; margin: 0; }
.page-head .meta a { font-weight: 500; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius);
  padding: 56px 24px;
  background: rgba(216, 178, 76, 0.03);
}
.empty .empty-icon {
  font-family: var(--serif);
  font-size: 2.4rem;
  color: rgba(240, 214, 145, 0.55);
  display: block;
  margin-bottom: 10px;
}

/* ---------- Login ---------- */
.auth-wrap { min-height: 66vh; display: flex; align-items: center; justify-content: center; }
.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px 32px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: -90px; left: 50%;
  transform: translateX(-50%);
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(216, 178, 76, 0.3), transparent 65%);
  pointer-events: none;
}
.auth-logo { position: relative; display: block; height: 96px; width: auto; margin: 0 auto 18px; filter: drop-shadow(0 4px 18px rgba(216, 178, 76, 0.3)); }
.auth-card h1 { font-family: var(--serif); font-weight: 500; font-size: 1.55rem; text-align: center; margin: 0 0 6px; }
.auth-card .auth-sub { text-align: center; color: var(--text-dim); font-size: 0.9rem; margin: 0 0 26px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 4px; }

/* ---------- Admin media management ---------- */
.admin-tile { display: flex; flex-direction: column; gap: 8px; }
.admin-tile .tile-actions { display: flex; gap: 6px; }
.admin-tile .tile-actions button,
.admin-tile .tile-actions a {
  flex: 1;
  text-align: center;
  padding: 7px 4px;
  border-radius: 9px;
  border: 1px solid var(--border-gold);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.admin-tile .tile-actions form { flex: 1; display: flex; }
.admin-tile .tile-actions button:hover,
.admin-tile .tile-actions a:hover { border-color: var(--gold); color: var(--gold-soft); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #1a1204;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.82rem;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
}
.footer-logo { height: 26px; width: auto; opacity: 0.85; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .container { padding: 30px 16px 64px; }
  .site-header-inner { padding: 11px 16px; }
  .brand-logo { height: 36px; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 7px; }
  .night-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .brand-sub { display: none; }
}
