:root {
  --cgil-red: #db2609;
  --ink: #161616;
  --ink-soft: #666;
}

html,
body {
  height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #b31f08 0%, var(--cgil-red) 45%, #f15433 100%);
  z-index: 20;
}

.page-wrap {
  width: min(98vw, 2600px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(10px, 2vh, 24px) 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(8px, 1.6vh, 16px);
}

.hero {
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero::after {
  content: "";
  display: block;
  width: min(200px, 40vw);
  height: 2px;
  margin: 9px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(219, 38, 9, 0.1), rgba(219, 38, 9, 0.9), rgba(219, 38, 9, 0.1));
}

.player-center {
  display: grid;
  place-items: center;
  min-height: 0;
}

.player-card {
  width: min(100%, 2600px, calc((100svh - 170px) * 16 / 9));
  padding: 0;
}

.stream-status {
  margin: 0 0 6px;
  text-align: center;
  color: var(--ink-soft);
  font-size: clamp(0.8rem, 0.9vw, 0.98rem);
}

.video-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e8d2cd;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

#ivs-player {
  width: 100%;
  height: 100%;
  display: block;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  pointer-events: none;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  padding: 16px;
}

.video-overlay.is-hidden {
  display: none;
}

.overlay-title {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.45rem);
  font-weight: 600;
}

@media (min-width: 1700px) {
  .page-wrap {
    width: min(98vw, 3000px);
  }

  .player-card {
    width: min(100%, 3000px, calc((100svh - 190px) * 16 / 9));
  }
}

@media (orientation: landscape) and (max-height: 780px) {
  .page-wrap {
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 8px;
  }

  .hero h1 {
    font-size: clamp(1rem, 2vw, 1.5rem);
  }

  .hero::after {
    margin-top: 6px;
  }

  .player-card {
    width: min(100%, 2200px, calc((100svh - 110px) * 16 / 9));
  }
}

@media (max-width: 740px) {
  .page-wrap {
    width: 94vw;
    padding: 14px 0;
    gap: 10px;
  }

  .hero h1 {
    font-size: clamp(1.1rem, 5.2vw, 1.6rem);
  }

  .player-card {
    width: 100%;
  }
}

@media (max-width: 740px) and (orientation: landscape) {
  .page-wrap {
    width: 96vw;
    padding: 8px 0;
    gap: 6px;
  }

  .hero h1 {
    font-size: clamp(0.95rem, 3.4vw, 1.2rem);
  }

  .hero::after {
    margin-top: 4px;
    height: 1px;
  }

  .player-card {
    width: min(100%, calc((100svh - 78px) * 16 / 9));
  }
}
