:root {
  --oxblood: #890000;
  --mahogany: #A52A2A;
  --garnet: #640000;
  --rosewood: #CD5C5C;
  --cream: #FBF4F1;
  --ink: #2a0606;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --pixel: 'Press Start 2P', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: 'Playfair Display', serif; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
figure { margin: 0; }
button { font-family: inherit; }
body.lock { overflow: hidden; }

.loader {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; gap: 26px; align-items: center; justify-content: center;
  background: var(--garnet); color: var(--cream);
  animation: loaderOut .7s ease 2.1s forwards;
}
.loader p { font-family: var(--pixel); font-size: .7rem; letter-spacing: .1em; animation: blink 1s steps(2) infinite; }
.loader-ball {
  position: relative; width: 84px; height: 84px; border-radius: 50%;
  background: linear-gradient(to bottom, var(--rosewood) 0 46%, var(--ink) 46% 54%, var(--cream) 54% 100%);
  border: 5px solid var(--ink); animation: ballRoll 1.2s ease-in-out infinite;
}
.loader-ball::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%);
  background: var(--cream); border: 5px solid var(--ink); border-radius: 50%;
}

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; }

.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60;
  background: linear-gradient(90deg, var(--rosewood), var(--cream));
}

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 5vw; color: var(--cream);
  transition: background .4s var(--ease), padding .4s var(--ease), box-shadow .4s var(--ease);
}
.nav.scrolled { background: rgba(100, 0, 0, .94); backdrop-filter: blur(8px); padding: 12px 5vw; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.nav-brand { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.15rem; display: flex; gap: 8px; align-items: center; }
.nav-brand i { color: var(--rosewood); font-size: .8rem; }
.nav-links { display: flex; gap: 22px; font-size: .86rem; font-weight: 500; }
.nav-links a { position: relative; opacity: .85; transition: opacity .3s; }
.nav-links a::after { content: ''; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0; background: var(--rosewood); transition: width .35s var(--ease); }
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { width: 100%; }
.nav-toggle { display: none; background: none; border: 0; color: var(--cream); font-size: 1.8rem; cursor: pointer; }

.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: 130px 6vw 90px; color: var(--cream); overflow: hidden;
  background: linear-gradient(160deg, var(--garnet) 0%, var(--oxblood) 60%, var(--mahogany) 100%);
}
.hero-glow {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(205, 92, 92, .35), transparent 65%);
  top: -20vmax; right: -15vmax; animation: drift 12s ease-in-out infinite alternate;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 50px; align-items: center; position: relative; width: 100%; }
.hero h1 { font-size: clamp(2.6rem, 6.6vw, 5.2rem); font-weight: 800; }
.hero h1 span { color: var(--rosewood); }
.hero-sub { font-size: 1.15rem; opacity: .85; margin: 16px 0 34px; }
.eyebrow { text-transform: uppercase; letter-spacing: .28em; font-size: .78rem; font-weight: 600; color: var(--rosewood); margin-bottom: 18px; }
.eyebrow.dark { color: var(--mahogany); }

.countdown { display: flex; gap: 14px; flex-wrap: wrap; }
.cd-box {
  min-width: 88px; padding: 16px 12px; border-radius: 14px; text-align: center;
  background: rgba(251, 244, 241, .08); border: 1px solid rgba(251, 244, 241, .18);
  backdrop-filter: blur(6px);
}
.cd-box strong { display: block; font-family: 'Playfair Display', serif; font-size: 2.1rem; }
.cd-box span { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; opacity: .75; }
.celebrate { display: none; font-family: 'Playfair Display', serif; font-size: 1.8rem; }
.hero.is-birthday .countdown { display: none; }
.hero.is-birthday .celebrate { display: block; animation: pop .8s var(--ease); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }

