* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: #0c1824;
  color: #102033;
}

body {
  overflow-x: hidden;
}

.lounge-page {
  width: 100%;
}

.hero-room {
  position: relative;
  width: min(100vw, 1920px);
  margin: 0 auto;
  line-height: 0;
  background: #0c1824;
}

.room-image {
  width: 100%;
  display: block;
  height: auto;
}

/* Clickable Music Fun Books banner at the top-right of the room image */
.music-fun-books-banner-link {
  position: absolute;
  left: 71.0%;
  top: 2.2%;
  width: 26.7%;
  height: 12.8%;
  z-index: 7;
  display: block;
  background: rgba(255,255,255,0);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

.music-fun-books-banner-link:focus-visible {
  outline: 3px solid rgba(255, 210, 80, 0.92);
  outline-offset: 4px;
}

body.show-hotspots .music-fun-books-banner-link {
  background: rgba(255, 210, 80, 0.16);
  box-shadow: inset 0 0 0 2px rgba(255, 210, 80, 0.72);
}

/* Title overlay */
.lounge-title {
  position: absolute;
  left: 11.4%;
  top: 2.9%;
  z-index: 5;
  color: #0b1f35;
  line-height: 1.05;
  text-shadow: 0 1px 1px rgba(255,255,255,0.35);
}

.lounge-title .welcome {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(17px, 1.9vw, 36px);
  color: #0b63b2;
  margin-bottom: 2px;
}

.lounge-title h1 {
  margin: 0;
  font-size: clamp(34px, 4.25vw, 74px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lounge-title p {
  margin: 10px 0 0;
  font-size: clamp(13px, 1.2vw, 22px);
  font-weight: 600;
  color: #17324d;
}

/* Bookshelf overlay: 9 books, 3 per shelf */
.book-shelf {
  position: absolute;
  left: 70.25%;
  top: 15.1%;
  width: 26.05%;
  height: 71.0%;
  pointer-events: none;
  z-index: 4;
}

.shelf-book {
  position: absolute;
  display: block;
  pointer-events: auto;
  background: transparent;
  border-radius: 4px;
  overflow: visible;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, filter 160ms ease;
}

.shelf-book:hover {
  transform: translateY(-3px) scale(1.025);
  filter: drop-shadow(0 16px 18px rgba(0,0,0,0.28));
}

.shelf-book img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  background: transparent;
  border-radius: 2px;
  filter: drop-shadow(0 11px 12px rgba(0,0,0,0.25));
}

.shelf-book .book-fallback {
  display: none;
}

/* Top shelf */
.book-slot-1 { left: 5.6%;  top: 1.9%;  width: 22.0%; height: 26.4%; }
.book-slot-2 { left: 39.0%; top: 1.9%;  width: 22.0%; height: 26.4%; }
.book-slot-3 { left: 72.4%; top: 1.9%;  width: 22.0%; height: 26.4%; }

/* Middle shelf */
.book-slot-4 { left: 5.6%;  top: 29.4%; width: 22.0%; height: 26.4%; }
.book-slot-5 { left: 39.0%; top: 29.4%; width: 22.0%; height: 26.4%; }
.book-slot-6 { left: 72.4%; top: 29.4%; width: 22.0%; height: 26.4%; }

/* Bottom shelf */
.book-slot-7 { left: 5.6%;  top: 54.8%; width: 22.0%; height: 26.4%; }
.book-slot-8 { left: 39.0%; top: 54.8%; width: 22.0%; height: 26.4%; }
.book-slot-9 { left: 72.4%; top: 54.8%; width: 22.0%; height: 26.4%; }

/* Visible circular resource buttons */
.ui-bubble {
  position: absolute;
  z-index: 5;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  line-height: 1.12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  box-shadow: 0 12px 28px rgba(0,0,0,0.22), inset 0 0 0 2px rgba(255,255,255,0.20);
  backdrop-filter: blur(2px);
}

.ui-bubble strong {
  display: block;
  font-size: clamp(12px, 1.03vw, 19px);
  font-weight: 800;
  line-height: 1.05;
}

.ui-bubble span {
  display: block;
  font-size: clamp(11px, 0.9vw, 16px);
  margin-top: 2px;
  line-height: 1.05;
}

.bubble-tip {
  left: 29.8%;
  top: 30.1%;
  width: 8.0%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 30% 28%, rgba(197,222,43,0.98), rgba(124,160,16,0.98));
}

.bubble-video {
  left: 42.8%;
  top: 26.2%;
  width: 6.3%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 30% 28%, rgba(51,143,224,0.98), rgba(17,78,142,0.98));
}

