/* ==========================================================================
   Games: game-specific boards, cards, animations, and arcade controls.
   Loaded after effects.css and before styles.css.
   ========================================================================== */

/* Native color picker as a plain round swatch (Playground) */
.color-input { -webkit-appearance: none; appearance: none; border: 2px solid rgba(73, 59, 55, .2); border-radius: 9999px; padding: 0; background: none; }
.color-input::-webkit-color-swatch-wrapper { padding: 0; border-radius: 9999px; }
.color-input::-webkit-color-swatch { border: none; border-radius: 9999px; }
.color-input::-moz-color-swatch { border: none; border-radius: 9999px; }

/* Games, whose turn: theirs — greyed, asleep (z's floating up: gameWaiting); mine — a soft glow pulsing (gameMe); the line under the game */
.game-waiting-who > :first-child, .game-who.is-idle > :first-child { filter: grayscale(1); opacity: .55; }
/* A closed box: its z's stand still (no motion beside the other things on the page) */
.arcade-box:not(.is-open) .zzz i { animation: none; opacity: .6; }
.arcade-box:not(.is-open) .zzz i:nth-child(2) { transform: translate(5px, -7px); }
.arcade-box:not(.is-open) .zzz i:nth-child(3) { transform: translate(10px, -14px); }
@keyframes my-turn { 0%, 100% { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--game, var(--passionfruit)), 0 0 6px 6px rgba(246, 185, 59, .35); }
  50% { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--game, var(--passionfruit)), 0 0 14px 11px rgba(246, 185, 59, .6); } }
.game-who.is-mine > :first-child { animation: my-turn 2.2s ease-in-out infinite; }
.game-hints { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem .75rem; margin-top: .25rem; text-align: center; font-size: .78rem; font-weight: 700; color: rgba(73, 59, 55, .55); }
.game-bar.is-bare { min-height: 0; height: 0; }
.game-bar.is-bare + * { margin-top: 0 !important; }
.game-faded { filter: grayscale(1) opacity(.5); transition: filter .4s; }

/* Bedroom games: a slip / recipe unfolding in, the card shuffle, the envelope opening */
@keyframes slip-in { from { transform: scale(.85) rotate(-4deg); opacity: 0; } to { transform: scale(1) rotate(-1deg); opacity: 1; } }
.slip-in { animation: slip-in .45s var(--ease-bounce) both; }
@keyframes shuffle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-3deg) scale(.97); } 75% { transform: rotate(3deg) scale(.97); } }
.is-shuffling { animation: shuffle .15s linear 3; }
.is-opening { animation: none !important; transition: transform .35s var(--ease-bounce); transform: scale(1.4) rotate(-10deg); }

/* Dice (games/dice.js): a 3D cube with pips that tumbles onto its number */
.dice-scene { --size: 5.5rem; --half: 2.75rem; width: var(--size); height: var(--size); perspective: 600px; transition: transform .25s var(--ease-bounce); }
.dice-cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.2s cubic-bezier(.2, .8, .25, 1); }
.dice-face { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; gap: 4%;
  background: #fff; border-radius: 18%; border: 2px solid rgba(73, 59, 55, .12); box-shadow: inset 0 0 14px rgba(73, 59, 55, .1); backface-visibility: hidden; }
.dice-pip { border-radius: 9999px; background: var(--passionfruit); margin: 12%; box-shadow: inset 0 2px 2px rgba(0, 0, 0, .25); }
.dice-scene:hover { transform: translateY(-3px) scale(1.04); } /* (no filter on the cube: it would flatten it, showing the wrong face) */
.dice-corner { --size: 3rem; --half: 1.5rem; position: relative; } /* on the Games page, top right; the last roll when pointed at */
.dice-corner::after { content: attr(data-tip); position: absolute; right: 0; top: calc(100% + .5rem); z-index: 20; white-space: nowrap; font-size: 11px; font-weight: 600; color: rgba(73, 59, 55, .75);
  background: #fff; border-radius: 9999px; padding: .15rem .6rem; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transition: opacity .2s; }
.dice-corner:hover::after, .dice-corner:focus-visible::after { opacity: 1; }

/* Truth or Dare: the 🤫 wobbles, the 🔥 flickers when you point at the button */
.tod-emoji { display: inline-block; }
@keyframes hush { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-15deg) scale(1.15); } 75% { transform: rotate(15deg) scale(1.15); } }
@keyframes flicker { 0%, 100% { transform: scale(1) translateY(0); } 25% { transform: scale(1.2, 1.35) translateY(-2px); } 50% { transform: scale(.95, 1.1); } 75% { transform: scale(1.15, 1.25) translateY(-1px) rotate(-6deg); } }
.tod-truth:hover .tod-emoji { animation: hush .8s ease-in-out infinite; }
.tod-dare:hover .tod-emoji { animation: flicker .5s ease-in-out infinite; }

