:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --surface: #111620;
  --surface-2: #171d29;
  --surface-3: #1d2532;
  --line: #2a3342;
  --line-strong: #3a4759;
  --text: #f2f5f8;
  --muted: #98a3b3;
  --faint: #687486;
  --cyan: #51d6c2;
  --cyan-dark: #163f3a;
  --coral: #ff7a68;
  --amber: #e9b85d;
  --danger: #ff6678;
  --discord: #5865f2;
  --header-height: 66px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 20, 0.96);
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(1460px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--text);
  font-weight: 760;
  font-size: 17px;
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(81, 214, 194, 0.12);
}

.main-nav {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 4px;
}

.nav-link,
.mobile-nav button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
}

.nav-link {
  height: 38px;
  padding: 0 14px;
  border-radius: 6px;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: var(--surface-2);
}

.account-area {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.discord-login,
.discord-wide,
.primary-button,
.quiet-button,
.share-button,
.text-button,
.account-button {
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.discord-login,
.discord-wide {
  color: #fff;
  background: var(--discord);
}

.discord-login {
  min-height: 40px;
  padding: 0 16px;
}

.discord-login:hover,
.discord-wide:hover {
  background: #6875f5;
}

.account-button {
  min-width: 108px;
  height: 40px;
  padding: 0 10px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.account-avatar,
.message-avatar,
.community-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--surface-3);
  color: var(--cyan);
  font-weight: 750;
}

.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.account-avatar img,
.message-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.account-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 240px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

.account-menu button {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.account-menu button:hover {
  background: var(--surface-2);
}

.page-shell {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 22px 24px 80px;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 368px;
  gap: 14px;
  align-items: stretch;
}

.player-panel,
.chat-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.player-panel {
  display: grid;
  grid-template-rows: auto auto auto;
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  overflow: hidden;
  background: #050609;
}

.player-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(5, 6, 9, 0.88));
}

.player-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #050609;
}

.player-topline {
  position: absolute;
  inset: 14px 14px auto;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.live-badge,
.latency-badge {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  color: #fff;
  background: rgba(5, 8, 12, 0.82);
  font-size: 12px;
  font-weight: 700;
}

.live-badge i {
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--coral);
}

.live-badge[data-state="online"] i {
  background: var(--cyan);
}

.live-badge[data-state="error"] i {
  background: var(--danger);
}

.player-caption {
  position: absolute;
  z-index: 3;
  left: 18px;
  right: 18px;
  bottom: 58px;
  pointer-events: none;
}

.player-caption span,
.player-caption strong {
  display: block;
}

.player-caption span {
  margin-bottom: 3px;
  color: #bdc6d2;
  font-size: 13px;
}

.player-caption strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 26px;
  line-height: 1.2;
}

.player-toolbar {
  min-height: 64px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stream-select-wrap {
  min-width: 210px;
  display: grid;
  gap: 4px;
}

.stream-select-wrap span,
.stream-meta span {
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.stream-select-wrap select {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--text);
  background: var(--surface-2);
}

.segmented {
  height: 34px;
  display: flex;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  overflow: hidden;
}

.segmented button {
  min-width: 48px;
  height: 100%;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 700;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.is-active {
  color: #07110f;
  background: var(--cyan);
}

.quiet-button,
.share-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
}

.quiet-button:hover,
.share-button:hover {
  border-color: var(--cyan);
}

.player-toolbar .quiet-button {
  margin-left: auto;
}

.stream-meta {
  min-height: 56px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr)) auto;
  align-items: center;
  gap: 8px;
}

.stream-meta div {
  min-width: 0;
}

.stream-meta strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #dce2ea;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-panel {
  min-height: 520px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.section-heading h2,
.page-heading h1 {
  margin: 0;
}

.panel-heading h2,
.section-heading h2 {
  font-size: 18px;
  line-height: 1.3;
}

