/* LiShi Mahjong: jade night, ivory tiles, gold frames, cherry blossom.
   Colours follow the game's UITheme (IVORY FFF8EC, GOLD F4C568, ROSE F4A3C7, GREEN 20A878,
   DANGER C2453F) and the jade of its store art. */

:root {
  color-scheme: dark;
  --jade-950: #05170f;
  --jade-900: #0a2a20;
  --jade-850: #0d3328;
  --jade-800: #113d30;
  --jade-700: #17503f;
  --jade-600: #1e6a52;
  --jade-500: #20a878;
  --jade-300: #8fdcb9;
  --ivory: #fff8ec;
  --cream: #fff0d4;
  --parchment: #f5e6c6;
  --gold: #f4c568;
  --gold-deep: #d6a043;
  --gold-line: rgba(244, 197, 104, 0.38);
  --gold-faint: rgba(244, 197, 104, 0.14);
  --rose: #f4a3c7;
  --blossom: #ffd3e3;
  --seal: #c2453f;
  --seal-deep: #962d29;
  --ink: #18302a;
  --ink-soft: #4c5f57;
  --text: #f6f0e2;
  --muted: #b8cbc1;
  --radius-lg: 30px;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow-deep: 0 34px 70px -24px rgba(0, 0, 0, 0.7);
  --font-body: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-display: "Noto Serif Display", "Noto Serif", Georgia, "Times New Roman", serif;
  --gutter: 24px;
}

:root:lang(he) {
  /* Hebrew headings use the game's own clean sans (Rubik), no serif. */
  --font-display: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--jade-900);
  background-image:
    radial-gradient(900px 520px at 8% 0%, rgba(244, 163, 199, 0.12), transparent 60%),
    radial-gradient(800px 480px at 96% 18%, rgba(244, 197, 104, 0.08), transparent 60%),
    repeating-linear-gradient(45deg, rgba(244, 197, 104, 0.028) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(-45deg, rgba(244, 197, 104, 0.028) 0 1px, transparent 1px 34px);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--gold);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blossom);
}

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

.container {
  width: min(100%, 1160px);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--jade-900);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--jade-900) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--gold-line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ivory);
  text-decoration: none;
  margin-inline-end: auto;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(0, 0, 0, 0.4);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-name span {
  color: var(--gold);
}

