:root {
  color-scheme: dark;
  --surface: rgba(15, 23, 42, 0.88);
  --surface-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.22);
  --line-strong: rgba(248, 113, 113, 0.48);
  --text-muted: #94a3b8;
  --accent: #ef4444;
  --accent-soft: rgba(239, 68, 68, 0.15);
  --teal: #14b8a6;
  --amber: #f59e0b;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #020617;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #020617 0%, #111827 52%, #0b1120 100%);
  background-size: 36px 36px, 36px 36px, auto;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: '';
  background:
    linear-gradient(110deg, rgba(20, 184, 166, 0.08), transparent 34%),
    linear-gradient(250deg, rgba(245, 158, 11, 0.06), transparent 42%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.absolute {
  position: absolute;
}

.relative {
  position: relative;
}

.inset-0 {
  inset: 0;
}

.mx-auto {
  margin-inline: auto;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.grid {
  display: grid;
}

.flex {
  display: flex;
}

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

.flex-1 {
  flex: 1 1 0%;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.min-h-0 {
  min-height: 0;
}

.min-h-full {
  min-height: 100%;
}

.min-h-\[480px\] {
  min-height: 480px;
}

.min-h-\[520px\] {
  min-height: 520px;
}

.min-w-0 {
  min-width: 0;
}

.h-4 {
  height: 1rem;
}

.h-full {
  height: 100%;
}

.w-4 {
  width: 1rem;
}

.w-full {
  width: 100%;
}

.max-w-3xl {
  max-width: 48rem;
}

.shrink-0 {
  flex-shrink: 0;
}

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

.aspect-video {
  aspect-ratio: 16 / 9;
}

.overflow-hidden {
  overflow: hidden;
}

.rounded-lg {
  border-radius: 0.5rem;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.border {
  border-width: 1px;
  border-style: solid;
}

.border-b {
  border-bottom-width: 1px;
  border-bottom-style: solid;
}

.border-slate-700\/70 {
  border-color: rgba(51, 65, 85, 0.7);
}

.bg-black {
  background: #000;
}

.bg-slate-900\/92 {
  background: rgba(15, 23, 42, 0.92);
}

.bg-slate-950\/80 {
  background: rgba(2, 6, 23, 0.8);
}

.bg-white {
  background: #fff;
}

.p-3 {
  padding: 0.75rem;
}

.px-2 {
  padding-inline: 0.5rem;
}

.px-4 {
  padding-inline: 1rem;
}

.py-3 {
  padding-block: 0.75rem;
}

.py-4 {
  padding-block: 1rem;
}

.text-center {
  text-align: center;
}

.font-sans {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.font-bold {
  font-weight: 700;
}

.leading-6 {
  line-height: 1.5rem;
}

.text-slate-200 {
  color: #e2e8f0;
}

.text-slate-300 {
  color: #cbd5e1;
}

.text-slate-400 {
  color: #94a3b8;
}

.text-white {
  color: #fff;
}

.underline {
  text-decoration-line: underline;
}

.decoration-slate-500 {
  text-decoration-color: #64748b;
}

.underline-offset-4 {
  text-underline-offset: 4px;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.ad-slot {
  min-height: 90px;
  border: 1px dashed rgba(148, 163, 184, 0.42);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.76), rgba(30, 41, 59, 0.72)),
    repeating-linear-gradient(135deg, transparent 0 12px, rgba(148, 163, 184, 0.035) 12px 24px);
}

.ad-slot[hidden] {
  display: none !important;
}

.ad-slot--active {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot--active .adsbygoogle {
  max-width: 100%;
}

.app-shell {
  min-height: calc(100vh - 228px);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.live-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1.1rem 1.2rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(239, 68, 68, 0.1), transparent 26rem),
    linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.3));
}

.live-header__identity {
  display: grid;
  width: min(100%, 58rem);
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  justify-content: center;
}

.live-header__content {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 0.65rem;
}

.title-heading {
  min-width: 0;
  max-width: 56rem;
  color: #f8fafc;
  font-size: clamp(1.35rem, 1.1rem + 0.65vw, 2rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.14;
  text-align: center;
}

.countdown-status {
  display: grid;
  width: min(100%, 48rem);
  grid-template-columns: minmax(16rem, 1fr) auto;
  align-items: center;
  justify-self: center;
  gap: 0.75rem;
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 0.7rem;
  padding: 0.58rem 0.65rem;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.13), rgba(245, 158, 11, 0.08)),
    rgba(2, 6, 23, 0.56);
}

.countdown-status[hidden] {
  display: none;
}

.countdown-status__copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  color: #5eead4;
}

