:root{
  --bg-sky:#87ceeb;
  --bg-cloud:#ffffff;
  --brick:#b2483c;
  --question:#f2d857;
  --question-border:#caa122;
  --primary:#ff5ea5;
  --secondary:#5e9cff;
  --accent:#ffd34a;
  --text:#141414;
  --panel:rgba(14,14,14,.65);
  --panel-2:rgba(23,23,23,.65);
}

*{box-sizing:border-box}
html,body{
  height:100%;
  margin:0;
  font-family:'Nunito',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:transparent; /* show the parallax background clearly */
}

#game{
  min-height:100vh;
  overflow-x:hidden;
  display:flex; flex-direction:column; /* ensure footer sticks to bottom */
}

/* Parallax background */
.parallax{position:fixed; inset:0; z-index:-1; perspective:1px; transform-style:preserve-3d}
.layer{position:absolute; inset:0; background-repeat:repeat-x; animation:scroll 60s linear infinite}
.layer.sky{background:linear-gradient(var(--bg-sky),#b6e7ff); transform:translateZ(-2px) scale(3); animation-duration:120s}
.layer.clouds{background-image:
  radial-gradient(circle at 20% 40%, var(--bg-cloud) 0 18%, transparent 19%),
  radial-gradient(circle at 60% 30%, var(--bg-cloud) 0 14%, transparent 15%),
  radial-gradient(circle at 80% 50%, var(--bg-cloud) 0 12%, transparent 13%);
  opacity:.7; transform:translateZ(-1.5px) scale(2.5); animation-duration:90s}

@keyframes scroll{
  from{background-position:0 0}
  to{background-position:-2000px 0}
}

/* HUD */
.hud{
  position:fixed; top:0; left:0; right:0;
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 20px; z-index:10;
  font-family:'Press Start 2P', monospace;
  color:#fff; text-shadow:0 2px 0 #000;
  background:rgba(12,12,12,.6);
}
.hud .hud-item{margin-right:14px}

/* Stage */
.stage{position:relative; padding-top:100px; padding-bottom:60px}

/* Blocks */
.blocks-row{
  display:flex; gap:18px; justify-content:center; align-items:flex-end;
  margin:60px auto; max-width:900px;
  transform:translateY(-10px);
  position:relative; z-index:5; /* ensure clickable above character */
}
.block{
  width:84px; height:84px; border-radius:8px;
  border:4px solid #000; position:relative; cursor:pointer;
  box-shadow:0 6px 0 #0003, inset 0 -4px 0 #0002;
  transform:translateY(0); transition:transform .08s ease, filter .2s ease;
  background-size:cover; background-position:center;
  outline:none;
}
.block .block-face{
  font-family:'Press Start 2P', monospace; font-size:28px;
  color:#222; text-shadow:0 2px 0 #fff8;
}
.block.question{background:linear-gradient(var(--question), #e7c84c); border-color:var(--question-border)}
.block.brick{background:
  linear-gradient(180deg, #b95949 0 12%, #8a3d32 12% 40%, #b95949 40% 52%, #8a3d32 52% 100%);
  border-color:#742f27}
.block:active{transform:translateY(6px)}
.block:hover{filter:brightness(1.1)}

/* Tooltip labels for blocks */
.block::before{
  content:attr(data-label);
  position:absolute; left:50%; bottom:100%; transform:translate(-50%, -8px);
  white-space:nowrap; font-family:'Press Start 2P'; font-size:12px;
  color:#fff; background:#000; padding:6px 8px; border:2px solid #fff; border-radius:8px;
  opacity:0; pointer-events:none; transition:opacity .15s ease, transform .15s ease;
}
.block:hover::before{opacity:1; transform:translate(-50%, -12px)}

/* Princess Peach (character) */
#peach{
  position:absolute; left:50%; bottom:60px; width:92px; height:120px;
  transform:translateX(-50%);
  background-image:url('https://raw.githubusercontent.com/0xType/retro-sprites/main/mario/princess_peach.png');
  background-size:contain; background-repeat:no-repeat; image-rendering:pixelated;
  animation:peach-idle .8s steps(2) infinite alternate;
  filter:drop-shadow(0 6px 0 #0005);
  z-index:1;
}
@keyframes peach-idle{
  to{transform:translateX(-50%) translateY(-2px)}
}

/* Panels */
.panel{
  margin:40px auto; padding:22px; max-width:980px;
  border:3px solid #000; border-radius:16px;
  background:linear-gradient(180deg, var(--panel), var(--panel-2));
  box-shadow:0 8px 0 #0004, inset 0 3px 0 #ffffff12;
  color:#eee;
  display:none;
  backdrop-filter:saturate(1.2) blur(6px);
}
.panel.active{display:block; animation:panel-pop .3s ease}
@keyframes panel-pop{from{transform:translateY(6px); opacity:.0} to{transform:translateY(0); opacity:1}}
.panel h2{
  font-family:'Press Start 2P', monospace; color:#fff; margin:0 0 16px; letter-spacing:1px;
}

/* Panel content */
.bio{display:flex; gap:18px; align-items:center}
.bio img{width:96px; height:96px; border-radius:12px; border:3px solid #000; object-fit:cover; background:#fff}
.bio h3{margin:0 0 6px; color:#fff}
.about-text{margin-top:16px; color:#f3f3f3}
.subheading{margin:16px 0 8px; color:#fff; font-weight:800}
.highlights-list{padding-left:18px; margin:8px 0 0; color:#eee}
.highlights-list li{margin-bottom:8px}

/* Videos grid */
.grid{display:grid; gap:16px}
.fixed4{grid-template-columns:repeat(4, 1fr)}
@media (max-width:900px){.fixed4{grid-template-columns:repeat(2, 1fr)}}
.video-card{
  position:relative; overflow:hidden; border-radius:12px; border:2px solid #000;
  background:#fff; box-shadow:0 6px 0 #0003;
  transform:translateY(8px); opacity:.0; transition:transform .25s ease, opacity .25s ease;
}
.video-card img{width:100%; height:120px; display:block; object-fit:cover}
.video-info{padding:10px 8px; background:#fff; color:#111; border-top:2px solid #000}
.video-title{display:block; font-weight:800; color:#111; text-decoration:none; margin-bottom:6px}
.video-title:hover{text-decoration:underline}
.video-meta{font-size:12px; color:#666; margin-bottom:6px}
.video-desc{font-size:14px; color:#333}
.video-card.visible{transform:translateY(0); opacity:1}

/* Articles list */
.list{display:flex; flex-direction:column; gap:12px}
.article-item{
  display:flex; gap:12px; align-items:center; padding:12px; border:2px solid #000;
  border-radius:12px; background:#101010; box-shadow:0 6px 0 #0003;
  transform:translateY(8px); opacity:.0; transition:transform .25s ease, opacity .25s ease;
}
.article-item .source{font-family:'Press Start 2P'; color:#ffd34a; font-size:12px}
.article-item a{color:#c7e0ff; text-decoration:none}
.article-item a:hover{text-decoration:underline}
.article-item.visible{transform:translateY(0); opacity:1}

/* Panel actions and CTAs */
.panel-actions{margin-top:16px}
.cta{
  display:inline-block; margin-right:10px; padding:10px 12px; border:2px solid #000; border-radius:10px;
  background:linear-gradient(180deg, #ff7abf, #ff5ea5); color:#fff; text-decoration:none; font-weight:800;
  box-shadow:0 6px 0 #0004;
}
.cta:hover{filter:brightness(1.1)}

/* Speaking layout */
.speaking-wrap{display:flex; gap:22px; align-items:flex-start}
.speaking-left{flex:1}
.speaking-right{flex:1; display:flex; flex-direction:column; align-items:center; gap:8px}

/* Speaking timeline */
.timeline{
  position:relative; margin:24px 0; padding:10px 0;
}
.timeline::before{
  content:""; position:absolute; left:50%; top:0; bottom:0; width:4px; background:#000; border-radius:2px; transform:translateX(-50%);
}
.timeline-item{
  position:relative; width:50%; padding:12px 16px; border:2px solid #000; border-radius:12px;
  background:#101010; color:#fff; box-shadow:0 6px 0 #0003;
  transform:translateY(12px); opacity:.0; transition:transform .35s ease, opacity .35s ease;
}
.timeline-item a{color:#c7e0ff; text-decoration:none; font-weight:700}
.timeline-item a:hover{text-decoration:underline}
.timeline-item.left{left:0}
.timeline-item.right{left:50%}
.timeline-item.left::after,
.timeline-item.right::after{
  content:""; position:absolute; top:18px; width:12px; height:12px; background:#ffd34a; border:2px solid #000; border-radius:50%;
}
.timeline-item.left::after{right:-33px}
.timeline-item.right::after{left:-33px}
.timeline-item.visible{transform:translateY(0); opacity:1}

/* Globe (D3-rendered) */
.globe{
  position:relative;
  width:280px; height:280px; border-radius:50%;
  border:3px solid #000; box-shadow:0 8px 0 #0003; overflow:hidden;
  background-color:#0a0a0a;
}
/* Tooltip for D3 pins */
.globe-tooltip{
  position:absolute; left:0; top:0;
  background:#000; color:#fff; font-size:12px; padding:6px 8px;
  border:2px solid #fff; border-radius:8px; white-space:nowrap;
  pointer-events:none; opacity:0; transition:opacity .12s ease;
  z-index:5;
}
.globe:active{cursor:grabbing}
.globe-note{color:#eee; font-size:12px}

/* Links */
.links{display:flex; flex-wrap:wrap; gap:12px}
.link-card{
  display:flex; align-items:center; gap:10px; padding:10px 12px; border:2px solid #000; border-radius:12px;
  background:#101010; color:#fff; text-decoration:none; font-weight:700; box-shadow:0 6px 0 #0003;
}
.link-card img{width:24px; height:24px; filter:drop-shadow(0 1px 0 #000)}

/* Footer */
main{flex:1; padding-bottom:100px} /* reserve space so fixed footer doesn't cover content */
.footer{
  position:fixed; left:0; right:0; bottom:0; z-index:3;
  padding:24px; text-align:center; color:#111; font-size:14px; background:#fff; border-top:3px solid #000
}
.footer a{color:#0d53ff; text-decoration:none; font-weight:800}
.footer a:hover{text-decoration:underline}

/* Responsive tweaks */
@media (max-width:900px){
  .timeline::before{left:12px; transform:none}
  .timeline-item{width:auto; margin-left:32px}
  .timeline-item.right{left:0}
  .timeline-item.left::after{right:auto; left:-33px}
  .speaking-wrap{flex-direction:column}
  .globe{width:100%; height:260px}
}
@media (max-width:720px){
  .blocks-row{gap:12px}
  .block{width:72px; height:72px}
  #peach{bottom:90px}
}