/* Import fonts from Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Delius&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Delius+Swash+Caps&family=Rubik+Bubbles&family=Rubik+Burned&family=Rubik+Doodle+Shadow&family=Rubik+Moonrocks&display=swap");

:root {
  --lilac: #dcb4f5;
  --pastel-pink: #ffc8dd;
  --pastel-green: #c8facc;
  --pastel-blue: #def3fd;
  --pastel-yellow: #fcf7de;
  --text-dark: #3a3737;
  --outline: #750000;
}

* {
  font-family: "Delius", cursive;
}

body {
  margin: 0;
  background: var(--pastel-green);
}

.start-screen {
  position: absolute;
  top: 20%;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* Game title with bold and emoji */
.game-title {
  font-size: 4rem;
  font-weight: bold;
  color: var(--text-dark);
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
}

.game-subtitle {
  font-size: 1.5rem;
  font-family: "Delius", cursive;
  color: var(--text-dark);
  margin-top: -10px;
}

/* Level buttons container */
.levels-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Main start buttons */
.start-btn {
  font-family: "Rubik Doodle Shadow", cursive;
  font-size: 2rem;
  padding: 16px 32px;
  border: 2px solid var(--text-dark);
  border-radius: 14px;
  cursor: pointer;
  background: var(--lilac);
  color: var(--text-dark);
  font-weight: bold;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.start-btn:hover {
  background: var(--pastel-green);
  transform: translateY(-2px);
  box-shadow: none;
}

.start-btn:active {
  transform: translateY(1px);
  background: var(--lilac);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Smaller credits button */
.credits-btn {
  margin-top: 20px;
  font-size: 1.5rem;
  padding: 10px 24px;
}

/* Credits Page Styles */
.credits-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  background: var(--pastel-pink);
  padding: 40px 20px;
  box-sizing: border-box;
}

.credits-title {
  text-align: center;
  font-size: 4rem;
  color: var(--text-dark);
  margin: 20px 0 10px 0;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
}

.credits-subtitle {
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-dark);
  margin: 0 0 40px 0;
  font-family: "Delius", cursive;
}

