:root {
  --bg: #0e0b0d;
  --bg-2: #1b0f12;
  --bg-3: #2a1a1f;
  --accent: #ff4d3d;
  --accent-2: #f7c948;
  --text: #f6f3f2;
  --muted: #b6a9ad;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.12);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

@font-face {
  font-family: "HardDrive";
  src: local("Impact"), local("Haettenschweiler"), local("Arial Black");
  font-weight: 700;
}

@font-face {
  font-family: "Riff";
  src: local("Trebuchet MS"), local("Segoe UI"), local("Verdana");
  font-weight: 400;
}

* {
  box-sizing: border-box;
}

figure {
  margin: 0.5rem 0;
}

body {
  margin: 0;
  font-family: "Riff", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% 10%, #371b22 0%, var(--bg) 55%),
    radial-gradient(900px 600px at 90% 20%, #1c1c2c 0%, #0f0f13 50%),
    linear-gradient(160deg, var(--bg-2), var(--bg));
  min-height: 100vh;
  position: relative;
}

.page::before,
.page::after {
  content: "";
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 61, 0.4), transparent 70%);
  z-index: 0;
  filter: blur(2px);
  opacity: 0.5;
}

.page::before {
  top: -120px;
  right: -60px;
}

.page::after {
  bottom: -120px;
  left: -40px;
  background: radial-gradient(circle, rgba(247, 201, 72, 0.35), transparent 70%);
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.12'/></svg>");
  mix-blend-mode: soft-light;
  opacity: 0.4;
  z-index: 0;
}

.hero {
  padding: 6rem 1.5rem 3rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: "HardDrive", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  margin: 1rem 0 0.75rem;
}

.lede {
  font-size: 1.1rem;
  max-width: 30rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--accent-2);
  background: rgba(0, 0, 0, 0.4);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.content {
  padding: 0 1.5rem 3rem;
  flex: 1;
  position: relative;
  z-index: 1;
  align-content: center;
}

.thankyou-page .content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.panel {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  margin-bottom: 1.5rem;
  animation: rise 0.6s ease both;
}

.panel-split {
  display: grid;
  gap: 1.5rem;
  animation-delay: 0.2s;
}

.rules {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.7;
}

.alert {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 77, 61, 0.12);
  border-radius: 12px;
  border: 1px solid rgba(255, 77, 61, 0.35);
  font-size: 0.9rem;
}

.footer {
  padding: 1rem 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.btn {
  border: none;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
}

.input {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 1rem;
}

.input:focus {
  outline: 2px solid rgba(255, 159, 69, 0.4);
}

.btn-primary {
  background: linear-gradient(135deg, #ff5f4d, #ff9f45);
  box-shadow: 0 12px 26px rgba(255, 111, 70, 0.35);
  color: #1a0907;
}

.btn-accent {
  background: linear-gradient(135deg, #f7c948, #ffed7a);
  color: #1a1405;
}

.btn-ghost {
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.35);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.vote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  z-index: 1;
  position: relative;
}

.step {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.camera-panel {
  display: grid;
  gap: 1.25rem;
  animation-delay: 0.1s;
  text-align: center;
}

.camera-toggle {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.camera-toggle .btn.is-active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.35);
}

.camera-shell {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #080606;
  min-height: 18rem;
  border: 1px solid var(--panel-border);
  display: grid;
  cursor: pointer;
}

.camera-shell video,
.camera-shell canvas,
.camera-shell #preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  
}

.preview {
  min-height: 18rem;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 2.2rem;
  background: radial-gradient(circle at 50% 50%, rgba(255, 77, 61, 0.08), transparent 60%);
  align-content: center;
}

.preview::before {
  content: none;
  display: none !important;
  background: none !important;
}

.preview.has-photo::before {
  display: none;
}

.camera-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.status {
  min-height: 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.file-fallback input {
  display: none;
}

.hidden {
  display: none !important;
}

.thankyou {
  text-align: center;
  padding: 3rem 2rem;
  display: grid;
  gap: 0.75rem;
  place-items: center;
  min-height: 60vh;
}

.thankyou h1 {
  font-family: "HardDrive", sans-serif;
  text-transform: uppercase;
}

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  width: 100%;
}

.card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem;
  width: 100%;
}

.card img {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  display: block;
  object-fit: cover;
}

.card figcaption {
  display: grid;
  gap: 0.3rem;
}

.category-panel {
  padding: 2.5rem;
}

.category-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.category-card {
  display: grid;
  gap: 0.5rem;
  padding: 2rem;
  border-radius: 24px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(145deg, rgba(17, 12, 14, 0.9), rgba(7, 7, 9, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.3);
}

.category-title {
  font-family: "HardDrive", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.6rem;
}

.category-sub {
  color: var(--muted);
}

.admin-page .panel {
  border-radius: 28px;
}

.admin-page .filters {
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.filter-pill {
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.45);
  text-transform: uppercase;
}

.filter-pill.is-active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.admin-page .grid {
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.admin-photos-panel {
  padding: 2.25rem;
}

.admin-photos-panel .grid {
  padding-bottom: 0.5rem;
}

.admin-photo-card {
  border-radius: 24px;
  padding: 1.3rem 1.1rem;
  gap: 0.9rem;
  background: linear-gradient(160deg, rgba(20, 17, 19, 0.95), rgba(8, 8, 10, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 18rem;
  place-items: center;
  text-align: center;
}

.admin-photo-card img {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.admin-photo-card figcaption {
  gap: 0.5rem;
  justify-items: center;
}

.admin-photo-card .badge {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

.admin-photo-card .step {
  font-size: 0.85rem;
}

.gallery-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
}

.gallery-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 6, 7, 0.7);
  backdrop-filter: blur(6px);
  z-index: 999;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  width: min(440px, 92vw);
  background: linear-gradient(160deg, rgba(20, 17, 19, 0.98), rgba(8, 8, 10, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 2rem;
  text-align: center;
  display: grid;
  gap: 0.75rem;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}

.modal-photo-wrap {
  width: 100%;
  max-height: 60vh;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.modal-photo {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.modal-photo.is-zoomed {
  transform: scale(1.8);
  cursor: zoom-out;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}


@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .hero,
  .content {
    padding-left: 4rem;
    padding-right: 4rem;
  }

  .panel-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .camera-shell {
    min-height: 24rem;
  }
}
