.watch-calendar,
.watch-calendar-day-dialog {
  --calendar-ink: #f2eef6;
  --calendar-muted: #b9b0c3;
  --calendar-line: #ded8ec27;
  --calendar-season: #8bdcb6;
  --calendar-premiere: #f6cc88;
  --calendar-finale: #dfbaff;
  color: var(--calendar-ink);
}

:is(.watch-calendar, .watch-calendar-day-dialog) :where(button) {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
}

.watch-calendar :is(h2, h3, p), .watch-calendar-day-dialog :is(h3, p) { margin: 0; }
.watch-calendar .studio-release-heading { padding-bottom: 12px; }
.watch-calendar-heading h2 {
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: 1.08;
}

.watch-calendar-hub {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 60px);
  padding: clamp(24px, 6vw, 88px) clamp(16px, 4vw, 54px) clamp(44px, 12vw, 150px);
  background: #16131d;
  border-radius: 14px;
}

.watch-calendar-artwork {
  --slant: clamp(20px, 8vw, 115px);
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

.watch-calendar-artwork img {
  position: absolute;
  top: 0;
  left: calc(var(--offset) - var(--slant) / 2);
  width: calc(20% + var(--slant) + 1px);
  height: 100%;
  object-fit: cover;
  object-position: var(--focus) center;
  clip-path: polygon(var(--top-left, var(--slant)) 0, 100% 0,
    var(--bottom-right, calc(100% - var(--slant))) 100%, 0 100%);
}

.watch-calendar-artwork > :nth-child(1) { --offset: 0%; --focus: 98%; --top-left: 0; }
.watch-calendar-artwork > :nth-child(2) { --offset: 20%; --focus: 67%; }
.watch-calendar-artwork > :nth-child(3) { --offset: 40%; --focus: 40%; }
.watch-calendar-artwork > :nth-child(4) { --offset: 60%; --focus: 36%; }
.watch-calendar-artwork > :nth-child(5) { --offset: 80%; --focus: 51%; --bottom-right: 100%; }

.watch-calendar-portrait { display: contents; }
.watch-calendar-portrait:nth-child(1) { --focus: 68%; }
.watch-calendar-portrait:nth-child(2) { --focus: 35%; }
.watch-calendar-portrait:nth-child(3) { --focus: 50%; }
.watch-calendar-portrait:nth-child(4) { --focus: 50%; }
.watch-calendar-portrait:nth-child(5) { --focus: 56%; }

.watch-calendar-leon { display: contents; }
.watch-calendar[data-mode="games"] .watch-calendar-leon img {
  --offset: 60%;
  --focus: 21%;
  object-view-box: inset(0 32% 55% 4%);
}

@media (max-width: 630px) {
  .watch-calendar[data-mode="games"] .watch-calendar-artwork > img:nth-child(1) { --focus: 88%; }
  .watch-calendar[data-mode="games"] .watch-calendar-artwork > img:nth-child(2) { --focus: 72%; }
  .watch-calendar[data-mode="games"] .watch-calendar-artwork > img:nth-child(5) { --focus: 56%; }
  .watch-calendar-leon {
    display: block;
    position: absolute;
    inset: 0 auto 0 calc(60% - var(--slant) / 2);
    width: calc(20% + var(--slant) + 1px);
    overflow: hidden;
    clip-path: polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
  }
  .watch-calendar[data-mode="games"] .watch-calendar-leon img {
    top: 0;
    left: 0;
    width: auto;
    max-width: none;
    height: 214%;
    transform: translateX(-3.2%);
    clip-path: none;
    object-view-box: none;
  }
}

.watch-calendar-artwork::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #15121d44, #15121dbd 44%, #15121ded 100%);
}

.watch-calendar-hub h3 {
  margin-bottom: clamp(12px, 2vw, 27px);
  font-size: clamp(25px, 3.2vw, 39px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.1;
}

.watch-calendar[data-mode="games"] .watch-calendar-hub {
  width: 100%;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 348px);
  padding: clamp(20px, 3vw, 36px);
}

.watch-calendar[data-mode="games"] .watch-calendar-artwork::after {
  background: linear-gradient(90deg, #15121dde 0%, #15121d99 25%, #15121d29 59%, #15121d44 100%);
}

.watch-calendar-hub nav {
  display: grid;
  gap: 5px;
}

.watch-calendar-hub hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--calendar-line);
  margin: 7px 0 4px;
}

