@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lato:wght@300;400&display=swap");

body {
  margin: 0;
  overflow: hidden;
  background-color: #f0f0f0;
  font-family: "Lato", sans-serif;
  color: #333;
  user-select: none;
  -webkit-touch-callout: none; /* iOS Safari */
}

#canvas-container {
  width: 100vw;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* UI Overlay */
#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* School Logo Watermark */
#school-logo {
  position: absolute;
  bottom: 30px;
  left: 30px;
  font-family: "Cinzel", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #4a90e2; /* Blue */
  text-shadow: 0 2px 10px rgba(74, 144, 226, 0.4);
  z-index: 20;
  pointer-events: none;
  opacity: 0.9;
}

/* Crosshair */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.2s, background 0.2s;
}

#crosshair.active {
  transform: translate(-50%, -50%) scale(1.5);
  background: #d4af37; /* Gold active state */
}

/* Start Screen */
#start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(250, 250, 250, 0.98);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  pointer-events: auto;
  text-align: center;
  color: #222;
  background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 20px;
  box-sizing: border-box;
}

h1 {
  font-family: "Cinzel", serif;
  font-size: clamp(1.8rem, 5vw, 3rem); /* Responsive font size */
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: #b8860b;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  text-decoration: underline; /* Regla fusionada del archivo adjunto */
}

h2 {
  font-family: "Lato", sans-serif;
  font-size: clamp(1rem, 3vw, 1.8rem);
  margin-top: 0;
  margin-bottom: 30px;
  color: #555;
  font-weight: 300;
  letter-spacing: 2px;
}

p.instructions {
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  margin-bottom: 40px;
  color: #444;
  max-width: 600px;
  line-height: 1.6;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn {
  padding: 15px 50px;
  font-size: 1.3rem;
  background: #b8860b;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: "Cinzel", serif;
  transition: all 0.3s;
  text-transform: uppercase;
  font-weight: bold;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(184, 134, 11, 0.3);
}

.btn:hover {
  background: #d4af37;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(184, 134, 11, 0.5);
}

/* 3D Speech Bubble */
#speech-bubble {
  position: absolute;
  background: white;
  padding: 20px;
  border-radius: 15px;
  border: 3px solid #b8860b;
  width: 300px;
  max-width: 90vw; /* Prevent overflow on mobile */
  display: none;
  pointer-events: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  /* Initial centering, updated by JS */
  transform: translate(-50%, -100%);
  margin-top: -20px;
  z-index: 100;
}

#speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%; /* JS will adjust if clamped */
  transform: translateX(-50%);
  border-width: 15px 15px 0;
  border-style: solid;
  border-color: #b8860b transparent transparent transparent;
}

.bubble-header {
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.bubble-title {
  font-family: "Cinzel", serif;
  color: #b8860b;
  font-size: 1.2rem;
  margin: 0;
}

.bubble-artist {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}

.bubble-content {
  font-size: 0.9rem;
  color: #444;
  max-height: 150px;
  overflow-y: auto;
  line-height: 1.4;
}

.close-bubble {
  position: absolute;
  top: 5px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
}
.close-bubble:hover {
  color: #b8860b;
}

#loading {
  position: absolute;
  bottom: 60px; /* Moved up to avoid overlap with logo */
  left: 30px;
  color: #777;
  font-size: 0.9rem;
  font-family: "Cinzel", serif;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  #speech-bubble {
    padding: 15px;
    width: 260px;
  }
  .bubble-content {
    max-height: 120px;
  }
  #school-logo {
    font-size: 2rem;
    bottom: 20px;
    left: 20px;
  }
}