/* Projector / presentation view for the seating plan. */
.presentation-launch {
  min-height: 42px;
  padding: 0 16px;
  border-color: transparent !important;
  background: var(--accent) !important;
  color: #ffffff !important;
  font-size: .8rem;
  box-shadow: 0 5px 14px rgba(91,75,219,.24);
}

.presentation-launch:hover,
.presentation-launch:focus-visible {
  background: var(--accent-strong) !important;
  box-shadow: 0 7px 18px rgba(91,75,219,.3);
  transform: translateY(-1px);
}

.presentation-exit {
  display: none;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 11px;
  background: rgba(23,32,51,.82);
  color: #fff;
  font-family: "Nunito", ui-sans-serif, system-ui, sans-serif;
  font-size: .76rem;
  font-weight: 900;
  opacity: .38;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: opacity .15s ease, background .15s ease;
}

.presentation-exit:hover,
.presentation-exit:focus-visible {
  opacity: 1;
  background: rgba(23,32,51,.96);
}

html.presentation-mode,
html.presentation-mode body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden !important;
  background: #11151d;
}

/* Fallback when the browser refuses the Fullscreen API: the room still becomes
   a fixed viewport overlay, so no editing controls can appear or require scroll. */
html.presentation-mode .room-scroll {
  position: fixed !important;
  inset: 0 !important;
  z-index: 900 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #11151d;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

/* Native fullscreen now targets #roomScroll itself. */
#roomScroll:fullscreen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #11151d;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

html.presentation-mode .room-frame,
#roomScroll:fullscreen .room-frame {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: clamp(7px, .7vw, 13px);
  border-radius: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html.presentation-mode .front-label,
#roomScroll:fullscreen .front-label {
  flex: 0 0 auto;
  margin: 0 auto clamp(5px, .6vh, 9px);
  padding: clamp(4px, .45vw, 7px) clamp(18px, 2vw, 34px);
  font-size: clamp(.72rem, 1vw, 1.08rem);
}

html.presentation-mode .room-layout,
#roomScroll:fullscreen .room-layout {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: var(--rail-size) minmax(0, 1fr) var(--rail-size);
  grid-template-rows: var(--rail-size) minmax(0, 1fr) var(--rail-size);
}

html.presentation-mode .classroom-grid,
#roomScroll:fullscreen .classroom-grid {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: auto;
  overflow: hidden;
}

html.presentation-mode .perimeter-rail,
#roomScroll:fullscreen .perimeter-rail {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

html.presentation-mode .student-card,
#roomScroll:fullscreen .student-card {
  font-size: clamp(.66rem, 1.1vw, 1.3rem);
  padding: clamp(2px, .35vw, 7px);
}

html.presentation-mode .fixture-card,
#roomScroll:fullscreen .fixture-card {
  font-size: clamp(.58rem, .86vw, 1rem);
}

html.presentation-mode .fixture-icon,
#roomScroll:fullscreen .fixture-icon {
  font-size: clamp(.78rem, 1.05vw, 1.2rem);
}

html.presentation-mode .fixture-remove,
#roomScroll:fullscreen .fixture-remove {
  display: none !important;
}

/* Projector mode is view-only. */
html.presentation-mode .room-item,
html.presentation-mode .grid-cell,
html.presentation-mode .perimeter-cell,
#roomScroll:fullscreen .room-item,
#roomScroll:fullscreen .grid-cell,
#roomScroll:fullscreen .perimeter-cell {
  pointer-events: none !important;
  cursor: default !important;
}

html.presentation-mode .presentation-exit,
#roomScroll:fullscreen .presentation-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto !important;
}

/* Keep vertical Door and Window labels visible in projector mode. */
html.presentation-mode .perimeter-rail.vertical .door-fixture-card .fixture-label,
html.presentation-mode .perimeter-rail.vertical .window-fixture-card .fixture-label,
#roomScroll:fullscreen .perimeter-rail.vertical .door-fixture-card .fixture-label,
#roomScroll:fullscreen .perimeter-rail.vertical .window-fixture-card .fixture-label {
  display: block !important;
}

@media (max-width: 760px) {
  html.presentation-mode .student-card,
  #roomScroll:fullscreen .student-card {
    font-size: clamp(.55rem, 2vw, .9rem);
  }

  .presentation-exit {
    top: 7px;
    right: 7px;
    min-height: 34px;
    padding: 0 9px;
    font-size: .68rem;
  }
}
