/* Doorbell Simulator: the look of the launch poster (poster/poster.html): navy speed-line background,
   yellow block title with red and black drop shadows, red banner, yellow name plates, P1/P2 tags.
   Fonts are shipped in fonts/ (SIL Open Font License, see fonts/OFL-*.txt); no runtime font requests. */
@font-face { font-family: "Bungee"; src: url(fonts-f79efe87/bungee-latin.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: "Archivo Black"; src: url(fonts-f79efe87/archivo-black-latin.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: "Archivo"; src: url(fonts-f79efe87/archivo-latin.woff2) format("woff2"); font-weight: 600 800; font-style: normal; font-display: block; }

:root { --bg: #0b1026; --bg2: #1b2a6b; --yellow: #ffd400; --red: #e3262f; --ink: #0a0a0a; --white: #fff;
  --display: "Bungee", "Archivo Black", Impact, sans-serif; --heavy: "Archivo Black", "Archivo", Arial Black, sans-serif; --text: "Archivo", -apple-system, system-ui, sans-serif; }
* { box-sizing: border-box; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: #fff; font-family: var(--text); font-weight: 600; overflow: hidden; overscroll-behavior: none; }

#stage { position: fixed; inset: 0; height: 100vh; height: 100dvh; overflow: hidden; touch-action: none; background: #000; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#stage.shake { animation: shake .35s linear; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translate(-5px, 3px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 2px); } }

/* Sense of speed while running: faint streaks radiating from the vanishing point, plus a vignette. */
#speed { position: absolute; inset: -10%; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: repeating-conic-gradient(from 0deg at 50% 42%, rgba(255,255,255,.13) 0deg 1.2deg, rgba(255,255,255,0) 1.2deg 7deg), radial-gradient(ellipse at 50% 42%, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, transparent 28%, #000 75%); mask-image: radial-gradient(ellipse at 50% 42%, transparent 28%, #000 75%); }
[data-state="running"] #speed.on { opacity: 1; animation: streak .5s steps(4) infinite; }
@keyframes streak { to { transform: rotate(7deg); } }
/* Ring feedback: a flash over the picture. */
#flash { position: absolute; inset: 0; background: #fff6b0; opacity: 0; pointer-events: none; }
#flash.go { animation: flash .3s ease-out; }
@keyframes flash { from { opacity: .6; } to { opacity: 0; } }

/* Distance along the walk. */
#progress { position: absolute; left: 0; right: 0; top: env(safe-area-inset-top, 0); height: 5px; background: rgba(10,10,10,.55); pointer-events: none; }
#progress-bar { height: 100%; width: 0; background: var(--yellow); }

/* Plates and tags, shared by the cards, the badge and the tally. */
.plate { background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); font-family: var(--heavy); text-transform: uppercase; letter-spacing: .02em; line-height: 1; white-space: nowrap; }
.tag { background: var(--white); color: var(--ink); border: 3px solid var(--ink); font-family: var(--text); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; line-height: 1; }

/* The chosen character, small in the top-left corner during play. */
#badge { position: absolute; left: 12px; top: calc(env(safe-area-inset-top, 0px) + 14px); width: 64px; pointer-events: none; }
#badge img { display: block; width: 64px; height: 80px; object-fit: cover; object-position: 55% 20%; border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--ink), 0 6px 14px rgba(0,0,0,.5); background: var(--ink); }
#badge .tag { position: absolute; top: -8px; left: -8px; font-size: 9px; padding: 3px 5px; }
#badge .plate { position: absolute; left: -6px; bottom: -10px; font-size: 9px; padding: 4px 6px; }

/* Ring tally. */
#tally { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; }
#tally-count { display: block; font-family: var(--display); font-size: 64px; line-height: 1; color: var(--yellow); text-shadow: 0 4px 0 var(--red), 0 7px 0 var(--ink), 0 10px 18px rgba(0,0,0,.6); }
#tally-count.pop { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(1); } 30% { transform: scale(1.55) rotate(-4deg); } 100% { transform: scale(1); } }
#tally .label { display: inline-block; margin-top: 2px; font-family: var(--text); font-weight: 800; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--white); text-shadow: 0 2px 0 var(--ink); }
#plus { position: absolute; left: 100%; top: 0; margin-left: 6px; font-family: var(--display); font-size: 28px; color: var(--white); text-shadow: 0 3px 0 var(--ink); opacity: 0; pointer-events: none; }
#plus.go { animation: rise .7s ease-out; }
@keyframes rise { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-50px); } }

