/* Premium multistream viewer skin. Visual overrides only; layout behavior remains in existing styles. */

:root {
  --bg: #080a0e;
  --surface: #0d1015;
  --surface-2: #11151b;
  --surface-3: #171c24;
  --surface-4: #1d232d;
  --border: #242b35;
  --border-strong: #363f4c;
  --text: #f5f6f8;
  --muted: #a7acb6;
  --muted-2: #737985;
  --accent: #743ee8;
  --accent-2: #8a4df8;
  --accent-soft: rgba(122, 68, 238, 0.16);
  --danger: #ff626d;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

body {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.012), transparent 190px),
    #080a0e;
}

@media (min-width: 981px) {
  body::before {
    content: "";
    position: fixed;
    inset: 6px;
    z-index: 9999;
    border: 1px solid rgba(96, 108, 124, 0.25);
    border-radius: 18px;
    pointer-events: none;
  }
}

.topbar,
.app-shell,
.input-error-wrap,
.site-footer {
  width: calc(100% - 56px);
}

.topbar {
  min-height: 112px;
  grid-template-columns: minmax(290px, 1fr) minmax(500px, 700px) minmax(190px, 1fr);
  gap: 24px;
}

.top-left {
  gap: 20px;
}

.brand-primary {
  font-size: 1.95rem;
}

.brand-secondary {
  font-size: 1.38rem;
  color: #f1f2f5;
}

.menu-button {
  width: 46px;
  height: 46px;
  color: #e2e4e8;
}

.menu-button:hover {
  background: rgba(255,255,255,0.045);
  border-color: transparent;
}

.top-actions {
  gap: 12px;
}

.top-icon-button {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border-color: #2b323d;
  background: #0f1319;
  color: #e0e3e8;
  box-shadow: none;
}

.top-icon-button:hover {
  background: #171c24;
  border-color: #414a58;
}