.countdown-status__text {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.countdown-status__description {
  min-width: 0;
  color: #e2e8f0;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
}

.countdown-status__timer {
  display: grid;
  grid-template-columns: repeat(4, minmax(3rem, auto));
  gap: 0.35rem;
}

.countdown-unit {
  display: grid;
  min-width: 3rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.5rem;
  padding: 0.3rem 0.36rem;
  background: rgba(15, 23, 42, 0.72);
  text-align: center;
}

.countdown-unit strong {
  color: #f8fafc;
  font-size: 1rem;
  line-height: 1.05;
}

.countdown-unit small {
  color: #94a3b8;
  font-size: 0.66rem;
  font-weight: 800;
}

.admin-shell {
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.34);
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-card {
  width: min(100%, 30rem);
}

.login-status {
  width: 100%;
  border-radius: 0.5rem;
  text-align: center;
}

.admin-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.admin-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.countdown-toggle {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.55rem;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 750;
}

.countdown-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--teal);
}

.field-label {
  color: #cbd5e1;
  font-size: 0.84rem;
  font-weight: 700;
}

.admin-input,
.admin-textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0.5rem;
  background: rgba(2, 6, 23, 0.54);
  color: white;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.admin-input {
  min-height: 2.75rem;
  padding: 0.7rem 0.8rem;
}

.admin-textarea {
  min-height: 10rem;
  resize: vertical;
  padding: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.84rem;
  line-height: 1.55;
}

.admin-input:focus,
.admin-textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.admin-save-button {
  border-color: rgba(20, 184, 166, 0.58);
  background: rgba(20, 184, 166, 0.16);
  color: #99f6e4;
}

.admin-save-button:hover {
  background: rgba(20, 184, 166, 0.24);
}

.preview-row {
  display: grid;
  gap: 0.35rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  padding-bottom: 0.75rem;
}

.preview-row dt {
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 700;
}

.preview-row dd {
  overflow-wrap: anywhere;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.45;
}

.article-editor-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.5rem;
  padding: 0.85rem;
  background: rgba(2, 6, 23, 0.28);
}

.article-editor-row__legend {
  padding-inline: 0.35rem;
  color: #fca5a5;
  font-size: 0.82rem;
  font-weight: 800;
}

.article-editor-row__wide {
  grid-column: 1 / -1;
}

.admin-textarea--compact {
  min-height: 5.5rem;
}

.control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.5rem;
  padding: 0.55rem 0.8rem;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.82);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.control-button:hover {
  border-color: rgba(226, 232, 240, 0.38);
  background: rgba(30, 41, 59, 0.95);
}

.control-button:active {
  transform: translateY(1px);
}

.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.icon-button {
  width: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
}

.video-stage {
  background:
    linear-gradient(135deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.96)),
    linear-gradient(45deg, rgba(239, 68, 68, 0.05), rgba(20, 184, 166, 0.08));
}

.chat-panel {
  min-width: 0;
}

.chat-panel__header {
  display: flex;
  min-height: 3rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.9);
  padding: 0.55rem 0.7rem 0.55rem 0.85rem;
}

.chat-panel__title {
  min-width: 0;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 800;
}

.chat-panel__actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.38rem;
}

.chat-panel__live-dot {
  position: relative;
  display: inline-flex;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.25rem;
}

.chat-panel__live-dot::before {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #f87171;
  opacity: 0.75;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
  content: '';
}

.chat-panel__live-dot span {
  position: relative;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: #ef4444;
}

.chat-panel__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.chat-panel__body iframe {
  width: 100%;
}

.chat-icon-button {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.5rem;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.75);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.chat-icon-button:hover {
  border-color: rgba(20, 184, 166, 0.45);
  color: #99f6e4;
  background: rgba(30, 41, 59, 0.92);
}

.articles-section {
  background: rgba(15, 23, 42, 0.84);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
}

.articles-section[hidden] {
  display: none;
}

.articles-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 0.85rem;
}

.articles-section--single .articles-grid {
  grid-template-columns: 1fr;
}

.article-list[hidden] {
  display: none;
}

.article-featured,
.article-list-item {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.5rem;
  background: rgba(2, 6, 23, 0.32);
  color: inherit;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.article-featured:hover,
.article-list-item:hover {
  border-color: rgba(20, 184, 166, 0.48);
  background: rgba(15, 23, 42, 0.78);
}

.article-featured {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) minmax(0, 0.58fr);
  min-height: 13rem;
  overflow: hidden;
}

