/* ==========================================================================
   GOATINHO — goatinho.app
   Single shared stylesheet. No build step, no framework, no JS.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #0c0e14;
  --panel: #171b22;
  --panel2: #1f2538;
  --text: #f3f5f9;
  --dim: #8a93a6;
  --gold: #ffd23d;
  --danger: #e3574b;
  --radius: 16px;

  --line: #ffffff14;
  --line-soft: #ffffff12;
  --line-table: #ffffff1a;

  --font-display: "Changa", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Neutral fallback accents (overridden per sport) */
  --accent: #ffd23d;
  --accent2: #d9a520;
}

/* Per-sport accents — applied on cards ([data-sport]) and pages (body[data-sport]) */
[data-sport="football"]   { --accent: #2bd47a; --accent2: #2f7d57; }
[data-sport="basketball"] { --accent: #d96b33; --accent2: #6e52c4; }
[data-sport="cricket"]    { --accent: #29bcae; --accent2: #a93658; }
[data-sport="gridiron"]   { --accent: #396bd0; --accent2: #a82f35; }
[data-sport="baseball"]   { --accent: #d64545; --accent2: #8a3a3a; }
[data-sport="volleyball"] { --accent: #e8b559; --accent2: #a8823a; }

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Doodle background: sports-ball line art drifting diagonally, barely there.
   Remove this block (and body::before) to go back to the plain gradient. */
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  top: -320px;
  left: -320px;
  width: calc(100vw + 320px);
  height: calc(100vh + 320px);
  background: url("/assets/img/doodle-tile.svg") repeat;
  background-size: 320px 320px;
  opacity: .05;
  pointer-events: none;
  animation: doodle-drift 80s linear infinite;
}
@keyframes doodle-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(320px, 320px, 0); }
}
/* Quieter behind long-form text (legal pages) */
body:has(.legal)::before { opacity: .03; }

/* Sport pages get their own ball only */
body[data-sport="football"]::before   { background-image: url("/assets/img/doodle-football.svg"); }
body[data-sport="basketball"]::before { background-image: url("/assets/img/doodle-basketball.svg"); }
body[data-sport="cricket"]::before    { background-image: url("/assets/img/doodle-cricket.svg"); }
body[data-sport="gridiron"]::before   { background-image: url("/assets/img/doodle-gridiron.svg"); }
body[data-sport="baseball"]::before   { background-image: url("/assets/img/doodle-baseball.svg"); }
body[data-sport="volleyball"]::before { background-image: url("/assets/img/doodle-volleyball.svg"); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% -10%, #14202e 0%, var(--bg) 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); }
a:hover { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .5em;
}

p { margin: 0 0 1em; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

main,
.main { flex: 1 0 auto; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--gold);
  color: #14161d;
  font-family: var(--font-display);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
}
.skip-link:focus {
  left: 0;
  color: #14161d;
}

/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(12, 14, 20, .8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex: none;
}
.brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.brand:hover span { color: var(--gold); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.site-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--dim);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  transition: color 150ms ease, background-color 150ms ease;
}
.site-nav a:hover {
  color: var(--text);
  background: #ffffff0d;
}

/* --------------------------------------------------------------------------
   4. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  flex: none;
  margin-top: 72px;
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--dim);
  font-size: .875rem;
}
.site-footer p { margin: 0 0 .4em; }
.site-footer p:last-child { margin-bottom: 0; }
.site-footer a {
  color: var(--dim);
  text-decoration: none;
  border-bottom: 1px solid #ffffff1f;
}
.site-footer a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.site-footer .fictional { margin-top: 12px; font-size: .8125rem; opacity: .8; }

/* --------------------------------------------------------------------------
   5. Buttons & chips
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .01em;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.btn--gold {
  background: var(--gold);
  color: #14161d;
  box-shadow: 0 8px 24px #ffd23d26;
}
.btn--gold:hover {
  color: #14161d;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px #ffd23d3d;
}

.btn--accent {
  background: var(--accent);
  color: #10131a;
  box-shadow: 0 8px 24px #00000059;
}
.btn--accent:hover {
  color: #10131a;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn--ghost:hover { background: #ffffff0d; color: var(--text); }

.btn--lg { font-size: 1.0625rem; padding: 14px 26px; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

/* Card button layout: Play takes the full first row, store chips share the second */
.card .btn-row .btn { flex: 1 1 100%; }
.card .btn-row .store { flex: 1 1 calc(50% - 5px); align-items: center; }

/* Store placeholder chips (disabled) */
.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff08;
  color: var(--dim);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1.2;
  cursor: default;
  user-select: none;
}
.store--soon { opacity: .75; }
.store .store__soon {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  opacity: .8;
}

/* COMING SOON pill */
.pill {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8125rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--dim);
  text-decoration: none;
  font-weight: 600;
  font-size: .9375rem;
}
.back-link:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   6. Landing — hero
   -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding-top: 72px;
  padding-bottom: 56px;
}
.hero__icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border-radius: 24px;
  box-shadow: 0 0 0 1px #ffffff14, 0 18px 50px #ffd23d1f;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  letter-spacing: .01em;
  margin-bottom: 14px;
}
.hero__sub {
  max-width: 620px;
  margin: 0 auto;
  color: var(--dim);
  font-size: 1.0625rem;
}
.hero .btn-row { justify-content: center; margin-top: 28px; }

