/* PA Mahjong home page (index.html, en/index.html): the game's green felt, gold and parchment. */
@font-face {
  font-family: "Cinzel";
  src: url("/fonts/Cinzel.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
:root {
  --felt: #0d3a26;
  --felt-deep: #072417;
  --card: rgba(6, 30, 19, 0.72);
  --gold: #f3cf7a;
  --gold-deep: #c99a45;
  --gold-line: rgba(224, 180, 90, 0.55);
  --ivory: #fff4dc;
  --text: #f5ead2;
  --muted: #cdbf9f;
  --parchment: #efe2c4;
  --ink: #2a2418;
  --radius: 22px;
  --wrap: 1160px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--felt);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(40, 120, 76, 0.45), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.55), transparent 70%),
    url("/img/felt.webp");
  background-size: auto, auto, 512px 512px;
  background-attachment: fixed, fixed, scroll;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
h1, h2, h3, .cinzel {
  font-family: "Cinzel", Georgia, serif;
  color: var(--gold);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); line-height: 1.08; margin: 0 0 18px; font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1.15; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 1.2rem; margin: 0 0 6px; font-weight: 700; }
p { margin: 0 0 12px; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 0 0 2px var(--gold-line), 0 6px 16px rgba(0, 0, 0, 0.4); }
.brand span { font-family: "Cinzel", Georgia, serif; font-weight: 800; font-size: 1.3rem; color: var(--gold); letter-spacing: 0.04em; }
.topnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.topnav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 0.95rem; }
.topnav a:hover { color: var(--gold); background: rgba(243, 207, 122, 0.08); }
.lang { border: 1px solid var(--gold-line); }
@media (max-width: 720px) { .hide-sm { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; text-decoration: none; border: 2px solid var(--gold-deep); cursor: pointer;
}
.btn-primary { color: #2b1a05; background: linear-gradient(180deg, #ffe39a, #e0b45a 55%, #b9862f); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn-ghost { color: var(--gold); background: rgba(5, 25, 16, 0.55); }
.btn[aria-disabled="true"] { cursor: default; }
.btn-ghost:hover { background: rgba(243, 207, 122, 0.1); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; padding: 40px 0 60px; }
.eyebrow { font-family: "Cinzel", Georgia, serif; color: var(--gold-deep); font-weight: 700; letter-spacing: 0.18em; font-size: 0.85rem; margin-bottom: 14px; }
.lead { font-size: 1.15rem; color: var(--text); max-width: 34em; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips li { font-size: 0.9rem; color: var(--muted); border: 1px solid var(--gold-line); border-radius: 999px; padding: 6px 12px; background: rgba(5, 25, 16, 0.4); }
.hero-art { position: relative; min-height: 600px; display: flex; justify-content: center; align-items: center; margin: 0; }
.hero-art .medallion { position: absolute; width: 112%; max-width: 620px; opacity: 0.9; pointer-events: none; }
.hero-art .glow { position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(243, 207, 122, 0.35), transparent 65%); filter: blur(10px); }
.phone {
  position: relative; width: 270px; border-radius: 38px; padding: 9px; background: linear-gradient(160deg, #2a2a26, #0b0b0a);
  box-shadow: 0 0 0 2px rgba(224, 180, 90, 0.45), 0 30px 60px rgba(0, 0, 0, 0.55);
}
.phone img { border-radius: 30px; width: 100%; height: auto; aspect-ratio: 540 / 1170; object-fit: cover; }
.hero-art .phone { width: 290px; z-index: 2; }
.float { position: absolute; width: 112px; z-index: 3; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.5)); animation: bob 6s ease-in-out infinite; }
.float.f1 { left: 2%; top: 10%; transform: rotate(-12deg); }
.float.f2 { right: 0; top: 22%; transform: rotate(10deg); animation-delay: -2s; }
.float.f3 { left: 6%; bottom: 8%; transform: rotate(8deg); animation-delay: -4s; }
.float.f4 { right: 6%; bottom: 4%; transform: rotate(-8deg); animation-delay: -1s; width: 100px; }
@keyframes bob { 50% { translate: 0 -12px; } }
@media (prefers-reduced-motion: reduce) { .float { animation: none; } html { scroll-behavior: auto; } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 16px; }
  .lead { margin: 0 auto 12px; }
  .actions, .chips { justify-content: center; }
  .hero-art { min-height: 520px; }
  .hero-art .phone { width: 240px; }
  .float { width: 84px; }
  .float.f4 { width: 76px; }
}

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; list-style: none; padding: 0; margin: 0 0 20px; }
.stats li { text-align: center; padding: 22px 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--gold-line); }
.stats b { display: block; font-family: "Cinzel", Georgia, serif; font-size: clamp(1.7rem, 4vw, 2.4rem); color: var(--gold); line-height: 1.1; }
.stats span { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Sections */
section { padding: 64px 0; }
.rule { border: 0; height: 26px; margin: 0; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='26' viewBox='0 0 400 26'><g fill='none' stroke='%23c99a45' stroke-width='1.5'><path d='M0 13h170M230 13h170'/><path d='M200 3l10 10-10 10-10-10z'/><path d='M180 13l-6-5v10zM220 13l6-5v10z' fill='%23c99a45'/></g></svg>") center / 400px 26px no-repeat; opacity: 0.85; }
.section-head { max-width: 46em; margin: 0 auto 34px; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* Screens */
.screens { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 4px 26px; scrollbar-width: thin; scrollbar-color: var(--gold-deep) transparent; }
.screens figure { margin: 0; flex: 0 0 auto; scroll-snap-align: center; text-align: center; }
.screens .phone { width: 230px; }
.screens figcaption { margin-top: 14px; color: var(--muted); font-size: 0.95rem; }
.screens figcaption b { display: block; color: var(--gold); font-family: "Cinzel", Georgia, serif; font-size: 1.05rem; }
@media (min-width: 1240px) { .screens { justify-content: center; } }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  position: relative; padding: 26px 24px 22px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--gold-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 30px rgba(0, 0, 0, 0.25);
}
.card::before, .card::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--gold-deep); opacity: 0.8; }
.card::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.card::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.card img.icon { width: 64px; height: 64px; object-fit: contain; margin-bottom: 12px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4)); }
.card p { color: var(--muted); margin: 0; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .features { grid-template-columns: 1fr; } }