#hint { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 118px); text-align: center; font-size: 14px; font-weight: 700; letter-spacing: .04em; opacity: .9; text-shadow: 0 1px 0 var(--ink), 0 2px 8px rgba(0,0,0,.9); pointer-events: none; transition: opacity 1s; }
#hint.gone { opacity: 0; }
/* "Loading the street ahead": shown when the player outruns the download. */
#status { position: absolute; left: 24px; right: 24px; bottom: calc(env(safe-area-inset-bottom, 0px) + 150px); text-align: center; font-family: var(--heavy); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; padding: 10px 14px; background: var(--red); color: var(--white); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); transform: rotate(-1.5deg); pointer-events: none; }
#status[hidden] { display: none; }
/* Big one-word moments: GO! at the start, THE DOORBELL on arrival. */
#shout { position: absolute; left: 0; right: 0; top: 36%; text-align: center; font-family: var(--display); font-size: 54px; line-height: 1; color: var(--yellow); text-shadow: 0 5px 0 var(--red), 0 9px 0 var(--ink), 0 14px 24px rgba(0,0,0,.6); pointer-events: none; }
#shout[hidden] { display: none; }
#shout.go { animation: slam 1.4s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes slam { 0% { opacity: 0; transform: scale(2.6) rotate(-6deg); } 18% { opacity: 1; transform: scale(1) rotate(-3deg); } 75% { opacity: 1; transform: scale(1.04) rotate(-3deg); } 100% { opacity: 0; transform: scale(1.1) rotate(-3deg); } }
#fps { position: absolute; left: 10px; top: calc(env(safe-area-inset-top, 0px) + 112px); font: 12px/1.3 ui-monospace, monospace; background: rgba(0,0,0,.5); padding: 4px 6px; border-radius: 6px; pointer-events: none; white-space: pre; }

/* Buttons. */
#controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 24px calc(env(safe-area-inset-bottom, 0px) + 22px); display: flex; flex-direction: column; gap: 14px; }
button.big { display: block; width: 100%; min-height: 86px; border: 4px solid var(--ink); border-radius: 0; background: var(--white); color: var(--ink); font-family: var(--display); font-size: 24px; line-height: 1; letter-spacing: .02em; box-shadow: 6px 6px 0 var(--red); touch-action: none; transform: rotate(-1deg); }
button.big:active, button.big.held { background: var(--yellow); box-shadow: 3px 3px 0 var(--red); transform: rotate(-1deg) translate(3px, 3px); }
button.big.ring { background: var(--red); color: var(--white); min-height: 118px; font-size: 40px; box-shadow: 7px 7px 0 var(--ink); transform: rotate(1deg); }
button.big.ring:active { background: #ff3b30; box-shadow: 3px 3px 0 var(--ink); transform: rotate(1deg) translate(4px, 4px); }
button.big.ring.pulse { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: rotate(1deg) scale(1); } 50% { transform: rotate(1deg) scale(1.035); } }
#reset { position: absolute; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 16px); background: none; border: 0; color: rgba(255,255,255,.6); font-family: var(--text); font-weight: 600; font-size: 12px; padding: 8px; text-shadow: 0 1px 0 var(--ink); }

/* Which controls show in which state. The game only goes forward: RUN until the stand, then RING. */
#run, #ring { display: none; }
[data-state="home"] #run, [data-state="running"] #run { display: block; }
[data-state="stand"] #ring { display: block; }
[data-state="loading"] #controls, [data-state="loading"] #tally, [data-state="loading"] #reset, [data-state="loading"] #progress, [data-state="loading"] #hint, [data-state="loading"] #badge,
[data-state="select"] #controls, [data-state="select"] #tally, [data-state="select"] #reset, [data-state="select"] #progress, [data-state="select"] #hint, [data-state="select"] #badge { display: none; }

