:root {
  color-scheme: light;
  --ink: #202133;
  --muted: #71758c;
  --paper: #f7f6f2;
  --surface: rgba(255, 255, 255, 0.82);
  --line: rgba(48, 49, 68, 0.11);
  --shadow: 0 24px 70px rgba(54, 49, 88, 0.12);
  --accent: #6e5ae6;
  --accent-strong: #4b35ca;
  --lime: #b7e45b;
  --pink: #ff8bb0;
  --cyan: #58d6d0;
  --orange: #ffb44d;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f1ff;
  --muted: #aaa8bd;
  --paper: #171723;
  --surface: rgba(35, 35, 51, 0.86);
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --accent: #a18cff;
  --accent-strong: #c2b5ff;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(183, 228, 91, 0.2), transparent 25rem),
    radial-gradient(circle at 86% 12%, rgba(110, 90, 230, 0.2), transparent 28rem),
    var(--paper);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }

.site-header,
.site-footer,
.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.12rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--lime), var(--cyan));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 8px 18px rgba(62, 180, 159, .18);
  color: #202133;
  transform: rotate(-5deg);
}

.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 9px 11px; color: var(--muted); font-size: .92rem; }

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(40, 35, 70, .06);
}

.icon-button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sound-toggle { position: relative; display: grid; place-items: center; font-size: 1.08rem; font-weight: 900; }
.sound-toggle span { transform: translateY(-1px); }
.sound-toggle::after {
  content: "";
  position: absolute;
  width: 20px;
  border-top: 2px solid currentColor;
  opacity: 0;
  transform: rotate(-45deg);
  transition: opacity .16s ease;
}
.sound-toggle[data-enabled="false"] { color: var(--muted); }
.sound-toggle[data-enabled="false"]::after { opacity: 1; }

.page-shell { padding: 48px 0 76px; }
.hero { max-width: 760px; margin: 24px auto 48px; text-align: center; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; }
.hero h1 { margin: 0; font-size: clamp(2.6rem, 8vw, 5.8rem); letter-spacing: -.075em; line-height: .94; }
.hero p { max-width: 590px; margin: 22px auto 0; color: var(--muted); font-size: clamp(1rem, 2.5vw, 1.18rem); line-height: 1.7; }

.game-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.game-card {
  position: relative;
  min-height: 310px;
  padding: 22px 22px 78px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  grid-column: span 2;
}
.game-card:nth-child(4) { grid-column: 2 / span 2; }
.game-card:nth-child(5) { grid-column: 4 / span 2; }
.game-card:hover { transform: translateY(-4px); box-shadow: 0 30px 75px rgba(54,49,88,.16); }
.game-card h2 { margin: 18px 0 8px; font-size: 1.45rem; letter-spacing: -.035em; }
.game-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.game-card .play-pill { position: absolute; left: 22px; bottom: 22px; padding: 10px 14px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 800; font-size: .9rem; }
.game-card .best { position: absolute; right: 22px; bottom: 30px; color: var(--muted); font-size: .8rem; }

