/* Backgammon site: the app's "Lapis and brass" look (app/src/theme/variables.scss, dark mode).
   base.css holds the reset and shared structure; this file is the app-specific layer. */

:root {
  --bg: #0e1726;
  --bg-deep: #0a111d;
  --surface: #172338;
  --surface-2: #1e2c45;
  --text: #eaf0f8;
  --muted: #a9b5c7;
  --line: rgb(143 176 228 / .16);
  --lapis: #1f3a68;
  --lapis-light: #8fb0e4;
  --primary: var(--lapis);
  --accent: #f2a93b;
  --accent-ink: #16202e;
  --cream: #f6f0e2;
  --wine: #5c1e2b;
  --wine-rim: #e2b49a;
  --radius: 20px;
  --font-display: 'Bricolage Grotesque Variable', 'Noto Sans Variable', 'Noto Sans Arabic Variable', 'Noto Sans Hebrew Variable',
    system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans', 'Microsoft YaHei', 'Malgun Gothic', sans-serif;
  --font-body: 'Noto Sans Variable', 'Noto Sans Arabic Variable', 'Noto Sans Hebrew Variable', system-ui, -apple-system, 'Segoe UI',
    'PingFang SC', 'Hiragino Sans', 'Microsoft YaHei', 'Malgun Gothic', sans-serif;
  color-scheme: dark;
}

body {
  background:
    radial-gradient(90% 60% at 20% -10%, rgb(31 58 104 / .75), transparent 70%),
    radial-gradient(60% 40% at 100% 10%, rgb(242 169 59 / .07), transparent 70%),
    var(--bg);
}

/* RTL: base.css uses physical sides in a few places */
[dir='rtl'] .prose th, [dir='rtl'] .prose td { text-align: right; }
[dir='rtl'] .prose ul, [dir='rtl'] .prose ol { padding-left: 0; padding-right: 1.25em; }
[dir='rtl'] .skip-link { left: auto; right: 12px; }

/* ---------- header ---------- */
.site-header { position: relative; z-index: 5; }
.brand { font-family: var(--font-display); font-size: 1.1rem; letter-spacing: -.01em; }
.brand img { border-radius: 9px; box-shadow: 0 2px 10px rgb(0 0 0 / .35); }

.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text); font-size: 14px; background: rgb(23 35 56 / .6);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { width: 16px; height: 16px; opacity: .8; }
.lang-menu summary:hover { border-color: rgb(143 176 228 / .4); }
.lang-menu ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 20;
  margin: 0; padding: 8px; list-style: none; width: min(420px, calc(100vw - 32px));
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 50px rgb(0 0 0 / .5);
}
.lang-menu a { display: block; padding: 7px 10px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 14px; }
.lang-menu a:hover { background: var(--surface-2); color: var(--text); }
.lang-menu a[aria-current='true'] { color: var(--accent-ink); background: var(--accent); font-weight: 600; }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; padding-block: clamp(24px, 5vw, 56px) 0; }
.hero .wrap {
  display: grid; gap: clamp(28px, 5vw, 64px); align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: min(calc(100svh - 160px), 680px);
}
.status-chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 12px; margin-bottom: 22px;
  border-radius: 999px; font-size: 14px; font-weight: 500;
  background: rgb(242 169 59 / .1); border: 1px solid rgb(242 169 59 / .35); color: #f6d39c;
}
.status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgb(242 169 59 / .2); }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); font-weight: 800; letter-spacing: -.035em; line-height: .95; margin-bottom: .3em; }
.hero h1 .games { display: block; margin-top: .22em; font-size: .36em; letter-spacing: -.005em; font-weight: 700; color: var(--accent); line-height: 1.25; }
.hero .tagline { font-family: var(--font-display); font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 600; line-height: 1.3; max-width: 26ch; margin-bottom: .6em; }
.hero .lead { color: var(--muted); max-width: 48ch; margin-bottom: 1.6em; }
.trust { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 15px; }
.trust svg { width: 20px; height: 20px; flex: none; color: var(--accent); }

