/* Tea Garden Mahjong — website styles */
:root {
  --mint: #5CC08E;
  --mint-dark: #3E9A6D;
  --mint-deep: #2E7D57;
  --mint-soft: #E3F5EB;
  --ink: #3B3355;
  --ink-soft: #6F6787;
  --cream: #FFFDF7;
  --sakura: #F07FA8;
  --sakura-soft: #FDE6EF;
  --honey-soft: #FFF3D6;
  --sky-soft: #E2F0FB;
  --line: #E8E2D3;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(59, 51, 85, .10), 0 2px 6px rgba(59, 51, 85, .06);
  --font: "Fredoka", ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  min-height: 100vh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; }

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

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 7vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

a { color: var(--mint-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px;
  text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: 12px; color: #fff; }

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

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

/* ---------- Header ---------- */
.site-header {
  position: relative; z-index: 5;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 16px; padding-bottom: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1.1rem;
}
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 2px 8px rgba(59,51,85,.15); }
.lang-switch {
  display: flex; gap: 4px; background: rgba(255,255,255,.75); padding: 4px; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(59,51,85,.08);
}
.lang-switch a, .lang-switch span {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem;
  text-decoration: none; color: var(--ink-soft);
}
.lang-switch [aria-current] { background: var(--mint-dark); color: #fff; }
.lang-switch a:hover { color: var(--ink); background: var(--mint-soft); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(180deg, rgba(227,245,235,.35), rgba(255,253,247,.0) 85%), url("bg_garden.jpg") center / cover no-repeat;
  margin-top: -72px; padding-top: 72px;
  border-bottom-left-radius: 40px; border-bottom-right-radius: 40px;
  overflow: hidden;
}
.hero .wrap {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 32px;
  padding-top: 40px; padding-bottom: 72px;
}
.hero-icon { width: 96px; height: 96px; border-radius: 26px; box-shadow: var(--shadow); margin-bottom: 18px; }
.hero h1 { margin-bottom: .25em; }
.hero h1 .accent { color: var(--mint-dark); }
.tagline { font-size: clamp(1.15rem, 2.6vw, 1.4rem); color: var(--ink-soft); max-width: 32ch; margin-bottom: 1.2em; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 26px; }
.pills li {
  background: rgba(255,255,255,.85); border-radius: 999px; padding: 4px 14px; font-size: .95rem; font-weight: 500;
  box-shadow: 0 1px 3px rgba(59,51,85,.08);
}
.pills li::before { content: "✓ "; color: var(--mint-dark); font-weight: 700; }

.btn-play {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--ink); color: #fff; text-decoration: none;
  padding: 12px 22px 12px 18px; border-radius: 18px; box-shadow: var(--shadow);
  transition: transform .15s ease, background .15s ease;
}
.btn-play:hover { color: #fff; background: #2b2542; transform: translateY(-2px); }
.btn-play svg { width: 28px; height: 28px; flex: none; }
.btn-play .small { display: block; font-size: .78rem; opacity: .85; line-height: 1.2; text-transform: uppercase; letter-spacing: .06em; }
.btn-play .big { display: block; font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.cta-note { font-size: .95rem; color: var(--ink-soft); margin-top: 12px; }

/* ---------- Tiles (built from body + face PNGs) ---------- */
.tile {
  --w: 96px;
  position: relative; display: block;
  width: var(--w); aspect-ratio: 236 / 296;
  background: url("tiles/body.png") center / 100% 100% no-repeat;
}
.tile > img {
  position: absolute; left: 7.627%; top: 6.081%; width: 76.27%; height: 81.08%;
  object-fit: contain;
}

.tile-stack {
  position: relative; width: 340px; height: 330px; margin: 0 auto;
}
.tile-stack .tile { position: absolute; --w: 104px; filter: drop-shadow(0 6px 10px rgba(59,51,85,.12)); }
.tile-stack .t1 { left: 20px;  top: 150px; }
.tile-stack .t2 { left: 110px; top: 150px; }
.tile-stack .t3 { left: 200px; top: 150px; }
.tile-stack .t4 { left: 65px;  top: 72px; }
.tile-stack .t5 { left: 155px; top: 72px; }
.tile-stack .t6 { left: 110px; top: -6px; }
.tile-stack .t6 { animation: bob 3.2s ease-in-out infinite; }
.tile-stack .t4 { animation: bob 3.8s ease-in-out .4s infinite; }
.tile-stack .t5 { animation: bob 3.5s ease-in-out .9s infinite; }
.tile-stack .cup {
  position: absolute; right: -24px; top: -8px; width: 112px; z-index: 3;
  animation: sway 5s ease-in-out infinite; transform-origin: 50% 90%;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }

@media (prefers-reduced-motion: reduce) {
  .tile-stack .tile, .tile-stack .cup { animation: none !important; }
}

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; }
.eyebrow {
  display: inline-block; font-weight: 600; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase;
  color: #C24A78; background: var(--sakura-soft); padding: 3px 12px; border-radius: 999px; margin-bottom: 12px;
}

/* Story */
.story-card {
  display: grid; grid-template-columns: 180px 1fr; gap: 32px; align-items: center;
  background: #fff; border-radius: 32px; padding: 36px 40px; box-shadow: var(--shadow);
  max-width: 860px; margin: 0 auto;
}
.story-card img { width: 180px; }
.story-card p { font-size: 1.1rem; }
.story-card p:last-child { margin-bottom: 0; }
.story-card .sign { font-weight: 500; color: var(--mint-dark); }

/* Features */
.features { background: var(--mint-soft); border-radius: 40px; }
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; list-style: none; margin: 0; padding: 0;
}
.feature {
  background: #fff; border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: 0 2px 10px rgba(59,51,85,.06);
}
.feature .ico {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; font-size: 1.6rem;
  margin-bottom: 12px; background: var(--mint-soft);
}
.feature:nth-child(3n+2) .ico { background: var(--sakura-soft); }
.feature:nth-child(3n+3) .ico { background: var(--honey-soft); }
.feature h3 { margin-bottom: .3em; }
.feature p { color: var(--ink-soft); margin: 0; font-size: 1rem; }

.layouts { margin-top: 28px; text-align: center; }
.layouts ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 10px 0 0; }
.layouts li { background: #fff; border-radius: 999px; padding: 4px 14px; font-weight: 500; font-size: .95rem; }
.themes li::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; background: var(--c); border: 2px solid rgba(0,0,0,.06); }

