/* Cat Sudoku: a cosy plum-and-amber room inside the site's dark look. Everything is prefixed cs-. */
.cs { width: 100%; }
.cs-stage {
  --cs-cell: 48px; --cs-pw: 64px; --cs-ph: 64px;
  --cs-amber: #ffd166; --cs-pink: #ff6b81; --cs-aqua: #55d6ff; --cs-ink: #f3ecff; --cs-soft: #b9a9e6;
  position: relative; width: 100%; height: min(86vh, 800px); min-height: 500px;
  display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; outline: none;
  color: var(--cs-ink); font: 500 14px/1.3 system-ui, sans-serif;
  background: radial-gradient(120% 85% at 50% -5%, #33215e 0%, #1a1236 52%, #0b0819 100%);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.cs-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='%23fff'%3E%3Cellipse cx='24' cy='30' rx='8' ry='7'/%3E%3Ccircle cx='12' cy='19' r='3.6'/%3E%3Ccircle cx='20' cy='13' r='3.6'/%3E%3Ccircle cx='29' cy='13' r='3.6'/%3E%3Ccircle cx='36' cy='19' r='3.6'/%3E%3Cg transform='rotate(24 70 74)'%3E%3Cellipse cx='70' cy='78' rx='8' ry='7'/%3E%3Ccircle cx='58' cy='67' r='3.6'/%3E%3Ccircle cx='66' cy='61' r='3.6'/%3E%3Ccircle cx='75' cy='61' r='3.6'/%3E%3Ccircle cx='82' cy='67' r='3.6'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
@media (max-width: 600px) {
  .cs-stage { height: auto; aspect-ratio: 3 / 5.3; max-height: 90vh; min-height: 0; border-radius: 10px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .cs-stage { height: 94vh; min-height: 280px; aspect-ratio: auto; max-height: none; }
}
.stage.is-immersive .stage-body > .cs { min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.stage.is-immersive .cs-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; border-radius: 0; }
.stage.is-immersive .cs-help { display: none; }

.cs-stage button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.cs-stage button:focus-visible, .cs-board:focus-visible, .cs-panel a:focus-visible { outline: 3px solid var(--cs-aqua); outline-offset: 2px; }
.cs-stage [hidden] { display: none !important; }
.cs-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cs-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 14; }
.cs-cat, .cs-mini { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
/* an svg is 150px tall until told otherwise, so every centring grid that holds a cat gets one fixed track */
.cs-c, .cs-nts i, .cs-pb, .cs-demo span { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }

/* ---------- top bar ---------- */
.cs-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 6px 8px 2px; flex: 0 0 auto; }
.cs-sp { flex: 1 1 auto; }
.cs-pz {
  display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 4px; align-items: center; text-align: left;
  min-height: 40px; padding: 3px 8px 3px 12px; border-radius: 12px; border: 1px solid #5a4a9c;
  background: linear-gradient(#3d2e74, #2d2158); box-shadow: 0 2px 0 #170f33;
}
.cs-pz:hover { border-color: #8672d6; }
.cs-pz-k { grid-column: 1; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-amber); font-weight: 700; line-height: 1.1; }
.cs-pz-n { grid-column: 1; font-size: 15px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.cs-pz-dd { grid-column: 2; grid-row: 1 / 3; width: 18px; height: 18px; fill: none; stroke: var(--cs-soft); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cs-ib {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: 0 0 auto;
  min-width: 40px; height: 40px; padding: 0 9px; border-radius: 12px; border: 1px solid #4a3c85; background: rgba(48, 36, 94, .78);
}
.cs-ib:hover { background: #3c2e74; border-color: #7f6cce; }
.cs-ib svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cs-dailyb { color: #ffe3a0; border-color: #7a6130; background: rgba(74, 54, 30, .7); font-weight: 700; font-size: 13px; }
.cs-dailyb:hover { background: #5a4222; border-color: #c9a24d; }
.cs-dot { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--cs-pink); box-shadow: 0 0 0 2px #2a1d4a; }
#cs-pause .cs-i-play { display: none; fill: currentColor; stroke: none; }
#cs-pause[aria-pressed="true"] .cs-i-play { display: block; }
#cs-pause[aria-pressed="true"] .cs-i-pause { display: none; }
#cs-pause[aria-pressed="true"] { color: var(--cs-amber); border-color: var(--cs-amber); }
#cs-sound .spk { fill: currentColor; stroke-width: 1.4; }
#cs-sound .off { display: none; }
#cs-sound[aria-pressed="true"] .on { display: none; }
#cs-sound[aria-pressed="true"] .off { display: block; }
#cs-sound[aria-pressed="true"] { color: var(--cs-soft); }
.cs-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 40px; padding: 0 4px; line-height: 1.1; }
.cs-k { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-soft); font-weight: 700; }
.cs-stat b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cs-oops b { color: #ff9fae; }
.cs-oops.zero b { color: var(--cs-ink); opacity: .75; }
.cs-stage.narrow .cs-dailyb-t, .cs-stage.narrow .cs-pz-w { display: none; }
.cs-stage.narrow .cs-top { gap: 4px; padding: 5px 5px 2px; }
.cs-stage.narrow .cs-ib { min-width: 40px; padding: 0 7px; }
.cs-stage.narrow .cs-pz { padding: 3px 5px 3px 9px; }
.cs-stage.narrow .cs-stat { min-width: 34px; padding: 0 2px; }
.cs-stage.narrow .cs-stat b { font-size: 15px; }
.cs-stage.tiny .cs-oops, .cs-stage.tiny .cs-pz-dd { display: none; }
.cs-stage.tiny .cs-top { gap: 3px; padding-left: 4px; padding-right: 4px; }
.cs-stage.tiny .cs-pz { padding: 3px 7px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.cs-stage.tiny .cs-pz-k { letter-spacing: .03em; }

/* ---------- layout ---------- */
.cs-main { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: 6px; padding: 4px 6px 8px; }
.cs-stage.wide .cs-main { flex-direction: row; justify-content: center; gap: 18px; padding: 6px 14px 12px; }
.cs-boardbox { position: relative; flex: 0 0 auto; }
.cs-side { display: flex; flex-direction: column; gap: 8px; align-items: stretch; flex: 0 0 auto; width: 100%; max-width: 560px; }
.cs-stage.wide .cs-side { width: var(--cs-sw, 300px); gap: 10px; justify-content: center; align-self: stretch; }
/* short and wide (a phone on its side): the board takes the full height and the bar moves above the cats */
.cs-stage.short { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: center; column-gap: 10px; padding: 6px 8px; }
.cs-stage.short .cs-main { display: contents; }
.cs-stage.short .cs-boardbox { grid-column: 1; grid-row: 1 / 3; }
.cs-stage.short .cs-top { grid-column: 2; grid-row: 1; padding: 0; flex-wrap: wrap; row-gap: 4px; }
.cs-stage.short .cs-side { grid-column: 2; grid-row: 2; width: auto; max-width: none; gap: 6px; justify-content: center; align-self: stretch; position: relative; z-index: 1; }
.cs-stage.short .cs-say, .cs-stage.tight .cs-say { display: none; }

/* ---------- board ---------- */
.cs-board {
  position: relative; display: grid; padding: 5px; border-radius: 14px; outline: none;
  background: #120b27; box-shadow: 0 0 0 1px #4d3d8c, 0 10px 30px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.cs-c {
  position: relative; width: var(--cs-cell); height: var(--cs-cell); display: grid; place-items: center;
  border: 1px solid transparent; background-clip: padding-box; border-radius: calc(var(--cs-cell) * .17);
  background-color: #261c4a; cursor: pointer; transition: background-color .12s;
}
.cs-c.alt { background-color: #2e2052; }
.cs-c.giv { background-color: #40317a; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .1); }
.cs-c.giv.alt { background-color: #4a3580; }
.cs-c.peer { background-color: #342862; }
.cs-c.giv.peer { background-color: #51409a; }
.cs-c.same { box-shadow: inset 0 0 0 2px rgba(255, 209, 102, .75); }
.cs-c.bad { background-color: #54203f; box-shadow: inset 0 0 0 2px var(--cs-pink); }
.cs-c.sel { background-color: #5b4a2c; box-shadow: inset 0 0 0 3px var(--cs-amber), 0 0 12px rgba(255, 209, 102, .5); z-index: 2; }
.cs-c.sel.bad { background-color: #5e2440; box-shadow: inset 0 0 0 3px var(--cs-amber), 0 0 12px rgba(255, 107, 129, .6); }
.cs-board .cs-c.lit { background-color: #1f4a66; }
.cs-board .cs-c.giv.lit { background-color: #2c6183; }
.cs-c.tip { box-shadow: inset 0 0 0 3px var(--cs-aqua), 0 0 14px rgba(85, 214, 255, .7); z-index: 2; animation: cs-tip 1s ease-in-out 3; }
@media (hover: hover) { .cs-c:hover:not(.sel) { filter: brightness(1.14); } }
.cs-c > .cs-cat { width: 92%; height: 92%; }
.cs-c.giv > .cs-cat { filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.cs-dg { font-weight: 800; font-size: calc(var(--cs-cell) * .58); line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.cs-c:not(.giv) > .cs-dg { font-weight: 600; }
.cs-tag {
  position: absolute; left: 1px; top: 1px; min-width: calc(var(--cs-cell) * .3); height: calc(var(--cs-cell) * .3); padding: 0 1px;
  display: grid; place-items: center; border-radius: 35%; background: rgba(12, 8, 28, .82); color: #fff;
  font-size: calc(var(--cs-cell) * .24); font-weight: 800; line-height: 1; pointer-events: none;
}
.cs-nts { position: absolute; inset: 4%; display: grid; gap: 0; pointer-events: none; }
.cs-nts.n9 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.cs-nts.n6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); inset: 9% 2%; }
.cs-nts.n4 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); inset: 9%; }
.cs-nts i { display: grid; place-items: center; min-width: 0; min-height: 0; font-style: normal; font-weight: 800; font-size: calc(var(--cs-cell) * .25); line-height: 1; }
.cs-nts.n4 i, .cs-nts.n6 i { font-size: calc(var(--cs-cell) * .3); }
.cs-nts .cs-mini { width: 100%; height: 100%; max-width: calc(var(--cs-cell) * .4); max-height: calc(var(--cs-cell) * .4); transform: scale(1.14); }
.cs-nts i.hit { background: rgba(255, 209, 102, .3); border-radius: 30%; }

.cs-c.pop > .cs-cat, .cs-c.pop > .cs-dg { animation: cs-pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.cs-c.purr > .cs-cat, .cs-c.purr > .cs-dg { animation: cs-purr .62s ease-in-out 2; animation-delay: var(--cs-d, 0s); }
.cs-c.shake > .cs-cat, .cs-c.shake > .cs-dg { animation: cs-shake .42s ease-in-out; }
.cs-c.zz > .cs-cat { animation: cs-breathe 3.2s ease-in-out infinite; }
.cs-board.won .cs-c > .cs-cat, .cs-board.won .cs-c > .cs-dg { animation: cs-dance .52s ease-in-out infinite alternate; animation-delay: var(--cs-d, 0s); }
@keyframes cs-pop { 0% { transform: scale(.4) rotate(-12deg); opacity: .3; } 100% { transform: none; opacity: 1; } }
@keyframes cs-purr { 0%, 100% { transform: none; } 25% { transform: translateY(-9%) rotate(-7deg) scale(1.06); } 75% { transform: translateY(-9%) rotate(7deg) scale(1.06); } }
@keyframes cs-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-9%) rotate(-5deg); } 40% { transform: translateX(8%) rotate(4deg); } 60% { transform: translateX(-6%) rotate(-3deg); } 80% { transform: translateX(4%); } }
@keyframes cs-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, .95) translateY(2%); } }
@keyframes cs-dance { 0% { transform: translateY(3%) rotate(-7deg); } 100% { transform: translateY(-8%) rotate(7deg); } }
@keyframes cs-tip { 0%, 100% { filter: none; } 50% { filter: brightness(1.35); } }

.cs-curtain {
  position: absolute; inset: 0; z-index: 5; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(18, 11, 39, .96); text-align: center; cursor: pointer; padding: 12px;
}
.cs-curtain .cs-cat { width: min(46%, 170px); height: auto; aspect-ratio: 1; animation: cs-breathe 3.2s ease-in-out infinite; }
.cs-curtain b { font-size: 20px; font-weight: 800; }
.cs-curtain span { color: var(--cs-soft); font-size: 13px; }

/* ---------- side: the say bubble, the cats, the tools ---------- */
.cs-say {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 10px 5px 6px; border-radius: 14px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
}
.cs-say-cat { flex: 0 0 34px; width: 34px; height: 34px; }
.cs-say-t { margin: 0; font-size: 13px; line-height: 1.25; color: #e9defF; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cs-stage.wide .cs-say { min-height: 62px; align-items: center; }
.cs-stage.wide .cs-say-cat { flex-basis: 44px; width: 44px; height: 44px; }
.cs-stage.wide .cs-say-t { font-size: 13.5px; -webkit-line-clamp: 3; }
.cs-say.flash { animation: cs-flash .5s ease-out; }
@keyframes cs-flash { 0% { background: rgba(255, 209, 102, .28); border-color: var(--cs-amber); } 100% { background: rgba(255, 255, 255, .06); } }

.cs-pad { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-left: auto; margin-right: auto; }
.cs-pb {
  position: relative; width: var(--cs-pw); height: var(--cs-ph); padding: 0; display: grid; place-items: center; border-radius: 14px;
  border: 1px solid #5b4b9f; background: linear-gradient(#41327c, #2e2259); box-shadow: 0 3px 0 #150e30; transition: transform .08s;
}
.cs-pb:hover { border-color: #9b88ea; }
.cs-pb:active { transform: translateY(2px); box-shadow: 0 1px 0 #150e30; }
.cs-pb .cs-cat { width: auto; height: 88%; aspect-ratio: 1; max-width: 92%; }
.cs-pb .cs-dg { font-size: calc(min(var(--cs-pw), var(--cs-ph)) * .56); }
.cs-pk { position: absolute; left: 4px; top: 3px; font-size: 10px; font-weight: 800; color: #cbbdf5; line-height: 1; }
/* on a phone the key number would sit on the cat's ear, and there is no keyboard to need it */
.cs-stage.narrow:not(.cs-tags) .cs-pk { display: none; }
.cs-stage.cs-tags .cs-pk { left: 2px; top: 2px; padding: 2px 4px; border-radius: 6px; background: rgba(12, 8, 28, .82); color: #fff; font-size: 11px; z-index: 1; }
.cs-pn {
  position: absolute; right: -3px; bottom: -3px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border-radius: 9px;
  background: #170f33; border: 1px solid #6a59b3; font-size: 11px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
}
.cs-pb.held { border-color: var(--cs-amber); background: linear-gradient(#6a5330, #4b3a22); box-shadow: 0 3px 0 #150e30, 0 0 0 2px var(--cs-amber), 0 0 16px rgba(255, 209, 102, .55); transform: translateY(-2px); }
.cs-pb.done { opacity: .55; background: linear-gradient(#2a2148, #211a3b); border-color: #3d3168; box-shadow: none; }
.cs-pb.done .cs-pn { background: #1f4a37; border-color: #3fae7c; color: #b9f5d4; }

.cs-tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cs-btn {
  position: relative; min-height: 46px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 12px; border: 1px solid #4a3c85; background: rgba(48, 36, 94, .78); font-size: 11.5px; font-weight: 700;
}
.cs-btn:hover { background: #3c2e74; border-color: #7f6cce; }
.cs-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cs-btn:disabled { opacity: .4; cursor: default; }
.cs-flag {
  position: absolute; top: -5px; right: -3px; min-width: 20px; height: 17px; padding: 0 5px; display: grid; place-items: center; border-radius: 9px;
  background: #170f33; border: 1px solid #6a59b3; font-size: 10px; font-weight: 800; line-height: 1;
}
.cs-notesb[aria-pressed="true"] { border-color: var(--cs-aqua); background: #1d4660; color: #dff6ff; }
.cs-notesb[aria-pressed="true"] .cs-flag { background: var(--cs-aqua); border-color: var(--cs-aqua); color: #06212e; }
.cs-hintb .cs-flag { background: var(--cs-amber); border-color: var(--cs-amber); color: #2b1d00; }
.cs-hintb.off { color: var(--cs-soft); }
.cs-hintb.off .cs-flag { background: #170f33; border-color: #4a3c85; color: var(--cs-soft); }
.cs-stage.short .cs-btn { min-height: 42px; }

/* ---------- panels ---------- */
.cs-overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 10px; background: rgba(7, 4, 18, .74); }
.cs-panel {
  position: relative; width: min(540px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; outline: none;
  padding: 16px 16px 14px; border-radius: 18px; background: linear-gradient(#231945, #1a1236); border: 1px solid #5646a0; box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  animation: cs-in .18s ease-out;
}
@keyframes cs-in { 0% { transform: translateY(10px) scale(.98); opacity: 0; } 100% { transform: none; opacity: 1; } }
.cs-panel h2 { margin: 0 44px 10px 0; font-size: 20px; font-weight: 800; line-height: 1.2; color: #fff; }
.cs-panel h3 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-amber); font-weight: 800; }
.cs-panel p { margin: 0 0 8px; color: #d9cdf7; font-size: 14px; line-height: 1.45; }
.cs-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid #4a3c85; background: rgba(48, 36, 94, .78); display: grid; place-items: center; }
.cs-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.cs-back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: -6px 0 2px -6px; padding: 0 10px 0 6px; border: 0; background: none; color: var(--cs-soft); font-weight: 700; border-radius: 10px; }
.cs-back:hover { color: #fff; }
.cs-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cs-fine { font-size: 12.5px !important; color: var(--cs-soft) !important; text-align: center; margin: 8px 0 0 !important; }
.cs-go {
  display: block; width: 100%; min-height: 50px; margin-top: 12px; border-radius: 14px; border: 0; font-size: 17px; font-weight: 800; color: #2b1d00 !important;
  background: linear-gradient(#ffe08a, #ffbf3f); box-shadow: 0 4px 0 #a86f12;
}
.cs-go:hover { filter: brightness(1.06); }
.cs-go:active { transform: translateY(2px); box-shadow: 0 2px 0 #a86f12; }
.cs-alt { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #5b4b9f; background: rgba(60, 46, 116, .8); font-weight: 700; }
.cs-alt:hover { border-color: #9b88ea; background: #46378a; }

.cs-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cs-size {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 9px; border-radius: 14px; border: 2px solid #4a3c85; background: rgba(48, 36, 94, .6);
}
.cs-size:hover { border-color: #8672d6; }
.cs-size[aria-checked="true"] { border-color: var(--cs-amber); background: rgba(106, 83, 48, .55); }
.cs-size-pic { display: grid; gap: 1.5px; padding: 3px; width: 62px; height: 62px; border-radius: 8px; background: #120b27; margin-bottom: 4px; }
.cs-size-pic i { border-radius: 22%; background: #3a2c6c; }
.cs-size-pic i.c { background: var(--c); }
.cs-size b { font-size: 18px; font-weight: 800; line-height: 1.1; }
.cs-size span { font-size: 13px; font-weight: 700; color: var(--cs-amber); }
.cs-size small { font-size: 11.5px; color: var(--cs-soft); text-align: center; line-height: 1.2; }
.cs-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.cs-level { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 54px; padding: 5px 4px; border-radius: 12px; border: 2px solid #4a3c85; background: rgba(48, 36, 94, .6); }
.cs-level:hover { border-color: #8672d6; }
.cs-level[aria-checked="true"] { border-color: var(--cs-amber); background: rgba(106, 83, 48, .55); }
.cs-level b { font-size: 15px; font-weight: 800; }
.cs-level span { font-size: 11.5px; color: var(--cs-soft); font-variant-numeric: tabular-nums; }

.cs-menu { display: grid; gap: 8px; }
.cs-mi { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 12px; text-align: left; border-radius: 14px; border: 1px solid #4a3c85; background: rgba(48, 36, 94, .6); }
.cs-mi:hover { border-color: #8672d6; background: #382b6e; }
.cs-mi .cs-cat { flex: 0 0 40px; width: 40px; height: 40px; }
.cs-mi b { display: block; font-size: 15.5px; font-weight: 800; }
.cs-mi span { display: block; font-size: 12.5px; color: var(--cs-soft); }
.cs-mi.warn b { color: #ffb3bf; }

.cs-how { display: grid; gap: 10px; }
.cs-how-row { display: flex; gap: 10px; align-items: center; }
.cs-how-n { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--cs-amber); color: #2b1d00; font-weight: 800; }
.cs-how-row p { margin: 0; }
.cs-demo { display: flex; justify-content: center; gap: 3px; padding: 8px; margin: 2px 0 4px; border-radius: 12px; background: #120b27; }
.cs-demo span { width: 40px; height: 40px; border-radius: 8px; background: #40317a; display: grid; place-items: center; }
.cs-demo span.e { background: #261c4a; box-shadow: inset 0 0 0 2px var(--cs-amber); color: var(--cs-amber); font-weight: 800; font-size: 20px; }
.cs-demo .cs-cat { width: 92%; height: 92%; }
.cs-keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; color: #d9cdf7; margin: 0; }
.cs-keys dt { font-weight: 800; color: #fff; white-space: nowrap; }
.cs-keys dd { margin: 0; }

.cs-catlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.cs-catcard { display: grid; grid-template-columns: 62px 1fr; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: rgba(48, 36, 94, .6); border: 1px solid #4a3c85; }
.cs-catcard .cs-cat { grid-row: 1 / 4; width: 62px; height: 62px; }
.cs-catcard b { font-size: 15.5px; font-weight: 800; }
.cs-catcard b small { font-size: 11px; font-weight: 800; color: #2b1d00; background: var(--cs-amber); border-radius: 8px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }
.cs-catcard em { font-style: normal; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--cs-amber); font-weight: 700; }
.cs-catcard span { font-size: 12.5px; color: #d9cdf7; line-height: 1.3; }

.cs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.cs-tile { padding: 8px 6px; border-radius: 12px; background: rgba(48, 36, 94, .6); border: 1px solid #4a3c85; text-align: center; }
.cs-tile b { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cs-tile span { font-size: 11.5px; color: var(--cs-soft); }
.cs-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.cs-table th, .cs-table td { padding: 5px 6px; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.cs-table th:first-child, .cs-table td:first-child { text-align: left; }
.cs-table th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--cs-soft); }
.cs-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cs-badge { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 12px; background: rgba(48, 36, 94, .45); border: 1px solid #3d3168; }
.cs-badge i { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #2a2148; color: #6f5fb0; }
.cs-badge i svg { width: 18px; height: 18px; fill: currentColor; }
.cs-badge b { display: block; font-size: 12.5px; font-weight: 800; color: #b9a9e6; line-height: 1.15; }
.cs-badge span { display: block; font-size: 11px; color: #9486c4; line-height: 1.2; }
.cs-badge.got { background: rgba(106, 83, 48, .45); border-color: #b08b3a; }
.cs-badge.got i { background: var(--cs-amber); color: #5a3d00; }
.cs-badge.got b { color: #fff; }
.cs-badge.got span { color: #e7d6a8; }

.cs-sets { display: grid; gap: 6px; }
.cs-set { display: flex; align-items: center; gap: 12px; min-height: 52px; width: 100%; padding: 6px 12px; text-align: left; border-radius: 12px; border: 1px solid #4a3c85; background: rgba(48, 36, 94, .6); }
.cs-set:hover { border-color: #8672d6; }
.cs-set div { flex: 1 1 auto; min-width: 0; }
.cs-set b { display: block; font-size: 14.5px; font-weight: 800; }
.cs-set span { display: block; font-size: 12px; color: var(--cs-soft); line-height: 1.25; }
.cs-sw { flex: 0 0 46px; width: 46px; height: 26px; border-radius: 13px; background: #170f33; border: 1px solid #5b4b9f; position: relative; transition: background .15s; }
.cs-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #8f7fd0; transition: transform .15s, background .15s; }
.cs-set[aria-checked="true"] .cs-sw { background: #2f7d57; border-color: #56c890; }
.cs-set[aria-checked="true"] .cs-sw::after { transform: translateX(20px); background: #fff; }

.cs-dhead { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cs-dhead .cs-cat { flex: 0 0 54px; width: 54px; height: 54px; }
.cs-dhead p { margin: 0; }
.cs-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 0 0 12px; }
.cs-day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0; border-radius: 10px; background: rgba(48, 36, 94, .45); font-size: 11px; color: var(--cs-soft); font-weight: 700; }
.cs-day i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #1a1236; }
.cs-day i svg { width: 14px; height: 14px; fill: #3d3168; }
.cs-day.got i { background: var(--cs-amber); }
.cs-day.got i svg { fill: #5a3d00; }
.cs-day.now { box-shadow: inset 0 0 0 2px #7f6cce; color: #fff; }
.cs-dlist { display: grid; gap: 8px; }
.cs-drow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; min-height: 60px; padding: 8px 12px; text-align: left; border-radius: 14px; border: 1px solid #7a6130; background: rgba(74, 54, 30, .5); }
.cs-drow:hover { border-color: #c9a24d; background: rgba(90, 66, 34, .7); }
.cs-drow b { font-size: 16px; font-weight: 800; }
.cs-drow b small { font-size: 12px; font-weight: 700; color: var(--cs-amber); margin-left: 6px; }
.cs-drow > span { grid-column: 1; font-size: 12px; color: #e7d6a8; min-height: 15px; }
.cs-drow em { grid-column: 2; grid-row: 1 / 3; font-style: normal; font-weight: 800; padding: 6px 12px; border-radius: 10px; background: var(--cs-amber); color: #2b1d00; font-variant-numeric: tabular-nums; }
.cs-drow.done { border-color: #3fae7c; background: rgba(31, 74, 55, .45); }
.cs-drow.done em { background: #1f4a37; color: #b9f5d4; border: 1px solid #3fae7c; }

/* ---------- the party card ---------- */
.cs-card { position: absolute; inset: 0; z-index: 15; display: grid; place-items: center; padding: 10px; background: rgba(7, 4, 18, .62); }
.cs-card-in {
  width: min(430px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; text-align: center; padding: 14px 16px 16px; border-radius: 20px;
  background: linear-gradient(#2b1f55, #1c1339); border: 1px solid var(--cs-amber); box-shadow: 0 18px 50px rgba(0, 0, 0, .6), 0 0 40px rgba(255, 209, 102, .18);
  animation: cs-in .25s ease-out;
}
.cs-card-cats { display: flex; justify-content: center; align-items: flex-end; gap: 2px; height: 70px; }
.cs-card-cats .cs-cat { width: 62px; height: 62px; animation: cs-dance .5s ease-in-out infinite alternate; }
.cs-card-cats .cs-cat:nth-child(2) { width: 76px; height: 76px; animation-delay: .18s; }
.cs-card-cats .cs-cat:nth-child(3) { animation-delay: .32s; }
.cs-card h2 { margin: 6px 0 2px; font-size: 23px; font-weight: 800; color: #fff; line-height: 1.15; }
.cs-card-sub { margin: 0 0 10px; color: var(--cs-amber); font-weight: 700; font-size: 13.5px; }
.cs-card-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 6px; margin-bottom: 8px; }
.cs-card-stats div { padding: 7px 4px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.cs-card-stats b { display: block; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cs-card-stats span { font-size: 11px; color: var(--cs-soft); }
.cs-card-stats .new b { color: var(--cs-amber); }
.cs-card-line { margin: 0 0 6px; font-size: 13px; color: #e7dcff; }
.cs-card-line:empty { display: none; }
.cs-card-new { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 0 0 6px; padding: 6px 10px; border-radius: 12px; background: rgba(106, 83, 48, .5); border: 1px solid #b08b3a; font-size: 13px; }
.cs-card-new svg { width: 18px; height: 18px; fill: var(--cs-amber); flex: 0 0 18px; }
.cs-card-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.cs-card-btns .cs-go { grid-column: 1 / 3; margin-top: 0; }
.cs-card-peek { margin-top: 8px; min-height: 40px; padding: 0 12px; border: 0; background: none; color: var(--cs-soft); font-weight: 700; text-decoration: underline; border-radius: 10px; }

.cs-toast {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 25; max-width: calc(100% - 24px); padding: 9px 14px; border-radius: 12px;
  background: #0f0a22; border: 1px solid #6a59b3; color: #fff; font-size: 13.5px; font-weight: 600; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); pointer-events: none;
  animation: cs-in .15s ease-out;
}
.cs-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 12; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: #0f0a22; border: 1px solid #6a59b3; }
.cs-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #4a3c85; border-top-color: var(--cs-amber); animation: cs-spin .8s linear infinite; }
@keyframes cs-spin { to { transform: rotate(360deg); } }

.cs-help { margin-top: 10px; }
.cs-help .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .cs-help .hint-kb { display: none; } .cs-help .hint-touch { display: inline; } }

.cs-stage.calm .cs-c > .cs-cat, .cs-stage.calm .cs-c > .cs-dg, .cs-stage.calm .cs-card-cats .cs-cat, .cs-stage.calm .cs-curtain .cs-cat { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .cs-stage *, .cs-stage *::after { animation: none !important; transition: none !important; }
}
