/*
 * The public site. Values are copied from the inline styles of docs/design/screens/Landing.dc.html; colours and fonts
 * come from tokens.css. No inline style anywhere: the public Content-Security-Policy allows only stylesheets of this
 * origin. Nothing may be wider than a 320px phone: no fixed width above 320px, min-width: 0 on grid and flex children.
 * Boxes size as in the design (content-box: max-width 1200px is the content, the 24px gutters come on top); only the
 * scoreboard, the call to action and the links are border-box.
 */

body.site {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
}

/* links count their padding in their 44px minimum height */
.site a {
  box-sizing: border-box;
  color: var(--text);
}

.site a:hover {
  color: var(--gold);
}

.site a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.site h1,
.site h2,
.site h3 {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.site p {
  margin: 0;
}

/* Header: logo, section links, language switch */

.site-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gold);
  /* the flame (fill="currentColor") */
  color: var(--bg);
  display: grid;
  place-items: center;
}

.header-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 28px;
  min-width: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 0;
  text-decoration: none;
}

.site-nav .nav-download {
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--gold);
  color: var(--on-gold);
}

.site-nav .nav-download:hover {
  background: var(--gold-hover);
  color: var(--on-gold);
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 10px;
  border-radius: 14px;
  color: var(--muted);
  text-decoration: none;
}

.lang-switch a[aria-current="true"] {
  background: var(--surface);
  color: var(--text);
}

/* Hero: kicker, headline, lead, store buttons and the scoreboard illustration */

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 88px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 384px);
  align-items: center;
  gap: 56px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.kicker {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--gold);
}

.hero h1 {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.08;
}

.lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 540px;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site .store {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 18px 28px;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.site .store-gold {
  background: var(--gold);
  color: var(--on-gold);
}

.site .store-gold:hover {
  background: var(--gold-hover);
  color: var(--on-gold);
}

.site .store-outline {
  background: var(--surface);
  border: 1.5px solid var(--border);
}

.site .store-dark {
  background: var(--bg);
  color: var(--text);
}

.site .store-dark:hover {
  color: var(--gold);
}

/* a store whose link is not configured yet: looks and behaves disabled */
.site .store.is-placeholder {
  cursor: default;
  pointer-events: none;
  background: var(--raised);
  border-color: var(--border);
  color: var(--muted);
  box-shadow: none;
}

.board {
  /* 384px outside as drawn: 340px of content, 20px padding and a 2px border on each side */
  box-sizing: border-box;
  width: 100%;
  max-width: 384px;
  justify-self: center;
  min-width: 0;
  background: var(--bg-deep);
  border: 2px solid var(--border);
  border-radius: 44px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.board-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.board-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.board-team {
  background: var(--surface);
  border-radius: 20px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.board-team-name {
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.board-total {
  font-size: 96px;
  line-height: 0.9;
}

.board-team-a .board-team-name,
.board-team-a .board-total {
  color: var(--gold);
}

.board-team-b .board-team-name,
.board-team-b .board-total {
  color: var(--blue);
}

.board-rounds {
  background: var(--surface);
  border-radius: 18px;
  padding: 4px 14px;
  display: flex;
  flex-direction: column;
}

.board-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  font-size: 14px;
}

.board-row + .board-row {
  border-top: 1px solid var(--border);
}

.board-bid {
  font-weight: 600;
  min-width: 0;
}

.board-row-a .board-bid {
  color: var(--gold);
}

.board-row-b .board-bid {
  color: var(--blue);
}

.board-score {
  font-size: 24px;
  white-space: nowrap;
}

.board-action {
  height: 54px;
  border-radius: 16px;
  background: var(--gold);
  color: var(--on-gold);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
}

/* Features: three groups of cards on the deeper background, each under a small gold title with a rule */

.features {
  background: var(--bg-deep);
}

.features-inner,
.how {
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.features h2,
.how h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.15;
}

.features h2 {
  max-width: 720px;
}

.feature-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--gold);
}

.group-title::after {
  content: "";
  flex: 1 1 24px;
  min-width: 24px;
  height: 1px;
  background: var(--border);
}

/* three cards to a row; a group of two shares the row in halves */
.cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}

.card {
  grid-column: span 2;
}

.card:first-child:nth-last-child(2),
.card:first-child:nth-last-child(2) ~ .card {
  grid-column: span 3;
}

