/* Copy Me — "the night toy": a round toy on a deep navy table. Four quadrant pads (orange circle,
   blue square, yellow triangle, green star: told apart by shape, not colour alone) around a dark
   hub that counts what you've copied. A lit pad brightens and glows; with reduced motion it still
   brightens, it just doesn't animate. Layout basics from cb-arcade.css. */
.cm-page, .cm-end-back {
  --ink: #f2efe6; --ink-2: #b9bbd6; --ink-3: #9a9cbd;
  --night-1: #2b2f5a; --night-2: #181a36; --night-3: #0e0f22; --rim: #10112a; --body-1: #3a3d66; --body-2: #1b1d38;
  --good: #3fc79a; --gold: #ffd23f; --violet: #6a5acd;
}
.cm-page [hidden] { display: none !important; }

.cbx-card.cm-card { --cbx-full-pad: 14px; padding: 16px 14px 20px; color: var(--ink); display: flex; flex-direction: column; gap: 14px;
  background: radial-gradient(90% 50% at 50% 42%, var(--night-1), var(--night-2) 60%, var(--night-3));
  box-shadow: 0 30px 60px -30px rgba(14, 15, 34, .8); }
.cbx-card.cm-card p { color: inherit; margin: 0; }

/* ---------- stats ---------- */
.cm-top { display: flex; gap: 10px; align-items: stretch; }
.cm-stats { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.cm-stats .k { font-size: 12px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; }
.cm-stats .v { font: 900 30px/1 'Fraunces', Georgia, serif; color: var(--ink); font-variant-numeric: tabular-nums; }
.cm-stats .mid { text-align: center; min-width: 0; }
.cm-stats .r { text-align: right; }
.cm-stats .beat { font-weight: 900; font-size: 17px; margin-top: 4px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-stats .beat.none { color: var(--ink-3); font-size: 15px; }
.cm-sound { flex: none; width: 44px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: var(--ink-2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cm-sound .off { display: none; }
.cm-sound[aria-pressed="false"] .on { display: none; }
.cm-sound[aria-pressed="false"] .off { display: inline; }

/* ---------- the toy ---------- */
.cm-toy { position: relative; align-self: center; width: min(330px, 84vw); aspect-ratio: 1; border-radius: 50%; padding: 4.2%; box-sizing: border-box;
  background: radial-gradient(circle at 40% 30%, var(--body-1), var(--body-2) 70%);
  box-shadow: 0 0 0 6px var(--rim), 0 30px 60px -20px rgba(0, 0, 0, .9), inset 0 2px 0 rgba(255, 255, 255, .12);
  user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.cm-pads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 3.6%; width: 100%; height: 100%; }
.cm-pad { --c: #888; --hi: #ccc; --lo: #444; border: 0; padding: 0; border-radius: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: .82;
  background: radial-gradient(circle at 40% 30%, var(--c), var(--lo) 85%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -6px 0 rgba(0, 0, 0, .25);
  transition: opacity .12s, box-shadow .12s, filter .12s; }
.cm-pad:nth-child(1) { border-top-left-radius: 100%; }
.cm-pad:nth-child(2) { border-top-right-radius: 100%; }
.cm-pad:nth-child(3) { border-bottom-left-radius: 100%; }
.cm-pad:nth-child(4) { border-bottom-right-radius: 100%; }
.cm-pad svg { width: 30%; height: auto; }
.cm-pad:nth-child(1) svg { margin: 14% 0 0 16%; }
.cm-pad:nth-child(2) svg { margin: 14% 16% 0 0; }
.cm-pad:nth-child(3) svg { margin: 0 0 14% 16%; }
.cm-pad:nth-child(4) svg { margin: 0 16% 14% 0; }
.cm-pad path { fill: rgba(255, 255, 255, .4); stroke: rgba(255, 255, 255, .4); stroke-width: 1.5; stroke-linejoin: round; }
.cm-pad.lit { opacity: 1; background: radial-gradient(circle at 50% 45%, #fff, var(--hi) 35%, var(--c) 80%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -6px 0 rgba(0, 0, 0, .25), 0 0 34px 8px var(--c), 0 0 0 3px #fff; }
.cm-pad.lit path { fill: rgba(255, 255, 255, .95); stroke: rgba(255, 255, 255, .95); }
.cm-pad.wrong { opacity: 1; filter: saturate(.3) brightness(.7); box-shadow: 0 0 0 3px #ff5d5d, inset 0 -6px 0 rgba(0, 0, 0, .25); }
.cm-toy.locked .cm-pad { cursor: default; }
.cm-pad:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

.cm-hub { position: absolute; left: 50%; top: 50%; width: 31.5%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 0; padding: 0;
  background: radial-gradient(circle at 40% 30%, #2a2d52, #12132a); color: var(--ink);
  box-shadow: 0 0 0 8px var(--body-2), inset 0 2px 0 rgba(255, 255, 255, .12), 0 6px 14px rgba(0, 0, 0, .6);
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: default; font-family: var(--cbx-body); }
.cm-hub .big { font: 900 clamp(24px, 8vw, 34px)/1 'Fraunces', Georgia, serif; font-variant-numeric: tabular-nums; }
.cm-hub .small { font-size: 12px; font-weight: 800; color: var(--ink-3); margin-top: 2px; }
.cm-hub.go { cursor: pointer; background: radial-gradient(circle at 40% 30%, #ffe27a, var(--gold) 55%, #c79a00); color: #241a00; box-shadow: 0 0 0 8px var(--body-2), 0 0 24px 4px rgba(255, 210, 63, .35), inset 0 2px 0 rgba(255, 255, 255, .5); }
.cm-hub.go .big { font-size: clamp(20px, 6.4vw, 28px); }
.cm-hub.go .small { color: #5a4600; }
.cm-hub.go:focus-visible { outline: 3px solid #fff; outline-offset: 10px; }

/* ---------- steps, banner, speeds ---------- */
.cm-steps { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; min-height: 14px; }
.cm-steps span { width: 14px; height: 14px; border-radius: 7px; background: rgba(255, 255, 255, .15); transition: background .15s; }
.cm-steps span.done { background: var(--good); }
.cm-steps span.next { width: 22px; background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.cm-steps.many span { width: 9px; height: 9px; }
.cm-steps.many span.next { width: 15px; }
.cm-banner { padding: 12px 14px; border-radius: 16px; text-align: center; font-weight: 800; font-size: 16px; line-height: 1.4; color: #fff8ea;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); min-height: 50px; }
.cm-banner.go { background: rgba(63, 199, 154, .14); border-color: rgba(63, 199, 154, .4); }
.cm-banner.go b { color: #7ff0c7; }
.cm-banner.watch b { color: var(--gold); }
.cm-banner.bad { background: rgba(255, 93, 93, .12); border-color: rgba(255, 93, 93, .4); }
.cm-speeds { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.cm-speeds button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: 800 14px var(--cbx-body); cursor: pointer; }
.cm-speeds button[aria-pressed="true"] { background: var(--ink); color: var(--night-2); font-weight: 900; }

/* ---------- the result sheet ---------- */
.cm-end-back { position: fixed; inset: 0; z-index: 2147482000; display: flex; align-items: flex-end; justify-content: center; padding: 12px; background: rgba(8, 9, 22, .55); animation: cm-fade .25s ease-out; }
@keyframes cm-fade { from { opacity: 0; } }
.cm-end { box-sizing: border-box; width: 100%; max-width: 440px; max-height: calc(100svh - 24px); overflow: auto; padding: 24px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 28px; background: #fffaf0; color: #1d1f24;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font-family: var(--cbx-body); box-shadow: 0 -10px 40px rgba(0, 0, 0, .45); animation: cm-up .35s cubic-bezier(.2, .9, .25, 1); }
@keyframes cm-up { from { transform: translateY(40px); opacity: 0; } }
.cm-kick { margin: 0; font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--violet); }
.cm-end h2 { margin: 0; font: 900 30px/1.1 'Fraunces', Georgia, serif; color: #1d1f24; }
.cm-end-line { margin: 0; font-size: 15px; font-weight: 700; color: #4a4d55; }
.cm-board { width: 100%; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cm-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: #f4efe3; }
.cm-row.me { background: #efeafd; box-shadow: inset 0 0 0 2px var(--violet); }
.cm-row .rk { font-weight: 900; font-size: 15px; width: 22px; text-align: left; color: #4a4d55; }
.cm-row .nm { flex: 1; min-width: 0; text-align: left; font-weight: 900; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-row .bar { height: 10px; border-radius: 5px; background: #c9c2b2; flex: none; }
.cm-row.me .bar { background: var(--violet); }
.cm-row .sc { font: 900 22px 'Fraunces', Georgia, serif; width: 34px; text-align: right; }
.cm-note { margin: 0; font-size: 13px; font-weight: 800; color: #4a4d55; }
.cm-name { display: flex; align-items: center; gap: 8px; width: 100%; font-weight: 800; font-size: 14px; color: #4a4d55; }
.cm-name input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 2px solid #d8d0bf; background: #fff; font: 800 16px var(--cbx-body); color: #1d1f24; }
.cm-end-btns { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.cm-go { min-height: 54px; border: 0; border-radius: 16px; background: #1d1f24; color: #fffaf0; font: 900 17px var(--cbx-body); cursor: pointer; }
.cm-alt { min-height: 48px; border: 0; border-radius: 16px; background: #ebe5d8; color: #1d1f24; font: 800 16px var(--cbx-body); cursor: pointer; }
.cm-end-btns a { min-height: 40px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #4a4d55; }

@media (prefers-reduced-motion: reduce) {
  .cm-pad, .cm-steps span { transition: none !important; }
  .cm-pad.lit { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -6px 0 rgba(0, 0, 0, .25), 0 0 0 4px #fff; }
  .cm-end, .cm-end-back { animation: none !important; }
}
