








:root {
  --sky: #163fa6;
  --sky-deep: #0d2670;
  --bubble: rgba(255, 255, 255, 0.07);
  --cloud: #fffaf2;
  --cloud-hi: #ffffff;
  --cloud-line: #c9d4f4;
  --ink: #14112a;
  --ink-dim: #4a4766;
  --candy: #ff4f86;
  --candy-dark: #c22a5f;
  --lemon: #ffcf3a;
  --lemon-dark: #c99a12;
  --mint: #3fd6a2;
  --mint-dark: #1c8f68;
  --lilac: #b69cff;
  --font: 'Nunito', 'Varela Round', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: var(--sky-deep); color: var(--cloud); font-family: var(--font); }

body {
  display: flex; flex-direction: column; min-height: 100dvh;
  background-color: var(--sky);
  background-image:
    radial-gradient(circle at 22% 30%, var(--bubble) 0 14px, transparent 15px),
    radial-gradient(circle at 70% 64%, var(--bubble) 0 22px, transparent 23px),
    radial-gradient(circle at 88% 18%, var(--bubble) 0 8px, transparent 9px),
    radial-gradient(circle at 40% 86%, var(--bubble) 0 10px, transparent 11px),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%);
  background-size: 220px 220px, 260px 260px, 180px 180px, 240px 240px, 100% 100%;}
[hidden] { display: none !important; }

.studio-bar { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 16px 6px; height: 54px; background: var(--ink); }
.studio-bar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--candy) 0 32px, var(--lemon) 32px 64px, var(--mint) 64px 96px, var(--lilac) 96px 128px); }
.studio-home { display: flex; align-items: center; gap: 10px; color: var(--cloud); text-decoration: none; font-weight: 800; font-size: 14px; }
.studio-home img { width: 28px; height: 28px; }

.cw { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.cw-page { width: 100%; max-width: 560px; margin: 0 auto; padding: 24px 16px 32px; display: flex; flex-direction: column; gap: 20px; }


.cw-head, .cw-card { position: relative; background: var(--cloud); color: var(--ink); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); }
.cw-head { padding: 22px 22px 20px; }
.cw-head h1 { margin: 0 64px 8px 0; font-size: clamp(34px, 10vw, 54px); font-weight: 900; line-height: 1.05; letter-spacing: 0.01em; color: var(--ink); }

.cw-head::after { content: ''; position: absolute; top: 20px; right: 20px; width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85) 0 7px, transparent 8px), var(--candy); }
.cw-head p { margin: 0; color: var(--ink-dim); font-size: 16px; line-height: 1.45; }
.cw-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.cw-card h2 { margin: 0; font-size: 19px; font-weight: 900; }
.cw-card ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.4; font-size: 15px; }
.cw-dim { margin: 0; color: var(--ink-dim); font-size: 14px; line-height: 1.4; }

.cw-go, .cw-btn, .cw-mini, .cw-chips button, .cw-fighters button { font: inherit; border-radius: 999px; cursor: pointer; }




.cw-go { background: var(--candy); color: var(--cloud-hi); border: 3px solid var(--ink); font-size: 26px; font-weight: 900; -webkit-text-stroke: 0.6px currentColor; letter-spacing: 0.03em; min-height: 72px; padding: 12px 20px; text-shadow: 0 2px 0 var(--candy-dark); box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.28), 0 5px 0 var(--ink); }
.cw-go:active { transform: translateY(4px); box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.28), 0 1px 0 var(--ink); }


#play-now { align-self: stretch; min-height: 112px; font-size: clamp(44px, 13vw, 64px); -webkit-text-stroke: 1px currentColor; letter-spacing: 0.06em; border-width: 4px; text-shadow: 0 3px 0 var(--candy-dark); box-shadow: inset 0 10px 0 rgba(255, 255, 255, 0.28), 0 7px 0 var(--ink); }
#play-now:active { transform: translateY(5px); box-shadow: inset 0 10px 0 rgba(255, 255, 255, 0.28), 0 2px 0 var(--ink); }


.cw-fold summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 20px; background: var(--lemon); color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.35), 0 4px 0 var(--ink); font-size: 17px; font-weight: 800; -webkit-text-stroke: 0.3px currentColor; cursor: pointer; list-style: none; }
.cw-fold summary::-webkit-details-marker { display: none; }
.cw-fold summary::after { content: '+'; font-size: 26px; line-height: 1; }
.cw-fold[open] summary::after { content: '\2212'; }
.cw-fold-body { display: flex; flex-direction: column; gap: 20px; padding-top: 20px; }