.add-stream-form {
  min-height: 58px;
  gap: 4px;
  padding: 5px;
  border-radius: 18px;
  border-color: #2f3742;
  background: #11151b;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.add-stream-form:focus-within {
  border-color: rgba(145, 103, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(116, 62, 232, 0.10);
}

.input-icon {
  width: 45px;
  height: 46px;
  color: #d1d4da;
}

.stream-input {
  height: 46px;
  font-size: 0.96rem;
}

.stream-input::placeholder {
  color: #858b95;
}

.primary-button {
  height: 46px;
  min-width: 104px;
  padding-inline: 19px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8a4df8, #6d32dd);
  box-shadow: none;
}

.primary-button:hover {
  background: linear-gradient(135deg, #975dff, #7a40e8);
}

.app-menu {
  top: 54px;
  min-width: 205px;
  padding: 7px;
  border-radius: 12px;
  border-color: #313945;
  background: #11151b;
  box-shadow: 0 16px 38px rgba(0,0,0,.42);
}

.app-menu a {
  min-height: 42px;
  border-radius: 8px;
  color: #e2e4e8;
}

.app-menu .donate-link {
  color: #bda8ff;
}

.app-menu .contact-link + a {
  margin-top: 5px;
  box-shadow: inset 0 1px #2b323c;
  border-radius: 4px 4px 8px 8px;
}

.input-error-wrap {
  margin-top: -18px;
  margin-bottom: 6px;
}

.app-shell {
  padding-bottom: 30px;
}

.empty-state {
  min-height: 470px;
  border-radius: 14px;
  border-color: #282f39;
  background: #0d1015;
}

.empty-icon {
  border-radius: 13px;
  background: rgba(116, 62, 232, 0.14);
}

.stream-grid {
  gap: 12px;
}

.stream-card {
  border-radius: 13px;
  border-color: #2a313b;
  background: #0d1015;
  box-shadow: 0 6px 18px rgba(0,0,0,.20);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

@media (hover: hover) {
  .stream-card:hover {
    border-color: #3b4552;
    box-shadow: 0 9px 24px rgba(0,0,0,.26);
    transform: translateY(-1px);
  }
}

.stream-toolbar {
  height: 48px;
  padding: 0 10px 0 11px;
  gap: 10px;
  border-bottom-color: #272e37;
  background: #11151b;
}

.stream-identity {
  gap: 9px;
}

.drag-handle {
  width: 13px;
  height: 22px;
  flex: 0 0 13px;
  opacity: 0.58;
  cursor: grab;
  background-image: radial-gradient(circle, #c8ccd2 1.35px, transparent 1.6px);
  background-size: 6px 6px;
  background-position: 0 2px;
}

.stream-card:hover .drag-handle {
  opacity: 0.88;
}

.stream-card.is-dragging .drag-handle {
  cursor: grabbing;
}

.platform-badge {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 0.70rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.09);
}

.platform-badge[data-platform="twitch"] {
  background: #7a4df3;
}

.platform-badge[data-platform="kick"] {
  background: #53df18;
}

.platform-badge[data-platform="youtube"] {
  background: #ef2634;
}

.stream-name {
  font-size: 0.87rem;
  font-weight: 700;
  color: #f1f2f4;
}

.stream-actions {
  gap: 4px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #d3d6dc;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button:hover {
  border-color: #38414e;
  background: #191e26;
  color: #fff;
}

.focus-button.is-active {
  background: rgba(116, 62, 232, 0.16);
  color: #bba7ff;
}

.remove-button:hover {
  border-color: rgba(255, 98, 109, .30);
  background: rgba(255, 98, 109, .08);
  color: #ff7b84;
}

.player-shell {
  background: #000;
}

.action-bar {
  width: min(1120px, 100%);
  min-height: 68px;
  margin: 14px auto 0;
  padding: 8px;
  grid-template-columns: minmax(150px, .9fr) repeat(3, minmax(165px, 1.08fr)) minmax(145px, .82fr);
  gap: 8px;
  border-radius: 16px;
  border-color: #2c333d;
  background: #11151b;
  box-shadow: 0 10px 24px rgba(0,0,0,.24);
}

.layout-control,
.stream-count-pill,
.action-button,
.danger-action {
  min-width: 0;
}

.stream-count-pill,
.action-button {
  min-height: 48px;
  height: 48px;
  border-radius: 11px;
  border-color: #303844;
  background: #171c24;
  color: #eceef2;
  box-shadow: none;
}

.stream-count-pill {
  padding-inline: 13px;
  font-size: 0.84rem;
}

.stream-count-pill:hover,
.action-button:hover {
  border-color: #414b59;
  background: #1c222b;
}

.stream-count-pill[aria-expanded="true"] {
  border-color: rgba(145, 103, 255, 0.55);
  background: rgba(116, 62, 232, 0.14);
}

.mini-grid-icon {
  width: 29px;
  height: 29px;
  padding: 6px;
  border-radius: 7px;
  background: #202630;
}

.action-button {
  padding-inline: 16px;
  font-size: 0.84rem;
  font-weight: 600;
}

.action-button svg {
  width: 19px;
  height: 19px;
}

.save-action {
  border-color: transparent;
  background: linear-gradient(135deg, #8a4df8, #6e34df);
  color: #fff;
  box-shadow: none;
}

.save-action:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #975eff, #7942e8);
}

.danger-action {
  width: 100%;
  justify-self: stretch;
  color: #eceef2;
}

.danger-action:hover {
  color: #ff7b84;
  border-color: rgba(255, 98, 109, .30);
  background: rgba(255, 98, 109, .07);
}

.layout-menu {
  border-radius: 12px;
  border-color: #313945;
  background: #11151b;
  box-shadow: 0 16px 38px rgba(0,0,0,.42);
}

.layout-option {
  border-radius: 8px;
}

.layout-option:hover {
  background: #1a2028;
}

.site-footer {
  margin-top: 0;
  padding: 14px 4px 22px;
  border-top-color: rgba(54, 63, 76, .55);
  color: #747a84;
  font-size: 0.70rem;
}

.site-footer a {
  color: #8d929c;
}

.toast {
  border-radius: 11px;
  background: #191f27;
  border-color: #35404c;
}

/* Preserve the existing compact 5-8 stream desktop behavior. */
@media (orientation: landscape) and (min-width: 1200px) {
  body:has(.stream-grid > .stream-card:nth-child(5)) .topbar {
    min-height: 90px;
  }

  body:has(.stream-grid > .stream-card:nth-child(5)) .stream-grid {
    gap: 10px;
  }

  body:has(.stream-grid > .stream-card:nth-child(5)) .stream-toolbar {
    height: 44px;
    padding-inline: 9px;
  }

  body:has(.stream-grid > .stream-card:nth-child(5)) .platform-badge {
    width: 27px;
    height: 27px;
  }

  body:has(.stream-grid > .stream-card:nth-child(5)) .stream-name {
    font-size: 0.81rem;
  }

  body:has(.stream-grid > .stream-card:nth-child(5)) .icon-button {
    width: 31px;
    height: 31px;
  }

  body:has(.stream-grid > .stream-card:nth-child(5)) .action-bar {
    min-height: 62px;
    margin-top: 10px;
    padding: 6px;
  }

  body:has(.stream-grid > .stream-card:nth-child(5)) .stream-count-pill,
  body:has(.stream-grid > .stream-card:nth-child(5)) .action-button {
    min-height: 40px;
    height: 40px;
  }
}

@media (max-width: 1280px) {
  .topbar {
    min-height: 124px;
    grid-template-columns: minmax(225px, 1fr) minmax(430px, 650px) minmax(150px, 1fr);
    gap: 18px;
  }

  .brand-primary { font-size: 1.72rem; }
  .brand-secondary { font-size: 1.22rem; }

  .action-bar {
    width: 100%;
    grid-template-columns: minmax(145px, .9fr) repeat(3, minmax(145px, 1fr)) minmax(135px, .8fr);
  }
}

@media (max-width: 980px) {
  body::before { display: none; }

  .topbar {
    min-height: 166px;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "left actions"
      "form form";
    padding: 16px 0 18px;
  }

  .top-left { grid-area: left; }
  .add-stream-form {
    grid-area: form;
    width: min(760px, 100%);
    justify-self: center;
  }
  .top-actions { grid-area: actions; }

  .stream-card:hover {
    transform: none;
  }

  .action-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .layout-control {
    grid-column: 1 / -1;
  }

  .action-button,
  .danger-action {
    width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 720px) {
  .topbar,
  .app-shell,
  .input-error-wrap,
  .site-footer {
    width: calc(100% - 24px);
  }

  .topbar {
    min-height: 154px;
  }

  .stream-toolbar {
    height: 50px;
  }

  .drag-handle {
    width: 11px;
    flex-basis: 11px;
  }

  .action-bar {
    padding: 7px;
    gap: 7px;
  }
}

@media (max-width: 560px) {
  .action-bar {
    grid-template-columns: 1fr;
  }

  .layout-control {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .add-stream-form {
    border-radius: 15px;
  }

  .primary-button {
    height: 46px;
    border-radius: 11px;
  }

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

  .stream-toolbar {
    padding-inline: 9px;
  }
}


/* Square-corner visual pass inspired by marlrivera.com. */
@media (min-width: 981px) {
  body::before {
    border-radius: 4px;
  }
}

.top-icon-button,
.add-stream-form,
.primary-button,
.app-menu,
.app-menu a,
.app-menu .contact-link + a,
.empty-state,
.empty-icon,
.stream-card,
.platform-badge,
.icon-button,
.action-bar,
.stream-count-pill,
.mini-grid-icon,
.action-button,
.layout-menu,
.layout-option,
.toast {
  border-radius: 4px;
}

@media (max-width: 520px) {
  .add-stream-form,
  .primary-button,
  .stream-card {
    border-radius: 4px;
  }
}
