:root {
  --aqua: #48d6c9;
  --aqua-dark: #0c8386;
  --lagoon: #1fa9c5;
  --sky: #c9f2ff;
  --moon: #5b75b7;
  --blue: #217eb9;
  --sand: #ffd98f;
  --sunset: #ff9e70;
  --shell: #fff9e9;
  --coral: #ff776d;
  --reef: #8edc8b;
  --ink: #143442;
  --muted: #557681;
  --line: rgba(20, 52, 66, 0.13);
  --shadow: 0 18px 44px rgba(13, 108, 124, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 158, 112, 0.32), transparent 30%),
    radial-gradient(circle at 86% 4%, rgba(91, 117, 183, 0.22), transparent 34%),
    linear-gradient(160deg, rgba(201, 242, 255, 0.92), rgba(255, 249, 233, 0.96) 42%, rgba(72, 214, 201, 0.28)),
    var(--shell);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: auto 0 0;
  z-index: -1;
  height: 42vh;
  opacity: 0.36;
  background:
    repeating-radial-gradient(ellipse at 50% 100%, rgba(31, 169, 197, 0.24) 0 18px, transparent 19px 38px),
    linear-gradient(180deg, transparent, rgba(72, 214, 201, 0.24));
}

a {
  color: var(--blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

p {
  line-height: 1.7;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: rgba(255, 249, 233, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--lagoon), var(--aqua) 48%, var(--sand));
  box-shadow: inset 0 -5px rgba(22, 50, 63, 0.12);
  font-weight: 900;
  font-size: 0.9rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.site-nav a {
  padding: 9px 11px;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.92rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: rgba(84, 211, 208, 0.25);
}

main {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.home-hero,
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  padding: 36px 0 24px;
}

.home-copy,
.page-hero > div:first-child {
  align-self: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--aqua-dark);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 720px;
  font-size: 2.65rem;
}

h2 {
  font-size: 1.7rem;
}

h3 {
  font-size: 1.08rem;
}

.home-copy > p:not(.eyebrow),
.page-hero p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-links a,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 15px;
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.hero-links a:nth-child(2) {
  background: var(--aqua-dark);
}

.hero-links a:nth-child(3) {
  background: #b46a1f;
}

.play-panel,
.note-card,
.feature-card,
.contact-form,
.faq-list details,
.tip-card,
.list-cards article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.play-panel {
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 249, 233, 0.84), rgba(201, 242, 255, 0.78)),
    #fff;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.icon-button,
.swipe-controls button,
.tips-filter button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.icon-button {
  width: 44px;
  height: 44px;
  font-size: 1.25rem;
}

.merge-board,
.pattern-board,
.hero-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(20, 52, 66, 0.08), rgba(31, 169, 197, 0.12)),
    rgba(255, 255, 255, 0.22);
}

.merge-board {
  aspect-ratio: 1;
}

.tile,
.pattern-board span,
.hero-mini-grid span {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 900;
  box-shadow: inset 0 -5px rgba(22, 50, 63, 0.12);
  transition: transform 180ms ease, filter 180ms ease;
}

.tile {
  grid-template-rows: 1fr auto;
  padding: 8px 4px;
  font-size: 1.45rem;
  cursor: pointer;
}

.tile span {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile:hover,
.feature-card:hover,
.tip-card:hover {
  transform: translateY(-4px);
  filter: saturate(1.08);
}

.tile.empty {
  background: rgba(255, 255, 255, 0.42);
  box-shadow: none;
}

.t2 { background: #fff5be; }
.t4 { background: #ffd98f; }
.t8 { background: #b9f3f0; }
.t16 { background: #48d6c9; }
.t32 { background: #85d7ff; }
.t64 { background: #ffb07e; }
.t128 { background: #8edc8b; }
.t256 { background: #f47f9a; }

.merge-board.swiping .tile:not(.empty) {
  animation: swipeLeft 430ms ease;
}

.merge-board.swiping[data-swipe="right"] .tile:not(.empty) {
  animation-name: swipeRight;
}

.merge-board.swiping[data-swipe="up"] .tile:not(.empty) {
  animation-name: swipeUp;
}

.merge-board.swiping[data-swipe="down"] .tile:not(.empty) {
  animation-name: swipeDown;
}

.pulse {
  animation: popTile 420ms ease;
}

.swipe-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.swipe-controls button {
  min-height: 42px;
  font-size: 1.2rem;
}

.content-band,
.two-column,
.step-grid,
.upgrade-track,
.tips-grid,
.faq-list,
.contact-wrap,
.legal-copy,
.reference-gallery,
.official-links,
.end-link {
  margin: 28px 0;
}

.section-title {
  margin-bottom: 16px;
}

.feature-grid,
.step-grid,
.upgrade-track,
.tips-grid,
.list-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.feature-card,
.tip-card,
.list-cards article,
.note-card,
.official-links,
.contact-form,
.faq-list details {
  padding: 18px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--sky);
  color: var(--aqua-dark);
  font-size: 1.35rem;
  font-weight: 900;
}

.feature-card p,
.tip-card p,
.list-cards p,
.note-card p {
  color: var(--muted);
}

.article-grid,
.two-column,
.contact-wrap {
  display: grid;
  gap: 18px;
}

.note-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(201, 242, 255, 0.76)),
    #fff;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-grid div {
  min-height: 112px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--sand);
}

.stat-grid strong {
  display: block;
  font-size: 1.75rem;
}

.stat-grid span {
  color: #6b4e16;
}

.hero-mini-grid {
  transform: rotate(2deg);
}

.hero-mini-grid span,
.pattern-board span {
  min-height: 58px;
  background: linear-gradient(145deg, #fff, rgba(201, 242, 255, 0.62));
}

.hero-mini-grid .fish {
  background: var(--aqua);
}

.step-grid article,
.upgrade-track article {
  position: relative;
  min-height: 168px;
  padding: 18px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 249, 233, 0.92)),
    #fff;
  border: 1px solid var(--line);
}

.step-grid span,
.upgrade-track span {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--aqua);
  font-weight: 900;
}

.tile-ladder {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.tile-ladder span {
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--sky), #fff);
  font-weight: 850;
  text-align: center;
}

.pattern-board span:empty {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: none;
}

.reference-gallery {
  overflow: hidden;
}

.reference-gallery .section-title p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
}

.screenshot-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
}

.screenshot-strip figure {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  transform: translateZ(0);
}

.screenshot-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 526 / 296;
  object-fit: cover;
  border-radius: calc(var(--radius) - 1px);
}