.card {
  background: var(--surface);
  border-radius: 24px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.site h4 {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.card h4,
.step h3 {
  font-size: 21px;
}

.card p,
.step p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

/* How it works: three numbered steps, then one line for those who came to play */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.step-number {
  font-size: 120px;
  line-height: 0.9;
  color: var(--gold);
}

.how-note {
  max-width: 720px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

/* Call to action: the gold panel with the store buttons again */

.cta-section {
  padding: 0 24px 88px;
}

.cta {
  box-sizing: border-box;
  max-width: 1152px;
  margin: 0 auto;
  background: var(--gold);
  color: var(--on-gold);
  border-radius: 36px;
  padding: 56px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.cta-text {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.cta h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

.cta p {
  font-size: 17px;
  line-height: 1.5;
}

.cta a:focus-visible {
  outline-color: var(--bg);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site .footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 0;
  color: var(--muted);
  text-decoration: none;
}

.site .footer-links a:hover {
  color: var(--text);
}

/*
 * Legal pages (site/legal.html) and the support page (site/support.html): one column of running text, at most 760px wide so that a line stays readable;
 * long Armenian words wrap. Numbers in the text keep the text font (no stand-alone figures here).
 */

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 88px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow-wrap: anywhere;
}

.legal-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.15;
}

.legal-updated {
  font-size: 14px;
  color: var(--muted);
}

.legal-text {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.legal-text section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-text h2 {
  font-size: 22px;
  line-height: 1.3;
}

.legal-text p,
.legal-text li {
  font-size: 17px;
  line-height: 1.7;
}

.legal-text ul {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-text a {
  color: var(--gold);
}

.legal-text a:hover {
  color: var(--gold-hover);
}

/*
 * The public game page (site/game.html): the landing page's scoreboard (.board and its parts) as the page's one
 * column, the hierarchy of the app's score screen (docs/design/screens/Score.dc.html): the totals first, then the
 * rounds, newest on top. Side A is left and gold, side B right and blue. Names are user text and wrap anywhere.
 */

.game {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.site .game-board {
  max-width: none;
  border-radius: 36px;
  padding: 24px 20px;
}

.game-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.game-title {
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.2;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.game-status {
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
}

.game-status.is-live {
  color: var(--gold);
}

.game-result {
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.game-board .board-team {
  border-radius: 24px;
  padding: 16px 16px 14px;
  gap: 6px;
}

.game-board .board-team-name {
  font-size: 15px;
}

.game-board .board-total {
  font-size: 120px;
}

.game-players {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.game-left,
.game-started,
.game-empty,
.live-state {
  font-size: 13px;
  color: var(--muted);
}

.game-rounds {
  margin: 0;
  list-style: none;
}

.game-rounds .board-row {
  min-height: 48px;
}

.game-rounds .board-bid {
  overflow-wrap: anywhere;
}

.game-rounds .board-score {
  font-size: 28px;
}

.live-state:empty {
  display: none;
}

/*
 * The public tournament page (site/tournament.html): the game page's column, wider, with the groups as tables (two
 * side by side on a wide screen, stacked on a phone), each with its matches beneath, then the bracket as rounds in
 * columns that scroll sideways inside their own box (the page itself never scrolls sideways), the final last and the
 * champion after it. Names are user text and wrap anywhere; the advancing places carry a gold mark.
 */

.tournament {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.tournament-board {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.tournament-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
}

.tournament-title {
  margin: 0;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.2;
  overflow-wrap: anywhere;
  min-width: 0;
}

.tournament-status {
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.tournament-status.is-live {
  color: var(--gold);
}

.groups {
  display: grid;
  /* two side by side where both get 420px, else one under the other */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
}

.group,
.bracket {
  background: var(--bg-deep);
  border: 2px solid var(--border);
  border-radius: 28px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.group h2,
.bracket h2 {
  margin: 0;
  font-size: 20px;
}

.group h3,
.round h3 {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
  min-width: 0;
}

.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.group-table th {
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.group-table td {
  padding: 8px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.group-table .team-col,
.group-table .team {
  text-align: start;
}

.group-table .team {
  width: 100%;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.group-table .points {
  font-weight: 700;
}

.group-table tr.advances td:first-child {
  color: var(--gold);
  box-shadow: inset 3px 0 0 var(--gold);
}

.rule {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.matches {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 14px;
}

.match + .match {
  border-top: 1px solid var(--border);
}

.match-team {
  overflow-wrap: anywhere;
  min-width: 0;
}

.match-b {
  text-align: end;
}

.match-team.is-winner {
  font-weight: 700;
  color: var(--gold);
}

.match-games {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--muted);
  white-space: nowrap;
}

.match-game {
  display: grid;
  grid-template-columns: 3.5ch auto 3.5ch;
  gap: 4px;
  color: var(--text);
}

.game-a {
  text-align: end;
}

.game-b {
  text-align: start;
}

/* a result taken from a game scored in the app: the link to that game's page, under its score */
.game-app {
  font-family: var(--font-text);
  font-size: 12px;
  color: var(--blue);
}

/* the player names of a team that agreed to take part, under its name */
.team-players {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.rounds {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 16px;
  overflow-x: auto;
  min-width: 0;
}

.round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 8px;
  min-width: 0;
}

.round .match {
  background: var(--surface);
  border-radius: 14px;
  padding: 8px 12px;
}

.round .match + .match {
  border-top: 0;
}

.champion {
  margin: 0;
  padding: 20px;
  border-radius: 24px;
  background: var(--gold);
  color: var(--on-gold);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
}

.champion-label {
  font-size: 14px;
  font-weight: 600;
}

.champion-name {
  font-size: 24px;
  font-weight: 700;
  overflow-wrap: anywhere;
  min-width: 0;
}

/*
 * The team invite page (site/invite.html): one column with the hero's typography, one gold primary action (the app's
 * link, the hero's store button in size), the store buttons outlined below it and the team code as a quiet note.
 */

.invite {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 24px 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.invite h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
  /* no lone last word on a phone */
  text-wrap: balance;
}

.site .invite-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 18px 28px;
  border-radius: 18px;
  background: var(--gold);
  color: var(--on-gold);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.site .invite-open:hover {
  background: var(--gold-hover);
  color: var(--on-gold);
}

/* the online table invitation page (site/table-invite.html): the table's code in large letters under its label */
.table-code {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.table-code-label {
  font-size: 15px;
  color: var(--muted);
}

.table-code-value {
  font-size: clamp(44px, 9vw, 72px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.invite-code {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

/* Error pages (layout/site.html without the header and footer) */

.error-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.error-page h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.15;
}

.error-page p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

.error-page a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

/* Tablet: the hero becomes one column, the call to action stacks */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .cta-text {
    flex-basis: 100%;
  }

  /* two cards to a row; the odd last one takes the whole row */
  .card,
  .card:first-child:nth-last-child(2),
  .card:first-child:nth-last-child(2) ~ .card {
    grid-column: span 3;
  }

  .card:last-child:nth-child(odd) {
    grid-column: span 6;
  }
}

/* Phone: the header nav wraps below the logo, 16px side gutters, a smaller headline */

@media (max-width: 560px) {
  .site-header {
    padding: 16px;
  }

  .header-end {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .site-nav {
    flex-basis: 100%;
    gap: 4px 20px;
  }

  .hero {
    padding: 32px 16px 64px;
    gap: 40px;
  }

  .hero h1 {
    font-size: clamp(34px, 9vw, 64px);
  }

  /* the scoreboard's rows keep one line at 320px */
  .board {
    padding: 24px 14px;
  }

  .board-rounds {
    padding: 4px 12px;
  }

  .features-inner,
  .how {
    padding: 64px 16px;
  }

  .card,
  .card:first-child:nth-last-child(2),
  .card:first-child:nth-last-child(2) ~ .card {
    grid-column: span 6;
  }

  .cta-section {
    padding: 0 16px 64px;
  }

  .cta {
    padding: 40px 24px;
  }

  .footer-inner {
    padding: 28px 16px;
  }

  .error-page {
    padding: 64px 16px;
  }

  /* the invite page: 16px gutters, the primary action as wide as the column */
  .invite {
    padding: 32px 16px 64px;
    align-items: stretch;
  }

  .invite .stores .store {
    flex: 1 1 auto;
    justify-content: center;
  }

  .legal {
    padding: 32px 16px 64px;
  }

  /* the game page: 16px gutters; the totals shrink so that two fit side by side at 320px */
  .game {
    padding: 16px 16px 48px;
  }

  .site .game-board {
    padding: 20px 14px;
    border-radius: 28px;
  }

  .game-board .board-total {
    font-size: clamp(64px, 22vw, 120px);
  }

  .game-rounds .board-score {
    font-size: 24px;
  }

  /* the tournament page: 16px gutters; the boxes give their room to the tables */
  .tournament {
    padding: 16px 16px 48px;
  }

  .group,
  .bracket {
    padding: 14px;
    border-radius: 22px;
  }

  .group-table td,
  .group-table th {
    padding: 6px 4px;
  }

  .legal-text p,
  .legal-text li {
    font-size: 16px;
  }
}

/* Nothing on the site moves; this keeps it so for anything a browser would animate by itself. */

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