/* ============================================================
   Arcade Demo — image trigger (image with play-icon overlay)
   ============================================================ */
.arcade-demo__thumb {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  width: 100%;
}

.arcade-demo__thumb img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.arcade-demo__thumb:hover,
.arcade-demo__thumb:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
}

.arcade-demo__thumb:focus-visible {
  outline: 3px solid #2c7ad4;
  outline-offset: 3px;
}

.arcade-demo__play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #0a3d5e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease, background 0.18s ease;
  pointer-events: none;
}

.arcade-demo__thumb:hover .arcade-demo__play,
.arcade-demo__thumb:focus-visible .arcade-demo__play {
  transform: translate(-50%, -50%) scale(1.08);
  background: #ffffff;
}

/* ============================================================
   Arcade Demo — modal
   ============================================================ */
.arcade-modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  margin: 0;
  inset: 0;
  color: #fff;
  overflow: hidden;
}

.arcade-modal::backdrop {
  background: rgba(0, 0, 0, 0.9);
}

.arcade-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .arcade-modal[open] {
    padding: 48px;
  }
}

.arcade-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease;
  z-index: 2;
}

.arcade-modal__close:hover,
.arcade-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.24);
}

.arcade-modal__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.arcade-modal__frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  margin: auto;
}

.arcade-modal__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  color-scheme: light;
}

body.arcade-modal-open {
  overflow: hidden;
}

/* Optional fade-in. Browsers without @starting-style fall back to instant open. */
@starting-style {
  .arcade-modal[open] {
    opacity: 0;
  }
  .arcade-modal[open]::backdrop {
    opacity: 0;
  }
}

.arcade-modal {
  transition: opacity 0.2s ease, overlay 0.2s ease allow-discrete, display 0.2s ease allow-discrete;
}

.arcade-modal::backdrop {
  transition: opacity 0.2s ease, overlay 0.2s ease allow-discrete, display 0.2s ease allow-discrete;
}