.hero-visual { position: relative; }
.board-shot {
  position: relative; margin: 0; border-radius: 22px; overflow: hidden;
  border: 1px solid rgb(246 240 226 / .14);
  box-shadow: 0 30px 80px rgb(0 0 0 / .55), 0 0 0 10px rgb(23 35 56 / .55), 0 0 120px rgb(31 58 104 / .8);
  transform: rotate(-1.5deg);
}
.board-shot img { width: 100%; height: auto; aspect-ratio: 960 / 642; object-fit: cover; }
.dice { position: absolute; inset-inline-start: -22px; bottom: -26px; display: flex; gap: 10px; z-index: 2; }
.dice svg { width: 64px; height: 64px; filter: drop-shadow(0 10px 16px rgb(0 0 0 / .45)); }
.dice svg:first-child { transform: rotate(-12deg); }
.dice svg:last-child { transform: rotate(9deg) translateY(10px); }

/* decorative checkers behind the hero */
.checkers { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.checkers span {
  position: absolute; border-radius: 50%; opacity: .1;
  background: radial-gradient(circle at 50% 50%, transparent 52%, rgb(0 0 0 / .25) 53%, transparent 58%), var(--c, var(--cream));
  box-shadow: inset 0 -6px 0 rgb(0 0 0 / .2);
}
.checkers span:nth-child(1) { width: 120px; height: 120px; top: 8%; inset-inline-start: -40px; }
.checkers span:nth-child(2) { width: 70px; height: 70px; top: 62%; inset-inline-start: 4%; --c: var(--wine); opacity: .35; }
.checkers span:nth-child(3) { width: 90px; height: 90px; top: 2%; inset-inline-end: 6%; --c: var(--wine); opacity: .3; }
.checkers span:nth-child(4) { width: 54px; height: 54px; top: 40%; inset-inline-end: -14px; }
.checkers span:nth-child(5) { width: 40px; height: 40px; top: 82%; inset-inline-end: 30%; }

/* the board's edge: a row of points closing each dark section */
.points-edge {
  height: 64px; margin-top: clamp(32px, 6vw, 72px);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='64'%3E%3Cpath d='M0 64 24 0 48 64Z' fill='%23f6f0e2' fill-opacity='.9'/%3E%3Cpath d='M48 64 72 0 96 64Z' fill='%235c1e2b'/%3E%3C/svg%3E") repeat-x left bottom / 96px 64px;
  opacity: .22;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

/* ---------- store buttons (assets/store-buttons.html) ---------- */
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  --btn-bg: #000; --btn-fg: #fff;
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-width: 172px; height: 58px; padding: 0 18px 0 14px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid rgb(255 255 255 / .2); border-radius: 14px;
  text-decoration: none; line-height: 1.1;
  box-shadow: 0 6px 20px rgb(0 0 0 / .3);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn .store-top { display: block; font-size: 11px; opacity: .85; letter-spacing: .01em; }
.store-btn .store-top, .store-btn .store-bottom { white-space: nowrap; }
.store-btn .store-bottom { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
a.store-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgb(0 0 0 / .4); border-color: rgb(255 255 255 / .35); }
.store-btn.is-soon { cursor: default; opacity: .78; box-shadow: none; }
.store-btn.is-soon .soon-tag {
  position: absolute; top: -10px; inset-inline-end: 10px;
  padding: 2px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}

/* ---------- sections ---------- */
.section { padding-block: clamp(56px, 9vw, 104px) 0; }
.section-head { max-width: 60ch; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.025em; }
.section-head p { color: var(--muted); margin: 0; }

.cultures { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.culture {
  margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.culture img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.culture figcaption { padding: 16px 18px 20px; }
.culture h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: .15em; }
.culture .native { color: var(--accent); font-size: 15px; font-weight: 600; margin-bottom: .5em; }
.culture p { color: var(--muted); font-size: 15px; margin: 0; }
.culture:hover { transform: translateY(-3px); border-color: rgb(143 176 228 / .32); box-shadow: 0 16px 40px rgb(0 0 0 / .35); }

.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature {
  padding: 22px; border-radius: var(--radius); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.feature .icon {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; margin-bottom: 14px;
  background: rgb(242 169 59 / .12); color: var(--accent); border: 1px solid rgb(242 169 59 / .25);
}
.feature .icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.12rem; margin-bottom: .35em; }
.feature p { color: var(--muted); font-size: 15.5px; margin: 0; }

.cta {
  position: relative; overflow: hidden; margin-top: clamp(56px, 9vw, 104px);
  padding: clamp(32px, 6vw, 56px); border-radius: 28px; text-align: center;
  background: linear-gradient(160deg, #24457a, var(--lapis) 55%, #172b4f);
  border: 1px solid rgb(143 176 228 / .25);
}
.cta h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; }
.cta p { color: #c9d6ea; }
.cta .store-buttons { justify-content: center; margin-top: 22px; }
.cta::after {
  content: ''; position: absolute; inset: auto 0 0; height: 48px; opacity: .18; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='48'%3E%3Cpath d='M0 48 18 0 36 48Z' fill='%23f6f0e2'/%3E%3Cpath d='M36 48 54 0 72 48Z' fill='%23f2a93b'/%3E%3C/svg%3E") repeat-x left bottom / 72px 48px;
}
.home-main { padding-bottom: clamp(48px, 8vw, 88px); }

/* ---------- legal pages ---------- */
.prose { position: relative; }
.prose h1 { font-weight: 800; letter-spacing: -.02em; }
.prose h2 { font-weight: 700; }
.prose table td:first-child { width: 58%; }
.prose .other-lang { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.4em; }
.button {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 14px; text-decoration: none; font-weight: 600;
  background: var(--accent); color: var(--accent-ink); border: 0; font: inherit; font-weight: 600; cursor: pointer;
}
.button.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.prose a.button { color: var(--accent-ink); }
.prose a.button.secondary { color: var(--text); }

/* invite / game link pages */
.link-card { text-align: center; }
.link-card .code {
  display: inline-block; margin: 8px 0 18px; padding: 12px 22px; border-radius: 16px;
  font: 700 clamp(1.6rem, 6vw, 2.2rem) / 1 var(--font-display); letter-spacing: .12em;
  background: var(--surface); border: 1px dashed rgb(242 169 59 / .55); color: var(--cream);
  direction: ltr; unicode-bidi: isolate;
}
.link-card .store-buttons { justify-content: center; margin-top: 18px; }

.site-footer .notice { width: 100%; font-size: 13px; opacity: .85; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .hero h1 { font-size: clamp(2.9rem, 11vw, 4.6rem); }
  .hero .wrap { grid-template-columns: 1fr; min-height: 0; }
  .hero-visual { order: -1; max-width: 560px; margin-inline: auto; width: 100%; }
  .dice svg { width: 50px; height: 50px; }
  .dice { inset-inline-start: -6px; bottom: -22px; }
}
@media (max-width: 420px) {
  .store-btn { min-width: 0; flex: 1 1 158px; padding-inline: 12px; gap: 8px; }
  .store-btn .store-bottom { font-size: 17px; }
  .lang-menu ul { grid-template-columns: 1fr 1fr; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: .06s; }
  .hero-copy > :nth-child(3) { animation-delay: .12s; }
  .hero-copy > :nth-child(4) { animation-delay: .18s; }
  .hero-copy > :nth-child(5) { animation-delay: .24s; }
  .board-shot { animation: settle 1s cubic-bezier(.2, .7, .2, 1) both .1s; }
  .dice svg:first-child { animation: bob 7s ease-in-out infinite; }
  .dice svg:last-child { animation: bob2 8s ease-in-out infinite 1s; }
  .checkers span { animation: drift 10s ease-in-out infinite; }
  .checkers span:nth-child(2n) { animation-duration: 13s; animation-delay: -4s; }
}
@keyframes rise { from { opacity: .4; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { transform: rotate(-4deg) translateY(18px); } to { transform: rotate(-1.5deg); } }
@keyframes bob { 50% { transform: rotate(-6deg) translateY(-6px); } }
@keyframes bob2 { 50% { transform: rotate(14deg) translateY(4px); } }
@keyframes drift { 50% { transform: translate(6px, -10px) rotate(8deg); } }
