:root {
  --bg: #000;
  --text: #fff;
  --muted: #cfcfcf;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  background: var(--bg) url("/bg_stars.jpg") center / cover fixed no-repeat;
  color: var(--text);
  font-family: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  margin: 0;
}

/* Header */
.site-header {
  display: flex;
  justify-content: center;
  padding: 32px 16px 0;
}
.logo {
  width: clamp(160px, 22vw, 320px);
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.65));
  mix-blend-mode: screen; /* makes black background effectively disappear on dark bg */
}

/* Main */
.content {
  text-align: center;
  padding: 24px 16px 48px;
}
.title {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: clamp(28px, 6vw, 64px);
  margin: 8px 0 4px;
}
.subtitle {
  font-weight: 600;
  font-size: clamp(14px, 2.5vw, 18px);
  margin: 0 0 20px;
  color: var(--muted);
}
.cta {
  font-weight: 600;
  font-size: clamp(18px, 3vw, 24px);
  margin: 0 0 32px;
}
.howto {
  display: flex;
  justify-content: center;
  margin: 16px auto 24px;
}
.howto img {
  width: clamp(280px, 80vw, 960px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.disclaimer {
  display: flex;
  justify-content: center;
}
.disclaimer-text {
  max-width: 720px;
  line-height: 1.6;
  font-size: clamp(12px, 2.2vw, 16px);
  color: var(--muted);
  padding: 0 16px;
  border-left: 2px solid rgba(255,255,255,0.08);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px 16px 32px;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}

/* Subtle star drift overlay for depth */
#stars-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("/bg_stars.jpg") center / cover no-repeat;
  opacity: 0.15;
  transform: translate3d(0,0,0);
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
  #stars-overlay { animation: none !important; }
  .logo, .title, .subtitle, .cta { transition: none !important; }
}

.main-nav { display: flex; justify-content: center; gap: 16px; margin-top: 12px; }
.main-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.main-nav a:hover { color: #fff; }

/* Scenes UI */
.toolbar {
  max-width: 1100px;
  margin: 8px auto 16px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}
.toolbar input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.btn:hover { background: rgba(255,255,255,0.1); }

.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  max-width: 1100px;
  margin: 8px auto 32px;
  padding: 0 16px;
}
.scene-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow: hidden;
}
.scene-thumb {
  aspect-ratio: 16 / 9;
  background: #0b0b0b;
  display: grid;
  place-items: center;
  color: #dcdcdc;
  font-size: 12px;
}
.scene-meta {
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.scene-id { font-weight: 700; }
.scene-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.scene-actions .btn { font-size: 12px; padding: 8px 10px; }

/* Modal player */
.modal {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.8);
  z-index: 50;
  padding: 24px;
}
.modal.open { display: flex; }
.modal-inner {
  width: min(100%, 960px);
  background: #000;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow: hidden;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.12);
}
.modal-title { font-weight: 700; }
.modal-close { cursor: pointer; color: #fff; opacity: 0.8; }
.modal-close:hover { opacity: 1; }
.modal-body { background: #000; }
.modal-body video { width: 100%; height: auto; display: block; }

/* Upload form */
.upload-form {
  max-width: 900px;
  margin: 16px auto 32px;
  padding: 0 16px;
  text-align: left;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-field { display: grid; gap: 8px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 700; font-size: 14px; }
.form-field input[type="text"],
.form-field input[type="file"] {
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 8px;
}
.hint { color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.status { margin-top: 12px; color: var(--muted); }
.result { margin-top: 12px; }
.result-row { display: flex; gap: 8px; }
.result-row input { flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #fff; }
.small { color: var(--muted); font-size: 12px; }

.progress,
#submitGlobalProgress,
#homeGlobalProgress,
.upload-form,
#homeUploadForm,
[data-view-sub],
[data-submissions] {
  display: none !important;
}

.progress { max-width: 1100px; margin: 8px auto 16px; padding: 0 16px; text-align: left; }
.progress-label { display: inline-block; font-weight: 700; margin-bottom: 6px; }
.progress-bar { width: 100%; height: 10px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: #fff; transition: width 0.3s ease; }