.official-links {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
}

.official-links p {
  color: var(--muted);
}

.official-links div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.official-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 800;
  text-decoration: none;
}

.app-profile,
.creature-ladder,
.ocean-elements {
  margin: 28px 0;
}

.app-profile {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 217, 143, 0.45), rgba(201, 242, 255, 0.78) 48%, rgba(72, 214, 201, 0.28)),
    #fff;
  box-shadow: var(--shadow);
}

.app-profile-head {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.app-profile-head img {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(20, 52, 66, 0.18);
}

.app-profile-head p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
}

.fact-grid,
.creature-grid,
.ocean-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.fact-grid div {
  min-height: 76px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.fact-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.fact-grid strong {
  display: block;
  line-height: 1.25;
}

.creature-grid article,
.ocean-card-grid article {
  position: relative;
  min-height: 164px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.9), transparent 22%),
    linear-gradient(145deg, rgba(201, 242, 255, 0.9), rgba(255, 249, 233, 0.88));
  box-shadow: var(--shadow);
}

.creature-grid article::after,
.ocean-card-grid article::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -24px;
  width: 112px;
  height: 58px;
  border-radius: 50%;
  background: rgba(31, 169, 197, 0.2);
  box-shadow: -42px -8px 0 rgba(72, 214, 201, 0.16);
}

.bubble-value {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--sunset), var(--sand));
  color: var(--ink);
  font-weight: 950;
  box-shadow: inset 0 -4px rgba(20, 52, 66, 0.12);
}

.ocean-card-grid article span {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 169, 197, 0.16);
  color: var(--aqua-dark);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.tips-filter {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}

.tips-filter button {
  min-height: 40px;
  padding: 8px 14px;
}

.tips-filter button.is-active {
  background: var(--ink);
  color: #fff;
}

.tip-card span {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 9px;
  border-radius: var(--radius);
  background: rgba(84, 211, 208, 0.22);
  color: var(--aqua-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 900;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

.contact-form small,
.form-error {
  color: #a5322b;
}

.form-success {
  color: #176f44;
}

.form-success,
.form-error {
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  font-weight: 800;
}

.legal-copy {
  max-width: 850px;
}

.legal-copy h2 {
  margin-top: 24px;
  font-size: 1.4rem;
}

.end-link {
  padding: 16px 0 34px;
  border-top: 1px solid var(--line);
}

.site-footer {
  display: grid;
  gap: 18px;
  padding: 26px clamp(16px, 4vw, 42px);
  background: #16323f;
  color: #fff;
}

.site-footer p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.75);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: #fff;
}

@keyframes swipeLeft {
  45% { transform: translateX(-12px); }
}

@keyframes swipeRight {
  45% { transform: translateX(12px); }
}

@keyframes swipeUp {
  45% { transform: translateY(-12px); }
}

@keyframes swipeDown {
  45% { transform: translateY(12px); }
}

@keyframes popTile {
  50% { transform: scale(1.08); }
}

@media (min-width: 720px) {
  h1 {
    font-size: 4.8rem;
  }

  h2 {
    font-size: 2.3rem;
  }

  .tile {
    font-size: 1.85rem;
  }

  .home-hero,
  .page-hero,
  .article-grid,
  .two-column,
  .contact-wrap {
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    align-items: center;
  }

  .feature-grid,
  .step-grid,
  .upgrade-track,
  .tips-grid,
  .list-cards,
  .creature-grid,
  .ocean-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fact-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .upgrade-track {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tile-ladder {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .site-footer {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (max-width: 840px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    inset: 76px 14px auto 14px;
    display: none;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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