:root {
  --bg-deep: #061a2b;
  --bg-mid: #0a3a4a;
  --ink: #062033;
  --paper: #f7fbff;
  --muted: #3d5a6c;
  --coral: #ff5e5b;
  --sun: #ffc857;
  --mint: #00d4a8;
  --sky: #3ec6ff;
  --peach: #ff8f6b;
  --leaf: #5dff9f;
  --shadow: 0 18px 40px rgba(6, 32, 51, 0.18);
  --radius: 22px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #9ef0ff 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #ffd6a5 0%, transparent 50%),
    linear-gradient(165deg, #e8f8ff 0%, #fff6ea 45%, #dffcf2 100%);
  overflow-x: hidden;
}

.bg-mesh,
.bg-orbs {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
}

.bg-mesh {
  background-image:
    linear-gradient(rgba(6, 58, 74, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 58, 74, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: floaty 12s ease-in-out infinite;
}

.orb-a {
  width: 280px;
  height: 280px;
  background: #7ef0d8;
  top: 12%;
  left: -60px;
}

.orb-b {
  width: 320px;
  height: 320px;
  background: #ffb38a;
  top: 40%;
  right: -80px;
  animation-delay: -4s;
}

.orb-c {
  width: 220px;
  height: 220px;
  background: #8fd6ff;
  bottom: 8%;
  left: 35%;
  animation-delay: -7s;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-28px) scale(1.06); }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(247, 251, 255, 0.72);
  border-bottom: 1px solid rgba(6, 58, 74, 0.08);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--mint), var(--sky));
  box-shadow: 0 8px 20px rgba(0, 212, 168, 0.35);
  animation: pulse-mark 2.4s ease-in-out infinite;
}

@keyframes pulse-mark {
  0%, 100% { transform: rotate(-6deg) scale(1); }
  50% { transform: rotate(6deg) scale(1.08); }
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  letter-spacing: -0.03em;
}

.nav {
  display: flex;
  gap: 1.25rem;
}

.nav a {
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--ink);
}

.site-main {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) 2.5rem;
}

/* —— Home hero —— */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: grid;
  align-content: end;
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  overflow: hidden;
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, transparent 20%, rgba(247, 251, 255, 0.35) 70%, rgba(247, 251, 255, 0.92) 100%),
    radial-gradient(ellipse 80% 60% at 70% 35%, rgba(62, 198, 255, 0.45), transparent 60%),
    radial-gradient(ellipse 60% 50% at 25% 55%, rgba(255, 94, 91, 0.35), transparent 55%),
    linear-gradient(120deg, #0b4a5c 0%, #147a6a 40%, #1f8f9e 70%, #f0a04b 100%);
  border-radius: 0 0 40px 40px;
  animation: hero-shift 14s ease-in-out infinite alternate;
}

@keyframes hero-shift {
  from { filter: hue-rotate(0deg) saturate(1); }
  to { filter: hue-rotate(12deg) saturate(1.1); }
}

.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.hero-particles span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  animation: rise 8s linear infinite;
}

@keyframes rise {
  0% { transform: translateY(100vh) scale(0.4); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(6, 32, 51, 0.35);
}

.hero-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 10vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 0.75rem;
  animation: brand-in 0.9s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@keyframes brand-in {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.hero-line {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.2vw, 1.65rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  animation: brand-in 0.9s 0.12s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.hero-sub {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  max-width: 34ch;
  opacity: 0.95;
  animation: brand-in 0.9s 0.22s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: brand-in 0.9s 0.32s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--sun), var(--peach));
  color: #3a2208;
  box-shadow: 0 12px 28px rgba(255, 126, 69, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
}

.btn-play {
  background: linear-gradient(135deg, var(--mint), #2ad4ff);
  color: #043447;
  box-shadow: 0 10px 24px rgba(0, 212, 168, 0.35);
}

.btn-secondary {
  background: rgba(6, 32, 51, 0.08);
  color: var(--ink);
}

.section {
  padding: 2.5rem 0 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
}

.section-sub {
  margin: 0 0 1.75rem;
  color: var(--muted);
  max-width: 42ch;
}

.ad-band {
  width: min(1100px, calc(100% - 2rem));
  margin: 1rem auto 2rem;
}

.ad-slot {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.45);
  border: 1px dashed rgba(6, 58, 74, 0.18);
  border-radius: 16px;
  overflow: hidden;
}

.ad-slot--side {
  min-height: 250px;
  margin: 1rem 0;
}

.ad-slot--inline {
  margin: 1.25rem 0;
}

/* Game grid — interactive tiles */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
}

.game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1.35rem 1.35rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  font: inherit;
}

.game-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--tile-accent, var(--mint));
}

.game-tile:hover,
.game-tile:focus-visible {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 24px 48px rgba(6, 32, 51, 0.22);
  outline: none;
}

.game-tile-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 0.65rem;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.12));
  animation: bob 3s ease-in-out infinite;
}

.game-tile:nth-child(2) .game-tile-icon { animation-delay: -0.4s; }
.game-tile:nth-child(3) .game-tile-icon { animation-delay: -0.8s; }
.game-tile:nth-child(4) .game-tile-icon { animation-delay: -1.2s; }
.game-tile:nth-child(5) .game-tile-icon { animation-delay: -1.6s; }
.game-tile:nth-child(6) .game-tile-icon { animation-delay: -2s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.game-tile h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.game-tile p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.game-tile .play-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tile-accent, var(--mint)) 22%, white);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.85rem;
}

/* Game page layout */
.game-page-head {
  padding: 1.5rem 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.game-page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0;
  letter-spacing: -0.03em;
}

.game-page-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  width: 100%;
}

.game-shell {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
}

@media (min-width: 900px) {
  .game-shell {
    grid-template-columns: 1fr 200px;
    align-items: start;
  }
}

.game-stage {
  position: relative;
  background: linear-gradient(160deg, #043447, #0a5c6e 50%, #126b58);
  border-radius: 24px;
  padding: 0.85rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.game-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 45%);
  pointer-events: none;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  position: relative;
  z-index: 1;
}

.hud-stat {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
}

.hud-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hud-actions .btn {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 70vh;
  border-radius: 16px;
  overflow: hidden;
  background: #021820;
  touch-action: none;
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 24, 32, 0.72);
  color: #fff;
  text-align: center;
  padding: 1.5rem;
  z-index: 5;
  backdrop-filter: blur(4px);
  transition: opacity 0.25s ease;
}

.game-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.game-overlay h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 0.5rem;
}

.game-overlay p {
  margin: 0 0 1.1rem;
  opacity: 0.9;
}

.touch-pad {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.75rem;
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

.touch-pad button {
  aspect-ratio: 1;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
}

.touch-pad .blank {
  visibility: hidden;
}

@media (max-width: 768px) {
  .touch-pad.show-mobile {
    display: grid;
  }
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tip-box {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 24px rgba(6, 32, 51, 0.08);
}

.tip-box h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.tip-box p,
.tip-box ul {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  padding-left: 1.1rem;
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--muted);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0 0 0.35rem;
}

.footer-note,
.footer-copy {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .nav a:last-child {
    display: none;
  }

  .hero {
    min-height: 72vh;
  }
}