.panel-heading span,
.section-heading p,
.page-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chat-heading {
  min-height: 64px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.text-button {
  min-height: 32px;
  padding: 0 4px;
  color: var(--cyan);
  background: transparent;
}

.text-button:hover {
  color: #8be7d8;
}

.chat-messages {
  min-height: 0;
  max-height: 530px;
  padding: 8px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chat-empty {
  min-height: 170px;
  display: grid;
  place-items: center;
  color: var(--faint);
}

.chat-message {
  position: relative;
  padding: 8px 44px 8px 12px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
}

.chat-message:hover {
  background: var(--surface-2);
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 11px;
}

.message-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.message-head strong {
  min-width: 0;
  overflow: hidden;
  color: #dfe5ec;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-head strong[data-role="moderator"],
.message-head strong[data-role="admin"] {
  color: var(--cyan);
}

.message-head time {
  color: var(--faint);
  font-size: 10px;
}

.message-body {
  margin: 2px 0 0;
  color: #c8d0dc;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message-menu-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: none;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 19px;
  line-height: 1;
}

.chat-message:hover .message-menu-button,
.message-menu-button:focus-visible {
  display: block;
}

.message-menu {
  position: absolute;
  z-index: 8;
  top: 38px;
  right: 8px;
  width: 170px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1119;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.message-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.message-menu button:hover {
  background: var(--surface-3);
}

.chat-compose {
  padding: 10px;
  border-top: 1px solid var(--line);
}

.chat-compose textarea {
  width: 100%;
  min-height: 58px;
  max-height: 132px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: #0d1119;
}

.chat-compose textarea::placeholder {
  color: var(--faint);
}

.compose-row {
  min-height: 38px;
  padding-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compose-row span {
  color: var(--faint);
  font-size: 11px;
}

.primary-button {
  min-height: 36px;
  padding: 0 15px;
  color: #07110f;
  background: var(--cyan);
}

.primary-button:hover {
  background: #72dfce;
}

.content-section {
  padding-top: 30px;
}

.section-heading {
  min-height: 48px;
  margin-bottom: 12px;
}

.stream-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.stream-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.stream-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.stream-card.is-selected {
  border-color: var(--cyan);
}

.stream-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #07090d;
}

.stream-card__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0.72;
}

.stream-card:not(:first-child) .stream-card__media img {
  filter: saturate(0.72) brightness(0.82);
}

.stream-card__status {
  position: absolute;
  top: 8px;
  left: 8px;
  min-height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  color: #fff;
  background: rgba(8, 11, 16, 0.86);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.stream-card__status.is-online {
  background: #963746;
}

.stream-card__copy {
  min-height: 76px;
  padding: 10px;
}

.stream-card__copy strong,
.stream-card__copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-card__copy strong {
  font-size: 14px;
}

.stream-card__copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
}

.event-list,
.schedule-board {
  border-top: 1px solid var(--line);
}

.event-item {
  min-height: 68px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: 86px 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.event-item span,
.event-item small {
  color: var(--muted);
}

.event-item time {
  color: var(--cyan);
  font-weight: 750;
}

.event-item strong,
.event-item small {
  display: block;
}

.event-item button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--text);
  background: var(--surface);
}

.community-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.community-compact,
.community-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.community-compact {
  min-height: 80px;
  padding: 12px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.community-avatar {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  color: var(--text);
  background: var(--cyan-dark);
}

.community-compact strong,
.community-compact span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-compact span {
  color: var(--muted);
  font-size: 11px;
}

.page-heading {
  padding: 28px 0 20px;
}

.page-heading h1 {
  font-size: 30px;
}

.schedule-board .event-item {
  min-height: 82px;
  grid-template-columns: 140px 80px minmax(0, 1fr) auto;
}

.communities-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.community-card {
  min-height: 164px;
  padding: 18px;
}

.community-card .community-avatar {
  margin-bottom: 18px;
}

.community-card h2 {
  margin: 0;
  font-size: 18px;
}

.community-card p {
  margin: 5px 0 16px;
  color: var(--muted);
}

.mobile-nav {
  display: none;
}

.modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(4, 6, 9, 0.78);
  backdrop-filter: blur(5px);
}

.modal[open] {
  display: grid;
  place-items: center;
}

.modal-shell {
  position: relative;
  width: min(470px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  padding: 24px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.54);
}

.moderation-shell {
  width: min(980px, 100%);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-heading {
  min-height: 50px;
  padding-right: 36px;
  display: flex;
  align-items: center;
  gap: 13px;
}

.modal-heading h2,
.modal-heading p {
  margin: 0;
}

.modal-heading h2 {
  font-size: 21px;
}

.modal-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.discord-wide {
  width: 100%;
  min-height: 44px;
  margin-top: 20px;
}

.auth-separator {
  position: relative;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--faint);
}

.auth-separator::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--line);
}

.auth-separator span {
  position: relative;
  z-index: 1;
  padding: 0 10px;
  background: var(--surface);
  font-size: 11px;
}

.auth-tabs,
.moderation-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.auth-tabs button,
.moderation-tabs button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.auth-tabs button.is-active,
.moderation-tabs button.is-active {
  color: var(--text);
  border-bottom-color: var(--cyan);
}

.auth-form {
  display: none;
  gap: 13px;
  padding-top: 18px;
}

.auth-form.is-active {
  display: grid;
}

.auth-form h3 {
  margin: 0;
}

.auth-form label:not(.check-row) {
  display: grid;
  gap: 5px;
  color: #cbd3dd;
  font-size: 12px;
  font-weight: 700;
}

.auth-form input:not([type="checkbox"]) {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--text);
  background: #0d1119;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--cyan);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--danger);
}

