:root {
  color-scheme: dark;
  --bg: #060706;
  --panel: rgba(16, 18, 17, 0.76);
  --panel-strong: rgba(23, 26, 24, 0.94);
  --text: #f4f7f2;
  --muted: #aab3aa;
  --line: rgba(255, 255, 255, 0.13);
  --accent: #ff3d47;
  --accent-2: #18c37e;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  -webkit-tap-highlight-color: transparent;
}

.app {
  position: relative;
  width: min(100vw, 480px);
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(6, 7, 6, 0.08), rgba(6, 7, 6, 0.88)),
    radial-gradient(circle at top left, rgba(24, 195, 126, 0.18), transparent 34%),
    var(--bg);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
}

.feed {
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.feed::-webkit-scrollbar {
  display: none;
}

.short {
  position: relative;
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 560px;
  place-items: center;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #050505;
}

.short iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #050505;
  pointer-events: none;
}

.short-info {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 92px 16px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
  pointer-events: none;
}

.sound-button {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: 50%;
  display: grid;
  width: 76px;
  height: 54px;
  border: 0;
  border-radius: 14px;
  padding: 0;
  place-items: center;
  background: #ff0000;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.sound-button span {
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 22px solid #fff;
  margin-left: 5px;
}

.sound-button:active {
  transform: translate(-50%, -50%) scale(0.96);
}

.channel-name {
  margin: 0 0 7px;
  font-size: 17px;
  font-weight: 850;
}

.short-title {
  display: -webkit-box;
  max-width: 92%;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.channel-card {
  align-content: end;
  padding: 120px 18px calc(24px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(12, 13, 12, 0.08), rgba(12, 13, 12, 0.96)),
    radial-gradient(circle at 50% 35%, rgba(255, 61, 71, 0.24), transparent 35%),
    #0d0f0e;
}

.channel-card .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.channel-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.channel-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--text);
  color: #101211;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.empty-state {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  padding: 24px;
  text-align: center;
  background: var(--bg);
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.empty-state p {
  max-width: 310px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (min-width: 481px) {
  body {
    background:
      linear-gradient(90deg, #111, #050505 28%, #050505 72%, #111);
  }

  .app {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}

.admin-body {
  overflow: auto;
  background: #090b0a;
}

.admin-app {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

.admin-header,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-header {
  margin-bottom: 18px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-search {
  width: min(42vw, 190px);
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #070807;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.header-search::placeholder {
  color: var(--muted);
}

.admin-link,
.text-button,
.option-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.admin-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.option-tab {
  min-height: 42px;
  cursor: pointer;
}

.option-tab[aria-selected="true"] {
  border-color: rgba(255, 61, 71, 0.62);
  background: var(--accent);
  color: white;
}

.admin-form,
.admin-list-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.admin-form {
  display: grid;
  gap: 13px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #070807;
  color: var(--text);
  font: inherit;
}

.submit-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 900;
}

.form-message,
.muted-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.admin-list-section {
  margin-top: 16px;
}

.section-title {
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
}

.text-button {
  cursor: pointer;
}

.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.danger {
  color: #ff9aa0;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-item strong,
.admin-item span,
.admin-item p {
  display: block;
}

.admin-item strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.admin-item span,
.admin-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.list-app {
  width: min(100%, 720px);
}

.list-toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.channel-filter-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.channel-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.channel-filter[aria-pressed="true"] {
  border-color: rgba(255, 61, 71, 0.62);
  background: var(--accent);
  color: white;
}

.channel-filter strong {
  min-width: 24px;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(0, 0, 0, 0.24);
  font-size: 12px;
  text-align: center;
}

.shorts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.short-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.short-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #050505;
}

.short-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.short-card-copy {
  display: grid;
  gap: 8px;
  padding: 11px;
}

.short-card-copy h2,
.short-card-copy p {
  margin: 0;
}

.short-card-copy h2 {
  display: -webkit-box;
  min-height: 38px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.short-card-copy p {
  color: var(--muted);
  font-size: 12px;
}

.short-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.watch-short-button,
.delete-short-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.watch-short-button {
  border: 1px solid var(--line);
  background: var(--text);
  color: #101211;
}

.delete-short-button {
  border: 1px solid rgba(255, 154, 160, 0.42);
  background: rgba(255, 61, 71, 0.12);
  color: #ff9aa0;
  cursor: pointer;
}

.delete-short-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}
