/* ==========================================================================
   TAP THE POTATO — cinematic dark-gold design system
   ========================================================================== */

:root {
  --bg: #0a0908;
  --bg-2: #100d0a;
  --surface: #16120d;
  --surface-2: #1d1811;
  --line: rgba(233, 192, 94, 0.16);
  --line-strong: rgba(233, 192, 94, 0.38);
  --gold: #e9c05e;
  --gold-bright: #f6d78a;
  --gold-deep: #a8752b;
  --ivory: #efe8da;
  --muted: #a3977f;
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

::selection { background: rgba(233, 192, 94, 0.28); color: #fff; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* --- film grain + vignette ------------------------------------------------ */
.grain::before {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 4;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -4%); }
  60% { transform: translate(-2%, -3%); }
  80% { transform: translate(4%, 2%); }
}
.grain::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}

/* --- cinematic intro curtain --------------------------------------------- */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  display: grid;
  place-items: center;
  animation: curtain-out 0.9s var(--ease) 1.15s forwards;
}
.curtain__mark { width: 92px; opacity: 0; animation: mark-in 0.9s var(--ease) 0.1s forwards; }
@keyframes mark-in { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes curtain-out { to { opacity: 0; visibility: hidden; } }

/* --- layout --------------------------------------------------------------- */
.wrap { width: min(1160px, 92vw); margin-inline: auto; }

section { position: relative; padding: clamp(72px, 11vw, 140px) 0; }

.eyebrow {
  font-family: var(--font-display);
  font-size: clamp(0.68rem, 1.4vw, 0.8rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 44px; height: 1px; background: var(--line-strong); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; }

h2 {
  font-size: clamp(1.9rem, 4.6vw, 3.2rem);
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.lede { font-family: var(--font-serif); font-size: clamp(1.12rem, 2vw, 1.35rem); font-style: italic; color: var(--muted); max-width: 56ch; }

.gold-text {
  background: linear-gradient(120deg, #f9e7ab 0%, #e9c05e 40%, #b07c2c 75%, #f6d78a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- header --------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 9, 8, 0.72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom-color: var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ivory); }
.brand:hover { color: var(--gold-bright); }
.brand__mark { width: 42px; height: 42px; }
.brand__name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.nav__links { display: flex; align-items: center; gap: clamp(18px, 3vw, 36px); list-style: none; }
.nav__links a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}
.nav__links a:hover { color: var(--gold-bright); }

/* --- buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 36px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: transform 0.35s var(--ease), box-shadow 0.35s ease, background 0.35s ease, color 0.3s ease;
}
.btn--gold {
  background: linear-gradient(135deg, #f6d78a, #e9c05e 45%, #b07c2c);
  color: #221607;
  border: none;
  box-shadow: 0 12px 34px rgba(233, 192, 94, 0.28);
}
.btn--gold:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(233, 192, 94, 0.4); color: #221607; }
.btn--ghost { background: transparent; color: var(--ivory); }
.btn--ghost:hover { background: rgba(233, 192, 94, 0.08); color: var(--gold-bright); transform: translateY(-3px); }

/* --- hero ------------------------------------------------------------------ */
.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 140px 0 90px;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 46% at 50% 32%, rgba(233, 192, 94, 0.13), transparent 65%),
    radial-gradient(ellipse 40% 30% at 82% 76%, rgba(176, 124, 44, 0.1), transparent 70%),
    radial-gradient(ellipse 36% 26% at 14% 68%, rgba(233, 192, 94, 0.07), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 60%, var(--bg) 100%);
}
#dust { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero .wrap { position: relative; z-index: 2; display: grid; justify-items: center; }

.hero__mark {
  width: clamp(150px, 22vw, 230px);
  margin-bottom: 28px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 24px 60px rgba(233, 192, 94, 0.28));
  transition: transform 0.25s var(--ease), filter 0.3s ease;
  animation: float 7s ease-in-out infinite;
  user-select: none;
  border: none;
  background: none;
  padding: 0;
}
.hero__mark:hover { filter: drop-shadow(0 28px 70px rgba(233, 192, 94, 0.45)); }
.hero__mark.tapped { animation: squish 0.4s var(--ease); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes squish {
  0% { transform: scale(1); }
  35% { transform: scale(0.9, 0.82) rotate(-2deg); }
  70% { transform: scale(1.06, 1.1) rotate(1deg); }
  100% { transform: scale(1); }
}

.hero__eyebrow {
  font-family: var(--font-display);
  font-size: clamp(0.66rem, 1.5vw, 0.82rem);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.6rem, 9vw, 6.4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero__tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  color: var(--muted);
  max-width: 44ch;
  margin-bottom: 42px;
}
.hero__cta { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }

.tap-count {
  margin-top: 34px;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  min-height: 1.4em;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.tap-count.show { opacity: 1; }
.tap-count strong { color: var(--gold-bright); font-weight: 700; }

.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 1px;
  height: 56px;
  background: linear-gradient(180deg, transparent, var(--gold));
  animation: hint 2.2s ease-in-out infinite;
}
@keyframes hint { 0%, 100% { opacity: 0.2; transform: translateX(-50%) scaleY(0.6); } 50% { opacity: 1; transform: translateX(-50%) scaleY(1); } }

/* ripple burst on tap */
.ripple {
  position: fixed;
  z-index: 45;
  width: 14px;
  height: 14px;
  border: 2px solid var(--gold-bright);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: ripple 0.7s var(--ease) forwards;
}
@keyframes ripple { to { width: 130px; height: 130px; opacity: 0; } }

/* --- marquee --------------------------------------------------------------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  overflow: hidden;
  background: rgba(22, 18, 13, 0.5);
}
.marquee__track {
  display: flex;
  gap: 64px;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee span {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 64px;
}
.marquee span::after { content: "✦"; color: var(--gold-deep); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* --- games ----------------------------------------------------------------- */
.games__head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 64px); }

