* {
  box-sizing: border-box;
}

/* ---------- BASE ---------- */

body {
  margin: 0;
  font-family: "Playfair Display", serif;
  background: #ffffff;
  color: #111;
  overflow: hidden;
  transition: background 0.6s ease, color 0.6s ease;
}

/* ---------- BACKGROUND VIDEO ---------- */

#bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

/* When a scene is active, JS can add this class */
body.has-video {
  background: #000;
  color: #fff;
}

body.has-video #bg-video {
  opacity: 1;
}

/* ---------- CLOCK ---------- */

#clock {
  position: fixed;
  top: 122px;
  left: 50%;
  transform: translateX(-50%);
  font-family: Arial, sans-serif;
  font-size: 1.5rem;
  text-transform: uppercase;
  color: #999999;
  opacity: 0.9;
  transition: color 0.6s ease;
}

#reading-note {
  position: fixed;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  font-family: Georgia, serif;
  font-size: .8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #999999;
  opacity: 0.85;
  transition: color 0.6s ease;
  font-weight: normal;
}

/* ---------- MENU ---------- */

#menu {
  position: fixed;
  top: 235px;
  left: 50%;
  transform: translateX(-50%);
}

/* Dropdown */
#room-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background: transparent;
  border: 1px solid #f2f2f2;
  padding: 10px;

  font-family: Tahoma, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #999999;
  font-weight: 300;

  cursor: pointer;
  outline: none;

  /* center the text */
  text-align: center;
  text-align-last: center; /* Firefox */
  -moz-text-align-last: center; /* Firefox old */
  -webkit-text-align-last: center; /* Safari/Chrome */

  transition: color 0.6s ease, border-color 0.6s ease;
}

/* Remove arrow in IE / old Edge */
#room-select::-ms-expand {
  display: none;
}

/* Options */
#room-select option {
  background: #ffffff;
  color: #111111;
  font-family: Tahoma, sans-serif;
  letter-spacing: 1px;
}

/* White text when a scene is active */
body.has-video #room-select {
  color: #ffffff;
  border-color: #ffffff;
}

/* ---------- VIDEO OPTION BUTTONS ---------- */

#video-options {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.video-dot input {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}


.video-dot input:checked {
  background: rgba(255, 255, 255, 0.55);
  border-color: #ffffff;
}



/* ---------- READERS DISPLAY ---------- */
#readers-display {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #999999;
  z-index: 10;
  padding-left: 10px;
}

body.has-video #readers-display {
  color: #ffffff;
}

#reader-circles {
  display: flex;
  align-items: center;
  gap: 6px;
  order: 0; /* comes first */
  margin-right: 6px;
}

#readers-count {
  order: 1; /* comes after circles */
}

.reader-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  border: 1px solid #ffffff;
  transition: border-color 0.6s ease;
}


.reader-circle:hover::after {
  content: attr(title);
  position: absolute;
  top: 100%;
  left: 100%;
  transform: translate(8px, 8px);

  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.6);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;

  font-family: Arial, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;

  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
}

body.has-video .reader-circle:hover::after {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
}


/* ---------- READING FORM ---------- */
#reading-form {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

#reading-form #book-title {
  font-family: Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #999999;
  border: none;
  background: transparent;
  outline: none;
  padding: 6px 8px;
  flex: 1;
  min-width: 230px; /* ensures placeholder is visible */
  font-size: 0.8rem;
  transition: color 0.6s ease;
  box-sizing: border-box;
}

#reading-form #book-title:focus::placeholder {
  color: transparent;
}

body.has-video #reading-form #book-title {
  color: #ffffff;
}

#reading-form #book-title::placeholder {
  color: #999999;
  transition: color 0.6s ease;
}

body.has-video #reading-form #book-title::placeholder {
  color: #ffffff;
}

/* ---------- COLOR PICKER (circle) ---------- */
#reading-form #reader-color {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #ffffff;
  padding: 0;
  cursor: pointer;
  background: none;
  transition: border-color 0.6s ease;
}

/* Chrome/Safari/Edge */
#reading-form #reader-color::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

#reading-form #reader-color::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

/* Firefox */
#reading-form #reader-color::-moz-color-swatch {
  border-radius: 50%;
  border: none;
}

/* border color turns white when a scene is active */
body.has-video #reading-form #reader-color {
  border-color: #ffffff;
}

/* ---------- COLOR PICKER TOOLTIP ---------- */

#reading-form #reader-color {
  position: relative;
}

/* tooltip */
#reading-form #reader-color::after {
  content: "SET YOUR COLOR";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);

  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.6);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;

  font-family: Arial, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;

  white-space: nowrap;
  pointer-events: none;

  opacity: 0;
  transition: opacity 0.15s ease;
}

/* show immediately on hover */
#reading-form #reader-color:hover::after {
  opacity: 1;
}

body.has-video #reading-form #reader-color::after {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Book input */
#book-title {
  font-family: Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #999999;
  border: none;
  background: transparent;
  outline: none;
  padding: 6px 8px;
  flex: 1;
  font-size: 0.8rem;
  box-sizing: border-box;
}

/* SET button */
#reading-form button {
  border: 1px solid #f2f2f2;
  background: transparent;
  border-radius: 16px;
  padding: 6px 12px;
  text-transform: uppercase;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  color: #999999;
  cursor: pointer;
  transition: all 0.3s ease, color 0.6s ease, border-color 0.6s ease;
}

body.has-video #reading-form button {
  color: #ffffff;
  border-color: #ffffff;
}

#reading-form button:hover {
  background: #999999;
  color: #fff;
}


/* ---------- SOUND PANEL (GLASS) ---------- */

#panel-wrap {
  position: fixed;
  right: 24px;
  top: 50%;
  width: 230px;
}

#sound-panel {
  transform: translateY(-50%);
  width: 100%;
  padding: 18px;
  border-radius: 14px;

  opacity: 0;
  pointer-events: none;

  transition:
    opacity 0.6s ease,
    background 0.6s ease,
    border-color 0.6s ease,
    color 0.6s ease;
}

/* Visible only when a room is active */
body.has-video #sound-panel {
  opacity: 1;
  pointer-events: auto;

  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

#sound-panel h3 {
  margin: 0 0 25px;
  font-weight: normal;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

/* ---------- SOUND CONTROLS ---------- */

.sound-control {
  margin-bottom: 20px;
}

.sound-control label {
  display: block;
  font-family: Arial, sans-serif;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 8px;
  opacity: 0.85;
}

.sound-control input[type="range"] {
  width: 100%;
  appearance: none;
  height: 2px;
  background: rgba(255, 255, 255, 0.45);
  outline: none;
}

.sound-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(255,255,255,0.8);
  cursor: pointer;
}
body.has-video #clock,
body.has-video #reading-note {
  color: #ffffff;
}

/* ---------- CONTROL PANEL ---------- */

#control-panel {
  margin-top: 30px;
  width: 100%;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  color: #ffffff;
  z-index: 15;
}

#control-panel button {
  padding: 6px 12px;
  cursor: pointer;
  border: 1px solid #fff;
  background: transparent;
  border-radius: 12px;
  color: #ffffff;
  transition: all 0.3s ease;
}

#toggle-panels-button {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 6px 12px;
  cursor: pointer;
  border: 1px solid #fff;
  background: transparent;
  border-radius: 12px;
  color: #ffffff;
  z-index: 20;
}