.card-art { height: 116px; display: grid; place-items: center; border-radius: 20px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mini-tiles { display: grid; grid-template-columns: repeat(4, 35px); gap: 8px; transform: rotate(-4deg); }
.mini-tile { width: 35px; aspect-ratio: 1; border-radius: 10px; box-shadow: inset 0 2px 3px rgba(255,255,255,.55), 0 5px 12px rgba(30,30,50,.1); }
.mini-tile:nth-child(4n+1) { background: var(--lime); }
.mini-tile:nth-child(4n+2) { background: var(--pink); border-radius: 50%; }
.mini-tile:nth-child(4n+3) { background: var(--cyan); clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.mini-tile:nth-child(4n) { background: var(--orange); transform: rotate(45deg) scale(.74); }

.outside-art { background: linear-gradient(145deg, rgba(88,214,208,.15), rgba(110,90,230,.12)); }
.link-preview { width: 70%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; color: var(--accent); font-size: 2.25rem; }
.link-preview span { height: 4px; background: currentColor; box-shadow: 0 -25px 0 -1px currentColor; }
.fruit-art { display: flex; gap: 10px; background: linear-gradient(145deg, rgba(183,228,91,.18), rgba(255,180,77,.16)); }
.fruit-art span { width: 48px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50% 46% 52% 48%; background: var(--orange); color: #35250d; font-size: 1.2rem; font-weight: 900; box-shadow: inset 0 4px 5px rgba(255,255,255,.45), 0 8px 15px rgba(80,55,20,.12); }
.fruit-art span:nth-child(2) { background: var(--lime); transform: translateY(-8px) rotate(6deg); }
.fruit-art span:nth-child(3) { background: var(--pink); transform: rotate(-5deg); }
.fruit-art span:nth-child(4) { background: var(--cyan); transform: translateY(6px) rotate(5deg); }
.orbit-art { position: relative; background: linear-gradient(145deg,rgba(161,140,255,.18),rgba(88,214,208,.14)); }
.orbit-art i { position: absolute; border: 5px solid var(--accent); border-radius: 50%; }
.orbit-art i:nth-child(1) { width: 42px; aspect-ratio: 1; }
.orbit-art i:nth-child(2) { width: 76px; aspect-ratio: 1; opacity: .72; }
.orbit-art i:nth-child(3) { width: 108px; aspect-ratio: 1; opacity: .42; }
.orbit-art b { z-index: 1; font-size: 1.2rem; }
.flash-art { display: grid; grid-template-columns:repeat(4,48px); gap:8px; background:linear-gradient(145deg,rgba(255,139,176,.14),rgba(110,90,230,.12)); }
.flash-art span { width:48px; aspect-ratio:1; display:grid; place-items:center; border-radius:14px; background:var(--lime); color:#2e2b38; font-weight:900; box-shadow:inset 0 3px 4px rgba(255,255,255,.45),0 7px 14px rgba(35,30,60,.12); }
.flash-art span:nth-child(2){background:var(--pink);transform:translateY(-7px)}.flash-art span:nth-child(3){background:var(--cyan)}.flash-art span:nth-child(4){background:var(--orange);transform:translateY(7px)}
.daily-strip { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; }
.daily-strip h2 { margin: 4px 0 8px; font-size: clamp(1.7rem, 4vw, 2.7rem); }
.daily-strip p:last-child { margin-bottom: 0; }
.daily-orb { width: 150px; aspect-ratio: 1; position: relative; border-radius: 50%; background: linear-gradient(145deg, var(--accent), var(--pink)); box-shadow: inset 0 0 0 10px rgba(255,255,255,.16), 0 24px 40px rgba(99,73,199,.2); }
.daily-orb span { position: absolute; display: grid; place-items: center; width: 42px; aspect-ratio: 1; border-radius: 13px; background: rgba(255,255,255,.85); color: #272238; font-weight: 900; }
.daily-orb span:nth-child(1) { top: 20px; left: 54px; transform: rotate(8deg); }
.daily-orb span:nth-child(2) { left: 25px; bottom: 28px; }
.daily-orb span:nth-child(3) { right: 22px; bottom: 24px; transform: rotate(-8deg); }
.content-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.content-columns h2 { font-size: 1.15rem; }

.guide-callout { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.guide-callout h2 { margin: 4px 0 8px; font-size: clamp(1.55rem, 3vw, 2.35rem); }
.guide-callout p:last-child { margin-bottom: 0; }
.guide-callout .primary-button { flex: 0 0 auto; display: inline-grid; place-items: center; text-align: center; }

.guide-shell { width: min(980px, calc(100% - 32px)); }
.guide-hero { max-width: 760px; margin: 20px auto 34px; text-align: center; }
.guide-hero h1 { margin: 0; font-size: clamp(2.3rem, 6vw, 4.6rem); letter-spacing: -.065em; line-height: 1; }
.guide-hero > p:not(.eyebrow) { max-width: 650px; margin: 18px auto 0; color: var(--muted); line-height: 1.7; }
.guide-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.guide-nav a { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .86rem; font-weight: 750; }
.guide-nav a:hover { color: var(--ink); border-color: var(--accent); }
.guide-grid { display: grid; gap: 18px; }
.guide-card { scroll-margin-top: 24px; padding: clamp(22px, 5vw, 36px); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: 0 14px 42px rgba(45,40,75,.06); }
.guide-card-heading { display: flex; align-items: center; gap: 16px; }
.guide-card-heading .eyebrow { margin-bottom: 5px; }
.guide-card-heading h2 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -.05em; }
.guide-number { flex: 0 0 auto; width: 48px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 15px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 900; }
.guide-summary { margin: 18px 0 20px; color: var(--muted); font-size: 1.04rem; line-height: 1.7; }
.guide-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; }
.guide-meta div { padding: 16px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.guide-meta dt { margin-bottom: 6px; font-weight: 850; }
.guide-meta dd { margin: 0; color: var(--muted); line-height: 1.62; }
.text-link { color: var(--accent); font-weight: 850; }
.faq-section h2 { margin-top: 0; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { padding: 18px 2px; cursor: pointer; font-weight: 820; }
.faq-list details p { margin: -4px 0 18px; }
.policy-shell { width: min(850px, calc(100% - 32px)); }
.policy-shell .content-card { margin-top: 0; }
.policy-shell .content-card > h1 { margin-bottom: 8px; font-size: clamp(2.2rem, 6vw, 4rem); }
.policy-shell .content-card > h2 { margin-top: 34px; }
.updated-note { font-size: .9rem; }
.policy-next { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }

.language-menu { position: relative; }
.language-menu summary { min-height: 42px; padding: 0 13px; display: flex; align-items: center; gap: 7px; list-style: none; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; color: var(--ink); font-size: .8rem; font-weight: 850; box-shadow: 0 8px 24px rgba(40,35,70,.06); }
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after { content: "▾"; color: var(--muted); font-size: .7rem; }
.language-menu[open] summary::after { transform: rotate(180deg); }
.language-options { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; min-width: 170px; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.language-options a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 11px; border-radius: 10px; color: var(--muted); font-size: .88rem; }
.language-options a:hover, .language-options a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--ink); }
.language-options a[aria-current="page"]::after { content: "✓"; color: var(--accent); font-weight: 900; }

.section-block, .content-card {
  margin-top: 28px;
  padding: clamp(22px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
}
.section-block h2, .content-card h1, .content-card h2 { letter-spacing: -.04em; }
.section-block p, .content-card p, .content-card li { color: var(--muted); line-height: 1.75; }

.game-layout { width: min(1020px, calc(100% - 24px)); margin: 0 auto; padding: 16px 0 64px; }
.game-heading { text-align: center; margin: 18px auto 20px; }
.game-heading h1 { margin: 8px 0 4px; font-size: clamp(2rem, 6vw, 3.5rem); letter-spacing: -.06em; }
.game-heading p { margin: 0; color: var(--muted); }
.game-panel { position: relative; padding: clamp(12px, 3vw, 24px); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.game-toolbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { padding: 11px 14px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--accent) 8%, transparent); text-align: center; }
.stat-label { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.stat-value { display: block; margin-top: 3px; font-weight: 900; font-size: 1.25rem; }
.game-board { position: relative; width: min(100%, 720px); margin-inline: auto; touch-action: none; user-select: none; }

.primary-button, .secondary-button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 850;
  cursor: pointer;
}
.primary-button { border: 0; background: var(--ink); color: var(--paper); box-shadow: 0 12px 24px rgba(35,32,60,.18); }
.secondary-button { border: 1px solid var(--line); background: var(--surface); }
.game-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.game-message { min-height: 24px; margin: 12px 0 0; text-align: center; color: var(--muted); font-weight: 700; }

.modal-backdrop { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 18px; border-radius: inherit; background: rgba(20,20,34,.62); backdrop-filter: blur(7px); }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: min(420px, 100%); padding: 28px; border-radius: 24px; background: var(--paper); text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.24); }
.modal-card h2 { margin: 0 0 8px; font-size: 2rem; letter-spacing: -.05em; }
.modal-card p { color: var(--muted); line-height: 1.6; }

.site-footer { padding: 24px 0 42px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 800px) {
  .game-grid { grid-template-columns: 1fr; }
  .game-card, .game-card:nth-child(4), .game-card:nth-child(5) { grid-column: auto; }
  .game-card { min-height: 334px; }
  .nav-link { display: none; }
  .page-shell { padding-top: 28px; }
  .content-columns { grid-template-columns: 1fr; gap: 8px; }
  .guide-callout { align-items: stretch; flex-direction: column; }
  .guide-callout .primary-button { align-self: flex-start; }
  .guide-meta { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header { width: min(100% - 20px, 1120px); }
  .game-layout { width: min(100% - 12px, 1020px); }
  .game-panel { border-radius: 22px; }
  .game-toolbar { gap: 6px; }
  .stat { padding-inline: 7px; }
  .stat-value { font-size: 1.08rem; }
  .daily-strip { grid-template-columns: 1fr; }
  .daily-orb { width: 120px; }
  .daily-orb span:nth-child(1) { left: 40px; }
  .language-menu summary { padding-inline: 10px; }
  .language-menu summary .language-long { display: none; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
