/* ---------- desktop extras: crab care, screensaver, shut down, now playing, games ---------- */

/* icons: three columns now */
.icons { grid-template-columns: repeat(3, 108px); }

/* crab + hats */
#crab { position: relative; }
.hat { position: absolute; left: 50%; top: -19px; width: 46px; height: 40px; transform: translateX(-12px); pointer-events: none; z-index: 1; transition: transform 1.2s ease; }
body.drowsy .hat { transform: translate(-11px, 4px) rotate(3deg); }
body.asleep .hat { transform: translate(-8px, 10px) rotate(7deg); }
.hat svg { display: block; width: 100%; height: 100%; overflow: visible; }
@media (prefers-reduced-motion: no-preference) {
  .hat.propeller .blade { animation: spin .6s linear infinite; transform-origin: 23px 7px; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .stache { left: 27px; top: 48px; width: 35px; height: 22px; } .hat { width: 34px; height: 30px; top: -14px; transform: translateX(-9px); } .icons { grid-template-columns: repeat(3, minmax(0, 1fr)); } .icon .meta { white-space: normal; } }

/* pancake plate */
.plate { position: fixed; right: 206px; bottom: 16px; z-index: 6; background: none; border: 0; padding: 0; cursor: var(--pk-arrow); touch-action: none; }
.plate { width: 56px; }
.plate:active { cursor: var(--pk-hand); }
.plate .tip { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: var(--label); opacity: 0; transition: opacity .2s; pointer-events: none; }
.plate:hover .tip, .plate:focus-visible .tip { opacity: 1; }
.flying-cake { position: fixed; z-index: 7000; pointer-events: none; width: 44px; height: 24px; transform: translate(-50%, -50%); }
@media (max-width: 760px) { .pet .belly { left: auto; right: 0; transform: none; } .plate .plate-n { right: 0; } }
@media (max-width: 760px) { .plate .tip { display: none; } .plate { position: relative; right: auto; bottom: auto; display: block; margin: -8px 0 0 auto; order: 2; } }

/* munching */
@media (prefers-reduced-motion: no-preference) {
  #crab.munch img { animation: munch .18s steps(2, end) 6; }
}
@keyframes munch { 50% { transform: translateY(3px) scaleY(.95); } }
.belly { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); display: flex; align-items: center; gap: 5px; background: var(--paper); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); padding: 1px 6px; font-size: 9px; white-space: nowrap; pointer-events: none; }
.belly .track { width: 46px; height: 7px; border: 1.5px solid var(--ink); background: #fff; }
.belly .track i { display: block; height: 100%; width: 50%; transition: width .6s, background .6s; }
.belly b { font-weight: 400; min-width: 52px; }
@media (prefers-reduced-motion: no-preference) {
  #crab.love img { animation: munch .18s steps(2, end) 6, love 1s ease 1; }
  body.crab-hungry #crab img { animation: sulk 3s ease-in-out infinite; }
}
@keyframes love { 50% { filter: drop-shadow(0 0 10px #f29bb8); } }
@keyframes sulk { 50% { transform: rotate(-3deg) translateY(2px); } }
.plate-n { position: absolute; right: -10px; top: -2px; background: var(--ink); color: var(--paper); font-size: 9px; padding: 1px 4px; }
.plate.empty #plate-art { opacity: .55; }
#plate-art svg { display: block; overflow: visible; filter: drop-shadow(2px 3px 0 rgb(17 17 17 / .35)); }
.cstat { border: 2px solid var(--ink); background: #fff; padding: 5px 9px; display: flex; flex-direction: column; min-width: 110px; flex: 1; }
.cstat b { font-size: 14px; font-weight: 600; color: var(--ink); }
.cstat span { font-size: 11px; }
.cstat.wide { flex-basis: 100%; }
.tops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tops span.no { opacity: .25; filter: grayscale(1); }

/* wardrobe */
.hats { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.hats button { background: #fff; border: 2px solid var(--ink); padding: 8px 4px 6px; cursor: var(--pk-hand); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; }
.hats button svg { width: 46px; height: 40px; overflow: visible; }
.ward-h { margin: 4px 0 -4px; font-size: 12px; font-weight: 400; }
.win[data-win="custom"] { width: 560px; }
.win[data-win="custom"] .body { max-height: min(66vh, 600px); overflow-y: auto; }
.win[data-win="custom"] .body > * { flex-shrink: 0; }
#crab-stats { align-items: stretch; }
.win [data-pane][hidden] { display: none; }
.ctabs { display: flex; border-bottom: 2px solid var(--ink); background: #e9e4d8; }
.ctabs button { flex: 1; font: 12px Silkscreen, monospace; background: none; border: 0; border-right: 2px solid var(--ink); padding: 8px 4px; cursor: var(--pk-hand); }
.ctabs button:last-child { border-right: 0; }
.ctabs button[aria-selected="true"] { background: var(--paper); box-shadow: inset 0 -3px 0 #c75d42; }
.hats button > svg[viewBox="0 0 32 32"] { width: 34px; height: 34px; }
.dk { display: flex; align-items: flex-end; height: 72px; }
.dk i { display: block; width: 46px; height: 64px; border: 1.5px solid var(--ink); border-radius: 5px; background-size: 100% 100%; position: relative; }
.dk .b { transform: rotate(-6deg); }
.dk .f { margin-left: -18px; transform: rotate(5deg) translateY(-4px); background: #f5ecd6; display: grid; place-items: center; color: #a3261b; }
.dk .f[data-deck="pancake"] { background: #fff8ea; } .dk .f[data-deck="blueprint"] { background: #eef3f6; } .dk .f[data-deck="classic"] { background: #fff; }
.dk .f svg { width: 40px; height: 40px; }
.dk .f b { font: 700 22px "IBM Plex Mono", monospace; }
.dk .f em { position: absolute; left: 3px; top: 2px; font: 600 9px "IBM Plex Mono", monospace; font-style: normal; }
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.decks button, .walls button, .opts button { background: #fff; border: 2px solid var(--ink); padding: 8px 4px 6px; cursor: var(--pk-hand); display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11px; }
.decks button[aria-pressed="true"], .walls button[aria-pressed="true"], .opts button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.walls .sw { width: 56px; height: 34px; border: 2px solid var(--ink); background-image: radial-gradient(rgb(255 255 255 / .12) 1px, transparent 1px) !important; background-size: 5px 5px !important; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts button { flex-direction: row; padding: 5px 12px; font-size: 12px; }
.stache { position: absolute; left: 37px; top: 65px; width: 48px; height: 30px; pointer-events: none; z-index: 1; transition: transform 1.2s ease; }
.stache svg { display: block; width: 100%; height: 100%; overflow: visible; }
body.drowsy .stache { transform: translate(1px, 4px) rotate(3deg); }
body.asleep .stache { transform: translate(3px, 9px) rotate(7deg); }
.hats button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.hats button[disabled] { opacity: .45; cursor: not-allowed; }
.stats { display: flex; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.stats b { font-weight: 600; }

/* screensaver */
.saver { position: fixed; inset: 0; z-index: 9000; background: #000; cursor: none; display: none; }
.saver.on { display: block; }
.saver img { position: absolute; width: 130px; left: 0; top: 0; will-change: transform; }
.saver .corner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); color: #f4f1ea; font-size: 32px; opacity: 0; transition: opacity .3s; }
.saver .corner.show { opacity: 1; }

/* shut down */
.shutdown { position: fixed; inset: 0; z-index: 9500; background: #000; display: none; place-items: center; text-align: center; cursor: var(--pk-hand); }
.shutdown.on { display: grid; }
.shutdown p { color: #e98b3a; font-size: clamp(16px, 2.6vw, 28px); margin: 0; padding: 24px; line-height: 1.6; }
.shutdown small { display: block; color: #6c6c6c; font-size: 12px; margin-top: 18px; }
.shutdown.going { background: var(--desk); }
.shutdown.going p { color: var(--paper); }

/* now playing */
.np { position: fixed; left: 18px; bottom: 18px; z-index: 3; width: 290px; background: var(--paper); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font-size: 12px; }
.np .bar { height: 18px; border-bottom: 2px solid var(--ink); display: flex; align-items: center; justify-content: space-between; padding: 0 6px; font-size: 10px; background: repeating-linear-gradient(0deg, var(--paper) 0 2px, var(--ink) 2px 3px); }
.np .bar span { background: var(--paper); padding: 0 4px; }
.np .in { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 8px; align-items: center; }
.np .in > span:last-child { min-width: 0; overflow: hidden; }
.np .art { width: 44px; height: 44px; border: 2px solid var(--ink); background: #111; display: grid; place-items: center; overflow: hidden; }
.np .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np .a { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np a { color: inherit; text-decoration: none; }
.np .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.np .eq i { width: 3px; background: var(--ink); height: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .np.live .eq i { animation: eq .9s ease-in-out infinite; }
  .np.live .eq i:nth-child(2) { animation-delay: .2s; }
  .np.live .eq i:nth-child(3) { animation-delay: .45s; }
}
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 10px; } }
@media (max-width: 1100px) and (min-width: 761px) { .np { width: 240px; } }
.np .bar .eq { margin-left: auto; margin-right: 6px; }
.np-tog { font: inherit; font-size: 10px; background: var(--paper); border: 0; padding: 0 4px; line-height: 14px; cursor: var(--pk-hand); }
.np-more { display: none; border-bottom: 2px solid var(--ink); padding: 10px; }
.np:hover .np-more, .np:focus-within .np-more, .np.open .np-more { display: block; }
.np:hover .np-tog, .np.open .np-tog { transform: rotate(180deg); }
.np-big { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border: 2px solid var(--ink); margin-bottom: 8px; background: #111; }
.np-prog { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--ink-2); margin: 2px 0 8px; }
.np-prog .tr { flex: 1; height: 6px; border: 1.5px solid var(--ink); background: #fff; }
.np-prog .tr i { display: block; height: 100%; background: #1db954; }
.np-more dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; }
.np-more dt { color: var(--ink-2); }
.np-more dd { margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-more a { text-decoration: underline; text-underline-offset: 2px; }
.np-more a:hover { color: var(--accent, #c75d42); }
.np-more h4 { margin: 10px 0 4px; font: 10px Silkscreen, monospace; font-weight: 400; color: var(--ink-2); }
.np-more ol { margin: 0; padding: 0; list-style: none; }
.np-more li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 0; }
.np-more li span { color: var(--ink-2); }
@media (hover: none) { .np:hover .np-more, .np:focus-within .np-more { display: none; } .np.open .np-more { display: block; } }
@media (max-width: 760px) { .np-big { width: 120px; } }
@media (max-width: 760px) { .np { position: static; width: auto; margin: 0 16px 16px; } }

/* games folder */
.folder { display: flex; gap: 18px; flex-wrap: wrap; }
.folder .icon .label { color: var(--paper); }
.folder .icon .meta { color: var(--ink-2); }

/* minesweeper */
.ms { display: inline-flex; flex-direction: column; gap: 10px; align-self: center; }
.ms-top { display: flex; justify-content: space-between; align-items: center; border: 2px solid var(--ink); padding: 4px 6px; background: #fff; }
.led { font-family: Silkscreen, monospace; background: #111; color: #e8553a; padding: 2px 6px; min-width: 46px; text-align: right; font-size: 16px; }
.ms-face { width: 34px; height: 30px; border: 2px solid var(--ink); background: var(--paper); cursor: var(--pk-hand); font-family: Silkscreen, monospace; font-size: 12px; box-shadow: 2px 2px 0 var(--ink); }
.ms-face:active { transform: translate(2px, 2px); box-shadow: none; }
.ms { --ms-cell: 26px;
  --ms-cover: #e3dccd; --ms-hi: #fff; --ms-lo: #a9a08e; --ms-open: var(--paper); --ms-line: var(--ink); --ms-boom: #e8553a; --ms-tex: none; --ms-open-tex: none;
  --n1: #1b4fd1; --n2: #1f7a3d; --n3: #c22a1d; --n4: #23236b; --n5: #7a1f1f; --n6: #1d7a7a; --n7: #111; --n8: #666; }
html[data-deck="classic"] .ms { --ms-cover: #c0c0c0; --ms-hi: #fff; --ms-lo: #7b7b7b; --ms-open: #c9c9c9; --ms-line: #7b7b7b; --ms-boom: #ff2a1a; }
html[data-deck="nautical"] .ms { --ms-cover: #2f6f80; --ms-hi: #5d9aa8; --ms-lo: #16424f; --ms-open: #f3e9d2; --ms-line: #16424f; --ms-boom: #c75d42;
  --ms-tex: radial-gradient(rgb(255 255 255 / .12) 1px, transparent 1.2px) 0 0 / 6px 6px; --ms-open-tex: linear-gradient(rgb(29 45 68 / .07) 1px, transparent 1px) 0 0 / 100% 8px;
  --n1: #2b5c9e; --n2: #3d7a52; --n3: #a3261b; --n4: #1d2d44; --n5: #7a2b1f; --n6: #2f6f80; --n7: #1d2d44; --n8: #6b6b6b; }
html[data-deck="pancake"] .ms { --ms-cover: #e2b46a; --ms-hi: #f6d9a0; --ms-lo: #b07b3a; --ms-open: #fbf3df; --ms-line: #7a4a28; --ms-boom: #b8574f;
  --ms-tex: radial-gradient(circle at 30% 35%, rgb(150 95 40 / .35) 1.2px, transparent 1.6px) 0 0 / 9px 9px; --ms-open-tex: none;
  --n1: #3b5ba8; --n2: #5f8f5a; --n3: #a3261b; --n4: #3b2516; --n5: #8a3b1f; --n6: #2f7a6e; --n7: #3b2516; --n8: #7a6a55; }
html[data-deck="blueprint"] .ms { --ms-cover: #1f4a6b; --ms-hi: #4f7fa1; --ms-lo: #0f2d45; --ms-open: #4d84ad; --ms-line: #173a55; --ms-boom: #c75d42;
  --ms-tex: linear-gradient(rgb(255 255 255 / .1) 1px, transparent 1px) 0 0 / 6px 6px, linear-gradient(90deg, rgb(255 255 255 / .1) 1px, transparent 1px) 0 0 / 6px 6px;
  --ms-open-tex: linear-gradient(rgb(255 255 255 / .08) 1px, transparent 1px) 0 0 / 100% 13px;
  --n1: #eef3f6; --n2: #a8e0b5; --n3: #ffb199; --n4: #f2d64b; --n5: #ffd0c2; --n6: #9fd6e6; --n7: #fff; --n8: #c7d6e0; }
@media (max-width: 760px) { .ms { --ms-cell: min(26px, calc((100vw - 76px) / var(--cols, 9))); } .ms-grid button { font-size: min(13px, calc(var(--ms-cell) * .55)); } }
.ms-board { position: relative; overflow: hidden; border: 2px solid var(--ink); }
.ms-grid { display: grid; background: var(--ms-line); gap: 1px; touch-action: manipulation; }
.ms-grid button { position: relative; width: var(--ms-cell); height: var(--ms-cell); border: 0; padding: 0; background: var(--ms-tex), var(--ms-cover); box-shadow: inset 2px 2px 0 var(--ms-hi), inset -2px -2px 0 var(--ms-lo); cursor: var(--pk-hand); font-family: Silkscreen, monospace; font-size: 13px; line-height: 1; display: grid; place-items: center; color: var(--ink); }
.ms-grid button svg { width: 78%; height: 78%; display: block; pointer-events: none; }
.ms-grid button:focus-visible { outline: 2px solid #f2d64b; outline-offset: -2px; z-index: 1; }
.ms-grid button.down:not(.open):not(.flag), .ms-grid button.peek { box-shadow: inset 1px 1px 0 var(--ms-lo); background: var(--ms-open-tex), var(--ms-open); }
.ms-grid button.open { background: var(--ms-open-tex), var(--ms-open); box-shadow: none; cursor: var(--pk-arrow); }
.ms-grid button.boom { background: var(--ms-boom); }
.ms-grid button.wrong::after { content: ""; position: absolute; inset: 3px; background: linear-gradient(45deg, transparent 44%, var(--ms-boom) 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, var(--ms-boom) 44% 56%, transparent 56%); }
.ms-grid .n1 { color: var(--n1); } .ms-grid .n2 { color: var(--n2); } .ms-grid .n3 { color: var(--n3); } .ms-grid .n4 { color: var(--n4); }
.ms-grid .n5 { color: var(--n5); } .ms-grid .n6 { color: var(--n6); } .ms-grid .n7 { color: var(--n7); } .ms-grid .n8 { color: var(--n8); }
.ms-best { color: var(--ink-2); font-size: 11px; order: 3; flex: 1 0 100%; text-align: center; white-space: nowrap; min-height: 1em; }
.ms.won .ms-face { background: #f2d64b; } .ms.lost .ms-face { background: #f3c2bd; }
@media (prefers-reduced-motion: no-preference) {
  .ms-grid button.pop { animation: ms-pop .26s cubic-bezier(.2,.9,.3,1.3) both; }
  .ms-grid button.plant svg { animation: ms-plant .28s cubic-bezier(.2,.9,.3,1.4) both; transform-origin: 30% 90%; }
  .ms-grid button.nope { animation: nope .3s; }
  .ms-grid button.boom svg { animation: ms-boom .4s ease-out; }
  .ms-grid.shine::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / .55) 50%, transparent 65%); animation: ms-shine 1.1s ease-in-out; }
}
@keyframes ms-pop { from { transform: scale(.55); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes ms-plant { from { transform: translateY(-6px) rotate(-18deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ms-boom { 0% { transform: scale(.4); } 50% { transform: scale(1.35); } 100% { transform: none; } }
@keyframes ms-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ms-mode { font-size: 11px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ms-mode button { font: inherit; border: 2px solid var(--ink); background: #fff; padding: 2px 8px; cursor: var(--pk-hand); }
.ms-mode button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ms-level { display: flex; gap: 4px; }

/* solitaire */
.win.sol { width: 620px; }
.sol .body { padding: 12px; background: var(--felt); gap: 10px; }
.sol, .sol-ghost { --felt: #2f6b4f; --face: #fff; --red: #b2361f; --blk: #111; --back: repeating-linear-gradient(45deg, #c75d42 0 4px, #e8c7a0 4px 8px); --line: rgb(255 255 255 / .35); }
html[data-deck="nautical"] .sol, .sol-ghost[data-deck="nautical"] { --felt: #16424f radial-gradient(rgb(255 255 255 / .06) 1px, transparent 1px) 0 0 / 7px 7px; --face: #f5ecd6; --red: #a3261b; --blk: #1d2d44; }
html[data-deck="pancake"] .sol, .sol-ghost[data-deck="pancake"] { --felt: repeating-linear-gradient(90deg, #7a4a28 0 26px, #6b3f22 26px 28px); --face: #fff8ea; --red: #b8574f; --blk: #3b2516; }
html[data-deck="blueprint"] .sol, .sol-ghost[data-deck="blueprint"] { --felt: #2b5778 linear-gradient(rgb(255 255 255 / .08) 1px, transparent 1px) 0 0 / 14px 14px; --face: #eef3f6; --red: #c75d42; --blk: #1c3550; }
.sol-top, .sol-tab { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.pile { position: relative; aspect-ratio: 5 / 7; border: 2px dashed var(--line); border-radius: 6px; }
.pile.waste { border-color: transparent; }
.pile.found .ghost { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line); font: 18px Silkscreen, monospace; }
.pile.over { border-color: #f2d64b; border-style: solid; background: rgb(242 214 75 / .15); }
.sol-tab .pile { aspect-ratio: auto; border-color: transparent; }
.sol-tab .pile.empty-slot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 5 / 7; border: 2px dashed var(--line); border-radius: 6px; }
.sol-tab .pile.over::before { content: ""; position: absolute; inset: 0; border: 2px solid #f2d64b; border-radius: 6px; }
.card { position: absolute; left: 0; width: 100%; aspect-ratio: 5 / 7; background: var(--face); color: var(--blk); border: 1.5px solid #111; border-radius: 6px; padding: 3px 4px; font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 13px; line-height: 1; cursor: var(--pk-hand); user-select: none; -webkit-user-select: none; touch-action: none; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 1px 0 rgb(0 0 0 / .25); }
.card.red { color: var(--red); }
.card .r1, .card .r2 { display: flex; flex-direction: column; align-items: center; width: 1.1em; }
.card .r1 i, .card .r2 i { font-style: normal; font-size: .9em; }
.card .r2 { align-self: flex-end; transform: rotate(180deg); }
.card .big { position: absolute; inset: 22% 14%; display: grid; place-items: center; font-size: 24px; line-height: 1; pointer-events: none; }
.card.court .big { font-size: 28px; border: 1.5px solid currentColor; border-radius: 4px; inset: 20% 18%; opacity: .9; }
.card .big svg { width: 100%; height: 100%; }
.card.court.art .big { border: 0; inset: 18% 8%; opacity: 1; }
.card.down { background: var(--back) center / 100% 100% no-repeat, #1d2d44; cursor: var(--pk-arrow); }
.stock .card.down { cursor: var(--pk-hand); }
.stock .n { position: absolute; right: 3px; bottom: 2px; font-size: 9px; color: #fff; background: rgb(0 0 0 / .45); padding: 0 3px; border-radius: 3px; }
.recycle { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line); font-size: 26px; cursor: var(--pk-hand); }
.card.nope { animation: nope .3s; }
@keyframes nope { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.sol-ghost { position: fixed; left: 0; top: 0; z-index: 8000; pointer-events: none; filter: drop-shadow(4px 6px 0 rgb(0 0 0 / .3)); }
.sol-ghost .card { position: absolute; }
.sol-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--paper); font-size: 12px; flex-wrap: wrap; }
#sol .sol-bar .dim { color: rgb(255 255 255 / .7); }
.sol-bar button { font: inherit; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); padding: 2px 10px; cursor: var(--pk-hand); box-shadow: 2px 2px 0 var(--ink); }
.sol-bar button[disabled] { opacity: .5; cursor: var(--pk-arrow); }
.sol-bar .seg { display: inline-flex; }
.sol-bar .seg button { box-shadow: none; }
.sol-bar .seg button + button { border-left: 0; }
.sol-bar .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
#sol { position: relative; }
.sol-cascade { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 900; }
.sol-cascade .card { position: absolute; left: 0; top: 0; }
.sol-win { text-align: center; color: var(--paper); font-family: Silkscreen, monospace; font-size: 18px; margin: 0; }
@media (max-width: 760px) { .card { font-size: 10px; padding: 2px; } .card .big { font-size: 16px; } .sol-top, .sol-tab { gap: 4px; } }


/* ---------- window previews ---------- */
.pv-models { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pv-models:empty, .pv-covers:empty, .pv-fpl:empty, .pv-mods:empty { display: none; }
.pv-models a { display: block; border: 2px solid var(--ink); background: #fff; color: inherit; text-decoration: none; }
.pv-models img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-bottom: 2px solid var(--ink); background: #e6dcc7; }
.pv-models span { display: block; font-size: 10px; line-height: 1.25; padding: 3px 4px; height: 30px; overflow: hidden; }
.pv-models a:hover { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.pv-fpl table { width: 100%; border-collapse: collapse; font-size: 12px; border: 2px solid var(--ink); background: #fff; }
.pv-fpl th { text-align: left; font: 10px Silkscreen, monospace; font-weight: 400; background: #e8c7a0; border-bottom: 2px solid var(--ink); padding: 4px 6px; }
.pv-fpl td { padding: 3px 6px; border-top: 1px solid #e3dccd; white-space: nowrap; }
.pv-fpl td.n { text-align: right; font-variant-numeric: tabular-nums; }
.pv-fpl td.t { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.pv-fpl .mv { font-size: 9px; } .pv-fpl .up { color: #1f7a3d; } .pv-fpl .dn { color: #c22a1d; }
.pv-fpl .dl { font-size: 11px; color: var(--ink-2); margin-top: 6px; }
.pv-tapes { display: flex; flex-direction: column; gap: 4px; }
.tape { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 8px; background: #2b2b2b; color: #f4f1ea; border: 2px solid var(--ink); padding: 3px 8px 3px 4px; text-decoration: none; font-size: 11px; }
.tape span { background: #f4f1ea; color: var(--ink); font-size: 10px; text-align: center; padding: 1px 0; }
.tape b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tape:hover { background: #c75d42; }
.pv-mods .bar { display: flex; height: 16px; border: 2px solid var(--ink); background: #fff; }
.pv-mods .bar i { display: block; height: 100%; border-right: 2px solid var(--ink); }
.pv-mods .bar i:last-child { border-right: 0; }
.pv-mods .key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; margin-top: 6px; color: var(--ink-2); }
.pv-mods .key b { display: inline-block; width: 9px; height: 9px; border: 1.5px solid var(--ink); margin-right: 4px; vertical-align: -1px; }
.pv-covers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 4px 2px 2px; }
.pv-covers a { display: block; background: #fff; border: 1px solid #d7cfbd; padding: 4px 4px 16px; box-shadow: 2px 3px 0 rgb(0 0 0 / .18); position: relative; color: inherit; text-decoration: none; transition: transform .15s; }
.pv-covers a:nth-child(odd) { transform: rotate(-2deg); } .pv-covers a:nth-child(even) { transform: rotate(1.6deg); }
.pv-covers a:hover { transform: rotate(0) scale(1.05); z-index: 1; }
.pv-covers img, .pv-covers .ph { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--c, #c75d42); }
.pv-covers small { position: absolute; left: 4px; right: 4px; bottom: 1px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-final { border: 2px solid var(--ink); background: #fff; padding: 10px 12px; }
.pv-final .lbl { font-size: 10px; color: var(--ink-2); }
.pv-final .sc { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; font-weight: 600; }
.pv-final .sc span { display: flex; align-items: center; gap: 6px; flex: 1; }
.pv-final .sc span:last-child { justify-content: flex-end; }
.pv-final .sc i { width: 20px; height: 14px; border: 1.5px solid var(--ink); flex: none; }
.pv-final .sc b { font: 18px Silkscreen, monospace; }
.pv-final p { margin: 0; font-size: 12px; }
@media (prefers-reduced-motion: no-preference) { @media (max-width: 760px) { .pv-models, .pv-covers { grid-template-columns: repeat(2, 1fr); } }

/* "dim" is also the desktop's nap overlay; inside windows it just means muted text */
.win .dim { position: static; inset: auto; background: none; opacity: 1; pointer-events: auto; z-index: auto; transition: none; color: var(--ink-2); }

/* arcade: same chrome as Solitaire */
.win.arcade { width: 400px; }
.win[data-win="tray"] { width: 380px; }
.win[data-win="guess"] { width: 560px; }
.body.game { padding: 12px; gap: 10px; }
.g-stack { background: #ead9b8; } .g-conga { background: #d9c39a; } .g-p48 { background: #ead9b8; } .g-cross { background: #d9c39a; } .g-tray { background: #16324d; }
html[data-deck="pancake"] .g-tray { background: #5a3a1f; } html[data-deck="blueprint"] .g-tray { background: #0f2d45; } html[data-deck="classic"] .g-tray { background: #151515; }
.gbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.gstat { display: flex; flex-direction: column; background: var(--paper); border: 2px solid var(--ink); padding: 2px 10px 3px; min-width: 64px; }
.gstat small { font: 9px Silkscreen, monospace; color: var(--ink-2); }
.gstat b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) { .gstat b.bump { animation: bump .25s ease; } }
@keyframes bump { 50% { transform: scale(1.18); } }
.gstage { position: relative; }
.gstage canvas { display: block; width: 100%; height: auto; border: 2px solid var(--ink); touch-action: none; box-shadow: 4px 4px 0 rgb(0 0 0 / .25); }
.gcard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(86%, 300px); background: var(--paper); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: 16px 18px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.gcard[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .gcard:not([hidden]) { animation: pop .22s cubic-bezier(.3, 1.4, .5, 1); } }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.85); opacity: 0; } }
.gcard h3 { margin: 0 0 2px; font: 18px Silkscreen, monospace; font-weight: 400; }
.gcard p { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.gcard small { font-size: 10px; color: var(--ink-2); margin-top: 2px; }
.gbtn, .gbar.bottom button { font: 12px Silkscreen, monospace; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); padding: 4px 12px; cursor: var(--pk-hand); box-shadow: 2px 2px 0 var(--ink); }
.gbtn { margin-top: 8px; background: var(--ink); color: var(--paper); padding: 6px 18px; }
.gbtn:hover, .gbar.bottom button:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.gbtn:active, .gbar.bottom button:active { transform: translate(2px, 2px); box-shadow: none; }
.gpad { display: flex; gap: 6px; margin-left: auto; }
.gpad button { min-width: 38px; font-size: 13px; }
.g-tray .gbar.bottom { color: var(--paper); }
@media (hover: hover) and (pointer: fine) { .g-cross .gbar.bottom { display: none; } .g-tray .gpad { display: none; } .g-conga .gbar.bottom { display: none; } }
.folder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }

/* Pancake 2048 */
.p48 { --gap: 8px; --cell: calc((100% - 5 * var(--gap)) / 4); position: relative; aspect-ratio: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); padding: var(--gap); background: #b98a5a; border: 2px solid var(--ink); box-shadow: 4px 4px 0 rgb(0 0 0 / .25); touch-action: none; user-select: none; }
.p48 .slot { background: rgb(255 248 230 / .28); border-radius: 4px; box-shadow: inset 0 2px 0 rgb(0 0 0 / .08); }
.p48 .tiles { position: absolute; inset: var(--gap); }
.p48t { --sz: calc((100% - 3 * var(--gap)) / 4); position: absolute; width: var(--sz); height: var(--sz); left: 0; top: 0; transform: translate(calc(var(--c) * (100% + var(--gap))), calc(var(--r) * (100% + var(--gap)))); border-radius: 4px; border: 2px solid var(--ink); background: #fbf3df; display: grid; place-items: end center; overflow: hidden; }
.p48t .num { position: absolute; left: 4px; top: 4px; font: 12px Silkscreen, monospace; line-height: 1; color: var(--ink); background: #fff; border: 1.5px solid var(--ink); border-radius: 3px; padding: 2px 4px 1px; }
.p48t.v2048 .num, .p48t.v4096 .num { background: var(--ink); color: #f2d64b; }
/* each size gets its own colour family so neighbours are easy to tell apart */
.p48t.v2 { background: #fbf3df; } .p48t.v4 { background: #cfe3e6; } .p48t.v8 { background: #cfe2b4; } .p48t.v16 { background: #f6d77e; } .p48t.v32 { background: #f4ad86; } .p48t.v64 { background: #e47f63; }
.p48t.v128 { background: #9cc6d8; } .p48t.v256 { background: #7fae74; } .p48t.v512 { background: #d98e4a; } .p48t.v1024 { background: #b77fb4; } .p48t.v2048, .p48t.v4096 { background: #f2d64b; box-shadow: 0 0 0 3px rgb(242 214 75 / .45); }
.pk-stack { position: relative; width: 62%; height: 72%; margin-bottom: 9%; }
.pk-stack b { position: absolute; width: 100%; border: 1.5px solid #5a3a1c; border-radius: 999px; box-sizing: border-box; }
.pk-stack em { position: absolute; display: block; }
.pk-stack .butter { left: 36%; width: 28%; height: 5px; background: #fff6c9; border: 1px solid #5a3a1c; border-radius: 1px; }
.pk-stack .berry { width: 6px; height: 6px; border-radius: 50%; background: #3e4f8c; border: 1px solid #1e2752; }
.pk-stack .syrup { left: 8%; width: 84%; height: 10px; background: linear-gradient(#b8742f, #9a5c22); border-radius: 6px 6px 3px 3px; opacity: .9; clip-path: polygon(0 0, 100% 0, 100% 60%, 88% 100%, 76% 55%, 60% 90%, 44% 50%, 28% 100%, 14% 55%, 0 70%); }
.pk-stack img { position: absolute; left: 50%; width: 70%; transform: translateX(-50%); }
.p48plus { position: absolute; right: 10px; top: -4px; font: 14px Silkscreen, monospace; color: #b8574f; pointer-events: none; }
.g-p48 .gbar.bottom button:disabled { opacity: .45; cursor: var(--pk-arrow); }
@media (prefers-reduced-motion: no-preference) {
  .p48t { transition: transform .11s ease-in-out; }
  .p48t.new { animation: p48-new .18s ease-out .06s both; }
  .p48t.merged { animation: p48-merge .2s cubic-bezier(.3, 1.6, .5, 1); z-index: 2; }
  .p48plus { animation: p48-plus .7s ease-out forwards; }
  .p48.bump0 { animation: p48-b0 .16s; } .p48.bump1 { animation: p48-b1 .16s; } .p48.bump2 { animation: p48-b2 .16s; } .p48.bump3 { animation: p48-b3 .16s; }
}
@keyframes p48-new { from { scale: 0; } to { scale: 1; } }
@keyframes p48-merge { 0% { scale: .8; } 50% { scale: 1.16; } 100% { scale: 1; } }
@keyframes p48-plus { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: 0 -30px; } }
@keyframes p48-b0 { 50% { translate: 0 -4px; } } @keyframes p48-b1 { 50% { translate: 4px 0; } } @keyframes p48-b2 { 50% { translate: 0 4px; } } @keyframes p48-b3 { 50% { translate: -4px 0; } }
