/* Spot the Difference: a bar-top touchscreen cabinet on a dim bar. */
:root {
  --wood: #2a170c; --wood2: #3b2212; --ink: #fff; --navy: #0b1a4a; --navy2: #1a0f4f;
  --gold: #ffd23a; --gold2: #ff9d00; --red: #ff2d3c; --green: #2fe36b; --cyan: #3fe8ff;
  --hud: 54px; --ctrl: 64px; --gap: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #120a05; color: var(--ink); font-family: Rubik, system-ui, sans-serif;
  overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }

/* the bar top */
#bar {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 50% 42%, rgba(255,170,80,.20), transparent 70%),
    repeating-linear-gradient(91deg, rgba(0,0,0,.0) 0 22px, rgba(0,0,0,.18) 22px 24px, rgba(255,200,140,.03) 24px 61px, rgba(0,0,0,.12) 61px 63px),
    repeating-linear-gradient(89.3deg, transparent 0 7px, rgba(255,210,160,.035) 7px 8px),
    linear-gradient(180deg, #1a0d06, var(--wood) 30%, var(--wood2) 70%, #170b05);
}
#bar .ring { position: absolute; border-radius: 50%; border: 3px solid rgba(255,220,170,.06); box-shadow: inset 0 0 6px rgba(255,220,170,.05); }
#bar .r1 { width: 92px; height: 92px; left: 4%; top: 7%; }
#bar .r2 { width: 92px; height: 92px; left: calc(4% + 30px); top: calc(7% + 22px); border-width: 2px; opacity: .7; }
#bar .coaster { position: absolute; right: 5%; bottom: 6%; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #e9dcc4 0 56%, #c9b796 57% 60%, #e2d3b8 61%); opacity: .14; transform: rotate(-12deg); }

/* the cabinet */
#cab { position: fixed; inset: 0; display: grid; place-items: center; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
.bezel {
  position: relative; padding: 16px 16px 30px; border-radius: 26px;
  background: linear-gradient(160deg, #3a3d44, #121317 22%, #08090b 60%, #1b1c21);
  box-shadow: 0 2px 0 #50535c inset, 0 -2px 0 #000 inset, 0 30px 60px rgba(0,0,0,.65), 0 0 0 2px #000, 0 0 120px rgba(255,150,60,.10);
}
.screen {
  position: relative; overflow: hidden; border-radius: 10px; width: var(--sw, 900px); height: var(--sh, 500px);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(80,120,255,.35), transparent 70%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy2) 100%);
  box-shadow: 0 0 0 3px #000, inset 0 0 40px rgba(0,0,0,.6);
  user-select: none; -webkit-user-select: none;
}
.glass { position: absolute; inset: 0; pointer-events: none; border-radius: 10px;
  background: linear-gradient(115deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,0) 28%, rgba(255,255,255,0) 70%, rgba(255,255,255,.035) 85%, rgba(255,255,255,0) 100%),
    radial-gradient(ellipse 18% 10% at 78% 88%, rgba(255,255,255,.035), transparent 70%),
    radial-gradient(ellipse 10% 7% at 22% 72%, rgba(255,255,255,.03), transparent 70%); }
