@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

@font-face {
  font-family: 'Press Start 2P';
  src: url('https://fonts.gstatic.com/s/pressstart2p/v12/e3t4euO8KNyE0bM0YF_AZQ.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'Comic Neue';
  src: url('https://fonts.gstatic.com/s/comicneue/v3/m8JQjfJ65Lem5kuupuswOJlxdP8.woff2') format('woff2');
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: 'Patrick Hand';
  src: url('https://fonts.gstatic.com/s/patrickhand/v16/LDI2apCSOBg7S-QT7pasEJT2UDw.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'Pacifico';
  src: url('https://fonts.gstatic.com/s/pacifico/v22/FwZY7-Qmy14u9lezJ-6H6Mk.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

:root {
  --neon-pink: #ff00cc;
  --neon-blue: #00eaff;
  --neon-green: #39ff14;
  --neon-orange: #ff9900;
  --bg-gradient: linear-gradient(135deg, #1a0033 0%, #003366 100%);
  --star-color: #fffbe6;
  --footer-bg: rgba(0,0,0,0.7);
  --footer-text: #fffbe6;
  --rainbow: linear-gradient(90deg, #ff00cc, #00eaff, #39ff14, #ff9900, #ff00cc);
}

html {
  height: 100%; /* ensure background image can always cover full viewport height */
  background: url('collage-bg.jpg') center center/cover no-repeat fixed, var(--bg-gradient);
}

body {
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  min-height: 100vh;
  font-family: 'VT323', 'Press Start 2P', monospace;
  background: transparent;
  color: var(--neon-pink);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  z-index: 0;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  /* Optional: subtle overlay for retro effect, but less opaque for collage visibility */
  background: repeating-radial-gradient(circle at 20% 30%, var(--star-color) 1px, transparent 2px 40px);
  opacity: 0.12;
}

header {
  text-align: center;
  padding: 1.5rem 0 0.5rem 0;
}

.marquee {
  font-family: 'Press Start 2P', monospace;
  color: #fff;
  background: #000;
  padding: 0.3rem 0;
  font-size: 1.1rem;
  text-shadow: 0 0 12px var(--neon-green), 0 0 4px #fff;
  border-bottom: 2px solid var(--neon-pink);
  border-top: 2px solid var(--neon-pink);
  letter-spacing: 2px;
  font-weight: bold;
  /* Marquee speed hack */
  animation: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 12;
  box-shadow: 0 2px 8px #000;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

marquee {
  scrollamount: 10;
}

h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 2rem;
  color: var(--neon-pink);
  margin: 0.5rem 0 0.2rem 0;
  text-shadow: 0 0 8px #fff, 0 0 2px #fff;
  letter-spacing: 2px;
  margin-top: 2.5rem;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

#camera-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

.camera-frame {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 3/4;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--neon-blue);
  border-radius: 1.5rem;
  overflow: hidden;  /* keep video clipped inside the rounded blue border */
  box-shadow: 0 0 24px var(--neon-blue);
  margin-bottom: 0.5rem;
}
#camera {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: block;
}

.camera-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

button {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.1rem;
  text-transform: uppercase;
  background: var(--neon-pink);
  color: #fff;
  border: none;
  border-radius: 0.7rem;
  padding: 1rem 1.5rem;
  margin: 0.2rem;
  box-shadow: 0 0 8px var(--neon-pink);
  transition: background 0.2s, color 0.2s;
  outline: none;
  touch-action: manipulation;
}

button:active {
  background: var(--neon-blue);
  color: var(--neon-pink);
}

.snap-btn {
  background: var(--neon-green);
  color: #000;
  font-size: 1.3rem;
  box-shadow: 0 0 12px var(--neon-green);
}

.snap-btn:disabled {
  background: #888 !important;
  color: #ccc !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

#gallery-section {
  width: 100vw;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

#gallery {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.gallery-photo {
  position: relative;
  width: 64px;
  height: 86px;
  aspect-ratio: 3/4;
  border: 2px solid var(--neon-orange);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #111;
  box-shadow: 0 0 8px var(--neon-orange);
}
.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: transparent;
  color: var(--neon-pink);
  border: none;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.5rem;
  text-align: center;
  box-shadow: none;
  z-index: 2;
}

.gallery-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.submit-btn {
  background: var(--neon-blue);
  color: #000;
  font-size: 1.2rem;
  box-shadow: 0 0 12px var(--neon-blue);
}

.submit-btn:disabled {
  background: #444;
  color: #aaa;
  box-shadow: none;
  cursor: not-allowed;
}

.snap-submit-row {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin: 0.5rem 0 0.5rem 0;
}

#snap, #submit {
  margin-top: 0 !important;
}

#submit-note {
  color: #ff00cc;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.9rem;
  margin: 0.5rem 0 0.5rem 0;
  text-shadow: 0 0 8px #fff, 0 0 2px #ff00cc;
  text-align: center;
}

.reset-btn {
  background: var(--neon-orange);
  color: #000;
  font-size: 1.1rem;
  box-shadow: 0 0 8px var(--neon-orange);
}

.success-message {
  text-align: center;
  color: var(--neon-green);
  font-size: 1.3rem;
  margin: 2rem 0 1rem 0;
  text-shadow: 0 0 8px var(--neon-green);
}

.insta-link {
  display: block;
  margin: 1rem auto;
  font-size: 1.1rem;
  color: var(--neon-pink);
  background: var(--neon-blue);
  padding: 0.7rem 1.2rem;
  border-radius: 0.7rem;
  text-decoration: none;
  box-shadow: 0 0 8px var(--neon-blue);
  font-family: 'Press Start 2P', monospace;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem env(safe-area-inset-bottom) 0.5rem;
  z-index: 10;
  font-family: 'VT323', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rainbow skin for Konami code */
.rainbow-skin {
  background: var(--rainbow) !important;
  animation: rainbow-bg 3s linear infinite;
}

@keyframes rainbow-bg {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.rainbow-skin header, .rainbow-skin .banner, .rainbow-skin footer {
  background: var(--rainbow) !important;
  color: #fff !important;
  text-shadow: 0 0 8px #fff;
}

.rainbow-skin button, .rainbow-skin .insta-link {
  background: var(--rainbow) !important;
  color: #fff !important;
  text-shadow: 0 0 8px #fff;
}

.animated-title {
  animation: rainbow-shadow 2.2s linear infinite;
  color: var(--neon-pink);
  text-shadow:
    0 0 8px #fff,
    0 0 12px #ff00cc,
    0 0 24px #00eaff,
    0 0 32px #39ff14,
    0 0 40px #ff9900;
  font-family: 'Press Start 2P', monospace !important;
  font-size: clamp(1.4rem, 7vw, 2.6rem);
  line-height: 1.15;
  word-break: keep-all;
  text-align:center;
}

.sheet-title {
  font-family: 'Press Start 2P', monospace !important;
  font-size: clamp(0.7rem, 2vw, 1.2rem);
  text-shadow: 0 0 4px #fff;
  font-weight: bold;
  letter-spacing: 1px;
  margin: 0 auto;
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  bottom: 22px;
  white-space: pre-line;
  word-break: break-word;
}

/* Photobooth preview tweaks – prevent cutting off header/footer */
.sheet-preview {
  width: min(90vw, 432px);
  height: auto;           /* let height follow aspect ratio */
  aspect-ratio: 9/16;
  max-height: 85vh;       /* leave a little breathing room under safe-area */
}

@keyframes rainbow-shadow {
  0% {
    text-shadow:
      0 0 8px #fff,
      0 0 12px #ff00cc,
      0 0 24px #00eaff,
      0 0 32px #39ff14,
      0 0 40px #ff9900;
  }
  25% {
    text-shadow:
      0 0 8px #fff,
      0 0 12px #00eaff,
      0 0 24px #39ff14,
      0 0 32px #ff9900,
      0 0 40px #ff00cc;
  }
  50% {
    text-shadow:
      0 0 8px #fff,
      0 0 12px #39ff14,
      0 0 24px #ff9900,
      0 0 32px #ff00cc,
      0 0 40px #00eaff;
  }
  75% {
    text-shadow:
      0 0 8px #fff,
      0 0 12px #ff9900,
      0 0 24px #ff00cc,
      0 0 32px #00eaff,
      0 0 40px #39ff14;
  }
  100% {
    text-shadow:
      0 0 8px #fff,
      0 0 12px #ff00cc,
      0 0 24px #00eaff,
      0 0 32px #39ff14,
      0 0 40px #ff9900;
  }
}

@keyframes waveHeader {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.instagram-follow a {
  color: #ff00cc;
  text-decoration: none;
  font-weight: bold;
  margin-top: 0.3rem;
  font-size: 1.2rem;
  display: inline-block;
}

.flash-active {
  background: var(--neon-green) !important;
  color:#000 !important;
}

/* Modern scrolling banner */
.banner {
  width: 100vw;
  overflow: hidden;
  white-space: nowrap;
  background: #000;
  border-top: 2px solid var(--neon-pink);
  border-bottom: 2px solid var(--neon-pink);
  box-shadow: 0 2px 8px #000;
  cursor: pointer;
}
.banner__inner {
  display: inline-block;
  padding-left: 100%;
  animation: banner-scroll 30s linear infinite;
}
.banner__inner::after {
  content: attr(data-text);
  margin-left: 4rem;
}
@keyframes banner-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Upload overlay */
#upload-overlay{
  position:fixed;
  top:0;left:0;width:100%;height:100%;
  background:rgba(0,0,0,0.85);
  display:none; /* toggled to flex when active */
  align-items:center;justify-content:center;
  flex-direction:column;
  color:#fff;
  text-align:center;
  z-index:10000;
  padding:20px;
}
#upload-overlay.active{display:flex;}
#upload-overlay progress{
  width:80%;
  max-width:300px;
  height:18px;
  margin-top:20px;
}

@media (max-width: 600px) {
  h1.animated-title { font-size: 1.3rem; }
  .marquee { font-size: 0.8rem; }
  button, .insta-link { font-size: 0.9rem; padding: 0.7rem 1rem; }
  #camera {
    width: 98vw;
    max-width: 98vw;
    aspect-ratio: 9/16;
    height: auto;
    min-height: 60vw;
    max-height: 80vh;
  }
  #gallery-section { max-width: 98vw; }
  .snap-submit-row { flex-direction: column; gap: 0.5rem; }
  #snap, #submit { width: 44vw; min-width: 120px; }
}

body, .sheet-title, .sheet-header, .animated-title, .photos-instructions {
  font-family: 'Press Start 2P', monospace !important;
  letter-spacing: 0.04em;
  text-transform: none;
}
.sheet-insta {
  font-family: 'Comic Neue', 'Comic Sans MS', cursive !important;
  letter-spacing: 0.01em;
  text-transform: none;
} 