.hero-visual { position: relative; display: grid; place-items: center; }
.float-badge {
  position: absolute; width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem;
  background: var(--cream); color: var(--oxblood); box-shadow: 0 14px 30px rgba(0,0,0,.3);
  animation: float 5s ease-in-out infinite;
}
.fb1 { top: 6%; left: 2%; }
.fb2 { top: 46%; left: -4%; animation-delay: -1.5s; }
.fb3 { bottom: 10%; left: 4%; animation-delay: -3s; }
.pokeball {
  position: absolute; right: 8%; top: -3%; width: 70px; height: 70px; border-radius: 50%;
  background: linear-gradient(to bottom, var(--rosewood) 0 46%, var(--garnet) 46% 54%, var(--cream) 54% 100%);
  border: 4px solid var(--garnet); box-shadow: 0 12px 30px rgba(0,0,0,.3);
  animation: float 6s ease-in-out infinite;
}
.pokeball::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%);
  background: var(--cream); border: 4px solid var(--garnet); border-radius: 50%;
}
.scroll-cue { position: absolute; bottom: 24px; left: 50%; margin-left: -12px; font-size: 1.4rem; animation: bob 1.8s ease-in-out infinite; opacity: .8; color: var(--cream); }

.sprite { position: relative; cursor: pointer; user-select: none; }
.sprite svg { display: block; width: 100%; height: auto; image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.22)); }
.sprite.idle svg { animation: idle 1.1s steps(2) infinite; }
.sprite .fl { animation: flick .45s steps(2) infinite alternate; }
.hero-mon { position: absolute; right: -4%; bottom: -3%; width: 150px; z-index: 3; }
.ember {
  position: absolute; width: 7px; height: 7px; background: #f8d030; box-shadow: 0 0 8px #e02818; pointer-events: none; z-index: 5;
  animation: ember 1s ease-out forwards;
}

.frame { position: relative; overflow: hidden; background: rgba(137, 0, 0, .08); }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.frame:hover img { transform: scale(1.06); }
.ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed rgba(205, 92, 92, .7); border-radius: inherit; color: var(--rosewood); text-align: center; padding: 10px;
  background: repeating-linear-gradient(45deg, rgba(205, 92, 92, .06) 0 12px, transparent 12px 24px);
}
.ph i { font-size: 2rem; }
.ph span { font-weight: 600; font-size: .9rem; }
.ph small { font-size: .72rem; opacity: .7; }
.frame img ~ .ph, .frame:has(img) .ph { display: none; }

.arch { width: min(360px, 78vw); aspect-ratio: 3 / 4; border-radius: 200px 200px 24px 24px; border: 6px solid rgba(251, 244, 241, .85); box-shadow: 0 34px 60px rgba(0,0,0,.4); }
.arch .ph { color: var(--cream); border-color: rgba(251, 244, 241, .5); }

.marquee { overflow: hidden; background: var(--garnet); color: var(--cream); padding: 16px 0; border-top: 1px solid rgba(251,244,241,.12); }
.marquee-track { display: flex; align-items: center; gap: 28px; width: max-content; animation: marquee 30s linear infinite; font-family: 'Playfair Display', serif; font-size: 1.3rem; }
.marquee-track i { color: var(--rosewood); font-size: .6rem; }
.marquee.big { background: var(--oxblood); padding: 26px 0; }
.marquee.big .marquee-track { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 800; gap: 36px; animation-direction: reverse; animation-duration: 38s; }
.marquee.big .marquee-track i { font-size: 1.2rem; }

