/*
 * 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: six cards on the deeper background */

.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;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

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

.card h3,
.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 */

.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);
}

/* 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): 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-draft,
.legal-notice {
  padding: 16px 20px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.6;
}

.legal-draft {
  background: var(--surface);
  border: 1.5px solid var(--gold);
  color: var(--text);
}

.legal-notice {
  background: var(--surface);
  color: var(--muted);
}

.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 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);
}

.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%;
  }
}

/* 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;
  }

  .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;
  }

  .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;
  }
}
