@property --color-primary {
  syntax: "<color>";
  inherits: false;
  initial-value: #ff0b00;
}
@property --color-secondary {
  syntax: "<color>";
  inherits: false;
  initial-value: #ff9300;
}
@property --color-background-primary {
  syntax: "<color>";
  inherits: false;
  initial-value: #0d1117;
}
@property --color-background-secondary {
  syntax: "<color>";
  inherits: false;
  initial-value: #161b22;
}
@property --color-border {
  syntax: "<color>";
  inherits: false;
  initial-value: #21262d;
}
@property --color-font {
  syntax: "<color>";
  inherits: false;
  initial-value: #fff;
}
:root {
  --color-font-muted: oklch(from var(--color-font) calc(l - 0.4) c h);
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Arial, sans-serif;
  background-color: var(--color-background-primary);
  font-family: "JetBrains Mono", monospace;
}

header {
  flex-shrink: 0;
  padding: 0.5em 1em 0.1em 1em;
  border-bottom: var(--color-border) 0.1em solid;
}

.logo {
  display: flex;
  align-items: center;
  height: 3rem;
  font-size: 0.8rem;
  margin: 0;
  color: var(--color-primary);
  font-family: "Arial Black", sans-serif;
  text-decoration: none;
}
.logo h1 {
  transform: scaleX(0.85);
}
.logo svg {
  height: 100%;
  width: auto;
}
.logo svg .st0 {
  fill: var(--color-primary);
}
.logo svg .st1 {
  fill: var(--color-secondary);
}

main {
  flex: 1;
  display: block;
  color: var(--color-font);
  padding: min(2em, 5%) 5%;
}

/* ==================== Loader ==================== */
#loader {
  display: flex;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  text-align: center;
  margin: 0 auto;
}
#loader p {
  border: 0.1em solid transparent;
  padding: 0.5em;
}

.loading_error {
  border-color: red !important;
  background-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
  border-radius: 0.5em;
}

.spinner-stop {
  color: var(--color-primary);
}

/*Loading spinner*/
.spinner {
  width: 4rem;
  height: 4rem;
  border: 0.2rem dotted #fff;
  border-style: solid solid dotted dotted;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  animation: rotation 2s linear infinite;
}
.spinner::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  border: 0.2rem dotted var(--color-primary);
  border-style: solid solid dotted;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  animation: rotationBack 1s linear infinite;
  transform-origin: center center;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes rotationBack {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}
/* ==================== Section Header ==================== */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-font-muted);
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15em 0.55em;
  background: oklch(from var(--color-primary) calc(l - 0.4) c h);
  color: oklch(from var(--color-primary) calc(l + 0.2) c h);
  border-radius: 20px;
}

/* ==================== Cards ==================== */
.cards_list {
  display: grid;
  width: 100%;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
@media (max-width: 349px) {
  .cards_list {
    grid-template-columns: 1fr;
  }
}

.card {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: var(--color-background-secondary);
  border: 0.1em solid var(--color-border);
  text-decoration: none;
  color: var(--color-font);
}
.card:hover {
  background-color: oklch(from var(--color-background-secondary) calc(l + 0.1) c h);
}
.card:hover .stream-name {
  color: var(--color-secondary);
}
.card:hover .stream-arrow {
  color: var(--color-secondary);
  transform: scale(1.2);
}

.stream-top {
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin-left: 0.4rem;
}

.stream-name {
  font-size: 1.4rem;
  font-weight: 600;
}

.live-dot {
  position: relative;
  width: 0.5em;
  height: 0.5em;
  flex-shrink: 0;
}

.live-dot::before,
.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-primary);
}

.live-dot::after {
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  70% {
    transform: scale(2.6);
    opacity: 0;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}
.stream-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 349px) {
  .stream-meta {
    grid-template-columns: 1fr;
  }
}

.meta-item {
  display: inline-flex;
  height: 1.2rem;
  color: var(--color-font-muted);
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.stream-arrow {
  color: var(--color-border);
  height: 1.5rem;
  margin-left: auto;
}

/* ==================== Footer ==================== */
footer {
  flex-shrink: 0;
  padding: 0.1em 1em 0.5em 1em;
  border-top: var(--color-border) 0.1em solid;
  color: var(--color-font-muted);
  font-size: 0.8rem;
}
