/* Presentation rehearsal module. */

.presentation-panel,
.presentation-setup,
.presentation-live,
.presentation-results {
  width: 100%;
  min-width: 0;
}

.presentation-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.presentation-panel[hidden],
.presentation-setup[hidden],
.presentation-live[hidden],
.presentation-results[hidden] {
  display: none;
}

.presentation-setup,
.presentation-live,
.presentation-results {
  display: grid;
  gap: 14px;
  align-content: start;
}

.presentation-hero {
  width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  margin: 0;
  border: 1px solid var(--hairline);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.presentation-hero img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.presentation-card,
.presentation-result-heading,
.presentation-result-text,
.presentation-result-media,
.presentation-cue-card {
  border: 1px solid var(--hairline);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.presentation-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
}

.presentation-card h2,
.presentation-result-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.35;
  word-break: keep-all;
}

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

.presentation-mode {
  min-height: 112px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 6px;
  text-align: left;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 100ms ease, box-shadow 100ms ease, background 100ms ease;
}

.presentation-mode.active {
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
}

.presentation-mode:hover,
.presentation-start:hover,
.presentation-stop:hover:not(:disabled),
.presentation-results .button-primary:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--ink);
}

.presentation-mode:active,
.presentation-start:active,
.presentation-stop:active,
.presentation-results .button-primary:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.presentation-mode strong {
  font-size: 16px;
  line-height: 1.3;
}

.presentation-mode small {
  color: var(--ink-muted);
  line-height: 1.45;
}

.presentation-script-input,
.presentation-result-text {
  display: grid;
  gap: 8px;
  color: var(--ink-secondary);
  font-weight: 800;
}

.presentation-script-input textarea,
.presentation-result-text textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--canvas-soft);
  color: var(--ink);
  padding: 12px;
  font: inherit;
  line-height: 1.55;
}

.presentation-script-input textarea:focus,
.presentation-result-text textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--primary) 34%, transparent);
  border-color: var(--primary);
}

.presentation-notice {
  display: grid;
  gap: 6px;
}

.presentation-notice p {
  margin: 0;
}

.presentation-start,
.presentation-stop,
.presentation-results .button-primary {
  width: 100%;
  min-height: 56px;
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 18px;
  font-weight: 900;
  transition: transform 100ms ease, box-shadow 100ms ease, background 100ms ease;
}

.presentation-live-shell {
  border: 2px solid #252b35;
  border-radius: 18px;
  background: #11151b;
  color: #f7f8fa;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
}

.presentation-live-header {
  min-height: 48px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #303741;
  background: #1b2028;
}

.presentation-live-header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presentation-live-header > span:last-child {
  color: #b8c0cc;
  font-size: 12px;
  font-weight: 750;
}

.presentation-live-badge {
  border-radius: 4px;
  background: #d93025;
  color: white;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
}

.presentation-stage {
  position: relative;
  min-height: 250px;
  background: #090c11;
  overflow: hidden;
}

.presentation-stage video {
  width: 100%;
  height: 250px;
  display: block;
  object-fit: cover;
  transform: scaleX(-1);
}

.presentation-stage video[hidden],
.presentation-audio-avatar[hidden] {
  display: none;
}

.presentation-audio-avatar {
  min-height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.presentation-audio-avatar span {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 3px solid #d7eaff;
  border-radius: 50%;
  background: #2673dd;
  color: white;
  font-size: 38px;
  font-weight: 950;
}

.presentation-audio-avatar i {
  width: 7px;
  height: 34px;
  border-radius: 6px;
  background: #7cb7ff;
  transform: scaleY(.45);
}

.presentation-stage.is-recording .presentation-audio-avatar i {
  animation: presentation-wave 700ms ease-in-out infinite alternate;
}

.presentation-stage.is-recording .presentation-audio-avatar i:nth-child(3) {
  animation-delay: 120ms;
}

.presentation-stage.is-recording .presentation-audio-avatar i:nth-child(4) {
  animation-delay: 240ms;
}

.presentation-presenter-name {
  position: absolute;
  left: 10px;
  bottom: 10px;
  border-radius: 5px;
  background: rgb(0 0 0 / 70%);
  color: white;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.presentation-timer {
  position: absolute;
  right: 10px;
  top: 10px;
  min-width: 86px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 7px;
  background: rgb(0 0 0 / 72%);
  padding: 6px 8px;
  display: grid;
  text-align: right;
}

.presentation-timer span {
  color: #bac3ce;
  font-size: 10px;
  font-weight: 750;
}

.presentation-timer strong {
  color: white;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.presentation-stage.time-warning .presentation-timer {
  border-color: #ff746b;
  box-shadow: 0 0 0 2px rgb(217 48 37 / 32%);
}

.presentation-countdown {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgb(4 7 11 / 78%);
  color: white;
  font-size: 84px;
  font-weight: 950;
}

.presentation-countdown[hidden] {
  display: none;
}

.presentation-audience {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  border-top: 1px solid #303741;
  border-bottom: 1px solid #303741;
}

.presentation-audience > div {
  min-width: 0;
  border: 1px solid #353d49;
  border-radius: 8px;
  background: #202630;
  padding: 6px 4px;
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 7px;
}

.presentation-audience span {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #354052;
  color: #dce8f7;
  font-weight: 900;
}

.presentation-audience small {
  width: 100%;
  overflow: hidden;
  color: #d6dbe2;
  font-size: 11px;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
}

.presentation-chat-panel {
  background: #171c23;
}

.presentation-chat-heading {
  padding: 10px 12px;
  display: grid;
  gap: 2px;
  border-bottom: 1px solid #303741;
}

.presentation-chat-heading strong {
  font-size: 13px;
}

.presentation-chat-heading span {
  color: #aeb7c3;
  font-size: 11px;
}

.presentation-chat-log {
  height: 154px;
  padding: 10px 12px;
  display: grid;
  align-content: start;
  gap: 9px;
  overflow-y: auto;
}

.presentation-chat-message {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.presentation-chat-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #303a49;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.presentation-chat-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.presentation-chat-copy strong {
  color: #d7e8ff;
  font-size: 12px;
}

.presentation-chat-copy p {
  margin: 0;
  color: #f1f3f6;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.presentation-chat-message.is-new {
  animation: presentation-chat-in 220ms ease-out;
}

.presentation-cue-card {
  max-height: 148px;
  padding: 14px 16px;
  overflow-y: auto;
}

.presentation-cue-card p,
.presentation-result-text p {
  margin: 7px 0 0;
  color: var(--ink);
  line-height: 1.6;
  white-space: pre-wrap;
}

.presentation-status {
  min-height: 24px;
  margin: 0;
  color: var(--ink-secondary);
  text-align: center;
  font-weight: 750;
}

.presentation-result-heading,
.presentation-result-text {
  padding: 18px;
}

.presentation-result-heading {
  display: grid;
  gap: 8px;
}

.presentation-result-heading p {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.presentation-result-media {
  padding: 12px;
}

.presentation-result-media video,
.presentation-result-media audio {
  width: 100%;
  display: block;
  border-radius: 14px;
  background: #101722;
}

.presentation-result-media video {
  max-height: 420px;
}

@keyframes presentation-wave {
  from { transform: scaleY(.35); }
  to { transform: scaleY(1); }
}

@keyframes presentation-chat-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 420px) {
  .presentation-mode-grid {
    grid-template-columns: 1fr;
  }

  .presentation-mode {
    min-height: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .presentation-stage.is-recording .presentation-audio-avatar i,
  .presentation-chat-message.is-new {
    animation: none;
  }
}
