:root {
  color-scheme: light;
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: #f5f8f7;
  color: #263c3a;
  --control-surface: rgba(42, 43, 46, 0.22);
  --control-ink: rgba(255, 255, 255, 0.94);
  --control-outline: rgba(66, 68, 72, 0.65);
}

* { box-sizing: border-box; }
html, body, .motion { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; }
.motion { position: relative; isolation: isolate; overflow: hidden; }
#player { position: absolute; inset: 0; pointer-events: none; }
.motion__poster { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.motion[data-state="loading"] #player { opacity: 0; }

button { font: inherit; -webkit-tap-highlight-color: transparent; touch-action: pan-y pinch-zoom; }
.motion__toggle {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.motion__toggle:disabled { cursor: wait; }
.motion__toggle:focus-visible { outline: 2px solid var(--control-outline); outline-offset: -4px; border-radius: 20px; }
.motion__transport {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  padding: 12px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--control-ink);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.motion__transport-disc,
.motion__replay {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--control-surface);
  color: var(--control-ink);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.motion__transport-disc {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
}
.motion__pause-icon { display: none; }
.motion[data-state="playing"] .motion__play-icon { display: none; }
.motion[data-state="playing"] .motion__pause-icon { display: block; }
.motion[data-state="paused"] .motion__transport,
.motion[data-state="ended"] .motion__transport,
.motion[data-controls="visible"] .motion__transport,
.motion:has(:focus-visible) .motion__transport {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.motion__transport:disabled { visibility: hidden !important; pointer-events: none; }
.motion__transport:focus-visible { outline: 2px solid var(--control-outline); outline-offset: 3px; }
.motion__replay {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, border-color 160ms ease;
}
.motion:hover .motion__replay,
.motion:has(:focus-visible) .motion__replay,
.motion[data-state="error"] .motion__replay { opacity: 1; pointer-events: auto; }
.motion__transport:hover .motion__transport-disc,
.motion__replay:hover { border-color: rgba(255, 255, 255, 0.34); }
.motion__replay:focus-visible { outline: 2px solid var(--control-outline); outline-offset: 2px; }
.motion__replay:disabled { opacity: 0; pointer-events: none; }
.motion__error { position: absolute; inset: 35% 12px auto; padding: 20px 12px; border-radius: 12px; background: #fff; font-size: 14px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (hover: none) {
  .motion__replay { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .motion__replay, .motion__transport { transition: none; }
}