.cw-btn { background: transparent; color: var(--cloud-hi); border: 3px solid var(--cloud-hi); font-size: 15px; font-weight: 800; -webkit-text-stroke: 0.3px currentColor; min-height: 44px; padding: 10px 18px; }
.cw-card .cw-btn, .cw-chips button { background: var(--cloud-hi); color: var(--ink); border: 3px solid var(--ink); }


.cw-mini { background: var(--cloud-hi); color: var(--ink); border: 2px solid var(--ink); font-size: 13px; font-weight: 800; -webkit-text-stroke: 0.3px currentColor; min-height: 32px; padding: 4px 14px; box-shadow: 0 3px 0 var(--ink); }
#sound-title { align-self: center; }
.cw-go:focus-visible, .cw-btn:focus-visible, .cw-mini:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--lemon); outline-offset: 3px; }

.cw-join { display: flex; gap: 12px; }
.cw-join input { flex: 1 1 auto; min-width: 0; background: var(--cloud-hi); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: 10px 16px; font: inherit; }
.cw-join input::placeholder { color: var(--ink-dim); }
.cw-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cw-chips { display: flex; flex-wrap: wrap; gap: 12px; }
.cw-chips button { min-height: 44px; padding: 8px 18px; font-weight: 800; -webkit-text-stroke: 0.3px currentColor; }
.cw-fighters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cw-fighters button { background: var(--cloud-hi); color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; min-height: 88px; padding: 8px; font-size: 13px; font-weight: 800; -webkit-text-stroke: 0.3px currentColor; }
.cw-chips button[aria-pressed='true'], .cw-fighters button[aria-pressed='true'] { background: var(--candy); color: var(--cloud-hi); border-color: var(--ink); }

.cw-code { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: 0.08em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cw-pill { font-size: 12px; font-weight: 800; letter-spacing: 0; background: var(--lemon); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; color: var(--ink); }
.cw-status { margin: 0; color: var(--ink-dim); line-height: 1.4; }
.cw-result { align-items: center; text-align: center; padding: 32px 20px; }
.cw-result h2 { font-size: 36px; }
.cw-score { margin: 0; font-size: 28px; font-weight: 900; color: var(--candy-dark); }

.cw-goal-line { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.4; color: var(--ink); }
.cw-card .cw-prizes { list-style: none; padding: 0; margin: 0; align-items: center; gap: 8px; }
.cw-prizes li { background: var(--lemon); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 16px; font-weight: 900; font-size: 16px; }
.cw-help { margin: 0; padding: 12px 16px; border: 2px dashed var(--ink); border-radius: 16px; font-size: 15px; line-height: 1.4; color: var(--ink); }

.cw-match { flex: 1 1 auto; position: relative; display: flex; flex-direction: column; min-height: 0; touch-action: manipulation; }
.cw-match canvas { display: block; flex: 1 1 auto; min-height: 0; width: 100%; }
.cw-matchbar { position: absolute; top: 6px; right: 16px; display: flex; align-items: center; gap: 6px; }
.cw-matchbar .cw-mini { font-size: 12px; padding: 4px 10px; }




#stage { touch-action: none; }
.cw-pad { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); height: 104px; touch-action: none; user-select: none; -webkit-user-select: none; }
.cw-pad button { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--mint); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; font-family: var(--font); font-weight: 900; -webkit-text-stroke: 0.3px currentColor; touch-action: none; box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.35), 0 5px 0 var(--ink); }
.cw-pad button + button { background: var(--candy); color: var(--cloud-hi); }
.cw-pad-icon { font-size: 30px; line-height: 1; }
.cw-pad-word { font-size: 20px; letter-spacing: 0.02em; }
.cw-pad button:active { transform: translateY(4px); box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.35), 0 1px 0 var(--ink); }

.cw-toast { position: fixed; left: 16px; right: 16px; bottom: 24px; max-width: 480px; margin: 0 auto; background: var(--ink); color: var(--cloud); border: 3px solid var(--cloud-hi); border-radius: 18px; padding: 12px 16px; text-align: center; z-index: 5; }
