:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: #ecf4f5;
  background: #0c161d;
  --panel: #111f28;
  --stroke: #29404a;
  --muted: #acbec4;
  --accent: #8be1d0;
  --button-text: #102a29;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 22% 8%, #172b33 0%, #0c161d 62%);
}

.shell {
  width: min(75rem, calc(100% - 4rem));
  margin-inline: auto;
}

.topbar {
  border-bottom: 1px solid #29404a;
  background: #101c23;
}

.masthead {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.brand {
  color: #ecf4f5;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.page { padding-block: clamp(2rem, 6vw, 5rem) 2rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14.5rem, 19rem);
  gap: clamp(1.25rem, 3vw, 2.4rem);
  align-items: start;
}

.player-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 1.125rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.375rem);
  line-height: 1.25;
  font-weight: 740;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.5;
}

.player-status {
  font-size: 0.875rem;
  color: var(--muted);
}

.screen {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  min-height: 12rem;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 1rem;
  background: radial-gradient(ellipse at center, #142932 0%, #091219 72%);
  box-shadow: 0 1.4rem 4rem #050b1260;
}

.screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #03080c;
  object-fit: contain;
}

.screen-message {
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  max-width: 26rem;
  padding: 1.15rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

.screen-message p { margin: 0; }

.screen-icon {
  width: 2.6rem;
  height: 2.6rem;
  position: relative;
  border: 1px solid #3a5d63;
  border-radius: 50%;
}

.screen-icon::after {
  position: absolute;
  top: 50%;
  left: 52%;
  translate: -50% -50%;
  width: 0;
  height: 0;
  border-block: 0.36rem solid transparent;
  border-left: 0.56rem solid #8bd1c8;
  content: "";
}

.side-panel {
  padding: 1.4rem;
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 1rem;
}

.panel-description {
  margin: 0.5rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9375rem;
}

form {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

label { font-size: 0.875rem; }

input, button { font: inherit; }

input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #41616a;
  border-radius: 0.55rem;
  background: #0b171e;
  color: #ecf4f5;
}

input[aria-invalid="true"] { border-color: #f7aaa6; }

button {
  min-height: 2.5rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  cursor: pointer;
}

button:disabled { opacity: 0.65; cursor: wait; }

:where(a, button, input):focus-visible {
  outline: 2px solid #b8f5e8;
  outline-offset: 3px;
}

.primary-button {
  margin-top: 0.5rem;
  color: var(--button-text);
  background: var(--accent);
  font-weight: 700;
  min-height: 2.75rem;
}

.primary-button:hover:not(:disabled) { background: #b0f0e3; }

.secondary-button {
  border-color: #3d5861;
  color: #e4eff1;
  background: #172831;
  font-size: 0.875rem;
}

.secondary-button:hover:not(:disabled) { background: #243d46; }

.catalog {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  margin: 0.85rem 0 0;
  padding: 0;
}

.catalog:empty { margin: 0; }

.video-option {
  width: 100%;
  text-align: left;
  color: #ecf4f5;
  border-color: #304951;
  background: #152831;
  overflow-wrap: anywhere;
}

.video-option:hover { border-color: #7ab6ad; }

.video-option[aria-pressed="true"] {
  border-color: #68ab9f;
  color: #c3f8ee;
  background: #1b3a3e;
}

.error {
  margin: 0;
  color: #ffc0b9;
  font-size: 0.875rem;
  line-height: 1.5;
}

.session-error { margin-top: 1.25rem; }

@media (max-width: 47rem) {
  .shell { width: calc(100% - 2rem); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .masthead { min-height: 3.75rem; }
  .page { padding-top: 1.5rem; }
}

@media (max-width: 24rem) {
  #account-name { display: none; }
}
