/* ==========================================
   THE FROZEN CLOCK - ELEGANT WINTER STYLING
   For children aged 5-7 years
   ========================================== */

/* IMPORT ELEGANT FONTS */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&family=Fredoka:wght@400;600;700&display=swap');

/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Fredoka', 'Quicksand', sans-serif;
  background: linear-gradient(135deg, #0a1628 0%, #1b3a5c 50%, #2d5a7b 100%);
  color: #ffffff;
  text-align: center;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* ANIMATED SNOWFLAKES BACKGROUND */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(2px 2px at 170px 80px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 130px 20px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 70px 120px, rgba(255, 255, 255, 0.5), transparent);
  background-size: 200px 200px;
  animation: snowfall 20s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes snowfall {
  0% {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
  }

  100% {
    background-position: 0 200px, 0 200px, 0 200px, 0 200px, 0 200px, 0 200px;
  }
}

/* APP CONTAINER */
#app {
  max-width: 1300px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 40px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 60px rgba(168, 216, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(168, 216, 255, 0.2);
  position: relative;
  z-index: 2;
}

/* SCREEN TRANSITIONS */
.screen {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* TYPOGRAPHY */
h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 25px;
  text-shadow:
    0 2px 10px rgba(168, 216, 255, 0.6),
    0 4px 20px rgba(0, 0, 0, 0.4),
    2px 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #ffffff 0%, #b8e6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #e0f4ff;
  text-shadow:
    0 2px 8px rgba(168, 216, 255, 0.5),
    1px 1px 3px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.5px;
}

p {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.3rem;
  line-height: 1.7;
  margin-bottom: 15px;
  font-weight: 500;
}

.story {
  font-size: 1.5rem;
  line-height: 1.9;
  margin: 25px 0 35px;
  padding: 25px;
  background: linear-gradient(135deg, rgba(168, 216, 255, 0.12), rgba(255, 255, 255, 0.08));
  border-radius: 20px;
  border: 2px solid rgba(168, 216, 255, 0.3);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.instructions {
  font-size: 1.35rem;
  line-height: 1.9;
  margin: 20px 0;
  padding: 20px 25px;
  background: linear-gradient(135deg, rgba(168, 216, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-radius: 18px;
  font-weight: 500;
  border: 1px solid rgba(168, 216, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* TASK HEADER */
.task-header {
  margin-bottom: 20px;
}

.task-number {
  display: inline-block;
  background: linear-gradient(135deg, rgba(168, 216, 255, 0.25), rgba(168, 216, 255, 0.15));
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #c8e8ff;
  border: 2px solid rgba(168, 216, 255, 0.4);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-family: 'Fredoka', sans-serif;
  letter-spacing: 0.5px;
}

/* TASK IMAGE */
.task-image {
  margin: 25px auto;
  max-width: none !important;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(168, 216, 255, 0.2);
  border: 3px solid rgba(168, 216, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.task-image img {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: auto;
  transition: transform 0.3s ease;
}

.task-image:hover img {
  transform: scale(1.02);
}

/* BUTTONS */
button {
  font-family: 'Fredoka', sans-serif;
  background: linear-gradient(135deg, #3d8fd1 0%, #2563a8 100%);
  color: white;
  border: none;
  padding: 16px 40px;
  font-size: 1.45rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  margin: 18px 8px;
  box-shadow:
    0 6px 20px rgba(74, 144, 226, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 20px rgba(74, 144, 226, 0.2);
  transition: all 0.3s ease;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(168, 216, 255, 0.3);
  letter-spacing: 0.5px;
}

button:hover {
  background: linear-gradient(135deg, #4a9de6 0%, #2e75c4 100%);
  transform: translateY(-3px);
  box-shadow:
    0 8px 25px rgba(74, 144, 226, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 30px rgba(74, 144, 226, 0.3);
}

button:active {
  transform: translateY(-1px);
  box-shadow:
    0 4px 15px rgba(74, 144, 226, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* INPUT FIELDS */
input {
  width: 100%;
  max-width: 320px;
  padding: 18px 25px;
  font-size: 1.6rem;
  font-family: 'Fredoka', sans-serif;
  border: 3px solid rgba(168, 216, 255, 0.5);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 250, 255, 0.95));
  color: #0b1c2d;
  text-align: center;
  margin: 20px auto;
  display: block;
  font-weight: 600;
  box-shadow:
    0 6px 15px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(168, 216, 255, 0.2);
  transition: all 0.4s ease;
  letter-spacing: 1px;
}

input:focus {
  outline: none;
  border-color: #80c8ff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(230, 245, 255, 1));
  box-shadow:
    0 6px 20px rgba(168, 216, 255, 0.6),
    0 0 30px rgba(168, 216, 255, 0.3),
    inset 0 2px 6px rgba(168, 216, 255, 0.3);
  transform: scale(1.05);
}

input::placeholder {
  color: #7095b8;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ERROR MESSAGES */
.error {
  color: #ffb3b3;
  font-size: 1.2rem;
  font-weight: bold;
  margin-top: 10px;
  min-height: 30px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* VIDEO CONTAINER */
.video-container {
  margin: 25px auto;
  max-width: 550px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 0 50px rgba(168, 216, 255, 0.2);
  border: 3px solid rgba(168, 216, 255, 0.4);
  background: rgba(0, 0, 0, 0.2);
}

video {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(1.05) contrast(1.05);
}

/* SUCCESS SCREEN */
.success-animation {
  animation: celebrate 1s ease-in-out;
}

@keyframes celebrate {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.big-emoji {
  font-size: 6rem;
  margin: 25px 0;
  animation: spin 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

@keyframes spin {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-10deg);
  }

  75% {
    transform: rotate(10deg);
  }
}

.celebration {
  font-size: 1.6rem;
  line-height: 2;
  margin: 25px 0;
  padding: 30px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(168, 216, 255, 0.15));
  border-radius: 25px;
  border: 3px solid rgba(255, 215, 0, 0.4);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    0 0 40px rgba(255, 215, 0, 0.2);
}

.celebration strong {
  font-size: 2.3rem;
  font-family: 'Fredoka', sans-serif;
  color: #ffd700;
  text-shadow:
    0 0 15px rgba(255, 215, 0, 0.8),
    2px 2px 6px rgba(0, 0, 0, 0.5);
  letter-spacing: 1px;
}
