/* the home page (index.html); fonts and the base colors are in style.css */

:root {
  --surface: #1c1c1c;
  --surface-hover: #222;
  --edge: #272727;
  --soft: #9b9b9b;
  --blue-text: #4b97ff;
  --green: #287850;
  --red: #c81432;
  --gold: #e6aa00;
  --purple: #8c288c;
  /* board squares, as in the app's map previews */
  --ground-light: #fff;
  --ground-dark: #dcdcdc;
  --water-light: #648bff;
  --water-dark: #3366ff;
  --lava-light: #ff8838;
  --lava-dark: #ff6600;
}

html { scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body.home {
  display: block;
  height: auto;
  min-height: 100%;
  padding: 0;
  text-align: left;
  overflow-x: clip;
}
.home main { max-width: none; }

.home p { margin: 0 0 12px; font-size: 17px; line-height: 1.55; color: var(--soft); }
.home h2 { margin: 0 0 16px; font-size: clamp(32px, 4.6vw, 48px); font-weight: 700; line-height: 1.06; letter-spacing: -0.015em; text-wrap: balance; }
.home h3 { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: var(--text); }
.home h4 { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: var(--text); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.home .eyebrow { margin-bottom: 14px; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; color: var(--blue-text); }

.icon {
  display: inline-block;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

/* top bar */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(22, 22, 22, 0.82);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 21px; letter-spacing: 0.02em; }
.brand svg { width: 22px; height: 22px; }
.top nav { display: flex; gap: 26px; margin-left: auto; }
.top nav a { color: var(--soft); text-decoration: none; font-size: 15px; transition: color 0.15s; }
.top nav a:hover { color: var(--text); }
.top .get {
  padding: 7px 15px;
  border-radius: 10px;
  background: var(--text);
  color: var(--background);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.top .get:hover { background: #fff; }

/* buttons */

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 26px;
  border: 1.5px solid var(--text);
  border-radius: 14px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.button:hover { background: rgba(218, 218, 218, 0.08); }
.button.primary { background: var(--text); color: var(--background); }
.button.primary:hover { background: #fff; border-color: #fff; }
.button:active { transform: scale(0.98); }

/* hero */

.hero { padding-top: 76px; text-align: center; }
.hero-copy { position: relative; z-index: 1; }
.hero h1 { margin: 0 0 22px; font-size: clamp(46px, 8.4vw, 96px); font-weight: 700; line-height: 0.98; letter-spacing: -0.025em; }
.hero .lede { max-width: 540px; margin: 0 auto 32px; font-size: clamp(18px, 2.2vw, 21px); }
.hero .fine { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.hero-art { margin-top: -3vw; }
.hero-art img {
  display: block;
  width: 100%;
  max-width: 1800px;
  height: auto;
  margin: 0 auto;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 18%, #000 78%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 18%, #000 78%, transparent);
  mask-composite: intersect;
}

/* sections */

.section { padding: 112px 0; }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center p { text-wrap: balance; }

/* how a game goes */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin: 0; padding: 0; list-style: none; }
.step .num { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--blue-text); }
.step:nth-child(n+3) .num { color: #ff5a70; }
.step p { font-size: 16px; }
.phone {
  max-width: 260px;
  margin: 0 auto 26px;
  padding: 6px;
  border-radius: 36px;
  background: #262626;
  box-shadow: inset 0 0 0 1px #363636, 0 30px 80px -24px rgba(0, 100, 200, 0.45);
}
.step:nth-child(n+3) .phone { box-shadow: inset 0 0 0 1px #363636, 0 30px 80px -24px rgba(200, 20, 50, 0.45); }
.phone img { display: block; width: 100%; height: auto; border-radius: 30px; background: #000; }

.rules-head { margin: 96px 0 20px; }
.rules-head h3 { font-size: 24px; }
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rule { padding: 24px; border: 1px solid var(--edge); border-radius: 18px; background: var(--surface); }
.rule .icon { width: 28px; height: 28px; margin-bottom: 14px; color: var(--blue-text); }
.rule p { margin: 0; font-size: 15.5px; }

/* ar */

.ar { background: linear-gradient(180deg, transparent, #121212 30%, #121212 70%, transparent); }
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 64px; align-items: center; }
.split-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--edge), 0 40px 90px -30px rgba(0, 100, 200, 0.35);
}
.ticks { display: grid; gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
.ticks li { display: flex; align-items: baseline; gap: 12px; font-size: 16px; color: var(--text); }
.ticks li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); transform: translateY(-1px); }

/* together */

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { padding: 26px; border: 1px solid var(--edge); border-radius: 18px; background: var(--surface); }
.feature svg { width: 30px; height: 30px; margin-bottom: 16px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.feature p { margin: 0; font-size: 15.5px; }

/* characters */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filters button {
  padding: 8px 15px;
  border: 1px solid #333;
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--background); }

.explorer { display: grid; grid-template-columns: 1fr 400px; gap: 32px; align-items: start; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.char {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 6px 14px;
  border: 1.5px solid var(--edge);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.char:hover { background: var(--surface-hover); }
.char[aria-pressed="true"] { border-color: var(--blue-text); background: var(--surface-hover); }
.char .icon { width: 50px; height: 50px; }
.char .cost { position: absolute; top: 8px; left: 8px; }
.char .dot { position: absolute; top: 13px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--pack); }
.char[hidden] { display: none; }

.cost {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--text);
  color: var(--background);
  font-size: 13px;
  font-weight: 700;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px;
  border: 1.5px solid var(--pack);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pack); }

.char-detail { position: sticky; top: 84px; overflow: hidden; border: 1px solid var(--edge); border-radius: 22px; background: var(--surface); }
.stage { display: grid; place-items: center; padding: 38px 0 32px; background: radial-gradient(circle at 50% 45%, #2e2e2e, #181818 72%); }
.stone {
  position: relative;
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  border-radius: 10px;
  background: linear-gradient(160deg, #f2f2f2, #cdcdcd);
  box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.8);
  color: var(--blue);
}
.stone::after { content: ""; position: absolute; left: 0; right: 0; bottom: 14px; height: 6px; background: var(--blue); }
.stone .icon { width: 62px; height: 62px; margin-bottom: 10px; }
.detail-body { padding: 22px 24px 26px; }
.detail-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.detail-title h3 { margin: 0; font-size: 26px; }
.detail-title .chip { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 22px; }
.stats div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: #141414; }
.stats dt { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.stats dt .icon { width: 14px; height: 14px; }
.stats dd { margin: 0; font-size: 24px; font-weight: 700; }
.abilities { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.abilities li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; }
.abilities .icon { width: 24px; height: 24px; margin-top: 1px; color: var(--text); }
.abilities strong { display: block; margin-bottom: 2px; font-size: 16px; color: var(--text); }
.abilities p, .detail-body .bio { margin: 0; font-size: 14.5px; line-height: 1.5; }
.detail-body .bio { margin-top: 18px; font-style: italic; }
.detail-body .unlock { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* maps */

.map-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; }
.map { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 0; padding: 22px 12px 16px; border: 1px solid var(--edge); border-radius: 16px; background: var(--surface); }
.map .frame { display: flex; align-items: center; justify-content: center; height: 158px; }
.board { display: grid; grid-template-columns: repeat(var(--cols), 15px); gap: 2.5px; }
.board i, .legend i { display: block; width: 15px; height: 15px; border-radius: 3px; }
.board .g { background: var(--ground-dark); }
.board .g.light { background: var(--ground-light); }
.board .w { background: var(--water-dark); }
.board .w.light { background: var(--water-light); }
.board .l { background: var(--lava-dark); }
.board .l.light { background: var(--lava-light); }
.map figcaption { text-align: center; font-size: 14px; font-weight: 700; color: var(--text); }
.map figcaption small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin: 28px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--soft); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; }
.legend .g { background: var(--ground-light); }
.legend .w { background: var(--water-dark); }
.legend .l { background: var(--lava-dark); }
.legend .v { border: 1.5px dashed #444; }

/* free to play */

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan { display: flex; flex-direction: column; align-items: flex-start; padding: 28px; border: 1px solid var(--edge); border-radius: 22px; background: var(--surface); }
.plan.featured { border-color: rgba(200, 20, 50, 0.55); background: linear-gradient(180deg, rgba(200, 20, 50, 0.12), var(--surface) 45%); }
.plan h3 { margin: 18px 0 4px; font-size: 26px; }
.plan .price { font-size: 15px; color: var(--muted); }
.mini-icons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px; }
.mini-icons .icon { width: 24px; height: 24px; color: var(--text); }
.plan ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.plan li { position: relative; padding-left: 20px; font-size: 15.5px; line-height: 1.5; color: var(--soft); }
.plan li::before { content: ""; position: absolute; left: 1px; top: 0.6em; width: 7px; height: 7px; border-radius: 2px; background: var(--pack); }
.plan li b { color: var(--text); }

/* faq */

.faq { max-width: 780px; }
.faq h2 { margin-bottom: 20px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  padding: 22px 44px 22px 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--soft);
  border-bottom: 2px solid var(--soft);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq details p { max-width: 680px; padding-bottom: 24px; margin: 0; }
.faq a { color: var(--text); }

/* the last word */

.finale { padding: 120px 0 110px; text-align: center; background: radial-gradient(ellipse 55% 60% at 50% 55%, rgba(0, 100, 200, 0.16), transparent 70%); }
.finale h2 { font-size: clamp(40px, 6vw, 64px); }
.finale p { margin-bottom: 30px; }
.stones { display: flex; justify-content: center; gap: 12px; perspective: 700px; }
.finale .hint { margin: 16px 0 40px; font-size: 13px; color: var(--muted); }
.hidden-stone {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (hover: hover) { .hidden-stone:hover { transform: translateY(-4px); } }
.hidden-stone.revealed { transform: rotateY(180deg); }
.hidden-stone > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(160deg, #444, #262626);
  box-shadow: 0 18px 30px -14px rgba(0, 0, 0, 0.9);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.hidden-stone > span::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 4px; background: var(--gold); }
.hidden-stone .back { transform: rotateY(180deg); color: var(--gold); }
.hidden-stone .icon { width: 32px; height: 32px; margin-bottom: 6px; }
.hidden-stone:focus-visible { outline: 2px solid var(--blue-text); outline-offset: 4px; border-radius: 8px; }

/* footer */

.site-foot { margin: 0; padding: 28px 0 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { color: var(--text); }

/* sections fade in as they scroll into view (home.js only hides ones below the fold) */

.reveal.waiting { opacity: 0; transform: translateY(18px); }
.reveal.shown { transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
@media (prefers-reduced-motion: reduce) {
  .reveal.waiting { opacity: 1; transform: none; }
  .hidden-stone { transition: none; }
}

/* smaller screens */

@media (max-width: 1000px) {
  .map-grid { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 48px 28px; }
  .explorer { grid-template-columns: 1fr; }
  .char-detail { position: static; order: -1; }
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 40px; }
  .rules, .features { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .top nav { display: none; }
  .top .get { margin-left: auto; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .section { padding: 76px 0; }
  .hero { padding-top: 52px; }
  .hero-art { margin-top: 16px; }
  .hero-art img { height: 300px; object-fit: cover; }
  .section-head { margin-bottom: 36px; }
  .rules, .features { grid-template-columns: 1fr; }
  .steps { display: flex; gap: 16px; margin: 0 -16px; padding: 0 16px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .steps::-webkit-scrollbar { display: none; }
  .step { flex: 0 0 76%; scroll-snap-align: center; }
  .rules-head { margin-top: 64px; }
  .char-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .char { padding: 22px 4px 12px; font-size: 13.5px; }
  .char .icon { width: 40px; height: 40px; }
  .map-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .board { grid-template-columns: repeat(var(--cols), 14px); gap: 2.5px; }
  .board i { width: 14px; height: 14px; }
  .map .frame { height: 148px; }
  .stones { gap: 9px; }
  .hidden-stone { width: 54px; height: 54px; }
  .hidden-stone .icon { width: 27px; height: 27px; }
}
