:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --panel-2: #eef2f8;
  --line: #d6deea;
  --text: #1c2738;
  --muted: #5d6f8c;
  --accent: #1f6fff;
  --danger: #d93636;
  --canvas-bg: #dde4ef;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", "Arial", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
  padding: 0.44rem 0.66rem;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.03);
}

button.primary {
  background: var(--accent);
  border-color: #1759cd;
  color: #ffffff;
  font-weight: 700;
}

button.danger {
  background: #ffecec;
  border-color: #ffb8b8;
  color: #912121;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
}

input[type="checkbox"] {
  width: auto;
  margin-top: 0;
  margin-right: 0.42rem;
  vertical-align: middle;
}

#button-attempt-fullscreen-row,
#button-bold-row {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

#button-bold-row {
  margin-top: 1.45rem;
}

#button-attempt-fullscreen-row input[type="checkbox"],
#button-bold-row input[type="checkbox"] {
  margin-right: 0;
}

textarea {
  resize: vertical;
}

label {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 0.5rem;
}

h2,
h3,
h4 {
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1rem;
}

h3 {
  font-size: 0.95rem;
}

h4 {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.hidden {
  display: none !important;
}


.runtime-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.runtime-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.runtime-background {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  z-index: 0;
}

.runtime-background-pattern-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.runtime-background-video-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 180ms ease;
}

.runtime-background-video-layer.is-ready {
  opacity: 1;
}

.runtime-background-video-layer.is-hidden {
  opacity: 0;
}

.runtime-background-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.runtime-background-video-overlay {
  position: absolute;
  inset: 0;
  background: #000000;
  pointer-events: none;
}

.runtime-background-brightness-overlay {
  position: absolute;
  inset: 0;
  background: #000000;
  pointer-events: none;
  z-index: 2;
}

.runtime-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 60;
}

.runtime-viewport-scroller-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: visible;
  pointer-events: none;
}

.runtime-stage {
  position: absolute;
  width: 1280px;
  height: 720px;
  transform-origin: top left;
  overflow: hidden;
  background: transparent;
  z-index: 1;
}

.runtime-slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.runtime-element {
  position: absolute;
}

.runtime-text {
  display: block;
  overflow: hidden;
  white-space: pre-wrap;
}

.runtime-rich-text-content .ql-color-orange,
.runtime-rich-text-content .ql-color-ff8c00 {
  color: #ff8c00;
}

.runtime-rich-text-content .ql-color-brown,
.runtime-rich-text-content .ql-color-8b4513 {
  color: #8b4513;
}

.runtime-rich-text-content .ql-color-cyan,
.runtime-rich-text-content .ql-color-00ffff {
  color: #00ffff;
}

.runtime-rich-text-content .ql-color-pink,
.runtime-rich-text-content .ql-color-ff69b4 {
  color: #ff69b4;
}

.runtime-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.runtime-video,
.runtime-audio-player {
  width: 100%;
  height: 100%;
  display: block;
}

.runtime-embed-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.runtime-embed-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #dbe7ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(219, 231, 255, 0.45);
  font-size: 0.9rem;
}

.runtime-particle-host {
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  position: relative;
}

.runtime-particle-host canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.runtime-button-element {
  cursor: pointer;
}

.runtime-nav {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.7rem;
  z-index: 40;
}

.runtime-nav button {
  min-width: 84px;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #475569;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-weight: 600;
}

.runtime-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.runtime-scorm-completion-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 56;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  background: #1f6fff;
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}

.runtime-scorm-completion-text {
  font-size: 0.92rem;
  line-height: 1.4;
  font-weight: 600;
}

.runtime-scorm-completion-btn {
  min-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: #ffffff;
  color: #1f6fff;
  padding: 0.5rem 0.95rem;
  font-weight: 700;
}

.runtime-scorm-completion-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.runtime-scorm-completion-bar.is-working .runtime-scorm-completion-btn {
  background: #dbeafe;
  color: #1e40af;
}

.runtime-scorm-completion-bar.is-error {
  background: #1d4ed8;
}

.runtime-presentation-menu {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 300px;
  z-index: 52;
  pointer-events: auto;
}

.runtime-presentation-menu.is-left {
  left: 0;
}

.runtime-presentation-menu.is-right {
  right: 0;
}

.runtime-presentation-menu-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 280px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.58rem;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

.runtime-presentation-menu.is-left .runtime-presentation-menu-panel {
  left: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.runtime-presentation-menu.is-right .runtime-presentation-menu-panel {
  right: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.runtime-presentation-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.runtime-presentation-menu-pin {
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(0, 0, 0, 0.24);
  color: inherit;
  font: inherit;
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  cursor: pointer;
}

.runtime-presentation-menu-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--menu-gap, 10px);
  padding-right: 0.2rem;
}

