/* Pixel Towers Smash – game page
   Colours are taken from the game: night-city navy, hazard red, and the power-up accents. */

:root {
  --bg: #151a2b;
  --bg-alt: #1c2238;
  --surface: #242b45;
  --surface-2: #2e3654;
  --line: #3a4364;
  --ink: #0b0d16;
  --text: #e9ecf5;
  --muted: #a7aec6;

  --red: #e0262f;
  --orange: #ff7a1a;
  --yellow: #ffd23f;
  --blue: #4fb6ff;
  --purple: #c46bff;
  --green: #4caf50;

  --pixel: "Press Start 2P", ui-monospace, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 6px;
  --gutter: 16px;
  --max: 1120px;
}

/* ---------- base ---------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--blue); }

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

button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 8px; top: -60px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border: 0;
  border-radius: 4px;
  background: var(--orange);
  color: var(--ink);
  font: 400 0.75rem/1 var(--pixel);
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.3), 0 4px 0 var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.3), 0 6px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3), 0 1px 0 var(--ink); }

.btn--ghost {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--ink);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--muted), 0 6px 0 var(--ink); }

.btn--small { padding: 10px 16px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--muted); }

.play-badge { display: inline-block; transition: transform 0.15s; }
.play-badge:hover { transform: scale(1.04); }
.play-badge img { width: 216px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(21, 26, 43, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.brand__home { width: 20px; height: 20px; fill: currentColor; }
.brand:hover { color: var(--orange); }

.socials { display: flex; gap: 6px; }
.socials a {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--text);
  transition: background 0.15s, transform 0.15s;
}
.socials a:hover { background: var(--surface-2); transform: scale(1.12); }
.socials img { width: 20px; height: 20px; filter: invert(1); }
.socials svg { width: 20px; height: 20px; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 72px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 45%, rgba(255, 122, 26, 0.18), transparent 70%),
    linear-gradient(180deg, #10142200 0%, #1d2440 100%),
    var(--bg);
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero__icon {
  width: 112px;
  border-radius: 22px;
  box-shadow: 0 0 0 3px var(--ink), 0 12px 32px rgba(0, 0, 0, 0.45);
  image-rendering: pixelated;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--pixel);
  font-weight: 400;
  text-transform: uppercase;
}
.logo__top {
  font-size: clamp(1.25rem, 3.6vw, 2.25rem);
  color: var(--text);
  text-shadow: 3px 3px 0 var(--ink);
}
.logo__bottom {
  font-size: clamp(2.5rem, 8vw, 4.75rem);
  color: var(--orange);
  text-shadow: 4px 4px 0 #8c1c1c, 8px 8px 0 var(--ink);
}

.hero__tagline {
  margin: 28px 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
}

.hero__lead {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.hero__phone { display: flex; justify-content: center; }

.phone {
  position: relative;
  width: min(320px, 78vw);
  aspect-ratio: 9 / 16;
  border: 10px solid #0d1020;
  border-radius: 34px;
  background: #000;
  overflow: hidden;
  box-shadow:
    0 0 0 2px #3a4364,
    0 30px 60px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(255, 122, 26, 0.18);
  transform: rotate(2deg);
}
.phone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.phone img.is-active { opacity: 1; }

/* falling pixel cubes behind the hero */
.hero__cubes span {
  position: absolute;
  top: -60px;
  width: 22px; height: 22px;
  background: #3b4260;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.35), inset 3px 3px 0 rgba(255, 255, 255, 0.08);
  opacity: 0.55;
  animation: fall 14s linear infinite;
}
.hero__cubes span:nth-child(1)  { left: 4%;  animation-delay: 0s;   animation-duration: 15s; }
.hero__cubes span:nth-child(2)  { left: 12%; animation-delay: -6s;  width: 14px; height: 14px; }
.hero__cubes span:nth-child(3)  { left: 21%; animation-delay: -10s; animation-duration: 18s; }
.hero__cubes span:nth-child(4)  { left: 33%; animation-delay: -3s;  width: 16px; height: 16px; background: #23408c; }
.hero__cubes span:nth-child(5)  { left: 45%; animation-delay: -12s; animation-duration: 20s; }
.hero__cubes span:nth-child(6)  { left: 53%; animation-delay: -1s;  width: 12px; height: 12px; }
.hero__cubes span:nth-child(7)  { left: 62%; animation-delay: -8s;  background: #8a6a12; width: 16px; height: 16px; }
.hero__cubes span:nth-child(8)  { left: 71%; animation-delay: -4s;  animation-duration: 17s; }
.hero__cubes span:nth-child(9)  { left: 79%; animation-delay: -11s; width: 14px; height: 14px; }
.hero__cubes span:nth-child(10) { left: 86%; animation-delay: -7s;  animation-duration: 19s; background: #6b1f25; }
.hero__cubes span:nth-child(11) { left: 93%; animation-delay: -2s;  width: 12px; height: 12px; }
.hero__cubes span:nth-child(12) { left: 98%; animation-delay: -9s; }

@keyframes fall {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(900px) rotate(360deg); }
}

/* ---------- hazard stripe ---------- */

.hazard {
  height: 14px;
  background: repeating-linear-gradient(135deg, var(--red) 0 14px, #1a0f12 14px 28px);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.25);
}
.hazard--thin { height: 8px; }

/* ---------- sections ---------- */

.section { padding: 80px 0; }
.section--alt { background: var(--bg-alt); }

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section__title {
  font: 400 clamp(1.1rem, 2.6vw, 1.5rem)/1.4 var(--pixel);
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--ink);
}

.section__lead {
  max-width: 40rem;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

/* how to play */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.step {
  padding: 28px 24px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.step h3 { margin: 20px 0 6px; font-size: 1.15rem; }
.step p { margin: 0; color: var(--muted); }

.keys { display: flex; gap: 10px; }

.key {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 8px;
  background: #b9bdc9;
  color: #1a1c24;
  font: 400 1.15rem/1 var(--pixel);
  box-shadow:
    inset 0 0 0 3px #5d6170,
    inset -4px -5px 0 #8b8f9c,
    0 4px 0 var(--ink);
}
.key--round { border-radius: 50%; }
.key--arrow svg { width: 30px; height: 25px; fill: #1a1c24; }

/* power-ups */

.powerups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.power {
  --accent: var(--orange);
  display: flex;
  flex-direction: column;
  border: 2px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.power:hover { transform: translateY(-4px); border-color: var(--accent); }

.power img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: 50% 62%;
}

.power__body { padding: 18px 20px 22px; }
.power h3 {
  color: var(--accent);
  font: 400 0.85rem/1.4 var(--pixel);
  text-transform: uppercase;
}
.power p { margin: 10px 0 0; color: var(--muted); font-size: 0.95rem; }

.power--slowmo   { --accent: var(--blue); }
.power--piercing { --accent: var(--purple); }
.power--rapid    { --accent: var(--yellow); }

/* special cubes */

.cubes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.cube {
  --accent: var(--muted);
  padding: 24px 22px 26px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.2s, border-color 0.2s;
}
.cube:hover { transform: translateY(-4px); border-color: var(--accent); }

.cube img {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  image-rendering: pixelated;
  box-shadow: 0 4px 0 var(--ink), 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent);
}

.cube h3 {
  margin-top: 20px;
  color: var(--accent);
  font: 400 0.85rem/1.4 var(--pixel);
  text-transform: uppercase;
}
.cube p { margin: 10px 0 0; color: var(--muted); font-size: 0.95rem; }

.cube--gold     { --accent: var(--yellow); }
.cube--armoured { --accent: #b9c2d8; }
.cube--ice      { --accent: var(--blue); }
.cube--bomb     { --accent: var(--red); }

/* screenshots */

.scroller-nav { display: flex; gap: 8px; }

.shots {
  display: flex;
  gap: 18px;
  margin: 32px 0 0;
  padding: 4px max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))) 16px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.shots li { flex: 0 0 auto; scroll-snap-align: start; }
.shots button {
  display: block;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #000;
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.2s, border-color 0.2s;
}
.shots button:hover { transform: translateY(-4px); border-color: var(--orange); }
.shots img { width: 230px; aspect-ratio: 9 / 16; object-fit: cover; }

/* video */

.video {
  position: relative;
  margin-top: 32px;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Vertical video (YouTube Short): a phone-shaped frame instead of 16:9 */
.video--short { aspect-ratio: 9 / 16; width: min(380px, 100%); margin-inline: auto; }

.video__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.video__poster img { width: 100%; height: 100%; object-fit: cover; }

.video__play {
  position: absolute;
  left: 50%; top: 50%;
  width: 88px; height: 88px;
  margin: -44px 0 0 -44px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px var(--ink), 0 6px 0 4px var(--ink), 0 0 40px rgba(224, 38, 47, 0.5);
  transition: transform 0.15s;
}
.video__play::after {
  content: "";
  position: absolute;
  left: 34px; top: 26px;
  border-style: solid;
  border-width: 18px 0 18px 28px;
  border-color: transparent transparent transparent #fff;
}
.video__poster:hover .video__play { transform: scale(1.08); }

.video__label {
  position: absolute;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(11, 13, 22, 0.75);
  font: 400 0.65rem/1.4 var(--pixel);
  text-transform: uppercase;
  white-space: nowrap;
}

/* closing */

.cta {
  text-align: center;
  background:
    radial-gradient(ellipse 50% 70% at 50% 100%, rgba(255, 122, 26, 0.16), transparent 70%),
    var(--bg);
}
.cta__inner { display: flex; flex-direction: column; align-items: center; }
.cta__inner > img { width: 96px; border-radius: 20px; image-rendering: pixelated; box-shadow: 0 0 0 3px var(--ink); }
.cta__title {
  margin-top: 24px;
  font: 400 clamp(1.1rem, 3vw, 1.75rem)/1.4 var(--pixel);
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--ink);
}
.cta p { margin: 12px 0 20px; color: var(--muted); }

/* ---------- footer ---------- */

.footer { padding: 28px 0; background: #0f1320; color: var(--muted); font-size: 0.9rem; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer p { margin: 0; }
.footer__links { display: flex; gap: 20px; }
.footer__links a { color: var(--muted); }
.footer__links a:hover { color: var(--text); }

/* ---------- cookie notice ---------- */

.cookie {
  position: fixed;
  left: 16px; bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 460px;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-top: 4px solid var(--orange);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0; color: var(--muted); }

/* ---------- lightbox ---------- */

.lightbox {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.lightbox::backdrop { background: rgba(8, 10, 18, 0.92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img {
  max-width: min(92vw, 520px);
  max-height: 88vh;
  width: auto;
  border-radius: 14px;
  box-shadow: 0 0 0 2px var(--line);
}
.lightbox .icon-btn { position: fixed; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 16px; top: 50%; margin-top: -22px; }
.lightbox__next { right: 16px; top: 50%; margin-top: -22px; }

/* ---------- back to top ---------- */

.to-top {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .cubes { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .hero { padding: 40px 0 56px; }
  .hero__inner { grid-template-columns: 1fr; gap: 48px; text-align: center; }
  .hero__icon { margin-left: auto; margin-right: auto; }
  .logo { align-items: center; }
  .hero__lead { margin: 0 auto; }
  .hero__actions { justify-content: center; }
  .phone { transform: none; }

  .steps { grid-template-columns: 1fr; }
  .powerups { grid-template-columns: 1fr; max-width: 460px; margin-left: auto; margin-right: auto; }
  .section { padding: 60px 0; }
}

@media (max-width: 520px) {
  .cubes { grid-template-columns: 1fr; gap: 14px; }
  .cube { display: flex; gap: 18px; align-items: center; padding: 18px; }
  .cube img { flex: none; width: 60px; height: 60px; }
  .cube h3 { margin-top: 0; }
  .cube p { margin-top: 6px; }
  .shots img { width: 64vw; }
  .scroller-nav { display: none; }
  .cookie { right: 16px; flex-direction: column; align-items: stretch; }
  .cookie .btn { justify-content: center; }
  .video__play { width: 68px; height: 68px; margin: -34px 0 0 -34px; }
  .video__play::after { left: 26px; top: 19px; border-width: 15px 0 15px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__cubes { display: none; }
  .phone img { transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