.grille { position: absolute; left: 0; right: 0; bottom: 7px; height: 16px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.grille span { width: 120px; height: 8px; border-radius: 4px; background: repeating-linear-gradient(90deg, #000 0 3px, #2a2c33 3px 6px); }
.grille .led { width: 6px; height: 6px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 8px #ff3b30; }
.grille .snd { position: absolute; right: 22px; bottom: -5px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #1d1f25; color: #6c707b; font-size: 13px; line-height: 26px; padding: 0; }
.grille .snd.on { color: var(--gold); }

/* HUD */
.hud { position: absolute; left: 0; right: 0; top: 0; height: var(--hud); display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 12px; padding: 0 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0) 60%), linear-gradient(180deg, #2b3fb8, #16207a);
  border-bottom: 2px solid #000; box-shadow: 0 2px 0 rgba(120,160,255,.35); }
.hud-round { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; overflow: hidden; }
.hud-round b { font: 400 20px/1 Bungee, sans-serif; color: var(--gold); text-shadow: 0 2px 0 #7a3b00, 0 0 12px rgba(255,190,0,.35); }
.hud-round span { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
.hud-round small { font-size: 12px; letter-spacing: .08em; color: #a9b8ff; overflow: hidden; text-overflow: ellipsis; }
.hud-dots { display: flex; gap: 6px; }
.hud-dots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255,255,255,.55); background: rgba(0,0,0,.25); transition: transform .2s; }
.hud-dots i.on { border-color: #fff; background: radial-gradient(circle at 35% 30%, #fff8, transparent 40%), var(--gold); box-shadow: 0 0 10px var(--gold); transform: scale(1.12); }
.hud-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.hud-score small { font: 400 10px Bungee, sans-serif; color: #a9b8ff; }
.hud-score b { font: 400 22px Bungee, sans-serif; color: #fff; text-shadow: 0 2px 0 #000; font-variant-numeric: tabular-nums; }
.hud-hi b { color: var(--gold); font-size: 16px; text-shadow: 0 2px 0 #7a3b00; }

/* initials and the high-score board */
.initials { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(4,6,30,.55); }
.initials[hidden] { display: none; }
.ini-in { display: grid; justify-items: center; gap: 8px; padding: 18px 26px 22px; border-radius: 18px; max-width: 92%;
  background: linear-gradient(180deg, rgba(10,16,70,.96), rgba(30,10,80,.96)); box-shadow: 0 0 0 4px #000, 0 0 0 7px var(--gold), 0 18px 40px rgba(0,0,0,.6); text-align: center; }
.ini-in > b { font: 400 clamp(20px, 3.4vw, 34px)/1 Bungee, sans-serif; color: var(--gold); text-shadow: 0 3px 0 #8a3b00; animation: attract 1s steps(2) infinite; }
.ini-score { font: 400 clamp(22px, 3vw, 30px)/1 Bungee, sans-serif; color: #fff; font-variant-numeric: tabular-nums; }
.ini-in small { font: 400 12px Bungee, sans-serif; letter-spacing: .08em; color: #a9b8ff; }
.ini-slots { display: flex; gap: 10px; margin: 2px 0 6px; }
.slot { display: grid; justify-items: center; gap: 4px; }
.slot button { border: 0; padding: 0; background: none; }
.slot .arrow { width: 52px; height: 34px; border-radius: 10px; color: var(--gold); font-size: 16px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 2px rgba(255,255,255,.18); }
.slot .arrow:active { background: rgba(255,210,58,.3); }
.slot .letter { width: 52px; height: 58px; border-radius: 8px; font: 400 36px/58px Bungee, sans-serif; color: #fff; background: #050821; box-shadow: inset 0 2px 4px #000, 0 0 0 2px #000, 0 0 0 4px #9aa6d8; }
.slot.on .letter { color: var(--gold); box-shadow: inset 0 2px 4px #000, 0 0 0 2px #000, 0 0 0 4px var(--gold), 0 0 14px rgba(255,210,58,.6); }
.board-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; min-width: 220px; }
.board-list[hidden] { display: none; }
.board-list li { display: grid; grid-template-columns: 3.2em 3.6em 1fr; gap: 10px; align-items: baseline; font: 400 18px/1.2 Bungee, sans-serif; color: #fff; text-align: left; }
.board-list li i { font-style: normal; color: #a9b8ff; font-size: 13px; }
.board-list li span { text-align: right; font-variant-numeric: tabular-nums; }
.board-list li.me { color: var(--gold); animation: blink .45s steps(2) 8; }
.hiscores { max-width: 1040px; margin: 0 auto 16px; padding: 12px 16px; border-radius: 12px; background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px rgba(255,210,58,.35); display: grid; justify-items: center; gap: 4px; }
.hiscores[hidden] { display: none; }
.hiscores > b { font: 400 14px Bungee, sans-serif; color: var(--gold); letter-spacing: .06em; }

/* the two pictures */
.boards { position: absolute; left: var(--pad, 12px); right: var(--pad, 12px); top: calc(var(--hud) + var(--gap)); bottom: calc(var(--ctrl) + var(--gap)); display: flex; align-items: center; justify-content: center; gap: var(--gap); }
.boards.stack { flex-direction: column; }
.board { position: relative; width: var(--bw, 400px); height: var(--bh, 225px); flex: none; background: #000; border-radius: 4px; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #000, 0 6px 18px rgba(0,0,0,.6); touch-action: manipulation; cursor: crosshair; }
.pic { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 4px; -webkit-user-drag: none; }
.marks { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.mark { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.mark.found { border: 4px solid #ff2a2a; box-shadow: 0 0 0 2px #fff, inset 0 0 0 2px #fff; animation: pop .35s cubic-bezier(.2,1.6,.4,1) both; }
.mark.miss { width: 44px; height: 44px; animation: miss .7s ease-out forwards; }
.mark.miss::before, .mark.miss::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46px; height: 9px; margin: -4.5px 0 0 -23px; background: var(--red); border-radius: 3px; box-shadow: 0 0 0 2px #fff; }
.mark.miss::before { transform: rotate(45deg); } .mark.miss::after { transform: rotate(-45deg); }
.mark.hint { border: 4px dashed var(--cyan); box-shadow: 0 0 18px var(--cyan); animation: hint .5s ease-in-out 5 alternate; }
.mark.reveal { border: 4px solid var(--gold); box-shadow: 0 0 0 2px #000, 0 0 16px var(--gold); animation: blink .45s steps(2) infinite; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes miss { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; } 25% { transform: translate(-50%, -50%) scale(1.1); } 80% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
@keyframes hint { from { transform: translate(-50%, -50%) scale(1.25); opacity: .45; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes blink { 50% { opacity: .25; } }
.boards.shake { animation: shake .3s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* controls */
.ctrl { position: absolute; left: 0; right: 0; bottom: 0; height: var(--ctrl); display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 0 12px;
  background: linear-gradient(180deg, #16207a, #0d1250); border-top: 2px solid #000; box-shadow: inset 0 2px 0 rgba(120,160,255,.3); }
.btn { position: relative; border: 0; padding: 0 18px; height: 44px; border-radius: 22px; font: 400 16px/44px Bungee, sans-serif; letter-spacing: .02em; color: #2b1400;
  background: linear-gradient(180deg, #fff6b8 0%, var(--gold) 30%, var(--gold2) 100%); box-shadow: 0 4px 0 #8a4a00, 0 6px 10px rgba(0,0,0,.5), inset 0 -3px 0 rgba(0,0,0,.15); text-shadow: 0 1px 0 rgba(255,255,255,.5); white-space: nowrap; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a4a00, 0 2px 4px rgba(0,0,0,.5); }
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.btn[disabled] { filter: grayscale(1) brightness(.7); cursor: default; }
.btn-hint span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 4px; border-radius: 12px; background: #2b1400; color: var(--gold); font-size: 13px; line-height: 1; vertical-align: 2px; }
.btn-menu { color: #fff; text-shadow: 0 1px 0 #000; background: linear-gradient(180deg, #ff9aa2 0%, #ff3346 30%, #b5001a 100%); box-shadow: 0 4px 0 #5d000c, 0 6px 10px rgba(0,0,0,.5), inset 0 -3px 0 rgba(0,0,0,.15); }
.btn-menu:active { box-shadow: 0 1px 0 #5d000c; }
.btn-go { color: #fff; text-shadow: 0 1px 0 #000; background: linear-gradient(180deg, #a8ffbf 0%, #2fe36b 30%, #0d9a3c 100%); box-shadow: 0 4px 0 #04501d, 0 6px 10px rgba(0,0,0,.5), inset 0 -3px 0 rgba(0,0,0,.15); }
.btn-ghost { color: #fff; background: linear-gradient(180deg, #6b7cff, #2b3fb8); box-shadow: 0 4px 0 #0b1250, 0 6px 10px rgba(0,0,0,.5); text-shadow: 0 1px 0 #000; }
.timer { position: relative; height: 26px; border-radius: 13px; background: #050821; box-shadow: inset 0 2px 4px #000, 0 0 0 2px #000, 0 0 0 4px #9aa6d8; overflow: hidden; }
.timer .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: left center; border-radius: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 45%), linear-gradient(90deg, #ff2d3c, #ffd23a 35%, #2fe36b 70%); background-size: 100% 100%, var(--tw, 600px) 100%; }
.timer.low .fill { animation: low .5s steps(2) infinite; }
@keyframes low { 50% { filter: brightness(1.8) saturate(1.4); } }
.timer .start { position: absolute; inset: 0; width: 100%; border: 0; background: linear-gradient(180deg, #fff6b8, var(--gold) 40%, var(--gold2)); color: #2b1400; font: 400 15px/26px Bungee, sans-serif; letter-spacing: .04em; animation: attract 1s steps(2) infinite; }
.timer .start[hidden] { display: none; }
@keyframes attract { 50% { color: #a35200; } }

/* banner between rounds */
.banner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .2s; }
.banner.on { opacity: 1; }
.banner-in { display: grid; justify-items: center; gap: 8px; padding: 18px 34px 20px; border-radius: 18px; transform: scale(.6) rotate(-3deg); transition: transform .35s cubic-bezier(.2,1.6,.4,1);
  background: linear-gradient(180deg, rgba(10,16,70,.93), rgba(30,10,80,.93)); box-shadow: 0 0 0 4px #000, 0 0 0 7px var(--gold), 0 18px 40px rgba(0,0,0,.6); max-width: 90%; text-align: center; }
.banner.on .banner-in { transform: scale(1) rotate(-3deg); }
.banner-in > b { font: 400 clamp(30px, 6vw, 58px)/1 Bungee, sans-serif; color: var(--gold); text-shadow: 0 4px 0 #8a3b00, 0 0 24px rgba(255,190,0,.45); }
.banner-in > span { font-weight: 700; font-size: clamp(15px, 2.2vw, 20px); color: #fff; }
.banner.bad .banner-in > b { color: #ff5a64; text-shadow: 0 4px 0 #5d000c, 0 0 24px rgba(255,40,60,.5); }

/* sheets: case study, menu, about */
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); background: rgba(10,5,2,.55); }
.sheet[hidden] { display: none; }
.sheet-bezel { width: min(1100px, 100%); height: min(100%, 1000px); display: grid; grid-template-rows: auto 1fr; border-radius: 22px; padding: 12px; overflow: hidden;
  background: linear-gradient(160deg, #3a3d44, #121317 22%, #08090b 60%, #1b1c21); box-shadow: 0 30px 60px rgba(0,0,0,.65), 0 0 0 2px #000; }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0) 60%), linear-gradient(180deg, #2b3fb8, #16207a); border-bottom: 2px solid #000; }
.sheet-name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.sheet-name b { font: 400 clamp(20px, 3vw, 28px)/1.1 Bungee, sans-serif; color: var(--gold); text-shadow: 0 3px 0 #7a3b00; }
.sheet-name small { font-size: 13px; letter-spacing: .1em; color: #a9b8ff; }
.sheet-btns { display: flex; gap: 10px; margin-left: auto; }
.sheet-body { overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 18px; border-radius: 0 0 10px 10px; background: linear-gradient(180deg, var(--navy), var(--navy2)); min-height: 0; }
#case .ab-media { --ab-fg: #fff; --ab-muted: #b8c4ff; --ab-accent: var(--gold); --ab-chrome: 150px; max-width: 900px; margin: 0 auto; }
#case .ab-lede { font-size: 17px; line-height: 1.5; }
#case .ab-text { line-height: 1.55; color: #e4e8ff; }
#case .ab-heading { font: 400 16px Bungee, sans-serif; color: var(--gold); }
.realpic { margin: 0 auto 22px; max-width: 900px; display: grid; justify-items: center; }
.realpic img { display: block; max-width: 100%; height: auto; max-height: calc(100svh - 150px); object-fit: contain; border-radius: 4px; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #000; }

.rounds { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; max-width: 1040px; }
.rounds li { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.rounds .thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px #fff; position: relative; }
.rounds .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rounds .thumb i { position: absolute; right: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px #000; display: none; }
.rounds li.done .thumb i { display: block; }
.rounds .meta { min-width: 0; display: grid; gap: 4px; }
.rounds .meta b { font: 400 12px Bungee, sans-serif; color: var(--gold); }
.rounds .meta span { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rounds .meta small { font-size: 11px; letter-spacing: .08em; color: #a9b8ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rounds .acts { display: flex; gap: 8px; margin-top: 2px; }
.rounds .acts .btn { height: 32px; line-height: 32px; font-size: 12px; padding: 0 12px; }
.about-body { line-height: 1.6; font-size: 17px; }
.about-body > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.about-body a { color: var(--gold); }
.about-body h3 { font: 400 15px Bungee, sans-serif; color: var(--gold); margin: 26px auto 8px; }
.about-body ul { padding-left: 20px; }

/* loader: the cabinet booting */
#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #000; transition: opacity .35s; }
#loader.done { opacity: 0; pointer-events: none; }
.boot { display: grid; justify-items: center; gap: 16px; }
.boot b { font: 400 16px Bungee, sans-serif; letter-spacing: .2em; color: var(--gold); animation: attract 1s steps(2) infinite; }
.boot-dots { display: flex; gap: 10px; }
.boot-dots i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.5); }
.boot-dots i.on { border-color: #ff2a2a; box-shadow: 0 0 0 2px #fff, inset 0 0 0 2px #fff; }
.boot-bar { width: min(320px, 70vw); height: 18px; border-radius: 9px; background: #050821; box-shadow: 0 0 0 2px #000, 0 0 0 4px #9aa6d8; overflow: hidden; }
#boot-fill { height: 100%; width: 0; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 45%), linear-gradient(90deg, #2fe36b, #ffd23a); transition: width .25s; }

@media (max-width: 700px) {
  :root { --hud: 66px; --ctrl: 60px; --gap: 8px; }
  .bezel { padding: 10px 10px 24px; border-radius: 20px; }
  .hud { grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; gap: 4px 10px; padding: 6px 10px; }
  .hud-hi b { font-size: 14px; }
  .slot .arrow, .slot .letter { width: 48px; }
  .board-list li { font-size: 16px; }
  .hud-round { grid-column: 1 / -1; gap: 8px; }
  .hud-round b { font-size: 16px; } .hud-round span { font-size: 15px; } .hud-round small { font-size: 11px; }
  .hud-dots i { width: 15px; height: 15px; border-width: 2px; }
  .hud-score { flex-direction: row; align-items: baseline; gap: 6px; } .hud-score b { font-size: 18px; }
  .ctrl { gap: 8px; padding: 0 8px; }
  .btn { padding: 0 12px; font-size: 13px; height: 40px; line-height: 40px; }
  .timer .start { font-size: 12px; }
  .sheet-bezel { padding: 8px; border-radius: 16px; }
  .sheet-body { padding: 12px; }
  .grille span { width: 80px; }
}
@media (prefers-reduced-motion: reduce) { .mark, .banner-in, .timer .start, .boot b { animation: none !important; transition: none !important; } }
