:root {
  --bg: #08121d;
  --panel: rgba(8, 18, 29, 0.7);
  --panel-strong: rgba(11, 26, 41, 0.88);
  --panel-border: rgba(149, 187, 214, 0.18);
  --text: #f4f6f2;
  --muted: #99adc0;
  --accent: #6fe0b8;
  --accent-strong: #39c792;
  --warm: #f8bc72;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(111, 224, 184, 0.2), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(248, 188, 114, 0.18), transparent 24%),
    linear-gradient(180deg, #10263d 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

.viewer-body {
  background: #000;
  overflow: hidden;
}

button,
label {
  font: inherit;
}

button {
  cursor: pointer;
}

input[type="file"] {
  display: none;
}

.shell {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 1rem;
  min-height: 100vh;
  padding: 1rem;
}

.shell-viewer {
  grid-template-rows: auto 1fr auto;
}

.toolbar,
.status-bar,
.viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.toolbar {
  border-radius: 24px;
}

.toolbar-viewer {
  flex-wrap: wrap;
}

.brand h1,
.brand p {
  margin: 0;
}

.eyebrow {
  color: var(--warm);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand h1 {
  font-size: clamp(1.4rem, 2vw, 2.2rem);
  font-weight: 750;
}

.toolbar-actions,
.status-bar {
  flex-wrap: wrap;
}

.status-bar,
.viewer-footer {
  border-radius: 18px;
  color: var(--muted);
}

.status-bar strong,
.viewer-footer,
.room-pill strong {
  color: var(--text);
}

.status-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timer-card {
  display: grid;
  gap: 0.45rem;
}

.access-panel {
  display: grid;
  grid-template-columns: minmax(14rem, 22rem) auto minmax(16rem, 1fr);
  align-items: end;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.access-input-group,
.access-link-group {
  min-width: 0;
}

.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.code-input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

.code-input:focus {
  outline: 2px solid rgba(111, 224, 184, 0.4);
  outline-offset: 2px;
}

.viewer-link {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.ghost-button,
.upload-button,
.danger-button {
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #05221b;
  font-weight: 700;
}

.ghost-button,
.upload-button,
.danger-button {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--panel-border);
  color: var(--text);
}

.primary-button:hover,
.ghost-button:hover,
.upload-button:hover,
.danger-button:hover,
.fullscreen-fab:hover {
  transform: translateY(-1px);
}

.danger-button {
  border-color: rgba(255, 120, 120, 0.35);
  background: rgba(130, 22, 22, 0.34);
  color: #ffd9d9;
}

.room-pill {
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
}

.stage-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(72vh, calc(100vh - 13rem));
  padding: 1.25rem;
  border-radius: 32px;
  border: 1px solid var(--panel-border);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stage-shell-viewer {
  min-height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.stage-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(111, 224, 184, 0.05), transparent 40%),
    radial-gradient(circle at bottom right, rgba(248, 188, 114, 0.12), transparent 25%);
  pointer-events: none;
}

.stage-shell-viewer::before {
  display: none;
}

.stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

#slide-canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 18px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.42);
}

.viewer-body #slide-canvas {
  border-radius: 0;
  box-shadow: none;
}

.viewer-notice {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.88);
}

.viewer-notice[hidden] {
  display: none !important;
}

.viewer-notice-card {
  max-width: 34rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(8, 18, 29, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
  text-align: center;
}

.viewer-notice-title,
.viewer-notice-copy {
  margin: 0;
}

.viewer-notice-title {
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  font-weight: 750;
}

.viewer-notice-copy {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.empty-state {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  text-align: center;
}

.empty-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 750;
}

.empty-copy {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.fullscreen-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 10;
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(8, 18, 29, 0.72);
  color: #f4f6f2;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

.fullscreen-fab svg {
  width: 1.25rem;
  height: 1.25rem;
}

.is-fullscreen .fullscreen-fab {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 860px) {
  .shell {
    padding: 0.75rem;
  }

  .toolbar,
  .status-bar,
  .viewer-footer {
    padding: 0.9rem 1rem;
    border-radius: 18px;
  }

  .toolbar {
    align-items: flex-start;
  }

  .stage-shell {
    min-height: calc(100vh - 15rem);
    border-radius: 24px;
  }

  .stage-shell-viewer {
    min-height: 100vh;
    border-radius: 0;
  }

  .access-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .fullscreen-fab {
    right: 1rem;
    bottom: 1rem;
    width: 3.1rem;
    height: 3.1rem;
  }
}
