/* Magic City Mahjong — mcmahjong.org
   Palette: mahjong-table green felt, warm ivory tiles, dragon red accent. */
:root {
  --felt: #0e5c3f;
  --felt-deep: #0a4630;
  --felt-dark: #063020;
  --ivory: #f7f4ec;
  --ivory-dim: #ece7da;
  --ink: #1c211e;
  --ink-soft: #435049;
  --red: #c0362c;
  --red-bright: #d94438;
  --gold: #d9a441;
  --line: rgba(14, 92, 63, 0.14);
  --shadow: 0 10px 30px rgba(6, 48, 32, 0.12);
  --radius: 16px;
  --maxw: 1080px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.4em; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.2rem;
  letter-spacing: 0.2px;
}
.brand:hover { text-decoration: none; }
.brand-tile {
  width: 23px;
  height: 31px;
  display: inline-block;
  vertical-align: middle;
  background-image: var(--sym), url("images/tiles/Front.svg");
  background-size: contain, contain;
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
}
.brand-text strong { color: var(--felt); font-weight: 800; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.96rem;
}
.nav-links a:hover { color: var(--felt); text-decoration: none; }
.nav-cta {
  background: var(--felt);
  color: var(--ivory) !important;
  padding: 8px 16px;
  border-radius: 999px;
}
.nav-cta:hover { background: var(--felt-deep); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--felt);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(192, 54, 44, 0.28); }
.btn-primary:hover { background: var(--red-bright); }
.btn-ghost { background: transparent; color: var(--ivory); border: 2px solid rgba(247, 244, 236, 0.6); }
.btn-ghost:hover { border-color: var(--ivory); }
.section .btn-ghost { color: var(--felt); border-color: rgba(14, 92, 63, 0.4); }
.section .btn-ghost:hover { border-color: var(--felt); }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn-discord {
  background: #5865f2;
  color: #fff;
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.32);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn-discord:hover { background: #4752c4; color: #fff; }
.discord-ico { width: 22px; height: 22px; fill: currentColor; flex: 0 0 auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--felt) 0%, var(--felt-deep) 55%, var(--felt-dark) 100%);
  color: var(--ivory);
  text-align: center;
  padding: 84px 0 96px;
}
.hero-tiles {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  opacity: 0.5;
  pointer-events: none;
  transform: translateY(30%);
}
.htile {
  width: clamp(34px, 7vw, 58px);
  height: clamp(45px, 9.3vw, 77px);
  background-image: var(--sym), url("images/tiles/Front.svg");
  background-size: contain, contain;
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
}
.hero-inner { position: relative; z-index: 1; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: 20px;
}
.lead {
  max-width: 640px;
  margin: 0 auto 30px;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: rgba(247, 244, 236, 0.9);
}
.lead strong { color: #fff; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note {
  margin-top: 26px;
  font-size: 0.92rem;
  color: rgba(247, 244, 236, 0.75);
}

/* ---------- Sections ---------- */
.section { padding: 76px 0; }
.section-alt { background: var(--ivory-dim); }
.section-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--felt-deep);
  text-align: center;
}
.section-intro {
  max-width: 680px;
  margin: 0 auto 44px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
}
.card-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 12px; }

/* Composited riichi tile: symbol layered over the Front (tile body). The
   symbol is supplied per-element via the --sym custom property. */
.tile-ico {
  width: 48px;
  height: 64px;
  display: block;
  margin: 0 0 16px;
  background-image: var(--sym), url("images/tiles/Front.svg");
  background-size: contain, contain;
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  filter: drop-shadow(0 4px 8px rgba(6, 48, 32, 0.18));
}
.card h3 { color: var(--felt-deep); font-size: 1.2rem; }
.card p { margin: 0; color: var(--ink-soft); }

/* ---------- Play grid ---------- */
.play-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.play-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  border-top: 4px solid var(--gold);
  box-shadow: var(--shadow);
}
.play-card h3 { color: var(--felt-deep); font-size: 1.15rem; }
.play-card p { margin: 0; color: var(--ink-soft); }
.play-cta { text-align: center; margin-top: 40px; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 54px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--felt);
  color: var(--ivory);
  border-radius: 50%;
  font-weight: 800;
}
.step h3 { color: var(--felt-deep); font-size: 1.12rem; margin-bottom: 4px; }
.step p { margin: 0; color: var(--ink-soft); }

.resources {
  max-width: 720px;
  margin: 0 auto;
  background: var(--ivory-dim);
  border-radius: var(--radius);
  padding: 28px 32px;
}
.resources h3 { color: var(--felt-deep); }
.resources ul { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.resources li { margin-bottom: 8px; }

/* ---------- Play Online ---------- */
.online-card {
  display: flex;
  flex-direction: column;
}
.online-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.online-head h3 { margin: 0; color: var(--felt-deep); font-size: 1.25rem; }
.online-card > p { color: var(--ink-soft); margin: 0 0 12px; }
.pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ivory-dim);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.pill-rec { background: var(--gold); color: #3a2a06; border-color: transparent; }
.platforms {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.platforms li {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--felt-deep);
  background: var(--ivory-dim);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  margin: 0;
}
.online-note {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.online-btn { margin-top: auto; align-self: flex-start; }
.online-foot {
  text-align: center;
  max-width: 660px;
  margin: 34px auto 0;
  color: var(--ink-soft);
}
.nsfw-mark {
  color: var(--red);
  font-weight: 800;
}
sup.nsfw-mark { font-size: 0.7em; margin-left: 1px; }
.nsfw-note {
  max-width: 620px;
  margin: 20px auto 0;
  padding: 13px 20px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-soft);
  background: rgba(192, 54, 44, 0.06);
  border: 1px solid rgba(192, 54, 44, 0.28);
  border-radius: 12px;
}

/* ---------- Join ---------- */
.join {
  background:
    radial-gradient(900px 400px at 50% 120%, var(--felt) 0%, var(--felt-deep) 60%, var(--felt-dark) 100%);
  color: var(--ivory);
  text-align: center;
}
.join .section-title { color: #fff; }
.join .section-intro { color: rgba(247, 244, 236, 0.85); }
.join-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.join-note { margin-top: 26px; font-size: 0.9rem; color: rgba(247, 244, 236, 0.7); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--felt-dark);
  color: rgba(247, 244, 236, 0.85);
  padding: 40px 0;
  text-align: center;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
}
.footer-tag { margin: 10px 0 6px; }
.footer-fine { margin: 0; font-size: 0.9rem; color: rgba(247, 244, 236, 0.6); }
.footer-fine a { color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .cards, .play-grid, .steps { grid-template-columns: 1fr; }
  .steps { max-width: 480px; margin-inline: auto; }
}
@media (max-width: 680px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 66px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 0 24px; }
  .nav-links a { display: block; padding: 12px 0; }
  .nav-cta { text-align: center; margin: 8px 24px; }
}