.stats { background: var(--cream); padding: 70px 6vw 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat-box { text-align: center; padding: 26px 10px; border-radius: 18px; background: #fff; border: 1px solid rgba(137, 0, 0, .1); box-shadow: 0 10px 30px rgba(100, 0, 0, .06); }
.stat-box strong { font-family: 'Playfair Display', serif; font-size: 2.6rem; color: var(--oxblood); }
.stat-box p { font-size: .85rem; opacity: .75; letter-spacing: .05em; }

.section { padding: 110px 6vw; position: relative; }
.section.dark { background: var(--garnet); color: var(--cream); }
.section.tint { background: #f5e6e1; }
.container { max-width: 1080px; margin: 0 auto; position: relative; }
.container.center { text-align: center; }
.container.narrow { max-width: 680px; }
.container.narrow-2 { max-width: 760px; }
.section h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); margin-bottom: 26px; }
.lead { font-size: 1.1rem; opacity: .88; max-width: 520px; margin-bottom: 28px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; margin-top: 44px; }
.card {
  background: #fff; padding: 34px 28px; border-radius: 18px;
  border: 1px solid rgba(137, 0, 0, .1); box-shadow: 0 10px 30px rgba(100, 0, 0, .06);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(-8px); box-shadow: 0 22px 44px rgba(100, 0, 0, .14); border-color: var(--rosewood); }
.card i { font-size: 1.7rem; color: var(--oxblood); display: inline-block; margin-bottom: 16px; transition: transform .4s var(--ease); }
.card:hover i { transform: scale(1.2) rotate(-6deg); }
.card h3 { font-size: 1.35rem; margin-bottom: 10px; }
.card p { font-size: .96rem; opacity: .85; }

.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips li {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-size: .9rem; font-weight: 500;
  background: rgba(251, 244, 241, .08); border: 1px solid rgba(251, 244, 241, .2);
  transition: background .3s, transform .3s var(--ease);
}
.chips li:hover { background: var(--oxblood); transform: translateY(-3px); }
.chips i { color: var(--rosewood); }

.trainer-card {
  background: linear-gradient(155deg, var(--cream), #f0dcd6); color: var(--ink);
  border-radius: 22px; padding: 26px; border: 6px solid var(--rosewood);
  box-shadow: 0 30px 60px rgba(0,0,0,.35); transform-style: preserve-3d;
  transition: transform .25s ease-out;
}
.tc-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.tc-name { font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 800; color: var(--oxblood); }
.tc-hp b { color: var(--mahogany); font-size: 1.2rem; }
.tc-art { height: 180px; border-radius: 14px; margin-bottom: 14px; background: radial-gradient(circle at 30% 20%, rgba(205,92,92,.25), rgba(137,0,0,.15)); }
.tc-type { font-size: .82rem; font-weight: 600; color: var(--mahogany); margin-bottom: 16px; letter-spacing: .04em; }
.stat { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 12px; margin-bottom: 10px; font-size: .85rem; font-weight: 500; }
.bar { height: 9px; border-radius: 99px; background: rgba(100, 0, 0, .12); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--mahogany), var(--oxblood)); transition: width 1.4s var(--ease); }
.tc-move { margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(100, 0, 0, .3); font-size: .85rem; }

.ach { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 44px; }
.ach-card {
  display: flex; gap: 16px; align-items: flex-start; background: #fff; padding: 24px 22px; border-radius: 18px;
  border: 1px solid rgba(137, 0, 0, .1); box-shadow: 0 10px 30px rgba(100, 0, 0, .06);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.ach-card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(100, 0, 0, .14); }
.ach-ico {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; color: var(--cream);
  background: linear-gradient(145deg, var(--mahogany), var(--oxblood)); transition: transform .4s var(--ease);
}
.ach-card:hover .ach-ico { transform: rotate(-10deg) scale(1.1); }
.ach-card h3 { font-size: 1.1rem; margin-bottom: 2px; }
.ach-card p { font-size: .88rem; opacity: .75; }
.pill { display: inline-block; margin-top: 10px; padding: 5px 8px; border-radius: 6px; font-family: var(--pixel); font-size: .5rem; background: var(--garnet); color: var(--cream); }

.quote-band {
  position: relative; padding: 110px 6vw; text-align: center; color: var(--cream); overflow: hidden;
  background: linear-gradient(135deg, var(--oxblood), var(--garnet));
}
.quote-band::before {
  content: ''; position: absolute; width: 50vmax; height: 50vmax; border-radius: 50%; left: -15vmax; bottom: -30vmax;
  background: radial-gradient(circle, rgba(205, 92, 92, .3), transparent 65%);
}
.qi { font-size: 3rem; color: var(--rosewood); opacity: .7; position: relative; }
.quote-band blockquote { position: relative; font-family: 'Playfair Display', serif; font-size: clamp(1.5rem, 3.8vw, 2.6rem); max-width: 820px; margin: 0 auto; line-height: 1.35; }
.quote-band cite { position: relative; display: block; margin-top: 24px; font-style: normal; font-size: .78rem; letter-spacing: .25em; text-transform: uppercase; color: var(--rosewood); }