.article-featured__media {
  position: relative;
  display: flex;
  min-height: 13rem;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.12) 0 1px, transparent 1px 10px),
    linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(20, 184, 166, 0.16));
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 800;
}

.article-featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-featured__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
}

.article-featured__title {
  color: #f8fafc;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
}

.article-featured__summary {
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.55;
}

.article-list {
  display: grid;
  gap: 0.65rem;
}

.article-list-item {
  display: flex;
  min-height: 4.6rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.85rem;
}

.article-list-item__title {
  color: #f8fafc;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.35;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.35rem;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
}

.article-meta__category {
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
}

.article-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  color: #5eead4;
  font-size: 0.86rem;
  font-weight: 800;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  background: rgba(15, 23, 42, 0.72);
}

.site-footer__links,
.site-footer__link {
  display: flex;
  align-items: center;
}

.site-footer__links {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.site-footer__link {
  gap: 0.4rem;
  min-height: 2.25rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.5rem;
  padding: 0.45rem 0.7rem;
  color: #e2e8f0;
  background: rgba(2, 6, 23, 0.35);
  font-size: 0.86rem;
  font-weight: 750;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.site-footer__link:hover {
  border-color: rgba(20, 184, 166, 0.48);
  color: #99f6e4;
  background: rgba(15, 23, 42, 0.82);
}

.status-pill {
  min-width: 7rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  color: #cbd5e1;
  background: rgba(2, 6, 23, 0.4);
}

.status-pill[data-type='success'] {
  border-color: rgba(20, 184, 166, 0.5);
  color: #5eead4;
}

.status-pill[data-type='error'] {
  border-color: rgba(248, 113, 113, 0.68);
  color: #fca5a5;
}

.chat-hidden .chat-panel__body {
  display: none;
}

.chat-hidden [data-chat-panel] {
  min-height: 3rem;
}

@keyframes ping {
  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@media (min-width: 1024px) {
  .lg\:aspect-auto {
    aspect-ratio: auto;
  }

  .lg\:border-b-0 {
    border-bottom-width: 0;
  }

  .lg\:border-r {
    border-right-width: 1px;
    border-right-style: solid;
  }

  .lg\:grid-cols-\[minmax\(0\,65fr\)_minmax\(320px\,35fr\)\] {
    grid-template-columns: minmax(0, 65fr) minmax(320px, 35fr);
  }

  .lg\:min-h-0 {
    min-height: 0;
  }

  .chat-hidden main {
    grid-template-columns: minmax(0, 1fr) 3.5rem !important;
  }

  .chat-hidden .chat-panel__header {
    height: 100%;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0.65rem 0.45rem;
  }

  .chat-hidden .chat-panel__title,
  .chat-hidden .chat-panel__live-dot {
    display: none;
  }

  .chat-hidden .chat-panel__actions {
    flex-direction: column;
  }
}

.is-theater {
  padding: 0;
}

.is-theater .ad-slot {
  display: none;
}

.is-theater [data-articles-section] {
  display: none;
}

.is-theater .site-footer {
  display: none;
}

.is-theater .app-shell {
  min-height: 100vh;
  border-radius: 0;
}

@media (min-width: 1024px) {
  .app-shell {
    height: calc(100vh - 228px);
    min-height: 680px;
  }
}

@media (max-width: 640px) {
  .live-header {
    padding: 0.9rem;
  }

  .live-header__identity {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .countdown-status {
    grid-template-columns: 1fr;
  }

  .countdown-status__timer {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .countdown-unit {
    min-width: 0;
  }

  .control-button {
    min-height: 2.35rem;
    padding-inline: 0.65rem;
  }

  .status-pill {
    min-width: 0;
  }

  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .site-footer__links {
    justify-content: center;
  }

  .site-footer__link {
    flex: 1 1 100%;
    justify-content: center;
  }

  .article-editor-row,
  .article-featured {
    grid-template-columns: 1fr;
  }

  .article-featured__media {
    min-height: 10rem;
  }
}

@media (min-width: 768px) {
  .md\:p-4 {
    padding: 1rem;
  }

  .md\:px-6 {
    padding-inline: 1.5rem;
  }

  .md\:py-6 {
    padding-block: 1.5rem;
  }

  .md\:text-base {
    font-size: 1rem;
    line-height: 1.5rem;
  }
}

@media (max-width: 900px) {
  .live-header {
    grid-template-columns: 1fr;
  }

  .admin-two-column,
  .admin-grid,
  .articles-grid {
    grid-template-columns: 1fr;
  }
}
