:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --accent: #9EFF00;
  --canvas-border: #9EFF00;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  transition: background-color 0.3s, color 0.3s;
  line-height: 1.6;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5em;
  padding: 2em;
  max-width: 800px;
  width: 100%;
  box-sizing: border-box;
}

.page h1 {
  font-family: 'Patrick Hand', cursive;
  font-size: 3rem;
  margin-bottom: 0.2em;
}

.page h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  margin-top: 0;
  color: var(--text-color);
}

.hidden {
  display: none;
}

.btn-group {
  display: flex;
  gap: 1em;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-group button,
button {
  font-family: 'Poppins', sans-serif;
  background-color: var(--accent);
  color: black;
  border: none;
  border-radius: var(--radius);
  padding: 0.6em 1.6em;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.btn-group button:hover,
button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.canvas-buttons {
  font-family: 'Poppins', sans-serif;
  display: flex;
  gap: 0.8em;
  justify-content: center;
  flex-wrap: wrap;
  margin: 8px 0 4px 0;
}

canvas {
  border: 2px solid var(--canvas-border);
  margin: 0.5em 0 0.5em 0;
  max-width: 85vw;
  max-height: 75vh;
  touch-action: none;
  background-color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#drawingCanvas {
  border: 3px solid #9EFF00;
  border-radius: 16px;
  display: block;
  margin: 0 auto;
}

body.dark {
  --bg-color: #1e1e1e;
  --text-color: #eeeeee;
}

body.dark canvas {
  background-color: #1e1e1e;
}

#darkModeToggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 67px;
  height: 32px;
  background-color: #ccc;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background-color 0.3s ease;
  z-index: 1000;
}

#darkModeToggle .icon {
  font-size: 1.1em;
  color: #333;
  z-index: 2;
}

#darkModeToggle .circle {
  width: 25px;
  height: 25px;
  background-color: #f0f0f0;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  left: 4px;
  transition: transform 0.3s ease, background-color 0.3s ease;
  z-index: 1;
}

body.dark #darkModeToggle {
  background-color: #444;
}

body.dark #darkModeToggle .icon {
  color: #ffffff;
}

body.dark #darkModeToggle .circle {
  background-color: #1e1e1e;
  transform: translateX(32px);
}

.modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1em;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 2em;
  border-radius: var(--radius);
  text-align: center;
  min-width: 250px;
  max-width: 90vw;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal-content h2 {
  margin-top: 0;
  font-size: 1.4rem;
  font-weight: 500;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--text-color);
  cursor: pointer;
}

#class-info {
  margin-top: 4px;
  text-align: center;
  max-width: 1500px;
  padding: 0.5em 1em;
}

#class-info p {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 1em;
  margin-top: 0.75em;
  color: var(--text-color);
}

.doodle-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2.5em;
  justify-items: center;
  margin-top: 2em;
}

.doodle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1em;
}

.doodle-item img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 0.5em;
  border-radius: 8px;
  padding: 0.4em;
  background-color: var(--bg-color);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.8s ease-in-out;
}

.doodle-item img:hover {
  transform: scale(1.1);
}

body.dark .doodle-item img {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.doodle-item img,
.doodle-track img {
  transition: opacity 0.3s ease;
}

.doodle-item img.fading,
.doodle-track img.fading {
  opacity: 0;
}


#classNote {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.doodle-strip {
  position: fixed;
  width: 100%;
  height: 50px;
  overflow: hidden;
  z-index: 1000;
  background: transparent;
  pointer-events: none;
  left: 0;
  margin-top: 5px;  
  margin-bottom: 12px;
}

.top-strip {
  top: 0;
}

.bottom-strip {
  bottom: 0;
}

.doodle-track {
  display: flex;
  gap: 1.2em;
  width: max-content;
  animation: scroll-left 12s linear infinite;
}

.doodle-track.reverse {
  animation: scroll-right 12s linear infinite;
}

.doodle-track img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  border-radius: 6px;
  background: transparent;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-20%);
  }
}

@keyframes scroll-right {
  0% {
    transform: translateX(-20%);
  }

  100% {
    transform: translateX(0);
  }
}

.about-image {
  margin-top: 0.5rem;
}

.about-heading {
  font-size: 2.2rem;
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
  font-family: 'Patrick Hand', cursive;
  color: var(--text-color);
}

.about-description {
  max-width: 600px;
  font-size: 1.05rem;
  color: var(--text-color);
  line-height: 1.4;
  margin-top: 0.1rem;
  margin-bottom: 0.4rem;
}

.connect-buttons {
  margin-top: 0.4rem;
  gap: 0.6em;
}

.connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: 'Poppins', sans-serif;
  background-color: var(--accent);
  color: black;
  border: none;
  border-radius: var(--radius);
  padding: 0.5em 1.3em;
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.connect-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  text-decoration: none;
}

.connect-btn i {
  font-size: 1rem;
}

.name-gif {
  height: 4rem;
  vertical-align: middle;
  margin-left: 0.3rem;
  transition: opacity 0.3s ease;
}

#thankCandyBtn {
  margin-top: 1em;
  font-family: 'Poppins', sans-serif;
  background-color: var(--accent);
  color: black;
  border: none;
  border-radius: var(--radius);
  padding: 0.6em 1.6em;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

#thankCandyBtn:hover {
  transform: scale(1.05);
}

.candy-text {
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.candy-emoji {
  font-size: 5rem;
  margin-bottom: 1rem;
}

.confetti-canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: 100 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

@media (max-width: 768px) {
  .page {
    padding: 2em;
  }

  .page h1 {
    font-size: 2.6rem;
  }

  .doodle-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5em;
  }

  canvas {
    margin: 7em 0 1em 0 !important; 
  }

  .doodle-item img {
    width: 70px;
    height: 70px;
  }

  #darkModeToggle {
    bottom: 16px;
    right: 16px;
  }

  .about-heading {
    font-size: 1.7rem;
  }

  .about-description {
    font-size: 1rem;
  }
  
  .confetti-canvas {
    top: 80px !important;       
    left: 20px !important;      
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 80px) !important;
  }
}