.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 44px; }
.mon {
  background: #fff; border-radius: 20px; padding: 16px 16px 22px; text-align: center;
  border: 1px solid rgba(137, 0, 0, .1); box-shadow: 0 10px 30px rgba(100, 0, 0, .06);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.mon:hover { transform: translateY(-8px) rotate(-1deg); box-shadow: 0 22px 44px rgba(100, 0, 0, .16); }
.frame.sq { aspect-ratio: 1 / 1; border-radius: 14px; margin-bottom: 16px; }
.frame.sq .sprite { position: absolute; inset: 10%; }
.mon h3 { font-size: 1.2rem; margin-bottom: 8px; }
.tag { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; background: var(--oxblood); color: var(--cream); }

.mathlab { overflow: hidden; }
.sym { position: absolute; font-family: 'Playfair Display', serif; font-size: 4.5rem; color: rgba(205, 92, 92, .16); pointer-events: none; animation: float 9s ease-in-out infinite; }
.sym:nth-child(1) { left: 5%; top: 10%; }
.sym:nth-child(2) { right: 8%; top: 14%; animation-delay: -2s; }
.sym:nth-child(3) { left: 12%; bottom: 12%; animation-delay: -4s; }
.sym:nth-child(4) { right: 14%; bottom: 16%; animation-delay: -6s; }
.sym:nth-child(5) { left: 46%; top: 6%; animation-delay: -3s; }
.sym:nth-child(6) { left: 52%; bottom: 6%; animation-delay: -5s; }
.formulas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 44px; }
.formula {
  padding: 36px 24px; border-radius: 18px; text-align: center; background: rgba(251, 244, 241, .06); border: 1px solid rgba(251, 244, 241, .16);
  transition: background .4s, transform .45s var(--ease), border-color .4s;
}
.formula:hover { background: var(--oxblood); transform: translateY(-8px); border-color: var(--rosewood); }
.eqn { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 700; margin-bottom: 14px; }
.formula p:last-child { font-size: .92rem; opacity: .82; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 16px; margin-top: 44px; }
.frame.g { border-radius: 18px; }
.frame.g.wide { grid-column: span 2; }
.frame.g.tall { grid-row: span 2; }
.frame.g figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 14px; font-size: .85rem; color: var(--cream);
  background: linear-gradient(to top, rgba(42, 6, 6, .85), transparent);
  transform: translateY(100%); transition: transform .5s var(--ease); z-index: 2;
}
.frame.g:hover figcaption { transform: translateY(0); }

.section.arcade {
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(251, 244, 241, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(251, 244, 241, .035) 1px, transparent 1px);
  background-size: 32px 32px;
}
.arcade h2 { font-family: var(--pixel); font-size: clamp(1.1rem, 3vw, 1.9rem); line-height: 1.6; }

.album-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.album-count { display: flex; align-items: center; gap: 10px; font-family: var(--pixel); font-size: .68rem; color: var(--rosewood); }
.album-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.album-hint {
  margin-top: 20px; padding: 12px 16px; border: 2px dashed rgba(205, 92, 92, .6); font-size: .86rem; opacity: .85;
}
.album-hint[hidden] { display: none; }
.album-hint code { padding: 2px 6px; border-radius: 4px; background: rgba(251, 244, 241, .12); font-family: ui-monospace, monospace; font-size: .82rem; }

.album { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; margin-top: 30px; padding: 6px; }
.a-tile {
  --bd: var(--rosewood);
  position: relative; aspect-ratio: 1 / 1; padding: 0; border: 0; cursor: pointer; background: var(--garnet);
  box-shadow: 0 -4px 0 0 var(--bd), 0 4px 0 0 var(--bd), -4px 0 0 0 var(--bd), 4px 0 0 0 var(--bd);
  transition: transform .2s steps(3), box-shadow .2s;
}
.a-tile:hover, .a-tile:focus-visible { --bd: var(--cream); transform: translateY(-6px); z-index: 2; outline: none; }
.a-tile canvas { display: block; width: 100%; height: 100%; }
.a-tile::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; transition: opacity .3s;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .2) 0 2px, transparent 2px 4px);
}
.a-tile:hover::after, .a-tile:focus-visible::after { opacity: 0; }
.a-num {
  position: absolute; left: 6px; top: 6px; z-index: 2; padding: 4px 5px;
  font-family: var(--pixel); font-size: .48rem; background: var(--ink); color: var(--cream);
}
.album.visible .a-tile { animation: tilePop .5s steps(5) backwards; animation-delay: var(--d); }
.album.visible .a-tile.pop { animation: tileShuffle .4s steps(4); }

