:root {
  --bg: rgb(175, 210, 225);
  --panel-bg: #ffffff;
  --navy: rgb(0, 60, 114);
  --navy-soft: rgb(95, 164, 195);
  --pale: rgb(175, 210, 225);
  --text: #1a1f2a;
  --muted: #64748b;
  --dark: rgb(8, 22, 32);
  --shadow: rgba(0, 18, 32, 0.18);
  --header-height: 126px;
  --footer-height: 188px;
  --border-radius: 22px;
  --player-width: min(57vw, 620px);
  --preview-width: min(38vw, 410px);
  --safe-side: 24px;
  --qr-size: 206px;
  --vh: 1vh;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
}

body {
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
  background: linear-gradient(180deg, rgb(175, 210, 225) 0%, rgb(198, 222, 234) 100%);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 32px 24px;
  background: linear-gradient(180deg, rgb(0, 60, 114) 0%, rgb(2, 42, 80) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 30;
}

.brand-wrap {
  width: min(62vw, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.05));
}

.main-panel {
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0 18px;
}

.carousel-wrap {
  position: relative;
  width: min(100%, 1080px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage {
  position: relative;
  width: min(92vw, 860px);
  height: min(73vh, 1050px);
  min-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.center-card,
.preview-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--player-width);
  height: calc(var(--player-width) * 16 / 9);
  border-radius: var(--border-radius);
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: #0c1015;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.18);
  transition: transform 0.48s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.42s ease, filter 0.42s ease, width 0.42s ease;
}

.center-card {
  z-index: 7;
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.20), 0 0 0 1px rgba(255,255,255,0.12);
}

.preview-card {
  width: var(--preview-width);
  height: calc(var(--preview-width) * 16 / 9);
  z-index: 2;
  opacity: 0.48;
  filter: saturate(0.45) brightness(0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

.preview-card .preview-media {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: brightness(0.72);
}

.preview-prev {
  transform: translate(-52%, -50%) translateX(-178px) scale(0.88);
}

.preview-next {
  transform: translate(-48%, -50%) translateX(178px) scale(0.88);
}

.center-card[data-position="prev"] {
  transform: translate(-50%, -50%) scale(0.78);
  opacity: 0.1;
}

.player-frame,
.player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 11, 17, 0.26);
  z-index: 15;
  transition: opacity 0.28s ease;
}

.play-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.play-button {
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 16px 26px;
  cursor: pointer;
  backdrop-filter: blur(2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.sound-toggle {
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 20;
  background: rgba(0, 60, 114, 0.9);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.22s ease;
}

.sound-toggle:hover,
.sound-toggle:focus-visible,
.nav-button:hover,
.nav-button:focus-visible,
.play-button:hover,
.play-button:focus-visible,
.pager-dot:hover,
.pager-dot:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.sound-toggle:focus-visible,
.nav-button:focus-visible,
.play-button:focus-visible,
.pager-dot:focus-visible {
  box-shadow: 0 0 0 3px rgba(95, 164, 195, 0.55);
}

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid rgba(0, 60, 114, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: var(--navy);
  font-size: 2.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 26px rgba(15, 25, 32, 0.12);
  z-index: 11;
  cursor: pointer;
}

.nav-prev {
  left: 2.5%;
}

.nav-next {
  right: 2.5%;
}

.pager {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 18;
  padding: 8px 14px;
  background: rgba(255,255,255,0.38);
  border-radius: 999px;
  border: 1px solid rgba(0, 60, 114, 0.08);
  backdrop-filter: blur(4px);
}

.pager-count {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 4px;
}

.pager-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(0, 60, 114, 0.25);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease;
}

.pager-dot.is-active {
  background: var(--navy);
  box-shadow: 0 0 0 2px rgba(0, 60, 114, 0.18);
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 18px 30px 22px 38px;
  background: linear-gradient(180deg, rgb(6, 25, 43) 0%, rgb(0, 60, 114) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 25;
}

.footer-copy {
  flex: 1;
  min-width: 0;
  color: #ffffff;
}

.footer-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 1.8vw, 2rem);
  line-height: 1.2;
  color: #ffffff;
}

.cta {
  margin: 0 0 8px;
  font-size: clamp(1rem, 1.45vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgb(175, 210, 225);
}

.supporting-text {
  margin: 0;
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.98rem;
  line-height: 1.45;
}

.fallback-url {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.01em;
  word-break: break-word;
}

.qr-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 10px 16px 10px 8px;
}

.qr-frame {
  width: var(--qr-size);
  height: var(--qr-size);
  background: #fff;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

.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 (max-width: 900px) {
  :root {
    --header-height: 120px;
    --footer-height: 170px;
    --qr-size: 200px;
  }

  .stage {
    width: min(94vw, 640px);
    min-height: 420px;
  }

  .nav-button {
    width: 56px;
    height: 56px;
  }

  .preview-prev {
    transform: translate(-52%, -50%) translateX(-120px) scale(0.85);
  }

  .preview-next {
    transform: translate(-48%, -50%) translateX(120px) scale(0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