.runtime-presentation-menu-item {
  border: 0;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--menu-text, #e5e7eb);
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
}

.runtime-presentation-menu-item:hover {
  color: var(--menu-hover, #93c5fd);
  background: rgba(255, 255, 255, 0.08);
}

.runtime-presentation-menu-item.is-active {
  color: var(--menu-active, #f8fafc);
  background: rgba(255, 255, 255, 0.16);
  font-weight: 700;
}

.runtime-presentation-menu-item.is-missing {
  opacity: 0.48;
  cursor: default;
}

.runtime-presentation-menu-submenu {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.runtime-presentation-menu-submenu-toggle {
  border: 0;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  color: var(--menu-text, #e5e7eb);
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.34rem 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.runtime-presentation-menu-submenu-toggle:hover {
  color: var(--menu-hover, #93c5fd);
  background: rgba(255, 255, 255, 0.1);
}

.runtime-presentation-menu-submenu-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-presentation-menu-submenu-chevron {
  font-size: 0.72rem;
  opacity: 0.88;
  transition: transform 180ms ease;
}

.runtime-presentation-menu-submenu.is-expanded .runtime-presentation-menu-submenu-chevron {
  transform: rotate(90deg);
}

.runtime-presentation-menu-submenu-list {
  display: none;
  flex-direction: column;
  gap: calc(var(--menu-gap, 10px) * 0.65);
  padding-left: 0.52rem;
}

.runtime-presentation-menu-submenu.is-expanded .runtime-presentation-menu-submenu-list {
  display: flex;
}

.runtime-presentation-menu-item.is-submenu-item {
  opacity: 0.96;
}

.runtime-presentation-menu-submenu-empty {
  opacity: 0.55;
  font-size: 0.84em;
  padding: 0.15rem 0.45rem;
}

.runtime-presentation-menu-divider.is-submenu-divider {
  margin-left: 0.45rem;
  margin-right: 0.45rem;
}

.runtime-presentation-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.24);
  margin: 0.08rem 0.2rem;
}

.runtime-presentation-menu-handle {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 74px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.64) 0%, rgba(2, 6, 23, 0.82) 100%);
  color: #e5e7eb;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.45);
}

.runtime-presentation-menu.is-right .runtime-presentation-menu-handle {
  border-radius: 8px 0 0 8px;
}

.runtime-presentation-menu-handle:hover {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.72) 0%, rgba(15, 23, 42, 0.9) 100%);
}

.runtime-presentation-menu-handle:active {
  transform: translateY(-50%) translateX(1px);
}

.runtime-presentation-menu.is-right .runtime-presentation-menu-handle:active {
  transform: translateY(-50%) translateX(-1px);
}

.runtime-presentation-menu-handle-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  opacity: 0.98;
}

.runtime-presentation-menu-handle-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  transform-origin: 50% 50%;
  transition: transform 180ms ease;
  filter: drop-shadow(0 0 0.5px rgba(248, 250, 252, 0.9));
}

.runtime-presentation-menu-handle.is-point-left .runtime-presentation-menu-handle-icon svg {
  transform: rotate(0deg);
}

.runtime-presentation-menu-handle.is-point-right .runtime-presentation-menu-handle-icon svg {
  transform: rotate(180deg);
}

.runtime-presentation-menu-handle-grip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.runtime-presentation-menu-handle-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.72);
}

.runtime-presentation-menu-handle:hover .runtime-presentation-menu-handle-dot {
  background: rgba(226, 232, 240, 0.78);
}

.runtime-presentation-menu.is-left .runtime-presentation-menu-handle {
  left: 280px;
}

.runtime-presentation-menu.is-right .runtime-presentation-menu-handle {
  right: 280px;
}

.runtime-presentation-menu.is-auto-hide.is-collapsed .runtime-presentation-menu-panel {
  opacity: 0.25;
}

.runtime-presentation-menu.is-auto-hide.is-collapsed {
  width: 22px;
}

.runtime-presentation-menu.is-auto-hide.is-collapsed.is-left .runtime-presentation-menu-panel {
  transform: translateX(-100%);
}

.runtime-presentation-menu.is-auto-hide.is-collapsed.is-right .runtime-presentation-menu-panel {
  transform: translateX(100%);
}

.runtime-presentation-menu.is-auto-hide.is-collapsed.is-left .runtime-presentation-menu-handle {
  left: 0;
}

.runtime-presentation-menu.is-auto-hide.is-collapsed.is-right .runtime-presentation-menu-handle {
  right: 0;
}

.runtime-presentation-menu.is-auto-hide .runtime-presentation-menu-panel,
.runtime-presentation-menu.is-auto-hide .runtime-presentation-menu-handle {
  transition: transform 180ms ease, opacity 180ms ease, left 180ms ease, right 180ms ease;
}

