:root { color-scheme: dark; font-family: "Trebuchet MS", system-ui, sans-serif; background: #2d231e; color: #fff3d2; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: repeating-linear-gradient(3deg, #392a2045 0 2px, transparent 3px 12px), radial-gradient(ellipse at top, #65503a, #30231d 75%); }
main { max-width: 99rem; padding: 0 clamp(.65rem, 3vw, 3rem) 1rem; margin: auto; }
header, .heading, .toolbar, .group { display: flex; align-items: center; }
header { justify-content: space-between; padding: .75rem 0; font-size: .9rem; }
a { color: #faeac5; text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
.heading { gap: 1rem; justify-content: space-between; padding: 0 0 .6rem; }
.heading h1 { margin-bottom: .35rem; }
#reference { position: relative; padding: 0; overflow: hidden; background: #423327; }
#reference img { display: block; width: min(42vw, 26rem); height: auto; }
#reference span { position: absolute; bottom: 0; right: 0; background: #302419eb; padding: .2rem .45rem; font-size: .75rem; border-radius: .3rem 0 0 0; }
#reference-view { max-width: 94vw; max-height: 94dvh; margin: auto; padding: .55rem; border: 1px solid #a48763; border-radius: .65rem; background: #30251e; text-align: right; }
#reference-view::backdrop { background: #1b130dd9; }
#full-picture { display: block; max-width: 100%; max-height: 76dvh; width: auto; height: auto; margin: auto auto .5rem; }
h1 { margin: 0; font: italic 800 clamp(2.2rem, 5vw, 4.3rem)/1 Georgia, serif; letter-spacing: -.055em; }
.heading p { margin: 0; color: #e4c694; font-weight: 700; }
.desk { position: relative; height: clamp(22rem, 66svh, 58rem); overflow: hidden; border: .4rem solid #7f6245; border-radius: .7rem; box-shadow: 0 0 0 2px #261b15, inset 0 .4rem 1rem #2229, 0 .3rem .5rem #2119;
  background: repeating-linear-gradient(38deg, #f9ecc509 0 1px, transparent 1px 3px), repeating-linear-gradient(128deg, #101d140b 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 32%, #686b51, #4c523f 75%); }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
:focus-visible { outline: 3px solid #ffcc73; outline-offset: 2px; }
canvas:focus-visible { outline-offset: -3px; }
.toolbar { margin-top: .7rem; gap: clamp(.55rem, 2vw, 2rem); flex-wrap: wrap; }
.group { gap: .28rem; }
.group span { margin-right: .2rem; font-size: .82rem; font-weight: 700; color: #e8d3ac; }
button { min-width: 2.65rem; min-height: 2.65rem; border-radius: .5rem; padding: .3rem .6rem; border: 1px solid #a48763; color: inherit; background: #453629; font: 700 1rem system-ui; cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
button:hover:enabled { filter: brightness(1.2); }
.primary { background: #f2c685; border-color: #ffdfab; color: #352719; margin-left: auto; padding-inline: 1rem; }
[hidden] { display: none !important; }
#status { margin: .7rem 0; min-height: 1.2em; color: #f8d9a3; }
section:has(#check[hidden]) #status { font: 700 clamp(1.35rem, 3vw, 2rem)/1.2 Georgia, serif; }
details { color: #e3d0b0; font-size: .9rem; max-width: 56rem; }
summary { cursor: pointer; width: fit-content; }
@media (max-width: 620px) {
  .heading { gap: .5rem; }
  #reference img { width: 57vw; }
  header { padding: .55rem 0; } .desk { height: 65svh; min-height: 19rem; }
  .toolbar { gap: .45rem; } .group { gap: .18rem; } .group span { display: none; }
  button { min-width: 2.45rem; } .primary { padding-inline: .55rem; }
}


#victory {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 1rem; border: none; background: transparent;
  color: #fff3d2; overflow: hidden;
}
#victory[open] { display: grid; place-items: center; }
#victory::backdrop { background: radial-gradient(ellipse at center, #211c16c4, #171610df); }
.win-card { position: relative; z-index: 1; text-align: center; }
#victory h2 { margin: 0; font: italic 700 clamp(4rem, 12vw, 9rem)/1 Georgia, serif; letter-spacing: -.055em; color: #ffdc97; text-shadow: 0 3px 20px #312115; }
#victory p { margin: .7rem 0 1.5rem; font: 500 clamp(1.05rem, 3vw, 1.5rem)/1.4 Georgia, serif; }
#victory form { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
#replay-win { background: #f2c685; color: #352719; }
#win-menu { padding: .75rem 1.2rem; border-radius: .5rem; background: #f2c685; color: #352719; }
.party-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.party-balloon, .paper-spray { position: absolute; }
.party-balloon {
  width: clamp(3.1rem, 7vw, 6.8rem); aspect-ratio: .8;
  border-radius: 50% 50% 47% 47% / 44% 44% 59% 59%;
  color: var(--color); background: radial-gradient(ellipse at 28% 24%, #fffc 0%, transparent 11%),
    radial-gradient(ellipse at 36% 33%, #fff5, transparent 58%), linear-gradient(115deg,var(--color) 42%,color-mix(in srgb,var(--color),#261b2c 40%));
  box-shadow: inset -3px -4px 10px #28182630;
}
.party-balloon::before { content: ""; position: absolute; top: 98%; left: 46%; border: .28rem solid transparent; border-bottom-color: currentColor; transform: translateY(-40%); }
.party-balloon::after { content: ""; position: absolute; top: 103%; left: 45%; height: 60%; width: 15%; border-left: 1px solid #fff6; border-radius: 50%; transform: rotate(5deg); }
.paper-spray i { position: absolute; width: .45rem; height: .8rem; border-radius: 1px; }
