:root {
  --header-height: clamp(58px, 8vw, 84px);
  --footer-height: clamp(58px, 8vw, 84px);
  --logo-width: clamp(76px, 10vw, 120px);
  --panel-width: min(76vw, 520px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html {
  background-color: #e8e8e8;
  background-image: url("../website%20assets/Background.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: transparent;
  color: #222;
}

.page-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  height: var(--header-height);
}

.page-header > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-brand-cluster {
  position: absolute;
  right: clamp(18px, 3vw, 44px);
  top: 50%;
  z-index: 21;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(6px, 1vw, 12px);
  transform: translateY(-50%);
}

.header-brand-cluster .brand-logo {
  position: static;
  transform: none;
  width: var(--logo-width);
  max-height: calc(var(--header-height) - 10px);
  object-fit: contain;
  display: block;
}

.language-home-button {
  height: clamp(32px, calc(var(--header-height) - 18px), 50px);
  width: auto;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-home-button img {
  height: 100%;
  width: auto;
  max-width: min(44px, 12vw);
  object-fit: contain;
  display: block;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.language-home-button:hover img,
.language-home-button:focus-visible img {
  filter: brightness(1.08);
}

.language-home-button:focus-visible {
  outline: 2px solid #d7ac2f;
  outline-offset: 2px;
}

.brand-logo {
  position: absolute;
  right: clamp(18px, 3vw, 44px);
  top: 50%;
  width: var(--logo-width);
  max-height: calc(var(--header-height) - 10px);
  object-fit: contain;
  transform: translateY(-50%);
}

.header-docudrama-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: #d7ac2f;
  font-size: clamp(16px, 2.1vw, 28px);
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.header-left-actions {
  position: absolute;
  left: clamp(10px, 2.4vw, 22px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 21;
  display: flex;
  align-items: center;
  gap: clamp(4px, 1vw, 10px);
}

.back-button {
  height: clamp(34px, calc(var(--header-height) - 14px), 56px);
  width: auto;
  max-width: 38vw;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.back-button img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.mute-button {
  height: clamp(34px, calc(var(--header-height) - 14px), 56px);
  width: auto;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.mute-button img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.home-content {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-height) + 42px) 16px calc(var(--footer-height) + 28px);
}

.language-selection {
  width: var(--panel-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.language-title {
  width: 100%;
  display: block;
  margin-bottom: 2px;
}

.language-item {
  width: 82%;
  display: block;
  transition: transform 120ms ease, filter 120ms ease;
}

.language-item img,
.story-item img {
  width: 100%;
  display: block;
}

.language-item:hover,
.story-item:hover {
  transform: scale(1.02);
  filter: brightness(1.06);
}

.story-item {
  width: 82%;
  display: block;
  transition: transform 120ms ease, filter 120ms ease;
}

#story-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.is-disabled {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.78;
}

.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-height);
  border-top: 4px solid #d7ac2f;
  overflow: hidden;
}

.page-footer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-content {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(520px, 1.8fr) minmax(260px, 1fr);
  align-items: center;
  gap: 28px;
  padding: calc(var(--header-height) + 20px) clamp(18px, 4vw, 46px) calc(var(--footer-height) + 20px);
}

.video-panel {
  width: 100%;
}

.video-frame {
  width: 100%;
  background: #747474;
  border: 14px solid #747474;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.video-frame iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
  background: #111;
}

.pro-player {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.pro-player .plyr {
  height: 100%;
}

.question-panel {
  text-align: center;
  color: #262626;
}

.docudrama-title {
  margin: 0 0 10px;
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 800;
  color: #a01515;
}

.question-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.question-title-row h2 {
  margin: 0;
  font-size: clamp(20px, 2.1vw, 33px);
  color: #161616;
}

.question-nav {
  width: clamp(34px, 4.6vw, 58px);
  cursor: pointer;
}

.question-text {
  margin: 12px auto 18px;
  max-width: 300px;
  line-height: 1.38;
  font-size: clamp(14px, 1.2vw, 18px);
}

.answer-text {
  margin: 0 auto 18px;
  max-width: 300px;
  line-height: 1.38;
  font-size: clamp(14px, 1.2vw, 18px);
  color: #a01515;
  font-weight: 700;
}

.story-label {
  margin: 0;
  font-size: 18px;
  color: #a01515;
}

.story-name {
  margin: 4px 0;
  font-size: 22px;
  font-weight: 700;
}

.language-name {
  margin: 0;
  font-size: 15px;
  opacity: 0.75;
}

@media (max-width: 900px) {
  .language-selection {
    width: min(92vw, 560px);
  }

  .language-item {
    width: 92%;
  }

  .player-content {
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
  }

  .question-panel {
    padding-bottom: 12px;
  }
}

/* ----- App loading overlay (blurred page, logo + ring) ----- */
html.is-app-loading {
  overflow: hidden;
}

html.is-app-loading body {
  overflow: hidden;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.app-loading.app-loading--done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loading__scrim {
  position: absolute;
  inset: 0;
  background: rgba(74, 4, 4, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.app-loading__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.app-loading__orbit {
  position: relative;
  width: clamp(120px, 28vw, 168px);
  height: clamp(120px, 28vw, 168px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-loading__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(215, 172, 47, 0.22);
  border-top-color: #d7ac2f;
  border-right-color: rgba(215, 172, 47, 0.55);
  animation: app-loading-spin 1s linear infinite;
  box-shadow: 0 0 0 1px rgba(160, 21, 21, 0.15);
}

.app-loading__logo {
  position: relative;
  z-index: 1;
  width: clamp(56px, 14vw, 88px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-loading__logo img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

@keyframes app-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading__ring {
    animation-duration: 2s;
  }

  .app-loading.app-loading--done {
    transition-duration: 0.15s;
  }
}
