:root {
  color-scheme: dark;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --brand: #a3232c;
  --brand-active: #d33042;
  --page: #000;
  --surface: #212223;
  --surface-raised: #303133;
  --text: #f7f7f7;
  --muted: #aaa;
  --gutter: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
  scroll-padding-top: 112px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--page);
  color: var(--text);
}

button,
summary {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
.creator-rail:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: var(--brand);
  box-shadow: 0 1px 0 rgb(255 255 255 / 8%);
}

.brand-row {
  display: flex;
  width: 100%;
  height: 60px;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  direction: ltr;
}

.brand-group {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
}

.brand-link {
  display: inline-flex;
  min-width: 0;
  align-items: center;
}

.brand-logo {
  display: block;
  width: clamp(126px, 42vw, 178px);
  max-width: 100%;
  height: auto;
}

.live-viewer-status {
  display: inline-flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  color: #f8f8f8;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.live-viewer-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #b5ec16;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 10%);
}

.live-viewer-status strong {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.live-viewer-label {
  color: #f1dfe0;
  font-size: 12px;
  font-weight: 500;
}

.language-switcher {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  margin-left: 8px;
}

.language-switcher summary {
  display: flex;
  min-width: 68px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 22px;
  background: #f7f7f7;
  color: #262626;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  list-style: none;
  touch-action: manipulation;
}

.language-switcher summary::-webkit-details-marker {
  display: none;
}

.language-caret {
  color: #666;
  font-size: 12px;
}

.language-options {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  width: 144px;
  gap: 2px;
  padding: 5px;
  border: 1px solid #454547;
  border-radius: 8px;
  background: #202022;
  box-shadow: 0 9px 24px rgb(0 0 0 / 45%);
}

.language-options button {
  min-height: 40px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
}

.language-options button:hover,
.language-options button:focus-visible {
  background: var(--surface-raised);
}

[dir="rtl"] .language-switcher,
[dir="rtl"] .language-options {
  direction: rtl;
}

.channel-nav {
  height: 48px;
  overflow-x: auto;
  background: var(--surface);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.channel-nav::-webkit-scrollbar {
  display: none;
}

.channel-tabs {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

[dir="rtl"] .channel-tabs {
  direction: ltr;
}

[dir="rtl"] .channel-tab {
  direction: rtl;
}

.channel-tab {
  position: relative;
  min-width: 0;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: #d2d2d2;
  cursor: pointer;
  font-size: 17px;
  font-weight: 550;
  white-space: nowrap;
  touch-action: manipulation;
}

.channel-tab[aria-selected="true"] {
  color: #fff;
}

.channel-tab[aria-selected="true"]::after {
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  background: var(--brand-active);
  content: "";
}

.page-content {
  width: min(100%, 1280px);
  min-height: 52vh;
  margin-inline: auto;
  padding: 10px 0 28px;
}

.content-sections {
  display: grid;
  gap: 28px;
}

.creator-section {
  min-width: 0;
}

.section-heading {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 var(--gutter) 8px;
}

.section-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.locale-mark {
  flex: 0 0 auto;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 26px;
  line-height: 1;
}

.locale-flag {
  display: block;
  width: 32px;
  height: 22px;
  object-fit: cover;
}

.browse-all {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 0 0 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  touch-action: manipulation;
}

.browse-all:hover {
  color: #fff;
}

.section-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.rail-control {
  display: none;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #4a4b4d;
  border-radius: 50%;
  background: #303133;
  color: #f7f7f7;
  cursor: pointer;
}

.rail-control:disabled {
  opacity: 0.38;
  cursor: default;
}

.rail-control__chevron {
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.rail-control--left .rail-control__chevron {
  transform: translateX(2px) rotate(-135deg);
}

.rail-control--right .rail-control__chevron {
  transform: translateX(-2px) rotate(45deg);
}

.creator-rail {
  display: grid;
  width: 100%;
  grid-template-rows: repeat(2, auto);
  grid-template-columns: repeat(8, min(44vw, 228px));
  grid-auto-flow: row;
  gap: 8px;
  padding: 0 var(--gutter) 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: auto;
  -webkit-overflow-scrolling: touch;
  direction: ltr;
}

.creator-rail::-webkit-scrollbar {
  display: none;
}

.creator-rail.is-dragging {
  scroll-snap-type: none;
  user-select: none;
  cursor: grabbing;
}

.creator-card {
  display: block;
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  aspect-ratio: 1.28 / 1;
  overflow: hidden;
  background: var(--surface-raised);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  scroll-snap-align: start;
}

.creator-card:hover .creator-image {
  transform: scale(1.025);
}

.creator-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
  transition: transform 180ms ease;
}

.creator-shade {
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgb(0 0 0 / 58%));
  pointer-events: none;
}

.creator-online-status {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 9px;
  height: 9px;
  border: 1px solid rgb(255 255 255 / 85%);
  border-radius: 50%;
  background: #29c66d;
  box-shadow: 0 0 0 2px rgb(0 0 0 / 45%);
  pointer-events: none;
}

.creator-name {
  position: absolute;
  right: 9px;
  bottom: 8px;
  left: 9px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer {
  background: #212223;
  color: #c6c6c6;
}

.footer-inner {
  width: min(100%, 1280px);
  margin-inline: auto;
  padding: 20px var(--gutter) max(22px, env(safe-area-inset-bottom));
}

.footer-brand {
  display: inline-block;
  margin-bottom: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.footer-inner p {
  max-width: 850px;
  margin: 0;
  color: #c3c3c3;
  font-size: 12px;
  line-height: 1.65;
}

.apk-dialog {
  width: min(360px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: visible;
  border: 1px solid #4a4a4c;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.apk-dialog::backdrop {
  background: rgb(0 0 0 / 72%);
}

.apk-dialog__surface {
  position: relative;
  padding: 24px 20px 20px;
  border-radius: inherit;
  background: #242426;
  box-shadow: 0 18px 56px rgb(0 0 0 / 48%);
}

.apk-dialog__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #c4c4c4;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.apk-dialog__close:hover {
  background: #373739;
  color: #fff;
}

.apk-dialog__title {
  max-width: calc(100% - 30px);
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.3;
}

.apk-dialog__description {
  margin: 0 0 18px;
  color: #c4c4c4;
  font-size: 14px;
  line-height: 1.55;
}

.apk-app {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  background: #303032;
}

.apk-app__icon {
  display: block;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 12px;
}

.apk-app__identity {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.apk-app__identity strong {
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

.apk-app__identity span {
  color: #aaa;
  font-size: 12px;
}

.apk-download {
  width: 100%;
  min-height: 42px;
  margin-top: 16px;
  border: 0;
  border-radius: 5px;
  background: var(--brand-active);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.apk-download:disabled {
  background: #5a3438;
  color: #d8bfc2;
  cursor: not-allowed;
}

.apk-dialog__status {
  margin: 8px 0 0;
  color: #aaa;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.apk-dialog__fallback {
  margin: 14px 0 8px;
  color: #c4c4c4;
  font-size: 12px;
  line-height: 1.5;
}

.apk-copy-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.apk-download-url {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  color: #eee;
  font-size: 11px;
}

.apk-copy {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid #555;
  border-radius: 5px;
  background: #343436;
  color: #f7f7f7;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.apk-copy:disabled {
  color: #a9a9a9;
  cursor: not-allowed;
}

.apk-copy-status {
  min-height: 0;
  margin: 6px 0 0;
  color: #bfcfc4;
  font-size: 12px;
  line-height: 1.4;
}

@media (min-width: 700px) {
  :root {
    --gutter: 24px;
  }

  .brand-row {
    height: 68px;
    padding-inline: max(var(--gutter), calc((100vw - 1280px) / 2));
  }

  .brand-group {
    gap: 12px;
  }

  .brand-logo {
    width: 196px;
  }

  .live-viewer-status {
    gap: 5px;
    font-size: 13px;
  }

  .live-viewer-status strong {
    font-size: 14px;
  }

  .live-viewer-label {
    font-size: 13px;
  }

  .language-switcher summary {
    min-width: 86px;
    min-height: 40px;
    font-size: 15px;
  }

  .channel-nav {
    height: 52px;
  }

  .channel-tabs {
    width: min(100%, 1280px);
    margin-inline: auto;
  }

  .channel-tab {
    font-size: 19px;
  }

  .page-content {
    padding-top: 18px;
  }

  .content-sections {
    gap: 34px;
  }

  .section-heading {
    min-height: 55px;
  }

  .section-title {
    font-size: 23px;
  }

  .locale-mark {
    font-size: 30px;
  }

  .browse-all {
    font-size: 17px;
  }

  .creator-rail {
    grid-template-columns: repeat(8, min(24vw, 250px));
    gap: 12px;
    padding-bottom: 8px;
    cursor: grab;
    scrollbar-color: #777 #28292a;
    scrollbar-width: thin;
  }

  .creator-rail::-webkit-scrollbar {
    display: block;
    height: 8px;
  }

  .creator-rail::-webkit-scrollbar-track {
    border-radius: 4px;
    background: #28292a;
  }

  .creator-rail::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: #777;
  }

  .rail-control {
    display: inline-flex;
  }

  .creator-name {
    right: 12px;
    bottom: 10px;
    left: 12px;
    font-size: 15px;
  }

  .footer-inner {
    padding-block: 22px 28px;
  }

  .footer-inner p {
    font-size: 13px;
  }
}

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