.runtime-presentation-menu.is-collapsed {
  width: 22px;
}

.runtime-presentation-menu.is-collapsed.is-left .runtime-presentation-menu-panel {
  transform: translateX(-100%);
}

.runtime-presentation-menu.is-collapsed.is-right .runtime-presentation-menu-panel {
  transform: translateX(100%);
}

.runtime-presentation-menu.is-collapsed.is-left .runtime-presentation-menu-handle {
  left: 0;
}

.runtime-presentation-menu.is-collapsed.is-right .runtime-presentation-menu-handle {
  right: 0;
}

.runtime-presentation-menu .runtime-presentation-menu-panel,
.runtime-presentation-menu .runtime-presentation-menu-handle {
  transition: transform 180ms ease, opacity 180ms ease, left 180ms ease, right 180ms ease;
}

.runtime-fullscreen-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 55;
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  padding: 0;
  line-height: 0;
  border: 1px solid rgba(203, 213, 225, 0.32);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.22);
  color: #e2e8f0;
  display: grid;
  place-items: center;
  opacity: 0.2;
  transition: opacity 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.runtime-fullscreen-toggle:hover,
.runtime-fullscreen-toggle:focus-visible {
  opacity: 0.92;
  background: rgba(15, 23, 42, 0.74);
  border-color: rgba(203, 213, 225, 0.82);
}

.runtime-fullscreen-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

.runtime-diagnostics-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 55;
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  padding: 0;
  line-height: 0;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.62);
  background: rgba(15, 23, 42, 0.46);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.72;
}

.runtime-diagnostics-toggle:hover,
.runtime-diagnostics-toggle:focus-visible {
  opacity: 0.92;
  background: rgba(15, 23, 42, 0.74);
  border-color: rgba(203, 213, 225, 0.82);
}

.runtime-diagnostics-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

.runtime-diagnostics-overlay {
  position: absolute;
  inset: 0;
  z-index: 70;
  background: rgba(2, 6, 23, 0.58);
  display: grid;
  place-items: center;
  padding: 0.9rem;
}

.runtime-diagnostics-modal {
  width: min(760px, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.96);
  color: #e2e8f0;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.6);
}

.runtime-diagnostics-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.48);
  background: rgba(2, 6, 23, 0.98);
}

.runtime-diagnostics-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.runtime-diagnostics-actions {
  display: inline-flex;
  gap: 0.4rem;
}

.runtime-diagnostics-actions button {
  border: 1px solid rgba(100, 116, 139, 0.58);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.34rem 0.55rem;
}

.runtime-diagnostics-actions button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.runtime-diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.75rem;
}

.runtime-diagnostics-section {
  border: 1px solid rgba(100, 116, 139, 0.4);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.56);
  padding: 0.58rem 0.62rem;
}

.runtime-diagnostics-section h4 {
  margin: 0 0 0.48rem;
  font-size: 0.8rem;
  color: #bfdbfe;
}

.runtime-diagnostics-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.74rem;
  line-height: 1.35;
  padding: 0.12rem 0;
}

.runtime-diagnostics-row span {
  color: #cbd5e1;
}

.runtime-diagnostics-row strong {
  color: #f8fafc;
  text-align: right;
}

.runtime-portrait-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 50;
  max-width: 280px;
  background: rgba(2, 6, 23, 0.86);
  border: 1px solid #475569;
  border-radius: 10px;
  padding: 0.7rem;
  color: #e2e8f0;
  font-size: 0.85rem;
}

.runtime-portrait-overlay button {
  margin-top: 0.5rem;
  width: 100%;
}

.runtime-countdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.12);
}

.runtime-countdown-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
}

.runtime-countdown-label {
  position: absolute;
  bottom: 12px;
  z-index: 46;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.runtime-countdown-label.left {
  left: 12px;
  text-align: left;
}

.runtime-countdown-label.right {
  right: 12px;
  text-align: right;
}

@media (max-width: 767px) {
  .runtime-fullscreen-toggle {
    display: none;
  }

  .runtime-diagnostics-grid {
    grid-template-columns: 1fr;
  }

  .runtime-scorm-completion-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .runtime-scorm-completion-btn {
    width: 100%;
  }
}

.runtime-anim {
  will-change: transform, opacity;
}

.shape-svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}


.runtime-form {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: auto;
}

.runtime-form-field {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.runtime-form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
}

.runtime-form-select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
}

.runtime-form-radio-group {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.runtime-form-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.runtime-form-inline input[type="radio"] {
  width: auto;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
}

.runtime-form-submit {
  padding: 10px 14px;
  cursor: pointer;
}

@keyframes runtime-progress-stripes {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 0;
  }
}
