:root {
  --bg: #0b0718;
  --bg2: #120b26;
  --panel: rgba(24, 14, 52, 0.82);
  --ink: #f4efff;
  --muted: #b9add8;
  --gold: #ffcc2e;
  --orange: #ff8a1e;
  --purple: #db80ff;
  --line: rgba(219, 128, 255, 0.25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}
a { color: var(--gold); }
img { max-width: 100%; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(11,7,24,0.05) 0%, rgba(11,7,24,0.25) 65%, var(--bg) 100%), url(/static/bg.jpg) center 60% / cover no-repeat;
  padding: 5vh 0 80px;
}
.hero-in { position: relative; z-index: 2; }
.hero img.logo {
  width: min(560px, 84vw); height: auto;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,0.65));
  animation: bob 4.5s ease-in-out infinite;
}
.tagline {
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 900;
  margin: 8px 0 26px;
  text-shadow: 0 3px 0 #000, 0 0 18px rgba(0,0,0,0.85);
}
.scroll {
  display: inline-block; margin-top: 34px; color: var(--gold); text-decoration: none; font-size: 22px;
  text-shadow: 0 2px 0 #000; animation: nudge 1.8s ease-in-out infinite;
}
.embers { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.embers i {
  position: absolute; bottom: -10px; width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle, #fff6c9 0%, var(--gold) 40%, rgba(255,138,30,0) 70%);
  box-shadow: 0 0 10px 3px rgba(255,170,40,0.55);
  animation: rise linear infinite;
}

.stores { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.store {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  min-width: 196px; padding: 10px 20px 11px; border-radius: 12px;
  background: #000; border: 1px solid rgba(255,255,255,0.55); color: #fff;
  text-decoration: none; text-align: left; line-height: 1.15;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.store:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 8px 24px rgba(255,204,46,0.25); }
.store small { font-size: 12px; opacity: .85; }
.store b { font-size: 21px; font-weight: 700; letter-spacing: .2px; }
.store.soon { opacity: .6; cursor: default; }
.store.soon:hover { transform: none; border-color: rgba(255,255,255,0.55); box-shadow: none; }

/* ---------- sections ---------- */
section { padding: 72px 0; position: relative; }
section.dark { background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 12%, var(--bg2) 88%, var(--bg) 100%); }
h2 {
  font-size: clamp(26px, 3.8vw, 40px); font-weight: 900; color: var(--gold);
  text-transform: uppercase; letter-spacing: .5px; margin: 0 0 14px; text-shadow: 0 3px 0 #000;
}
.lead { font-size: 19px; color: var(--muted); max-width: 780px; margin: 0 0 28px; }
.frame {
  border-radius: 18px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 6px rgba(219,128,255,0.06);
}
.frame img { display: block; width: 100%; height: auto; transition: transform 6s ease; }
.frame:hover img { transform: scale(1.04); }

/* heroes */
.heroes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: end; }
.hero-card {
  margin: 0; text-align: center; padding: 18px 10px 16px; border-radius: 18px;
  background: radial-gradient(ellipse at 50% 85%, rgba(255,190,60,0.22) 0%, rgba(255,190,60,0) 60%), var(--panel);
  border: 1px solid var(--line);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.hero-card:hover { transform: translateY(-8px); border-color: var(--gold); box-shadow: 0 16px 40px rgba(255,204,46,0.18); }
.hero-card figcaption { margin-top: 10px; }
.hero-card b { display: block; font-size: 20px; text-transform: uppercase; color: var(--purple); letter-spacing: .5px; }
.hero-card span { color: var(--muted); font-size: 15px; }

/* worlds */
.worlds { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.world-view { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,0.55); }
.world-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .8s ease, transform 6s ease; }
.world-view img.active { opacity: 1; transform: scale(1); }
.world-tabs { display: flex; flex-direction: column; gap: 10px; }
.world-tabs button {
  flex: 1; text-align: left; cursor: pointer; font: inherit; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.world-tabs button b { display: block; color: var(--ink); font-size: 18px; text-transform: uppercase; letter-spacing: .4px; }
.world-tabs button:hover { transform: translateX(4px); }
.world-tabs button.active { border-color: var(--gold); background: rgba(60, 34, 110, 0.9); }
.world-tabs button.active b { color: var(--gold); }

/* monsters */
.monsters { display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; gap: 0 10px; }
.monsters .sprite { transition: transform .2s ease; }
.monsters .sprite:hover { transform: scale(1.18); }

/* animated strips: frames side by side (anim_*.png, from the game), one frame a step, in whole pixels, played there and back (no jump from the last frame to the first) */
.sprite { background-repeat: no-repeat; background-position: 0 0; filter: drop-shadow(0 10px 10px rgba(0,0,0,0.45)); }
.hero-anim { width: 220px; height: 220px; margin: 0 auto; background-size: 8800px 220px; animation: hero-strip 3.33s steps(40) infinite alternate; }
.monster-anim { width: 170px; height: 170px; background-size: 4080px 170px; animation: monster-strip 2s steps(24) infinite alternate; }
.hero-card:nth-child(2) .hero-anim { animation-delay: -0.8s; }
.hero-card:nth-child(3) .hero-anim { animation-delay: -1.7s; }
.hero-card:nth-child(4) .hero-anim { animation-delay: -2.5s; }
.monster-anim:nth-child(even) { animation-delay: -1s; }
@keyframes hero-strip { from { background-position: 0 0; } to { background-position: -8800px 0; } }
@keyframes monster-strip { from { background-position: 0 0; } to { background-position: -4080px 0; } }
.a-hero_worker { background-image: url(/static/anim_hero_worker.png); }
.a-hero_fatman { background-image: url(/static/anim_hero_fatman.png); }
.a-hero_girl { background-image: url(/static/anim_hero_girl.png); }
.a-hero_skater { background-image: url(/static/anim_hero_skater.png); }
.a-monster_dragon { background-image: url(/static/anim_monster_dragon.png); }
.a-monster_flyer { background-image: url(/static/anim_monster_flyer.png); }
.a-monster_hornedbeast { background-image: url(/static/anim_monster_hornedbeast.png); }
.a-monster_alienboss { background-image: url(/static/anim_monster_alienboss.png); }
.a-monster_spider { background-image: url(/static/anim_monster_spider.png); }
.a-monster_robot { background-image: url(/static/anim_monster_robot.png); }
.a-monster_pinkworm { background-image: url(/static/anim_monster_pinkworm.png); }
.a-monster_skeleton { background-image: url(/static/anim_monster_skeleton.png); }
.a-monster_smallalien { background-image: url(/static/anim_monster_smallalien.png); }
.a-monster_greenbeetle { background-image: url(/static/anim_monster_greenbeetle.png); }

/* battle modes */
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.mode {
  position: relative; min-height: 260px; border-radius: 18px; overflow: hidden; padding: 18px;
  display: flex; flex-direction: column; justify-content: flex-end;
  border: 1px solid var(--line); background: #000;
  transition: transform .2s ease, border-color .2s ease;
}
.mode::before { content: ""; position: absolute; inset: 0; background: var(--shot) center / cover no-repeat; transition: transform 1.2s ease; }
.mode::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,7,24,0) 25%, rgba(11,7,24,0.92) 100%); }
.mode.dm { --shot: url(/static/mac_Battle_33.jpg); }
.mode.lms { --shot: url(/static/mac_Skater_3.jpg); }
.mode.ctf { --shot: url(/static/mac_Battle_32.jpg); }
.mode.dom { --shot: url(/static/mac_Battle_45.jpg); }
.mode:hover { transform: translateY(-6px); border-color: var(--gold); }
.mode:hover::before { transform: scale(1.1); }
.mode b, .mode span { position: relative; z-index: 1; }
.mode b { font-size: 20px; text-transform: uppercase; color: var(--gold); text-shadow: 0 2px 0 #000; }
.mode span { color: var(--ink); font-size: 15px; }

/* features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; transition: transform .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-4px); border-color: var(--purple); }
.card h3 { margin: 0 0 6px; font-size: 18px; color: var(--purple); text-transform: uppercase; letter-spacing: .4px; }
.card p { margin: 0; color: var(--muted); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery img, .phones img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; transition: transform .2s ease, border-color .2s ease; }
.gallery img:hover, .phones img:hover { transform: scale(1.03); border-color: var(--gold); }
.phones { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.phones img { width: auto; height: 360px; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5, 3, 12, 0.92); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,0.7); animation: pop .25s ease; }

.cta { text-align: center; padding: 90px 0; background: radial-gradient(ellipse at 50% 60%, rgba(255,140,30,0.18) 0%, rgba(255,140,30,0) 60%); }
.cta .lead { margin-left: auto; margin-right: auto; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 15px; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------- pages (support, privacy) ---------- */
.page { padding: 40px 20px 64px; }
.page header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.page header img { width: 56px; height: 56px; border-radius: 13px; }
.page header a { color: var(--ink); text-decoration: none; font-weight: 800; font-size: 20px; }
.page h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; color: var(--gold); text-shadow: 0 3px 0 #000; }
.page h2 { font-size: 22px; margin-top: 34px; }
.page p, .page li { color: var(--muted); }
.page .mail { font-size: 22px; font-weight: 800; }
.faq dt { font-weight: 800; color: var(--ink); margin-top: 18px; }
.faq dd { margin: 4px 0 0; color: var(--muted); }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.shown { opacity: 1; transform: none; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-0.6deg); } 50% { transform: translateY(-10px) rotate(0.6deg); } }
@keyframes nudge { 0%, 100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(7px); opacity: 1; } }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(0.985, 1.025); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes rise {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(var(--drift, 30px), -95vh) scale(0.4); opacity: 0; }
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (max-width: 900px) {
  .heroes { grid-template-columns: repeat(2, 1fr); }
  .worlds { grid-template-columns: 1fr; }
  .world-tabs { flex-direction: row; flex-wrap: wrap; }
  .world-tabs button { flex: 1 1 45%; }
  .modes { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .phones img { height: 260px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  section { padding: 54px 0; }
  .hero { min-height: 78vh; }
  .hero-anim { zoom: 0.72; }
  .monster-anim { zoom: 0.7; }
  .modes { grid-template-columns: 1fr; }
  .mode { min-height: 200px; }
  .world-tabs button span { display: none; }
}