.form-message[data-state="ok"] {
  color: var(--cyan);
}

.auth-result {
  padding: 20px 0 4px;
}

.auth-result h3 {
  margin: 0 0 6px;
}

.auth-result p {
  margin: 0 0 16px;
  color: var(--muted);
}

.rules-list {
  margin: 22px 0 0;
  padding-left: 22px;
  color: #c9d1dc;
}

.rules-list li {
  margin-bottom: 12px;
  padding-left: 4px;
}

.moderation-tabs {
  margin-top: 18px;
  overflow-x: auto;
}

.moderation-panel {
  display: none;
  padding-top: 14px;
}

.moderation-panel.is-active {
  display: block;
}

.moderation-list {
  display: grid;
  gap: 8px;
}

.moderation-item {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d1119;
}

.moderation-item strong,
.moderation-item span,
.moderation-item small {
  display: block;
  overflow-wrap: anywhere;
}

.moderation-item span,
.moderation-item small {
  color: var(--muted);
}

.moderation-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.moderation-actions button,
.moderation-actions select {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--text);
  background: var(--surface-2);
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
}

.toast {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  color: var(--text);
  background: #121821;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.45);
}

.toast.is-error {
  border-left-color: var(--danger);
}

@media (max-width: 1180px) {
  .live-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
  }

  .player-toolbar {
    flex-wrap: wrap;
  }

  .player-toolbar .quiet-button {
    margin-left: 0;
  }

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

