:root {
  --bg: #0c1040;
  --bg-deep: #06082a;
  --panel: #141a5e;
  --panel-edge: #3848c8;
  --ring-gold: #ffcc00;
  --sega-blue: #1e4fd6;
  --sonic-cyan: #3ad6ff;
  --hot-magenta: #ff3da6;
  --text: #e8ecff;
  --text-dim: #9aa3d6;
  --ok-green: #34d97a;
  --warn-red: #ff4d5e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Press Start 2P', monospace;
  image-rendering: pixelated;
}

body {
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px, transparent 1px, transparent 3px),
    radial-gradient(circle at 50% 0%, var(--bg) 0%, var(--bg-deep) 70%);
  min-height: 100vh;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- boot screen ---------- */
#boot-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 16px;
}
.boot-text {
  font-size: 28px;
  color: var(--ring-gold);
  text-shadow: 3px 3px 0 var(--hot-magenta), 6px 6px 0 var(--sega-blue);
  letter-spacing: 2px;
}
.boot-sub {
  font-size: 12px;
  color: var(--sonic-cyan);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- header ---------- */
.site-header {
  padding: 18px 20px 14px;
  text-align: center;
  border-bottom: 4px solid var(--panel-edge);
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
}
.site-title {
  font-size: 22px;
  color: var(--ring-gold);
  text-shadow: 3px 3px 0 var(--hot-magenta), 6px 6px 0 var(--sega-blue);
  margin: 0 0 8px;
  letter-spacing: 1px;
}
.site-subtitle {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.mode-pill {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  font-size: 9px;
  border: 2px solid var(--ok-green);
  color: var(--ok-green);
  background: rgba(52, 217, 122, 0.08);
}
.mode-pill.live {
  border-color: var(--hot-magenta);
  color: var(--hot-magenta);
  background: rgba(255, 61, 166, 0.08);
}

/* ---------- main ---------- */
/* Generous width on purpose: the after's real resolution only reads as
   sharpness if the comparison is displayed large -- shrinking it back down
   for layout tidiness is exactly what hid the upscale before. */
main { flex: 1; padding: 24px 24px 60px; max-width: 1600px; margin: 0 auto; width: 100%; }

.section-label {
  font-size: 11px;
  color: var(--sonic-cyan);
  margin: 0 0 18px;
  text-shadow: 2px 2px 0 var(--bg-deep);
}

/* ---------- gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.clip-card {
  border: 4px solid var(--panel-edge);
  background: var(--panel);
  padding: 14px;
  box-shadow: 6px 6px 0 var(--bg-deep);
}

.clip-title {
  font-size: 13px;
  color: var(--ring-gold);
  margin: 0 0 10px;
}

.wipe-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 3px solid var(--bg-deep);
  background: #000;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}

.wipe-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.wipe-after-mask {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
  width: 50%;
}
/* Inner video width is set inline by app.js to match the wipe-wrap's full
   pixel width, not the mask's -- otherwise it would rescale (squish) as the
   mask narrows instead of staying put and simply getting clipped. */
.wipe-after-mask video { position: absolute; top: 0; left: 0; }

.wipe-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: var(--ring-gold);
  box-shadow: 0 0 0 2px var(--bg-deep);
  transform: translateX(-2px);
}
.wipe-handle::before {
  content: "\2194";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  background: var(--ring-gold);
  color: var(--bg-deep);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.wipe-tag {
  position: absolute;
  bottom: 8px;
  font-size: 8px;
  padding: 4px 7px;
  background: rgba(0,0,0,0.65);
  z-index: 3;
}
.wipe-tag.before { left: 8px; color: var(--text-dim); }
.wipe-tag.after { right: 8px; color: var(--sonic-cyan); }

.wipe-playpause {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  font-size: 11px;
  padding: 6px 9px;
  background: rgba(0,0,0,0.65);
  color: var(--ring-gold);
  border: 2px solid var(--ring-gold);
  pointer-events: none;
}

.fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  font-family: inherit;
  font-size: 8px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.65);
  color: var(--ring-gold);
  border: 2px solid var(--ring-gold);
  cursor: pointer;
}
.fullscreen-btn:hover { background: var(--ring-gold); color: var(--bg-deep); }

.wipe-wrap:fullscreen,
.wipe-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: unset !important;
}

/* ---------- live mode upload stub ---------- */
.live-panel {
  border: 4px solid var(--hot-magenta);
  background: var(--panel);
  padding: 20px;
  margin-bottom: 30px;
}
.live-panel h2 {
  font-size: 13px;
  color: var(--hot-magenta);
  margin: 0 0 10px;
}
.live-panel p {
  font-size: 10px;
  line-height: 1.9;
  color: var(--text-dim);
}
.upload-stub {
  margin-top: 16px;
  padding: 18px;
  border: 3px dashed var(--panel-edge);
  text-align: center;
}
.todo-note {
  margin-top: 14px;
  font-size: 8px;
  color: var(--warn-red);
  line-height: 1.8;
  text-align: left;
}

.btn-action {
  font-family: inherit;
  font-size: 10px;
  padding: 12px 20px;
  background: var(--hot-magenta);
  color: var(--bg-deep);
  border: 3px solid var(--ring-gold);
  cursor: pointer;
}
.btn-action:hover { background: var(--ring-gold); }
.btn-action:disabled { background: #2a2f70; color: var(--text-dim); border-color: var(--panel-edge); cursor: not-allowed; }

.btn-link {
  font-family: inherit;
  font-size: 8px;
  padding: 4px 8px;
  background: transparent;
  color: var(--sonic-cyan);
  border: 2px solid var(--sonic-cyan);
  cursor: pointer;
}
.btn-link:hover { background: var(--sonic-cyan); color: var(--bg-deep); }

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.upload-form { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.upload-form input[type="file"] {
  font-family: inherit;
  font-size: 8px;
  color: var(--text-dim);
}

.upload-msg { font-size: 9px; color: var(--text-dim); margin-top: 4px; }
.upload-success { font-size: 9px; color: var(--ok-green); margin-top: 4px; }
.upload-error { font-size: 9px; color: var(--warn-red); margin-top: 4px; }

/* ---------- admin ---------- */
.admin-wrap { max-width: 640px; margin: 0 auto; }
.admin-panel {
  border: 4px solid var(--panel-edge);
  background: var(--panel);
  padding: 18px;
  margin-bottom: 22px;
}
.admin-panel h2 {
  font-size: 12px;
  color: var(--sonic-cyan);
  margin: 0 0 12px;
}
.admin-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  padding: 6px 0;
  border-bottom: 2px solid rgba(255,255,255,0.07);
  gap: 12px;
}
.admin-row .v { color: var(--ring-gold); text-align: right; }
.admin-note {
  font-size: 9px;
  color: var(--text-dim);
  line-height: 1.9;
  margin-top: 10px;
}

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  padding: 16px;
  font-size: 8px;
  color: var(--text-dim);
  border-top: 4px solid var(--panel-edge);
}

/* Crop comparisons are zoomed-in detail shots, not full scenes -- keep them
   at a moderate, centered width rather than stretching across the full
   1600px main column. */
.crop-grid {
  grid-template-columns: 1fr;
  max-width: 760px;
  margin: 0 auto;
}

.section-note {
  font-size: 9px;
  color: var(--text-dim);
  line-height: 1.8;
  margin: -10px 0 18px;
}