.bubble-sheet {
  left: 2.4%;
  top: 72.0%;
  width: 7.4%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 30% 28%, rgba(34,133,212,0.98), rgba(16,78,130,0.98));
}

.bubble-resource {
  left: 46.8%;
  top: 68.0%;
  width: 8.0%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 30% 28%, rgba(46,192,171,0.98), rgba(18,126,114,0.98));
}

/* Keep Featured Book off the bookshelf */
.bubble-book {
  left: 63.4%;
  top: 51.5%;
  width: 7.4%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 30% 28%, rgba(128,84,184,0.98), rgba(83,48,141,0.98));
}

/* Bottom navigation built in code */
.bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8.7%;
  padding: 0.75% 3.2%;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.9%;
  background: linear-gradient(180deg, rgba(8,24,39,0.66), rgba(7,22,37,0.94));
}

.nav-btn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(12, 30, 48, 0.72);
  color: #fff;
  border-radius: 18px;
  font-size: clamp(11px, 1.0vw, 18px);
  line-height: 1.08;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.nav-icon {
  width: clamp(28px, 3vw, 54px);
  height: clamp(28px, 3vw, 54px);
  border-radius: 50%;
  background: rgba(255,255,255,0.09);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 2vw, 34px);
  color: #f3d59b;
  flex: 0 0 auto;
}

.nav-btn:hover,
.ui-bubble:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* Debug helper: press H */
body.show-hotspots .book-shelf {
  outline: 2px solid rgba(0, 200, 255, 0.65);
}

body.show-hotspots .shelf-book {
  outline: 2px solid rgba(0, 200, 255, 0.95);
}

body.show-hotspots .ui-bubble,
body.show-hotspots .nav-btn,
body.show-hotspots .lounge-title {
  outline: 2px solid rgba(255, 230, 0, 0.95);
}

/* Mobile fallback */
.mobile-cards {
  display: none;
  padding: 18px;
  background: #0c1824;
  grid-template-columns: 1fr;
  gap: 10px;
}

.mobile-cards button,
.mobile-cards a {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.18);
  background: #14263a;
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

@media (max-width: 900px) {
  .ui-bubble strong { font-size: 10px; }
  .ui-bubble span { font-size: 9px; }
  .nav-btn { font-size: 10px; gap: 5px; }
  .nav-icon { display: none; }
}

@media (max-width: 760px) {
  .mobile-cards {
    display: grid;
  }

  .lounge-title, .ui-bubble, .bottom-bar, .book-shelf {
    display: none;
  }
}

/* Modal */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 18, 0.72);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow-y: auto;
  background: #fff;
  color: #102033;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.40);
  line-height: 1.45;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #eef2f7;
  color: #102033;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.modal-kicker {
  margin: 0 48px 6px 0;
  color: #6b7280;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.modal-card h2 {
  margin: 0 48px 14px 0;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.1;
}

.modal-card p {
  font-size: 17px;
  margin: 0 0 14px;
}

.modal-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}

.modal-card .pill {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #223244;
  font-size: 13px;
  font-weight: 700;
}

.modal-card .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.modal-card .action-link {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 999px;
  background: #0f5bb5;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.modal-card .action-link.secondary {
  background: #25364a;
}

.modal-card .book-cover {
  width: 150px;
  max-width: 40%;
  float: right;
  margin: 0 0 16px 20px;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.modal-card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
  margin-top: 8px;
}

@media (max-width: 520px) {
  .modal-card {
    padding: 22px;
    border-radius: 16px;
  }

  .modal-card .book-cover {
    float: none;
    display: block;
    max-width: 190px;
    width: 70%;
    margin: 0 auto 16px;
  }
}


/* =========================================================
   Free Book of the Day prominence update - corrected
   ---------------------------------------------------------
   Current live HTML uses:
   .ui-bubble.bubble-sheet[data-panel="sheet"]

   This moves the Free Book bubble closer to the center of
   the desktop room and makes it slightly more prominent.
   ========================================================= */

