Step under the studio lights. Twenty questions stand between you and the
golden trophy — from Montevideo 1930 to Qatar 2022. Answer fast: the clock pays a bonus.
⚽ 20 questions⏱ 20 s each???? 100 pts + speed bonus⌨️ Keys 1–4 work
Gerd Dani — Founder & Director Gerd Dani is the visionary in a wheelchair behind FreeAstroScience. An astronomy graduate and a master's in physics, he founded this blog in June 2020, driven by a passion for breaking down complex scientific and philosophical concepts into bite-sized, digestible pieces. As President, he is dedicated to making science accessible to everyone, from students to seasoned academics.
(function(){
"use strict";
/* ================= World Cup Arena — game engine =================
State machine: INTRO → PLAYING → REVEAL → (next) … → RESULTS
No globals leak; everything is scoped to this IIFE. */
var ROOT = document.getElementById('fas-wcq');
if(!ROOT || ROOT.dataset.qInit) return; ROOT.dataset.qInit = "1";
/* ---------- Question bank (cat: H=History, F=Fun fact, S=Statistics) ---------- */
var BANK = [
{c:'H', q:"Which country hosted — and won — the very first FIFA World Cup in 1930?",
a:["Uruguay","Italy","Brazil","Argentina"], x:"Uruguay beat Argentina 4–2 in Montevideo, with the whole tournament played in a single city."},
{c:'S', q:"Which nation has lifted the World Cup the most times?",
a:["Brazil","Germany","Italy","Argentina"], x:"Brazil leads with 5 titles: 1958, 1962, 1970, 1994 and 2002."},
{c:'S', q:"Who is the all-time top scorer in World Cup history?",
a:["Miroslav Klose","Ronaldo Nazário","Pelé","Lionel Messi"], x:"Germany's Klose scored 16 goals across four tournaments (2002–2014)."},
{c:'H', q:"Who won the 2022 World Cup in Qatar?",
a:["Argentina","France","Croatia","Brazil"], x:"Argentina beat France on penalties after a legendary 3–3 final in Lusail."},
{c:'H', q:"Who is the only player to win the World Cup three times?",
a:["Pelé","Diego Maradona","Franz Beckenbauer","Cafu"], x:"Pelé triumphed with Brazil in 1958, 1962 and 1970 — a record that still stands."},
{c:'F', q:"Before 1970, the trophy was named after which football pioneer?",
a:["Jules Rimet","Henri Delaunay","João Havelange","Sepp Herberger"], x:"The Jules Rimet Trophy honoured the FIFA president who launched the tournament."},
{c:'F', q:"Who scored the fastest goal in World Cup history — after just 10.8 seconds?",
a:["Hakan Şükür","Clint Dempsey","Bryan Robson","Pelé"], x:"Turkey's Şükür struck against South Korea in the 2002 third-place match."},
{c:'S', q:"Most goals in a single tournament: 13. Who holds this 'untouchable' record?",
a:["Just Fontaine","Gerd Müller","Kylian Mbappé","Harry Kane"], x:"France's Fontaine scored 13 in just six games at Sweden 1958."},
{c:'H', q:"Which was the first African nation to reach a World Cup semi-final?",
a:["Morocco","Cameroon","Ghana","Senegal"], x:"Morocco made history in Qatar 2022, knocking out Spain and Portugal on the way."},
{c:'F', q:"The infamous 'Hand of God' goal of 1986 was scored by…",
a:["Diego Maradona","Pelé","Romário","Gabriel Batistuta"], x:"Maradona punched it past England — then scored the 'Goal of the Century' minutes later."},
{c:'H', q:"Which is the most recent host nation to win the title on home soil?",
a:["France (1998)","Germany (2006)","Brazil (2014)","South Africa (2010)"], x:"Zidane's two headers sank Brazil 3–0 in the Stade de France final."},
{c:'S', q:"Which is the only country to have played in every World Cup since 1930?",
a:["Brazil","Germany","Italy","Argentina"], x:"Brazil has qualified for all 22 editions — no other nation comes close."},
{c:'F', q:"In one of football's greatest shocks, who beat England 1–0 at the 1950 World Cup?",
a:["United States","Spain","Chile","Cuba"], x:"A team of part-timers won in Belo Horizonte; some papers assumed the score was a typo."},
{c:'S', q:"The highest-scoring final saw Brazil win 5–2 in 1958 — against whom?",
a:["Sweden","Hungary","Italy","Czechoslovakia"], x:"A 17-year-old Pelé scored twice against the host nation in Stockholm."},
{c:'H', q:"The 2026 World Cup is co-hosted by the USA, Mexico and which third country?",
a:["Canada","Costa Rica","Panama","Jamaica"], x:"It's the first three-nation World Cup — and the first with 48 teams."},
{c:'H', q:"The first World Cup in Asia (2002) was shared by Japan and…",
a:["South Korea","China","Thailand","Qatar"], x:"It was also the first co-hosted edition in tournament history."},
{c:'F', q:"'World Cup Willie' (1966), the first official mascot, was what kind of animal?",
a:["A lion","A bulldog","A bear","An eagle"], x:"A Union-Jack-shirted lion kicked off the long tradition of World Cup mascots."},
{c:'S', q:"Who holds the record for most World Cup matches played, with 26?",
a:["Lionel Messi","Lothar Matthäus","Cristiano Ronaldo","Paolo Maldini"], x:"Messi passed Matthäus's 25 during Argentina's victorious 2022 campaign."},
{c:'S', q:"In the 2014 semi-final, Germany stunned host Brazil by what scoreline?",
a:["7–1","5–0","6–2","4–0"], x:"The 'Mineirazo': five German goals flew in within the first 29 minutes."},
{c:'F', q:"Who became the World Cup's oldest goalscorer, aged 42, at USA 1994?",
a:["Roger Milla","Stanley Matthews","Dino Zoff","Peter Shilton"], x:"Cameroon's dancing legend came out of retirement — twice — to set the record."}
];
/* ---------- Config & state ---------- */
var TIME = 20, BASE = 100, RING = 163.36;
var S = { i:0, score:0, correct:0, locked:false, t:TIME, raf:0, t0:0, order:[] };
/* ---------- DOM handles ---------- */
function $(id){ return document.getElementById(id); }
var el = { intro:$('qIntro'), game:$('qGame'), results:$('qResults'),
card:$('qCard'), tag:$('qTag'), num:$('qNum'), qq:$('qQuestion'),
ans:$('qAnswers'), exp:$('qExplain'), next:$('qNext'), strip:$('qStrip'),
score:$('qScore'), ring:$('qRing'), time:$('qTime'), timerBox:$('qTimerBox'),
finalPts:$('qFinalPts'), final:$('qFinal'), grade:$('qGrade'), stat:$('qStatline'),
live:$('qLive'), confetti:$('qConfetti') };
var reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
var TAGS = { H:'History', F:'Fun fact', S:'Statistics' };
/* ---------- Utilities ---------- */
function shuffle(arr){
for(var i=arr.length-1;i>0;i--){ var j=(Math.random()*(i+1))|0, t=arr[i]; arr[i]=arr[j]; arr[j]=t; }
return arr;
}
function say(msg){ el.live.textContent = msg; }
/* ---------- LED progress strip ---------- */
function buildStrip(){
var frag = document.createDocumentFragment();
for(var i=0;i<BANK.length;i++) frag.appendChild(document.createElement('i'));
el.strip.textContent=''; el.strip.appendChild(frag);
}
function setLed(i, cls){ var d = el.strip.children[i]; if(d) d.className = cls; }
/* ---------- Timer (rAF-driven SVG ring) ---------- */
function startTimer(){
cancelAnimationFrame(S.raf);
S.t0 = performance.now(); S.t = TIME;
el.timerBox.classList.remove('is-low');
(function tick(now){
var left = Math.max(0, TIME - (now - S.t0)/1000);
S.t = left;
el.time.textContent = Math.ceil(left);
el.ring.style.strokeDashoffset = (RING * (1 - left/TIME)).toFixed(1);
if(left <= 5) el.timerBox.classList.add('is-low');
if(left <= 0){ timeUp(); return; }
if(!S.locked) S.raf = requestAnimationFrame(tick);
})(performance.now());
}
function stopTimer(){ cancelAnimationFrame(S.raf); }
/* ---------- Scenes ---------- */
function show(scene){
el.intro.hidden = scene !== 'intro';
el.game.hidden = scene !== 'game';
el.results.hidden = scene !== 'results';
ROOT.scrollTop = 0; ROOT.scrollLeft = 0; /* belt & braces for overflow scroll */
if(scene === 'results')
ROOT.scrollIntoView({behavior: reduceMotion ? 'auto' : 'smooth', block: 'start'});
}
/* ---------- Render a question ---------- */
function render(){
var item = BANK[S.i];
el.tag.textContent = TAGS[item.c];
el.num.textContent = S.i + 1;
el.qq.textContent = item.q;
el.exp.textContent = '';
el.next.hidden = true;
S.locked = false;
/* shuffle answers while remembering the correct one (index 0 in source) */
var opts = item.a.map(function(text, idx){ return { text:text, ok: idx === 0 }; });
shuffle(opts);
var keys = ['1','2','3','4'], frag = document.createDocumentFragment();
opts.forEach(function(o, idx){
var b = document.createElement('button');
b.type = 'button'; b.className = 'q-ans';
b.innerHTML = '<span class="k">' + keys[idx] + '</span><span></span>';
b.lastChild.textContent = o.text;
b.dataset.ok = o.ok ? '1' : '';
b.addEventListener('click', function(){ answer(b); });
frag.appendChild(b);
});
el.ans.textContent = ''; el.ans.appendChild(frag);
setLed(S.i, 'on-now');
say('Question ' + (S.i+1) + ' of 20. ' + item.q);
startTimer();
}
/* ---------- Answer handling ---------- */
function lockButtons(){
Array.prototype.forEach.call(el.ans.children, function(b){
b.disabled = true;
if(b.dataset.ok) b.classList.add('is-correct');
else if(!b.classList.contains('is-wrong')) b.classList.add('is-faded');
});
}
function answer(btn){
if(S.locked) return;
S.locked = true; stopTimer();
var item = BANK[S.i], ok = !!btn.dataset.ok, gained = 0;
if(ok){
gained = BASE + Math.round((S.t / TIME) * 50);
S.score += gained; S.correct++;
setLed(S.i, 'on-good');
say('Correct! +' + gained + ' points.');
}else{
btn.classList.add('is-wrong');
setLed(S.i, 'on-bad');
say('Wrong. The right answer was ' + item.a[0] + '.');
}
lockButtons();
el.score.textContent = S.score;
el.exp.innerHTML = (ok ? '<b>✔ Correct! +' + gained + ' pts</b> — ' : '<b>✘ ' + item.a[0] + '</b> — ');
el.exp.appendChild(document.createTextNode(item.x));
el.next.hidden = false;
el.next.textContent = (S.i === BANK.length - 1) ? 'Final score ▸' : 'Next ▸';
el.next.focus({preventScroll:true});
}
function timeUp(){
if(S.locked) return;
S.locked = true; stopTimer();
var item = BANK[S.i];
setLed(S.i, 'on-bad');
lockButtons();
el.exp.innerHTML = '<b>⏱ Time! ' + '</b>';
el.exp.appendChild(document.createTextNode('The answer was ' + item.a[0] + '. ' + item.x));
say('Time is up. The answer was ' + item.a[0] + '.');
el.next.hidden = false;
el.next.textContent = (S.i === BANK.length - 1) ? 'Final score ▸' : 'Next ▸';
el.next.focus({preventScroll:true});
}
/* ---------- Card flip between questions ---------- */
function advance(){
if(S.i >= BANK.length - 1){ finish(); return; }
if(reduceMotion){ S.i++; render(); return; }
el.card.classList.add('is-flipping');
setTimeout(function(){
S.i++; render();
el.card.classList.remove('is-flipping');
}, 460);
}
/* ---------- Results ---------- */
function grade(c){
if(c >= 18) return ['???? World Cup Legend', 'You belong on the podium in gold confetti.'];
if(c >= 14) return ['⭐ Star Striker', 'Clinical finishing — a transfer to trivia royalty awaits.'];
if(c >= 9) return ['⚽ Solid Midfielder', 'Great engine, good vision. A little extra training and you go pro.'];
if(c >= 5) return ['???? Squad Rotation', 'Flashes of brilliance — time for some highlight reels.'];
return ['???? Pre-season Form', 'Everyone starts somewhere. Re-watch the classics and come back!'];
}
function finish(){
show('results');
var g = grade(S.correct), pct = Math.round((S.correct / BANK.length) * 100);
el.grade.textContent = g[0];
el.stat.innerHTML = '<b>' + S.correct + ' / 20</b> correct • ' + g[1];
el.final.style.setProperty('--pct', 0);
/* animated count-up */
var target = S.score, t0 = performance.now(), dur = reduceMotion ? 0 : 1100;
(function step(now){
var k = dur ? Math.min(1, (now - t0) / dur) : 1, e = 1 - Math.pow(1 - k, 3);
el.finalPts.textContent = Math.round(target * e);
el.final.style.setProperty('--pct', Math.round(pct * e));
if(k < 1) requestAnimationFrame(step);
})(t0);
say('Quiz complete. ' + S.correct + ' out of 20 correct. ' + S.score + ' points. ' + g[0]);
if(S.correct >= 14 && !reduceMotion) confetti();
}
/* ---------- Confetti (tiny canvas burst) ---------- */
function confetti(){
var c = el.confetti, ctx = c.getContext('2d');
if(!ctx) return;
var r = ROOT.getBoundingClientRect(), dpr = Math.min(2, window.devicePixelRatio || 1);
c.width = r.width * dpr; c.height = r.height * dpr; ctx.scale(dpr, dpr);
var colors = ['#f3c548','#22c272','#7d6bff','#ffffff','#ff5d6c'], P = [];
for(var i=0;i<140;i++) P.push({
x: r.width/2 + (Math.random()-0.5)*120, y: r.height*0.3,
vx:(Math.random()-0.5)*9, vy: -(Math.random()*8+4),
s: Math.random()*6+3, a: Math.random()*Math.PI, va:(Math.random()-0.5)*0.3,
col: colors[(Math.random()*colors.length)|0], life: 1
});
var t0 = performance.now();
(function loop(now){
var dt = Math.min(32, now - t0)/16; t0 = now;
ctx.clearRect(0,0,r.width,r.height);
var alive = false;
P.forEach(function(p){
p.vy += 0.22*dt; p.x += p.vx*dt; p.y += p.vy*dt; p.a += p.va*dt;
p.life -= 0.004*dt;
if(p.life > 0 && p.y < r.height + 20){
alive = true;
ctx.save(); ctx.globalAlpha = Math.max(0, p.life);
ctx.translate(p.x, p.y); ctx.rotate(p.a);
ctx.fillStyle = p.col; ctx.fillRect(-p.s/2, -p.s/2, p.s, p.s*0.6);
ctx.restore();
}
});
if(alive) requestAnimationFrame(loop);
else ctx.clearRect(0,0,r.width,r.height);
})(t0);
}
/* ---------- Parallax stage tilt (fine pointers only) ---------- */
if(!reduceMotion && window.matchMedia('(pointer: fine)').matches){
var stage = el.game;
stage.addEventListener('pointermove', function(e){
if(e.target.closest('button')) return; /* keep click targets still */
var r = stage.getBoundingClientRect();
var dx = (e.clientX - r.left)/r.width - 0.5, dy = (e.clientY - r.top)/r.height - 0.5;
ROOT.style.setProperty('--ry', (dx*6).toFixed(2)+'deg');
ROOT.style.setProperty('--rx', (-dy*5).toFixed(2)+'deg');
});
stage.addEventListener('pointerleave', function(){
ROOT.style.setProperty('--rx','0deg'); ROOT.style.setProperty('--ry','0deg');
});
}
/* ---------- Keyboard: 1–4 answer, Enter/Space advance ---------- */
document.addEventListener('keydown', function(e){
if(el.game.hidden) return;
if(!S.locked && e.key >= '1' && e.key <= '4'){
var b = el.ans.children[+e.key - 1];
if(b && !b.disabled){ e.preventDefault(); answer(b); }
}else if(S.locked && (e.key === 'Enter' || e.key === ' ') && document.activeElement !== el.next){
e.preventDefault(); advance();
}
});
/* ---------- Wiring ---------- */
function reset(){
S.i = 0; S.score = 0; S.correct = 0; S.locked = false;
el.score.textContent = '0';
buildStrip();
}
$('qStart').addEventListener('click', function(){ reset(); show('game'); render(); });
el.next.addEventListener('click', advance);
$('qRestart').addEventListener('click', function(){ reset(); show('game'); render(); });
$('qReview').addEventListener('click', function(){ show('intro'); });
buildStrip();
})();
(()=>{async function handleCredentialResponse(response){try{const res=await fetch('https://freeastroscience.com/wp-login.php?action=googlesitekit_auth',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:new URLSearchParams(response)});/* Preserve comment text in case of redirect after login on a page with a Sign in with Google button in the WordPress comments. */ const commentText=document.querySelector('#comment')?.value;const postId=document.querySelectorAll('.googlesitekit-sign-in-with-google__comments-form-button')?.[0]?.className?.match(/googlesitekit-sign-in-with-google__comments-form-button-postid-(\d+)/)?.[1];if(!! commentText?.length){sessionStorage.setItem(`siwg-comment-text-${postId}`,commentText);}location.reload();}catch(error){console.error(error);}}if(typeof google !=='undefined'){google.accounts.id.initialize({client_id:'251104905146-eghigrtua82ec7aan4em9fle9u5f0ilc.apps.googleusercontent.com',callback:handleCredentialResponse,library_name:'Site-Kit'});}const defaultButtonOptions={"theme":"outline","text":"signin_with","shape":"rectangular"};document.querySelectorAll('.googlesitekit-sign-in-with-google__frontend-output-button').forEach((siwgButtonDiv)=>{const buttonOptions={shape:siwgButtonDiv.getAttribute('data-googlesitekit-siwg-shape')|| defaultButtonOptions.shape,text:siwgButtonDiv.getAttribute('data-googlesitekit-siwg-text')|| defaultButtonOptions.text,theme:siwgButtonDiv.getAttribute('data-googlesitekit-siwg-theme')|| defaultButtonOptions.theme,};if(typeof google !=='undefined'){google.accounts.id.renderButton(siwgButtonDiv,buttonOptions);}});/* If there is a matching saved comment text in sessionStorage,restore it to the comment field and remove it from sessionStorage. */ const postId=document.body.className.match(/postid-(\d+)/)?.[1];const commentField=document.querySelector('#comment');const commentText=sessionStorage.getItem(`siwg-comment-text-${postId}`);if(commentText?.length && commentField && !! postId){commentField.value=commentText;sessionStorage.removeItem(`siwg-comment-text-${postId}`);}})();
var astra = {"break_point":"921","isRtl":"","is_scroll_to_id":"1","is_scroll_to_top":"1","is_header_footer_builder_active":"1","responsive_cart_click":"flyout","is_dark_palette":"","revealEffectEnable":"","edit_post_url":"https://freeastroscience.com/wp-admin/post.php?post={{id}}&action=edit","ajax_url":"https://freeastroscience.com/wp-admin/admin-ajax.php","infinite_count":"2","infinite_total":"0","pagination":"number","infinite_scroll_event":"scroll","no_more_post_message":"No more posts to show.","grid_layout":{"desktop":3,"tablet":1,"mobile":1},"site_url":"https://freeastroscience.com","blogArchiveTitleLayout":"layout-2","blogArchiveTitleOn":"1","show_comments":"Show Comments","enableHistoryPushState":"1","masonryEnabled":"","blogMasonryBreakPoint":"0"};
//# sourceURL=astra-theme-js-js-extra