/* ============================================
   WOBBLY LONDON — Styles
   ============================================
   This file controls how the page looks.
   The game canvas takes up the whole screen,
   and the UI elements float on top.
   ============================================ */

/* Make the page fill the whole screen with no scrollbars */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: white;
}

/* The 3D game canvas fills the entire window */
#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* ============================================
   NAME INPUT SCREEN
   (shown when you first load the game)
   ============================================ */

#nameScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#nameScreen h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(155, 89, 182, 0.5);
}

#nameScreen p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.8;
}

#nameInput {
  padding: 12px 24px;
  font-size: 1.3rem;
  border: 2px solid #9b59b6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-align: center;
  outline: none;
  width: 300px;
}

#nameInput::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

#nameInput:focus {
  border-color: #bb77d6;
  box-shadow: 0 0 15px rgba(155, 89, 182, 0.3);
}

#startButton {
  margin-top: 1.5rem;
  padding: 12px 40px;
  font-size: 1.2rem;
  border: none;
  border-radius: 8px;
  background: #9b59b6;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

#startButton:hover {
  background: #8e44ad;
}

/* ============================================
   HUD — Heads Up Display
   (the info shown during gameplay)
   ============================================ */

#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let clicks go through to the game */
  z-index: 10;
  display: none; /* Hidden until game starts */
}

/* Crosshair in the centre of the screen */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

/* Instructions shown at the top */
#instructions {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ============================================
   LANDMARKS PANEL
   (shows which landmarks you've discovered)
   ============================================ */

#landmarksPanel {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 10px;
  min-width: 220px;
  backdrop-filter: blur(5px);
}

#landmarksPanel h3 {
  margin-bottom: 10px;
  font-size: 1rem;
  color: #f1c40f;
}

.landmark-item {
  padding: 5px 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.landmark-item.discovered {
  color: #2ecc71;
}

.landmark-item.undiscovered {
  color: rgba(255, 255, 255, 0.4);
}

.landmark-icon {
  font-size: 1rem;
}

/* ============================================
   DISCOVERY POPUP
   (the big message when you find a landmark)
   ============================================ */

#discoveryPopup {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #f1c40f;
  padding: 30px 50px;
  border-radius: 15px;
  text-align: center;
  display: none;
  animation: popIn 0.5s ease-out;
}

#discoveryPopup h2 {
  color: #f1c40f;
  font-size: 1.8rem;
  margin-bottom: 8px;
}

#discoveryPopup p {
  color: white;
  font-size: 1.1rem;
}

@keyframes popIn {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ============================================
   CHAT
   ============================================ */

#chatContainer {
  position: absolute;
  bottom: 15px;
  left: 15px;
  width: 350px;
  pointer-events: auto; /* Chat needs to receive clicks */
}

#chatMessages {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 8px;
  scrollbar-width: thin;
}

.chat-message {
  background: rgba(0, 0, 0, 0.6);
  padding: 5px 10px;
  border-radius: 5px;
  margin-bottom: 3px;
  font-size: 0.85rem;
  word-wrap: break-word;
}

.chat-message .chat-name {
  font-weight: bold;
  margin-right: 6px;
}

.chat-message.system {
  color: #f1c40f;
  font-style: italic;
}

#chatInput {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.9rem;
  outline: none;
  display: none; /* Hidden until Enter is pressed */
}

#chatInput:focus {
  border-color: #9b59b6;
}

/* ============================================
   PLAYER COUNT
   ============================================ */

#playerCount {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* ============================================
   VEHICLE PROMPT
   (the "Press E" message near vehicles)
   ============================================ */

#vehiclePrompt {
  position: absolute;
  bottom: 25%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 1rem;
  display: none;
  text-align: center;
}

/* ============================================
   TUBE MENU
   (destination picker for tube stations)
   ============================================ */

#tubeMenu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 30, 0.92);
  border: 2px solid #CC0000;
  padding: 25px 35px;
  border-radius: 12px;
  text-align: center;
  display: none;
  pointer-events: auto;
  z-index: 20;
}

#tubeMenu h3 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.tube-dest-btn {
  display: block;
  width: 100%;
  padding: 10px 20px;
  margin-bottom: 8px;
  background: #000088;
  color: white;
  border: 1px solid #CC0000;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.tube-dest-btn:hover {
  background: #CC0000;
}

#tubeCancel {
  margin-top: 8px;
  padding: 8px 20px;
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

#tubeCancel:hover {
  color: white;
  border-color: white;
}

/* ============================================
   TUBE TRAVEL OVERLAY
   (dark screen while travelling underground)
   ============================================ */

#tubeOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a1a;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
}

#tubeOverlayInner {
  text-align: center;
}

#tubeOverlayLogo {
  font-size: 2.5rem;
  font-weight: bold;
  color: #CC0000;
  letter-spacing: 6px;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(204, 0, 0, 0.4);
}

#tubeOverlayText {
  font-size: 1.3rem;
  color: #aaa;
  animation: tubePulse 1s ease-in-out infinite;
}

@keyframes tubePulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
