:root{
  --robox-red:#e2231a;
  --robox-dark:#191919;
  --robox-dark2:#232323;
  --robox-yellow:#ffd500;
  --robox-blue:#00a2ff;
  --robox-green:#57b757;
  --robox-cream:#fff8ec;
  --ink:#26211c;
}

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

html,body{
  height:100%;
  font-family:'Fredoka',sans-serif;
  color:var(--ink);
  background:radial-gradient(1200px 700px at 50% -10%, #3a0f0d 0%, #200a08 45%, #100504 100%);
  overflow:hidden;
  -webkit-tap-highlight-color:transparent;
}

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

.scene{
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;
  perspective:2600px;
}

.book{
  position:relative;
  width:min(92vw,820px);
  height:min(62vh,560px);
  border-radius:18px;
  box-shadow:0 40px 80px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.06) inset;
  transform-style:preserve-3d;
}

.book::after{
  content:"";
  position:absolute;left:0;top:0;bottom:0;width:14px;
  background:linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,0));
  border-radius:18px 0 0 18px;
  z-index:3;pointer-events:none;
}

.page{
  position:absolute;inset:0;
  transform-origin:left center;
  transform-style:preserve-3d;
  border-radius:14px;
  overflow:hidden;
  background:var(--robox-cream);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.05);
}

/* ---------- Page skins ---------- */
.page-inner{
  position:absolute;inset:0;
  padding:clamp(18px,4vw,44px);
  display:flex;flex-direction:column;
  overflow:auto;
}

