27:18Gemini 4 Hydrogen: Cheaper Tokens, More Expensive Answers?
Nov 13, 2026 · YouTube
18:40ERNIE 5.5 Flash Preview vs GLM 5.3 Flash: Baidu's new model is very impressive!
Nov 11, 2026 · YouTube
36:22Fable 5.2 robbing me blind, plus: Nex AGI's N2.6 vs GLM 5.3 Flash
Nov 11, 2026 · YouTube
14:03Gemini 4 Carbon: Can it handle my challenges? (First look with one-shot coding tests)
Nov 10, 2026 · YouTube
47:51Ranking major U.S. Open-Weights Models. (Where does Ripple 65B fit in?)
Nov 6, 2026 · YouTube
10:57"Crouton Alpha": the latest super-efficient coding model by Meta?
Nov 3, 2026 · YouTube
38:58Testing Particle-1: a post-trained DeepSeek V4.1 Flash specializing in coding and efficiency
Oct 28, 2026 · YouTube
22:14GPT-6.1 Terra Pro vs Terra: How Much Better Is Pro?
Oct 27, 2026 · YouTube
29:55Kimi K3.1 Pro Looked Incredible. Then I Kept Testing.
Oct 26, 2026 · YouTube
31:28Is this company reselling GPT Sol 6.1 at a loss (for non-agentic/text-only)?🤔 Is this sustainable?
Oct 20, 2026 · YouTube
17:58Nemotron 3.5 Super VL vs Opus 5.5: Testing NVIDIA’s new coding juggernaut
Oct 15, 2026 · YouTube
16:04Testing a *massive* new open-weights model 🤯: Muse Spark Open (vs. Nemotron, Opus 5.5, and more)
Oct 15, 2026 · YouTube
16:43Gemini 4 Argon: Great 🐈 Animation, but a broken escalator. (Coding challenge vs Opus 5.5, Sol 6.1)
Oct 13, 2026 · YouTube
16:37Meta's new "Muse Wonder" AI is impressive... but can it compete with Anthropic's models?
Oct 12, 2026 · YouTube
11:12WOW... Haiku 5.5 is very impressive. RIP OpenAI?
Oct 7, 2026 · YouTube
22:47Mistral Large 4 Is Cheap. But Is It Good Enough to Compete?
Oct 6, 2026 · YouTube
22:02Is Pareto 26.10 Preview Just Routing to GPT Sol? I Tested It Against Sol 6.1 Pro
Oct 1, 2026 · YouTube
11:22I Tested Sonnet 5.5 Against Opus 5.5. Is It Actually Cheaper?
Sep 28, 2026 · YouTube
You write simulations where the interesting behavior is supposed to come out of the dice rather than be animated by hand.
Build me a single HTML page: a Starbucks-style coffee shop running a bizarre promotion, simulated live.
data: URIs are fine.localStorage, sessionStorage, cookies or indexedDB — sandboxed frame, they throw.html block.One paragraph, before the file. Given your own timings — how long a customer stays inside holding a drink, how fast the counter serves — roughly how many customers should pass through between catastrophes? Show the working, not just the number.
The single fenced html block.
Having written it, what does the page do in its first few minutes? Name anything you tuned, special-cased or nudged. Say what it does badly — I am going to leave it running and watch the counters.
The counter serves every 2 simulated seconds, and each drink stays inside for 10 seconds, so a busy shop has a rolling window of five drink rolls. A catastrophe occurs when that window contains three unicorns. Simply using (P(\text{at least 3 of 5})=276/7776\approx3.55%) understates the waiting time because adjacent windows overlap. Accounting for that overlap, use the recurrence (E(s)=1+(5/6)E(s0)+(1/6)E(s1)), retaining the last four outcomes and stopping when the next outcome creates three successes: starting empty, it gives approximately 67.4 drinks between catastrophes. That is roughly 135 simulated seconds of service, plus a 9-second recovery and a little entrance time. This is an average, not a deadline; droughts and closely spaced disasters are both legitimate.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>STARBUCKLED — The Unicorn Incident</title>
<style>
:root{color-scheme:dark;--bg:#091410;--panel:#12231c;--line:#2a4336;--muted:#9ab2a3;--ink:#edf6ee;--green:#b5f6bb;--pink:#ff71d9}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 system-ui,sans-serif}
main{max-width:1440px;margin:auto;padding:24px}
header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}
.eyebrow{color:var(--green);font-size:11px;letter-spacing:3px;font-weight:800}
h1{margin:3px 0 0;font-size:clamp(24px,4vw,38px);letter-spacing:-1.5px;line-height:1.15}
h1 span{color:var(--pink)}
.tagline{color:var(--muted);margin:7px 0 0}
.badge{border:1px solid var(--line);border-radius:30px;padding:8px 14px;white-space:nowrap;color:var(--green);font-size:12px}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:16px}
.stage{border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#0d1d17;position:relative}
.stagebar{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:12px 18px;border-bottom:1px solid var(--line);font-size:12px}
#status{font-weight:800;letter-spacing:1px;color:var(--green)}
#clock{color:var(--muted);font-variant-numeric:tabular-nums}
canvas{display:block;width:100%;aspect-ratio:1100/650}
.controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:14px 18px;border-top:1px solid var(--line)}
button{background:#203e2c;border:1px solid #416a4c;color:var(--ink);padding:8px 13px;border-radius:8px;font:inherit;cursor:pointer}
button:hover{background:#31533d}
button:focus-visible,input:focus-visible{outline:2px solid var(--pink);outline-offset:4px}
input{accent-color:var(--green);width:150px}
.speed{display:flex;align-items:center;gap:10px}
#speedLabel{min-width:33px;color:var(--green);font-weight:bold}
.controls .hint{margin-left:auto;font-size:11px;color:var(--muted)}
aside{display:flex;flex-direction:column;gap:12px}
.card{border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:16px}
.card h2{margin:0 0 12px;font-size:11px;letter-spacing:2px;color:var(--muted);text-transform:uppercase}
.big{font-size:35px;font-weight:750;letter-spacing:-1px;line-height:1.1;font-variant-numeric:tabular-nums}
.sub{color:var(--muted);font-size:12px}
.pink{color:var(--pink)}
.row{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid #294034;font-size:12px}
.row:last-child{border:0;padding-bottom:0}
.row b{font-variant-numeric:tabular-nums}
.meter{height:7px;background:#08130d;border-radius:5px;margin:12px 0 6px;overflow:hidden}
.meter i{display:block;height:100%;background:linear-gradient(90deg,#7effad,#ff71d9);width:0%;transition:width .2s}
#log{margin:0;padding:0;list-style:none;font-size:12px;color:var(--muted)}
#log li{border-top:1px solid var(--line);padding:8px 0}
#log li:first-child{border-top:0}
footer{display:grid;grid-template-columns:1fr 1fr;gap:25px;margin-top:18px;color:var(--muted);font-size:12px}
footer p{margin:0}
footer strong{color:var(--ink)}
@media(max-width:900px){.layout{grid-template-columns:1fr}aside{display:grid;grid-template-columns:1fr 1fr}.card:last-child{grid-column:1/-1}header .badge{display:none}footer{grid-template-columns:1fr}main{padding:14px}.controls .hint{display:none}}
@media(max-width:480px){aside{grid-template-columns:1fr}.stagebar{font-size:10px}.controls{gap:8px}}
</style>
</head>
<body>
<main>
<header>
<div><div class="eyebrow">AN ENTIRELY UNAUTHORIZED COFFEE EXPERIMENT</div>
<h1>STARBUCKLED <span>✦</span></h1>
<p class="tagline">Handcrafted beverages. Statistically inevitable property damage.</p></div>
<div class="badge">OPEN • PROBABLY INSURED</div>
</header>
<div class="layout">
<section class="stage" aria-label="Live coffee shop simulation">
<div class="stagebar"><span id="status">ORDINARY COFFEE OPERATIONS</span><span id="clock">00:00 simulated</span></div>
<canvas id="scene" width="1100" height="650" aria-label="Customers queue, buy randomly glowing drinks, and occasionally summon a giant unicorn"></canvas>
<div class="controls">
<button id="pause" type="button">Pause</button>
<label class="speed">Speed <input id="speed" type="range" min="0" max="5" step="1" value="0"><output id="speedLabel">1×</output></label>
<button id="reset" type="button">New experiment</button>
<span class="hint">Fast-forward changes time, not the die.</span>
</div>
</section>
<aside>
<div class="card">
<h2>Currently inside</h2>
<div class="big"><span id="inside">0</span><span class="sub"> / 8 customers</span></div>
<div class="meter"><i id="occupancy"></i></div>
<div class="row"><span>Holding a unicorn</span><b class="pink" id="active">0 / 3</b></div>
<div class="row"><span>Waiting outside</span><b id="waiting">0</b></div>
<div class="row"><span>Last counter roll</span><b id="die">—</b></div>
</div>
<div class="card">
<h2>Accounting, allegedly</h2>
<div class="big" id="served">0</div><div class="sub">drinks served = customers served</div>
<div class="row"><span>Neon Unicorns produced</span><b class="pink" id="produced">0</b></div>
<div class="row"><span>Observed unicorn rate</span><b id="rate">—</b></div>
<div class="row"><span>True probability</span><b>1 / 6 · 16.67%</b></div>
<div class="row"><span>Catastrophes</span><b class="pink" id="events">0</b></div>
<div class="row"><span>Drinks since last event</span><b id="since">0</b></div>
<div class="row"><span>Mean drinks / event¹</span><b id="mean">—</b></div>
<div class="row"><span>Emergency evacuations</span><b id="evacs">0</b></div>
<div class="row"><span>Queue was too much</span><b id="balked">0</b></div>
</div>
<div class="card">
<h2>Incident paperwork</h2>
<ul id="log"></ul>
<div class="sub">¹ Completed intervals only. Ideal busy-shop mean: ~67.4 drinks.</div>
</div>
</aside>
</div>
<footer>
<p><strong>The actual rules.</strong> One independent fair six-sided roll at the counter for every drink; only a 6 makes a unicorn. Service takes 2 seconds. A customer holds their drink inside for 10 seconds, including the walk out. Capacity is 8; arrivals are every 1.55 seconds. Three simultaneous holders trigger the incident immediately. No pity timer, scheduled explosion, or probability boost.</p>
<p><strong>Fine print.</strong> The 9-second incident stops service and evacuates the shop; the outside queue survives. The line caps at 24, after which arrivals go elsewhere. All timings are simulated time. Glow and shake are visual only. Reduced-motion preferences soften the effects. Fictional café, not affiliated with Starbucks. Corporate has classified the creature as “seasonal foam.”</p>
</footer>
</main>
<script>
"use strict";
const $ = id => document.getElementById(id);
const canvas = $("scene"), ctx = canvas.getContext("2d");
const W=1100,H=650,DT=1/60;
const speeds=[1,2,4,8,16,32];
const reduced=matchMedia("(prefers-reduced-motion: reduce)").matches;
let speed=1,paused=false,accumulator=0,lastFrame=performance.now(),uiAt=0;
let t,customers,line,departing,arrival,service,event,debris,stats,logItems,idCounter,lastDie;
const seats=[
[455,280],[560,280],[665,280],[455,355],
[560,355],[665,355],[455,425],[560,425]
];
const colors=["#d8caab","#a8ccba","#eac2a0","#9caed2","#c6a5d4","#dfba8a"];
const rnd=(a,b)=>a+Math.random()*(b-a);
const clamp=(v,a,b)=>Math.max(a,Math.min(b,v));
function fairD6(){
// Rejection sampling: 2^32 is not divisible by six.
if(globalThis.crypto && typeof crypto.getRandomValues==="function"){
const a=new Uint32Array(1);
do {crypto.getRandomValues(a)} while(a[0]>=4294967292);
return 1+a[0]%6;
}
return 1+Math.floor(Math.random()*6);
}
function record(text){
logItems.unshift({at:t,text});
logItems=logItems.slice(0,4);
$("log").replaceChildren(...logItems.map(item=>{
const li=document.createElement("li");
li.textContent=timeString(item.at)+" — "+item.text;
return li;
}));
}
function timeString(s){
const n=Math.floor(s);
return String(Math.floor(n/60)).padStart(2,"0")+":"+String(n%60).padStart(2,"0");
}
function initialize(){
t=0;customers=[];line=[];departing=[];arrival=0;service=0;
event=null;debris=[];idCounter=0;lastDie=null;logItems=[];
stats={served:0,produced:0,events:0,evacs:0,balked:0,since:0,completed:0};
accumulator=0;
record("Doors open. The waiver is printed on the receipt.");
updateUI();
}
function activeCount(){return customers.filter(c=>c.kind==="drink"&&c.unicorn).length}
function queueTarget(index){return [820-index*51,330+Math.min(index,5)*22]}
function lineTarget(index){
if(index<9)return [292-index*29,472];
if(index<18)return [60+(index-9)*29,515];
return [292-(index-18)*29,558];
}
function glide(c,x,y,dt,rate=7){
const a=1-Math.exp(-rate*dt);
c.x+=(x-c.x)*a;c.y+=(y-c.y)*a;
}
function spawn(){
if(line.length>=24){stats.balked++;return}
line.push({id:++idCounter,x:-25,y:558,color:colors[Math.floor(rnd(0,colors.length))],kind:"queue",unicorn:false,slot:-1});
}
function trigger(){
// This is the only call site that starts a catastrophe.
// It is reached only after the live inside-holder count becomes >= 3.
stats.events++;stats.completed+=stats.since;stats.since=0;
event={start:t,evacuated:false,number:stats.events};
debris=Array.from({length:90},(_,i)=>({
x:rnd(330,960),y:rnd(180,510),vx:rnd(-190,190),vy:rnd(-300,-50),
w:rnd(6,29),h:rnd(4,20),rot:rnd(0,6.28),spin:rnd(-5,5),
color:i%4===0?"#ff72df":i%4===1?"#8affc2":i%4===2?"#e9dbad":"#49755a"
}));
record(["Three unicorns. Building now legally a smoothie.",
"Foam has achieved sentience. Please tip it.",
"The landlord has been added to the group chat.",
"Structural integrity: decaf."][((stats.events-1)%4)]);
}
function step(dt){
t+=dt;arrival+=dt;
while(arrival>=1.55){arrival-=1.55;spawn()}
if(event){
const age=t-event.start;
if(age>=.65&&!event.evacuated){
event.evacuated=true;
stats.evacs+=customers.length;
customers.forEach((c,i)=>{
c.kind="escape";c.escapeAt=t;c.vx=-rnd(130,240);c.vy=rnd(15,65);
departing.push(c);
});
customers=[];
}
if(age>=9){
event=null;debris=[];service=0;
record("Rebuilt with the same questionable ingredients.");
}
} else {
// Remove exiting holders BEFORE serving at the ten-second boundary:
// the counter therefore sees the four preceding drink rolls, not five.
for(let i=customers.length-1;i>=0;i--){
const c=customers[i];
if(c.kind==="drink" && t-c.heldAt>=10-1e-7){
customers.splice(i,1);
c.kind="exit";c.unicorn=false;c.x=321;c.y=472;c.escapeAt=t;
departing.push(c);
}
}
while(customers.length<8 && line.length){
const c=line.shift();
c.slot=seats.findIndex((_,i)=>!customers.some(p=>p.slot===i));
c.kind="queue";customers.push(c);
}
const q=customers.filter(c=>c.kind==="queue");
q.forEach((c,i)=>{
const pos=queueTarget(i);
glide(c,pos[0],pos[1],dt);
});
customers.filter(c=>c.kind==="drink").forEach(c=>{
const age=t-c.heldAt;
if(age<1.4){glide(c,...seats[c.slot],dt,4)}
else if(age<8.5){glide(c,...seats[c.slot],dt,5)}
else {
// A smooth, timed departure that is still INSIDE until age 10.
const f=clamp((age-8.5)/1.5,0,1);
c.x=seats[c.slot][0]*(1-f)+330*f;
c.y=seats[c.slot][1]*(1-f)+472*f;
}
});
service=Math.min(2,service+dt);
const first=q[0];
if(service>=2-1e-7 && first && Math.hypot(first.x-820,first.y-330)<10){
service=0;
lastDie=fairD6();
first.kind="drink";first.unicorn=lastDie===6;first.heldAt=t;
first.x=820;first.y=330;
stats.served++;stats.since++;
if(first.unicorn)stats.produced++;
if(activeCount()>=3)trigger();
}
}
line.forEach((c,i)=>glide(c,...lineTarget(i),dt,5));
departing.forEach(c=>{
if(c.kind==="escape"){c.x+=c.vx*dt;c.y+=c.vy*dt}
else {c.x-=115*dt;c.y+=18*dt}
});
departing=departing.filter(c=>t-c.escapeAt<4 && c.x>-40);
}
function updateUI(){
const n=activeCount();
$("inside").textContent=customers.length;
$("occupancy").style.width=customers.length/8*100+"%";
$("active").textContent=n+" / 3";
$("waiting").textContent=line.length;
$("die").textContent=lastDie===null?"—":lastDie===6?"⚅ 6 · UNICORN":"⚀⚁⚂⚃⚄"[lastDie-1]+" "+lastDie+" · normal";
$("served").textContent=stats.served.toLocaleString();
$("produced").textContent=stats.produced.toLocaleString();
$("rate").textContent=stats.served?(100*stats.produced/stats.served).toFixed(2)+"%":"—";
$("events").textContent=stats.events;
$("since").textContent=stats.since;
$("mean").textContent=stats.events?(stats.completed/stats.events).toFixed(1):"—";
$("evacs").textContent=stats.evacs;
$("balked").textContent=stats.balked;
$("clock").textContent=timeString(t)+" simulated"+(paused?" · PAUSED":"");
$("status").textContent=event?"NEON UNICORN EVENT":
n===2?"TWO UNICORNS · LOAD-BEARING FOAM":
n===1?"ONE UNICORN · MILD REALITY LEAK":"ORDINARY COFFEE OPERATIONS";
$("status").style.color=event||n===2?"#ff71d9":n===1?"#8fffc0":"#b5f6bb";
}
function rect(x,y,w,h,color,r=0){
ctx.fillStyle=color;ctx.beginPath();
if(r)ctx.roundRect(x,y,w,h,r);else ctx.rect(x,y,w,h);
ctx.fill();
}
function text(s,x,y,size=14,color="#dce9df",align="left",weight=500){
ctx.fillStyle=color;ctx.textAlign=align;ctx.font=weight+" "+size+"px system-ui,sans-serif";ctx.fillText(s,x,y);
}
function circle(x,y,r,color){
ctx.fillStyle=color;ctx.beginPath();ctx.arc(x,y,r,0,Math.PI*2);ctx.fill();
}
function lineDraw(x1,y1,x2,y2,color,width=2){
ctx.strokeStyle=color;ctx.lineWidth=width;ctx.beginPath();ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.stroke();
}
function polygon(points,color){
ctx.fillStyle=color;ctx.beginPath();points.forEach((p,i)=>i?ctx.lineTo(...p):ctx.moveTo(...p));ctx.closePath();ctx.fill();
}
function sparkle(x,y,r,color,rotation=0){
ctx.save();ctx.translate(x,y);ctx.rotate(rotation);
polygon([[0,-r],[r*.26,-r*.26],[r,0],[r*.26,r*.26],[0,r],[-r*.26,r*.26],[-r,0],[-r*.26,-r*.26]],color);
ctx.restore();
}
function drawShop(n,alpha=1){
ctx.save();ctx.globalAlpha=alpha;
const wobble=n>=2&&!reduced?Math.sin(t*15)*2.6:0;
ctx.translate(wobble,n>=2&&!reduced?Math.cos(t*19)*1.8:0);
ctx.shadowColor=n?"#e168ff":"transparent";
ctx.shadowBlur=n===1?14:n>=2?27:0;
rect(323,173,644,350,"#355640",12);
ctx.shadowBlur=0;
rect(335,189,620,318,"#192e23",5);
// Floor grid
ctx.strokeStyle="#294132";ctx.lineWidth=1;
for(let x=350;x<955;x+=35)lineDraw(x,228,x,506,"#294132",1);
for(let y=240;y<506;y+=35)lineDraw(336,y,954,y,"#294132",1);
rect(323,151,644,66,"#e4d9ba",8);
text("STARBUCKLED",642,194,29,"#234b35","center",900);
circle(367,183,23,"#226444");
text("★",367,192,26,"#efeada","center");
text("COFFEE • CONSEQUENCES",864,186,11,"#416044","center",800);
// Counter
rect(772,232,158,130,"#638369",6);
rect(767,229,168,23,"#b7c4a5",4);
rect(857,200,60,31,"#17291f",3);
text("ROLL →",843,278,12,"#e0ecd9","center",800);
rect(790,293,35,27,"#263d30",3);
circle(806,299,5,"#dbdfc0");
text("BARISTA",846,344,10,"#1a3324","center",800);
rect(869,296,40,27,"#162b21",3);
text("$",889,314,17,"#adceac","center");
seats.forEach(([x,y])=>{
circle(x,y,21,"#304b38");circle(x,y,16,"#4c6245");
circle(x+30,y,9,"#294c39");
});
// Entrance notch and arrows
rect(319,447,24,51,"#0f2119");
lineDraw(338,445,338,439,"#b7e5c0",4);
lineDraw(338,501,338,509,"#b7e5c0",4);
text("IN / OUT",352,500,10,"#b7c6b5");
text("OCCUPANCY: 8 MAX. REALITY: OPTIONAL.",642,544,11,"#6b9b7c","center",700);
// Back-wall promotional poster
rect(359,234,52,77,"#123e2c",4);
text("1 IN 6",385,254,11,"#aff6c1","center",800);
text("IS",385,273,9,"#a9c3b1","center");
text("MAGIC*",385,292,11,"#ff91de","center",800);
ctx.restore();
}
function drawCustomer(c){
const isDrink=c.kind==="drink"||c.kind==="escape";
const bob=isDrink?Math.sin(t*3+c.id)*1:Math.sin(t*5+c.id)*1.5;
ctx.save();ctx.translate(c.x,c.y+bob);
ctx.globalAlpha=c.kind==="escape"||c.kind==="exit"?clamp(1-(t-c.escapeAt)/4,0,1):1;
circle(0,4,12,"#07120b");
circle(0,0,10,c.color);
circle(3,-2,2,"#213329");
if(isDrink){
if(c.unicorn){
ctx.shadowColor="#ff63eb";ctx.shadowBlur=18;
circle(14,-3,12,"hsla("+((t*100+c.id*37)%360)+",100%,66%,.23)");
rect(9,-9,10,14,"hsl("+((t*130+c.id*41)%360)+",100%,68%)",2);
ctx.shadowBlur=0;
sparkle(17,-18,4,"#d8ffb1",t);
lineDraw(15,-10,18,-17,"#ff8ce9",2);
}else{
rect(9,-7,9,12,"#dbdfbd",2);
rect(8,-9,11,3,"#e9efde",1);
lineDraw(14,-9,16,-14,"#96bd8b",2);
}
}
ctx.restore();
}
function drawUnicorn(age){
const grow=clamp((age-.25)/1.1,0,1);
const fade=clamp((9-age)/1.6,0,1);
if(grow<=0)return;
ctx.save();ctx.globalAlpha=fade;
const beat=Math.sin(age*6), move=reduced?beat*.2:beat;
ctx.translate(645+Math.sin(age*2.5)*25,354+move*17+(1-grow)*140);
ctx.scale(grow,grow);ctx.rotate(move*.075);
const hue=(age*95)%360;
ctx.shadowColor="hsl("+hue+",100%,65%)";ctx.shadowBlur=30;
// Tail ribbons
for(let i=0;i<7;i++){
ctx.strokeStyle="hsl("+(hue+i*42)+",100%,68%)";ctx.lineWidth=10;
ctx.beginPath();ctx.moveTo(-112,0);
ctx.bezierCurveTo(-180,-55+i*13,-160+Math.sin(age*7+i)*25,120,-218,70+i*7);
ctx.stroke();
}
// Four actively dancing legs
for(let i=0;i<4;i++){
const x=-85+i*49, a=age*6+i*Math.PI*.73;
const kneeX=x+Math.sin(a)*25,kneeY=96+Math.cos(a)*15;
lineDraw(x,30,kneeX,kneeY,"hsl("+(hue+i*63)+",100%,70%)",19);
lineDraw(kneeX,kneeY,kneeX+Math.cos(a)*30,137+Math.sin(a)*18,"#c1ffe8",15);
rect(kneeX+Math.cos(a)*30-16,132+Math.sin(a)*18,34,15,"#ff6ada",5);
}
ctx.fillStyle="#a1ffe5";ctx.beginPath();ctx.ellipse(0,0,123,63,0,0,Math.PI*2);ctx.fill();
polygon([[64,-24],[91,-126],[132,-127],[145,-3]],"#caffef");
ctx.save();ctx.translate(124,-121);ctx.rotate(-.14+move*.12);
ctx.fillStyle="#dcfff0";ctx.beginPath();ctx.ellipse(16,0,66,35,0,0,Math.PI*2);ctx.fill();
polygon([[-19,-24],[-28,-63],[2,-32]],"#ff83df");
polygon([[14,-29],[35,-120],[44,-29]],"#fffbb0");
for(let i=0;i<5;i++)lineDraw(22+i*3,-45-i*12,42-i,-47-i*12,"#ff82de",3);
rect(-6,-12,40,13,"#202936",5);rect(36,-12,25,13,"#202936",5);
lineDraw(28,-8,38,-8,"#202936",4);
circle(67,3,4,"#386750");
ctx.beginPath();ctx.strokeStyle="#386750";ctx.lineWidth=3;ctx.arc(53,9,13,0,Math.PI*.8);ctx.stroke();
ctx.restore();
// Mane
for(let i=0;i<8;i++){
circle(80+i*4,-99+i*14,15,"hsl("+(hue+i*40)+",100%,67%)");
}
sparkle(-25,-5,22,"#ff78e9",age);
ctx.shadowBlur=0;
text("UNIONIZED FOAM",0,8,12,"#24604e","center",900);
ctx.restore();
}
function drawEvent(){
const age=t-event.start;
const progress=clamp(age/9,0,1);
ctx.save();
const backdrop=ctx.createRadialGradient(645,310,20,645,310,540);
backdrop.addColorStop(0,"rgba(163,34,184,.45)");
backdrop.addColorStop(1,"rgba(5,13,11,0)");
ctx.fillStyle=backdrop;ctx.fillRect(0,0,W,H);
// Rotating ridiculous cosmic rays, smooth rather than strobing.
ctx.save();ctx.translate(645,340);ctx.rotate(age*.2);
for(let i=0;i<14;i++){
ctx.rotate(Math.PI/7);
polygon([[0,0],[650,-35],[650,35]],"hsla("+(i*26+age*30)+",100%,70%,.075)");
}ctx.restore();
if(age<.65)drawShop(3,1-age*.9);
if(age>6.8){
const a=clamp((age-6.8)/2.2,0,1);
ctx.save();ctx.translate(0,(1-a)*90);drawShop(0,a);ctx.restore();
}
debris.forEach(d=>{
const a=Math.max(0,age-.12);
const x=d.x+d.vx*a,y=d.y+d.vy*a+75*a*a;
if(y>640)return;
ctx.save();ctx.translate(x,y);ctx.rotate(d.rot+d.spin*a);
rect(-d.w/2,-d.h/2,d.w,d.h,d.color,2);ctx.restore();
});
if(age<2.5){
ctx.strokeStyle="hsla("+(age*130)+",100%,75%,"+(1-age/2.5)+")";
ctx.lineWidth=8;ctx.beginPath();ctx.ellipse(645,355,age*280,age*180,0,0,Math.PI*2);ctx.stroke();
}
drawUnicorn(age);
text(age<6.8?"NEON UNICORN EVENT":"REBUILDING WITH NO NEW SAFETY MEASURES",645,112,age<6.8?36:23,"#ffb4ed","center",900);
text(age<6.8?"YOUR DRINK IS NOW THE LANDLORD.":"PLEASE IGNORE THE HOOFPRINTS.",645,142,13,"#e7d5ed","center",700);
rect(390,582,510,6,"#273f32",3);
rect(390,582,510*progress,6,"#ff7bdf",3);
text("INCIDENT "+event.number+" / CLAIM PROCESSING",645,613,11,"#bca6c0","center",700);
ctx.restore();
}
function draw(){
const sx=canvas.width/W,sy=canvas.height/H;
ctx.setTransform(sx,0,0,sy,0,0);
ctx.clearRect(0,0,W,H);
rect(0,0,W,H,"#0d1d17");
// Street and ambient scenery.
rect(0,446,319,155,"#18281f");
for(let x=16;x<320;x+=38)lineDraw(x,601,x+16,601,"#3c5041",3);
rect(0,614,W,36,"#0a1610");
text("THE PATIENT SIDEWALK",147,419,11,"#6e937a","center",800);
text("EACH DOT IS ONE CUSTOMER. NO ONE GETS A SECOND ROLL.",24,640,10,"#688b72");
circle(86,141,32,"#1d3c28");rect(81,167,10,103,"#33432d");
circle(1048,276,30,"#1d3c28");rect(1044,302,9,70,"#33432d");
lineDraw(1048,386,1048,454,"#344b39",5);
circle(1048,385,13,"#b6d3a4");
const n=activeCount();
if(!event){
drawShop(n);
if(n){
const intensity=n===1?.09:.2;
const g=ctx.createRadialGradient(640,335,20,640,335,300);
g.addColorStop(0,"hsla("+(t*35%360)+",100%,65%,"+intensity+")");
g.addColorStop(1,"transparent");ctx.fillStyle=g;ctx.fillRect(320,160,660,375);
const count=n===1?7:30;
for(let i=0;i<count;i++){
const x=365+((i*83+t*12)%550),y=220+((i*59-t*22)%260+260)%260;
sparkle(x,y,2+(i%3),"hsla("+(i*43+t*45)+",100%,74%,.7)",t+i);
}
if(n===2){
text("THE ESPRESSO MACHINE KNOWS YOUR NAME",642,126,13,"#f69bdf","center",800);
if(!reduced){
ctx.globalAlpha=.06+.04*Math.sin(t*5);
rect(323,173,644,350,"#ff69d5",12);ctx.globalAlpha=1;
}
}
} else {
text("TODAY'S SPECIAL: PLAUSIBLE DENIABILITY",642,126,12,"#85a990","center",700);
}
// A visible coffee timer. Never a catastrophe countdown.
rect(785,371,135,4,"#0b1810",2);
rect(785,371,135*service/2,4,"#b6ddb0",2);
text("2s / ORDER",853,397,10,"#8aa891","center");
}else drawEvent();
line.forEach(drawCustomer);
customers.forEach(drawCustomer);
departing.forEach(drawCustomer);
if(paused){
rect(20,25,112,33,"#203e2c",6);text("Ⅱ PAUSED",76,47,13,"#c7f2c8","center",800);
}
}
function resize(){
const r=canvas.getBoundingClientRect();
const d=Math.min(devicePixelRatio||1,2);
canvas.width=Math.round(r.width*d);
canvas.height=Math.round(r.height*d);
draw();
}
$("speed").addEventListener("input",e=>{
speed=speeds[Number(e.target.value)];$("speedLabel").textContent=speed+"×";
});
$("pause").addEventListener("click",()=>{
paused=!paused;$("pause").textContent=paused?"Resume":"Pause";updateUI();
});
$("reset").addEventListener("click",()=>{
initialize();draw();
});
document.addEventListener("visibilitychange",()=>{
// Hidden tabs do not accumulate hours of catch-up simulation.
lastFrame=performance.now();accumulator=0;
});
function frame(now){
const elapsed=Math.min((now-lastFrame)/1000,.1);
lastFrame=now;
if(!paused&&!document.hidden){
accumulator+=elapsed*speed;
while(accumulator>=DT){step(DT);accumulator-=DT}
}
draw();
if(now-uiAt>180){updateUI();uiAt=now}
requestAnimationFrame(frame);
}
initialize();
new ResizeObserver(resize).observe(canvas);
resize();
requestAnimationFrame(frame);
</script>
</body>
</html>
The shop fills, the line forms, and the counter settles into one drink every two simulated seconds. Ordinary customers leave with ordinary coffee. One live unicorn adds glow; two make the building wobble and reality leak. Only a third simultaneous holder starts the explosion, dancing sunglasses-wearing unicorn, evacuation, and rebuild.
At normal speed, the first few minutes may contain a catastrophe—or none. At 32×, several simulated minutes pass quickly, but the odds remain unchanged. The observed rate includes every drink, including those sold just before a disaster.
Tuned: arrival rate, ten-second holding time, capacity, and service rate deliberately create five overlapping drink opportunities. The outside queue caps at 24. Recovery lasts nine seconds. Departing holders are removed before a simultaneous counter roll, preventing an accidental sixth overlapping drink. No odds are nudged.
Limitations: customers glide through furniture and one another; evacuations are visual, not a crowd-physics model. The theoretical 67.4-drink average assumes uninterrupted service, so startup movement adds time. Small samples can look suspiciously lucky or unlucky. Hidden tabs pause rather than catching up, and overloaded rendering slows wall-clock progress instead of skipping simulation steps.