/* Overlays in the poster's look. */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; }
.overlay[hidden] { display: none; }
.poster { background:
  radial-gradient(circle at 50% 40%, rgba(255,212,0,.26) 0, rgba(255,212,0,0) 42%),
  repeating-conic-gradient(from 0deg at 50% 40%, rgba(255,255,255,.055) 0deg 6deg, rgba(255,255,255,0) 6deg 15deg),
  radial-gradient(circle at 50% 35%, var(--bg2) 0, var(--bg) 70%); }
.poster::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.1) 1.2px, transparent 1.3px); background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 30%, transparent 75%, #000 100%); mask-image: linear-gradient(to bottom, #000 0, transparent 30%, transparent 75%, #000 100%); }
.box { position: relative; width: 100%; max-width: 380px; text-align: center; }
.eyebrow { font-family: var(--text); font-weight: 800; font-size: min(11px, 3.2vw); letter-spacing: .32em; color: var(--yellow); text-transform: uppercase; }
.logo { font-family: var(--display); font-weight: 400; font-size: 46px; line-height: .95; margin: 10px 0 18px; color: var(--yellow); text-transform: uppercase; text-shadow: 0 4px 0 var(--red), 0 7px 0 var(--ink), 0 12px 22px rgba(0,0,0,.6); letter-spacing: .01em; }
.logo.small { font-size: 36px; }
.box p { font-size: 17px; margin: 0 0 16px; }
.box p.how { line-height: 1.5; margin: 0 22px 24px; font-weight: 600; }
.box p.how b { font-weight: 800; color: var(--yellow); }
.launch { display: inline-block; background: var(--white); color: var(--ink); border: 5px solid var(--ink); box-shadow: 8px 8px 0 var(--red); padding: 18px 36px; transform: rotate(-1deg); font-family: var(--display); font-size: 26px; line-height: 1; text-transform: uppercase; margin-bottom: 30px; }
.launch:active { box-shadow: 4px 4px 0 var(--red); transform: rotate(-1deg) translate(4px, 4px); }
.banner { display: inline-block; background: var(--red); color: var(--white); padding: 10px 20px 11px; font-family: var(--heavy); font-size: min(17px, 4.3vw); letter-spacing: .12em; text-transform: uppercase; border: 4px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); white-space: nowrap; transform: rotate(-2deg); position: relative; z-index: 5; margin-top: -6px; }
.cards { display: flex; justify-content: center; gap: 30px; margin: 22px 0 44px; }
.card { position: relative; width: 148px; height: 196px; padding: 0; border: 5px solid var(--white); background: var(--ink); box-shadow: 0 0 0 4px var(--ink), 0 18px 36px rgba(0,0,0,.6); transition: transform .25s, opacity .25s, box-shadow .25s; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.card.emily { transform: rotate(-5deg); }
.card.emily img { object-position: 60% 25%; }
.card.dave { transform: rotate(5deg); }
.card.dave img { object-position: 50% 10%; }
.card .tag { position: absolute; top: -14px; left: -12px; font-size: 11px; padding: 5px 8px; }
.card.dave .tag { left: auto; right: -12px; }
.card .plate { position: absolute; bottom: -22px; left: -12px; font-size: 12px; padding: 8px 8px 9px; z-index: 6; }
.card.dave .plate { left: auto; right: -12px; }
.card.chosen { transform: rotate(0) scale(1.08); box-shadow: 0 0 0 4px var(--ink), 0 0 0 9px var(--yellow), 0 0 40px rgba(255,212,0,.7); z-index: 7; }
.cards.picked .card:not(.chosen) { opacity: .4; filter: grayscale(.8); }
.bar { height: 12px; background: rgba(10,10,10,.6); border: 3px solid var(--ink); overflow: hidden; margin: 0 24px 10px; }
#loading-bar { height: 100%; width: 0; background: var(--yellow); transition: width .15s; }
#loading-text { font-size: 13px; font-weight: 700; letter-spacing: .06em; opacity: .9; min-height: 1.4em; margin: 0; }
#fatal { z-index: 20; }
#rotate { display: none; }
@media (orientation: landscape) and (max-height: 500px) { #rotate { display: flex; z-index: 10; } }
@media (max-height: 700px) { .logo { font-size: 38px; margin-bottom: 10px; } .card { width: 128px; height: 170px; } .card .plate { font-size: 11px; } .cards { margin-bottom: 36px; } .launch { margin-bottom: 18px; } }