.cover .page-inner{
  background:
    radial-gradient(circle at 12% 16%, rgba(255,255,255,.16), transparent 40%),
    linear-gradient(150deg,#ff3b30 0%, var(--robox-red) 55%, #a80f08 100%);
  color:#fff;
  align-items:center;justify-content:center;text-align:center;
}

.back .page-inner{
  background:linear-gradient(150deg,#a80f08 0%, var(--robox-red) 60%, #ff3b30 100%);
  color:#fff;
  align-items:center;justify-content:center;text-align:center;
}

.inner .page-inner{
  background:
    radial-gradient(circle at 88% 8%, rgba(226,35,26,.06), transparent 45%),
    var(--robox-cream);
}

/* ---------- Typography ---------- */
.tagline{
  font-family:'Luckiest Guy',cursive;
  letter-spacing:2px;
  text-transform:uppercase;
  font-size:clamp(14px,2.4vw,20px);
  color:var(--robox-yellow);
  margin-bottom:8px;
  text-shadow:0 2px 0 rgba(0,0,0,.25);
}

.big-title{
  font-family:'Luckiest Guy',cursive;
  font-size:clamp(40px,9vw,92px);
  line-height:.9;
  color:#fff;
  text-shadow:0 4px 0 rgba(0,0,0,.25), 0 8px 22px rgba(0,0,0,.35);
  margin:6px 0;
}

.big-title .accent{color:var(--robox-yellow)}

.name{
  font-family:'Luckiest Guy',cursive;
  font-size:clamp(26px,5.5vw,54px);
  color:#fff;
  background:rgba(0,0,0,.28);
  padding:6px 22px;
  border-radius:12px;
  border:3px solid rgba(255,255,255,.35);
  box-shadow:0 5px 0 rgba(0,0,0,.25);
  margin-top:12px;
}

.hint{
  margin-top:22px;
  font-size:clamp(12px,1.6vw,15px);
  opacity:.9;
  letter-spacing:.5px;
}

.h2{
  font-family:'Luckiest Guy',cursive;
  font-size:clamp(24px,4vw,40px);
  color:var(--robox-red);
  margin-bottom:4px;
}

.rule{
  width:64px;height:5px;border-radius:4px;
  background:var(--robox-yellow);
  border:2px solid rgba(0,0,0,.15);
  margin-bottom:16px;
}

.inner p{font-size:clamp(15px,2vw,18px);line-height:1.55;color:#3a332b}

/* ---------- Blocks / studs ---------- */
.studs{display:flex;gap:8px;margin:14px 0}
.stud{width:14px;height:14px;border-radius:50%;box-shadow:inset 0 -3px 0 rgba(0,0,0,.18)}
.s1{background:var(--robox-red)} .s2{background:var(--robox-yellow)}
.s3{background:var(--robox-blue)} .s4{background:var(--robox-green)}

/* ---------- Avatar (blocky) ---------- */
.avatar{position:relative;width:130px;height:150px;margin:18px auto 4px}
.avatar .head{
  position:absolute;top:0;left:50%;transform:translateX(-50%);
  width:74px;height:66px;background:var(--robox-yellow);
  border-radius:14px;box-shadow:inset 0 -8px 0 rgba(0,0,0,.12);
}
.avatar .face{position:absolute;top:26px;left:50%;transform:translateX(-50%);width:74px;height:40px;text-align:center}
.avatar .eye{display:inline-block;width:10px;height:10px;background:#191919;border-radius:4px;margin:0 7px}
.avatar .smile{width:22px;height:12px;margin:8px auto 0;border-bottom:4px solid #191919;border-radius:0 0 12px 12px}
.avatar .body{
  position:absolute;top:68px;left:50%;transform:translateX(-50%);
  width:60px;height:50px;background:var(--robox-red);
  border-radius:12px 12px 6px 6px;box-shadow:inset 0 -8px 0 rgba(0,0,0,.14);
}
.avatar .arm{position:absolute;top:72px;width:20px;height:44px;background:var(--robox-red);border-radius:8px;box-shadow:inset 0 -6px 0 rgba(0,0,0,.14)}
.avatar .arm.l{left:6px}.avatar .arm.r{right:6px}
.avatar .leg{position:absolute;top:118px;width:22px;height:30px;background:var(--robox-dark);border-radius:7px}
.avatar .leg.l{left:40px}.avatar .leg.r{right:40px}

/* ---------- Gallery ---------- */
.gallery{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;flex:1;margin-top:10px}
.photo{
  position:relative;border-radius:14px;overflow:hidden;
  background:#efe5d4;border:3px solid #fff;
  box-shadow:0 8px 18px rgba(0,0,0,.18);
  min-height:110px;
}
.photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:2}
.photo-fallback{
  position:absolute;inset:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;text-align:center;
  color:#9a8b74;font-size:clamp(12px,1.8vw,15px);line-height:1.4;padding:10px;
}
.photo-fallback .cam{font-size:clamp(22px,4vw,34px)}
.photo-fallback .path{font-size:clamp(9px,1.3vw,11px);opacity:.75;margin-top:6px}

/* ---------- Wish cards ---------- */
.wishes{display:flex;flex-direction:column;gap:12px;flex:1;margin-top:10px}
.wish{
  display:flex;gap:12px;align-items:flex-start;
  background:#fff;border:2px solid #f0e6d6;border-radius:14px;
  padding:12px 14px;box-shadow:0 6px 14px rgba(0,0,0,.08);
}
.wish .who{
  font-family:'Luckiest Guy',cursive;font-size:15px;color:#fff;
  background:var(--robox-blue);padding:6px 10px;border-radius:10px;
  white-space:nowrap;box-shadow:0 3px 0 rgba(0,0,0,.15);
}
.wish p{font-size:clamp(13px,1.8vw,16px);color:#4a4238;line-height:1.45}

/* ---------- Fun facts ---------- */
.facts{display:flex;flex-direction:column;gap:12px;flex:1;margin-top:10px}
.fact{
  display:flex;gap:14px;align-items:center;
  background:#fff;border:2px solid #f0e6d6;border-radius:14px;
  padding:12px 16px;box-shadow:0 6px 14px rgba(0,0,0,.08);
}
.fact .icon{
  font-size:clamp(22px,3.4vw,34px);width:48px;height:48px;flex:0 0 48px;
  display:flex;align-items:center;justify-content:center;
  background:var(--robox-yellow);border-radius:12px;box-shadow:0 4px 0 rgba(0,0,0,.15);
}
.fact .icon img{width:30px;height:30px;object-fit:contain;filter:drop-shadow(0 1px 0 rgba(0,0,0,.2))}

.inline-icon{height:1.15em;width:auto;vertical-align:-0.2em;margin-left:4px}
.heading-icon{height:0.85em;width:auto;vertical-align:-0.05em;margin-right:8px}

.icon-strip{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:16px}
.icon-strip img{width:30px;height:30px;object-fit:contain;opacity:.9}
.icon-strip.light img{filter:invert(1);opacity:.85}

.invite{display:flex;flex-direction:column;gap:12px;flex:1;margin-top:12px}
.invite-row{display:flex;gap:12px;align-items:center;background:#fff;border:2px solid #f0e6d6;border-radius:14px;padding:12px 16px;box-shadow:0 6px 14px rgba(0,0,0,.08)}
.invite-icon{width:44px;height:44px;flex:0 0 44px;display:flex;align-items:center;justify-content:center;background:var(--robox-red);border-radius:12px;box-shadow:0 4px 0 rgba(0,0,0,.15)}
.invite-icon img{width:26px;height:26px;object-fit:contain;filter:invert(1)}
.invite-row p{font-size:clamp(14px,2vw,17px);color:#4a4238;line-height:1.4}

.wish-icon{width:34px;height:34px;flex:0 0 34px;object-fit:contain;margin-top:4px}
.fact p{font-size:clamp(14px,2vw,17px);color:#4a4238;line-height:1.4}
.fact b{color:var(--robox-red)}

/* ---------- Navigation ---------- */
.nav{
  position:fixed;top:50%;transform:translateY(-50%);
  width:56px;height:56px;border-radius:50%;border:none;cursor:pointer;
  font-size:34px;line-height:1;color:#fff;
  background:var(--robox-red);box-shadow:0 6px 16px rgba(0,0,0,.4), 0 0 0 3px rgba(255,255,255,.2);
  z-index:10;display:flex;align-items:center;justify-content:center;
  transition:transform .15s, background .15s;
}
.nav:hover{background:#ff3b30;transform:translateY(-50%) scale(1.06)}
.nav:active{transform:translateY(-50%) scale(.94)}
.nav:disabled{opacity:.28;cursor:default;transform:translateY(-50%) scale(1)}
.nav.prev{left:max(12px,2vw)}.nav.next{right:max(12px,2vw)}

.controls{
  position:fixed;left:50%;bottom:16px;transform:translateX(-50%);
  display:flex;flex-direction:column;align-items:center;gap:8px;z-index:10;
}
.dots{display:flex;gap:8px}
.dot{width:11px;height:11px;border-radius:50%;background:rgba(255,255,255,.35);cursor:pointer;transition:all .2s}
.dot.on{background:var(--robox-yellow);transform:scale(1.35);box-shadow:0 0 0 3px rgba(255,213,0,.25)}
.counter{
  font-family:'Luckiest Guy',cursive;letter-spacing:1px;
  color:#fff;font-size:14px;background:rgba(0,0,0,.35);padding:4px 14px;border-radius:20px;
}

.music{
  position:fixed;top:16px;right:16px;width:48px;height:48px;border-radius:50%;
  border:none;cursor:pointer;font-size:22px;color:var(--robox-dark);
  background:var(--robox-yellow);box-shadow:0 5px 14px rgba(0,0,0,.4), 0 0 0 3px rgba(255,255,255,.18);
  z-index:10;transition:transform .15s;
}
.music:hover{transform:scale(1.07)}
.music.playing{animation:pulse 1s infinite}
@keyframes pulse{0%,100%{box-shadow:0 5px 14px rgba(0,0,0,.4),0 0 0 3px rgba(255,255,255,.18)}50%{box-shadow:0 5px 14px rgba(0,0,0,.4),0 0 0 8px rgba(255,213,0,.35)}}

@media (max-width:600px){
  .nav{width:44px;height:44px;font-size:26px}
}
