/* === GLOBAL RESET === */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Georgia', serif;
  background: linear-gradient(to right, #fceabb, #f8b500);
}

/* === START SCREEN === */
.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  text-align: center;
}

button {
  padding: 15px 30px;
  font-size: 20px;
  background-color: #fff176;
  border: none;
  border-radius: 10px;
  box-shadow: 3px 3px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.3s;
  font-family: 'Georgia', serif;
}

button:hover {
  transform: scale(1.05);
  background-color: #ffee58;
}

#loadingBar {
  width: 0;
  height: 10px;
  background-color: #4caf50;
  margin-top: 20px;
  transition: width 3s;
}

#message {
  margin-top: 20px;
  font-size: 18px;
  color: #444;
}

/* === GLITCH BACKGROUND EFFECT === */
#glitchBackground {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  background: #000;
  mix-blend-mode: screen;
}

#glitchBackground::before,
#glitchBackground::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

#glitchBackground::before {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.05) 2px,
    rgba(255,255,255,0.05) 4px
  );
  animation: glitchLines 0.3s infinite;
}

#glitchBackground::after {
  background: linear-gradient(
    rgba(255, 0, 0, 0.05),
    rgba(0, 255, 255, 0.05)
  );
  mix-blend-mode: difference;
  animation: glitchRGB 0.3s infinite;
}

@keyframes glitchLines {
  0% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
  100% { transform: translateY(1px); }
}

@keyframes glitchRGB {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2px, 2px); }
  50%  { transform: translate(2px, -2px); }
  75%  { transform: translate(-1px, 1px); }
  100% { transform: translate(0, 0); }
}

@keyframes glitchFade {
  0%   { opacity: 0; }
  10%  { opacity: 0.5; }
  50%  { opacity: 0.7; transform: scale(1.01); }
  90%  { opacity: 0.3; }
  100% { opacity: 0; transform: scale(1); }
}

/* === RESULT SCREEN === */
#happyZone {
  position: absolute;
  inset: 0;
  background: #fffde7;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  animation: fadeIn 1s ease;
  padding: 20px;
  overflow: hidden;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

#happyZone > p {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: bold;
  margin-bottom: 30px;
  color: #e53935;
  font-family: 'Georgia', serif;
  text-align: center;
}

/* === POLAROID STYLE === */
.gallery {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
}

.polaroid {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  width: 90vw;
  max-width: 420px;
  text-align: center;
  overflow: hidden;
}

.polaroid img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
}

.polaroid p {
  margin-top: 15px;
  font-style: italic;
  font-size: clamp(16px, 2vw, 20px);
  color: #444;
  font-family: 'Georgia', serif;
}

/* === FADE SCREEN === */
#fadeScreen {
  position: fixed;
  inset: 0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  font-size: 24px;
  font-weight: bold;
  z-index: 999;
}

#fadeScreen.show {
  opacity: 1;
}

/* === FOOTER === */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 10px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 2000;
}

footer a {
  color: #444;
  text-decoration: none;
  transition: transform 0.2s, color 0.2s;
}

footer a:hover {
  transform: scale(1.2);
  color: #e53935;
}

footer svg {
  width: 24px;
  height: 24px;
}