:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #f8f0e8;
  background: #100d16;
  --orange: #ff9a45;
  --purple: #bc92ed;
  --muted: #afa0bc;
  --line: #372a43;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 90% 4%, #45216350, transparent 48%), radial-gradient(ellipse at 0 0, #71361728, transparent 45%);
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--purple); outline-offset: 4px; }
[hidden] { display: none !important; }
.loading { min-height: 100svh; display: grid; place-items: center; color: var(--muted); }
.registration { min-height: 100svh; display: grid; place-items: center; padding: 40px 20px; }
.registration-card {
  position: relative;
  width: min(100%, 440px);
  padding: 26px 36px 34px;
  background: linear-gradient(145deg, #27192f, #19131f 70%);
  border: 1px solid #4a3357;
  border-radius: 28px;
  box-shadow: 0 30px 100px #0005, 0 0 90px #75428d15;
}
.registration-art { position: relative; height: 144px; margin-bottom: 20px; }
.registration-pumpkin { position: absolute; width: 154px; left: 50%; top: 0; transform: translateX(-50%) rotate(-7deg); filter: drop-shadow(0 10px 24px #ff761225); }
.registration-bat { position: absolute; width: 66px; }
.bat-one { left: 0; top: 15px; transform: rotate(-18deg); }
.bat-two { right: -2px; top: 60px; width: 45px; transform: rotate(16deg); opacity: .65; }
.registration h1 { font-size: 27px; letter-spacing: -1px; font-weight: 600; margin: 0 0 24px; }
.input-wrap { position: relative; }
input { width: 100%; height: 58px; border: 1px solid #5a416b; border-radius: 12px; background: #100d17; padding: 0 42px 0 16px; color: #f8f0e8; font-size: 16px; }
input::placeholder { color: #a191af; }
.search-icon { position: absolute; right: 16px; top: 9px; font-size: 30px; color: var(--purple); pointer-events: none; }
#suggestions { padding: 5px; margin: 8px 0 0; list-style: none; background: #201629; border: 1px solid #5a416b; border-radius: 12px; max-height: 280px; overflow: auto; }
#suggestions li { padding: 13px 11px; border-radius: 7px; font-size: 14px; line-height: 1.45; cursor: pointer; }
#suggestions li:hover, #suggestions li[aria-selected=true] { background: #3f2852; color: #ffd2a0; }
.field-status { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 10px 0 0; }
.field-status:empty { display: none; }
.primary { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 12px; background: var(--orange); color: #241326; padding: 18px 20px; font-weight: 650; margin-top: 22px; }
.primary:hover:not(:disabled) { background: #ffb164; }
.primary span { font-size: 22px; line-height: 16px; }
.primary:disabled { background: #3a2947; color: #a18caf; }
.error { color: #ffa99b; font-size: 14px; line-height: 1.5; }
.error:empty { display: none; }
.gallery { max-width: 1104px; margin: auto; padding: 0 40px 52px; }
.topbar { height: 88px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); gap: 24px; }
.brand-home { display: inline-flex; align-items: center; min-height: 44px; border-radius: 4px; }
/* Original marks are black on transparent backgrounds; invert only their display on the dark theme. */
.brand-logo { display: block; height: auto; object-fit: contain; filter: invert(1); }
.brand-logo-first { width: 155px; }
.brand-logo-second { width: 114px; }
.gallery-heading { display: flex; align-items: end; justify-content: space-between; padding: 44px 0 32px; gap: 16px; }
.eyebrow { font-size: 13px; letter-spacing: .3px; line-height: 1.5; color: var(--muted); margin: 0 0 14px; }
.gallery h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.05; font-weight: 750; letter-spacing: -2.5px; margin: 0; }
.gallery h1 span { color: var(--orange); }
.counter { white-space: nowrap; padding-bottom: 3px; }
.counter strong { font-size: 39px; letter-spacing: -1.8px; font-weight: 600; color: var(--orange); }
.counter strong span { color: #a284bb; font-size: 24px; font-weight: 400; }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.photo-slot { position: relative; aspect-ratio: 4/3; border: 1px dashed #70507f; border-radius: 20px; background: linear-gradient(145deg, #261b30, #1a1423); overflow: hidden; color: var(--purple); display: flex; align-items: center; justify-content: center; padding: 0; transition: background .18s, border-color .18s, transform .18s; }
.photo-slot:nth-child(2n) { background: linear-gradient(145deg, #291d23, #1d1420); border-color: #8f603f; color: var(--orange); }
.photo-slot:hover { border-color: var(--orange); background: #302038; transform: translateY(-2px); }
.photo-slot:active { transform: scale(.985); }
.slot-number { position: absolute; left: 18px; top: 16px; font-size: 11px; font-weight: 550; letter-spacing: 1px; color: #b29ac5; }
.photo-slot:nth-child(2n) .slot-number { color: #d9a580; }
.plus { width: 25%; aspect-ratio: 1; position: relative; display: block; }
.plus::before, .plus::after { content: ""; position: absolute; background: currentColor; border-radius: 3px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.plus::before { width: 100%; height: 2px; }
.plus::after { height: 100%; width: 2px; }
.photo-slot.filled { border: 1px solid #715084; background: #21152d; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.filled .slot-number { background: #170e24dd; color: #ffe0bb; border: 1px solid #ffffff20; border-radius: 7px; padding: 5px 8px; left: 12px; top: 12px; z-index: 1; }
.saved-label { position: absolute; bottom: 12px; right: 12px; background: #170e24e8; color: #ffd0a0; border: 1px solid #ffb76e50; border-radius: 8px; padding: 6px 9px; font-size: 12px; }
.pending .saved-label { color: #ffbf81; }
.night-decoration { display: flex; align-items: center; justify-content: center; pointer-events: none; }
.night-decoration img { display: block; width: 100%; max-height: 100%; object-fit: contain; }
.queue-message { padding: 14px 18px; background: #2e1e30; border: 1px solid #6e4b46; border-radius: 14px; margin-top: 20px; font-size: 13px; line-height: 1.5; display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.secondary { background: transparent; color: #ffc18c; border: 1px solid #936449; border-radius: 9px; padding: 10px 12px; font-size: 12px; flex-shrink: 0; }
dialog { border: 1px solid #513a62; padding: 0; }
dialog::backdrop { background: #08050ed9; backdrop-filter: blur(8px); }
.camera-dialog { width: min(100%, 520px); max-width: 100%; max-height: 100svh; background: #1c1426; color: #f8f0e8; border-radius: 22px; overflow: auto; }
.camera-top, .preview-top { padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.icon-button { width: 40px; height: 40px; border: 1px solid #6a4b7d; border-radius: 50%; background: #271a35; color: #e4cbfb; font-size: 19px; }
.viewfinder { position: relative; aspect-ratio: 3/4; max-height: 62svh; background: #09070d; display: flex; align-items: center; justify-content: center; }
.viewfinder video { display: block; width: 100%; height: 100%; object-fit: contain; }
.viewfinder p { position: absolute; inset: auto 20px 30px; text-align: center; font-size: 14px; line-height: 1.5; color: white; text-shadow: 0 1px 4px black; }
.frame-corner { position: absolute; width: 26px; height: 26px; border: 1px solid #ffb76ec0; pointer-events: none; }
.corner-a { left: 20px; top: 20px; border-right: 0; border-bottom: 0; }
.corner-b { bottom: 20px; right: 20px; border-left: 0; border-top: 0; }
.camera-controls { padding: 20px 24px 26px; position: relative; display: flex; align-items: center; flex-direction: column; gap: 16px; }
.camera-controls p { font-size: 12px; line-height: 1.5; text-align: center; color: #c2a5d9; margin: 0; }
.shutter { width: 70px; height: 70px; border: 1px solid #ffb76e; border-radius: 50%; background: transparent; padding: 5px; }
.shutter span { display: block; background: var(--orange); width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 24px #ff7b251f; }
.shutter:disabled { opacity: .3; }
.switch-camera { position: absolute; right: 35px; bottom: 40px; font-size: 29px; }
.preview-dialog { background: #1c1426; color: #f8f0e8; border-radius: 18px; max-width: 94vw; max-height: 94svh; width: min(800px, 94vw); overflow: auto; }
.preview-dialog img { display: block; width: 100%; max-height: 72svh; object-fit: contain; background: #09070d; }
.preview-dialog p { font-size: 12px; color: #c2a5d9; text-align: center; padding: 4px 16px 12px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 14px 20px; background: #45295e; color: #fff1e2; border: 1px solid #9b73bb; border-radius: 12px; box-shadow: 0 4px 25px #0005; max-width: 90vw; width: max-content; font-size: 13px; z-index: 10; }
@media (max-width: 650px) {
  .gallery { padding: 0 20px 32px; }
  .topbar { height: 72px; gap: 16px; }
  .brand-logo-first { width: 135px; }
  .brand-logo-second { width: 100px; }
  .gallery-heading { padding: 30px 0 25px; gap: 10px; }
  .gallery h1 { font-size: clamp(30px, 8vw, 40px); letter-spacing: -1.5px; }
  .eyebrow { font-size: 11px; max-width: 265px; margin-bottom: 12px; }
  .counter strong { font-size: 28px; letter-spacing: -1px; }
  .counter strong span { font-size: 18px; }
  .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .photo-slot { aspect-ratio: 4/5; border-radius: 16px; }
  .slot-number { left: 14px; top: 13px; }
  .night-decoration img { width: 115%; max-width: none; }
  .queue-message { display: block; }
  .queue-message .secondary { margin-bottom: 5px; }
  .registration-card { padding: 24px 26px 28px; }
  .registration h1 { font-size: 25px; }
  .camera-dialog { border-radius: 0; border: 0; width: 100%; height: 100svh; max-height: 100svh; margin: 0; }
  .viewfinder { max-height: calc(100svh - 240px); width: 100%; }
  .camera-controls { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .preview-dialog { border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