@media (max-width: 900px) {
  :root {
    --header-height: 60px;
  }

  .header-inner {
    padding: 0 16px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .main-nav {
    display: none;
  }

  .discord-login,
  .account-name {
    display: none;
  }

  .account-button {
    min-width: 40px;
    width: 40px;
    padding: 4px;
  }

  .page-shell {
    padding: 12px 12px 86px;
  }

  .live-layout {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: 430px;
  }

  .chat-messages {
    max-height: 340px;
  }

  .home-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

  .mobile-nav {
    position: fixed;
    z-index: 35;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 60px;
    padding: 6px max(10px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    border-top: 1px solid var(--line);
    background: rgba(11, 14, 20, 0.97);
    backdrop-filter: blur(12px);
  }

  .mobile-nav button {
    min-height: 42px;
    padding: 0 6px;
    border-radius: 5px;
    font-size: 12px;
  }

  .mobile-nav button.is-active {
    color: var(--text);
    background: var(--surface-2);
  }
}

@media (max-width: 620px) {
  .brand {
    font-size: 16px;
  }

  .player-stage {
    min-height: 0;
  }

  .player-caption {
    left: 12px;
    right: 12px;
    bottom: 48px;
  }

  .player-caption span {
    font-size: 11px;
  }

  .player-caption strong {
    font-size: 20px;
  }

  .latency-badge {
    display: none;
  }

  .player-toolbar {
    align-items: stretch;
  }

  .stream-select-wrap {
    width: 100%;
  }

  .segmented {
    flex: 1 1 auto;
  }

  .segmented button {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 8px;
  }

  .player-toolbar .quiet-button {
    width: 100%;
  }

  .stream-meta {
    grid-template-columns: repeat(3, 1fr);
  }

  .stream-meta .share-button {
    grid-column: 1 / -1;
  }

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

  .event-item,
  .schedule-board .event-item {
    grid-template-columns: 72px 54px minmax(0, 1fr);
  }

  .event-item button {
    display: none;
  }

  .community-row,
  .communities-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 8px;
  }

  .modal-shell {
    max-height: calc(100vh - 16px);
    padding: 20px 16px;
  }

  .moderation-item {
    grid-template-columns: 1fr;
  }

  .form-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .page-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  .stream-grid {
    grid-template-columns: 1fr;
  }

  .stream-card__copy {
    min-height: 66px;
  }

  .mobile-nav button {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Viewer home, aligned with the public Gamesggge reference layout. */
.header-inner,
.page-shell {
  width: min(1220px, 100%);
}

.page-shell {
  padding-top: 14px;
}

.featured-stage {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #06080d;
}

.featured-stage .player-stage {
  min-height: 410px;
  max-height: 510px;
  aspect-ratio: 2.55 / 1;
}

.featured-stage .player-stage::after {
  inset: 0;
  height: auto;
  background: rgba(2, 5, 10, 0.34);
}

.featured-stage.is-playing .player-stage::after {
  background: rgba(2, 5, 10, 0.08);
}

.featured-stage .player-stage video {
  object-fit: cover;
}

.featured-stage.is-playing .player-stage video {
  object-fit: contain;
}

.featured-stage .player-topline {
  inset: 18px 18px auto;
}

.featured-stage .latency-badge {
  display: none;
}

.featured-stage.is-playing .latency-badge {
  display: inline-flex;
}

.featured-stage .player-caption {
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 4;
  pointer-events: auto;
}

.featured-stage .player-caption strong {
  max-width: min(720px, 100%);
  font-size: 42px;
  line-height: 1.08;
}

.featured-stage .player-caption span {
  margin: 8px 0 0;
  color: #c8d0dc;
  font-size: 14px;
}

.hero-actions {
  min-height: 42px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.watch-button,
.hero-button,
.hero-state {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 750;
}

.watch-button,
.hero-button {
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.watch-button {
  min-width: 112px;
  color: #06110f;
  background: var(--cyan);
}

.watch-button:hover {
  background: #79e1d1;
}

.hero-button {
  color: #fff;
  background: rgba(7, 11, 18, 0.74);
}

.hero-button:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(18, 25, 36, 0.92);
}

.hero-state {
  padding-inline: 10px;
  color: #d2dae5;
  background: rgba(7, 11, 18, 0.54);
  font-size: 12px;
}

.player-console {
  min-height: 64px;
  padding: 10px 12px;
  display: none;
  align-items: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.featured-stage.is-playing .player-console {
  display: flex;
}

.console-metric {
  min-width: 70px;
  min-height: 34px;
  display: grid;
  align-content: center;
}

.console-metric span,
.console-metric strong {
  display: block;
}

.console-metric span {
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.console-metric strong {
  color: #dce2ea;
  font-size: 12px;
}

.player-console .quiet-button {
  margin-left: auto;
}

.home-grid {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.content-section {
  padding-top: 38px;
}

.section-heading {
  min-height: 52px;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 22px;
}

.on-air-section .section-heading p {
  display: none;
}

.stream-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stream-card {
  border-radius: 8px;
}

.stream-card__media {
  aspect-ratio: 16 / 10;
}

.stream-card__media img {
  opacity: 0.78;
}

.stream-card__copy {
  min-height: 68px;
  padding: 10px 11px;
}

.events-panel {
  margin-top: 38px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.events-panel .section-heading {
  min-height: 48px;
  margin-bottom: 8px;
}

.events-panel .section-heading h2 {
  font-size: 18px;
}

.events-panel .event-list {
  border-top: 0;
}

.events-panel .event-item {
  min-height: 72px;
  padding: 10px 0;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0 10px;
}

.events-panel .event-item span {
  grid-column: 1;
  grid-row: 1;
  font-size: 11px;
}

.events-panel .event-item time {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
}

.events-panel .event-item div {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  min-width: 0;
}

.events-panel .event-item strong,
.events-panel .event-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.events-panel .event-item button {
  display: none;
}

.chat-drawer {
  width: min(420px, 100%);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--surface);
}

.chat-drawer::backdrop {
  background: rgba(4, 6, 9, 0.74);
  backdrop-filter: blur(4px);
}

.chat-drawer[open] {
  display: block;
}

.chat-drawer .chat-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.chat-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 24px;
  line-height: 1;
}

.chat-drawer .chat-messages {
  max-height: none;
}

@media (max-width: 980px) {
  .home-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .events-panel {
    margin-top: 26px;
  }

  .featured-stage .player-stage {
    min-height: 360px;
    aspect-ratio: 2 / 1;
  }
}

@media (max-width: 700px) {
  .featured-stage .player-stage {
    min-height: 0;
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .featured-stage .player-caption {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .featured-stage .player-caption strong {
    font-size: 27px;
  }

  .featured-stage .player-caption span {
    margin-top: 5px;
    font-size: 12px;
  }

  .hero-actions {
    min-height: 36px;
    margin-top: 11px;
  }

  .watch-button,
  .hero-button,
  .hero-state {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .player-console {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .player-console .stream-select-wrap {
    width: 100%;
  }

  .player-console .segmented {
    flex: 1 1 170px;
  }

  .player-console .console-metric {
    flex: 1 1 74px;
  }

  .player-console .quiet-button {
    width: 100%;
    margin-left: 0;
  }

  .stream-grid {
    grid-template-columns: 1fr;
  }

  .stream-card {
    display: grid;
    grid-template-columns: 42% minmax(0, 1fr);
  }

  .stream-card__media {
    height: 100%;
    aspect-ratio: 16 / 10;
  }

  .stream-card__copy {
    align-self: center;
  }

  .events-panel {
    padding: 14px;
  }
}

@media (max-width: 430px) {
  .hero-state,
  .featured-stage .player-caption > span {
    display: none;
  }

  .featured-stage .player-caption strong {
    font-size: 23px;
  }

  .hero-actions {
    flex-wrap: nowrap;
  }

  .watch-button {
    min-width: 0;
    flex: 1 1 auto;
  }

  .hero-button {
    padding-inline: 8px;
  }
}