/* --------------------------------------------------------------------------
   7. Landing — games grid
   -------------------------------------------------------------------------- */
.section { padding-top: 24px; padding-bottom: 8px; }
.section__title {
  font-size: 1.5rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.section__lead { color: var(--dim); margin-bottom: 26px; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px 22px 22px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  height: 100%;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.card--live:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Whole card is clickable via the title link, without nesting <a> in <a>. */
.card__link {
  color: var(--text);
  text-decoration: none;
}
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.card--live:hover .card__link { color: var(--accent); }

.card__art {
  position: relative;
  width: 120px;
  margin-bottom: 16px;
}
.card__art img {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  object-fit: cover;
  background: #ffffff08;
}
/* Dim only placeholder art (the badge marks a card with no real logo yet). */
.card--soon .card__art:has(.card__badge) img { opacity: .5; }
.card__badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
}
.dim { color: var(--dim); font-weight: 600; }
.card__title .dim { font-size: .9em; }
.card__tag { color: var(--dim); font-size: .9375rem; margin: 4px 0 0; }

.card .btn-row {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 18px;
}
.card--soon { opacity: .85; }
.card--soon:hover { opacity: 1; border-color: #ffffff24; }
.card--soon .card__link:hover { color: var(--gold); }
.card--soon .pill { margin-top: auto; }
.card--soon .card__tag { margin-bottom: 18px; }
/* Cards without a tagline: the title carries the gap down to the pill. */
.card--soon .card__title:has(+ .pill) { margin-bottom: 18px; }

/* --------------------------------------------------------------------------
   8. Game detail page
   -------------------------------------------------------------------------- */
.page-head { padding-top: 40px; }

.game-hero {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 0 44px;
  border-bottom: 1px solid var(--line);
}
.game-hero__art { position: relative; flex: none; width: 160px; }
.game-hero__art img {
  width: 160px;
  height: 160px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 0 0 1px #ffffff14,
              0 18px 50px color-mix(in srgb, var(--accent) 22%, transparent);
}
.game-hero--soon .game-hero__art img { opacity: .5; }
.game-hero__art .card__badge { width: 48px; height: 48px; font-size: 24px; }

.game-hero__body { flex: 1 1 320px; min-width: 0; }
.game-hero__body h1 {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  margin-bottom: 8px;
}
.game-hero__body h1 .dim { font-size: .72em; }
.game-hero__tag {
  color: var(--dim);
  font-size: 1.0625rem;
  margin: 0;
}
.game-hero__body .pill { margin-top: 18px; }

.game-body { padding-top: 40px; max-width: 760px; }
.game-body h2 {
  font-size: 1.375rem;
  letter-spacing: .02em;
  margin: 36px 0 14px;
}
.game-body > p:first-child { margin-top: 0; }
.lead { font-size: 1.0625rem; }

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.feature-list li {
  position: relative;
  padding-left: 26px;
  color: var(--text);
}
.feature-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}
.feature-list strong { font-weight: 700; }


/* --------------------------------------------------------------------------
   9. /<sport>/play/ placeholder + 404
   -------------------------------------------------------------------------- */
.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 72px;
  padding-bottom: 72px;
}
.panel-card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 40px 28px 34px;
}
.panel-card img.panel-card__art {
  width: 128px;
  height: 128px;
  border-radius: 22px;
  margin: 0 auto 22px;
  object-fit: cover;
  box-shadow: 0 0 0 1px #ffffff14,
              0 16px 44px color-mix(in srgb, var(--accent) 20%, transparent);
}
.panel-card h1 { font-size: 1.6rem; margin-bottom: 10px; }
.panel-card p { color: var(--dim); margin-bottom: 0; }
.panel-card .btn-row { justify-content: center; margin-top: 24px; }
.panel-card .code {
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: var(--gold);
  letter-spacing: .06em;
  margin: 0 0 6px;
}

/* --------------------------------------------------------------------------
   10. Legal pages (/privacy/, /terms/)
   -------------------------------------------------------------------------- */
