*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #000;
  --text: #e8edf4;
  --muted: #8fa3bc;
  --accent: #3b9eff;
  --brand-silver: #c8d4e3;
  --header-height: 4.85rem;
}

html,
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #000;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

body.kiosk-active {
  cursor: none;
}

html:fullscreen,
html:-webkit-full-screen,
body:fullscreen,
body:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: #000;
}

.fs-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.88);
}

.fs-gate[hidden],
html.fs-unlocked .fs-gate {
  display: none !important;
}

.fs-start-btn {
  appearance: none;
  border: 3px solid #3b9eff;
  background: #fff;
  color: #111;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  cursor: pointer;
}

.fs-start-btn:focus {
  outline: 4px solid #3b9eff;
  outline-offset: 6px;
  box-shadow: 0 0 0 10px rgba(59, 158, 255, 0.25);
}

.fs-gate-hint {
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

.slideshow-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 2rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.75) 70%, transparent 100%);
}

.brand-logo {
  height: 2.75rem;
  width: auto;
  flex-shrink: 0;
}

.brand-logo--left {
  margin-right: auto;
}

.brand-logo--right {
  margin-left: auto;
}

.brand-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
}

.brand-rule {
  width: 3rem;
  height: 1px;
  flex-shrink: 0;
}

.brand-rule--left {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38));
}

.brand-rule--right {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.38), transparent);
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  white-space: nowrap;
  line-height: 1;
}

.brand-name {
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: #fff;
  padding-left: 0.24em;
}

.brand-sep {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.brand-tag {
  font-size: 1.9rem;
  font-weight: 300;
  letter-spacing: 0.34em;
  color: var(--brand-silver);
  padding-right: 0.34em;
}

.brand-accent-line {
  display: block;
  width: 4rem;
  height: 2px;
  margin: 0.4rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  opacity: 0.65;
}

.slideshow-counter {
  display: block;
  margin-top: 0.38rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  color: rgba(143, 163, 188, 0.88);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.slideshow {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: calc(var(--header-height) + 0.5rem) 0.5rem 0.5rem;
}

.slideshow-stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

#pdfCanvas {
  max-width: 100%;
  max-height: calc(100vh - var(--header-height) - 1rem);
  object-fit: contain;
}

.drive-frame {
  width: min(96vw, calc((100vh - var(--header-height) - 1rem) * 16 / 9));
  height: min(calc(100vh - var(--header-height) - 1rem), calc(96vw * 9 / 16));
  border: 0;
  background: #111;
}

.youtube-stage {
  width: min(96vw, calc((100vh - var(--header-height) - 1rem) * 16 / 9));
  height: min(calc(100vh - var(--header-height) - 1rem), calc(96vw * 9 / 16));
  background: #000;
  overflow: hidden;
  pointer-events: none;
}

.youtube-stage iframe,
.youtube-stage > div {
  width: 100% !important;
  height: 100% !important;
}

.pptx-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pptx-stage .pptx-preview-pagination,
.pptx-stage .pptx-preview-pre,
.pptx-stage .pptx-preview-next,
.pptx-stage [class*="pagination"] {
  display: none !important;
}

.pptx-stage .pptx-preview-wrapper {
  max-width: min(98vw, 1280px);
  max-height: calc(100vh - var(--header-height) - 1rem);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  background: #fff;
  border-radius: 4px;
}

.slide-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pptx-render-host {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

@media (max-width: 640px) {
  .slideshow-header {
    padding: 0.5rem 1rem;
  }

  .brand-logo {
    height: 1.85rem;
  }

  .brand-rule {
    width: 1.25rem;
  }

  .brand-lockup {
    gap: 0.6rem;
  }

  .brand-name,
  .brand-tag {
    font-size: 1.15rem;
  }

  .brand-name {
    letter-spacing: 0.16em;
  }

  .brand-tag {
    letter-spacing: 0.22em;
  }

  .brand-accent-line {
    width: 2.5rem;
    margin-top: 0.28rem;
  }

  .slideshow-counter {
    font-size: 0.58rem;
    margin-top: 0.28rem;
  }
}