/* How to play: parchment steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step {
  position: relative; padding: 26px 22px 24px; border-radius: var(--radius); color: var(--ink);
  background: radial-gradient(ellipse at 50% 30%, #f7ecd2, var(--parchment) 70%, #dcc89e);
  border: 2px solid var(--gold-deep); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 4px rgba(255, 255, 255, 0.25);
}
.step h3 { color: #6b3d0c; text-shadow: none; }
.step p { margin: 0; color: #3d3423; }
.step .num {
  counter-increment: step; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; margin-bottom: 10px;
  font-family: "Cinzel", Georgia, serif; font-weight: 800; color: var(--gold); background: #0f3b26; border: 2px solid var(--gold-deep);
}
.step .num::before { content: counter(step); }
.step .tiles { display: flex; gap: 8px; margin: 4px 0 14px; }
.step .tiles img { width: 64px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3)); }
.step .slots { display: flex; gap: 6px; margin: 4px 0 14px; }
.step .slots i { width: 42px; height: 56px; border: 2px solid #b8862f; border-left-color: transparent; border-right-color: transparent; border-radius: 6px; background: rgba(15, 59, 38, 0.08); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* Safety, download */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.split ul { margin: 0; padding-left: 20px; color: var(--muted); }
.split li { margin: 6px 0; }
.dl { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; }
.dl-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dl-row small { color: var(--muted); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .dl-row { flex-direction: column; align-items: flex-start; } }

/* Footer */
.footer { margin-top: 30px; padding: 44px 0 30px; background: rgba(3, 18, 11, 0.7); border-top: 1px solid var(--gold-line); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 28px; }
.footer h4 { font-family: "Cinzel", Georgia, serif; color: var(--gold); margin: 0 0 10px; font-size: 1rem; letter-spacing: 0.06em; }
.footer p, .footer address { color: var(--muted); font-style: normal; font-size: 0.95rem; margin: 0 0 6px; }
.footer nav a { display: block; color: var(--text); text-decoration: none; margin: 0 0 8px; font-size: 0.95rem; }
.footer nav a:hover { color: var(--gold); }
.fine { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(224, 180, 90, 0.2); color: #9f9478; font-size: 0.82rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .brand span { font-size: 1.05rem; white-space: nowrap; }
  .brand img { width: 38px; height: 38px; }
  .topnav { flex-wrap: nowrap; gap: 2px; }
  .topnav a { padding: 6px 9px; font-size: 0.88rem; }
}

/* Phones: no blue flash on tap; focus rings only for keyboard users. */
html { -webkit-tap-highlight-color: transparent; }
:focus:not(:focus-visible) { outline: none; }