.brand:hover {
  color: var(--ivory);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.lang-link {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  height: 38px;
  padding-inline: 14px;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-link:hover {
  background: var(--gold);
  color: var(--jade-900);
}

@media (max-width: 860px) {
  .site-nav a:not(.nav-support) {
    display: none;
  }
}

@media (max-width: 420px) {
  :root {
    --gutter: 16px;
  }
  .brand-name {
    font-size: 17px;
  }
  .site-nav a {
    padding-inline: 8px;
  }
}

/* ---------- Shared pieces ---------- */

.seal {
  display: inline-grid;
  place-items: center;
  writing-mode: vertical-rl;
  font-family: "Noto Serif Display", "Noto Serif", serif;
  font-weight: 700;
  color: #fff3ea;
  background: linear-gradient(160deg, var(--seal), var(--seal-deep));
  border: 2px solid #f0c9a0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--seal-deep), 0 8px 18px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.05em;
  line-height: 1.05;
}

.seal-sm {
  width: 30px;
  height: 40px;
  font-size: 13px;
  border-radius: 6px;
  border-width: 1.5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(1px);
}

.btn-jade {
  color: var(--ivory);
  background: linear-gradient(180deg, #27866a, var(--jade-600));
  border-color: var(--gold);
  box-shadow: 0 4px 0 #0f3f30, 0 10px 18px -6px rgba(0, 0, 0, 0.5);
}

.btn-gold {
  color: #3a2508;
  background: linear-gradient(180deg, #ffd889, var(--gold) 55%, var(--gold-deep));
  border-color: #fff0c8;
  box-shadow: 0 4px 0 #a8762a, 0 10px 18px -6px rgba(0, 0, 0, 0.5);
}

.btn-gold:hover {
  color: #3a2508;
}

.btn-ghost {
  color: var(--ink);
  background: transparent;
  border-color: rgba(24, 48, 42, 0.28);
}

.btn-ghost:hover {
  background: rgba(24, 48, 42, 0.07);
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  direction: ltr;
}

.store-badge {
  display: block;
  line-height: 0;
  border-radius: 10px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.store-badge:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.store-badge img {
  height: 54px;
  width: auto;
}

.store-soon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  height: 54px;
  min-width: 162px;
  padding: 4px 18px;
  border-radius: 10px;
  border: 1.5px dashed rgba(246, 240, 226, 0.45);
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
  line-height: 1.15;
  text-align: start;
}

.store-soon-note {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.store-soon-name {
  font-size: 20px;
  font-weight: 600;
}

@media (max-width: 420px) {
  .store-row {
    gap: 10px;
  }
  .store-badge img {
    height: 48px;
  }
  .store-soon {
    height: 48px;
    min-width: 0;
    padding-inline: 14px;
  }
  .store-soon-name {
    font-size: 17px;
  }
}

/* Section head */

.section {
  position: relative;
  padding-block: clamp(64px, 9vw, 112px);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto clamp(36px, 5vw, 56px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

:lang(he) .kicker {
  letter-spacing: 0.04em;
  font-size: 15px;
  text-transform: none;
}

.kicker::before,
.kicker::after {
  content: "";
  width: 34px;
  height: 7px;
  background:
    linear-gradient(var(--gold), var(--gold)) center / 100% 1px no-repeat;
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 2.5px, transparent 3px) center / 7px 7px no-repeat,
    linear-gradient(#000, #000) center / 100% 1px no-repeat;
  mask: radial-gradient(circle at 50% 50%, #000 2.5px, transparent 3px) center / 7px 7px no-repeat,
    linear-gradient(#000, #000) center / 100% 1px no-repeat;
}

.kicker::before,
.kicker::after {
  background: var(--gold);
}

.section h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4.6vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ivory);
  text-wrap: balance;
}

.section-sub {
  margin: 0 auto;
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(16px, 1.9vw, 18.5px);
  text-wrap: pretty;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-block: clamp(36px, 6vw, 80px) clamp(56px, 8vw, 104px);
  border-bottom: 1px solid var(--gold-line);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, var(--jade-900) 0%, rgba(10, 42, 32, 0.94) 34%, rgba(10, 42, 32, 0.55) 62%, rgba(10, 42, 32, 0.78) 100%),
    linear-gradient(180deg, rgba(10, 42, 32, 0.2) 0%, rgba(10, 42, 32, 0) 50%, var(--jade-900) 100%),
    url("/assets/hero-garden.webp") right 10% / cover no-repeat;
}

[dir="rtl"] .hero-backdrop {
  background:
    linear-gradient(270deg, var(--jade-900) 0%, rgba(10, 42, 32, 0.94) 34%, rgba(10, 42, 32, 0.55) 62%, rgba(10, 42, 32, 0.78) 100%),
    linear-gradient(180deg, rgba(10, 42, 32, 0.2) 0%, rgba(10, 42, 32, 0) 50%, var(--jade-900) 100%),
    url("/assets/hero-garden.webp") left 10% / cover no-repeat;
}

.hero-grid {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

@media (min-width: 980px) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.hero-copy {
  position: relative;
}

.hero-logo {
  position: relative;
  width: min(370px, 82%);
  height: auto;
  margin-inline-start: -10px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 22px rgba(255, 248, 236, 0.32)) drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}

.hero-copy::before {
  /* Lantern light behind the logo so its jade lettering reads on the night garden. */
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline-start: -8%;
  top: -14%;
  width: min(560px, 110%);
  aspect-ratio: 1.7;
  background: radial-gradient(closest-side, rgba(255, 240, 212, 0.42), rgba(255, 240, 212, 0.12) 55%, transparent);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 7px 16px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgba(10, 42, 32, 0.72);
  color: var(--ivory);
  font-size: 14px;
  font-weight: 600;
}

[dir="rtl"] .hero-badge {
  padding: 7px 12px 7px 16px;
}

.badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 4px rgba(244, 163, 199, 0.22);
}

.hero h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ivory);
  text-wrap: balance;
}

.hero h1 span {
  display: block;
  font-style: italic;
  font-weight: 600;
  background: linear-gradient(100deg, var(--gold) 10%, #ffe2a6 45%, var(--rose) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

:lang(he) .hero h1 span {
  font-style: normal;
  font-weight: 700;
}

:lang(he) .hero h1,
:lang(he) .section h2 {
  letter-spacing: -0.01em;
}

.hero-lead {
  margin: 0 0 30px;
  max-width: 52ch;
  color: #d4e1da;
  font-size: clamp(17px, 2vw, 20px);
  text-wrap: pretty;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-facts li::before {
  content: "";
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: var(--gold);
  border-radius: 1px;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.phone {
  position: relative;
  width: min(300px, 70vw);
  padding: 9px;
  border-radius: 44px;
  background: linear-gradient(150deg, #fbe2a8, var(--gold) 30%, #9b6a24 60%, #f4cf86 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15),
    0 40px 80px -20px rgba(0, 0, 0, 0.75),
    0 0 120px rgba(244, 197, 104, 0.18);
  transform: rotate(-2.5deg);
}

[dir="rtl"] .phone {
  transform: rotate(2.5deg);
}

.phone img {
  width: 100%;
  height: auto;
  border-radius: 36px;
  border: 3px solid #0b231b;
  background: var(--jade-800);
}

.float-tile {
  position: absolute;
  width: clamp(54px, 7vw, 76px);
  height: auto;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.45));
  animation: float 7s ease-in-out infinite;
  z-index: 2;
}

.ft-1 { top: 6%; inset-inline-start: 4%; rotate: -12deg; }
.ft-2 { top: 34%; inset-inline-end: 0%; rotate: 9deg; animation-delay: -2s; }
.ft-3 { bottom: 10%; inset-inline-start: 0%; rotate: 7deg; animation-delay: -4s; }
.ft-4 { bottom: 2%; inset-inline-end: 12%; rotate: -8deg; animation-delay: -5.5s; width: clamp(46px, 5.6vw, 62px); }

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

/* The seal writes vertically, so logical insets would map to top/bottom: use physical sides. */
.seal-hero {
  position: absolute;
  top: 7%;
  right: -28px;
  width: 54px;
  height: 74px;
  font-size: 24px;
  rotate: 8deg;
  z-index: 3;
}

[dir="rtl"] .seal-hero {
  right: auto;
  left: -28px;
  rotate: -8deg;
}

.hero-lantern {
  position: absolute;
  top: -8px;
  inset-inline-end: 3%;
  width: clamp(70px, 8vw, 110px);
  height: auto;
  opacity: 0.92;
  transform-origin: 30% 0;
  animation: sway 6s ease-in-out infinite;
  z-index: 1;
  filter: drop-shadow(0 0 24px rgba(255, 196, 120, 0.45));
}

@keyframes sway {
  0%, 100% { rotate: -2deg; }
  50% { rotate: 2deg; }
}

@media (max-width: 979px) {
  .hero-copy {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .hero-logo {
    margin-inline: auto;
  }
  .hero-copy::before {
    inset-inline-start: 50%;
    translate: -50% 0;
  }
  [dir="rtl"] .hero-copy::before {
    translate: 50% 0;
  }
  .hero-lead {
    margin-inline: auto;
  }
  .hero-stores,
  .hero-facts {
    justify-content: center;
  }
  .hero-lantern {
    display: none;
  }
  .hero-backdrop,
  [dir="rtl"] .hero-backdrop {
    background:
      linear-gradient(180deg, rgba(10, 42, 32, 0.78) 0%, rgba(10, 42, 32, 0.9) 45%, rgba(10, 42, 32, 0.6) 75%, var(--jade-900) 100%),
      url("/assets/hero-garden.webp") center 30% / cover no-repeat;
  }
}

/* Petals: plain pink ovals, like the game's own petal effect. */
.petals {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.petals i {
  position: absolute;
  top: -24px;
  width: 13px;
  height: 9px;
  border-radius: 60% 40% 60% 40% / 70% 50% 50% 30%;
  background: linear-gradient(135deg, #ffe3ee, var(--rose));
  opacity: 0.85;
  animation: fall linear infinite;
}

.petals i:nth-child(1) { left: 6%; animation-duration: 14s; animation-delay: -2s; }
.petals i:nth-child(2) { left: 14%; animation-duration: 18s; animation-delay: -9s; scale: 0.8; }
.petals i:nth-child(3) { left: 23%; animation-duration: 16s; animation-delay: -5s; }
.petals i:nth-child(4) { left: 31%; animation-duration: 20s; animation-delay: -13s; scale: 1.2; }
.petals i:nth-child(5) { left: 40%; animation-duration: 15s; animation-delay: -7s; scale: 0.7; }
.petals i:nth-child(6) { left: 48%; animation-duration: 19s; animation-delay: -1s; }
.petals i:nth-child(7) { left: 57%; animation-duration: 17s; animation-delay: -11s; scale: 0.9; }
.petals i:nth-child(8) { left: 64%; animation-duration: 21s; animation-delay: -4s; scale: 1.1; }
.petals i:nth-child(9) { left: 72%; animation-duration: 16s; animation-delay: -15s; }
.petals i:nth-child(10) { left: 79%; animation-duration: 18s; animation-delay: -8s; scale: 0.75; }
.petals i:nth-child(11) { left: 86%; animation-duration: 14s; animation-delay: -12s; }
.petals i:nth-child(12) { left: 93%; animation-duration: 20s; animation-delay: -3s; scale: 1.15; }
.petals i:nth-child(13) { left: 52%; animation-duration: 23s; animation-delay: -17s; scale: 0.6; }
.petals i:nth-child(14) { left: 2%; animation-duration: 22s; animation-delay: -6s; scale: 0.9; }

@keyframes fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  25% { transform: translate3d(28px, 25vh, 0) rotate(120deg); }
  50% { transform: translate3d(-12px, 50vh, 0) rotate(220deg); }
  75% { transform: translate3d(34px, 75vh, 0) rotate(320deg); }
  100% { transform: translate3d(6px, 105vh, 0) rotate(420deg); }
}

/* ---------- How to play (mini board) ---------- */

.section-play {
  background:
    radial-gradient(700px 380px at 50% 0%, rgba(32, 168, 120, 0.12), transparent 70%);
}

.play-grid {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
}

@media (min-width: 940px) {
  .play-grid {
    grid-template-columns: 0.8fr 1.2fr;
  }
}

.steps {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.step-tile {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 50px;
  height: 62px;
  border-radius: 10px;
  font-family: "Noto Serif Display", "Noto Serif", serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--seal);
  background: linear-gradient(180deg, #fffdf7, var(--ivory) 60%, var(--parchment));
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.7),
    0 4px 0 var(--jade-600),
    0 6px 0 #0c3a2c,
    0 12px 18px -6px rgba(0, 0, 0, 0.5);
}

.step h3 {
  margin: 4px 0 4px;
  font-size: 19px;
  font-weight: 600;
  color: var(--ivory);
}

.step p {
  margin: 0;
  color: var(--muted);
}

.board-card {
  --tw: clamp(50px, 14.2vw, 76px);
  --th: calc(var(--tw) * 1.266);
  --sx: calc(var(--tw) * 0.965);
  --sy: calc(var(--th) * 0.86);
  --ox: calc(var(--tw) * -0.075);
  --oy: calc(var(--th) * -0.085);
  --px: calc(var(--tw) * 0.18);
  --py: calc(var(--th) * 0.2);
  position: relative;
  padding: clamp(18px, 3vw, 30px) clamp(12px, 3vw, 30px) clamp(18px, 3vw, 26px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 248, 236, 0.1), transparent 60%),
    linear-gradient(180deg, #1a5a46, #11402f);
  border: 2px solid var(--gold);
  box-shadow:
    inset 0 0 0 5px rgba(10, 42, 32, 0.8),
    inset 0 0 0 6px var(--gold-line),
    var(--shadow-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.board {
  position: relative;
  width: calc(var(--px) * 1.4 + var(--sx) * 4 + var(--tw));
  height: calc(var(--py) * 1.2 + var(--sy) * 2 + var(--th));
  margin-bottom: 14px;
}

.board-win {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.board-win img {
  width: min(78%, 250px);
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45));
  animation: bloom-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes bloom-in {
  from { transform: scale(0.4) translateY(30px); opacity: 0; }
}

.board-noscript {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.tile {
  position: absolute;
  left: calc(var(--px) + var(--x) / 2 * var(--sx) + var(--z) * var(--ox));
  top: calc(var(--py) + var(--y) / 2 * var(--sy) + var(--z) * var(--oy));
  width: var(--tw);
  height: var(--th);
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--face) center / 100% 100% no-repeat;
  cursor: pointer;
  filter: drop-shadow(-2px 4px 3px rgba(0, 0, 0, 0.35));
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.tile.is-blocked {
  cursor: default;
  filter: drop-shadow(-2px 4px 3px rgba(0, 0, 0, 0.35)) brightness(0.66) saturate(0.75);
}

.tile.is-free:hover {
  transform: translateY(-4px);
  filter: drop-shadow(-2px 8px 6px rgba(0, 0, 0, 0.4)) brightness(1.05);
}

.tile.is-gone {
  opacity: 0;
  transform: translateY(26px) scale(0.7);
  pointer-events: none;
}

.tile.is-nudge {
  animation: nudge 0.32s ease;
}

@keyframes nudge {
  25% { translate: -3px 0; }
  75% { translate: 3px 0; }
}

.tray-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tray-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

:lang(he) .tray-label {
  letter-spacing: 0.02em;
  font-size: 14px;
}

.tray {
  display: flex;
  gap: 8px;
  padding: 9px;
  border-radius: 16px;
  background: linear-gradient(180deg, #0b2c22, #07211a);
  border: 2px solid var(--gold);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(244, 197, 104, 0.12);
}

.tray.is-full {
  animation: nudge 0.4s ease 2;
  border-color: var(--seal);
}

.slot {
  position: relative;
  width: calc(var(--tw) * 0.86);
  height: calc(var(--th) * 0.86);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1.5px rgba(244, 197, 104, 0.22);
}

.slot img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  animation: pop 0.22s ease-out;
}

.slot.is-match img {
  animation: matched 0.42s ease forwards;
}

@keyframes pop {
  from { transform: scale(0.6) translateY(-14px); opacity: 0; }
}

@keyframes matched {
  40% { transform: scale(1.12); filter: brightness(1.25) drop-shadow(0 0 10px var(--gold)); }
  100% { transform: scale(0.4); opacity: 0; }
}

.game-status {
  min-height: 3.2em;
  margin: 16px 0 6px;
  max-width: 40ch;
  text-align: center;
  color: var(--ivory);
  font-weight: 500;
}

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

.game-status.is-lose {
  color: var(--blossom);
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.board-card .btn-ghost {
  color: var(--ivory);
  border-color: rgba(246, 240, 226, 0.4);
}

.board-card .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-win-cta][hidden] {
  display: none;
}

/* ---------- Features: cards shaped like ivory tiles on a jade base ---------- */

.tile-grid {
  display: grid;
  gap: 30px 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.tile-card {
  position: relative;
  padding: 28px 26px 26px;
  border-radius: 24px;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf8 0%, var(--ivory) 50%, #f7e9cd 100%);
  border: 1px solid rgba(214, 160, 67, 0.6);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.6),
    inset 0 0 0 6px rgba(214, 160, 67, 0.25),
    0 7px 0 var(--jade-600),
    0 11px 0 #0c3a2c,
    0 26px 34px -14px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile-card:hover {
  transform: translateY(-4px);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.6),
    inset 0 0 0 6px rgba(214, 160, 67, 0.35),
    0 11px 0 var(--jade-600),
    0 15px 0 #0c3a2c,
    0 34px 40px -14px rgba(0, 0, 0, 0.6);
}

.tile-card::after {
  /* A blossom in the corner, like the painted corners of the tile faces. */
  content: "";
  position: absolute;
  top: 14px;
  inset-inline-end: 16px;
  width: 30px;
  height: 30px;
  opacity: 0.55;
  background:
    radial-gradient(circle at 50% 50%, #f2c14e 0 3px, transparent 3.5px),
    radial-gradient(circle at 50% 18%, var(--rose) 0 5.5px, transparent 6px),
    radial-gradient(circle at 81% 41%, var(--rose) 0 5.5px, transparent 6px),
    radial-gradient(circle at 69% 79%, var(--rose) 0 5.5px, transparent 6px),
    radial-gradient(circle at 31% 79%, var(--rose) 0 5.5px, transparent 6px),
    radial-gradient(circle at 19% 41%, var(--rose) 0 5.5px, transparent 6px);
}

.tile-card-icon {
  width: 56px;
  margin-bottom: 18px;
}

.tile-card-icon img {
  width: 56px;
  height: auto;
  filter: drop-shadow(-2px 5px 4px rgba(0, 0, 0, 0.25));
  rotate: -4deg;
}

.tile-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 25px;
  line-height: 1.15;
  color: #124232;
}

.tile-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.tile-tag {
  margin-top: 14px !important;
  font-size: 14px !important;
  font-weight: 600;
  color: var(--seal) !important;
}

.code-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 16px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
  background: #0f3b2e;
  color: var(--ivory);
}

[dir="rtl"] .code-chip {
  padding: 10px 14px 10px 10px;
}

.code-label {
  flex-basis: 100%;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--jade-300);
}

.code-chip code {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-inline-end: auto;
}

.copy-btn {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.copy-btn:hover,
.copy-btn.is-done {
  background: var(--gold);
  color: var(--jade-900);
}

/* ---------- Worlds ---------- */

.section-worlds {
  background: linear-gradient(180deg, transparent, rgba(5, 23, 15, 0.55) 30%, rgba(5, 23, 15, 0.55) 70%, transparent);
}

.worlds {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .worlds {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1100px) {
  .worlds {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
  }
  .world:nth-child(even) {
    translate: 0 28px;
  }
}

.world {
  position: relative;
  overflow: hidden;
  aspect-ratio: 520 / 700;
  border-radius: 22px;
  border: 2px solid var(--gold-line);
  box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.7);
  background: var(--jade-800);
}

.world::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 2;
  border-radius: 16px;
  border: 1px solid rgba(255, 240, 212, 0.35);
  pointer-events: none;
}

.world img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.world:hover img {
  transform: scale(1.06);
}

.world-label {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 44px 14px 16px;
  background: linear-gradient(180deg, transparent, rgba(5, 23, 15, 0.92) 60%);
}

.world-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--jade-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 0 0 3px rgba(244, 197, 104, 0.3);
}

.world-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.15;
  color: var(--ivory);
}

/* ---------- Screens ---------- */

.shots-wrap {
  position: relative;
}

.shots {
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 10px 6px 28px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-line) transparent;
  -webkit-overflow-scrolling: touch;
}

.shot {
  flex: 0 0 auto;
  width: clamp(200px, 24vw, 252px);
  scroll-snap-align: start;
}

.shot figure {
  margin: 0;
}

.shot-frame {
  padding: 6px;
  border-radius: 32px;
  background: linear-gradient(160deg, #f8dc9c, #a87830 50%, #f1cb80);
  box-shadow: 0 22px 40px -18px rgba(0, 0, 0, 0.75);
}

.shot-frame img {
  width: 100%;
  height: auto;
  border-radius: 27px;
  border: 2px solid #0b231b;
}

.shot figcaption {
  margin-top: 14px;
  text-align: center;
  font-weight: 500;
  font-size: 15.5px;
  color: var(--text);
}

.shots-nav {
  position: absolute;
  top: calc(50% - 40px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(10, 42, 32, 0.9);
  color: var(--gold);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
}

.shots-nav[data-dir="-1"] { inset-inline-start: -10px; }
.shots-nav[data-dir="1"] { inset-inline-end: -10px; }

[dir="rtl"] .shots-nav span {
  display: inline-block;
  transform: scaleX(-1);
}

.shots-nav:hover {
  background: var(--gold);
  color: var(--jade-900);
}

.shots-nav[disabled] {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 720px), (hover: none) {
  .shots-nav {
    display: none;
  }
}

/* ---------- Comfort + model ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.chips li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgba(17, 61, 48, 0.75);
  font-weight: 500;
  font-size: 15.5px;
}

[dir="rtl"] .chips li {
  padding: 10px 12px 10px 18px;
}

.chips li::before {
  content: "";
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%230a2a20' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat,
    var(--jade-500);
}

.model-title {
  margin: clamp(56px, 7vw, 80px) 0 26px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 36px);
  color: var(--ivory);
}

.model-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.model-card {
  position: relative;
  padding: 24px 22px 22px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(23, 80, 63, 0.7), rgba(13, 51, 40, 0.7));
  border: 1px solid var(--gold-line);
  overflow: hidden;
}

.model-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.model-card h4 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--gold);
}

.model-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

/* ---------- CTA ---------- */

.section-cta {
  padding-bottom: clamp(24px, 4vw, 48px);
}

.cta-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  max-width: 900px;
  margin-inline: auto;
  padding: clamp(36px, 6vw, 60px) clamp(20px, 5vw, 56px);
  text-align: center;
  border-radius: 32px;
  color: var(--ink);
  background:
    radial-gradient(90% 70% at 50% 0%, #fffdf8, transparent 70%),
    linear-gradient(180deg, var(--ivory), #f6e4c2);
  border: 2px solid var(--gold);
  box-shadow:
    inset 0 0 0 7px rgba(255, 255, 255, 0.55),
    inset 0 0 0 8px rgba(214, 160, 67, 0.35),
    0 9px 0 var(--jade-600),
    0 14px 0 #0c3a2c,
    var(--shadow-deep);
}

.cta-tree {
  position: absolute;
  z-index: -1;
  bottom: -26px;
  inset-inline-start: -30px;
  width: clamp(130px, 22vw, 230px);
  height: auto;
  opacity: 0.9;
}

.cta-lantern {
  position: absolute;
  z-index: -1;
  bottom: 6px;
  inset-inline-end: 14px;
  width: clamp(70px, 11vw, 110px);
  height: auto;
}

.cta-logo {
  width: min(280px, 70%);
  height: auto;
  margin: 0 auto 6px;
}

.cta-card h2 {
  color: #124232;
}

.cta-card .section-sub {
  color: var(--ink-soft);
  margin-bottom: 28px;
}

.cta-stores {
  justify-content: center;
}

.cta-card .store-soon {
  background: #111;
  border: 1.5px solid #a6a6a6;
  color: #fff;
}

@media (max-width: 600px) {
  .cta-tree,
  .cta-lantern {
    opacity: 0.35;
  }
}

/* ---------- Try also ---------- */

.also-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
}

.also-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(244, 197, 104, 0.22);
  background: rgba(13, 51, 40, 0.65);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.also-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: rgba(23, 80, 63, 0.7);
  color: var(--text);
}

.also-card img {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fff;
}

.also-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

[dir="rtl"] .also-name {
  text-align: right;
}

.also-name {
  font-weight: 700;
  font-size: 16.5px;
  color: var(--ivory);
}

.also-copy {
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted);
}

.also-studio {
  margin: 30px 0 0;
  text-align: center;
}

.also-studio a {
  display: inline-flex;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.also-studio a:hover {
  background: var(--gold);
  color: var(--jade-900);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--gold-line);
  background: rgba(5, 23, 15, 0.6);
  padding: 30px 0 40px;
  color: var(--muted);
  font-size: 14.5px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

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

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

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

/* ---------- Legal pages ---------- */

.legal {
  position: relative;
  padding-block: 36px 80px;
}

.legal-deco {
  position: absolute;
  top: 26px;
  inset-inline-end: max(16px, calc((100vw - 900px) / 2 - 90px));
  display: flex;
  gap: 8px;
  opacity: 0.9;
  pointer-events: none;
}

.legal-tile {
  width: 46px;
  height: auto;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.4));
}

.legal-tile:nth-child(1) { rotate: -8deg; }
.legal-tile:nth-child(2) { rotate: 4deg; translate: 0 10px; }
.legal-tile:nth-child(3) { rotate: 10deg; }

@media (max-width: 720px) {
  .legal-deco {
    display: none;
  }
}

.legal-container {
  max-width: 860px;
}

.legal-back {
  margin: 0 0 18px;
  font-weight: 600;
}

.legal-back a {
  text-decoration: none;
}

.legal-card {
  padding: clamp(24px, 5vw, 52px);
  border-radius: 26px;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf8, var(--ivory) 30%, #fbf1de);
  border: 1px solid rgba(214, 160, 67, 0.6);
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.55),
    inset 0 0 0 7px rgba(214, 160, 67, 0.22),
    0 8px 0 var(--jade-600),
    0 12px 0 #0c3a2c,
    var(--shadow-deep);
  line-height: 1.7;
}

.legal-card h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.1;
  color: #124232;
}

.legal-card h2 {
  margin: 1.8em 0 0.5em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 2.6vw, 25px);
  color: #124232;
}

.legal-card p,
.legal-card li {
  color: #2f433c;
}

.legal-card ul {
  padding-inline-start: 1.3em;
}

.legal-card li::marker {
  color: var(--jade-500);
}

.legal-card a {
  color: #1a7a58;
  font-weight: 500;
}

.legal-card a:hover {
  color: var(--seal);
}

.legal-card .meta {
  color: var(--ink-soft);
  font-size: 15px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(214, 160, 67, 0.4);
}

.legal-card h2:target {
  scroll-margin-top: 90px;
  background: linear-gradient(90deg, rgba(244, 197, 104, 0.35), transparent);
  border-radius: 8px;
  padding-inline: 8px;
  margin-inline: -8px;
}

/* ---------- 404 ---------- */

.not-found {
  padding-block: clamp(48px, 8vw, 100px);
}

.not-found-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.not-found-inner img {
  width: min(220px, 60vw);
  height: auto;
  margin-bottom: 10px;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
}

.not-found h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 52px);
  color: var(--ivory);
}

.not-found-he {
  margin: 18px 0 26px;
  color: var(--muted);
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .petals,
  .hero-lantern {
    display: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