.watch-calendar-hub [hidden], .game-countdown-group[hidden] { display: none; }

.watch-calendar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 36px;
}

.watch-calendar-link svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: #a6b8d6;
  stroke-width: 1.5;
}

.game-countdowns {
  margin-top: clamp(20px, 3vw, 36px);
  padding-top: clamp(12px, 1.5vw, 18px);
  border-top: 1px solid var(--calendar-line);
}
.game-countdown-group:not([hidden]) + .game-countdown-group { margin-top: 16px; }
.game-countdown-group h4 { margin: 0 0 9px; color: var(--calendar-muted); font-size: 13px; font-weight: 500; }
.game-countdown-group p { color: var(--calendar-muted); font-size: 13px; }
.game-countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.watch-calendar .game-countdown-card {
  position: relative;
  isolation: isolate;
  display: block;
  container-type: inline-size;
  aspect-ratio: 920 / 430;
  min-width: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #211c2a;
  color: #fff;
  font-family: Arial, sans-serif;
}
.game-countdown-card img, .game-countdown-card::before {
  position: absolute;
  inset: 0;
  width: 100%;
}
.game-countdown-card img {
  z-index: -2;
  height: auto;
  aspect-ratio: 920 / 430;
  object-fit: cover;
  object-position: center;
}
.game-countdown-card::before {
  content: '';
  z-index: -1;
  background: rgb(7 11 19 / 66%);
  transition: background-color 220ms ease;
}
.game-countdown-card:is(:hover:where(html:not([data-touch-input]) *), :focus-visible:where(html:not([data-touch-input]) *))::before { background-color: rgb(7 11 19 / 38%); }
.game-countdown-card img.game-countdown-blurred { filter: blur(9px); transform: scale(1.09); }
.game-countdown-content { display: block; padding: 4cqw 7.4cqw 3.4cqw; }
.game-countdown-title, .game-countdown-date { display: block; font-weight: 400; }
.game-countdown-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 5.5cqw;
  line-height: 1.1;
}
.game-countdown-date {
  margin-top: .6cqw;
  color: #fff;
  font-size: 4.1cqw;
  text-decoration: underline;
  text-underline-offset: .65cqw;
}
.game-countdown-clock {
  display: grid;
  grid-template-columns: 3fr 2fr 2fr;
  gap: 4.2cqw;
  margin-top: 2.65cqw;
}
.game-countdown-clock > span {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 1.45cqw;
}
.game-countdown-clock > span + span::before {
  content: '';
  position: absolute;
  inset: 5.8cqw auto auto -2.1cqw;
  width: 2px;
  height: 7.4cqw;
  background: #fffffff0;
}
.game-countdown-digits { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1.45cqw; }
.game-countdown-clock strong {
  display: grid;
  place-items: center;
  height: 18.1cqw;
  border-radius: 3px;
  background: #18152142;
  font-size: 9.6cqw;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
}
.game-countdown-clock small {
  color: #fff;
  font-size: 2.2cqw;
  text-align: center;
  text-transform: uppercase;
}
@media (max-width: 900px) {
  .game-countdown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .game-countdown-grid { grid-template-columns: 1fr; max-width: 400px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-countdown-card::before { transition: none; }
}

.watch-calendar-link:hover:where(html:not([data-touch-input]) *) span,
.watch-calendar-back:hover:where(html:not([data-touch-input]) *) { text-decoration: underline; text-underline-offset: 5px; }

.watch-calendar-back { min-height: 30px; color: var(--calendar-muted); }
.watch-calendar-period-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 7px 0 5px; }
.watch-calendar-period-nav { display: flex; flex: none; gap: 6px; }
.watch-calendar-arrow {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 21px;
}
.watch-calendar-arrow:hover:where(html:not([data-touch-input]) *) { background: #ded8ec18; }
.watch-calendar-context, .watch-calendar-message { color: var(--calendar-muted); }
@media (max-width: 760px) {
  .watch-calendar[data-screen="period"] {
    min-height: calc(100dvh - var(--home-header-height, 78px) - var(--home-rail-height, 44px));
  }
  #release-calendar .watch-calendar[data-screen="period"] > .studio-release-heading {
    padding-block: 4px 8px;
  }
  .watch-calendar[data-pinned] > .studio-release-heading::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset-block: calc(-1 * var(--home-header-height, 78px)) 0;
    inset-inline: calc((100% - 100vw) / 2);
    background: inherit;
    border-bottom: 1px solid var(--calendar-line);
    pointer-events: none;
  }
  .watch-calendar[data-screen="period"] .watch-calendar-back { min-height: 32px; font-size: 12px; }
  .watch-calendar[data-screen="period"] .watch-calendar-period-head { align-items: center; margin: 0; }
  .watch-calendar[data-screen="period"] .watch-calendar-heading h2 { font-size: clamp(22px, 6vw, 28px); }
  .watch-calendar[data-screen="period"] .watch-calendar-arrow { width: 42px; height: 40px; }
  .watch-calendar[data-screen="period"] .watch-calendar-context { font-size: 12px; }
}
.watch-calendar-message { padding-block: 20px; }