.lightbox {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 24px;
  background: rgba(20, 2, 2, .94); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-fig { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: calc(100vw - 190px); }
.lb-fig canvas {
  max-width: 100%; max-height: 70vh; width: auto; height: auto; background: var(--garnet);
  border: 6px solid var(--cream); box-shadow: 0 0 0 6px var(--oxblood), 0 30px 60px rgba(0, 0, 0, .6);
}
.lb-fig figcaption {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px;
  font-family: var(--pixel); font-size: .6rem; line-height: 1.8; color: var(--cream); text-align: center;
}
.lb-count { padding: 6px 8px; background: var(--oxblood); }
.lb-nav, .lb-close {
  flex: 0 0 auto; width: 50px; height: 50px; display: grid; place-items: center; cursor: pointer;
  border: 3px solid var(--cream); background: var(--garnet); color: var(--cream); font-size: 1.3rem;
  transition: background .2s, transform .2s steps(2);
}
.lb-nav:hover, .lb-close:hover { background: var(--oxblood); transform: scale(1.1); }
.lb-close { position: absolute; top: 20px; right: 20px; }

.battle {
  max-width: 760px; margin: 44px auto 0; border-radius: 18px; overflow: hidden; background: var(--cream); color: var(--ink); text-align: left;
  border: 6px solid var(--ink); box-shadow: 0 0 0 6px var(--oxblood), 0 34px 60px rgba(0,0,0,.4);
}
.b-screen { position: relative; height: 340px; background: linear-gradient(to bottom, #fbe9e4 0 56%, #e0b3aa 56% 100%); overflow: hidden; }
.hp-box { position: absolute; width: 235px; padding: 10px 12px; background: var(--cream); border: 3px solid var(--ink); border-radius: 8px; font-family: var(--pixel); font-size: .55rem; z-index: 4; }
.hp-box.foe { top: 18px; left: 18px; }
.hp-box.you { bottom: 16px; right: 16px; }
.hp-row { display: flex; justify-content: space-between; }
.hp { height: 10px; margin-top: 8px; border: 2px solid var(--ink); background: #fff; }
.hp i { display: block; height: 100%; width: 100%; background: #3ecf5a; transition: width .6s var(--ease), background .3s; }
.hp-num { margin-top: 8px; text-align: right; }
.foe-art { position: absolute; top: 34px; right: 70px; font-size: 5.4rem; color: var(--oxblood); animation: float 3.5s ease-in-out infinite; }
.foe-art.hit { animation: hit .5s steps(4); }
.b-mon { position: absolute; left: 40px; bottom: 6px; width: 210px; z-index: 3; }
.b-mon.attack svg { animation: lunge .6s steps(6); }
.b-text {
  min-height: 96px; padding: 20px 22px; background: var(--ink); color: var(--cream); border-top: 4px solid var(--oxblood);
  font-family: var(--pixel); font-size: .68rem; line-height: 1.9;
}
.b-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 14px; background: var(--cream); border-top: 4px solid var(--ink); }
.b-menu button {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 10px; border: 3px solid var(--ink); border-radius: 8px; cursor: pointer;
  background: #fff; color: var(--ink); font-family: var(--pixel); font-size: .62rem; transition: background .2s, color .2s, transform .2s var(--ease);
}
.b-menu button:hover:not(:disabled) { background: var(--oxblood); color: var(--cream); transform: translateY(-3px); }
.b-menu button:disabled { opacity: .45; cursor: not-allowed; }
.b-menu button.restart { grid-column: 1 / -1; background: var(--oxblood); color: var(--cream); }
.b-menu button[hidden] { display: none; }

.timeline { position: relative; margin-top: 44px; padding-left: 34px; }
.timeline::before { content: ''; position: absolute; left: 22px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(to bottom, var(--rosewood), rgba(205,92,92,.15)); }
.tl-item { position: relative; display: flex; gap: 22px; margin-bottom: 34px; }
.tl-dot {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin-left: -34px;
  background: var(--oxblood); color: var(--cream); box-shadow: 0 0 0 6px var(--cream), 0 10px 20px rgba(100,0,0,.25);
  transition: transform .4s var(--ease);
}
.tl-item:hover .tl-dot { transform: scale(1.12) rotate(-8deg); }
.tl-item h3 { font-size: 1.3rem; margin-bottom: 4px; }
.tl-item p { opacity: .8; font-size: .96rem; }

.eq { display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 150px; margin: 36px 0 30px; }
.eq span {
  width: 10px; height: 100%; border-radius: 6px; transform-origin: bottom; transform: scaleY(.15);
  background: linear-gradient(to top, var(--oxblood), var(--rosewood));
  animation: eq 1.2s ease-in-out infinite alternate;
}
.eq.boost span { animation-duration: .35s; }

.floor {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; max-width: 640px; margin: 0 auto; padding: 14px;
  background: rgba(0, 0, 0, .28); border-radius: 16px; border: 1px solid rgba(251, 244, 241, .12);
}
.floor span { aspect-ratio: 1 / 1; border-radius: 6px; background: rgba(251, 244, 241, .07); transition: background .35s, box-shadow .35s, transform .35s var(--ease); }
.floor span:hover { transform: scale(1.12); background: var(--rosewood); }
.floor span.c0 { background: #890000; box-shadow: 0 0 14px #890000; }
.floor span.c1 { background: #A52A2A; box-shadow: 0 0 14px #A52A2A; }
.floor span.c2 { background: #CD5C5C; box-shadow: 0 0 14px #CD5C5C; }
.floor span.c3 { background: #FBF4F1; box-shadow: 0 0 14px #FBF4F1; }
.floor span.c4 { background: #e8a29a; box-shadow: 0 0 14px #e8a29a; }
.floor-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

.cake-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; margin-top: 40px; }
.cake { display: flex; flex-direction: column; align-items: center; }
.candles { display: flex; gap: 22px; margin-bottom: -2px; }
.candle { position: relative; display: flex; flex-direction: column; align-items: center; background: none; border: 0; cursor: pointer; padding: 6px 4px 0; }
.stick { width: 9px; height: 38px; border-radius: 3px; background: repeating-linear-gradient(135deg, var(--cream) 0 6px, var(--rosewood) 6px 12px); }
.flame {
  width: 13px; height: 20px; margin-bottom: 2px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 70%, #fff3b0, #f8d030 45%, #e02818 100%);
  box-shadow: 0 0 18px 4px rgba(248, 208, 48, .55);
  transform-origin: bottom; animation: candle .6s ease-in-out infinite alternate; transition: opacity .35s, transform .35s;
}
.candle.out .flame { opacity: 0; transform: scale(0); animation: none; }
.tier { border-radius: 12px 12px 6px 6px; border-top: 12px solid var(--cream); }
.t1 { width: 130px; height: 50px; background: var(--rosewood); }
.t2 { width: 200px; height: 58px; background: var(--mahogany); margin-top: -2px; }
.t3 { width: 270px; height: 66px; background: var(--oxblood); margin-top: -2px; }
.plate { width: 320px; height: 12px; border-radius: 99px; background: var(--ink); opacity: .85; margin-top: -2px; }
.wish-msg { min-height: 28px; font-family: 'Playfair Display', serif; font-size: 1.25rem; color: var(--oxblood); }

.acc { margin-top: 40px; display: flex; flex-direction: column; gap: 14px; }
.acc details { background: #fff; border-radius: 16px; border: 1px solid rgba(137, 0, 0, .1); box-shadow: 0 8px 24px rgba(100, 0, 0, .05); overflow: hidden; transition: box-shadow .3s; }
.acc details[open] { box-shadow: 0 16px 36px rgba(100, 0, 0, .12); border-color: var(--rosewood); }
.acc summary {
  display: flex; align-items: center; gap: 14px; padding: 20px 24px; cursor: pointer; list-style: none; font-weight: 600; position: relative;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary i { color: var(--oxblood); font-size: 1.2rem; }
.acc summary::after { content: '+'; position: absolute; right: 24px; font-size: 1.5rem; color: var(--mahogany); transition: transform .35s var(--ease); }
.acc details[open] summary::after { transform: rotate(45deg); }
.acc p { padding: 0 24px 22px 58px; opacity: .85; animation: fadeDown .45s var(--ease); }

.wishes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 44px; }
.wish {
  position: relative; background: #fff; padding: 38px 28px 26px; border-radius: 20px;
  border: 1px solid rgba(137, 0, 0, .1); box-shadow: 0 10px 30px rgba(100, 0, 0, .06);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.wish:hover { transform: translateY(-8px); box-shadow: 0 22px 44px rgba(100, 0, 0, .14); }
.quote { position: absolute; top: 12px; left: 22px; font-size: 2.6rem; color: var(--rosewood); opacity: .5; }
.wish p { font-size: .98rem; margin-bottom: 22px; }
.who { display: flex; align-items: center; gap: 12px; }
.who strong { display: block; font-size: .95rem; }
.who span { font-size: .8rem; opacity: .65; }
.avatar { position: relative; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .ph { border-width: 1.5px; padding: 0; }
.avatar .ph i { font-size: 1.1rem; }

.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 13px 26px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 .95rem 'Inter', sans-serif; color: var(--cream); background: var(--oxblood);
  box-shadow: 0 10px 24px rgba(137, 0, 0, .3);
  transition: transform .3s var(--ease), background .3s, box-shadow .3s, color .3s;
}
.btn:hover { background: var(--mahogany); transform: translateY(-3px); box-shadow: 0 16px 30px rgba(137, 0, 0, .4); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.light { background: var(--cream); color: var(--garnet); }
.btn.light:hover { background: var(--rosewood); color: var(--cream); }
.btn.ghost { background: transparent; border: 1px solid rgba(251,244,241,.5); box-shadow: none; }
.btn.ghost:hover { background: rgba(251,244,241,.12); }
.dark .btn { background: var(--rosewood); color: var(--garnet); }
.dark .btn:hover { background: var(--cream); }

.puzzle { margin-top: 30px; }
.equation { font-family: 'Playfair Display', serif; font-size: 2.6rem; font-weight: 700; }
.hint { opacity: .7; font-size: .9rem; margin: 6px 0 24px; }
.puzzle-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.puzzle input {
  width: 170px; padding: 13px 18px; border-radius: 999px; border: 1px solid rgba(251, 244, 241, .3);
  background: rgba(251, 244, 241, .08); color: var(--cream); font: 500 1rem 'Inter', sans-serif; text-align: center; outline: none;
  transition: border-color .3s, box-shadow .3s;
}
.puzzle input:focus { border-color: var(--rosewood); box-shadow: 0 0 0 4px rgba(205, 92, 92, .25); }
.puzzle input::placeholder { color: rgba(251, 244, 241, .5); }
.puzzle.shake { animation: shake .45s; }
.feedback { min-height: 26px; margin-top: 16px; font-size: .92rem; color: var(--rosewood); }

.letter { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 1.2s var(--ease), opacity .9s ease; }
.letter.open { max-height: 900px; opacity: 1; margin-top: 44px; }
.letter-inner {
  background: var(--cream); color: var(--ink); text-align: left; padding: 40px 36px; border-radius: 18px;
  border-left: 6px solid var(--oxblood); box-shadow: 0 24px 50px rgba(0,0,0,.35);
}
.letter-inner h3 { font-size: 1.6rem; color: var(--oxblood); margin-bottom: 16px; }
.letter-inner p { margin-bottom: 14px; }
.sign { font-family: 'Playfair Display', serif; font-size: 1.15rem; margin-top: 22px; color: var(--garnet); }
.sign span { font-family: 'Inter', sans-serif; font-size: .85rem; opacity: .7; }

.footer { text-align: center; background: var(--ink); color: var(--cream); font-size: .9rem; }
.footer p { padding: 30px 6vw 34px; }
.footer i { color: var(--rosewood); margin: 0 4px; }
.ground { position: relative; height: 76px; overflow: hidden; background: var(--garnet); border-top: 4px solid var(--oxblood); }
.ground::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 12px;
  background: repeating-linear-gradient(90deg, var(--rosewood) 0 16px, var(--mahogany) 16px 32px); opacity: .55;
}
.runner { position: absolute; bottom: 10px; left: 0; width: 64px; animation: walk 24s linear infinite; }
.runner .sprite svg { animation: hop .4s steps(2) infinite; }

.to-top {
  position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; z-index: 55;
  background: var(--oxblood); color: var(--cream); font-size: 1.1rem; box-shadow: 0 10px 24px rgba(0,0,0,.3);
  opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .4s, transform .4s var(--ease), background .3s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--mahogany); }

.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.visible { opacity: 1; transform: none; }

@keyframes loaderOut { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes ballRoll { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-22px) rotate(180deg); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-16px) rotate(8deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes drift { to { transform: translate(-6vmax, 6vmax); } }
@keyframes eq { to { transform: scaleY(1); } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
@keyframes flick { from { opacity: 1; } to { opacity: .45; } }
@keyframes ember { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }
@keyframes lunge { 0%, 100% { transform: translateX(0); } 40% { transform: translateX(70px); } 60% { transform: translateX(70px); } }
@keyframes hit { 0%, 100% { transform: translateX(0); opacity: 1; } 25% { transform: translateX(12px); opacity: .3; } 50% { transform: translateX(-12px); opacity: 1; } 75% { transform: translateX(12px); opacity: .3; } }
@keyframes candle { from { transform: scale(1, 1) rotate(-3deg); } to { transform: scale(.9, 1.1) rotate(3deg); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: .85; transform: none; } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10%); } }
@keyframes tilePop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes tileShuffle { 0% { transform: scale(1); } 50% { transform: scale(.7) rotate(-4deg); } 100% { transform: scale(1); } }
@keyframes walk {
  0% { transform: translateX(-90px) scaleX(1); }
  48% { transform: translateX(calc(100vw + 20px)) scaleX(1); }
  50% { transform: translateX(calc(100vw + 20px)) scaleX(-1); }
  98% { transform: translateX(-90px) scaleX(-1); }
  100% { transform: translateX(-90px) scaleX(1); }
}

@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: rgba(100, 0, 0, .97);
    max-height: 0; overflow: hidden; transition: max-height .5s var(--ease);
  }
  .nav-links.open { max-height: 560px; }
  .nav-links a { padding: 14px 6vw; border-top: 1px solid rgba(251,244,241,.1); }
  .nav-links a::after { display: none; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 44px; }
  .countdown, .hero-actions { justify-content: center; }
  .split { grid-template-columns: 1fr; gap: 44px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .team { grid-template-columns: repeat(2, 1fr); }
  .ach { grid-template-columns: repeat(2, 1fr); }
  .formulas { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; }
  .album { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 620px) {
  .team, .ach { grid-template-columns: 1fr; }
  .album { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .cd-box { min-width: 72px; }
  .float-badge { width: 46px; height: 46px; font-size: 1.1rem; }
  .hero-mon { width: 110px; right: -2%; }
  .b-screen { height: 300px; }
  .hp-box { width: 190px; }
  .b-mon { width: 150px; left: 14px; }
  .foe-art { font-size: 3.6rem; right: 30px; top: 60px; }
  .t3 { width: 230px; }
  .t2 { width: 170px; }
  .t1 { width: 110px; }
  .plate { width: 270px; }
  .acc p { padding-left: 24px; }
  .floor { grid-template-columns: repeat(8, 1fr); gap: 4px; }
  .lb-fig { max-width: 100%; margin-bottom: 70px; }
  .lb-nav { position: absolute; bottom: 24px; }
  .lb-nav.prev { left: 24px; }
  .lb-nav.next { right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .loader { display: none; }
}