:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090b0e;
  color: #f4f6f8;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #090b0e; }
.page-shell { width: min(1120px, calc(100% - 28px)); margin: 28px auto 48px; }
body.video-portrait .page-shell { width: min(520px, calc(100% - 28px)); }
body.video-square .page-shell { width: min(760px, calc(100% - 28px)); }
.player-card, .debug-card { background: #12161b; border: 1px solid #252b33; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.24); }
.player-card { padding: 12px; }
media-player { display: block; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 12px; overflow: hidden; background: #000; }
media-video-layout {
  --video-brand: #d62828;
  --video-controls-color: #f5f5f5;
  --video-sm-button-size: 40px;
  --video-load-button-size: 64px;
  --video-load-button-color: #f5f5f5;
  --video-load-button-bg: #d62828;
  --video-load-button-border: #d62828;
  --video-sm-load-button-size: 48px;
  --video-sm-play-button-size: 48px;
  --video-sm-play-button-bg: #d62828;
  --media-buffering-size: 42px;
}
.source-note { padding: 11px 4px 2px; color: #aab2bd; font-size: 13px; }
.source-note code { color: #dce3ec; }
.debug-card { margin-top: 18px; padding: 18px; }
.debug-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; }
.debug-head h1 { margin: 0; font-size: 18px; }
#statusBadge { border-radius: 999px; background:#272d35; padding:6px 10px; font-size:12px; color:#cdd5df; }
.debug-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.debug-grid > div { min-width:0; background:#0c0f13; border:1px solid #232931; border-radius:10px; padding:11px; }
.debug-grid small { display:block; color:#8993a1; margin-bottom:5px; }
.debug-grid strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.debug-grid .debug-wide { grid-column: span 2; }
.debug-grid .debug-wide strong { white-space: normal; overflow: visible; word-break: break-word; }
.milestones { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
.milestones span { border:1px solid #303845; color:#8993a1; border-radius:999px; padding:5px 9px; font-size:12px; }
.milestones span.hit { color:#fff; border-color:#5f6b7a; background:#242b34; }
#eventLog { margin:0; max-height:220px; overflow:auto; white-space:pre-wrap; word-break:break-word; background:#080a0d; border:1px solid #202630; border-radius:10px; padding:12px; color:#bac4d0; font-size:12px; line-height:1.55; }
@media (max-width: 820px) { .debug-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 520px) { .debug-grid .debug-wide { grid-column: 1 / -1; } .page-shell { width:min(100% - 16px,1120px); margin-top:8px; } .player-card { padding:6px; border-radius:12px; } .debug-card { padding:12px; } .debug-grid { grid-template-columns:1fr 1fr; } }

/* Escolha de retomada */
.player-stage { position: relative; width: 100%; aspect-ratio: var(--video-aspect, 16 / 9); margin-inline: auto; background: #000; border-radius: 12px; overflow: hidden; }
.resume-choice[hidden] { display: none !important; }
.resume-choice {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
}
.resume-choice__panel {
  width: min(520px, 100%);
  background: rgba(13, 16, 21, .96);
  border: 1px solid #303743;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  text-align: center;
}
.resume-choice__eyebrow {
  color: #9ba6b4;
  font-size: 13px;
  margin-bottom: 7px;
}
.resume-choice__panel h2 {
  margin: 0 0 8px;
  font-size: clamp(20px, 4vw, 28px);
}
.resume-choice__panel p {
  margin: 0 0 20px;
  color: #b7c0cc;
}
.resume-choice__actions {
  display: grid;
  gap: 10px;
}
.resume-choice__button {
  width: 100%;
  appearance: none;
  border: 1px solid #3a424e;
  border-radius: 11px;
  padding: 14px 16px;
  background: #171c22;
  color: #f5f7fa;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.resume-choice__button:hover { background: #20262e; }
.resume-choice__button--primary {
  background: #f4f6f8;
  color: #0c0f13;
  border-color: #f4f6f8;
}
.resume-choice__button--primary:hover { background: #dfe4ea; }
.resume-choice__button:focus-visible {
  outline: 3px solid rgba(255,255,255,.55);
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .resume-choice { padding: 10px; }
  .resume-choice__panel { padding: 18px 14px; }
  .resume-choice__button { padding: 13px 12px; }
}

/* Modo iframe: somente o player, sem moldura externa. */
html.embed-mode, body.embed-mode{height:100dvh;background:#000;overflow:hidden}
body.embed-mode .page-shell,
body.embed-mode .player-card,
body.embed-mode .player-stage{height:100%;min-height:0}
body.embed-mode .page-shell{width:100%;margin:0}
body.embed-mode .player-card{padding:0;border:0;border-radius:0;box-shadow:none;background:#000}
body.embed-mode media-player{border-radius:0}
body.embed-mode .player-stage{width:100%;aspect-ratio:auto;border-radius:0}
