@font-face{font-family:Kalam;src:url('assets/fonts/kalam-bold.woff2')}*{box-sizing:border-box}body{margin:0;color:#283e49;background:#d5cbb5;font:16px system-ui,sans-serif}main,dialog{background-color:#fff8e7;background-image:linear-gradient(90deg,transparent 13px,#ca7f765c 13px 15px,transparent 15px),repeating-linear-gradient(0deg,transparent 0 23px,#9fb8bb55 24px 25px)}main{max-width:560px;min-height:100svh;margin:auto;padding:16px clamp(22px,5vw,35px) 24px;box-shadow:3px 0 0 #b5ab92,8px 0 0 #e7ddc4}h1,h2,h3,.hand,.tile strong{font-family:Kalam,Georgia,serif;line-height:1.05}h1{font-size:clamp(35px,8vw,54px);margin:15px 0 0}h2{font-size:30px;margin:8px 0}p{line-height:1.45}.top,.bar,.choices{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.top{justify-content:space-between}.top small{letter-spacing:.12em;font-weight:650}.top button,.link{background:transparent;border:0;text-decoration:underline}.tagline{margin:3px 0 20px;color:#765447;font:18px Kalam,serif}.shelf{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.tile{display:grid;align-content:start;text-align:left;padding:12px;border:1.5px solid #72817d;border-radius:3px 8px 2px 5px;box-shadow:2px 3px #c0b69f;background:#fffaf0}.tile:nth-child(2n){transform:rotate(.5deg)}.tile svg{height:50px;width:90px;color:#315972;max-width:100%;margin-bottom:6px}.tile strong{font-size:21px}.tile span{font-size:13px;color:#4f5b58;font-weight:400}.tile:hover{background:#fff1cf}button,select,input{font:inherit;color:inherit}button,select{min-height:44px;cursor:pointer;border:1px solid #6b7772;background:#fff8e6;padding:8px 13px;border-radius:4px}button:disabled{cursor:default}.primary{background:#294e53;color:#fff8e6}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #c58017;outline-offset:2px}footer{text-align:center;margin-top:18px;font-size:12px;color:#635e50}.brand{height:85svh;display:grid;place-content:center;justify-items:center;gap:8px}.brand img{width:125px}.intro{background:#102326;color:white}.screen{animation:turn .19s ease-out}.reduced *{animation:none!important;transition:none!important}@keyframes turn{from{opacity:.55;transform:perspective(700px) rotateY(-5deg)}to{opacity:1;transform:none}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}dialog{width:min(370px,92vw);max-height:90svh;padding:24px;border:2px solid #465754}dialog::backdrop{background:#16272899}label{display:block;margin:12px 0}dialog img{width:75px;background:#102326}.panel{margin:20px 0}.status{font:22px Kalam,serif;color:#8d4037;min-height:32px}.graph{background-color:#fff9e9;background-image:linear-gradient(#9cb8bf55 1px,transparent 1px),linear-gradient(90deg,#9cb8bf55 1px,transparent 1px);background-size:18px 18px}.center{text-align:center}input[type=text]{width:100%;padding:10px;background:#fffaf0;border:1px solid #8b9287}.blue{color:#285b85}.red{color:#9c4239}@media(max-width:350px){main{padding:12px 18px}.shelf{gap:8px}.tile{padding:9px}.tile strong{font-size:18px}}
.ttt{position:relative;display:grid;grid-template-columns:repeat(3,1fr);width:min(100%,320px);aspect-ratio:1;margin:16px auto 22px}.ttt button{border:1.5px solid #627775;border-radius:2px;background:transparent;font:clamp(40px,14vw,68px) Kalam}.ttt svg{position:absolute;inset:0;pointer-events:none;width:100%;height:100%}
.scratch{font-size:22px;overflow-wrap:anywhere;line-height:1.4}.ring{font-size:30px;letter-spacing:.18em}.strike{position:relative;display:inline-block}.strike:after{content:"";position:absolute;top:48%;left:0;right:0;border-top:2px solid #aa4233;transform-origin:left;animation:cancel .13s var(--delay) both}@keyframes cancel{from{transform:scaleX(0) rotate(-9deg)}to{transform:scaleX(1) rotate(-9deg)}}.outcome{color:#934837}
.letters{display:grid;grid-template-columns:repeat(6,1fr);gap:5px}.letters button{padding:4px;min-width:0}.letters button:disabled{opacity:.45}.puzzle{font-size:clamp(18px,6vw,30px);letter-spacing:.12em;overflow-wrap:anywhere;line-height:1.55}.hang-art{width:160px;height:120px;fill:none;stroke:#3b5561;stroke-width:3;stroke-linecap:round}.hang-art text{fill:#974a3e;stroke:none;font:bold 17px Kalam}.celebrate,.wobble{transform-origin:center;animation:turn .4s ease-out}
.field{display:block;width:min(100%,380px);margin:5px auto 16px;border:1px solid #b8b9a4;touch-action:manipulation}.field text{font:700 19px Kalam;text-anchor:middle}.field [data-move]{cursor:pointer}.field [data-move]:focus-visible{outline:2px solid #bc7732}.tally{text-align:center;margin:4px}
.pitch{touch-action:none;width:min(100%,350px,58svh)}.pitch-key{font-size:14px;margin:4px;text-align:center}.field [tabindex]:focus-visible{stroke:#c27e25}
@media(max-height:650px) and (orientation:portrait){.top{min-height:40px}main{padding-top:6px;padding-bottom:8px}h1{font-size:32px;margin-top:7px}.status{margin:8px 0;min-height:26px}.pitch{width:min(100%,calc((100svh - 235px)*.74));margin-bottom:7px}.tagline{margin-bottom:10px}.shelf{gap:7px}.tile svg{height:37px}.tile{padding:8px}.cover footer,footer{margin-top:6px}}

.hang-art .pendulum{transform-origin:94px 12px;animation:sway 1.1s ease-out}.hang-art .cheer{animation:hop .42s ease-out 2}.hang-art .new-beam{stroke-dasharray:180;animation:ink .35s ease-out}@keyframes ink{from{stroke-dashoffset:180}}@keyframes sway{20%{transform:rotate(9deg)}48%{transform:rotate(-6deg)}72%{transform:rotate(3deg)}}@keyframes hop{50%{transform:translateY(-5px)}}.suspended *{animation:none!important}

.score{text-align:center;font:700 20px Kalam}.score small{display:block;font:13px system-ui}.party{text-align:center;color:#864739;font:bold 26px Kalam;position:relative}.party.final{font-size:32px}.party i{display:inline-block;color:#305b85;pointer-events:none;animation:shower .9s ease-out}.party.final i{animation-duration:1.3s}@keyframes shower{from{transform:translateY(-15px) rotate(-14deg);opacity:.25}}.score~.pitch{max-height:52svh}

.confetti{pointer-events:none;position:absolute;inset:0;overflow:hidden}.party .confetti i{position:absolute;left:var(--x);top:20%;width:5px;height:8px;background:#ad5645;transform:rotate(var(--tilt));animation:none}.party .confetti i:nth-child(even){background:#3c648a}.party .confetti i:nth-child(3n){background:#b78a36}.party.fresh .confetti i{animation:tumble 1.1s ease-out both}.party.fresh.final .confetti i{animation-duration:1.4s}@keyframes tumble{from{transform:translateY(-15px) rotate(0);opacity:.1}65%{opacity:1}to{transform:translateY(24px) rotate(var(--tilt));opacity:0}}.party svg{vertical-align:middle}.reduced .confetti i{animation:none!important}

.reduced .strike:after{animation:none!important;transform:scaleX(1)}.score~.pitch-key{margin-block:1px}.party~.pitch{width:min(100%,clamp(155px,calc((100svh - 330px)*.72),315px))}

.score.updated{animation:score-pop .32s ease-out}@keyframes score-pop{50%{transform:scale(1.05)}}body:has(dialog[open]) .party i,body:has(dialog[open]) .score,body:has(dialog[open]) .pendulum{animation-play-state:paused}

select,select option,select optgroup{color-scheme:light;color:#263943;background:#fff6dd;font-family:Kalam,'Trebuchet MS',sans-serif}select:focus-visible,button:focus-visible{outline:3px solid #245a79;outline-offset:2px}select option:checked{background:#dce9dd;color:#263943}select:disabled{color:#57534b;background:#eee7d8}.variations{display:grid;grid-auto-rows:1fr;gap:12px}.variations button{display:grid;grid-template-columns:minmax(64px,23%) 1fr;align-items:center;gap:12px;text-align:left;padding:13px;min-height:90px;background:#fff6dd;color:#263943;border:2px solid #526267;border-radius:4px 10px 5px 7px;box-shadow:2px 3px #aa9e84}.variations button:active{background:#dce9dd;transform:translateY(2px);box-shadow:none}.variations svg{width:100%;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}.variations strong,.variations small{display:block}.variations strong{font:700 22px Kalam}.variations small{font:15px/1.25 system-ui}
.result-art[hidden]{display:none}.relationship{width:min(100%,225px);height:108px;fill:none;stroke:#314f61;stroke-linecap:round;stroke-linejoin:round;stroke-width:2.6;display:block;margin:auto}.relationship .heart,.relationship .spark{stroke:#a34f48}.relationship .ring{stroke:#93702c}.playing .relationship .left{animation:meet-left 2.6s both}.playing .relationship .right{animation:meet-right 2.6s both}.playing .relationship .spark{animation:twinkle 2.5s both}.playing .affection .smile{transform-origin:center;animation:beam 2.5s}.playing .enemies .left{animation:turn-away 2.4s both;transform-origin:center}.playing .enemies .right{animation:turn-away 2.4s reverse;transform-origin:center}.playing .love .heart{animation:love-pulse 2.6s both}.playing .marriage .right{animation:meet-right 2.6s both}.outcome:has(+.result-art){text-transform:uppercase}.playing .friends .left,.playing .siblings .right{animation:shake-hands 2.5s both}
@keyframes meet-left{0%{transform:translateX(-16px)}50%,100%{transform:translateX(0)}}@keyframes meet-right{0%{transform:translateX(16px)}50%,100%{transform:translateX(0)}}@keyframes shake-hands{0%{transform:translateX(-10px)}40%,65%,90%{transform:translateY(0)}52%,77%{transform:translateY(-2px)}}@keyframes twinkle{0%,25%{opacity:0}55%{opacity:1;transform:translateY(-4px)}80%{opacity:.5}100%{opacity:1}}@keyframes beam{45%{transform:scale(1.12)}}@keyframes turn-away{30%{transform:rotate(0)}65%,100%{transform:rotate(-10deg)}}@keyframes love-pulse{0%{opacity:.3;transform:scale(.65)}40%,75%{transform:scale(1.13)}55%,100%{transform:scale(1)}}

.playing .love .left{--enter:-17px;animation:love-meet 2.6s both}.playing .love .right{--enter:17px;animation:love-meet 2.6s both}@keyframes love-meet{0%{transform:translateX(var(--enter)) scale(.8)}40%,78%{transform:translateX(0) scale(1.12)}58%,100%{transform:translateX(0) scale(1)}}

#difficulty[hidden]{display:none}

.outcome:has(+.result-art)::after{content:'!'}.playing .affection .grin{stroke-dasharray:35;animation:draw-grin 2.5s both}.playing .enemies .brows{animation:scowl 2.4s both}.playing .enemies .left{--away:-12deg;animation:face-away 2.4s both}.playing .enemies .right{--away:12deg;animation:face-away 2.4s both}.playing .love .heartlet{animation-delay:.12s}@keyframes face-away{0%,25%{transform:rotate(0)}75%,100%{transform:rotate(var(--away))}}@keyframes scowl{0%{transform:translateY(-4px)}55%,100%{transform:translateY(1px)}}@keyframes draw-grin{0%{stroke-dashoffset:35}55%,100%{stroke-dashoffset:0}}

.tile[data-game=penfight]{grid-column:1/-1;grid-row:1;grid-template-columns:74px 1fr;align-items:center}.tile[data-game=penfight] svg{grid-row:span 2;width:65px;margin:0}.pen-game{display:grid;gap:10px}.pen-game>button{text-align:left}.pen-game header{display:flex;justify-content:space-between;align-items:center}.pen-game small{display:block}.pen-game section{padding:8px 12px;border-bottom:1px solid #97846c}.pen-game section canvas,.pen-emblem canvas{width:105px;vertical-align:middle}.pen-game label{display:grid;gap:2px;margin:2px 0}.pen-game input{min-height:40px}.pen-emblem{display:flex;justify-content:center;background:#d5ae7b;padding:22px;border:3px double #715b48}.pen-emblem canvas+canvas{transform:rotate(55deg)}.pencil-tray{background:#dac29c;border:5px ridge #996c4e;border-radius:9px}.pencil-tray section{background:#f8edd8;margin:6px}.locked{filter:brightness(.15);opacity:.5}.pen-playing .desk{display:block;touch-action:none;width:min(100%,calc((100svh - 185px) * 320 / 460));max-height:calc(100svh - 185px);margin:auto;box-shadow:0 0 0 5px #554638,0 5px 12px #594937}.pen-playing h1{font-size:25px;margin:5px 0}.pen-playing .pen-game{gap:6px}.capture{border:1px dashed #735e37;padding:14px;font:22px Kalam,serif;animation:turn .3s ease-out}

.pen-setup{border-left:5px solid var(--team)}.pen-setup>strong{display:block;font:700 22px Kalam,serif;color:#202020}.pen-setup>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pen-game .cpu-mark{display:inline;font:600 11px system-ui;color:#444}
.pen-scores{display:flex;gap:3px;justify-content:center;margin:0}.pen-token{flex:1;max-width:90px;border:1px solid transparent;border-radius:5px;text-align:center;line-height:1.05;color:#202020}.pen-token.active{border-color:var(--team);background:#fff8df;box-shadow:inset 0 -2px var(--team)}.pen-token canvas{display:block;margin:auto;width:47px;height:11px}.pen-token span{font:600 11px system-ui}.pen-token i{display:inline-block;width:10px;height:10px;margin:0 2px;border-radius:50%;box-sizing:border-box;border:1.5px solid #595448}.pen-token i.won{background:var(--team);border-color:#433e35}.pen-token.out canvas{opacity:.42}.pen-token.out span{color:#57534e}
.pen-playing .desk{width:min(100%,calc((100svh - 200px)*320/460));max-height:calc(100svh - 200px)}
.pen-game .pen-victory{position:relative;isolation:isolate;overflow:hidden;padding:24px 14px;border:4px double var(--team);background:#fff4df;background:linear-gradient(145deg,color-mix(in srgb,var(--team) 38%,#fff6dc),#fff6dc 65%);text-align:center}
.pen-game .pen-victory.final{position:fixed;inset:0;z-index:10;display:grid;align-items:safe center;overflow-y:auto;min-height:100%;box-sizing:border-box;background-color:#fff1ce}
.pen-final main{transform:none;animation:none}.victory-content{position:relative;max-width:32rem;width:100%;margin:auto;z-index:1}.pen-victory h2{font:700 clamp(32px,9vw,65px)/1 Kalam,serif;color:#202020;margin:14px 0;text-shadow:0 3px color-mix(in srgb,var(--team) 55%,white)}
.pen-victory .pen-crown{font:48px Georgia,serif;color:#74551b}.pen-victory canvas.winning-pen{display:block;width:190px;height:auto;margin:12px auto}.pen-victory .pen-token canvas{width:47px}.pen-victory .capture canvas{display:block;margin:auto}.pen-victory nav{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:15px}.pen-victory nav button:first-child{background:#294e53;color:#fff}
.pen-confetti{position:absolute;inset:0;pointer-events:none;overflow:hidden;opacity:.8}.pen-confetti i{position:absolute;left:var(--x);top:var(--y);width:5px;height:11px;background:var(--ink);transform:rotate(var(--r));animation:pen-drift 2s ease-out var(--delay) 2}.pen-victory:not(.final) .pen-confetti{opacity:.65}.pen-victory h2{animation:pen-pulse 2s ease-in-out 2}
@keyframes pen-drift{from{transform:translateY(-40px) rotate(var(--r))}to{transform:translateY(12px) rotate(calc(var(--r) + 90deg))}}
@keyframes pen-pulse{50%{text-shadow:0 5px color-mix(in srgb,var(--team) 80%,white)}}
@media(prefers-reduced-motion:reduce){.pen-confetti i,.pen-victory h2{animation:none}}

.burst,.party .confetti.burst{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:4}
.burst i,.party.fresh .confetti.burst i,.party.fresh.final .confetti.burst i{position:absolute;left:var(--origin);top:var(--y);width:var(--size);height:calc(var(--size)*1.6);border-radius:1px 3px 1px 2px;background:var(--color);animation:paper-flight var(--time) var(--delay) cubic-bezier(.2,.5,.45,.9) both;pointer-events:none}
@keyframes paper-flight{0%{transform:translate(0,0) rotate(0);opacity:0}6%{opacity:1}33%{transform:translate(calc(var(--dx)*.55),var(--rise)) rotate(calc(var(--spin)*.55))}82%{opacity:.95}100%{transform:translate(var(--dx),var(--fall)) rotate(var(--spin));opacity:0}}
.paper-stars{color:#9a6036;margin-inline:6px}.score{position:relative;z-index:5}.reduced .burst,body.suspended .burst{display:none}
@media(prefers-reduced-motion:reduce){.burst{display:none}}
