/* assets/css/style.css */

/* --- GENERAL BODY STYLES --- */
body {
  background: url('../images/background.webp') no-repeat center center fixed;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  font-family: 'Georgia', serif;
}

/* --- LOGIN PAGE STYLES --- */
body.login-page {
  position: relative;
  padding: 2rem;
  color: #f8e4c2;
}

body.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 5, 2, 0.7), rgba(70, 45, 20, 0.55));
  backdrop-filter: blur(2px);
  z-index: 0;
}

.login-wrapper {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 2.5rem 2rem;
  background: rgba(25, 18, 10, 0.82);
  border: 2px solid #d4a373;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

.login-title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: 0.04em;
}

.login-subtitle {
  margin: 0 0 2rem;
  color: #e0cfa5;
  font-size: 1rem;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-input {
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 163, 115, 0.4);
  background: rgba(12, 8, 4, 0.75);
  color: #f8e4c2;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input::placeholder {
  color: rgba(248, 228, 194, 0.65);
}

.login-input:focus {
  outline: none;
  border-color: #f2c97d;
  box-shadow: 0 0 0 3px rgba(242, 201, 125, 0.25);
}

.login-button {
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #d4a373, #f2c97d);
  color: #2c1608;
  font-weight: bold;
  font-size: 1rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-button:hover,
.login-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.login-button:focus-visible {
  outline: 3px solid rgba(242, 201, 125, 0.55);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 600px) {
  body.login-page {
    padding: 1.5rem;
  }

  .login-wrapper {
    padding: 2rem 1.5rem;
  }
}

/* --- INDEX.HTML LANDING PAGE STYLES --- */
body.landing {
    background-color: black;
}

.landing-container {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* Styles for both landing images */
.landing-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(1);
  animation: slowZoom 35s ease forwards;
}

/* Hide mobile image by default */
.mobile-image {
  display: none;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.25);
  opacity: 0;
  animation: fadeIn 3s ease-in-out forwards;
  animation-delay: 1.5s;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.overlay-button {
  position: absolute;
  width: 20%; 
  max-width: 180px;
  height: auto;
  object-fit: contain;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.overlay-button:hover {
  transform: scale(1.1);
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes slowZoom { to { transform: scale(1.1); } }


/* --- TOWN/GAME PAGE STYLES --- */
#borderWrapper {
  position: relative;
  display: inline-block;
}

#mapBorder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 975px;
  height: 670px;
  pointer-events: none;
  z-index: 10;
}

#game {
  position: relative;
  width: 900px;
  height: 600px;
  overflow: hidden;
  margin: 0 auto;
}

#scene {
  width: 100%;
  height: 100%;
  display: block;
}

#fadeOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  opacity: 0;
  pointer-events: none;
  z-index: 5000;
  transition: opacity 0.2s ease;
}

.hotspot {
  position: absolute;
  width: 80px;
  height: 80px;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

.hotspot:hover {
  transform: scale(1.1);
  background: radial-gradient(circle,
    rgba(236, 236, 113, 0.5) 0%,
    rgba(255, 255, 200, 0.0) 80%
  );
  mix-blend-mode: screen;
  transition: transform 0.2s ease, background 0.2s ease;
}

/* Tooltip label */
.hotspot::after {
  content: attr(data-label);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.hotspot:hover::after {
  opacity: 1;
}

/* Unified Dialogue Box */
#dialogueBox {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  background: rgba(50, 30, 10, 0.85);
  border: 3px solid #d4a373;
  border-radius: 12px;
  padding: 20px;
  color: #f8e4c2;
  font-family: 'Georgia', serif;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  animation: fadeIn 0.3s ease;
  cursor: pointer;
}

#dialogueBox.hidden {
  display: none;
}

#closeDialogue {
  position: absolute;
  top: 8px;
  right: 12px;
  color: #f8e4c2;
  font-weight: bold;
  cursor: pointer;
}

#backButtonContainer {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.back-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.back-button img {
    width: 50px;
    height: 50px;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.back-button img:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* --- RESPONSIVE IMAGE SWAPPING --- */
@media (max-width: 768px) {
  /* Hide the desktop image on mobile screens */
  .desktop-image {
    display: none;
  }
  /* Show the mobile image on mobile screens */
  .mobile-image {
    display: block;
  }
}