/* Screenshots */
.shots {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 28px 24px; padding: 0; margin: 0; list-style: none;
}
.shot { scroll-snap-align: center; margin: 0; }
.shot .frame {
  position: relative; aspect-ratio: 19.5 / 9; border-radius: 26px; overflow: hidden;
  background: #2E2A40; padding: 9px; box-shadow: var(--shadow);
}
.shot .frame > * { border-radius: 18px; }
.shot img.real { width: 100%; height: 100%; object-fit: cover; }
.shot .placeholder {
  display: none; width: 100%; height: 100%; position: relative;
  background: url("bg_garden.jpg") center / cover;
  align-items: center; justify-content: center; gap: 2%;
}
.shot.missing img.real { display: none; }
.shot.missing .placeholder { display: flex; }
.shot .placeholder .tile { --w: 17%; filter: drop-shadow(0 3px 5px rgba(59,51,85,.15)); }
.shot .placeholder .tile.dim { filter: brightness(.82) saturate(.7); }
.shot .placeholder .tile.lift { transform: translateY(-14%); }
.shot .placeholder .label {
  position: absolute; left: 10px; bottom: 8px; font-size: .75rem; font-weight: 500;
  color: var(--ink-soft); background: rgba(255,255,255,.8); padding: 1px 10px; border-radius: 999px;
}
.shot figcaption { text-align: center; color: var(--ink-soft); margin-top: 10px; font-weight: 500; }

