/* Presenter page: top bar, stage preview and controls, and the side-panel cards. */

body.host { min-height: 100%; }
.session { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.session strong { font-size: 16px; }

.host-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}
.main { min-width: 0; display: grid; gap: 14px; align-content: start; align-self: start; position: sticky; top: 80px; }
.panel { display: grid; gap: 14px; align-content: start; }

.stage-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: calc(100vh - 260px);
  min-height: 200px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}
.stage-frame:fullscreen { max-height: none; border: 0; border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
.stage-frame #stage { width: 100%; height: 100%; }

.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.controls .btn { min-width: 96px; }
.counter { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.counter input {
  width: 56px; height: 40px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  outline: none;
}
.counter input:focus { border-color: var(--accent); }
.now-showing { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }

.thumbs {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
}
.thumb {
  position: relative;
  flex: none;
  width: 136px; height: 77px;
  padding: 0;
  border-radius: 8px;
  border: 2px solid transparent;
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  display: grid; place-items: center;
}
.thumb canvas { max-width: 100%; max-height: 100%; display: block; }
.thumb span {
  position: absolute; left: 5px; bottom: 4px;
  font: 600 11px var(--mono);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}
.thumb:hover { border-color: #3a4256; }
.thumb.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.25); }
.hint { font-size: 12px; color: var(--muted); }
.notes-card { display: grid; gap: 6px; }
.notes-card h2 { font-size: 13px; color: var(--muted); }
#notes-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  font: 14px/1.45 var(--font); color: var(--text);
  resize: vertical;
  outline: none;
}
#notes-input:focus { border-color: var(--accent); }


