/* LiveKick stream page: two teams face to face + the OBS player. */

.lk {
  --lk-bg: #06101d;
  --lk-card: #0e1b2e;
  --lk-line: rgba(255, 255, 255, .09);
  --lk-text: #f4f7fb;
  --lk-dim: #8b9bb3;
  --lk-green: #1ed760;
  --lk-blue: #2f8bff;
  --lk-red: #ff3b4e;
  direction: rtl;
  font-family: "Cairo", system-ui, sans-serif;
  color: var(--lk-text);
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  box-sizing: border-box;
}
.lk *, .lk *::before, .lk *::after { box-sizing: border-box; }
.lk [hidden] { display: none !important; }

/* ---------------- Full page ---------------- */

body.lk-full {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(47, 139, 255, .22), transparent 70%),
    repeating-linear-gradient(90deg, rgba(30, 215, 96, .035) 0 80px, transparent 80px 160px),
    #06101d;
  color: #f4f7fb;
}
.lk-page { padding: clamp(14px, 3vw, 32px) 16px 40px; }

/* ---------------- Teams ---------------- */

.lk-match {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(10px, 3vw, 40px);
  padding: clamp(16px, 3vw, 28px) clamp(12px, 3vw, 36px);
  margin-bottom: clamp(14px, 2.4vw, 22px);
  border: 1px solid var(--lk-line);
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(47, 139, 255, .16), transparent 38%, transparent 62%, rgba(255, 59, 78, .14)),
    var(--lk-card);
  box-shadow: 0 18px 46px rgba(0, 5, 14, .35);
}
/* Halfway line + centre circle of a pitch behind the scoreboard. */
.lk-match::before, .lk-match::after {
  content: "";
  position: absolute;
  left: 50%;
  pointer-events: none;
}
.lk-match::before { top: 0; bottom: 0; width: 1px; background: var(--lk-line); }
.lk-match::after {
  top: 50%;
  width: clamp(110px, 16vw, 170px);
  aspect-ratio: 1;
  border: 1px solid var(--lk-line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.lk-team {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-align: center;
  animation: lk-in .6s cubic-bezier(.2, .8, .2, 1) both;
}
.lk-away { animation-delay: .08s; }
.lk-crest {
  display: grid;
  place-items: center;
  width: clamp(72px, 13vw, 128px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 70%);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .025), 0 12px 30px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.lk-home .lk-crest { box-shadow: 0 0 0 6px rgba(47, 139, 255, .08), 0 12px 30px rgba(0, 0, 0, .35); }
.lk-away .lk-crest { box-shadow: 0 0 0 6px rgba(255, 59, 78, .08), 0 12px 30px rgba(0, 0, 0, .35); }
.lk-crest img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35));
}
.lk-ini { font-size: clamp(30px, 5vw, 52px); font-weight: 900; color: var(--lk-dim); }
.lk-name {
  font-size: clamp(15px, 2.6vw, 26px);
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.lk-mid {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lk-vs {
  display: grid;
  place-items: center;
  width: clamp(48px, 7vw, 64px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--lk-bg);
  border: 1px solid rgba(255, 255, 255, .16);
  font-weight: 900;
  font-size: clamp(14px, 2vw, 18px);
  letter-spacing: .04em;
  direction: ltr;
}
.lk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--lk-red);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.lk-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: lk-pulse 1.2s ease-in-out infinite;
}
.lk-badge.off { background: rgba(255, 255, 255, .1); color: var(--lk-dim); }
.lk-badge.off i { background: var(--lk-dim); animation: none; }

/* ---------------- Player ---------------- */

.lk-player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--lk-line);
  box-shadow: 0 22px 60px rgba(0, 5, 14, .45);
}
.lk-player > video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}
.lk-player.is-off > video { visibility: hidden; }
.lk-player.is-embed > video { display: none; }
.lk-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }

/* Waiting screen = a pitch seen from above, ball bouncing on the centre spot, text at the bottom. */
.lk-off {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 0 8% 7%;
  text-align: center;
  background:
    linear-gradient(to top, rgba(4, 20, 12, .85), transparent 45%),
    repeating-linear-gradient(90deg, #0d3a22 0 9%, #0f4127 9% 18%),
    #0d3a22;
}
.lk-player.is-off .lk-off { display: flex; }
.lk-off::before {
  /* pitch border */
  content: "";
  position: absolute;
  inset: 5%;
  border: 2px solid rgba(255, 255, 255, .2);
  border-radius: 4px;
  pointer-events: none;
}
.lk-off > b { position: relative; font-size: clamp(15px, 3vw, 28px); font-weight: 900; line-height: 1.5; }
.lk-off > span { position: relative; max-width: 460px; color: rgba(255, 255, 255, .78); font-size: clamp(11px, 1.8vw, 15px); line-height: 1.6; }

.lk-pitch { position: absolute; inset: 0; pointer-events: none; }
.lk-pitch .lk-line { position: absolute; left: 50%; top: 5%; bottom: 5%; width: 2px; background: rgba(255, 255, 255, .2); transform: translateX(-50%); }
.lk-pitch .lk-circle {
  position: absolute;
  left: 50%;
  top: 42%;
  height: 38%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.lk-ball {
  position: absolute;
  left: 50%;
  top: 30%;
  width: clamp(30px, 8%, 72px);
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #1b1f27 0 17%, transparent 18%),
    radial-gradient(circle at 50% 6%, #1b1f27 0 12%, transparent 13%),
    radial-gradient(circle at 92% 38%, #1b1f27 0 12%, transparent 13%),
    radial-gradient(circle at 76% 90%, #1b1f27 0 12%, transparent 13%),
    radial-gradient(circle at 24% 90%, #1b1f27 0 12%, transparent 13%),
    radial-gradient(circle at 8% 38%, #1b1f27 0 12%, transparent 13%),
    radial-gradient(circle at 35% 30%, #fff, #dfe4ea 70%);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .35);
  animation: lk-bounce 1.1s cubic-bezier(.45, 0, .55, 1) infinite;
}

.lk-unmute {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 2;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(6, 16, 29, .82);
  color: #fff;
  font: 800 14px "Cairo", system-ui, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.lk-unmute:hover { background: var(--lk-blue); }

/* Waiting screen with the owner's image / video (instead of the pitch). */
.lk-off.has-media { background: #000 center / cover no-repeat; }
.lk-off.has-media .lk-pitch { display: none; }
.lk-off.has-media::before { inset: 0; border: 0; border-radius: 0; z-index: 1; background: none; }
.lk-off.has-media.has-text::before { background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent 55%); }
.lk-off > b, .lk-off > span { z-index: 2; }
.lk-off .lk-idle-video { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------------- Ads ---------------- */

.lk-ad {
  position: relative;
  display: flex;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto clamp(14px, 2.4vw, 22px);
  text-align: center;
  overflow: hidden;
}
.lk-ad-bottom { margin: clamp(14px, 2.4vw, 22px) auto 0; }
.lk-ad img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.lk-ad a { display: block; max-width: 100%; }
.lk-ad.is-code { display: block; width: 100%; min-height: 50px; }
.lk-ad-tag {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  z-index: 1;
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(6, 16, 29, .72);
  color: rgba(255, 255, 255, .8);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}
.lk-ad.is-code .lk-ad-tag { position: static; display: block; margin-bottom: 4px; background: none; color: var(--lk-dim); }

/* ---------------- Motion ---------------- */

@keyframes lk-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lk-pulse { 50% { opacity: .25; } }
@keyframes lk-bounce {
  0%, 100% { transform: translateY(-58%) rotate(0deg); }
  50% { transform: translateY(22%) rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) {
  .lk-team, .lk-ball, .lk-badge i { animation: none; }
}

@media (max-width: 560px) {
  .lk-match { border-radius: 16px; gap: 8px; }
  .lk-team { gap: 8px; }
  .lk-player { border-radius: 14px; }
}