.watch-calendar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 0 18px; font-size: 12px; }
.watch-calendar-mark { color: var(--calendar-marker); font-weight: 600; }
:is(.watch-calendar, .watch-calendar-day-dialog) [data-kind="season"] { --calendar-marker: var(--calendar-season); }
:is(.watch-calendar, .watch-calendar-day-dialog) [data-kind="premiere"] { --calendar-marker: var(--calendar-premiere); }
:is(.watch-calendar, .watch-calendar-day-dialog) [data-kind="finale"] { --calendar-marker: var(--calendar-finale); }

.watch-calendar-grid { --calendar-day-padding: clamp(6px, .85vw, 13px); }
.watch-calendar-day-label { display: none; }
.watch-calendar-weekdays, .watch-calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.watch-calendar-weekdays { color: var(--calendar-muted); font-size: 12px; padding-bottom: 8px; }
.watch-calendar-weekdays > span { padding-inline: var(--calendar-day-padding); }
.watch-calendar-week { border-top: 1px solid var(--calendar-line); }
.watch-calendar-day {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 52px;
  gap: 7px;
  padding: 8px var(--calendar-day-padding) 12px;
}
.watch-calendar-day + .watch-calendar-day { border-inline-start: 1px solid var(--calendar-line); }
.watch-calendar-date { display: flex; align-items: center; justify-content: space-between; gap: 3px; min-height: 27px; }
.watch-calendar-date time { font-size: 22px; font-weight: 600; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
span.watch-calendar-date { color: var(--calendar-muted); }
.watch-calendar-date[aria-current="date"] time { color: var(--calendar-premiere); }
button.watch-calendar-date:hover:where(html:not([data-touch-input]) *) time { text-decoration: underline; text-underline-offset: 4px; }
.watch-calendar-covers { display: grid; gap: 8px; }
.watch-calendar-featured { position: relative; min-width: 0; }
.watch-calendar-featured .watch-calendar-date {
  position: absolute;
  inset: 5px auto auto 5px;
  justify-content: center;
  min-width: 30px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #141119d9;
  color: #fff;
  line-height: 1;
}
.watch-calendar-previews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 5px; }
.watch-calendar-cover { display: block; min-width: 0; width: 100%; }
.watch-calendar-poster {
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 5px;
  background: #282431;
}
.watch-calendar-poster img { display: block; width: 100%; height: 100%; object-fit: cover; visibility: hidden; }
.watch-calendar-poster[data-ready] img { visibility: visible; }
.watch-calendar-lead .watch-calendar-poster { aspect-ratio: 1; }
.watch-calendar-lead .watch-calendar-poster img { object-position: center 35%; }
.watch-calendar-cover:hover:where(html:not([data-touch-input]) *) .watch-calendar-poster { filter: brightness(1.16); }
.watch-calendar-episode-range {
  display: block;
  padding-top: 3px;
  color: var(--calendar-marker, var(--calendar-muted));
  line-height: 1.25;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.watch-calendar-marks { display: flex; gap: 3px 6px; flex-wrap: wrap; }
.watch-calendar-more {
  width: 100%;
  min-height: 25px;
  margin-top: auto;
  border-radius: 5px;
  background: #ded8ec0c;
  font-size: 11px;
  text-align: center;
}
.watch-calendar-more:hover:where(html:not([data-touch-input]) *) { background: #3c3448; }
.watch-calendar-more-compact { display: none; }

.watch-calendar-day-dialog {
  position: fixed;
  width: min(500px, calc(100% - 28px));
  max-height: min(76dvh, 620px);
  margin: auto;
  padding: 20px;
  border: 0;
  border-radius: 15px;
  background: var(--playview-dialog-glass);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 70px #0009;
  overflow: auto;
  overscroll-behavior: contain;
  color-scheme: dark;
}
.watch-calendar-day-dialog::backdrop { background: #09070b92; backdrop-filter: blur(5px); }
.watch-calendar-day-dialog header { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 12px; }
.watch-calendar-day-dialog h3 { font-size: 23px; font-weight: 500; letter-spacing: -.025em; }
.watch-calendar-day-items { display: grid; gap: 5px; }
.watch-calendar-day-item { display: grid; grid-template-columns: 43px minmax(0, 1fr); gap: 10px; align-items: center; padding: 5px; border-radius: 8px; }
.watch-calendar-day-item:hover:where(html:not([data-touch-input]) *), .watch-calendar-day-item:focus-visible:where(html:not([data-touch-input]) *) { background: #ded8ec16; }
.watch-calendar-day-item strong, .watch-calendar-day-item small { display: block; }
.watch-calendar-day-item small { color: var(--calendar-muted); }
.watch-calendar-day-item .watch-calendar-marks { margin-block: 2px; font-size: 12px; }

@media (max-width: 630px) {
  .watch-calendar-hub { grid-template-columns: 1fr; gap: 24px; }
  .watch-calendar-portrait {
    display: block;
    position: absolute;
    inset: 0;
    clip-path: var(--strip);
  }
  .watch-calendar-portrait img {
    top: var(--crop-top);
    left: var(--crop-left, 0);
    width: var(--crop-width, 100%);
    height: var(--crop-height);
    object-position: var(--crop-focus);
    clip-path: none;
  }
  .watch-calendar-portrait:nth-child(1) {
    --strip: polygon(0 0, 58% 0, 0 23%);
    --crop-top: -1%;
    --crop-height: 25%;
    --crop-width: 59%;
    --crop-focus: 80% center;
  }
  .watch-calendar-portrait:nth-child(2) {
    --strip: polygon(0 22.8%, 57.5% 0, 100% 0, 100% 13%, 0 53%);
    --crop-top: 0%;
    --crop-height: 54%;
    --crop-focus: 46% center;
  }
  .watch-calendar-portrait:nth-child(3) {
    --strip: polygon(0 52.8%, 100% 12.8%, 100% 42%, 0 82%);
    --crop-top: 12%;
    --crop-height: 74%;
    --crop-focus: 42% center;
  }
  .watch-calendar-portrait:nth-child(4) {
    --strip: polygon(0 81.8%, 100% 41.8%, 100% 72%, 30% 100%, 0 100%);
    --crop-top: 41%;
    --crop-height: 60%;
    --crop-focus: 41% center;
  }
  .watch-calendar-portrait:nth-child(5) {
    --strip: polygon(29.5% 100%, 100% 71.8%, 100% 100%);
    --crop-top: 71.5%;
    --crop-height: 40%;
    --crop-left: 29%;
    --crop-width: 71%;
    --crop-focus: 36% center;
  }
  .watch-calendar[data-mode="watch"] .watch-calendar-artwork::after {
    background: linear-gradient(90deg, #15121dbb, #15121d66 56%, #15121d24);
  }
  .watch-calendar-grid { --calendar-day-padding: 0px; }
  .watch-calendar-weekdays { display: none; }
  .watch-calendar-week { display: block; border: 0; }
  .watch-calendar-day:not([data-has-releases]) { display: none; }
  .watch-calendar-day[data-has-releases] {
    position: relative;
    gap: 5px;
    padding: 8px 0 9px 49px;
    border-inline-start: 0;
    border-top: 1px solid var(--calendar-line);
  }
  .watch-calendar-day .watch-calendar-featured { position: static; }
  .watch-calendar-day .watch-calendar-date {
    inset: 8px auto auto 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    background: transparent;
  }
  .watch-calendar-day .watch-calendar-date time { font-size: 20px; }
  .watch-calendar-day-label { display: block; color: var(--calendar-muted); font-size: 11px; }
  .watch-calendar-covers {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
    gap: 5px;
  }
  .watch-calendar-day .watch-calendar-previews { display: contents; }
  .watch-calendar-lead .watch-calendar-poster { aspect-ratio: 2 / 3; }
  .watch-calendar-episode-range { font-size: 10px; }
  .watch-calendar-more-desktop { min-height: 34px; }
}
@media (pointer: coarse) {
  .watch-calendar-link, .watch-calendar-arrow { min-height: 44px; }
  .watch-calendar-arrow { width: 44px; }
}
