/* A small, discoverable toy on the desk. */
.laptop {
  position: absolute; z-index: 3; left: 49%; bottom: calc(var(--desk-h) - 8px);
  width: 132px; height: 102px; padding: 0; border: 0; background: none;
  transform: translateX(-50%); perspective: 450px; cursor: pointer; color: var(--ink);
}
.laptop-lid {
  position: absolute; left: 7px; right: 7px; bottom: 14px; height: 80px;
  border: 2px solid #4a4039; border-radius: 7px 7px 3px 3px;
  background: #b8afa1; box-shadow: inset 0 0 0 3px #d9d0bf;
  transform-origin: center bottom; transform: rotateX(-90deg); opacity: 0;
  transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .2s;
}
.laptop-screen { position: absolute; inset: 6px; border-radius: 3px; background: #203b37; color: #a8f0d8; display: flex; flex-direction: column; justify-content: center; gap: 5px; font: 800 12px/1.2 'JetBrains Mono', monospace; opacity: 0; transition: opacity .3s; }
.laptop-screen small { font: 8px 'JetBrains Mono', monospace; letter-spacing: 1px; }
.laptop-base { opacity: 0; position: absolute; left: 0; bottom: 0; width: 100%; height: 19px; }
.laptop:focus-visible { outline: 3px solid var(--mint-ink); outline-offset: 6px; border-radius: 8px; }
.laptop.is-open .laptop-lid { transform: rotateX(0); background: #847c71; opacity: 1; }
.laptop-closed { position: absolute; bottom: 0; left: 0; width: 100%; height: 18px; }
.laptop.is-open .laptop-closed { opacity: 0; }
.laptop.is-open .laptop-base { opacity: 1; }
.laptop.is-open .laptop-screen { opacity: 1; transition-delay: .25s; }
.laptop:disabled { cursor: default; }
.laptop-treasure { position: absolute; inset: 0 -18px -12px; pointer-events: none; z-index: 1; }
.laptop-treasure::before { content: ''; position: absolute; inset: 48px 0 0; background: radial-gradient(ellipse, #ffd26b70, #efb94325 45%, transparent 72%); animation: treasure-glow 3.6s ease-in-out infinite; }
.laptop-treasure i { position: absolute; left: var(--x); bottom: 18px; width: var(--size, 10px); height: var(--size, 10px); background: linear-gradient(135deg, #fff8d5 20%, #d79620 80%); clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); opacity: 0; animation: treasure-spark 3.8s ease-out infinite; animation-delay: var(--delay); }
.laptop-treasure i:nth-child(1) { --x: 15%; --delay: -1.1s; --drift: -7px; }
.laptop-treasure i:nth-child(2) { --x: 31%; --delay: -2.8s; --drift: 5px; --size: 7px; }
.laptop-treasure i:nth-child(3) { --x: 48%; --delay: -.3s; --drift: -4px; --size: 12px; }
.laptop-treasure i:nth-child(4) { --x: 64%; --delay: -2s; --drift: 7px; }
.laptop-treasure i:nth-child(5) { --x: 81%; --delay: -3.3s; --drift: 9px; --size: 8px; }
.laptop-treasure i:nth-child(6) { --x: 55%; --delay: -1.7s; --drift: -8px; --size: 6px; }
.laptop.is-open .laptop-treasure, .laptop:disabled .laptop-treasure { display: none; }
@keyframes treasure-glow { 0%, 100% { opacity: .4; transform: scale(.94); } 50% { opacity: .85; transform: scale(1.05); } }
@keyframes treasure-spark { 0%, 70%, 100% { opacity: 0; } 0% { transform: translate(0, 0) scale(.2) rotate(0); } 12% { opacity: 1; transform: translate(0, -8px) scale(1) rotate(10deg); } 38% { opacity: .85; transform: translate(var(--drift), -27px) scale(.85) rotate(35deg); } 70%, 100% { transform: translate(var(--drift), -49px) scale(.3) rotate(65deg); } }
@media (prefers-reduced-motion: reduce) {
  .laptop-treasure::before { animation: none; opacity: .5; }
  .laptop-treasure i { animation: none; }
}
.laptop-tooltip { position: absolute; bottom: 65px; left: 50%; transform: translateX(-50%); padding: 7px 12px; border-radius: 9px; background: #39352f; color: #fff4df; font: 800 12px/1.2 'Nunito', sans-serif; white-space: nowrap; box-shadow: 0 3px 9px #30291f26; pointer-events: none; opacity: 0; visibility: hidden; }
.laptop-tooltip::after { content: ''; position: absolute; top: 100%; left: calc(50% - 4px); border: 4px solid transparent; border-top-color: #39352f; }
.laptop:not(.is-open):focus-visible .laptop-tooltip { opacity: 1; visibility: visible; }
@media (hover: hover) {
  .laptop:not(.is-open):hover .laptop-tooltip { opacity: 1; visibility: visible; }
}
.game-running { overflow: hidden; }
.game-running .hero { opacity: 0; pointer-events: none; }
.hero { transition: opacity .4s; }
.game-running .psst { visibility: hidden; }
.bug-game[hidden], .game-hud[hidden], .game-message[hidden] { display: none; }
.bug-game { position: fixed; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.game-hud { position: fixed; bottom: 22px; left: 24px; right: 24px; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #fff0d5; text-shadow: 0 1px 1px #4c2e2280; pointer-events: none; }
.game-score-row { display: flex; align-items: center; gap: 32px; }
.game-score-item { display: flex; flex-direction: column; gap: 3px; }
.game-score-item > span { font-size: 11px; }
.game-score, .game-best b { font: 800 26px/1.1 'JetBrains Mono', monospace; }
.game-best { color: #f1dfc2; }
.game-controls { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.game-controls button { display: grid; place-items: center; font: 800 14px 'Nunito', sans-serif; border: 1px solid #fff0d540; border-radius: 10px; background: #4b2d1926; min-width: 44px; height: 44px; padding: 0 10px; cursor: pointer; color: #fff0d5; text-shadow: inherit; }
.game-controls button:hover { background: #4b2d194d; }
.game-controls button:focus-visible { outline: 2px solid #fff0d5; outline-offset: 3px; }
.game-controls svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.game-controls #game-exit { display: flex; align-items: center; gap: 8px; }
.resume-symbol, .sound-muted { display: none; }
.game-paused .pause-symbol, #game-sound[aria-pressed="true"] .sound-waves { display: none; }
.game-paused .resume-symbol, #game-sound[aria-pressed="true"] .sound-muted { display: block; }
#game-time { color: #367c9b; margin-top: 12px; font: 800 clamp(64px, 9vw, 92px)/1.1 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; letter-spacing: -4px; }
#game-time.is-urgent { color: #b74b33; }
#game-time.is-go { color: #317963; }
.game-confetti { position: absolute; left: 0; top: 0; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; }
#game-time[hidden], .game-message p[hidden] { display: none; }
.game-message { position: fixed; z-index: 8; left: 50%; top: 27%; transform: translateX(-50%); width: min(350px, calc(100% - 32px)); text-align: center; pointer-events: none; }
.game-message h2 { margin: 0 0 8px; font-size: 34px; line-height: 1.1; letter-spacing: -1px; }
.game-message:has(#game-time:not([hidden])) h2 { color: #807868; }
.game-message p { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin: 0; }
.game-message button { pointer-events: auto; margin-top: 18px; padding: 11px 22px; border: 1.5px solid var(--mint-ink); border-radius: 12px; background: var(--mint); color: var(--mint-ink); font: 900 14px 'Nunito', sans-serif; box-shadow: 0 3px 0 #134a43; cursor: pointer; }
.game-message button[hidden] { display: none; }
.game-bug { position: absolute; left: 0; top: 0; width: 64px; height: 64px; border: 0; padding: 0; background: none; pointer-events: auto; cursor: crosshair; touch-action: manipulation; will-change: transform; }
.game-clock { position: absolute; left: 0; top: 0; z-index: 2; width: 60px; padding: 0; border: 0; background: none; color: #59452d; pointer-events: auto; cursor: pointer; touch-action: manipulation; }
.game-clock svg { display: block; width: 60px; height: 60px; }
.game-clock span { display: inline-block; padding: 1px 7px; border-radius: 8px; background: #fff5d9; font: 900 13px/1.3 'JetBrains Mono', monospace; }
.game-clock:focus-visible { outline: 3px solid #367c9b; outline-offset: 4px; border-radius: 12px; }
.game-points.clock-points { color: #367c9b; font: 900 18px 'Nunito', sans-serif; white-space: nowrap; }
.has-cloud-boss .game-message:has(#game-time:not([hidden])) { top: 24px; }
.has-cloud-boss .game-message:has(#game-time:not([hidden])) h2 { font-size: 23px; }
.has-cloud-boss #game-time { margin-top: 4px; font-size: 64px; }
.cloud-boss { position: absolute; top: 0; left: 0; z-index: 1; width: 0; height: 0; pointer-events: none; }
.cloud-target { position: absolute; width: clamp(190px, 26vw, 260px); height: auto; left: 0; top: 0; translate: -50% -50%; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; touch-action: manipulation; border-radius: 45%; }
.cloud-target:disabled { cursor: default; }
.cloud-target svg { display: block; width: 100%; overflow: visible; }
.cloud-face { transform-origin: 130px 90px; transform: scale(var(--anger, 1)); }
.cloud-flinch, .cloud-knocked-out { display: none; }
.cloud-boss.is-hit .cloud-scowl, .cloud-boss.is-defeated .cloud-scowl { display: none; }
.cloud-boss.is-hit .cloud-flinch, .cloud-boss.is-defeated .cloud-knocked-out { display: inline; }
.has-cloud-boss:has(.cloud-boss.is-departing) .game-message { visibility: hidden; }
.cloud-boss.is-ready .cloud-target { outline: 3px solid #65bea9; outline-offset: 6px; background: #9fe3d233; }
.cloud-target:focus-visible { outline: 4px solid #367c9b; outline-offset: 7px; }
.cloud-status { position: absolute; left: -120px; top: clamp(66px, 9vw, 90px); width: 240px; text-align: center; font: 800 12px/1.4 'Nunito', sans-serif; color: #5b6259; }
.cloud-health { display: flex; justify-content: center; gap: 7px; margin-bottom: 9px; }
.cloud-health i { display: block; width: 9px; height: 9px; border-radius: 50%; background: #626c62; border: 1px solid #424b43; }
.cloud-health .is-spent { background: #e1d9c6; border-color: #bcb5a3; }
.bark-meter { width: 116px; height: 7px; margin: 0 auto 6px; border-radius: 6px; background: #d6d2bf; overflow: hidden; }
.bark-meter i { display: block; width: 100%; height: 100%; transform-origin: left; background: #439c84; transform: scaleX(0); }
.cloud-boss.is-ready .bark-hint { color: #28775f; }
.cloud-boss.is-defeated .cloud-status { visibility: hidden; }
.boss-bark-wave { position: absolute; left: 0; top: 0; width: 140px; height: 140px; pointer-events: none; z-index: 3; }
.boss-bark-wave svg { width: 100%; height: 100%; overflow: visible; }
#game-boss-bonus-row[hidden] { display: none; }
.game-time-fly { z-index: 1; }
.fly-wings { transform-origin: 36px 30px; animation: fly-flutter .12s ease-in-out infinite alternate; }
@keyframes fly-flutter { to { transform: scaleY(.5); } }
.game-paused .fly-wings { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .fly-wings { animation: none; } }
.game-bug svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 5px 2px #50371c22); }
.game-bug .bug-shell { fill: #c54f32; }
.game-bug .bug-face { fill: #e46b43; }
.game-bug .bug-shine { fill: #f29663; }
.game-bug.is-bomb .bug-shell { fill: #614087; }
.game-bug.is-bomb .bug-face { fill: #a07ac7; }
.game-bug.is-bomb .bug-shine { fill: #d1b7ec; }
.game-bug.is-bomb svg { filter: drop-shadow(0 -6px 5px #a07ac755); }
.game-bug.is-dead .bomb-fuse { display: none; }
.game-bug.has-hit svg { filter: drop-shadow(0 0 16px #ef7938); }
.game-bug .bug-dead-eyes { display: none; }
.game-bug.is-targeted::after { content: ''; position: absolute; inset: 1px; border: 2px dashed #367968; border-radius: 50%; }
.game-bug.is-targeted { pointer-events: none; }
.game-bug.is-dead { pointer-events: none; }
.game-bug.is-dead .bug-shell, .game-bug.is-dead .bug-face { fill: #34322e; }
.game-bug.is-dead .bug-shine { fill: #57514a; }
.game-bug.is-dead .bug-eyes { display: none; }
.game-bug.is-dead .bug-dead-eyes { display: block; stroke: #f5ecd6; }
.game-bug:focus-visible { outline: 3px solid #437a69; outline-offset: 2px; border-radius: 50%; }
.game-beam { position: absolute; height: 5px; left: 0; top: 0; border-radius: 10px; background: #effff3; box-shadow: 0 0 0 3px #67d7bb, 0 0 16px 6px #57e0c58c; transform-origin: left center; pointer-events: none; }
.game-beam::before, .game-beam::after { content: ''; position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: #edfff4; box-shadow: 0 0 12px 6px #64dfc1; transform: translate(-50%, -50%); }
.game-beam::after { left: 100%; width: 23px; height: 23px; }
.game-points { position: absolute; color: #235f50; font: 900 16px 'JetBrains Mono', monospace; text-shadow: 0 1px var(--cream); }
.game-points { width: 190px; margin-left: -75px; text-align: center; }
.game-points strong { display: block; }
.game-points small { display: block; font: 900 11px/1.6 'Nunito', sans-serif; white-space: nowrap; }
.game-points.is-combo { color: #a04c20; }
.game-points.is-combo strong { font-size: 27px; }
.game-paused .game-bug { pointer-events: none; }
@media (max-width: 640px) {
  .laptop { left: 47%; width: 116px; }
  .game-hud { left: 16px; right: 16px; bottom: 18px; gap: 10px; }
  .game-score-row { gap: 18px; }
  .game-score, .game-best b { font-size: 22px; }
  .game-controls { gap: 6px; }
  .game-message { top: 29%; }
  .game-message h2 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .laptop-lid, .laptop-screen, .hero { transition: none; }
  .game-beam { box-shadow: 0 0 0 2px #67d7bb; }
}
.front .laptop, .og .laptop { display: none; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .laptop:not(.is-open):hover .laptop-lid { transform: rotateX(-66deg); opacity: 1; }
  .laptop:not(.is-open):hover .laptop-closed { opacity: 0; }
  .laptop:not(.is-open):hover .laptop-base { opacity: 1; }
}

.game-over-dialog {
  width: min(560px, calc(100vw - 28px)); max-width: none; max-height: calc(100dvh - 28px);
  padding: 28px; overflow-y: auto; border: 1px solid #d7c6a7; border-radius: 24px;
  background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 24px 90px #211a1659;
}
.game-over-dialog::backdrop { background: #30291f70; backdrop-filter: blur(5px); }
.game-over-kicker { margin: 0 0 5px; font: 800 11px 'JetBrains Mono', monospace; letter-spacing: 2px; color: #80715e; }
.game-over-dialog h2 { margin: 0; font-size: 42px; line-height: 1.2; letter-spacing: -1px; }
#game-over-reason { margin: 8px 0 20px; font-size: 15px; color: var(--ink-soft); }
#game-scorecard { display: block; width: 100%; height: auto; border-radius: 13px; border: 1px solid #dfd1b9; }
#game-card-status { color: var(--ink-soft); font-size: 14px; }
.game-over-divider { border: 0; border-top: 1px solid #dfd1b9; margin: 22px 0; }
.game-over-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-over-dialog button, .game-share-actions a { font: 900 14px 'Nunito', sans-serif; cursor: pointer; border-radius: 12px; padding: 12px 14px; color: var(--ink); border: 1px solid #d6c6ab; background: #f5ecd6; text-decoration: none; }
.game-over-dialog .game-primary { background: var(--mint); color: var(--mint-ink); border-color: #72b6a4; }
.game-over-dialog button:hover, .game-share-actions a:hover { filter: brightness(.96); }
.game-over-dialog :is(button, a):focus-visible { outline: 3px solid #367c9b; outline-offset: 3px; }
.game-share-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.game-share-actions :is(a, button) { padding: 9px 12px; font-size: 13px; background: transparent; }
#game-post-x { background: #302e2b; border-color: #302e2b; color: #fff8e9; }
.game-share-note { margin: 12px 0 0; font-size: 12px; color: #80715e; }
.game-over-dialog [hidden] { display: none !important; }
@media (max-width: 480px) {
  .game-over-dialog { padding: 22px 16px; border-radius: 20px; }
  .game-over-dialog h2 { font-size: 36px; }
}

.game-bug[hidden] { display: none; }
.game-explosion { position: absolute; top: 0; left: 0; width: 160px; height: 160px; pointer-events: none; transform-origin: center; will-change: transform, opacity; }
.game-explosion svg { width: 100%; height: 100%; overflow: visible; }
.game-explosion .explosion-cloud { opacity: .8; }
.game-explosion .explosion-flash, .game-explosion .explosion-core { opacity: calc(1 - var(--burst-progress, 0)); }
.game-explosion i { position: absolute; left: 76px; top: 76px; width: 9px; height: 9px; border-radius: 2px; background: #7a568f; border: 1px solid #59445f; transform: translate(calc(var(--spark-x) * var(--burst-progress, 0)), calc(var(--spark-y) * var(--burst-progress, 0))) rotate(var(--spark-turn)); }
.game-explosion i:nth-child(even) { background: #f3b85b; border-color: #a45932; }

/* Avoid repeatedly rasterizing blurred layers during touch-screen zaps. */
@media (pointer: coarse) {
  .game-bug svg, .game-bug.is-bomb svg { filter: none; }
  .game-beam { box-shadow: 0 0 0 2px #67d7bb; }
  .game-beam::before, .game-beam::after { box-shadow: 0 0 0 3px #67d7bb; }
  .game-points { text-shadow: none; }
}

#game-round-bonuses { width: min(270px, 100%); margin: 18px auto 0; padding: 14px 18px; border: 1px solid #cbbfa766; border-radius: 14px; background: #f8f1dfb3; text-align: left; }
#game-round-bonuses[hidden] { display: none; }
#game-round-bonuses > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
#game-round-bonuses > div + div { margin-top: 8px; }
#game-round-bonuses dt { color: var(--ink-soft); font-size: 14px; font-weight: 800; }
#game-round-bonuses dd { margin: 0; color: #367c9b; font: 800 15px/1.4 'JetBrains Mono', monospace; }
#game-clear-percent { margin-left: 4px; color: #80715e; font-size: 11px; }