@media (min-width: 769px) {
  .ui-bubble.bubble-sheet[data-panel="sheet"] {
    left: 37.2% !important;
    top: 57.0% !important;
    width: 9.8% !important;
    aspect-ratio: 1 / 1 !important;
    z-index: 20 !important;
    background: radial-gradient(circle at 30% 28%, rgba(38,150,235,0.98), rgba(9,88,170,0.98)) !important;
    box-shadow: 0 18px 42px rgba(0,0,0,0.30), inset 0 0 0 2px rgba(255,255,255,0.26) !important;
  }

  .ui-bubble.bubble-sheet[data-panel="sheet"] strong {
    font-size: clamp(13px, 1.22vw, 22px) !important;
    font-weight: 900 !important;
  }

  .ui-bubble.bubble-sheet[data-panel="sheet"] span {
    font-size: clamp(11px, 1.0vw, 18px) !important;
  }

  /* Give the more important Free Book bubble room to breathe. */
  .ui-bubble.bubble-resource {
    left: 48.6% !important;
    top: 70.0% !important;
  }

  .ui-bubble.bubble-book {
    left: 65.0% !important;
    top: 52.0% !important;
  }
}


/* =========================================================
   Music Supplies popup
   ========================================================= */

.supplies-intro {
  max-width: 680px;
}

.supply-section {
  margin-top: 22px;
}

.supply-section h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #25364a;
}

.supply-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.supply-card {
  border: 1px solid #dce3ec;
  border-radius: 16px;
  padding: 15px;
  background: #f8fafc;
}

.supply-card h4 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.2;
}

.supply-card p {
  font-size: 15px;
  margin-bottom: 10px;
}

.supply-card img {
  width: 78px;
  max-height: 78px;
  object-fit: contain;
  float: right;
  margin: 0 0 10px 12px;
  border-radius: 8px;
}

.supply-actions {
  margin-top: 10px;
}

.supply-placeholder {
  color: #6b7280;
  font-size: 13px !important;
  font-style: italic;
}

.affiliate-note {
  margin-top: 22px !important;
  padding-top: 14px;
  border-top: 1px solid #dce3ec;
  color: #4b5563;
  font-size: 13px !important;
}

.affiliate-note a {
  color: #0f5bb5;
  font-weight: 700;
}

@media (max-width: 620px) {
  .supply-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Source attribution for Teacher Tip of the Day
   ========================================================= */

.source-note {
  margin-top: 10px !important;
  margin-bottom: 16px !important;
  padding: 10px 12px;
  border-left: 4px solid #1d7bd6;
  background: #f1f7ff;
  color: #41536a;
  font-size: 14px !important;
  line-height: 1.45;
}

.source-note a {
  color: #0f5bb5;
  font-weight: 800;
  text-decoration: none;
}

.source-note a:hover {
  text-decoration: underline;
}

.source-note span {
  color: #64748b;
}


/* =========================================================
   Composer of the Day
   ========================================================= */

.modal-card .composer-portrait {
  width: 150px;
  max-width: 40%;
  float: right;
  margin: 0 0 16px 20px;
  border-radius: 14px;
  border: 1px solid #d9e1ec;
  background: #f8fafc;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
}

@media (max-width: 620px) {
  .modal-card .composer-portrait {
    float: none;
    display: block;
    max-width: 190px;
    width: 70%;
    margin: 0 auto 16px;
  }
}


/* =========================================================
   Optional room ambience button
   ========================================================= */

.room-sound-toggle {
  position: absolute;
  left: 3.0%;
  top: 4.0%;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.42);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(12, 30, 48, 0.76);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(12px, 0.9vw, 16px);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(255,255,255,0.10);
  backdrop-filter: blur(5px);
  transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}

.room-sound-toggle:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.room-sound-toggle .sound-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.14);
  color: #f3d59b;
  font-size: 18px;
  flex: 0 0 auto;
}

.room-sound-toggle .sound-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.room-sound-toggle.is-playing {
  background: rgba(16, 87, 68, 0.84);
}

.room-sound-toggle.is-playing .sound-state {
  background: rgba(255,255,255,0.20);
}

@media (max-width: 760px) {
  .mobile-cards .room-sound-toggle {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    margin: 0 0 4px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #19324b;
    text-align: center;
  }

  .mobile-cards .room-sound-toggle.is-playing {
    background: #135744;
  }
}
