:root {
  --bg0: #070a13;
  --bg1: #0b1220;
  --card: rgba(255, 255, 255, 0.07);
  --card2: rgba(255, 255, 255, 0.10);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);
  --accent: #22c55e;
  --warn: #f43f5e;
  --amber: #f59e0b;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 10% 0%, #1b2a6b 0%, rgba(27, 42, 107, 0) 60%),
    radial-gradient(1000px 800px at 90% 10%, rgba(34, 197, 94, 0.25) 0%, rgba(34, 197, 94, 0) 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
  color: var(--text);
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__title {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 16px;
}

.brand__subtitle {
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1;
  user-select: none;
}

.pill--ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.10);
}

.pill--bad {
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.10);
}

.pill--muted {
  color: var(--muted);
}

.btn {
  appearance: none;
  border: 1px solid var(--stroke);
  background: var(--card2);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.13);
}

.stage {
  padding: 0 14px 14px;
}

.embed {
  position: relative;
  width: 100%;
  height: min(76vh, 900px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.30);
  box-shadow: var(--shadow);
}

.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  pointer-events: none;
}

.overlay__bar {
  align-self: end;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px;
}

.frame-pill {
  width: 110px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.frame-pill__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.frame-pill__value {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.scoreboard {
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 12px;
}

.player {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
}

.player__name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__score {
  font-size: 46px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.player--a .player__score {
  color: #60a5fa;
}

.player--b .player__score {
  color: #fb7185;
}

.scoreboard__vs {
  display: grid;
  place-items: center;
}

.vs__chip {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.12em;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.overlay__hint {
  display: none;
  justify-self: center;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  backdrop-filter: blur(10px);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 16px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 720px) {
  .embed {
    height: 78vh;
    border-radius: 16px;
  }

  .overlay__bar {
    grid-template-columns: 1fr;
  }

  .frame-pill {
    width: 100%;
    justify-items: start;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .frame-pill__value {
    justify-self: end;
  }

  .player__score {
    font-size: 38px;
  }

  .vs__chip {
    width: 46px;
    height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
