/* Partner live studio — Photoshop layout (sidebar | main) */

.stream-modal {
  position: fixed;
  inset: 0;
  z-index: 205;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2vw, 28px);
}

.stream-modal[hidden] {
  display: none;
}

.stream-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(4px);
}

.stream-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(980px, 96vw);
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 1.8vw, 1.35rem) clamp(1.1rem, 2vw, 1.65rem) clamp(1.1rem, 1.8vw, 1.45rem);
  border-radius: 22px;
  background: linear-gradient(165deg, #1a1a1a 0%, #0e0e0e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.62);
  overflow: hidden;
}

.stream-modal__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(172px, 210px) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.stream-modal__tabs {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.35rem 1rem 0.35rem 0.15rem;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.stream-modal__tab {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 54px;
  padding: 0.7rem 0.75rem;
  border: none;
  border-radius: 14px;
  background: rgba(42, 42, 42, 0.55);
  color: rgba(255, 255, 255, 0.72);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.stream-modal__tab--active {
  background: var(--color-red);
  color: #fff;
}

.stream-modal__tab-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.stream-modal__main {
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-left: clamp(0.85rem, 1.6vw, 1.35rem);
  overflow: hidden;
}

.stream-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-right: 0;
}

.stream-modal__title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.stream-modal__gif-unit {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.28rem 0.28rem 0.28rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff1a8 0%, #f0a800 100%);
  color: #3d2500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 3px 0 #7a4e00;
}

.stream-modal__gif-unit span {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.stream-modal__gif-unit strong {
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stream-modal__gif-unit-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #8a5600;
  cursor: pointer;
}

.stream-modal__gif-unit-refresh:hover {
  background: #fffaf0;
}

.stream-modal__gif-unit-refresh.is-spinning svg {
  animation: partner-gif-spin 0.6s linear infinite;
}

@keyframes partner-gif-spin {
  to {
    transform: rotate(360deg);
  }
}

.stream-modal__title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 2.65rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-align: left;
  margin: 0;
}

.stream-modal__start,
.stream-modal__status {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: #a80012;
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.stream-modal__start:hover,
.stream-modal__status.is-live {
  filter: brightness(1.08);
}

.stream-modal__status {
  cursor: pointer;
  user-select: none;
  background: #2e2e2e;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.stream-modal__status.is-timing {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  min-width: 6.5rem;
  text-align: center;
}

.stream-modal__start.is-live,
.stream-modal__status.is-live {
  background: #2e2e2e;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.stream-modal__msg {
  margin: 0 0 0.55rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.stream-modal__msg--ok {
  background: rgba(0, 128, 64, 0.18);
  border: 1px solid rgba(0, 200, 100, 0.35);
  color: #b8ffd4;
}

.stream-modal__msg--error {
  background: rgba(160, 0, 0, 0.22);
  border: 1px solid rgba(220, 40, 40, 0.45);
  color: #ffc4c4;
}

.stream-modal__msg[hidden] {
  display: none;
}

.stream-modal__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(248px, 0.88fr);
  gap: clamp(0.85rem, 1.5vw, 1.15rem);
  min-width: 0;
  min-height: 0;
  align-items: stretch;
  flex: 1;
  overflow: hidden;
}

.stream-modal__workspace[hidden] {
  display: none !important;
}

.stream-modal__workspace--records:not([hidden]) {
  display: flex;
  min-height: 0;
}

.stream-records {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.stream-records__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.stream-records__meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
  font-weight: 700;
}

.stream-records__search input {
  width: min(240px, 42vw);
  height: 34px;
  padding: 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
}

.stream-records__msg {
  margin: 0;
  color: #ffb4b4;
  font-size: 0.82rem;
}

.stream-records__msg[hidden] {
  display: none !important;
}

.stream-records__table-wrap {
  min-height: 0;
  flex: 1 1 auto;
  max-height: min(58vh, 520px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}

.stream-records__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 0.78rem;
}

.stream-records__table th,
.stream-records__table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

.stream-records__table th {
  position: sticky;
  top: 0;
  background: #1a1a1a;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stream-records__table td {
  color: #fff;
}

.stream-records__table--details td:nth-child(n + 4),
.stream-records__table--details th:nth-child(n + 4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stream-records__table--details td:last-child,
.stream-records__table--details th:last-child {
  text-align: left;
}

.stream-records__table--gifts td:nth-child(n + 4),
.stream-records__table--gifts th:nth-child(n + 4) {
  text-align: left;
}

.stream-records__table--gifts td:nth-child(4),
.stream-records__table--gifts th:nth-child(4) {
  text-align: right;
}

.stream-records__empty {
  text-align: center !important;
  color: rgba(255, 255, 255, 0.5) !important;
  padding: 1.4rem 0.7rem !important;
}

.stream-records__sub {
  display: block;
  margin-top: 0.15rem;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.72rem;
  font-weight: 600;
}

.stream-records__gift {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.stream-records__gift img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.stream-records__status {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.stream-records__status--live {
  color: #7dffa8;
}

.stream-records__pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.stream-records__pager[hidden] {
  display: none !important;
}

.stream-records__pager button {
  height: 32px;
  padding: 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.stream-records__pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

.stream-modal__stage {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.stream-modal__preview {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  max-height: min(52vh, 480px);
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: min(28vh, 220px);
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.stream-modal__preview.has-broadcast {
  max-height: min(56vh, 520px);
  min-height: min(32vh, 260px);
}

.stream-modal__preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  z-index: 3;
  background: #000;
}

.stream-modal__preview.has-broadcast .stream-modal__preview-field,
.stream-modal__preview.has-broadcast .stream-modal__preview-field::after,
.stream-modal__preview.has-broadcast .stream-modal__preview-scrim {
  display: none;
}

.partner-picker {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.partner-picker[hidden] {
  display: none !important;
}

.partner-picker__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.partner-picker__dialog {
  position: relative;
  z-index: 1;
  margin: 0;
}

.partner-picker__search {
  width: 100%;
  margin: 0.65rem 0 0.75rem;
  padding: 0.62rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1a1a1a;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
}

.partner-picker__search::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.partner-picker__search:focus {
  outline: 2px solid rgba(196, 255, 0, 0.35);
  border-color: rgba(196, 255, 0, 0.45);
}

.partner-picker__close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.stream-modal__field--comments {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.stream-modal__comment-feed {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: min(320px, 48vh);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1e1e1e;
  overflow: hidden;
}

.stream-modal__comment-empty {
  margin: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.85rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.stream-modal__comment-empty[hidden] {
  display: none !important;
}

.stream-modal__comment-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.55rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.stream-modal__comment-composer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.stream-modal__comment-composer:focus-within {
  box-shadow: inset 0 0 0 1px rgba(225, 6, 0, 0.55);
}

.stream-modal__comment-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #2a2a2a;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
}

.stream-modal__comment-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.stream-modal__comment-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.22);
}

.stream-modal__comment-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stream-modal__comment-send {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-red, #e10600);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.stream-modal__comment-send:hover:not(:disabled) {
  filter: brightness(1.08);
}

.stream-modal__comment-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stream-modal__comment-msg--self .stream-modal__comment-bubble {
  background: rgba(225, 6, 0, 0.22);
  border: 1px solid rgba(225, 6, 0, 0.35);
}

.stream-modal__comment-msg--self .stream-modal__comment-bubble--gift {
  display: inline-flex;
}

.stream-modal__comment-messages::-webkit-scrollbar {
  width: 6px;
}

.stream-modal__comment-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
}

.stream-modal__comment-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.stream-modal__comment-face {
  position: relative;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
}

.stream-modal__comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stream-modal__comment-avatar--empty {
  background: rgba(255, 255, 255, 0.1);
}

.stream-modal__comment-team {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: contain;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 1px;
  box-sizing: border-box;
}

.stream-modal__comment-body {
  min-width: 0;
  flex: 1;
}

.stream-modal__comment-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.stream-modal__comment-host-live {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px 1px 4px;
  border-radius: 999px;
  background: rgba(255, 59, 59, 0.2);
  color: #ff7a7a;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
}

.stream-modal__comment-host-live::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 5px #ff4d4d;
}

.stream-modal__comment-bubble {
  margin: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  line-height: 1.35;
  color: #fff;
  word-break: break-word;
}

.stream-modal__comment-bubble--gift {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.stream-modal__comment-bubble--gift-normal,
.stream-modal__comment-msg--self .stream-modal__comment-bubble--gift-normal {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d8d8d8;
}

.stream-modal__comment-bubble--gift-pro,
.stream-modal__comment-msg--self .stream-modal__comment-bubble--gift-pro {
  background: linear-gradient(180deg, rgba(70, 160, 255, 0.34), rgba(16, 70, 168, 0.46));
  border: 1px solid rgba(130, 196, 255, 0.7);
  color: #eaf5ff;
}

.stream-modal__comment-bubble--gift-proplus,
.stream-modal__comment-msg--self .stream-modal__comment-bubble--gift-proplus {
  background: linear-gradient(180deg, rgba(255, 214, 90, 0.4), rgba(150, 90, 0, 0.46));
  border: 1px solid rgba(255, 210, 80, 0.78);
  color: #fff6d0;
  box-shadow: 0 0 14px rgba(255, 196, 60, 0.28);
}

.stream-modal__comment-gift-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.stream-modal__preview-field {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 42% at 50% 58%, rgba(72, 160, 78, 0.55) 0%, transparent 70%),
    linear-gradient(180deg, rgba(18, 52, 22, 0.2) 0%, rgba(0, 0, 0, 0.45) 100%),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 48px,
      rgba(255, 255, 255, 0.03) 48px,
      rgba(255, 255, 255, 0.03) 49px
    ),
    #1a4d22;
}

.stream-modal__preview-field::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: clamp(72px, 12vw, 110px);
  height: clamp(72px, 12vw, 110px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0%, #ddd 18%, #999 42%, #666 70%, #444 100%);
  opacity: 0.42;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.stream-modal__preview-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.stream-modal__preview-live {
  position: absolute;
  left: 50%;
  bottom: clamp(0.85rem, 2vh, 1.35rem);
  transform: translateX(-50%);
  padding: 0.5rem 1.45rem;
  border-radius: 999px;
  background: var(--color-red);
  color: #fff;
  font-size: clamp(0.88rem, 1.6vw, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  opacity: 0.5;
  z-index: 2;
}

.stream-modal__preview.is-live .stream-modal__preview-live {
  opacity: 1;
  animation: stream-live-pulse 1.8s ease-in-out infinite;
}

@keyframes stream-live-pulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
}

.stream-modal__match-stats.is-api-locked,
.stream-modal__teams.is-api-locked {
  opacity: 0.72;
}

.stream-modal__match-stats.is-api-locked .stream-modal__stat-input,
.stream-modal__teams.is-api-locked .stream-modal__team-name {
  cursor: not-allowed;
  color: rgba(255, 255, 255, 0.55);
}

.stream-modal__teams.is-api-locked .stream-modal__logo {
  cursor: not-allowed;
  pointer-events: none;
}

.stream-modal__match-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.15rem;
}

.stream-modal__match-col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 0.5rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stream-modal__match-col-label {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.stream-modal__stat-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}

.stream-modal__stat-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-height: 72px;
  padding: 0.35rem 0.2rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: #2a2a2a;
  cursor: text;
}

.stream-modal__stat-field-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  line-height: 1.15;
}

.stream-modal__stat-field-head img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.stream-modal__stat-input {
  width: 100%;
  max-width: 3.25rem;
  padding: 0.2rem 0.15rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.stream-modal__stat-input::-webkit-outer-spin-button,
.stream-modal__stat-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stream-modal__stat-input:focus {
  outline: none;
  border-color: rgba(196, 255, 0, 0.45);
  box-shadow: 0 0 0 2px rgba(196, 255, 0, 0.12);
}

.stream-modal__stat-input--goal {
  font-size: 1.15rem;
  color: #b8ff3d;
  max-width: 3.5rem;
}

.stream-modal__stat-field--goal {
  min-height: 78px;
}

.stream-modal__api-match {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stream-modal__api-match-label {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.stream-modal__api-match-value {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

.stream-modal__api-match-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.stream-modal__api-sync {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
}

.stream-modal__api-btn {
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  border: none;
  background: var(--color-red, #e10600);
  color: #fff;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.stream-modal__api-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.partner-fixture-picker {
  z-index: 230;
}

.partner-fixture-picker__dialog {
  width: min(520px, 94vw);
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
}

.partner-fixture-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.partner-fixture-list__empty {
  margin: 0.5rem 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.partner-fixture-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.partner-fixture-item:hover {
  background: rgba(225, 6, 0, 0.12);
  border-color: rgba(225, 6, 0, 0.35);
}

.partner-fixture-item__league {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.5);
}

.partner-fixture-item__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.35rem;
  align-items: center;
}

.partner-fixture-item__team {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 0;
}

.partner-fixture-item__team img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.partner-fixture-item__team--away {
  justify-content: flex-end;
  text-align: right;
}

.partner-fixture-item__status {
  font-size: 0.72rem;
  font-weight: 800;
  color: #ff9a9a;
  white-space: nowrap;
}

.stream-modal__teams {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: clamp(0.45rem, 1vw, 0.7rem);
  align-items: center;
}

.stream-modal__logo {
  width: clamp(58px, 7vw, 72px);
  height: clamp(58px, 7vw, 72px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  text-align: center;
  padding: 0.3rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.15;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stream-modal__logo:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 2px rgba(196, 255, 0, 0.12);
}

.stream-modal__logo:focus-visible {
  outline: 2px solid #c4ff00;
  outline-offset: 2px;
}

.stream-modal__logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.stream-modal__logo.has-image .stream-modal__logo-placeholder {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stream-modal__logo.is-uploading {
  pointer-events: none;
  opacity: 0.65;
}

.stream-modal__team-name {
  width: 100%;
  min-width: 0;
  padding: 0.58rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #2a2a2a;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.stream-modal__controls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.stream-modal__controls > .stream-modal__field:not(.stream-modal__field--comments) {
  flex-shrink: 0;
}

.stream-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.stream-modal__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: capitalize;
  color: rgba(255, 255, 255, 0.52);
}

.stream-modal__input,
.stream-modal__textarea {
  width: 100%;
  padding: 0.62rem 0.72rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #2a2a2a;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
}

.stream-modal__textarea {
  min-height: 5.5rem;
  max-height: 9rem;
  resize: none;
  overflow-y: auto;
}

.stream-modal__key-row {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #2a2a2a;
  min-height: 2.65rem;
}

.stream-modal__key {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 0.58rem 4.25rem 0.58rem 0.72rem;
  background: transparent;
  border: none;
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  word-break: break-all;
}

.stream-modal__copy {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #c8e600;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: lowercase;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
}

.stream-modal__save {
  margin-top: 0.35rem;
  padding: 0.68rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.stream-modal__save:hover {
  border-color: var(--color-red);
  color: #fff;
}

/* Side-by-side with profile (partner studio) */
body.partner-studio-open .site-header__user {
  display: none;
}

body.partner-studio-open {
  overflow: hidden;
  --studio-profile-col: min(380px, 31vw);
  --studio-edge: clamp(14px, 2vw, 32px);
  --studio-gap: clamp(10px, 1.4vw, 22px);
}

body.partner-studio-open .profile-modal__backdrop {
  opacity: 0;
  pointer-events: none;
}

body.partner-studio-open .profile-modal {
  z-index: 212;
  justify-content: flex-start;
  align-items: center;
  padding-left: var(--studio-edge);
  padding-right: 0;
  pointer-events: none;
}

body.partner-studio-open .profile-modal__dialog {
  width: var(--studio-profile-col);
  max-width: calc(100vw - var(--studio-edge) * 2);
  pointer-events: auto;
  margin: 0;
  box-shadow:
    0 0 0 2px rgba(212, 0, 0, 0.45),
    0 24px 60px rgba(0, 0, 0, 0.55);
}

body.partner-studio-open .stream-modal {
  z-index: 211;
  justify-content: flex-start;
  align-items: center;
  padding-left: calc(var(--studio-edge) + var(--studio-profile-col) + var(--studio-gap));
  padding-right: var(--studio-edge);
}

body.partner-studio-open .stream-modal__dialog {
  width: 100%;
  max-width: none;
  max-height: min(94vh, 880px);
  min-height: min(88vh, 760px);
}

body.partner-studio-open .stream-modal__preview {
  max-height: min(50vh, 440px);
  min-height: min(30vh, 240px);
}

body.partner-studio-open .stream-modal__preview.has-broadcast {
  max-height: min(54vh, 500px);
  min-height: min(34vh, 280px);
}

body.partner-studio-open .stream-modal__workspace {
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
}

body.stream-modal-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  body.partner-studio-open .profile-modal,
  body.partner-studio-open .stream-modal {
    justify-content: center;
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
  }

  body.partner-studio-open .profile-modal__dialog,
  body.partner-studio-open .stream-modal__dialog {
    width: min(100%, 520px);
    max-width: none;
    min-height: auto;
    margin: 12px auto;
  }

  .stream-modal__body {
    grid-template-columns: 1fr;
  }

  .stream-modal__tabs {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    padding: 0 0 0.75rem;
  }

  .stream-modal__tab {
    flex: 1;
    justify-content: center;
    font-size: 0.62rem;
    min-height: 48px;
  }

  .stream-modal__main {
    padding-left: 0;
    padding-top: 0.65rem;
  }

  .stream-modal__workspace {
    grid-template-columns: 1fr;
  }

  .stream-modal__teams {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .stream-modal__logo {
    margin: 0 auto;
  }

  #partnerHomeLogo {
    grid-column: 1;
    grid-row: 1;
  }

  #partnerHomeName {
    grid-column: 1;
    grid-row: 2;
  }

  #partnerAwayName {
    grid-column: 2;
    grid-row: 2;
  }

  #partnerAwayLogo {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  .stream-modal__dialog {
    width: 100%;
    max-height: none;
    border-radius: 18px;
  }

  .stream-modal__preview {
    min-height: 220px;
  }

  .stream-modal__teams {
    grid-template-columns: 1fr;
  }

  #partnerHomeLogo,
  #partnerAwayLogo,
  #partnerHomeName,
  #partnerAwayName {
    grid-column: 1;
    grid-row: auto;
  }
}

.stream-modal__end-confirm {
  z-index: 320;
  margin: auto;
  padding: 0;
  border: none;
  max-width: min(92vw, 22rem);
  background: transparent;
  color: #fff;
}

.stream-modal__end-confirm::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
}

.stream-modal__end-confirm-card {
  padding: 1.35rem 1.25rem 1.15rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, #242424 0%, #121212 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.stream-modal__end-confirm-title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stream-modal__end-confirm-copy {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}

.stream-modal__end-confirm-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: center;
  flex-wrap: wrap;
}

.stream-modal__end-confirm-btn {
  min-width: 7rem;
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.stream-modal__end-confirm-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
}

.stream-modal__end-confirm-btn--danger {
  background: var(--color-red, #e10600);
  border-color: transparent;
  color: #fff;
}

.stream-modal__react {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}

.stream-modal__react[hidden] {
  display: none !important;
}

.stream-modal__react-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}

.stream-modal__react-item img,
.stream-modal__react-eye {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.stream-modal__react-item--views {
  color: #d7e8ff;
}

.stream-modal__share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.stream-modal__share:hover {
  border-color: rgba(255, 90, 90, 0.75);
  background: rgba(255, 255, 255, 0.12);
}

.stream-modal__share.is-copied {
  border-color: #3dd68c;
  color: #3dd68c;
}

.stream-modal__admin-ended {
  margin: 0 0 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 120, 120, 0.85);
  background: linear-gradient(180deg, #c41212 0%, #6d0000 100%);
  box-shadow: 0 12px 28px rgba(160, 0, 0, 0.4);
  text-align: center;
}

.stream-modal__admin-ended[hidden],
.stream-modal__admin-ended-cover[hidden] {
  display: none !important;
}

.stream-modal__admin-ended-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stream-modal__admin-ended-copy {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.stream-modal__admin-ended-cover {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(90, 0, 0, 0.72);
  text-align: center;
}

.stream-modal__admin-ended-cover p {
  margin: 0;
  max-width: 16rem;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
}

.stream-modal__admin-ended-dialog {
  max-width: min(94vw, 28rem);
  z-index: 400;
}

.stream-modal__admin-ended-card {
  border: 2px solid #ff4d4d;
  box-shadow: 0 0 0 6px rgba(180, 0, 0, 0.28), 0 24px 60px rgba(0, 0, 0, 0.55);
}

.stream-modal__admin-ended-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #ffb4b4;
}

.stream-modal__admin-ended-dialog .stream-modal__end-confirm-title {
  font-size: 1.35rem;
  color: #fff;
}
