:root {
  --navy-deep: #081433;
  --glass: rgb(8 20 51 / .55);
  --glass-hover: rgb(255 255 255 / .14);
  --icon: #F4F6FB;
  --gilt: #E3B861;

  --edge: 16px;
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--navy-deep);
}

body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Khung chiếu: luôn đúng bằng viewport, không cuộn */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--navy-deep);
}

/* Video căng kín toàn màn hình (giống kjc20250.com): không cắt mép, không chừa viền */
.stage__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.stage__play {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--icon);
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.stage__play svg {
  width: 30px;
  height: 30px;
  margin-left: 4px; /* căn giữa thị giác cho tam giác */
}

.stage__play:hover {
  background: rgb(8 20 51 / .75);
}

/* Cụm nút góc dưới phải */
.controls {
  position: absolute;
  right: calc(var(--edge) + var(--safe-r));
  bottom: calc(var(--edge) + var(--safe-b));
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: opacity .3s ease;
}

.controls__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--icon);
  background: transparent;
  cursor: pointer;
}

.controls__btn:hover {
  background: var(--glass-hover);
}

.controls__btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.controls__btn[aria-pressed="true"] {
  color: var(--gilt);
}

/* Mỗi nút có 2 icon: icon-a là trạng thái mặc định, icon-b khi nút ở trạng thái còn lại */
.icon-b,
.controls__btn.is-alt .icon-a,
.controls__btn[aria-pressed="true"] .icon-a {
  display: none;
}

.controls__btn.is-alt .icon-b,
.controls__btn[aria-pressed="true"] .icon-b {
  display: block;
}

.stage__play[hidden],
.controls[hidden],
.controls__btn[hidden] {
  display: none;
}

/* Tự ẩn khi không thao tác */
.stage.is-idle {
  cursor: none;
}

.stage.is-idle .controls {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 600px) {
  :root {
    --edge: 12px;
  }

  .stage__play {
    width: 56px;
    height: 56px;
  }

  .stage__play svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .controls {
    transition: none;
  }
}
