/* Diamonds Spin — mirrors app/src/ui/theme.ts (art direction "gems": deep indigo panels, near-black violet outlines,
   gold call-to-action, saturated jewel accents, Fredoka). */
:root {
  color-scheme: dark;
  --bg: #1a0b4a;
  --bg-deep: #12063a;
  --ink: #12063a;
  --panel: #261468;
  --panel-light: #3a228c;
  --rays: #3a1fa0;
  --text: #ffffff;
  --dim: #cfc4ff;
  --accent: #18d6ee;
  --hot: #ff2f7d;
  --gold: #ffb800; --gold-lip: #c97a00;
  --purple: #7a4dff; --purple-lip: #4a22c8;
  --ruby: #ff2f55; --topaz: #ffc400; --emerald: #19d46a; --sapphire: #2a7dff; --diamond: #18d6ee; --amethyst: #a04bff; --quartz: #ff4fc3;
  --border: 3px;
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 'Fredoka', system-ui, sans-serif; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.1; }
a:focus-visible, button:focus-visible, .gallery:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
::selection { background: var(--gold); color: var(--ink); }
.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.game-skip { position: fixed; top: -80px; left: 16px; z-index: 30; padding: 10px 16px; background: var(--gold); color: var(--ink); border: var(--border) solid var(--ink); border-radius: 12px; font-weight: 600; text-decoration: none; }
.game-skip:focus { top: 12px; }

/* White lettering with a thick ink outline and drop, as on the store captions. */
.outlined { color: var(--text); -webkit-text-stroke: .13em var(--ink); paint-order: stroke fill; text-shadow: 0 .08em 0 var(--ink); letter-spacing: -.005em; }