.connect { text-align: center; }
.qr-wrap {
  width: 184px; height: 184px;
  margin: 12px auto 12px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
}
.qr-wrap img { width: 100%; height: 100%; display: block; }
.join-url {
  margin-top: 6px;
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: var(--bg);
  font-size: 13px;
  letter-spacing: 0;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.join-url:hover { border-color: var(--accent); }
.join-pin { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.join-pin span { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; }
.join-pin input {
  width: 120px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 26px; font-weight: 700;
  text-align: center; letter-spacing: 0.3em; text-indent: 0.3em;
  outline: none;
}
.join-pin input:hover { border-color: #3a4256; }
.join-pin input:focus { border-color: var(--accent); }
.presenters-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.presenters-head h3 { margin: 0; font-size: 13px; font-weight: 650; }
.presenters { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; text-align: left; }
.presenters-empty { padding: 4px 0; text-align: center; }
.presenter {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 4px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.presenter:hover, .presenter:focus-within { background: var(--card-2); }
.presenter.offline .presenter-name { color: var(--muted); }
.presenter.just-joined { animation: joined 2.4s ease-out; }
@keyframes joined {
  0%, 40% { border-color: rgba(52, 211, 153, 0.7); background: rgba(52, 211, 153, 0.12); }
  100% { border-color: transparent; background: transparent; }
}
.presenter-info { flex: 1; min-width: 0; display: grid; }
input.presenter-name {
  width: 100%;
  height: 28px;
  margin-left: -6px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  outline: none;
}
input.presenter-name:hover { border-color: var(--line); }
input.presenter-name:focus { border-color: var(--accent); background: var(--bg); }
.presenter-meta { font-size: 12px; color: var(--muted); }

.dropzone {
  display: grid; justify-items: center; gap: 2px;
  padding: 18px;
  border-radius: 12px;
  border: 1.5px dashed #343b4f;
  background: var(--bg);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone span { font-size: 13px; color: var(--muted); }
.dropzone:hover, body.dragging .dropzone { border-color: var(--accent); background: rgba(139, 108, 255, 0.08); }

/* Running order */

.agenda { list-style: none; margin: 10px 0 8px; padding: 0; display: grid; gap: 6px; }
.agenda:empty { display: none; }
.slot {
  display: grid; gap: 6px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.slot.current { border-color: rgba(139, 108, 255, 0.6); background: rgba(139, 108, 255, 0.1); }
.slot.drop-target { border-color: var(--accent-2); border-style: dashed; }
.slot-top { display: flex; align-items: center; gap: 4px; }
.slot-num { width: 20px; flex: none; font: 600 12px var(--mono); color: var(--muted); text-align: center; }
input.slot-name {
  flex: 1; min-width: 0;
  height: 30px; padding: 0 6px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent;
  font-weight: 600; font-size: 14px;
  outline: none;
}
input.slot-name:hover { border-color: var(--line); }
input.slot-name:focus { border-color: var(--accent); background: var(--card); }
.slot-start { min-height: 28px; padding: 0 10px; }
.icon-btn.small { width: 24px; height: 26px; font-size: 14px; }
.icon-btn:disabled { opacity: 0.25; cursor: default; background: transparent; color: var(--muted); }
.slot-details { display: grid; grid-template-columns: auto 1fr; gap: 6px; padding-left: 24px; }
.slot-deck { grid-column: 1 / -1; }
.slot-details select { height: 30px; font-size: 12px; padding: 0 6px; min-width: 0; }
.slot-time { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.slot-time input {
  width: 48px; height: 30px; padding: 0 4px;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); text-align: center; font-size: 12px;
  outline: none;
}
.slot-time input:focus, .slot-details select:focus { border-color: var(--accent); }
.control-desc { margin-top: 8px; }
.pointer-toggle { --pointer-color: #3b82f6; }
.pointer-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pointer-color); box-shadow: 0 0 6px var(--pointer-color); }
.pointer-toggle.active { border-color: var(--pointer-color); background: color-mix(in srgb, var(--pointer-color) 18%, transparent); }
.stage-frame.pointing { cursor: crosshair; }
.stage-frame.pointing iframe { pointer-events: none; } /* website decks would swallow the mouse */
.cue-colors { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.cue-colors label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cue-colors input[type='color'] { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.cue-colors .btn { margin-left: auto; }

/* Timer and messages */

.top-timer {
  --tone: var(--text);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--tone);
  font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.timer-big {
  --tone: var(--text);
  margin-top: 6px;
  font-size: 44px; font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--tone);
}
.timer-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 4px 0 12px; }
.timer-bar span { --tone: var(--ok); display: block; height: 100%; background: var(--tone); transition: width 0.25s linear, background 0.3s; }
.timer-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.timer-buttons .btn { padding: 0 8px; }
#next-speaker { margin-top: 8px; overflow: hidden; text-overflow: ellipsis; }
.timer-settings { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.timer-settings summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.timer-settings summary:hover { color: var(--text); }
.duration input, .split input {
  width: 58px; height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  text-align: center;
  outline: none;
}
.duration input:focus, .split input:focus { border-color: var(--accent); }
.split { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); }
.split input { width: 50px; height: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  padding: 6px 10px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.chips button:hover { border-color: #3a4256; }
#nudges button.active { border-color: var(--accent); background: rgba(139, 108, 255, 0.15); }
.presets { margin-top: 10px; }
.presets button[data-level='warn'] { border-color: rgba(251, 191, 36, 0.35); }

.link-form { display: flex; gap: 6px; margin-top: 8px; }
.link-form input {
  flex: 1; min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 13px;
  outline: none;
}
.link-form input:focus { border-color: var(--accent); }
.web-hint {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  font-size: 13px;
}
.web-hint p { flex: 1; }
.uploads, .decks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.uploads:empty { display: none; }
.upload { display: grid; gap: 6px; font-size: 13px; padding: 8px 10px; background: var(--bg); border-radius: 8px; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.deck {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 4px 4px 0;
  border-radius: 10px;
  border: 1px solid transparent;
}
.deck:hover { background: var(--card-2); }
.deck.live { border-color: rgba(139, 108, 255, 0.5); background: rgba(139, 108, 255, 0.1); }
.deck-main {
  flex: 1; min-width: 0;
  display: grid; text-align: left; gap: 1px;
  padding: 6px 10px;
  border: 0; background: transparent;
  cursor: pointer;
}
.deck.pending .deck-main { cursor: default; }
.deck-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-meta { font-size: 12px; color: var(--muted); }
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge.live { background: var(--accent); color: #fff; }
.empty { padding: 4px 0; }

.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.themes button {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.themes button.active { border-color: var(--accent); background: rgba(139, 108, 255, 0.15); }
.themes button:disabled { opacity: 0.4; cursor: not-allowed; }
.card .row { margin-top: 10px; }

@media (max-width: 960px) {
  .host-layout { grid-template-columns: 1fr; padding: 16px; }
  .main { position: static; }
  .stage-frame { max-height: none; }
  .topbar { padding: 0 16px; gap: 10px; }
  .top-actions .btn { padding: 0 10px; }
  #btn-audience, #btn-signout { display: none; }
  .now-showing { display: none; }
}
@media (max-width: 480px) {
  .session .muted { display: none; }
  .controls .btn { min-width: 0; flex: 1; }
  #idle-toggle { flex-basis: 100%; }
}