.legal {
  max-width: 760px;
  line-height: 1.7;
  padding: 44px 0 0;
}
.legal h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  margin-bottom: 6px;
}
.legal .updated {
  color: var(--dim);
  font-size: .875rem;
  margin: 0 0 28px;
}
.legal h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: .01em;
  display: inline-block;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
  margin: 40px 0 14px;
}
.legal h3 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  color: var(--text);
  margin: 26px 0 8px;
}
.legal p { margin: 0 0 16px; }
.legal a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--text); }
.legal ul,
.legal ol { margin: 0 0 18px; padding-left: 22px; }
.legal li { margin-bottom: 10px; }
.legal li::marker { color: var(--gold); }
.legal strong { font-weight: 700; }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }

.summary-box {
  background: var(--panel2);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 32px;
}
.summary-box > :last-child { margin-bottom: 0; }
.summary-box h2 {
  margin-top: 0;
  border-bottom: 0;
  padding-bottom: 0;
  font-size: 1.125rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.summary-box ul { margin-bottom: 0; }

.table-scroll {
  overflow-x: auto;
  margin: 0 0 22px;
  -webkit-overflow-scrolling: touch;
}
.legal table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: .9375rem;
}
.legal table th,
.legal table td {
  border: 1px solid var(--line-table);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.legal table thead th {
  background: var(--panel);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .875rem;
  color: var(--text);
}
.legal table td { color: var(--dim); font-size: .9rem; }

/* --------------------------------------------------------------------------
   11. Footer language picker (markup injected by /js/i18n.js)
   -------------------------------------------------------------------------- */
.lang-row { margin-top: 16px; }

.lang-picker {
  position: relative;
  display: inline-block;
}

.lang-picker__current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff08;
  color: var(--dim);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}
.lang-picker__current::-webkit-details-marker { display: none; }
.lang-picker__current::marker { content: ""; }
.lang-picker__current:hover {
  color: var(--text);
  background: #ffffff0d;
  border-color: #ffffff2b;
}
.lang-picker[open] > .lang-picker__current {
  color: var(--text);
  border-color: #ffffff2b;
}

/* Opens upward — the picker sits in the last footer row. */
.lang-picker__menu {
  position: absolute;
  z-index: 50;
  bottom: 100%;
  left: 0;
  margin-bottom: 8px;
  min-width: 214px;
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 46px #00000073;
}

.lang-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}
.lang-opt:hover { color: var(--text); background: #ffffff0d; }
.lang-opt.is-current { color: var(--gold); }

.lang-flag { flex: none; font-size: 1.05rem; line-height: 1; }
.lang-name { min-width: 0; }

/* Dim notice under the H1 on /privacy/ and /terms/ */
.legal .updated:has(+ .legal-lang-note) { margin-bottom: 4px; }
.legal-lang-note {
  color: var(--dim);
  font-size: .8125rem;
  font-style: italic;
  opacity: .85;
  margin: 0 0 28px;
}

/* --------------------------------------------------------------------------
   12. RTL (ar, fa) — dir="rtl" is set on <html> by /js/i18n.js
   -------------------------------------------------------------------------- */
[dir="rtl"] .feature-list li { padding-left: 0; padding-right: 26px; }
[dir="rtl"] .feature-list li::before { left: auto; right: 0; content: "◂"; }

[dir="rtl"] .legal ul,
[dir="rtl"] .legal ol { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .legal table th,
[dir="rtl"] .legal table td { text-align: right; }
[dir="rtl"] .summary-box { border-left: 0; border-right: 4px solid var(--gold); }

[dir="rtl"] .lang-picker__menu { left: auto; right: 0; }
[dir="rtl"] .lang-opt { text-align: right; }

/* Back links carry their arrow inside the translated string — the ar/fa
   dictionaries use the mirrored glyph ("→"); these rules only make sure the
   line itself reads right-to-left. */
[dir="rtl"] .back-link,
[dir="rtl"] .panel-card .btn--ghost { direction: rtl; }

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .header-row { min-height: 56px; gap: 8px; }
  .brand span { font-size: 1.05rem; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 8px 9px; font-size: .875rem; }

  .hero { padding-top: 48px; padding-bottom: 40px; }
  .hero__icon { width: 84px; height: 84px; }
  .hero .btn-row .btn { width: 100%; }

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

  .game-hero { gap: 22px; padding-bottom: 34px; }
  .game-hero__art,
  .game-hero__art img { width: 128px; }
  .game-hero__art img { height: 128px; }

  .btn-row .btn--lg { width: 100%; }
  .store { flex: 1 1 auto; align-items: center; }

  .panel-card { padding: 32px 20px 28px; }
  .site-footer { margin-top: 56px; }
}

/* --------------------------------------------------------------------------
   14. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover,
  a.card:hover { transform: none; }
}