/* Fantasy Jar: the pulled ones, little notes next to the jar; pointing at one shows what's on it */
.fantasy-slip { position: relative; width: 2.6rem; height: 1.9rem; border-radius: 3px; transform: rotate(var(--tilt, 0deg)); box-shadow: 0 1px 3px rgba(73, 59, 55, .15); transition: transform .25s var(--ease-bounce); }
.fantasy-slip::after { content: ''; position: absolute; left: 20%; right: 20%; top: 45%; border-top: 1.5px solid rgba(73, 59, 55, .18); } /* a line of writing */
.fantasy-tip { position: absolute; z-index: 50; top: calc(100% + 1rem); left: 50%; transform: translateX(-50%); width: max-content; max-width: 14rem; padding: .45rem .7rem; border-radius: .75rem; background: #fff; box-shadow: var(--shadow-pop);
  font-family: 'Caveat', cursive; font-size: 1.15rem; line-height: 1.2; color: var(--ink, #493B37); text-align: center; white-space: normal; opacity: 0; pointer-events: none; transition: opacity .2s; }
.fantasy-slip:hover, .fantasy-slip:focus-visible { z-index: 45; box-shadow: 0 4px 10px rgba(73, 59, 55, .25); }
.fantasy-slip:hover .fantasy-tip, .fantasy-slip:focus-visible .fantasy-tip { opacity: 1; }
.fantasy-slip:has(.fantasy-mark)::after { display: none; } /* a photo or link slip: its mark instead of a line */
.fantasy-hearts { position: absolute; left: 50%; bottom: -.8rem; transform: translateX(-50%); font-size: 9px; line-height: 1; white-space: nowrap; }
.fantasy-slip.is-meh { filter: grayscale(1); opacity: .45; } /* "not for me" */
.fantasy-comments { position: absolute; top: -.35rem; right: -.35rem; width: .95rem; height: .95rem; border-radius: 9999px; background: #fff; color: rgba(73, 59, 55, .7); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
[data-pep] { transition: transform .15s, opacity .15s, filter .15s; }
.keepsake-tray { position: relative; min-height: 3.2rem; box-shadow: inset 0 2px 5px rgba(73, 59, 55, .05); }
.keepsake-tray:has(.fantasy-slip:hover), .keepsake-tray:has(.fantasy-slip:focus-visible) { z-index: 30; }
.jar-slip-fall { transform-box: fill-box; transform-origin: center; animation: jar-slip-fall .9s cubic-bezier(.3, .1, .4, 1.25) both; }
@keyframes jar-slip-fall { from { transform: translateY(-110px) rotate(25deg); opacity: 0; } 15% { opacity: 1; } }
.jar-glare { animation: jar-glare 7s ease-in-out infinite; }
.jar-btn { cursor: pointer; border-radius: 1rem; }
.jar-slip rect { transition: x .5s cubic-bezier(.25, .8, .25, 1), y .5s cubic-bezier(.25, .8, .25, 1), transform .5s cubic-bezier(.25, .8, .25, 1); }
.is-shaking { animation: jar-rock .9s ease-in-out; transform-origin: 50% 90%; }
@keyframes jar-rock { 15% { transform: rotate(-9deg); } 35% { transform: rotate(8deg); } 55% { transform: rotate(-6deg); } 75% { transform: rotate(4deg); } }
.is-shaking .jar-slip { transform-box: fill-box; transform-origin: center; animation: jar-shake .9s ease-in-out; }
@keyframes jar-shake { 25% { transform: translate(var(--sx), var(--sy)) rotate(var(--sr)); } 55% { transform: translate(calc(var(--sx) * -1), calc(var(--sy) * .6)) rotate(calc(var(--sr) * -.7)); } 80% { transform: translate(calc(var(--sx) * .3), calc(var(--sy) * .2)); } }
@keyframes jar-glare { 0%, 70% { transform: translateX(0); } 100% { transform: translateX(150px); } }
.fantasy-icons { position: absolute; z-index: 30; bottom: calc(100% + .4rem); right: 0; display: grid; grid-template-columns: repeat(4, 2.25rem); gap: .2rem; padding: .4rem; border-radius: .9rem; background: #fff; box-shadow: var(--shadow-pop); }
.fantasy-icons[hidden] { display: none; }
.fantasy-icons button { width: 2.25rem; height: 2.25rem; display: flex; align-items: center; justify-content: center; border-radius: .6rem; color: var(--passionfruit); }
.fantasy-icons button:hover { background: rgba(246, 185, 59, .18); }
.fantasy-icons button.is-on { background: var(--passionfruit); color: #fff; }

/* Memory: cards that turn over (the back: the other one's avatar) */
.memory-card { position: relative; aspect-ratio: 1; perspective: 700px; border-radius: .8rem; transition: opacity .35s, transform .35s, filter .35s; }
.memory-card .mc-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s var(--ease-bounce); }
.memory-card.is-up .mc-inner { transform: rotateY(180deg); }
.memory-card.is-turning:not(.is-up) .mc-inner { transform: rotateY(25deg); }
.mc-back, .mc-front { position: absolute; inset: 0; border-radius: .8rem; overflow: hidden; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 3px 8px -3px rgba(73, 59, 55, .35); }
.mc-back { background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.55) 0 8%, transparent 9%) 0 0 / 14px 14px, var(--game); border: 3px solid #fff; }
.mc-front { transform: rotateY(180deg); background: #FFFDF5; border: 3px solid #fff; }
.mc-front img { width: 100%; height: 100%; object-fit: cover; }
.memory-card.is-playable { cursor: pointer; }
.memory-card.is-playable:not(.is-up):hover .mc-inner { transform: translateY(-3px) rotateY(8deg); }
.memory-card.is-open { z-index: 2; transform: translateY(-3px) scale(1.03); }
.memory-card.is-open .mc-front { border-color: var(--mango, #F6B93B); box-shadow: 0 0 0 3px var(--game, var(--passionfruit)), 0 10px 18px -4px rgba(108, 38, 92, .45); }
.memory-card.is-matched:not(.is-new-pair) { opacity: .58; transform: scale(.94); filter: saturate(.75); }
.memory-card.is-matched .mc-front { border-color: var(--greentea, #91A875); box-shadow: 0 0 0 2px var(--greentea, #91A875), 0 3px 8px -3px rgba(73, 59, 55, .25); }
.mc-badge { position: absolute; top: .22rem; right: .22rem; z-index: 2; display: inline-flex; align-items: center; gap: .2rem; border-radius: 9999px; font-size: .65rem; font-weight: 800; line-height: 1; pointer-events: none; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); }
.mc-badge.is-open-badge { padding: .15rem .35rem .15rem .15rem; background: var(--game, var(--passionfruit)); color: #fff; border: 1.5px solid #fff; }
.mc-badge.is-matched-badge { width: 1.15rem; height: 1.15rem; justify-content: center; background: var(--greentea, #91A875); color: #fff; border: 1.5px solid #fff; }
.memory-card.is-new-pair { animation: memory-pair .5s var(--ease-bounce) .45s; }
@keyframes memory-pair { 50% { transform: scale(1.06); } }

/* From 1 to 1: compact — a slim row of numbers; the emoji hints open from a small button (pointing at it, or a tap) */
.oto-block { border-radius: 1rem; background: rgba(250, 245, 234, .7); padding: .65rem .75rem .75rem; }
.oto-hints { position: relative; }
.oto-hint-btn { display: inline-flex; align-items: center; gap: .3rem; height: 2.3rem; padding: 0 .7rem; border-radius: .75rem; background: #fff; color: rgba(73, 59, 55, .65); box-shadow: inset 0 0 0 1.5px rgba(73, 59, 55, .12); }
.oto-hint-btn:hover { box-shadow: inset 0 0 0 1.5px rgba(108, 38, 92, .35); }
.oto-palette { position: absolute; z-index: 30; left: 0; bottom: calc(100% + .35rem); display: grid; grid-template-columns: repeat(7, 2rem); gap: .1rem; padding: .4rem;
  background: #fff; border-radius: .9rem; box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(4px) scale(.97); pointer-events: none; transition: opacity .15s, transform .15s; }
.oto-palette::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: .5rem; } /* (no gap to lose the pointer in) */
@media (hover: hover) { .oto-hints:hover .oto-palette { opacity: 1; transform: none; pointer-events: auto; } }
.oto-hints.is-open .oto-palette { opacity: 1; transform: none; pointer-events: auto; }
.oto-palette button { width: 2rem; height: 2rem; border-radius: .55rem; font-size: 1.15rem; line-height: 1; transition: transform .15s, background-color .15s; }
.oto-palette button:hover { transform: scale(1.2); background: rgba(246, 185, 59, .15); }
.oto-palette button.is-on { background: rgba(246, 185, 59, .35); box-shadow: inset 0 0 0 1.5px var(--passionfruit); }

/* Mau-Mau: a green felt table; the other one's hand face down above, the deck and pile in the middle, mine fanned below */
.mm-table { --table-light: color-mix(in srgb, var(--game) 78%, #fff); border-radius: 1.25rem; padding: .8rem .7rem 1rem; background: radial-gradient(ellipse at 50% 40%, var(--table-light, #2f8e56), var(--game)); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .12), inset 0 6px 20px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: .8rem; }
.mm-card { position: relative; display: block; width: 2.9rem; height: 4.1rem; border-radius: .45rem; background: #FFFDF8; box-shadow: 0 2px 5px rgba(0, 0, 0, .3); font-family: 'Lora', serif; flex-shrink: 0; }
.mm-card.is-back { background: repeating-linear-gradient(45deg, var(--game) 0 4px, var(--game-deep) 4px 8px); border: 3px solid #fff; }
.mm-corner { position: absolute; left: .25rem; top: .15rem; font-size: .72rem; line-height: .95; display: flex; flex-direction: column; align-items: center; }
.mm-corner i { font-style: normal; font-size: .62rem; }
.mm-corner.is-bottom { left: auto; top: auto; right: .25rem; bottom: .15rem; transform: rotate(180deg); }
.mm-pip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.mm-other { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.mm-fan { display: flex; }
.mm-fan .mm-card { width: 1.7rem; height: 2.4rem; border-width: 2px; margin-left: -1.05rem; transform: rotate(calc((var(--i) - 3) * 3deg)); }
.mm-fan .mm-card:first-child { margin-left: 0; }
.mm-middle { display: grid; grid-template-columns: 1fr auto auto 1fr; align-items: center; gap: .9rem; }
.mm-deck { grid-column: 2; position: relative; width: 2.9rem; height: 4.1rem; }
.mm-deck .mm-card { position: absolute; inset: 0; }
.mm-deck .mm-card + .mm-card { transform: translate(3px, -3px); }
.mm-deck:not(:disabled) { cursor: pointer; }
.mm-deck:not(:disabled):hover .mm-card + .mm-card { transform: translate(5px, -7px) rotate(4deg); }
.mm-deck-label { position: absolute; left: 50%; bottom: -1.1rem; transform: translateX(-50%); font-size: 10px; font-weight: 800; color: #fff; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.mm-pile { grid-column: 3; position: relative; }
.mm-pile .mm-card { transform: rotate(-4deg); }
.mm-pile .mm-card.is-landing { animation: mm-land .45s var(--ease-bounce); }
@keyframes mm-land { from { transform: translateY(70px) rotate(18deg) scale(1.1); opacity: .4; } }
.mm-wish { position: absolute; right: -.7rem; top: -.7rem; width: 1.6rem; height: 1.6rem; border-radius: 9999px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.mm-note { grid-column: 4; display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; min-width: 0; }
.mm-note span { color: rgba(255, 255, 255, .85) !important; text-align: left; }
.mm-hand { display: flex; justify-content: center; padding: .4rem .5rem 0; min-height: 4.6rem; }
.mm-slot { --dist: max(var(--i) - (var(--n) - 1) / 2, (var(--n) - 1) / 2 - var(--i)); margin-left: -.9rem; transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 4deg)) translateY(calc(var(--dist) * 2px)); transform-origin: 50% 120%; transition: transform .25s var(--ease-bounce); }
.mm-slot:first-child { margin-left: 0; }
.mm-slot:disabled { cursor: default; }
.mm-slot:disabled .mm-card { filter: brightness(.94); }
.mm-slot.is-playable { cursor: pointer; }
.mm-slot.is-playable .mm-card { box-shadow: 0 0 0 2px #F6C443, 0 4px 10px rgba(0, 0, 0, .3); }
.mm-slot.is-playable:hover { transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 4deg)) translateY(-14px); z-index: 2; }

/* Poker & Strip Poker (inside Card Games table) */
.mm-table.is-strip { --table-light: #9A2B55; background: radial-gradient(ellipse at 50% 40%, #8E284F, #4A1128); }
.pk-board { display: flex; justify-content: center; gap: .35rem; flex-wrap: nowrap; }
.pk-board .mm-card { width: 2.75rem; height: 3.9rem; }
.pk-slot-empty { width: 2.75rem; height: 3.9rem; border-radius: .45rem; border: 1.5px dashed rgba(255, 255, 255, .28); background: rgba(0, 0, 0, .12); }
.mm-card.is-best { box-shadow: 0 0 0 2.5px #F6C443, 0 0 14px rgba(246, 196, 67, .75); transform: translateY(-4px); }
.pk-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 9999px; font-size: 11px; font-weight: 800; background: rgba(0, 0, 0, .26); color: #fff; }
.pk-chip.is-pot { background: rgba(246, 196, 67, .92); color: #3D2618; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.pk-clothes { display: flex; align-items: center; gap: .2rem; font-size: .85rem; line-height: 1; }
.pk-clothes .is-off { opacity: .22; filter: grayscale(1); transform: scale(.85); }
.pk-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.pk-btn { padding: .35rem .7rem; border-radius: .65rem; font-size: .75rem; font-weight: 800; background: rgba(255, 255, 255, .94); color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .22); transition: transform .15s, background-color .15s; }
.pk-btn:hover:not(:disabled) { transform: translateY(-2px); background: #fff; }
.pk-btn.is-raise { background: #F6C443; color: #3D2618; }
.pk-btn.is-allin { background: #E2475A; color: #fff; }
.pk-btn.is-fold { background: rgba(255, 255, 255, .2); color: rgba(255, 255, 255, .9); box-shadow: none; }
.pk-btn.is-fold:hover { background: rgba(226, 71, 90, .85); color: #fff; }

/* Exquisite Corpse & Playground */
.corpse-sheet { position: relative; border-radius: .5rem; overflow: hidden; border: 1px solid rgba(73, 59, 55, .15); } /* (like the other canvases: no shadow) */
.corpse-sheet::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed rgba(73, 59, 55, .25); pointer-events: none; }
.corpse-half { display: block; }
.corpse-pick { width: 100%; display: flex; align-items: center; justify-content: center; background: #fff; color: rgba(73, 59, 55, .55); transition: background-color .2s, color .2s; }
.corpse-pick:not(.is-mine) { background: rgba(73, 59, 55, .06); color: rgba(73, 59, 55, .35); }
.corpse-pick:not(.is-mine):hover { background: rgba(73, 59, 55, .1); }
.corpse-hidden { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center;
  background: repeating-linear-gradient(-45deg, #F7F1E6 0 12px, #EFE6D6 12px 24px); }
.corpse-sheet.is-stitched::after { border: 0; height: 8px; margin-top: -4px; /* a seam of little cross stitches */
  background: repeating-linear-gradient(45deg, transparent 0 5px, #E2475A 5px 6.5px, transparent 6.5px 11px), repeating-linear-gradient(-45deg, transparent 0 5px, #E2475A 5px 6.5px, transparent 6.5px 11px);
  background-size: 11px 8px; opacity: .8; animation: corpse-stitch 1.2s steps(24) both; }
@keyframes corpse-stitch { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.snap-flash { position: absolute; inset: 0; border-radius: .5rem; background: #fff; pointer-events: none; animation: snap-flash .7s ease-out forwards; box-shadow: 0 0 0 4px #fff; }
@keyframes snap-flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

/* Stickyfight: the stage (a soft spotlight), what happens popping up over the figures, the picks below */
.sf-stage { position: relative; border-radius: 1rem; padding: .4rem .3rem 0; background: radial-gradient(ellipse 55% 70% at 50% 75%, var(--game-soft), transparent 70%), rgba(250, 245, 234, .6); }
.sf-say { position: absolute; inset: 0; pointer-events: none; }
.sf-round { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-family: 'Lora', serif; font-weight: 700; font-size: 1.8rem; color: var(--passionfruit); animation: stage-count .7s ease-out both; }
.sf-pop { position: absolute; top: 18%; transform: translateX(-50%); font-weight: 800; font-size: 1.05rem; white-space: nowrap; animation: sf-pop 1.3s ease-out forwards; text-shadow: 0 1px 0 #fff, 0 0 6px #fff; }
.sf-pop.is-hit { color: #E2475A; } .sf-pop.is-block { color: #3E6FD8; } .sf-pop.is-grab { color: #B6852B; } .sf-pop.is-miss { color: rgba(73, 59, 55, .6); }
@keyframes sf-pop { 0% { opacity: 0; transform: translate(-50%, 8px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 30% { transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -26px); } }
.sf-grab { cursor: pointer; }
.sf-grab:hover > g, .sf-grab.is-picked > g { filter: drop-shadow(0 0 4px rgba(246, 185, 59, .95)); }
.sf-grab.is-picked > g { transform-box: fill-box; }
.sf-controls { display: grid; grid-template-columns: 1fr 1fr auto; gap: .9rem; align-items: start; }
@media (max-width: 560px) { .sf-controls { grid-template-columns: 1fr 1fr; } .sf-go { grid-column: span 2; } }
.sf-label { display: flex; align-items: center; gap: .3rem; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: rgba(73, 59, 55, .5); margin-bottom: .35rem; }
.sf-zones { display: flex; gap: .3rem; }
.sf-zone { flex: 1; height: 2.3rem; border-radius: .7rem; font-size: .78rem; font-weight: 700; background: #fff; color: rgba(73, 59, 55, .7); box-shadow: inset 0 0 0 1.5px rgba(73, 59, 55, .12); transition: all .15s; }
.sf-zone:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px rgba(108, 38, 92, .4); }
.sf-zone.is-on { background: var(--game); color: #fff; box-shadow: none; }
.sf-zone:disabled { opacity: .35; }
.sf-go { align-self: end; min-height: 2.3rem; }

/* Tease: mirror, crack shake, pokable cursor, archive strip */
@keyframes crack { 0%, 100% { transform: rotate(0deg) scale(1); } 20% { transform: rotate(-4deg) scale(1.04); } 40% { transform: rotate(3deg) scale(.98); } 60% { transform: rotate(-2deg) scale(1.03); } 80% { transform: rotate(1deg); } }
.is-cracking { animation: crack .45s ease-in-out; }
.tease-mirror { cursor: pointer; display: block; }
.tease-glass { fill: var(--game-soft); }
.tease-plus { opacity: .0; transition: opacity .25s; }
.tease-mirror:hover .tease-plus { opacity: 1; }
.tease-blanket { transform-box: fill-box; transform-origin: 30% 0; transition: transform .45s var(--ease-bounce); }
.tease-mirror:hover .tease-blanket { transform: rotate(-6deg) translate(4px, -2px); }
@media (hover: none) { .tease-plus { opacity: 1; } }
.tease-pokable { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ctext x='0' y='24' font-size='24'%3E%F0%9F%91%89%3C/text%3E%3C/svg%3E") 28 14, pointer; }
.tease-pokable:active { transform: scale(.98); }
.tease-done { aspect-ratio: 3 / 4; border-radius: .5rem; overflow: hidden; filter: grayscale(1); transition: filter .2s, transform .2s, opacity .2s; box-shadow: 0 2px 6px -3px rgba(73, 59, 55, .4); }
.tease-done:hover { filter: grayscale(1) contrast(1.08); transform: scale(1.08); opacity: 1 !important; z-index: 10; }
.tease-done img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }

/* Spin the Wheel (wheel.js): a lever at the side — pull it down to spin; it springs back */
.wheel-lever { position: relative; width: 2.2rem; flex-shrink: 0; cursor: pointer; }
.wheel-lever:disabled { cursor: default; }
.wheel-lever-slot { position: absolute; left: 50%; top: 12%; bottom: 12%; width: .45rem; transform: translateX(-50%); border-radius: 9999px; background: var(--game-soft); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15); }
.wheel-lever-arm { position: absolute; left: 50%; top: 14%; width: .3rem; height: 45%; transform: translateX(-50%); transform-origin: 50% 100%; border-radius: 9999px; background: var(--game-deep); transition: top .25s ease-in, height .25s ease-in; }
.wheel-lever-knob { position: absolute; left: 50%; top: -.55rem; width: 1.3rem; height: 1.3rem; transform: translateX(-50%); border-radius: 9999px; background: var(--game); box-shadow: inset -2px -3px 0 rgba(0, 0, 0, .18), 0 3px 6px -2px rgba(0, 0, 0, .35); }
.wheel-lever:not(:disabled):hover .wheel-lever-arm { top: 18%; }
.wheel-lever.is-down .wheel-lever-arm { top: 60%; height: 26%; transition: top .2s ease-in, height .2s ease-in; }

/* Connect Four: physical falling chip animation */
.cf-board { --cf-gap: 0.375rem; --cf-pad: 0.5rem; }
@media (min-width: 640px) { .cf-board { --cf-gap: 0.5rem; --cf-pad: 0.75rem; } }
@keyframes cf-chip-fall {
  0% { transform: translateY(calc(-100% * (var(--row) + 1) - var(--row) * var(--cf-gap, 0.375rem) - var(--cf-pad, 0.5rem) - 0.75rem)); animation-timing-function: cubic-bezier(0.5, 0.05, 0.8, 0.3); }
  65% { transform: translateY(0); animation-timing-function: cubic-bezier(0.12, 0.9, 0.32, 1); }
  78% { transform: translateY(-16%); animation-timing-function: cubic-bezier(0.7, 0.05, 0.85, 0.4); }
  89% { transform: translateY(0); animation-timing-function: cubic-bezier(0.15, 0.9, 0.4, 1); }
  95% { transform: translateY(-4%); animation-timing-function: ease-in; }
  100% { transform: translateY(0); }
}
.cf-falling-chip { animation: cf-chip-fall calc(0.24s + var(--row, 0) * 0.06s) both; will-change: transform; }
@keyframes cf-outline-pop {
  0%, 65% { outline-color: transparent; }
  75% { outline-color: rgba(255, 255, 255, 0.9); outline-offset: 3px; }
  100% { outline-color: #fff; outline-offset: 1px; }
}
.cf-last-cell { outline: 2px solid transparent; outline-offset: 1px; animation: cf-outline-pop calc(0.24s + var(--row, 0) * 0.06s) forwards; }
@media (prefers-reduced-motion: reduce) {
  .cf-falling-chip { animation: none !important; }
  .cf-last-cell { animation: none !important; outline-color: #fff !important; }
}

/* Tic-Tac-Toe: Rubber stamp pop & Winning celebration pulse */
@keyframes xo-stamp-in {
  0% { transform: scale(0.2) rotate(-8deg); opacity: 0; }
  50% { opacity: 1; }
  75% { transform: scale(1.18) rotate(3deg); }
  90% { transform: scale(0.96) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.xo-stamp { animation: xo-stamp-in 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both; will-change: transform; }
@keyframes xo-tile-impact {
  0% { transform: scale(1); }
  35% { transform: scale(0.93); }
  70% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.xo-impact { animation: xo-tile-impact 0.32s ease-out both; }
@keyframes xo-win-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 2px var(--game, var(--passionfruit)), 0 4px 12px rgba(108, 38, 92, 0.15); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 3px var(--game, var(--passionfruit)), 0 0 16px 4px rgba(246, 185, 59, 0.45); }
}
.xo-win-cell { border-color: var(--game, var(--passionfruit)) !important; background-color: #fff !important; animation: xo-win-pulse 2.2s ease-in-out infinite; animation-delay: calc(var(--win-delay, 0s) + var(--win-i, 0) * 0.15s); z-index: 5; position: relative; }
.xo-impact.xo-win-cell { animation: xo-tile-impact 0.32s ease-out both, xo-win-pulse 2.2s ease-in-out calc(var(--win-delay, 0.35s) + var(--win-i, 0) * 0.15s) infinite; }
@media (prefers-reduced-motion: reduce) {
  .xo-stamp, .xo-impact, .xo-win-cell, .xo-impact.xo-win-cell { animation: none !important; }
  .xo-win-cell { box-shadow: 0 0 0 3px var(--game, var(--passionfruit)) !important; }
}

/* ==========================================================================
   Pack the Suitcase (games/suitcase.js): vintage hardshell suitcase grid,
   polyomino inventory tiles, ghost preview, match-clear pop & zipper bust.
   ========================================================================== */
.sk-case-wrap { position: relative; padding-top: .85rem; }
.sk-handle { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 5.5rem; height: 1.15rem; border: 4px solid #7C4E35; border-bottom: 0; border-radius: .75rem .75rem 0 0; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25); pointer-events: none; }
.sk-case {
  position: relative; padding: .55rem; border-radius: 1.15rem;
  background: linear-gradient(155deg, #B9815E, #8F5A3C);
  border: 2.5px solid #6E4129;
  box-shadow: 0 10px 22px -10px rgba(73, 59, 55, .45), inset 0 2px 0 rgba(255, 255, 255, .28), inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.sk-case.is-spicy {
  background: linear-gradient(155deg, #8F2D56, #5E1B3B);
  border-color: #451029;
}
.sk-case.is-busted { animation: sk-bust .55s ease-in-out; }
@keyframes sk-bust { 15% { transform: translateX(-5px) rotate(-1.5deg); } 35% { transform: translateX(5px) rotate(1.5deg); } 55% { transform: translateX(-4px) rotate(-1deg); } 75% { transform: translateX(3px); } }
.sk-zipper {
  position: relative; padding: .35rem; border-radius: .85rem;
  background: #F6EFE2;
  border: 2px dashed rgba(73, 59, 55, .28);
  box-shadow: inset 0 3px 10px rgba(73, 59, 55, .14);
}
.sk-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px;
  background: rgba(73, 59, 55, .1); padding: 2px; border-radius: .55rem;
  position: relative; touch-action: manipulation;
}
.sk-cell {
  position: relative; aspect-ratio: 1; border-radius: .32rem;
  background: rgba(255, 253, 248, .92);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s var(--ease-bounce), background-color .15s, box-shadow .15s;
  user-select: none; padding: 0; border: 0;
}
.sk-cell.is-empty { cursor: pointer; }
.sk-cell.is-filled {
  background: var(--sk-bg, #F6B93B);
  box-shadow: inset 0 0 0 1.5px var(--sk-bd, rgba(73, 59, 55, .22)), inset 0 2px 0 rgba(255, 255, 255, .45);
}
.sk-cell.is-filled.is-conn-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: -2px; padding-right: 2px; z-index: 1; }
.sk-cell.is-filled.is-conn-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.sk-cell.is-filled.is-conn-b { border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: -2px; padding-bottom: 2px; z-index: 1; }
.sk-cell.is-filled.is-conn-t { border-top-left-radius: 0; border-top-right-radius: 0; }
.sk-cell.is-just-placed { animation: sk-drop .38s var(--ease-bounce) both; }
@keyframes sk-drop { 0% { transform: scale(.55); opacity: .4; } 65% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.sk-cell.is-preview-ok { background: rgba(145, 168, 117, .42) !important; box-shadow: inset 0 0 0 2px var(--greentea, #91A875) !important; z-index: 4; }
.sk-cell.is-preview-bad { background: rgba(233, 140, 145, .48) !important; box-shadow: inset 0 0 0 2px #E2475A !important; z-index: 4; }
.sk-cell.is-will-pop { animation: sk-will-pop .65s ease-in-out infinite; z-index: 5; }
@keyframes sk-will-pop { 0%, 100% { box-shadow: inset 0 0 0 2px #F6B93B, 0 0 0 0 rgba(246, 185, 59, .7); } 50% { box-shadow: inset 0 0 0 2px #E2475A, 0 0 10px 2px rgba(246, 185, 59, .9); transform: scale(1.04); } }
.sk-emoji { font-size: clamp(.9rem, 2.7vw, 1.3rem); line-height: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .14)); pointer-events: none; }
.sk-pop-ghost {
  position: absolute; inset: 0; border-radius: .35rem; pointer-events: none; z-index: 8;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(246, 185, 59, .85), rgba(233, 140, 145, .35) 65%, transparent);
  animation: sk-pop-burst .75s ease-out forwards;
}
@keyframes sk-pop-burst { 0% { transform: scale(.7); opacity: 1; } 45% { transform: scale(1.35); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.sk-banner {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 15; pointer-events: none;
  padding: .35rem .85rem; border-radius: 9999px; background: #fff; border: 2px solid var(--mango, #F6B93B);
  color: var(--passionfruit); font-weight: 800; font-size: .82rem; white-space: nowrap;
  box-shadow: 0 10px 24px -6px rgba(73, 59, 55, .45);
  animation: sk-banner-float 1.85s ease-out forwards;
}
@keyframes sk-banner-float {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(.75); }
  16% { opacity: 1; transform: translate(-50%, -6px) scale(1.06); }
  75% { opacity: 1; transform: translate(-50%, -14px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(.96); }
}
.sk-mini { display: inline-grid; gap: 2px; padding: 3px; border-radius: .45rem; background: rgba(73, 59, 55, .07); }
.sk-mini-cell { width: .85rem; height: .85rem; border-radius: 3px; }
.sk-mini-cell.is-on { background: var(--sk-bg, #F6B93B); box-shadow: inset 0 0 0 1px var(--sk-bd, rgba(73, 59, 55, .25)); }
.sk-tray-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: .3rem;
  padding: .55rem .4rem; border-radius: .9rem; background: #fff; border: 2px solid rgba(73, 59, 55, .12);
  transition: transform .18s var(--ease-bounce), border-color .15s, box-shadow .15s;
}
.sk-tray-btn:hover { transform: translateY(-3px); border-color: var(--game, var(--passionfruit)); box-shadow: 0 6px 14px -6px rgba(73, 59, 55, .3); }
.sk-tray-btn.is-spicy-item { border-color: rgba(226, 71, 90, .35); background: linear-gradient(180deg, #fff, #FFF5F7); }
.sk-pill { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 9999px; font-size: .72rem; font-weight: 800; background: rgba(73, 59, 55, .07); color: var(--ink); }
.sk-pill.is-spicy-on { background: rgba(226, 71, 90, .16); color: #B3243A; }

/* ==========================================================================
   Street Kitchen (games/kitchen.js): stall counter, hanging tickets,
   sizzling woks, rising steam, wooden cutting board & pantry.
   ========================================================================== */
.kt-stall {
  position: relative; padding: .65rem; border-radius: 1.1rem;
  background: linear-gradient(180deg, #FDF6E9, #F5E8D3);
  border: 2px solid rgba(138, 90, 52, .24);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .65);
}
.kt-rail {
  padding-top: .35rem;
  border-top: 3px solid #7C5234;
  border-radius: 2px;
}
.kt-ticket {
  position: relative; padding: .4rem .3rem .35rem; border-radius: .35rem .35rem .55rem .55rem;
  background: #FFFDF8; border: 1px solid rgba(73, 59, 55, .14);
  box-shadow: 0 3px 8px -4px rgba(73, 59, 55, .35);
}
.kt-ticket-pin {
  position: absolute; top: -.28rem; left: 50%; transform: translateX(-50%);
  width: .45rem; height: .45rem; border-radius: 9999px; background: #D93848; border: 1.5px solid #fff;
}
.kt-wok {
  display: flex; flex-direction: column; gap: .35rem; padding: .5rem; border-radius: .9rem;
  background: rgba(255, 255, 255, .82); border: 2px solid rgba(73, 59, 55, .12);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kt-wok.is-selected { border-color: var(--game, var(--passionfruit)); box-shadow: 0 0 0 2px rgba(246, 185, 59, .3); }
.kt-wok.is-ready { border-color: var(--greentea, #91A875); background: #F7FBF2; box-shadow: 0 0 12px -2px rgba(145, 168, 117, .55); }
.kt-wok.is-warning { border-color: #E2475A; background: #FFF2F3; animation: kt-shake .45s ease-in-out infinite; }
.kt-wok.is-burnt { border-color: #493B37; background: #E9E4DF; }
@keyframes kt-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px) rotate(-.6deg); } 75% { transform: translateX(2px) rotate(.6deg); } }
.kt-pan {
  position: relative; padding: .45rem .35rem; border-radius: 9999px;
  background: radial-gradient(circle at 38% 35%, #59504D, #2C2624);
  border: 2.5px solid #1E1A19;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .45);
}
.kt-wok.is-cooking .kt-pan, .kt-wok.is-ready .kt-pan { box-shadow: inset 0 3px 8px rgba(0, 0, 0, .45), 0 4px 12px -2px rgba(243, 169, 43, .65); }
.kt-wok.is-warning .kt-pan { box-shadow: inset 0 3px 8px rgba(0, 0, 0, .45), 0 4px 14px -1px rgba(226, 71, 90, .85); }
.kt-steam { position: absolute; left: 50%; top: -.25rem; transform: translateX(-50%); display: flex; gap: .35rem; pointer-events: none; }
.kt-steam i { width: .32rem; height: .7rem; border-radius: 9999px; background: rgba(255, 255, 255, .75); filter: blur(1px); animation: kt-steam 1.2s ease-out infinite; }
.kt-steam i:nth-child(2) { animation-delay: .35s; }
.kt-steam i:nth-child(3) { animation-delay: .7s; }
.kt-wok.is-warning .kt-steam i { background: rgba(120, 110, 108, .75); }
@keyframes kt-steam { 0% { opacity: 0; transform: translateY(4px) scale(.7); } 40% { opacity: .85; } 100% { opacity: 0; transform: translateY(-16px) scale(1.3); } }
.kt-meter { height: .35rem; border-radius: 9999px; background: rgba(73, 59, 55, .12); overflow: hidden; }
.kt-meter > span { display: block; height: 100%; background: var(--mango, #F6B93B); transition: width .22s linear; border-radius: 9999px; }
.kt-wok.is-ready .kt-meter > span { background: var(--greentea, #91A875); }
.kt-wok.is-warning .kt-meter > span { background: #E2475A; }
.kt-wok.is-burnt .kt-meter > span { background: #493B37; }
.kt-board {
  padding: .45rem .5rem; border-radius: .8rem;
  background: repeating-linear-gradient(90deg, #E8CFAF 0 10px, #E2C6A2 10px 20px);
  border: 1.5px solid rgba(138, 90, 52, .3);
}
.kt-prep-slot {
  position: relative; min-height: 3.3rem; border-radius: .65rem; padding: .3rem .25rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 253, 248, .85); border: 1.5px dashed rgba(73, 59, 55, .2);
  transition: transform .15s var(--ease-bounce), border-color .15s;
}
.kt-prep-slot.is-raw { border-style: solid; border-color: rgba(246, 185, 59, .75); background: #FFFBF0; }
.kt-prep-slot.is-chopped { border-style: solid; border-color: var(--greentea, #91A875); background: #F5FBF0; }
.kt-prep-slot:not(.is-empty):hover { transform: translateY(-2px); }
.kt-prep-x {
  position: absolute; top: -.3rem; right: -.3rem; width: 1.15rem; height: 1.15rem; border-radius: 9999px;
  background: #fff; border: 1px solid rgba(73, 59, 55, .2); color: rgba(73, 59, 55, .6);
  font-size: 11px; font-weight: 800; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.kt-prep-x:hover { color: #E2475A; }
.kt-pantry-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  padding: .35rem .15rem; border-radius: .6rem; background: #fff; border: 1.5px solid rgba(73, 59, 55, .1);
  transition: transform .15s var(--ease-bounce), border-color .15s;
}
.kt-pantry-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--game, var(--passionfruit)); }
.kt-pantry-btn:disabled { opacity: .45; cursor: default; }

/* ==========================================================================
   Full-width (.arcade-cell.is-wide) game layouts: keep expanded boxes
   balanced, crisp, and nicely proportioned instead of over-stretched.
   ========================================================================== */
@media (min-width: 640px) {
  /* Card Games (Mau-Mau, Texas Hold'em & Strip Poker): spacious casino table */
  .arcade-cell.is-wide .mm-table { padding: 1.25rem 2rem 1.5rem; gap: 1rem; }
  .arcade-cell.is-wide .mm-card { width: 3.45rem; height: 4.85rem; }
  .arcade-cell.is-wide .mm-deck { width: 3.45rem; height: 4.85rem; }
  .arcade-cell.is-wide .mm-hand { min-height: 5.4rem; }
  .arcade-cell.is-wide .pk-board { gap: .6rem; }
  .arcade-cell.is-wide .pk-board .mm-card,
  .arcade-cell.is-wide .pk-slot-empty { width: 3.45rem; height: 4.85rem; }

  /* Keep square/grid boards nicely sized & centered inside full-width boxes */
  .arcade-cell.is-wide .cf-board { max-width: 28rem; margin-inline: auto; }
  .arcade-cell.is-wide .sk-case-wrap { max-width: 24rem; margin-inline: auto; }
  .arcade-cell.is-wide .kt-stall { max-width: 46rem; margin-inline: auto; padding: .95rem 1.15rem; }
  .arcade-cell.is-wide .sf-stage,
  .arcade-cell.is-wide .sf-controls { max-width: 40rem; margin-inline: auto; }
  .arcade-cell.is-wide [data-mount="memory"] > .grid { max-width: 34rem; margin-inline: auto; }
  .arcade-cell.is-wide [data-mount="wordguess"] > :not(.game-bar):not(.game-who),
  .arcade-cell.is-wide [data-mount="onetoone"] > :not(.game-bar):not(.game-who),
  .arcade-cell.is-wide [data-mount="photoquiz"] > :not(.game-bar):not(.game-who),
  .arcade-cell.is-wide [data-mount="truthordare"] > :not(.game-bar):not(.game-who) { max-width: 42rem; margin-inline: auto; }
  .arcade-cell.is-wide [data-mount="minigolf"] canvas { max-width: 42rem; margin-inline: auto; }
  .arcade-cell.is-wide .sc-map-wrap { max-width: 48rem; margin-inline: auto; }
  .arcade-cell.is-wide .sh-stage { max-width: 44rem; margin-inline: auto; }
}

/* ==========================================================================
   Midnight Trail (games/scotland.js): twilight city map, transport lines,
   detective red strings, suspect pins & evidence strip.
   ========================================================================== */
.sc-map-wrap {
  position: relative; border-radius: 1rem; overflow: hidden; padding: .35rem .35rem .25rem;
  background: radial-gradient(ellipse at 50% 25%, #232B47, #14192E);
  border: 2px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 4px 18px rgba(0, 0, 0, .35);
}
.sc-map-wrap.is-spicy {
  background: radial-gradient(ellipse at 50% 25%, #3D1A33, #1D0D1D);
  border-color: rgba(226, 71, 90, .4);
}
.sc-edge { stroke-linecap: round; opacity: .7; }
.sc-edge.is-walk { stroke: rgba(255, 248, 233, .38); stroke-width: 2; stroke-dasharray: 4 4; }
.sc-edge.is-taxi { stroke: #F3A92B; stroke-width: 2.3; opacity: .65; }
.sc-edge.is-metro { stroke: #6991F2; stroke-width: 3.4; opacity: .78; }
.sc-trail { stroke: #F6C443; stroke-width: 2.5; stroke-dasharray: 6 4; opacity: .85; stroke-linecap: round; stroke-linejoin: round; }
.sc-string { stroke: #E2475A; stroke-width: 2.6; opacity: .95; stroke-linecap: round; filter: drop-shadow(0 1px 3px rgba(226, 71, 90, .7)); }
.sc-staged { stroke: #7CE0A0; stroke-width: 3.5; stroke-dasharray: 5 4; stroke-linecap: round; }
.sc-staged.is-runner { stroke: #F6C443; }
.sc-node-bg { fill: #FFFDF8; stroke: rgba(73, 59, 55, .45); stroke-width: 2; transition: transform .15s, fill .15s, stroke .15s; }
.sc-node-label { font-size: 9px; font-weight: 800; fill: rgba(255, 248, 233, .88); paint-order: stroke; stroke: rgba(16, 20, 38, .85); stroke-width: 3px; }
.sc-node.is-clickable { cursor: pointer; }
.sc-node.is-clickable:hover .sc-node-bg { fill: #FFF4D4; stroke: #F6C443; stroke-width: 3; }
.sc-node.is-reach .sc-node-bg { stroke: #7CE0A0; stroke-width: 3; filter: drop-shadow(0 0 6px rgba(124, 224, 160, .85)); }
.sc-node.is-staged .sc-node-bg { fill: #E7FAEE; stroke: #39B86B; stroke-width: 3.5; }
.sc-node.is-sighting .sc-node-bg { stroke: #E2475A; stroke-width: 3.5; filter: drop-shadow(0 0 9px rgba(226, 71, 90, .9)); }
.sc-node.is-string-origin .sc-node-bg { stroke: #E2475A; stroke-width: 3.5; fill: #FFE6EA; }
.sc-node.is-pin-no { opacity: .45; }
.sc-legend {
  display: flex; justify-content: center; gap: .9rem; padding: .2rem 0 .1rem;
  font-size: 10px; font-weight: 700; color: rgba(255, 248, 233, .72);
}
.sc-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.sc-legend i { display: inline-block; width: 1.1rem; height: 0; border-top: 2.5px solid #fff; }
.sc-legend i.is-walk { border-top-style: dashed; border-color: rgba(255, 248, 233, .65); }
.sc-legend i.is-taxi { border-color: #F3A92B; }
.sc-legend i.is-metro { border-color: #6991F2; border-top-width: 3px; }
.sc-log-chip {
  display: inline-flex; align-items: center; gap: .15rem; padding: .12rem .42rem;
  border-radius: 9999px; font-size: 10px; font-weight: 800; background: rgba(73, 59, 55, .08); color: var(--ink);
}
.sc-log-chip.is-reveal { background: rgba(226, 71, 90, .18); color: #A61E4D; box-shadow: inset 0 0 0 1px rgba(226, 71, 90, .35); }
.sc-clue-pill {
  display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem;
  border-radius: 9999px; font-size: 11px; font-weight: 700; background: rgba(246, 185, 59, .2); color: var(--ink);
}
.sc-clue-pill.is-found { background: rgba(246, 185, 59, .4); box-shadow: inset 0 0 0 1px rgba(186, 122, 34, .4); }

/* ==========================================================================
   Sleepy Sheep (games/sheep.js): calm night meadow, progressive dim-out,
   floating cloud whispers & soft breathing pill.
   ========================================================================== */
.sh-stage { position: relative; border-radius: .95rem; overflow: hidden; box-shadow: 0 8px 22px -12px rgba(13, 19, 40, .65); }
.sh-dim { position: absolute; inset: 0; background: #050814; opacity: 0; pointer-events: none; transition: opacity 2.5s ease; }
.sh-hud {
  position: absolute; top: .55rem; left: .6rem; right: .6rem; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; pointer-events: none;
}
.sh-pill {
  padding: .18rem .6rem; border-radius: 9999px; font-size: 11px; font-weight: 700;
  background: rgba(13, 19, 40, .55); color: rgba(247, 231, 180, .92); backdrop-filter: blur(4px);
}
.sh-whisper-badge {
  position: absolute; left: 50%; bottom: .5rem; transform: translateX(-50%); z-index: 3; max-width: 90%;
  padding: .2rem .75rem; border-radius: 9999px; font-size: 11px; font-weight: 600; font-style: italic;
  background: rgba(13, 19, 40, .58); color: rgba(255, 248, 233, .88); backdrop-filter: blur(4px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}

/* ==========================================================================
   Cosmos & Fortune (modules/cosmos.js): night sky moon banner, crackable
   Glückskeks fortune cookie & 3D flip cozy Tarot cards.
   ========================================================================== */
.cs-sky-card {
  position: relative; border-radius: var(--radius); padding: 1.35rem 1.4rem;
  background:
    radial-gradient(circle, rgba(246, 224, 152, .6) 0 1px, transparent 1.6px) 16px 18px / 68px 62px,
    radial-gradient(circle, rgba(255, 255, 255, .45) 0 .8px, transparent 1.4px) 46px 40px / 80px 70px,
    linear-gradient(145deg, #1A2242, #2B1F47 55%, #161C36);
  color: #FFF8EC; border: 1px solid rgba(246, 227, 174, .22);
  box-shadow: 0 14px 32px -18px rgba(22, 28, 54, .65);
}
.cs-sky-pill {
  display: inline-flex; align-items: center; gap: .25rem; padding: .18rem .6rem;
  border-radius: 9999px; font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, .12); color: #F6E3AE;
}
.cs-sign-btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .65rem;
  border-radius: 9999px; font-weight: 700; background: rgba(255, 255, 255, .14); color: #FFF8EC;
  border: 1px solid rgba(246, 227, 174, .28); transition: background-color .15s, transform .15s;
}
.cs-sign-btn:not(.is-static):hover { background: rgba(255, 255, 255, .24); transform: translateY(-1px); }
.cs-cookie-btn { display: inline-flex; flex-direction: column; align-items: center; gap: .25rem; cursor: pointer; }
.cs-cookie-svg { width: 8.5rem; height: auto; overflow: visible; }
.cs-cookie-left, .cs-cookie-right, .cs-crumbs { transition: transform .5s var(--ease-bounce), opacity .4s; transform-box: fill-box; }
.cs-cookie-left { transform-origin: 95% 55%; }
.cs-cookie-right { transform-origin: 5% 55%; }
.cs-crumbs { opacity: 0; }
.cs-cookie-btn:hover .cs-cookie-svg:not(.is-cracked) { animation: gift-feel 1.1s ease-in-out infinite; }
.cs-cookie-btn.is-cracking .cs-cookie-left, .cs-cookie-svg.is-cracked .cs-cookie-left { transform: translate(-11px, 3px) rotate(-18deg); }
.cs-cookie-btn.is-cracking .cs-cookie-right, .cs-cookie-svg.is-cracked .cs-cookie-right { transform: translate(11px, 3px) rotate(18deg); }
.cs-cookie-btn.is-cracking .cs-crumbs, .cs-cookie-svg.is-cracked .cs-crumbs { opacity: 1; }
.cs-slip {
  max-width: 26rem; width: 100%; padding: .9rem 1.2rem; border-radius: .35rem;
  background: #FFFDF8; border: 1.5px solid rgba(233, 140, 145, .55);
  box-shadow: inset 0 0 0 3px #FFFDF8, inset 0 0 0 4px rgba(233, 140, 145, .3), 0 8px 20px -12px rgba(73, 59, 55, .35);
  animation: slip-in .5s var(--ease-bounce) both;
}
.cs-tarot { position: relative; min-height: 12.5rem; perspective: 900px; cursor: pointer; text-align: center; }
.cs-tarot:disabled { cursor: default; }
.cs-tarot-inner { position: relative; display: block; width: 100%; height: 100%; min-height: 12.5rem; transform-style: preserve-3d; transition: transform .65s var(--ease-bounce); }
.cs-tarot.is-flipped .cs-tarot-inner { transform: rotateY(180deg); }
.cs-tarot:not(.is-flipped):hover .cs-tarot-inner { transform: translateY(-4px) rotateY(10deg); }
.cs-tarot-back, .cs-tarot-front {
  position: absolute; inset: 0; border-radius: 1rem; padding: .95rem .85rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.cs-tarot-back {
  background:
    radial-gradient(circle, rgba(246, 224, 152, .35) 1px, transparent 1.5px) 0 0 / 16px 16px,
    linear-gradient(155deg, #4B2354, #24193D);
  color: #F6E3AE; border: 2px solid rgba(246, 224, 152, .45);
  box-shadow: inset 0 0 0 5px rgba(246, 224, 152, .12), 0 8px 18px -10px rgba(36, 25, 61, .55);
}
.cs-tarot-front {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #FFFDF7, #FAF1E2);
  border: 2px solid rgba(246, 185, 59, .55);
  box-shadow: 0 8px 18px -10px rgba(73, 59, 55, .3);
}
