:root {
  color-scheme: dark;
  --bg: #08110f;
  --bg-deep: #050a09;
  --panel: rgba(17, 31, 27, 0.82);
  --panel-strong: #12251f;
  --text: #f4f8f4;
  --muted: #a9bbb1;
  --accent: #63d38d;
  --accent-bright: #9af3b7;
  --accent-dark: #1f7144;
  --border: rgba(151, 220, 174, 0.18);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(45, 112, 70, 0.2), transparent 32rem),
    radial-gradient(circle at 85% 90%, rgba(19, 70, 52, 0.28), transparent 36rem),
    linear-gradient(145deg, var(--bg), var(--bg-deep));
  color: var(--text);
  font-family: IRANSansX, Tahoma, "Segoe UI", sans-serif;
  line-height: 1.5;
  direction: rtl;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: clamp(1.25rem, 4vw, 1.5rem);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(100%, 1100px);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  display: block;
  width: clamp(3.6rem, 8vw, 5.5rem);
  height: auto;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
}

.brand-name {
  color: var(--text);
  font-size: clamp(0.82rem, 1.5vw, 0.98rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-caption {
  color: var(--muted);
  font-size: 0.78rem;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.status-dot::before {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0.3rem rgba(99, 211, 141, 0.1);
  content: "";
}

.hero {
  width: min(100%, 1100px);
  margin: auto;
  padding: clamp(3rem, 9vh, 7rem) 0 clamp(2rem, 5vh, 4rem);
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-bright);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0 auto;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.hero-intro {
  max-width: 520px;
  margin: 1.25rem auto 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 1.75rem);
  width: min(100%, 900px);
  margin: 0 auto;
}

.table-card {
  position: relative;
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background: linear-gradient(145deg, rgba(29, 57, 45, 0.9), rgba(13, 27, 23, 0.96));
  box-shadow: var(--shadow);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.table-card::before {
  position: absolute;
  top: -5rem;
  left: -4rem;
  width: 13rem;
  height: 13rem;
  border: 1px solid rgba(154, 243, 183, 0.17);
  border-radius: 50%;
  box-shadow: 0 0 0 2rem rgba(154, 243, 183, 0.035), 0 0 0 4rem rgba(154, 243, 183, 0.02);
  content: "";
}

.table-card:hover,
.table-card:focus-visible {
  border-color: rgba(154, 243, 183, 0.6);
  background: linear-gradient(145deg, rgba(37, 78, 58, 0.96), rgba(14, 34, 27, 0.98));
  transform: translateY(-0.35rem);
}

.table-card:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 4px;
}

.table-number {
  position: relative;
  z-index: 1;
  color: var(--accent-bright);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.table-card strong {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.match-status,
.match-score,
.referee,
.table-action {
  position: relative;
  z-index: 1;
}

.match-status {
  margin-top: 0.75rem;
  color: var(--accent-bright);
  font-size: 0.9rem;
  font-weight: 700;
}

.match-score {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.65rem;
  color: var(--text);
  font-size: 0.95rem;
}

.player-score {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.65rem 0.5rem;
  border: 1px solid rgba(154, 243, 183, 0.16);
  border-radius: 0.55rem;
  background: rgba(4, 16, 12, 0.38);
  text-align: center;
}

.player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-points {
  flex: 0 0 auto;
  min-width: 2rem;
  color: var(--accent-bright);
  font-size: 1.25rem;
  text-align: center;
}

.match-score b {
  color: var(--accent-bright);
  font-size: 1.15rem;
}

.referee {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.table-action {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-card span:last-child {
  position: relative;
  z-index: 1;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-note {
  margin: clamp(2rem, 6vh, 4rem) auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.stream-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: clamp(1rem, 3vw, 2rem);
}

.stream-header,
.stream-content {
  width: min(100%, 1280px);
  margin: 0 auto;
}

.stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1rem, 3vw, 1.75rem);
}

.stream-title {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.5rem);
}

.stream-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.stream-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}

.stream-frame {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: min(62vh, 720px);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: #000;
  box-shadow: var(--shadow);
}

.stream-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 0;
}

.stream-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.button:hover {
  border-color: rgba(154, 243, 183, 0.6);
  background: var(--panel-strong);
  transform: translateY(-2px);
}

.button-primary {
  border-color: transparent;
  background: var(--accent);
  color: #092114;
}

.button-primary:hover {
  border-color: transparent;
  background: var(--accent-bright);
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
  }

  .status-dot {
    display: none;
  }

  .hero {
    padding-top: 4rem;
  }

  .table-grid {
    grid-template-columns: 1fr;
  }

  .table-card {
    min-height: 175px;
  }

  .stream-header {
    align-items: flex-start;
  }

  .stream-frame {
    min-height: 58vh;
  }

  .stream-controls {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .stream-controls .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