/* ---------- Sky: header + hero ---------- */
.sky { position: relative; isolation: isolate; overflow: hidden; background: radial-gradient(ellipse 70% 60% at 72% 45%, #5a36d8 0%, #3a1fa0 38%, transparent 72%), linear-gradient(180deg, #2a1470 0%, var(--bg) 100%); }
/* Light rays behind the board, like the store screenshots. */
.sky::before { content: ''; position: absolute; z-index: -1; inset: -30% -10% -30% 30%; background: repeating-conic-gradient(from 0deg at 50% 50%, #ffffff0d 0deg 9deg, transparent 9deg 22deg); mask-image: radial-gradient(circle at 50% 50%, #000 0 30%, transparent 62%); -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0 30%, transparent 62%); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 20px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 22px; text-decoration: none; color: var(--text); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.brand img { width: 46px; height: 46px; border: var(--border) solid var(--ink); border-radius: 13px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; }
.site-nav a { padding: 6px 12px; border-radius: 99px; text-decoration: none; }
.site-nav a:hover { background: #ffffff1a; }
.site-nav .nav-world { color: var(--dim); }
.site-nav .nav-cta { margin-left: 6px; }
.languages { display: flex; flex-wrap: wrap; gap: 8px; }
.languages a { min-width: 46px; padding: 3px 10px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--panel-light); box-shadow: 0 3px 0 var(--ink); text-align: center; font-size: 13px; font-weight: 600; text-decoration: none; }
.languages a[aria-current="page"] { background: var(--gold); color: var(--ink); box-shadow: 0 3px 0 var(--gold-lip); }
.languages a:hover { transform: translateY(-1px); }

.hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; padding-block: 30px 90px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border: 2.5px solid var(--ink); border-radius: 99px; background: var(--panel-light); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.eyebrow::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--ink); }
h1 { margin: 18px 0 18px; }
.logo { width: min(100%, 520px); margin-left: -4%; filter: drop-shadow(0 8px 0 #12063a88); }
.h1-sub { display: block; margin-top: 4px; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.15; }
.intro { max-width: 480px; color: var(--dim); font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding: 0; list-style: none; }
.chips li { padding: 3px 12px; border: 2px solid #ffffff22; border-radius: 99px; background: #ffffff12; font-size: 13px; font-weight: 500; }

/* Chunky buttons: a face over a darker lip that collapses when pressed (Button in components.tsx). */
.btn { --face: var(--purple); --lip: var(--purple-lip); --text: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; border: var(--border) solid var(--ink); border-radius: 16px; background: var(--face); box-shadow: inset 0 3px 0 #ffffff40, 0 5px 0 var(--lip), 0 5px 0 var(--border) var(--ink); color: var(--text); font: 600 17px/1.2 'Fredoka', sans-serif; text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 3px 0 #ffffff40, 0 1px 0 var(--lip), 0 1px 0 var(--border) var(--ink); }
.btn-gold { --face: var(--gold); --lip: var(--gold-lip); --text: var(--ink); }

/* Hero board: a 4 × 4 corner of the board whose framed 2 × 2 square turns a quarter turn at a time. */
.hero-visual { position: relative; display: grid; place-items: center; min-height: 480px; }
.board { --cell: clamp(62px, 9vw, 96px); position: relative; display: grid; grid-template-columns: repeat(4, var(--cell)); grid-template-rows: repeat(4, var(--cell)); gap: 6px; padding: 12px; border: var(--border) solid var(--ink); border-radius: 26px; background: #1d0e55e6; box-shadow: inset 0 0 0 2px #ffffff14, 0 10px 0 var(--ink), 0 30px 60px #0008; }
.cell { display: grid; place-items: center; border-radius: 14px; background: #ffffff0d; box-shadow: inset 0 0 0 1.5px #ffffff10; }
.cell img, .turn img { width: 84%; height: auto; }
.turn { grid-area: 2 / 2 / 4 / 4; position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.turn .cell { background: #ffffff16; }
.turn::after { content: ''; position: absolute; inset: -6px; border: 4px solid var(--gold); border-radius: 18px; box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 2px var(--ink), 0 0 24px #ffb80088; pointer-events: none; }
.turn-arrow { position: absolute; z-index: 2; width: 0; height: 0; border: 9px solid transparent; }
.turn-arrow.a { top: -14px; right: 18%; border-left: 14px solid var(--gold); border-right: 0; }
.turn-arrow.b { bottom: -14px; left: 18%; border-right: 14px solid var(--gold); border-left: 0; }
.float-tag { position: absolute; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: var(--border) solid var(--ink); border-radius: 99px; background: var(--panel-light); box-shadow: 0 4px 0 var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; }
.float-tag img { width: 34px; height: 34px; }
.float-tag b { color: var(--gold); }
.tag-a { top: 4%; left: 0; }
.tag-b { bottom: 6%; right: 0; }
.sparkle { position: absolute; z-index: 1; color: #fff; font-size: 22px; line-height: 1; opacity: .85; }
.sparkle:nth-of-type(1) { top: 12%; right: 8%; }
.sparkle:nth-of-type(2) { top: 50%; left: 2%; font-size: 16px; }
.sparkle:nth-of-type(3) { bottom: 2%; left: 30%; font-size: 14px; color: var(--gold); }

/* Crystal edge used as a divider. */
.gem-edge { height: 14px; background: linear-gradient(90deg, var(--ruby), var(--topaz), var(--emerald), var(--diamond), var(--sapphire), var(--amethyst), var(--quartz)); border-block: var(--border) solid var(--ink); }

/* ---------- Sections ---------- */
main section { padding-block: 70px; }
.section-head { display: grid; justify-items: center; gap: 18px; margin-bottom: 40px; text-align: center; }
.section-head h2 { font-size: clamp(36px, 4.8vw, 56px); }
.section-head p { max-width: 580px; color: var(--dim); font-size: 18px; }
.ribbon { display: inline-block; padding: 6px 22px; border: var(--border) solid var(--ink); border-radius: 99px; background: var(--hot); box-shadow: inset 0 3px 0 #ffffff40, 0 4px 0 #a3104a; font-size: 16px; font-weight: 700; letter-spacing: .02em; }
.ribbon.gold { background: var(--gold); color: var(--ink); box-shadow: inset 0 3px 0 #ffe6a3, 0 4px 0 var(--gold-lip); }
.ribbon.cyan { background: var(--accent); color: var(--ink); box-shadow: inset 0 3px 0 #b6f6ff, 0 4px 0 #0c8ea0; }

.panel { border: var(--border) solid var(--ink); border-radius: var(--radius); background: var(--panel); box-shadow: inset 0 0 0 2px #ffffff12, 0 6px 0 var(--ink); }
.panel p { color: var(--dim); }
.panel h3 { font-size: 24px; margin-bottom: 8px; }

/* How to play */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li { padding: 30px 26px 28px; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border: var(--border) solid var(--ink); border-radius: 12px; background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--gold-lip); font-size: 22px; font-weight: 700; }
.score-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 22px; margin-top: 26px; padding: 18px 24px; text-align: center; }
.score-note b { color: var(--gold); }

/* Gems */
.gems { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; padding: 0; margin: 0; list-style: none; }
.gems li { display: grid; justify-items: center; gap: 4px; padding: 16px 8px 14px; border: var(--border) solid var(--ink); border-radius: 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 28%, var(--panel)), var(--panel)); box-shadow: 0 5px 0 var(--ink); text-align: center; }
.gems img { width: 76px; height: 76px; }
.gems .name { font-weight: 600; font-size: 17px; }
.gems .unlock { color: var(--dim); font-size: 13px; line-height: 1.3; }

/* Powers & obstacles */
.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 0; margin: 0; list-style: none; }
.cards-4 li { display: grid; justify-items: start; align-content: start; gap: 10px; padding: 24px; }
.cards-4 img { width: 72px; height: 72px; }
.cards-4 h3 { margin: 0; font-size: 21px; }
.cards-4 p { font-size: 15px; }
.cards-4 .tag { display: inline-block; padding: 2px 10px; border-radius: 99px; background: #ffffff14; border: 2px solid #ffffff22; color: var(--gold); font-size: 13px; font-weight: 600; }
.subhead { margin: 44px 0 20px; text-align: center; font-size: 28px; }

/* Adventures */
.adventures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 0; margin: 0; list-style: none; counter-reset: adv; }
.adventures li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; padding: 18px 20px; counter-increment: adv; }
.adventures img { width: 92px; height: 92px; }
.adventures .no { color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.adventures .no::after { content: ' ' counter(adv); }
.adventures h3 { margin: 2px 0 4px; font-size: 21px; }
.adventures p { font-size: 15px; line-height: 1.35; }
.boss-note { margin-top: 24px; padding: 20px 26px; text-align: center; }

/* Modes */
.modes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; padding: 0; margin: 0; list-style: none; }
.modes li { padding: 24px 20px; border-top: 8px solid var(--ink); }
.modes li:nth-child(1) { background: linear-gradient(180deg, #4a1450, var(--panel) 70%); }
.modes li:nth-child(2) { background: linear-gradient(180deg, #5a1a3a, var(--panel) 70%); }
.modes li:nth-child(3) { background: linear-gradient(180deg, #11504a, var(--panel) 70%); }
.modes li:nth-child(4) { background: linear-gradient(180deg, #5a4410, var(--panel) 70%); }
.modes li:nth-child(5) { background: linear-gradient(180deg, #123a6e, var(--panel) 70%); }
.modes h3 { font-size: 22px; }
.modes p { font-size: 15px; }
.modes .unlock { display: block; margin-top: 12px; color: var(--accent); font-size: 13px; font-weight: 600; }
.modes-note { margin-top: 18px; color: var(--dim); text-align: center; }

/* Gallery */
.gallery { display: flex; gap: 20px; overflow-x: auto; padding: 6px 4px 22px; scroll-snap-type: x mandatory; scrollbar-color: var(--gold) transparent; }
.gallery figure { flex: 0 0 auto; width: min(240px, 66vw); margin: 0; scroll-snap-align: center; }
.gallery img { width: 100%; border: var(--border) solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--ink); }
.gallery-hint { margin-top: 4px; color: var(--dim); text-align: center; font-size: 14px; }

/* Promise */
.promise { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 0; margin: 0; list-style: none; }
.promise li { padding: 24px; }
.promise .icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px; border: var(--border) solid var(--ink); border-radius: 50%; background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--gold-lip); font-size: 24px; }
.promise h3 { font-size: 20px; }
.promise p { font-size: 15px; }

/* Download */
.download { position: relative; isolation: isolate; overflow: hidden; display: grid; justify-items: center; gap: 18px; padding: clamp(40px, 6vw, 70px) 24px; text-align: center; background: radial-gradient(circle at 50% 30%, #5a36d8, #2a1470 70%); border: var(--border) solid var(--ink); border-radius: 28px; box-shadow: 0 8px 0 var(--ink); }
.download::before { content: ''; position: absolute; z-index: -1; inset: -40%; background: repeating-conic-gradient(from 0deg at 50% 35%, #ffffff10 0deg 8deg, transparent 8deg 20deg); }
.download > img { width: 112px; height: 112px; border: var(--border) solid var(--ink); border-radius: 28px; box-shadow: 0 6px 0 var(--ink); }
.download h2 { font-size: clamp(38px, 5vw, 60px); }
.download p { max-width: 480px; color: var(--dim); }
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 6px; }
.store-link { text-align: left; line-height: 1.25; }
.store-link small { display: block; font-size: 13px; font-weight: 500; }
.store-link strong { font-size: 18px; }
.store-soon { display: grid; gap: 0; padding: 10px 22px; border: var(--border) dashed var(--dim); border-radius: 16px; background: #ffffff10; text-align: left; line-height: 1.25; }
.store-soon small { color: var(--dim); font-size: 13px; }
.store-soon strong { font-size: 18px; }
.download .contact { font-size: 15px; }
.download .contact a { color: var(--text); font-weight: 600; }

/* Footer */
.site-footer { background: var(--bg-deep); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding-block: 26px; font-size: 15px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--dim); }
.footer-links a { text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 0 24px; color: var(--dim); font-size: 13px; }
.motion-toggle { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.motion-toggle[hidden] { display: none; }

/* ---------- Motion (paused by motion.js / reduced-motion) ---------- */
[data-reveal] { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .motion-ready [data-reveal]:not(.is-visible) { opacity: 0; transform: translateY(24px); }
  .motion-ready [data-reveal] { transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
  /* Four clockwise quarter turns per loop; the gems turn back so they stay upright, as in the game. */
  .turn { animation: quarter-turn 8s cubic-bezier(.5,0,.2,1.25) infinite; }
  .turn img { animation: quarter-turn-back 8s cubic-bezier(.5,0,.2,1.25) infinite; }
  .tag-a { animation: tag-float 6s ease-in-out infinite; }
  .tag-b { animation: tag-float 6s 1.2s ease-in-out infinite; }
  .sparkle { animation: twinkle 3.2s ease-in-out infinite; }
  .sparkle:nth-of-type(2) { animation-delay: -1.1s; }
  .sparkle:nth-of-type(3) { animation-delay: -2.2s; }
}
@keyframes quarter-turn { 0%, 17% { transform: rotate(0); } 25%, 42% { transform: rotate(90deg); } 50%, 67% { transform: rotate(180deg); } 75%, 92% { transform: rotate(270deg); } 100% { transform: rotate(360deg); } }
@keyframes quarter-turn-back { 0%, 17% { transform: rotate(0); } 25%, 42% { transform: rotate(-90deg); } 50%, 67% { transform: rotate(-180deg); } 75%, 92% { transform: rotate(-270deg); } 100% { transform: rotate(-360deg); } }
@keyframes tag-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes twinkle { 0%,100% { transform: scale(.7); opacity: .4; } 50% { transform: scale(1.1); opacity: 1; } }
.motion-paused *, .motion-paused *::before, .motion-paused *::after { animation-play-state: paused !important; }
.motion-paused [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .gems { grid-template-columns: repeat(4, 1fr); }
  .cards-4, .promise { grid-template-columns: 1fr 1fr; }
  .adventures { grid-template-columns: 1fr 1fr; }
  .modes { grid-template-columns: repeat(6, 1fr); }
  .modes li { grid-column: span 2; }
  .modes li:nth-child(4) { grid-column: 2 / span 2; }
  .hero { gap: 20px; }
}
@media (max-width: 820px) {
  .site-nav .nav-section { display: none; }
  .hero { grid-template-columns: 1fr; padding-block: 16px 60px; text-align: center; }
  .hero > div:first-child { display: grid; justify-items: center; }
  .logo { margin-inline: auto; }
  .actions, .chips { justify-content: center; }
  .hero-visual { min-height: 0; padding-block: 30px 10px; }
  .steps { grid-template-columns: 1fr; }
  .modes { grid-template-columns: 1fr 1fr; }
  .modes li, .modes li:nth-child(4) { grid-column: auto; }
  .modes li:last-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .site-header { flex-wrap: wrap; gap: 12px; padding-block: 14px; }
  .brand { font-size: 19px; }
  .brand img { width: 40px; height: 40px; }
  .site-nav { gap: 2px; font-size: 14px; }
  .site-nav a { padding: 6px 8px; }
  .board { --cell: calc((100vw - 32px - 24px - 18px - 6px) / 4); gap: 6px; padding: 12px; border-radius: 22px; }
  .float-tag { font-size: 12px; }
  .float-tag img { width: 26px; height: 26px; }
  .tag-a { top: 0; }
  .tag-b { bottom: -4px; }
  main section { padding-block: 50px; }
  .gems { grid-template-columns: repeat(2, 1fr); }
  .gems li:last-child { grid-column: 1 / -1; }
  .cards-4, .promise, .adventures, .modes { grid-template-columns: 1fr; }
  .modes li:last-child { grid-column: auto; }
  .cards-4 li { grid-template-columns: auto 1fr; align-items: center; column-gap: 16px; }
  .cards-4 li > img { grid-row: span 3; width: 60px; height: 60px; }
  .cards-4 li > :not(img) { grid-column: 2; }
  .adventures img { width: 72px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Privacy policy (privacy/, en/privacy/) ---------- */
.legal { padding-block: 36px 80px; }
.legal-card { max-width: 780px; margin-inline: auto; padding: clamp(24px, 5vw, 48px); }
.legal-card h1 { font-size: clamp(30px, 4.4vw, 46px); margin: 14px 0 8px; }
.legal-card .updated { color: var(--dim); font-size: 15px; }
.legal-card .lead { margin-top: 22px; padding: 14px 18px; border: 2.5px solid var(--ink); border-left: 8px solid var(--gold); border-radius: 14px; background: var(--panel-light); color: var(--text); }
.legal-card h2 { margin: 34px 0 10px; font-size: 22px; color: var(--gold); }
.legal-card p { color: var(--dim); }
.legal-card p + p { margin-top: 10px; }
.legal-card ul { margin: 8px 0 0; padding-left: 22px; color: var(--dim); }
.legal-card li + li { margin-top: 4px; }
.legal-card a { color: var(--accent); font-weight: 500; overflow-wrap: anywhere; }
.legal-card strong { color: var(--text); font-weight: 600; }
.legal-sky { padding-bottom: 8px; }
