.player-page {
  background: var(--paper);
}

.player-hero {
  position: relative;
  isolation: isolate;
  height: 390px;
  min-height: 340px;
  color: #fff;
  overflow: hidden;
}

.player-hero > img,
.player-hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player-hero > img {
  z-index: -2;
  object-fit: cover;
  object-position: center 43%;
}

.player-hero-shade {
  z-index: -1;
  background: rgba(18, 16, 21, 0.55);
  box-shadow: inset 0 -150px 130px rgba(13, 11, 15, 0.66);
}

.player-hero-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: min(var(--max-width), calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  padding: calc(var(--header-height) + 30px) 0 52px;
}

.player-hero-content p,
.player-dashboard-heading > div > p,
.player-note > div > p {
  margin: 0 0 7px;
  color: #f3adc1;
  font-size: 13px;
  font-weight: 900;
}

.player-hero-content h1 {
  margin: 0;
  font-family: "Noto Serif TC", "PMingLiU", serif;
  font-size: 62px;
  font-weight: 900;
  line-height: 1.15;
}

.player-hero-content > span {
  margin-top: 12px;
  color: #fff7fa;
  font-size: 19px;
  font-weight: 650;
}

.player-dashboard {
  width: min(var(--max-width), calc(100% - 48px));
  margin: -24px auto 86px;
  padding: 30px;
  background: #242127;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.player-dashboard-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 25px;
}

.player-dashboard-heading h2,
.player-note h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Serif TC", "PMingLiU", serif;
  font-size: 37px;
  line-height: 1.25;
}

.player-dashboard-heading > div > span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}

.live-state {
  display: grid;
  grid-template-columns: 12px auto;
  align-items: center;
  column-gap: 10px;
  min-width: 190px;
  padding: 12px 15px;
  background: #1b1a1f;
  border: 1px solid var(--line);
}

.live-state > span {
  grid-row: 1 / 3;
  width: 10px;
  height: 10px;
  background: #9f959b;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(159, 149, 155, 0.12);
}

.live-state.online > span {
  background: #66b99c;
  box-shadow: 0 0 0 5px rgba(102, 185, 156, 0.14);
}

.live-state.offline > span {
  background: #e17a89;
  box-shadow: 0 0 0 5px rgba(225, 122, 137, 0.14);
}

.live-state strong {
  color: var(--ink);
  font-size: 16px;
}

.live-state small {
  color: var(--muted);
  font-size: 12px;
}

.player-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.player-kpis article {
  display: grid;
  align-content: center;
  min-height: 126px;
  padding: 18px 21px;
  background: #1e1c22;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.player-kpis span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.player-kpis strong {
  margin-top: 3px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  line-height: 1.15;
}

.player-kpis article:first-child strong {
  color: #f1adc1;
}

.player-kpis small {
  color: #a99fa5;
  font-size: 12px;
}

.player-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 26px 0 16px;
}

.range-control {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
}

.range-control button,
.refresh-button {
  min-height: 42px;
  padding: 9px 14px;
  color: var(--muted);
  background: #1d1b20;
  border: 0;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.range-control button + button {
  border-left: 1px solid var(--line);
}

.range-control button:hover,
.range-control button:focus-visible,
.range-control button[aria-pressed="true"] {
  color: #241d22;
  background: #f1b3c5;
}

.refresh-button {
  flex: 0 0 auto;
  color: #e3d9df;
  border: 1px solid var(--line);
}

.refresh-button:hover,
.refresh-button:focus-visible {
  color: #fff;
  border-color: #9d7382;
}

.refresh-button[disabled] {
  cursor: wait;
  opacity: 0.55;
}

.player-chart-shell {
  position: relative;
  width: 100%;
  height: 430px;
  overflow: hidden;
  background: #19181c;
  border: 1px solid var(--line);
}

.player-chart-shell canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.chart-empty strong {
  color: var(--ink);
  font-size: 20px;
}

.chart-empty[hidden] {
  display: none;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 146px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(39, 34, 41, 0.96);
  border: 1px solid #6d5d66;
  box-shadow: 0 10px 26px rgba(5, 4, 6, 0.34);
  font-size: 13px;
  line-height: 1.55;
  pointer-events: none;
}

.chart-tooltip strong,
.chart-tooltip span {
  display: block;
}

.chart-tooltip strong {
  color: #f4b4c7;
  font-size: 17px;
}

.player-chart-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 13px;
}

.player-chart-footer p {
  margin: 0;
}

.player-chart-footer p:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-chart-footer p:first-child > span {
  flex: 0 0 auto;
  width: 18px;
  height: 3px;
  background: #e68da5;
}

.player-note {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.2fr);
  gap: 42px;
  width: min(980px, calc(100% - 48px));
  margin: 0 auto 100px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.player-note p:last-child {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

@media (max-width: 900px) {
  .player-dashboard {
    width: min(100% - 32px, var(--max-width));
    padding: 24px;
  }

  .player-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-chart-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .refresh-button {
    align-self: flex-start;
  }
}

@media (max-width: 760px) {
  .player-hero {
    height: 330px;
    min-height: 300px;
  }

  .player-hero-content {
    width: calc(100% - 32px);
    padding-bottom: 38px;
  }

  .player-hero-content h1 {
    font-size: 42px;
  }

  .player-hero-content > span {
    font-size: 17px;
  }

  .player-dashboard {
    margin-top: -14px;
    margin-bottom: 66px;
    padding: 20px 16px;
  }

  .player-dashboard-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .player-dashboard-heading h2,
  .player-note h2 {
    font-size: 31px;
  }

  .live-state {
    width: 100%;
  }

  .player-kpis article {
    min-height: 108px;
    padding: 15px;
  }

  .player-kpis strong {
    font-size: 31px;
  }

  .range-control {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .range-control button + button {
    border-left: 0;
  }

  .range-control button {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .player-chart-shell {
    height: 330px;
  }

  .player-chart-footer,
  .player-note {
    flex-direction: column;
  }

  .player-chart-footer {
    display: grid;
    gap: 7px;
  }

  .player-note {
    grid-template-columns: 1fr;
    gap: 18px;
    width: calc(100% - 32px);
    margin-bottom: 72px;
  }
}

@media (max-width: 390px) {
  .player-kpis {
    grid-template-columns: 1fr;
  }

  .player-chart-shell {
    height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .range-control button,
  .refresh-button {
    transition: none;
  }
}