/* Promise */
.promise-card {
  background: var(--ink); color: #fff; border-radius: 36px; padding: 48px 40px; text-align: center;
  position: relative; overflow: hidden;
}
.promise-card h2 { color: #fff; }
.promise-card p { color: #D9D4E8; max-width: 620px; margin-left: auto; margin-right: auto; }
.promise-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; list-style: none; padding: 0; margin: 24px 0 8px; }
.promise-list li {
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.18); border-radius: 999px;
  padding: 6px 16px; font-weight: 500;
}
.promise-list li::before { content: "✕ "; color: var(--sakura); font-weight: 700; }
.promise-card a { color: #A8EBC8; }
.promise-card a:hover { color: #fff; }

/* How to play / FAQ */
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; list-style: none; padding: 0; margin: 0 0 40px; counter-reset: step; }
.howto li {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative;
}
.howto li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--mint-dark); color: #fff; font-weight: 600; margin-bottom: 10px;
}
.howto p { margin: 0; color: var(--ink-soft); }
.howto strong { color: var(--ink); }

.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: #fff; border: 2px solid var(--line); border-radius: 18px; margin-bottom: 12px;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; font-weight: 500; font-size: 1.08rem; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: var(--mint-soft); color: var(--mint-deep);
  display: grid; place-items: center; font-weight: 600; font-size: 1.2rem; line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq details[open] { border-color: var(--mint); }
.faq .answer { padding: 0 20px 16px; color: var(--ink-soft); }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--mint-soft); margin-top: 40px; padding: 40px 0 32px; text-align: center;
  border-top-left-radius: 40px; border-top-right-radius: 40px;
}
.site-footer .love { font-size: 1.25rem; font-weight: 500; margin-bottom: 8px; }
.site-footer .love .heart { color: var(--sakura); }
.site-footer nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; list-style: none; padding: 0; margin: 12px 0; }
.site-footer small { color: var(--ink-soft); font-size: .9rem; }
.site-footer img { width: 64px; margin: 0 auto 6px; }

/* ---------- Legal pages ---------- */
.legal { padding: 24px 0 40px; }
.legal article {
  background: #fff; border-radius: 32px; box-shadow: var(--shadow); padding: 40px 44px; max-width: 800px; margin: 0 auto;
}
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.legal h2 { font-size: 1.4rem; margin-top: 1.6em; }
.legal .meta { color: var(--ink-soft); }
.legal ul { padding-left: 1.3em; }
.legal li { margin-bottom: .4em; }
.summary-box { background: var(--mint-soft); border-radius: 18px; padding: 16px 20px; margin: 20px 0; }
.summary-box p:last-child { margin: 0; }
.back { display: inline-block; margin-bottom: 16px; font-weight: 500; }

/* 404 */
.notfound { text-align: center; padding: 40px 0 60px; }
.notfound img { width: 160px; margin: 0 auto 16px; }
.btn {
  display: inline-block; background: var(--mint-dark); color: #fff; text-decoration: none; font-weight: 500;
  padding: 10px 22px; border-radius: 999px; margin: 4px;
}
.btn:hover { background: var(--mint-deep); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; padding-bottom: 48px; }
  .hero-icon { margin-left: auto; margin-right: auto; }
  .tagline { margin-left: auto; margin-right: auto; }
  .pills { justify-content: center; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .howto { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  section { padding: 52px 0; }
  .wrap { padding: 0 16px; }
  .story-card { grid-template-columns: 1fr; text-align: center; padding: 28px 22px; gap: 12px; }
  .story-card img { width: 120px; margin: 0 auto; }
  .feature-grid { grid-template-columns: 1fr; gap: 12px; }
  .feature { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; padding: 16px; }
  .feature .ico { grid-row: span 2; width: 48px; height: 48px; font-size: 1.4rem; margin: 0; }
  .features { border-radius: 28px; }
  .promise-card { padding: 36px 20px; border-radius: 28px; }
  .legal article { padding: 28px 20px; border-radius: 24px; }
  .shots {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 16px; gap: 14px;
  }
  .brand span { font-size: 1rem; }
}
@media (max-width: 400px) {
  .tile-stack { transform: scale(.82); transform-origin: top center; height: 280px; }
  .brand span { display: none; }
}