.games__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: clamp(18px, 2.6vw, 30px);
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(165deg, var(--surface-2), var(--surface) 60%);
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.4s ease, box-shadow 0.5s ease;
}
.card:hover {
  transform: translateY(-8px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow), 0 0 0 1px rgba(233, 192, 94, 0.08);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, rgba(233, 192, 94, 0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

.card__art {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(233, 192, 94, 0.028) 14px 15px),
    linear-gradient(160deg, #1b160f, #120e09);
}
.card__numeral {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  font-weight: 700;
  opacity: 0.9;
}
.card__body { padding: 24px 26px 28px; }
.card__title { font-size: 1.05rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.card__desc { font-size: 0.92rem; color: var(--muted); }
.card__tag {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 14px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

/* --- about ------------------------------------------------------------------ */
.about { background: linear-gradient(180deg, var(--bg) 0%, #0e0b08 50%, var(--bg) 100%); }
.about__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(36px, 6vw, 90px);
  align-items: center;
}
.about p { color: var(--muted); margin-bottom: 18px; max-width: 58ch; }
.about p strong { color: var(--ivory); font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.stat { background: var(--surface); padding: clamp(20px, 3vw, 34px) 12px; text-align: center; }
.stat__num { font-family: var(--font-display); font-size: clamp(1.5rem, 3.4vw, 2.3rem); font-weight: 700; }
.stat__label { font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

/* --- footer ----------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: clamp(48px, 7vw, 80px) 0 36px; background: var(--bg-2); }
.footer__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; margin-bottom: 48px; }
.footer__brand { max-width: 320px; }
.footer__brand .brand { margin-bottom: 16px; }
.footer__brand p { font-size: 0.9rem; color: var(--muted); }
.footer__col h3 { font-size: 0.74rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; }
.footer__col ul { list-style: none; display: grid; gap: 10px; }
.footer__col a { color: var(--muted); font-size: 0.9rem; }
.footer__col a:hover { color: var(--gold-bright); }
.footer__bottom {
  border-top: 1px solid var(--line);
  padding-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* --- game cards (linked) ---------------------------------------------------- */
a.card { display: block; color: inherit; }
a.card:hover { color: inherit; }
.card__art { position: relative; overflow: hidden; }
.card__art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
a.card:hover .card__art img { transform: scale(1.05); }
.card__art .card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 9, 8, 0.45);
  opacity: 0;
  transition: opacity 0.4s ease;
}
a.card:hover .card__play { opacity: 1; }
.card__play span {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #221607;
  background: linear-gradient(135deg, #f6d78a, #e9c05e 45%, #b07c2c);
  padding: 12px 26px;
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(233, 192, 94, 0.35);
}
.card__tag--play { background: rgba(233, 192, 94, 0.1); }

/* --- game pages -------------------------------------------------------------- */
.game-page { padding-top: 130px; padding-bottom: clamp(60px, 8vw, 100px); }
.breadcrumbs {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--gold); }
.game-head h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); margin-bottom: 12px; }
.game-head .lede { margin-bottom: clamp(26px, 4vw, 40px); }

.game-stage { display: grid; justify-items: center; }
.game-frame-wrap {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow), 0 0 60px rgba(233, 192, 94, 0.07);
}
.game-frame-wrap.wide { aspect-ratio: 16 / 9; width: min(100%, calc(76vh * 16 / 9)); }
.game-frame-wrap.classic { aspect-ratio: 4 / 3; width: min(100%, calc(76vh * 4 / 3)); }
.game-frame-wrap.portrait { aspect-ratio: 9 / 16; width: min(100%, calc(82vh * 9 / 16)); }
.game-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.game-frame-wrap:fullscreen { aspect-ratio: auto; width: 100%; border-radius: 0; border: none; }

.game-toolbar { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 26px 0 clamp(40px, 7vw, 70px); }
.btn--small { padding: 12px 26px; font-size: 0.72rem; }

.game-article { max-width: 780px; margin-inline: auto; }
.game-article h2 {
  font-size: 1.1rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 38px 0 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.game-article h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.game-article p, .game-article li { color: var(--muted); font-size: 0.98rem; margin-bottom: 12px; }
.game-article ul { padding-left: 22px; }
.game-article li strong { color: var(--ivory); }

.related { margin-top: clamp(60px, 9vw, 100px); }
.related h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 28px; }

/* --- legal pages ------------------------------------------------------------ */
.legal { padding-top: 150px; max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 8px; }
.legal .updated { color: var(--muted); font-size: 0.85rem; margin-bottom: 40px; }
.legal h2 { font-size: 1.25rem; margin: 38px 0 12px; }
.legal p, .legal li { color: var(--muted); font-size: 0.96rem; margin-bottom: 12px; }
.legal ul { padding-left: 22px; }

/* --- reveal animations ------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.12s; }
.reveal[data-delay="2"] { transition-delay: 0.24s; }
.reveal[data-delay="3"] { transition-delay: 0.36s; }
.reveal[data-delay="4"] { transition-delay: 0.48s; }
.reveal[data-delay="5"] { transition-delay: 0.6s; }

/* --- responsive ------------------------------------------------------------- */
@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav__links li.hide-sm { display: none; }
  .brand__name { font-size: 0.8rem; letter-spacing: 0.2em; }
  .brand__mark { width: 36px; height: 36px; }
  .hero { padding-top: 120px; }
  .hero__cta .btn { width: 100%; }
  .footer__grid { flex-direction: column; }
}

/* --- reduced motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .curtain { display: none; }
}
