:root {
  --font-size: 2.5em; /* default text size */
}
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000; /* Changed to black for better dark theme */
  font-family: Arial, sans-serif;
  color: #fff;
  height: 100%;
}

/* Warp Speed Background Canvas */
#warp-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: black;
}

/* Landing Overlay (Demo Mode) */
#landing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

/* RSVP Display (Spritz Demo) */
#rsvp-container {
  font-size: var(--font-size);
  min-height: 3em;
  position: relative;
  margin-bottom: 20px;
}
.word-container {
  width: 100%;
  position: relative;
  height: 100%;
}
.left-part, .right-part {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}
.left-part {
  right: 50%;
  text-align: right;
  padding-right: 0.4em;
}
.right-part {
  left: 50%;
  text-align: left;
  padding-left: 0.4em;
}
.highlight {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ff3366;
  font-weight: bold;
}
.highlight::before,
.highlight::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background-color: #ff3366;
}
.highlight::before {
  bottom: 100%;
  margin-bottom: 0.6em;
  height: 1em;
}
.highlight::after {
  top: 100%;
  margin-top: 0.6em;
  height: 1em;
}

/* Live WPM Display */
#live-wpm {
  font-size: 1em;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.7); /* Consistent color */
}

/* Login Button */
#login-container {
  text-align: center;
  z-index: 20; /* Ensure button is on top */
}
#login-container button {
  margin: 10px;
  padding: 15px 30px;
  font-size: 1.5em;
  background: #00ff88;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  color: #000;
}

/* Curved Slider Guides with Text */
#size-slider {
  position: fixed;
  left: 10%;
  top: 20%;
  height: 60%;
  width: 2px;
  background: rgba(255, 255, 255, 0.5); /* Thin white line */
  border-radius: 50px; /* Curved ends */
  transform: rotate(30deg); /* Curved effect */
  z-index: 20;
}
#size-slider::before {
  content: "Size";
  position: absolute;
  top: 50%;
  left: -20px; /* Adjusted for closer alignment */
  transform: translateY(-50%) rotate(-90deg);
  color: rgba(255, 255, 255, 0.7); /* Consistent color */
  font-size: 0.8em;
  text-align: center;
}

#speed-slider {
  position: fixed;
  right: 10%;
  top: 20%;
  height: 60%;
  width: 2px;
  background: rgba(255, 255, 255, 0.5); /* Thin white line */
  border-radius: 50px; /* Curved ends */
  transform: rotate(-30deg); /* Curved effect */
  z-index: 20;
}
#speed-slider::before {
  content: "Speed";
  position: absolute;
  top: 50%;
  right: -30px;
  transform: translateY(-50%) rotate(90deg);
  color: rgba(255, 255, 255, 0.7); /* Consistent color */
  font-size: 0.8em;
  text-align: center;
}

/* Invisible Touch Zones */
#left-touch-zone, #right-touch-zone {
  position: fixed;
  top: 0;
  width: 50%; /* Cover half the page */
  height: 100%;
  z-index: 5;
}
#left-touch-zone {
  left: 0;
}
#right-touch-zone {
  right: 0;
}

/* Chat UI (After Login) */
#chat-ui {
  display: none; /* Hidden by default, shown after login */
}
#chat-btn {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1003;
  padding: 8px;
  background: #00ff88;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #1a1a1a;
  font-size: 20px;
}
#chat-panel {
  display: none; /* Hidden initially */
  position: fixed;
  top: 60px;
  left: 10px;
  right: 10px;
  background: #1a1a1a; /* Dark background for chat panel */
  border: 1px solid #333;
  border-radius: 4px;
  z-index: 1003;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  transition: all 0.3s ease;
}
#chat-panel.full-screen {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: none;
  border-radius: 0;
  padding: 20px;
  z-index: 2000;
}
#settings-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1003;
  padding: 8px 16px;
  background: #00ff88;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #1a1a1a;
  font-weight: bold;
}
#settings-menu {
  position: fixed;
  top: 50px;
  right: 10px;
  background: rgba(0, 0, 0, 0.95);
  padding: 10px;
  border-radius: 8px;
  z-index: 1004;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.control-group input[type="range"] {
  width: 120px;
}
#chat-rsvp-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 60px);
  padding-top: 120px;
  box-sizing: border-box;
}
#word-display {
  font-size: var(--font-size);
  min-height: 3em;
  position: relative;
}
#chat-wpm {
  margin-top: 5px;
  font-size: 1em;
}

/* --- Bottom Chat Controls Styling --- */
#controls {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #1a1a1a; /* Dark background for controls */
  padding: 10px;
  box-sizing: border-box;
  z-index: 1001;
}
#chat-controls {
  display: flex;
  gap: 10px;
  align-items: center; /* Vertically align items in chat controls */
}
#chat-controls input[type="text"] {
  flex: 1;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #555; /* Slightly lighter border for input */
  background: #2a2a2a; /* Darker background for input */
  color: #fff;
  font-size: 16px;
}
#chat-controls button {
  padding: 12px 16px; /* Adjusted padding to match input height */
  background: #00ff88;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: #1a1a1a;
  font-weight: bold;
  height: auto; /* Ensure button height adjusts to content */
}

/* Media Query for Mobile Screens */
@media (max-width: 768px) {
  #size-slider, #speed-slider {
    height: 40%; /* Shorter lines for mobile */
  }
}