.credits-content {
  max-width: 900px;
  margin: 0 auto;
  background: var(--text-dark);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.credits-section {
  margin-bottom: 40px;
  padding: 20px 30px;
  background: #fff; /* semi-transparent white */
  border: 3px dashed #2b2b2b; /* sketchy dashed border */
  box-shadow: 5px 5px 0px #2b2b2b; /* 3D lifted effect */
  transform: rotate(-1deg); /* subtle tilt */
  border-radius: 12px;
}

.attribution {
  background: var(--pastel-pink);
  border: 3px dashed #2b2b2b;
  box-shadow: 4px 4px 0px #2b2b2b;
  transform: rotate(1deg);
  padding: 15px 20px;
  margin: 15px 0;
  border-radius: 10px;
}

.attribution p {
  margin: 5px 0;
  font-size: 1rem;
}

.attribution a {
  color: #2b2b2b;
  text-decoration: none;
  font-weight: bold;
}

.attribution a:hover {
  color: #3a3737;
}

.credits-section h2 {
  font-size: 2.2rem;
  color: var(--text-dark);
  margin-bottom: 15px;
  border-bottom: 3px solid var(--lilac);
  padding-bottom: 10px;
}

.credits-section p {
  font-size: 1.2rem;
  color: var(--text-dark);
  margin: 8px 0;
  font-family: "Delius", cursive;
  line-height: 1.6;
}

/* .attribution {
  background: var(--pastel-pink);
  border-left: 5px solid var(--outline);
  padding: 15px 20px;
  margin: 15px 0;
  border-radius: 10px;
}

.attribution p {
  margin: 5px 0;
  font-size: 1rem;
}

.attribution a {
  color: var(--outline);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
} */

.attribution a:hover {
  color: #3a3737;
}

.thank-you {
  text-align: center;
  background: var(--lilac);
  padding: 30px;
  border-radius: 15px;
  margin-top: 50px;
}

.thank-you h2 {
  border: none;
  margin-bottom: 10px;
}

.thank-you p {
  font-size: 1.5rem;
}

.credits-back-btn {
  display: block;
  margin: 30px auto 40px auto;
  font-size: 2rem;
  padding: 15px 40px;
  border: 2px solid var(--text-dark);
  border-radius: 14px;
  cursor: pointer;
  background: var(--lilac);
  color: var(--text-dark);
  font-weight: bold;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.credits-back-btn:hover {
  background: var(--pastel-pink);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.credits-back-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Color Palette Styles */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
}

.color-swatch {
  text-align: center;
  flex: 0 0 auto;
}

.swatch {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  border: 3px solid var(--text-dark);
  margin: 0 auto 10px auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.swatch:hover {
  transform: scale(1.1);
}

.color-swatch p {
  font-size: 0.9rem;
  margin: 0;
  font-family: "Delius", cursive;
}

.conservation-message {
  font-size: 1.1rem;
  font-style: italic;
  margin-top: 10px;
}

/* ===== STORYLINE/PRELUDE STYLES ===== */
/* Common styles for intro comics and storyline bubbles across all levels */

/* Full-screen comic overlay */
.comic-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  cursor: pointer;
}

/* Comic image */
.comic-image {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Continue text below comic */
.comic-continue-text {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 1.2rem;
  font-family: "Delius", cursive;
  font-style: italic;
  opacity: 0.8;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Story overlay background (dark) */
.story-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  cursor: pointer;
}

/* Bubble container (centers content) */
.bubble-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 20px;
}

/* Main story bubble */
.story-bubble {
  background: #ffffffee;
  border: 4px dashed #2b2b2b;
  border-radius: 20px;
  padding: 30px 40px;
  max-width: 600px;
  text-align: center;
  box-shadow: 8px 8px 0px #2b2b2b;
  font-family: "Delius", cursive;
  color: #2b2b2b;
  position: relative;
  transform: scale(0) rotate(-1deg);
  transition: transform 0.3s ease-out;
}

.story-bubble.show {
  transform: scale(1) rotate(-1deg);
}

/* Bubble title */
.bubble-title {
  margin: 0 0 20px 0;
  font-size: 2rem;
  color: #2b2b2b;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Bubble text content */
.bubble-text {
  margin: 0 0 20px 0;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #2b2b2b;
}

/* Instructions container within bubble */
.bubble-instructions {
  text-align: left;
  margin-top: 20px;
  padding: 15px;
  background: #f0f8ff;
  border-radius: 10px;
  border: 2px solid #dcb4f5;
}

/* Instructions title */
.instructions-title {
  margin: 0 0 15px 0;
  font-size: 1.3rem;
  color: #2b2b2b;
  font-weight: bold;
}

/* Individual instruction item */
.instruction-item {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 5px;
  color: #2b2b2b;
  font-weight: 500;
}

/* Keyboard key button (for controls like W, A, S, D, Shift, etc.) */
.key-button {
  display: inline-block;
  padding: 4px 10px;
  margin: 0 3px;
  background: var(--lilac);
  color: #2b2b2b;
  border: 2px solid var(--text-dark);
  border-radius: 6px;
  box-shadow: 3px 3px 0px var(--pastel-pink);
  font-family: "Delius", cursive;
  font-weight: bold;
  font-size: 0.95rem;
  text-transform: uppercase;
}

/* Click to continue hint */
.continue-hint {
  color: white;
  font-size: 1rem;
  margin-top: 20px;
  font-family: "Delius", cursive;
  opacity: 0.8;
}

.continue-hint.final {
  color: #4caf50;
  font-size: 1.1rem;
  font-weight: bold;
}

/* Page counter */
.page-counter {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 0.9rem;
  color: #666;
  font-family: "Delius", cursive;
}

/* Skip story button */
.skip-story-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
  border-radius: 5px;
  cursor: pointer;
  font-family: "Delius", cursive;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.skip-story-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Help button (question mark) */
.help-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #2b2b2b;
  background: #dcb4f5;
  color: #2b2b2b;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 2px 2px 0px #c8facc;
  font-family: "Delius", cursive;
  z-index: 10000;
}

/* Instruction bubble (initial tooltip) */
.instruction-bubble {
  position: fixed;
  top: 20px;
  left: 90px;
  transform: rotate(-2deg);
  padding: 18px 24px;
  background: #ffffffee;
  border: 3px dashed #2b2b2b;
  border-radius: 18px;
  box-shadow: 7px 7px 0px #2b2b2b;
  font-family: "Delius", cursive;
  color: #2b2b2b;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  max-width: 360px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 10000;
  display: none;
}

.instruction-bubble.show {
  display: block;
  opacity: 1;
}

/* Instruction bubble heading */
.instruction-bubble-heading {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

/* Instruction bubble messages */
.instruction-bubble-message {
  margin-top: 6px;
}

.instruction-bubble-message.bold {
  font-weight: bold;
}
