/* PitchWorks (pitchworks.js): the hub, New course, the editor's bars, the test-run cards, Share, a friend's course and
   Enter code. The owner's PitchWorks screen art (assets/pw_ui_*.webp) with live text and CSS controls in its colours:
   navy panels, bright cyan and gold buttons, wood. Lilita One for the headings and buttons (--font-fun). */

.pw, .pw-ui, .pw-modal, .pw-res, .pw-flash {
  --pw-ink: #081631;
  --pw-navy: #0d2a5e;
  --pw-navy2: #15397a;
  --pw-edge: #2f74db;
  --pw-cyan: #1fd6f7;
  --pw-cyan-hi: #b3f8ff;
  --pw-cyan-lo: #0a7fb0;
  --pw-gold: #ffd35a;
  --pw-gold-hi: #fff2bd;
  --pw-gold-lo: #b37710;
  --pw-text: #eef7ff;
  --pw-dim: #a8c2e6;
  --pw-red: #ff5d5d;
  --pw-green: #63e27d;
  color: var(--pw-text);
}
.pw svg, .pw-ui svg, .pw-modal svg, .pw-res svg { width: 1.2em; height: 1.2em; flex: 0 0 auto; }
/* (the game's green button look off: every PitchWorks button styles itself; :where keeps this below their own rules) */
:where(.pw, .pw-ui, .pw-modal, .pw-res) button, :where(.pw, .pw-ui, .pw-modal, .pw-res) button:active { box-shadow: none; }

/* ---------- a full PitchWorks screen: the workshop plate behind, the page scrolling over it ---------- */
#overlay:has(> .menu.pw) { top: calc(-1 * var(--safe-t)); bottom: calc(-1 * var(--safe-b)); align-items: stretch; justify-content: stretch; }
.menu.pw {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(6, 14, 36, 0.3) 0%, rgba(6, 14, 36, 0.55) 30%, rgba(6, 14, 36, 0.84) 62%, rgba(6, 14, 36, 0.92)), var(--pw-bg-workshop, none) center top / cover no-repeat, #0b1f45;
}
.pw-bgart { display: none; }
.pw-page {
  position: relative; width: 100%; max-width: 480px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
  padding: calc(var(--safe-t) + 10px) 16px calc(var(--safe-b) + 20px);
}
.pw-page > * { flex-shrink: 0; }
.pw-head { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.pw-head h1 { flex: 1; margin: 0; text-align: center; font: 400 26px/1.05 var(--font-fun); letter-spacing: 0.01em; text-transform: uppercase; color: #fff; text-shadow: 0 3px 0 #06224f, 0 0 14px rgba(0, 0, 0, 0.5); }
.pw-head-sp { width: 46px; flex: 0 0 46px; }
.pw-hub-head { justify-content: space-between; min-height: 0; align-items: flex-start; }
.pw-sign { width: min(62vw, 260px); margin-top: -4px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); animation: pwSway 5s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes pwSway { 0%, 100% { rotate: -1.2deg; } 50% { rotate: 1.2deg; } }

/* round icon button (back, undo, redo) */
.pw-round {
  width: 46px; height: 46px; min-height: 0; flex: 0 0 46px; padding: 0; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  color: #06294f; background: radial-gradient(circle at 50% 30%, #7af0ff, var(--pw-cyan) 55%, #0aa6d4); border: 3px solid var(--pw-cyan-hi);
  box-shadow: 0 4px 0 var(--pw-cyan-lo), 0 6px 12px rgba(0, 0, 0, 0.45); transition: transform 0.08s, box-shadow 0.08s, filter 0.1s;
}
.pw-round svg { width: 26px; height: 26px; stroke-width: 1; }
.pw-round svg g { stroke-width: 6; }
.pw-round:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pw-cyan-lo), 0 3px 6px rgba(0, 0, 0, 0.4); }
.pw-round:disabled { filter: grayscale(0.9) brightness(0.6); box-shadow: 0 2px 0 #213457; cursor: default; }
.pw-round.sm { width: 40px; height: 40px; flex-basis: 40px; }
.pw-round.sm svg { width: 22px; height: 22px; }

/* the chunky buttons */
.pw-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: 14px; cursor: pointer;
  font: 400 17px/1 var(--font-fun); letter-spacing: 0.02em; color: var(--pw-text); white-space: nowrap;
  background: linear-gradient(180deg, #1d4d9e, #12306b); border: 2.5px solid #4f8fe8; box-shadow: 0 4px 0 #0a1d45, 0 6px 12px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); transition: transform 0.08s, box-shadow 0.08s, filter 0.1s;
}
.pw-btn svg { width: 20px; height: 20px; }
.pw-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a1d45, 0 3px 6px rgba(0, 0, 0, 0.3); }
.pw-btn:disabled { filter: grayscale(0.85) brightness(0.7); cursor: default; transform: none; }
.pw-btn.cyan { color: #05264b; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); background: linear-gradient(180deg, #7cf2ff, var(--pw-cyan) 48%, #0bb2e2); border-color: var(--pw-cyan-hi); box-shadow: 0 4px 0 var(--pw-cyan-lo), 0 6px 14px rgba(0, 0, 0, 0.35); }
.pw-btn.gold { color: #3b2204; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45); background: linear-gradient(180deg, #fff0a8, var(--pw-gold) 45%, #f2a81c); border-color: var(--pw-gold-hi); box-shadow: 0 4px 0 var(--pw-gold-lo), 0 6px 14px rgba(0, 0, 0, 0.35); }
.pw-btn.ghost { background: rgba(8, 22, 52, 0.72); border-color: rgba(120, 170, 240, 0.55); box-shadow: 0 3px 0 rgba(4, 12, 32, 0.9); }
.pw-btn.big { min-height: 54px; font-size: 20px; border-radius: 16px; padding: 0 18px; }
.pw-btn.big svg { width: 24px; height: 24px; }
.pw-btn.sm { min-height: 34px; padding: 0 11px; font-size: 14.5px; border-radius: 11px; border-width: 2px; box-shadow: 0 3px 0 #0a1d45; }
.pw-btn.sm svg { width: 16px; height: 16px; }
.pw-btn.sm.cyan { box-shadow: 0 3px 0 var(--pw-cyan-lo); }
.pw-btn.sm.gold { box-shadow: 0 3px 0 var(--pw-gold-lo); }
.pw-row { display: flex; gap: 10px; }
.pw-row > .pw-btn { flex: 1 1 0; min-width: 0; }
.pw .is-pressed, .pw-ui .is-pressed, .pw-modal .is-pressed, .pw-res .is-pressed { scale: 0.94; filter: brightness(1.15); transition: scale 0.07s ease-out, filter 0.07s ease-out; }

/* ---------- the hub ---------- */
.pw-hero { position: relative; display: flex; align-items: flex-end; gap: 4px; margin-top: -6px; }
.pw-coach { width: 44%; max-width: 200px; flex: 0 0 auto; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); }
.pw-bubble {
  position: relative; flex: 1; margin-bottom: 18px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.95); color: #10244a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; gap: 4px; font: 500 13.5px/1.3 var(--font-ui);
}
.pw-bubble::before { content: ""; position: absolute; left: -9px; bottom: 22px; border: 10px solid transparent; border-left: 0; border-right-color: rgba(255, 255, 255, 0.95); }
.pw-bubble b { font: 400 18px/1.05 var(--font-fun); color: #0d3a8a; }
.pw-tabs3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 5px; border-radius: 16px; background: rgba(6, 18, 44, 0.85); border: 2px solid rgba(80, 140, 230, 0.45); }
.pw-tabs3 button {
  box-shadow: none; min-height: 40px; padding: 0 6px; border-radius: 12px; border: 0; background: transparent; color: var(--pw-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px; font: 400 15.5px/1 var(--font-fun); letter-spacing: 0.01em; white-space: nowrap;
}
.pw-tabs3 button i { font-style: normal; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; font: 400 12px/1 var(--font-fun); background: rgba(255, 255, 255, 0.14); color: #fff; }
.pw-tabs3 button.on { color: #3b2204; background: linear-gradient(180deg, #fff0a8, var(--pw-gold) 50%, #f3b12a); box-shadow: 0 3px 0 var(--pw-gold-lo); }
.pw-tabs3 button.on i { background: rgba(59, 34, 4, 0.18); color: #3b2204; }
.pw-tabs3 button.lock { opacity: 0.6; }
.pw-tabs3 button.lock svg { width: 15px; height: 15px; }
.pw-list { display: flex; flex-direction: column; gap: 12px; }
.pw-cc {
  position: relative; display: flex; gap: 12px; padding: 10px; border-radius: 18px; flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(24, 62, 132, 0.95), rgba(12, 36, 86, 0.95)); border: 2.5px solid #3f82e6; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25), 0 6px 16px rgba(0, 0, 0, 0.45);
}
.pw-thumb { flex: 0 0 96px; height: 160px; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: #0a2150; border: 2px solid rgba(150, 200, 255, 0.4); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); }
.pw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pw-thumb img:not(.drawn) { object-fit: contain; padding: 6px; }
.pw-ci { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-right: 26px; }
.pw-ci h3 { margin: 2px 0 0; font: 400 20px/1.05 var(--font-fun); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.pw-ci p { margin: 0; font: 600 13px/1.25 var(--font-ui); color: var(--pw-dim); }
.pw-state { display: flex; align-items: center; gap: 5px; }
.pw-state.ok { color: var(--pw-green) !important; }
.pw-state svg { width: 15px; height: 15px; }
.pw-cb { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.pw-stamp { position: absolute; right: 8px; top: 34px; width: 64px; rotate: 10deg; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.pw-del { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; min-height: 0; padding: 0; display: grid; place-items: center; border-radius: 10px; cursor: pointer; color: #ffb3b3; background: rgba(0, 0, 0, 0.28); border: 1.5px solid rgba(255, 120, 120, 0.35); }
.pw-del svg { width: 18px; height: 18px; }
.pw-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 18px 20px; border-radius: 18px; background: rgba(8, 24, 60, 0.82); border: 2px dashed rgba(120, 175, 245, 0.5); }
.pw-empty-art { width: 150px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); }
.pw-empty h3 { margin: 4px 0 0; font: 400 22px/1 var(--font-fun); color: #fff; }
.pw-empty p { margin: 0; font: 500 14px/1.35 var(--font-ui); color: var(--pw-dim); }
.pw-empty p b { color: #fff; }
.pw-foot { position: sticky; bottom: calc(var(--safe-b) + 8px); z-index: 2; margin-top: auto; display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px; padding: 10px; border-radius: 20px; background: rgba(6, 16, 40, 0.9); border: 2px solid rgba(80, 140, 230, 0.4); box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35); }
.pw-foot .pw-btn { padding: 0 10px; }
.pw-foot2 { margin-top: auto; display: flex; gap: 10px; padding-top: 6px; }
.pw-foot2 > .pw-btn { flex: 1; }

/* ---------- New course ---------- */
.pw-newart { display: grid; place-items: center; margin: -6px 0 -10px; }
.pw-blue { width: 150px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); rotate: -4deg; }
.pw-lab { margin: 4px 0 -6px; font: 400 15px/1 var(--font-fun); letter-spacing: 0.06em; text-transform: uppercase; color: var(--pw-gold); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
.pw-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pw-theme {
  box-shadow: none; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 10px; border-radius: 18px; cursor: pointer; color: #fff;
  background: rgba(10, 30, 72, 0.88); border: 3px solid rgba(90, 150, 235, 0.5); font: 400 18px/1 var(--font-fun);
}
.pw-theme.on { border-color: var(--pw-gold); box-shadow: 0 0 0 3px rgba(255, 211, 90, 0.3), 0 0 22px rgba(255, 211, 90, 0.35); }
.pw-theme.on::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 400 16px/1 var(--font-fun); color: #3b2204; background: var(--pw-gold); box-shadow: 0 2px 0 var(--pw-gold-lo); }
.pw-theme.lock { color: var(--pw-dim); }
.pw-theme small { display: flex; align-items: center; gap: 4px; font: 600 12px/1 var(--font-ui); color: var(--pw-dim); }
.pw-theme small svg { width: 13px; height: 13px; }
.pw-th-art { width: 100%; max-width: 150px; aspect-ratio: 1; object-fit: contain; }
/* the four themes: a tile of their ground with a bit of scenery on it, tinted the way the board is */
.pw-theme .pw-th-art { position: relative; display: block; width: 100%; height: 64px; border-radius: 12px; overflow: hidden; background: #2f7d2c; border: 2px solid #e4d6b4; }
.pw-theme .pw-th-art > img:first-child { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pw-theme .pw-th-art::after { content: ""; position: absolute; inset: 0; mix-blend-mode: multiply; }
.pw-theme.th-night .pw-th-art::after { background: rgb(112, 130, 200); }
.pw-theme.th-beach .pw-th-art::after { background: rgb(255, 236, 200); }
.pw-theme.th-snow .pw-th-art::before { content: ""; position: absolute; inset: 0; background: rgba(238, 246, 255, 0.82); }
.pw-theme .pw-th-deco { position: absolute; left: 50%; bottom: 2px; height: 54px; width: auto; translate: -50% 0; z-index: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.pw-theme.th-night .pw-th-deco { filter: drop-shadow(0 0 12px rgba(255, 225, 120, 0.95)); }
.pw-theme small { justify-content: center; text-align: center; }
/* the challenge picker in Course details */
.pw-chal button { flex: 1 1 40%; }
/* a course's flags on its card */
.pw-flags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 !important; }
.pw-flags i { font: 400 11px/1 var(--font-fun); font-style: normal; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 7px; border-radius: 8px; color: #0a1c3a; background: #c9d6e6; }
.pw-flags i.one { background: linear-gradient(180deg, #fff0a8, var(--pw-gold)); }
.pw-flags i.dark { background: linear-gradient(180deg, #8d9cff, #4a55c8); color: #fff; }
.pw-flags i.th-night { background: #2b3a78; color: #dbe4ff; }
.pw-flags i.th-beach { background: #f2d99a; }
.pw-flags i.th-snow { background: #eef6ff; }
/* coins on the result card */
.pw-rcoins { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(255, 211, 90, 0.14); border: 1.5px solid rgba(255, 211, 90, 0.5); font: 600 13px/1.2 var(--font-ui); color: var(--pw-dim); }
.pw-rcoins b { font: 400 18px/1 var(--font-fun); color: var(--pw-gold); }
.pw-rcoins svg { width: 20px; height: 20px; color: var(--pw-gold); }
.pw-input {
  -webkit-user-select: text; user-select: text; width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px; font: 400 20px/1 var(--font-fun); color: #fff; letter-spacing: 0.01em;
  background: #0a2152; border: 3px solid #3f82e6; box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.45); outline: none;
}
.pw-input:focus { border-color: var(--pw-cyan); box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(31, 214, 247, 0.3); }
.pw-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pw-step { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.pw-step .pw-lab { margin: 4px 0 0; }
.pw-step small { font: 500 12px/1.2 var(--font-ui); color: var(--pw-dim); text-align: center; margin-top: -4px; }
.pw-stepper {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 6px; padding: 6px; border-radius: 16px;
  background: linear-gradient(180deg, #b8743a, #8b5122); border: 2px solid #5e3413; box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.5), 0 4px 0 #4a280c;
}
.pw-stepper.gold { box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.5), 0 4px 0 #4a280c, 0 0 0 2px rgba(255, 211, 90, 0.45); }
.pw-stepper button { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: #fff; background: linear-gradient(180deg, #5aa8ff, #1b6fe0); border: 2px solid #a9d3ff; box-shadow: 0 3px 0 #0c3f8f; }
.pw-stepper button svg { width: 22px; height: 22px; }
.pw-stepper button:active { transform: translateY(2px); box-shadow: 0 1px 0 #0c3f8f; }
.pw-stepper b { height: 44px; display: grid; place-items: center; border-radius: 10px; font: 400 26px/1 var(--font-fun); color: #fff; background: #0a1c44; border: 2px solid var(--pw-gold); }

/* ---------- the editor: its bar above the pitch, its dock below ---------- */
#pwTop, #pwDock { display: none; }
body.pw-edit:not(.menu) #pwTop, body.pw-edit:not(.menu) #pwDock { display: flex; }
body.pw-edit #hud, body.pw-edit #squadbar, body.pw-edit #controls { display: none !important; }
body.pw-edit:not(.menu) #app { background: linear-gradient(rgba(10, 6, 2, 0.25), rgba(10, 6, 2, 0.25)), var(--pw-bg-editor, none) center / cover no-repeat, #3a2412; }
body.pw-edit:not(.menu) #c { border-radius: 10px; box-shadow: 0 0 0 3px rgba(40, 20, 6, 0.6), 0 10px 26px rgba(0, 0, 0, 0.6); }
.pw-topbar { flex: 0 0 auto; align-items: center; gap: 7px; padding: 8px 10px 6px; background: linear-gradient(180deg, rgba(8, 20, 48, 0.96), rgba(10, 26, 60, 0.9)); border-bottom: 2px solid rgba(60, 120, 220, 0.5); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); z-index: 6; }
.pw-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.pw-tname { min-height: 0; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; gap: 5px; color: #fff; text-align: left; min-width: 0; }
.pw-tname b { font: 400 19px/1.05 var(--font-fun); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.pw-tname svg { width: 15px; height: 15px; color: var(--pw-dim); }
.pw-tchk { min-height: 0; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.pw-chip { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px 0 6px; border-radius: 11px; font: 400 12.5px/1 var(--font-fun); letter-spacing: 0.02em; white-space: nowrap; }
.pw-chip svg { width: 13px; height: 13px; }
.pw-chip.bad { color: #fff; background: #d63a3a; box-shadow: 0 0 10px rgba(255, 80, 80, 0.5); animation: pwPulse 1.6s ease-in-out infinite; }
.pw-chip.ok { color: #073a16; background: var(--pw-green); }
.pw-chip.go { color: #05264b; background: var(--pw-cyan); }
.pw-chip.warn { color: #3b2204; background: var(--pw-gold); }
.pw-par { font: 600 12px/1 var(--font-ui); color: var(--pw-dim); white-space: nowrap; }
@keyframes pwPulse { 50% { box-shadow: 0 0 2px rgba(255, 80, 80, 0.2); } }
.pw-test {
  flex: 0 0 auto; min-height: 44px; height: 44px; padding: 0 13px 0 10px; border-radius: 14px; display: flex; align-items: center; gap: 5px; cursor: pointer;
  font: 400 19px/1 var(--font-fun); color: #3b2204; background: linear-gradient(180deg, #fff0a8, var(--pw-gold) 45%, #f2a81c); border: 2.5px solid var(--pw-gold-hi); box-shadow: 0 4px 0 var(--pw-gold-lo), 0 0 16px rgba(255, 211, 90, 0.35);
}
.pw-test svg { width: 20px; height: 20px; }
.pw-test:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pw-gold-lo); }
.pw-test.off { filter: grayscale(0.7) brightness(0.8); box-shadow: 0 4px 0 #5b4a2a; }

.pw-dock { flex: 0 0 auto; flex-direction: column; gap: 6px; padding: 7px 0 calc(6px); background: linear-gradient(180deg, rgba(10, 26, 60, 0.94), rgba(6, 16, 40, 0.98)); border-top: 2px solid rgba(60, 120, 220, 0.5); box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.4); z-index: 6; }
.pw-bar { height: 66px; padding: 0 10px; display: flex; align-items: center; overflow: hidden; }   /* (a fixed height: the pitch never jumps as you pick) */
.pw-bar.sel { display: grid; grid-template-columns: 1fr auto; grid-template-rows: 16px 48px; column-gap: 6px; row-gap: 2px; align-items: center; }
.pw-hint { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pw-hint b { font: 400 16px/1 var(--font-fun); color: var(--pw-gold); letter-spacing: 0.02em; }
.pw-hint span { font: 500 12.5px/1.25 var(--font-ui); color: var(--pw-dim); }
.pw-selname { grid-column: 1 / 3; min-width: 0; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
.pw-selname b { font: 400 15px/1 var(--font-fun); color: var(--pw-cyan); overflow: hidden; text-overflow: ellipsis; }
.pw-selname small { font: 500 11.5px/1 var(--font-ui); color: var(--pw-dim); overflow: hidden; text-overflow: ellipsis; }
.pw-sbs { touch-action: pan-x; min-width: 0; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.pw-sbs::-webkit-scrollbar { display: none; }
.pw-sb {
  flex: 1 1 0; min-width: 40px; max-width: 58px; height: 48px; min-height: 0; padding: 3px 0 0; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  color: #fff; background: linear-gradient(180deg, #2360c0, #173f86); border: 2px solid #5b9af0; box-shadow: 0 3px 0 #0a2150;
}
.pw-sb svg { width: 22px; height: 22px; }
.pw-sb span { font: 400 10.5px/1 var(--font-fun); letter-spacing: 0.01em; white-space: nowrap; }
.pw-sb:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a2150; }
.pw-sb[data-sel="del"] { background: linear-gradient(180deg, #e2544f, #a8261f); border-color: #ff9d97; box-shadow: 0 3px 0 #5e0f0a; }
.pw-sbx { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--pw-dim); background: rgba(255, 255, 255, 0.08); border: 1.5px solid rgba(255, 255, 255, 0.2); }
.pw-sbx svg { width: 18px; height: 18px; }
.pw-items { touch-action: pan-x; display: flex; gap: 7px; padding: 2px 10px 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.pw-items::-webkit-scrollbar { display: none; }
.pw-item {
  position: relative; flex: 0 0 70px; height: 84px; min-height: 0; padding: 5px 3px 4px; border-radius: 14px; scroll-snap-align: start; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2px;
  background: linear-gradient(180deg, #16407f, #0e2a5c); border: 2.5px solid #3a78d6; box-shadow: 0 3px 0 #071a3d; color: #fff;
}
.pw-item span { width: 100%; font: 400 10.5px/1.05 var(--font-fun); text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pw-item .pw-ith { width: 54px; height: 50px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.pw-item.tall .pw-ith { height: 52px; }
.pw-item.on { background: linear-gradient(180deg, #fff0a8, var(--pw-gold) 50%, #f0a818); border-color: var(--pw-gold-hi); box-shadow: 0 3px 0 var(--pw-gold-lo), 0 0 14px rgba(255, 211, 90, 0.55); color: #3b2204; }
.pw-item.dis { opacity: 0.45; }
.pw-item em { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--pw-green); color: #073a16; }
.pw-item em svg { width: 12px; height: 12px; }
.pw-item:active { transform: translateY(2px); box-shadow: 0 1px 0 #071a3d; }
.pw-tile { width: 50px; height: 50px; border-radius: 9px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.4); }
.pw-tile.rot { transform: rotate(90deg); }
.pw-tile.eras { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #2e6b2a 0 6px, #347a2f 6px 12px); color: #fff; }
.pw-tile.eras svg { width: 30px; height: 30px; }
.pw-sep { flex: 0 0 64px; height: 84px; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding-left: 8px; border-left: 2px dashed rgba(255, 211, 90, 0.55); font: 500 10.5px/1.2 var(--font-ui); font-style: normal; color: var(--pw-dim); }
.pw-sep b { font: 400 14px/1 var(--font-fun); color: var(--pw-gold); }
.pw-cats { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; padding: 0 6px; }
.pw-cats button {
  min-width: 0; height: 50px; min-height: 0; padding: 4px 0 3px; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--pw-dim); background: rgba(255, 255, 255, 0.05); border: 1.5px solid rgba(90, 150, 235, 0.3);
}
.pw-cats button svg { width: 24px; height: 24px; }
.pw-cats button span { font: 400 clamp(7.5px, 2.2vw, 10px)/1 var(--font-fun); letter-spacing: -0.01em; white-space: nowrap; }
.pw-cats button.on { color: #3b2204; background: linear-gradient(180deg, #fff0a8, var(--pw-gold) 50%, #f0a818); border-color: var(--pw-gold-hi); box-shadow: 0 3px 0 var(--pw-gold-lo); }

/* ---------- the test-run banner, the result card over the pitch ---------- */
.pw-flash { position: absolute; left: 50%; top: 14%; z-index: 8; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; animation: pwFlash 2.8s ease-out both; }
.pw-fl-art { width: min(64vw, 260px); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.55)); }
.pw-flash span { padding: 6px 14px; border-radius: 999px; font: 400 16px/1 var(--font-fun); color: #fff; background: rgba(6, 18, 44, 0.88); border: 2px solid var(--pw-cyan); }
@keyframes pwFlash { 0% { opacity: 0; scale: 0.6; } 12% { opacity: 1; scale: 1.06; } 20% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; translate: -50% -14px; } }
.pw-res {
  width: min(92%, 380px); max-height: 94%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 18px 16px; border-radius: 24px; text-align: center;
  background: linear-gradient(180deg, rgba(22, 60, 130, 0.98), rgba(10, 30, 74, 0.98)); border: 3px solid #4d8ff0; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.6);
  animation: pwPop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.pw-res.win { border-color: var(--pw-gold); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 211, 90, 0.35), 0 16px 40px rgba(0, 0, 0, 0.6); }
@keyframes pwPop { from { opacity: 0; scale: 0.8; } }
.pw-rbanner { width: 92%; margin-top: -4px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.pw-rbadge { width: 118px; margin-top: -4px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); animation: pwPop 0.5s 0.1s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.pw-rcoach { width: 120px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.pw-rtitle { margin: 0; font: 400 30px/1 var(--font-fun); color: #fff; text-transform: uppercase; text-shadow: 0 3px 0 #06224f; }
.pw-stars { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: 2px 0; }
.pw-star { width: 58px; }
.pw-star:nth-child(2) { width: 72px; }
.pw-star.on { animation: pwPop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.pw-star.on:nth-child(2) { animation-delay: 0.15s; }
.pw-star.on:nth-child(3) { animation-delay: 0.3s; }
.pw-rline { margin: 0; font: 400 19px/1.2 var(--font-fun); color: #fff; }
.pw-rline b { color: var(--pw-gold); font-weight: 400; }
.pw-rsub { margin: 0; font: 500 14px/1.35 var(--font-ui); color: var(--pw-dim); }
.pw-rbtns { width: 100%; display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }

/* ---------- Share ---------- */
.pw-pub { display: grid; place-items: center; margin: -8px 0 -6px; }
.pw-pubart { width: min(60vw, 230px); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)); animation: pwPop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.pw-sharecard { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 18px; background: linear-gradient(180deg, rgba(24, 62, 132, 0.95), rgba(12, 36, 86, 0.95)); border: 2.5px solid #3f82e6; }
.pw-prev { position: relative; flex: 0 0 120px; }
.pw-prev img[data-pic] { width: 100%; aspect-ratio: 400 / 656; object-fit: cover; display: block; border-radius: 12px; border: 3px solid rgba(255, 255, 255, 0.85); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45); background: #0a2150; }
.pw-prev img[data-pic]:not(.drawn) { object-fit: contain; }
.pw-cby { position: absolute; right: -22px; bottom: -14px; width: 78px; rotate: 12deg; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.pw-si { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pw-si h2 { margin: 0; font: 400 24px/1.05 var(--font-fun); color: #fff; overflow-wrap: anywhere; }
.pw-si p { margin: 0; font: 600 13.5px/1.2 var(--font-ui); color: var(--pw-dim); }
.pw-code {
  width: 100%; min-height: 96px; resize: none; padding: 12px 14px; border-radius: 14px; font: 600 14px/1.45 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; word-break: break-all; color: #d8f6ff; letter-spacing: 0.02em;
  background: #071a42; border: 3px solid var(--pw-cyan); box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.5), 0 0 16px rgba(31, 214, 247, 0.2); outline: none; user-select: all; -webkit-user-select: all;
}
.pw-code.in { user-select: text; -webkit-user-select: text; touch-action: pan-y; border-color: #3f82e6; box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.5); }
.pw-code.in:focus { border-color: var(--pw-cyan); }
.pw-code.in.good { border-color: var(--pw-green); box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.5), 0 0 14px rgba(99, 226, 125, 0.35); }
.pw-code.in.err { border-color: var(--pw-red); box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 93, 93, 0.35); }
.pw-chal { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 244, 214, 0.95); color: #3a2a12; }
.pw-env { width: 76px; flex: 0 0 auto; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.3)); }
.pw-chal div { display: flex; flex-direction: column; gap: 3px; font: 500 13px/1.3 var(--font-ui); }
.pw-chal b { font: 400 18px/1 var(--font-fun); color: #7a3f0a; }

/* ---------- a friend's course ---------- */
.pw-introcard { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border-radius: 22px; text-align: center; background: linear-gradient(180deg, rgba(24, 62, 132, 0.95), rgba(12, 36, 86, 0.95)); border: 3px solid #4d8ff0; }
.pw-prev.big { flex: none; width: min(56vw, 210px); }
.pw-introcard h2 { margin: 6px 0 0; font: 400 28px/1.05 var(--font-fun); color: #fff; overflow-wrap: anywhere; }
.pw-by { margin: 0; display: flex; align-items: center; gap: 6px; font: 600 14px/1 var(--font-ui); color: var(--pw-dim); }
.pw-by svg { width: 18px; height: 18px; }
.pw-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.pw-facts span { min-width: 70px; padding: 8px 10px 7px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 3px; font: 600 11.5px/1 var(--font-ui); color: var(--pw-dim); background: rgba(4, 14, 38, 0.6); border: 2px solid rgba(90, 150, 235, 0.4); }
.pw-facts b { font: 400 24px/1 var(--font-fun); color: #fff; }
.pw-facts .gold { border-color: var(--pw-gold); }
.pw-facts .gold b { color: var(--pw-gold); }
.pw-facts .ok b { color: var(--pw-green); }

/* ---------- PitchWorks' own dialogs (Enter code, course details, the checks) ---------- */
.pw-modal { position: fixed; inset: 0; z-index: 8000; display: grid; place-items: center; padding: 18px; background: rgba(3, 8, 22, 0.66); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: faIn 0.16s ease-out both; }
.pw-mcard {
  width: min(100%, 380px); max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 16px; border-radius: 24px;
  background: linear-gradient(180deg, #17438d, #0c2a62); border: 3px solid #4d8ff0; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3), 0 18px 44px rgba(0, 0, 0, 0.6);
  animation: pwPop 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.pw-mart { width: 86px; align-self: center; margin-top: -2px; filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.45)); }
.pw-mplaque { display: none; }
.pw-mtitle { margin: 0; text-align: center; font: 400 26px/1.05 var(--font-fun); color: #fff; text-shadow: 0 3px 0 #06224f; }
.pw-mtext { margin: -4px 0 0; text-align: center; font: 500 14px/1.35 var(--font-ui); color: var(--pw-dim); }
.pw-cstate { display: none; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; font: 500 13px/1.3 var(--font-ui); }
.pw-cstate.ok, .pw-cstate.err { display: flex; }
.pw-cstate.ok { background: rgba(99, 226, 125, 0.14); border: 2px solid rgba(99, 226, 125, 0.6); }
.pw-cstate.err { background: rgba(255, 93, 93, 0.14); border: 2px solid rgba(255, 93, 93, 0.6); }
.pw-cstate div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pw-cstate b { font: 400 16px/1.1 var(--font-fun); color: #fff; overflow-wrap: anywhere; }
.pw-cstate span { color: var(--pw-dim); }
.pw-csart { width: 44px; flex: 0 0 44px; }
.pw-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pw-checks li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(4, 14, 38, 0.55); border: 2px solid rgba(255, 93, 93, 0.55); }
.pw-checks li.warn { border-color: rgba(255, 211, 90, 0.55); }
.pw-checks li > svg { width: 22px; height: 22px; margin-top: 1px; color: var(--pw-red); }
.pw-checks li.warn > svg { color: var(--pw-gold); }
.pw-checks div { display: flex; flex-direction: column; gap: 3px; }
.pw-checks b { font: 400 16px/1.1 var(--font-fun); color: #fff; }
.pw-checks span { font: 500 12.5px/1.25 var(--font-ui); color: var(--pw-dim); }

/* ---------- 30 Sep 2026: machines drive every moving thing; opponents' movement; tall courses ---------- */
/* each character in the palette says how it moves */
.pw-mv { position: absolute; left: 3px; top: 3px; padding: 2px 5px; border-radius: 6px; font: 800 9px/1 var(--font-display); font-style: normal; letter-spacing: 0.04em; text-transform: uppercase; color: #3b2204; background: var(--pw-gold); box-shadow: 0 1px 0 var(--pw-gold-lo); }
.pw-mv.still { color: #0a2447; background: #c9d6e6; box-shadow: 0 1px 0 #6f8298; }
.pw-item.on .pw-mv { background: #fff; }
.pw-sb.hi { background: linear-gradient(180deg, #fff0a8, var(--pw-gold) 50%, #f0a818); border-color: var(--pw-gold-hi); box-shadow: 0 3px 0 var(--pw-gold-lo); color: #3b2204; }
/* the settings panel (in the dock: the pitch stays in view and moves as you change things) */
.pw-dock.set { gap: 0; padding: 0 0 6px; }
.pw-sethead { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px; border-bottom: 1px solid rgba(90, 150, 235, 0.3); }
.pw-sethead b { font: 400 17px/1.05 var(--font-fun); color: var(--pw-cyan); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-sethead small { flex: 1; font: 600 11px/1 var(--font-ui); color: var(--pw-dim); white-space: nowrap; }
.pw-setbody { flex: 0 1 auto; max-height: 36vh; overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px 2px; display: flex; flex-direction: column; gap: 7px; touch-action: pan-y; }
.pw-set { display: flex; flex-direction: column; gap: 4px; }
.pw-setl { display: flex; align-items: baseline; gap: 8px; font: 400 13px/1 var(--font-fun); letter-spacing: 0.04em; text-transform: uppercase; color: var(--pw-gold); }
.pw-setl em { font: 600 12px/1 var(--font-ui); font-style: normal; letter-spacing: 0; text-transform: none; color: #fff; }
.pw-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.pw-seg button { flex: 1 1 auto; min-width: 0; min-height: 34px; padding: 0 9px; border-radius: 10px; cursor: pointer; font: 400 13.5px/1 var(--font-fun); color: #d6e7fb; background: #102f63; border: 2px solid #2f65b8; box-shadow: none; white-space: nowrap; }
.pw-seg button.on { color: #05264b; background: linear-gradient(180deg, #7cf2ff, var(--pw-cyan) 55%, #0bb2e2); border-color: var(--pw-cyan-hi); box-shadow: 0 2px 0 var(--pw-cyan-lo); }
.pw-dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.pw-dots button { min-height: 30px; padding: 0; border-radius: 9px; cursor: pointer; display: grid; place-items: center; background: #102f63; border: 2px solid #2f65b8; box-shadow: none; }
.pw-dots button i { width: 60%; height: 8px; border-radius: 4px; background: rgba(160, 200, 240, 0.35); }
.pw-dots button.on { border-color: var(--pw-gold-hi); background: #2a2a10; }
.pw-dots button.on i { background: linear-gradient(90deg, #ffe07a, var(--pw-gold)); box-shadow: 0 0 6px rgba(255, 211, 90, 0.7); }
.pw-partrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pw-partimg { width: 42px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.pw-partrow b { font: 400 14px/1 var(--font-fun); color: #fff; margin-right: auto; }
.pw-none { font: 600 13px/1 var(--font-ui); color: var(--pw-dim); margin-right: auto; }
.pw-setnote { margin: 0; font: 500 12.5px/1.3 var(--font-ui); color: var(--pw-dim); }
/* a piece's or a wire's power (pitchworks.js powerBlock, wirePanel): gold always on, its switch's colour, red none */
.pw-pwr .pw-none, .pw-setbody > .pw-partrow .pw-none { line-height: 1.25; color: #e8f0ff; min-width: 0; }
.pw-gold { color: #ffd23a; font-style: normal; font-weight: 800; }
.pw-pdot { display: inline-block; vertical-align: -3px; width: 14px; height: 14px; margin-right: 7px; border-radius: 50%; border: 2px solid rgba(6, 14, 34, 0.9); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.25); }
.pw-pdot.on { background: #ffd23a; }
.pw-pdot.sw { background: var(--c, #33e0e0); }
.pw-pdot.none { background: #6b7280; box-shadow: 0 0 0 1.5px #ff8a8a; }
/* a tall course: the screen arrows beside the pitch (editor), the whole-course view (playing) */
.pw-nav { position: absolute; right: 6px; top: 50%; z-index: 7; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border-radius: 16px; background: rgba(6, 18, 44, 0.85); border: 2px solid rgba(80, 140, 230, 0.55); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45); }
.pw-nav button { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 12px; display: grid; place-items: center; cursor: pointer; color: #05264b; background: linear-gradient(180deg, #7cf2ff, var(--pw-cyan) 55%, #0bb2e2); border: 2px solid var(--pw-cyan-hi); box-shadow: 0 3px 0 var(--pw-cyan-lo); }
.pw-nav button svg { width: 24px; height: 24px; }
.pw-nav b { font: 400 16px/1 var(--font-fun); color: #fff; }
.pw-nav small { font: 600 9px/1 var(--font-ui); color: var(--pw-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.pw-view { position: absolute; right: 8px; top: 8px; z-index: 7; min-height: 36px; padding: 0 12px 0 9px; display: flex; align-items: center; gap: 6px; border-radius: 12px; cursor: pointer; font: 400 14px/1 var(--font-fun); color: #fff; background: rgba(6, 18, 44, 0.85); border: 2px solid rgba(80, 140, 230, 0.7); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45); }
.pw-view svg { width: 20px; height: 20px; }
.pw-view.on { color: #05264b; background: linear-gradient(180deg, #7cf2ff, var(--pw-cyan) 55%, #0bb2e2); border-color: var(--pw-cyan-hi); }
/* New course: its size */
.pw-sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.pw-size { box-shadow: none; min-height: 0; padding: 10px 6px 8px; border-radius: 16px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; background: rgba(10, 30, 72, 0.88); border: 3px solid rgba(90, 150, 235, 0.5); font: 400 15px/1 var(--font-fun); }
.pw-size.on { border-color: var(--pw-gold); box-shadow: 0 0 0 3px rgba(255, 211, 90, 0.3), 0 0 18px rgba(255, 211, 90, 0.35); }
.pw-sizepic { display: flex; flex-direction: column-reverse; gap: 2px; }
.pw-sizepic b { width: 26px; height: 18px; border-radius: 4px; background: linear-gradient(180deg, #6cc04a, #3f8f3a); border: 2px solid #e4d6b4; }
.pw-step.wide { margin-top: 4px; }
.pw-step.wide small { text-align: left; }

/* ---------- Kit 2 (30 Sep 2026): the power system's controls, ten tabs, the kerb picker ---------- */
.pw-cats { grid-template-columns: repeat(10, 1fr); gap: 2px; padding: 0 4px; }
.pw-cats button svg { width: 22px; height: 22px; }
.pw-cats button span { font-size: clamp(7px, 2vw, 9.5px); }
/* the tools in the palette: rub out, stream, dry up, wire */
.pw-item.tool .pw-tile { display: grid; place-items: center; color: #fff; }
.pw-item.tool .pw-tile svg { width: 30px; height: 30px; }
.pw-tile.wet { background: linear-gradient(180deg, #4db8ff, #1a6fd6); }
.pw-tile.dry { background: repeating-linear-gradient(45deg, #2a5f8f 0 6px, #1d4a73 6px 12px); color: #ffb3b3 !important; }
.pw-tile.dry::after { content: ""; position: absolute; width: 44px; height: 4px; border-radius: 2px; background: #ff5d5d; rotate: -45deg; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.35); }
.pw-item.tool { overflow: hidden; }
.pw-tile.wire { background: linear-gradient(180deg, #ffe27a, #f0a818); color: #3b2204 !important; }
.pw-tile.sel { background: linear-gradient(180deg, #7cf2ff, #0bb2e2); color: #05264b !important; }
.pw-tile.sel.on { background: linear-gradient(180deg, #ffe27a, #f0a818); color: #3b2204 !important; }
/* the Enter code card sits at the top of the screen on a phone: the keyboard covers the bottom half */
@media (pointer: coarse) {
  .pw-modal:has(.pw-codem) { place-items: start center; padding-top: calc(var(--safe-t, 0px) + 18px); }
  .pw-codem .pw-mart { width: 56px; }
}
/* the wires' colours: a row of swatches (Auto first, in the colour the game would pick) */
.pw-wcs { display: flex; align-items: center; gap: 6px; padding: 3px 3px; }
.pw-wc { box-shadow: none; flex: 1 1 0; min-width: 0; max-width: 34px; aspect-ratio: 1; height: auto; min-height: 0; padding: 0; border-radius: 50%; cursor: pointer; background: var(--c); border: 2.5px solid rgba(6, 14, 34, 0.9); outline: 2px solid rgba(255, 255, 255, 0.22); font: 400 11.5px/1 var(--font-fun); letter-spacing: 0.03em; color: #0a1c3a; }
.pw-wc:first-child { flex: 0 0 auto; max-width: none; aspect-ratio: auto; height: 32px; padding: 0 12px; border-radius: 16px; }
.pw-wc.on { outline: 3px solid #fff; box-shadow: 0 0 10px var(--c); }
/* the Power tab's tool: the wires showing while playing, or not */
.pw-tile.won { background: linear-gradient(180deg, #7cf2ff, #0bb2e2); color: #05264b !important; }
.pw-tile.woff { background: linear-gradient(180deg, #46536e, #2a3450); color: #c9d6e6 !important; }
.pw-tile.woff::after { content: ""; position: absolute; width: 44px; height: 4px; border-radius: 2px; background: #ff5d5d; rotate: -45deg; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.35); }
.pw-tile.allon { background: linear-gradient(180deg, #7dff9e, #1fa84a); color: #073a16 !important; }
/* what powers a machine: its own block in the settings */
.pw-pwr { display: flex; flex-direction: column; gap: 7px; margin: 2px -4px 0; padding: 8px 6px 8px; border-radius: 12px; background: rgba(255, 211, 90, 0.08); border: 1.5px dashed rgba(255, 211, 90, 0.5); }
.pw-pwr .pw-setl::before { content: ""; }
.pw-setl em { margin-left: auto; text-align: right; }
.pw-seg button { white-space: normal; line-height: 1.05; }
/* Course details: the kerb, the wires showing */
.pw-kerbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pw-kerb { box-shadow: none; min-height: 0; padding: 8px 4px 6px; border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; color: #fff; background: rgba(10, 30, 72, 0.88); border: 2.5px solid rgba(90, 150, 235, 0.5); font: 400 13.5px/1 var(--font-fun); }
.pw-kerb.on { border-color: var(--pw-gold); box-shadow: 0 0 0 3px rgba(255, 211, 90, 0.3); }
.pw-kerbimg { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.pw-toggle { box-shadow: none; min-height: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; cursor: pointer; text-align: left; color: #fff; background: rgba(10, 30, 72, 0.88); border: 2.5px solid rgba(90, 150, 235, 0.5); }
.pw-toggle i { position: relative; flex: 0 0 50px; height: 28px; border-radius: 14px; background: #24365c; border: 2px solid #4a6aa8; transition: background 0.15s; }
.pw-toggle i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #c9d6e6; transition: translate 0.15s, background 0.15s; }
.pw-toggle.on i { background: #1b7a3a; border-color: var(--pw-green); }
.pw-toggle.on i::after { translate: 22px 0; background: #fff; }
.pw-toggle span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pw-toggle b { font: 400 16px/1.05 var(--font-fun); }
.pw-toggle small { font: 500 12px/1.25 var(--font-ui); color: var(--pw-dim); }

@media (prefers-reduced-motion: reduce) {
  .pw-sign, .pw-chip.bad { animation: none; }
}

/* ---------- the guide (How it works): a full sheet over the hub or the editor, one topic open at a time ---------- */
.pw-modal.pw-helpm { display: block; padding: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(180deg, rgba(6, 14, 36, 0.3) 0%, rgba(6, 14, 36, 0.55) 30%, rgba(6, 14, 36, 0.84) 62%, rgba(6, 14, 36, 0.92)), var(--pw-bg-workshop, none) center top / cover no-repeat, #0b1f45; }
.pw-hpage { min-height: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; padding: calc(var(--safe-t) + 10px) 16px calc(var(--safe-b) + 24px); }
.pw-hlist { display: flex; flex-direction: column; gap: 10px; }
.pw-hc { border-radius: 18px; background: linear-gradient(180deg, rgba(24, 62, 132, 0.95), rgba(12, 36, 86, 0.95)); border: 2.5px solid #3f82e6; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25), 0 6px 16px rgba(0, 0, 0, 0.45); overflow: hidden; }
.pw-hc.open { border-color: var(--pw-gold); }
.pw-hch { width: 100%; min-height: 0; padding: 10px 12px; display: flex; align-items: center; gap: 12px; text-align: left; background: transparent; border: 0; box-shadow: none; color: #fff; cursor: pointer; }
.pw-hpic { flex: 0 0 56px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #74c454, #3f8f3a); border: 2px solid #e4d6b4; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2); }
.pw-hpic img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4)); }
.pw-hpic svg { width: 32px; height: 32px; color: #fff; }
.pw-hct { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pw-hct b { font: 400 20px/1.05 var(--font-fun); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.pw-hct small { font: 600 13px/1.25 var(--font-ui); color: var(--pw-dim); }
.pw-hch > svg { flex: 0 0 auto; width: 22px; height: 22px; rotate: 180deg; opacity: 0.8; transition: rotate 0.2s; }
.pw-hc.open .pw-hch > svg { rotate: 0deg; }
.pw-hcb { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease; }
.pw-hc.open .pw-hcb { grid-template-rows: 1fr; }
.pw-hcb > div { overflow: hidden; }
.pw-hcx { padding: 2px 12px 14px; display: flex; flex-direction: column; gap: 9px; font: 500 14px/1.4 var(--font-ui); color: var(--pw-text); }
.pw-hcx p { margin: 0; }
.pw-hcx b { color: var(--pw-gold); font-weight: 700; }
.pw-hl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pw-hl li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: rgba(6, 18, 44, 0.55); }
.pw-hl li > img { flex: 0 0 36px; width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4)); }
.pw-hl li > svg { flex: 0 0 26px; width: 26px; height: 26px; margin: 0 5px; color: var(--pw-cyan); }
.pw-hl li span { min-width: 0; }
.pw-hsteps { margin: 0; padding: 0; list-style: none; counter-reset: hs; display: flex; flex-direction: column; gap: 8px; }
.pw-hsteps li { position: relative; padding-left: 34px; counter-increment: hs; }
.pw-hsteps li::before { content: counter(hs); position: absolute; left: 0; top: 0; width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; font: 400 14px/1 var(--font-fun); color: #3b2204; background: linear-gradient(180deg, #fff0a8, var(--pw-gold) 50%, #f3b12a); box-shadow: 0 2px 0 var(--pw-gold-lo); }
.pw-hcols { display: flex; gap: 6px; margin-top: 6px; }
.pw-hcols i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(6, 14, 34, 0.85); outline: 1.5px solid rgba(255, 255, 255, 0.25); }
.pw-helpm .pw-row { margin-top: 6px; }
/* the editor's Run / Stop button on the board, and the coach's test on the checks card */
.pw-live { position: absolute; left: 8px; bottom: 8px; z-index: 7; min-height: 40px; padding: 0 14px 0 10px; display: flex; align-items: center; gap: 6px; border-radius: 13px; cursor: pointer; font: 400 15px/1 var(--font-fun); color: #073a16; background: linear-gradient(180deg, #7dff9e, #1fa84a); border: 2.5px solid #c9ffd6; box-shadow: 0 3px 0 #0f6b2d, 0 4px 10px rgba(0, 0, 0, 0.45); }
.pw-live svg { width: 20px; height: 20px; }
.pw-live.on { color: #fff; background: linear-gradient(180deg, #ff8a8a, #d23b3b); border-color: #ffd0d0; box-shadow: 0 3px 0 #7e1d1d, 0 4px 10px rgba(0, 0, 0, 0.45); animation: pwLivePulse 1.2s ease-in-out infinite; }
@keyframes pwLivePulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
.pw-live:active { transform: translateY(2px); box-shadow: 0 1px 0 #0f6b2d; }
.pw-coachtest { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(6, 18, 44, 0.6); border: 2px solid rgba(99, 226, 125, 0.5); }
.pw-coachtest.warn { border-color: rgba(255, 211, 90, 0.55); }
.pw-ctcoach { width: 46px; flex: 0 0 46px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45)); }
.pw-coachtest div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pw-coachtest b { font: 400 16px/1 var(--font-fun); color: var(--pw-gold); }
.pw-coachtest span { font: 500 13px/1.3 var(--font-ui); color: var(--pw-text); }
/* the ? on the editor's tab hint */
.pw-bar:not(.sel) { position: relative; padding-right: 50px; }
.pw-hq { position: absolute; right: 10px; top: 50%; translate: 0 -50%; width: 36px; height: 36px; min-height: 0; padding: 0; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: #06294f; background: radial-gradient(circle at 50% 30%, #7af0ff, var(--pw-cyan) 55%, #0aa6d4); border: 2.5px solid var(--pw-cyan-hi); box-shadow: 0 3px 0 var(--pw-cyan-lo), 0 4px 8px rgba(0, 0, 0, 0.4); }
.pw-hq svg { width: 22px; height: 22px; }
.pw-hq svg g { stroke-width: 5; }
.pw-hq:active { translate: 0 calc(-50% + 2px); box-shadow: 0 1px 0 var(--pw-cyan-lo); }

/* ---------- PitchWorks online (2 Oct 2026): the Featured library, the 6-letter code, likes, your courses' numbers ---------- */
/* the library's three lists under the hub's tabs */
.pw-libtabs { display: grid; grid-template-columns: repeat(3, auto); gap: 6px; margin-top: -4px; }   /* (sized to their words: all three fit a phone) */
.pw-libtabs button {
  box-shadow: none; min-width: 0; min-height: 44px; padding: 0 6px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer;
  font: 400 14.5px/1 var(--font-fun); letter-spacing: 0.01em; color: #d6e7fb; background: rgba(10, 30, 72, 0.88); border: 2px solid #2f65b8; white-space: nowrap;
}
.pw-libtabs button span { overflow: hidden; text-overflow: ellipsis; }
.pw-libtabs button svg { width: 18px; height: 18px; }
@media (max-width: 370px) { .pw-libtabs button svg { display: none; } }
.pw-libtabs button.on { color: #05264b; background: linear-gradient(180deg, #7cf2ff, var(--pw-cyan) 55%, #0bb2e2); border-color: var(--pw-cyan-hi); box-shadow: 0 3px 0 var(--pw-cyan-lo); }
.pw-libnote { margin: 0; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; font: 600 13px/1.3 var(--font-ui); color: var(--pw-gold-hi); background: rgba(255, 211, 90, 0.12); border: 1.5px dashed rgba(255, 211, 90, 0.55); }
.pw-libnote svg { width: 22px; height: 22px; flex: 0 0 auto; }
/* a course's chips: the coach's pick, yours, its code */
.pw-flags i { display: inline-flex; align-items: center; gap: 3px; }
.pw-flags i svg { width: 13px; height: 13px; }
.pw-flags i.pick { color: #3b2204; background: linear-gradient(180deg, #fff0a8, var(--pw-gold)); box-shadow: 0 0 8px rgba(255, 211, 90, 0.45); }
.pw-flags i.mine { color: #073a16; background: var(--pw-green); }
.pw-flags i.code { color: #05264b; background: var(--pw-cyan); letter-spacing: 0.1em; }
/* plays and the clear rate on a card (and bigger on a course's screen and Share) */
.pw-ost { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 !important; font: 600 12.5px/1 var(--font-ui) !important; color: var(--pw-dim); }
.pw-ost > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pw-ost i { font-style: normal; }
.pw-ost b { font: 400 15px/1 var(--font-fun); color: #fff; }
.pw-ost svg { width: 15px; height: 15px; color: var(--pw-cyan); }
.pw-ost.big { justify-content: center; gap: 6px 16px; margin-top: 2px !important; font-size: 13.5px !important; }
.pw-ost.big b { font-size: 18px; }
.pw-ost.big svg { width: 18px; height: 18px; }
.pw-ostwait, .pw-gone { display: inline-flex; align-items: center; gap: 7px; color: var(--pw-dim); }
.pw-gone svg { color: var(--pw-dim) !important; }
/* the like: the pack's heart buttons (pw_ui_like, pw_ui_like_on), the count beside or under */
.pw-lk1 { display: none; }
.on > .pw-lk1 { display: block; }
.on > .pw-lk0 { display: none; }
.pw-likeb {
  position: relative; min-height: 34px; padding: 0 11px 0 3px; border-radius: 11px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  font: 400 15px/1 var(--font-fun); color: #fff; background: rgba(4, 14, 38, 0.6); border: 2px solid rgba(90, 150, 235, 0.55); box-shadow: 0 3px 0 #0a1d45;
}
.pw-likeb::after { content: ""; position: absolute; inset: -6px -3px; }   /* (a finger-sized target round a small button) */
.pw-likeb img { width: 28px; height: 28px; }
.pw-likeb.on { border-color: #ff8a98; background: rgba(150, 18, 40, 0.5); }
.pw-likeb.mine { cursor: default; box-shadow: none; border-style: dashed; background: rgba(4, 14, 38, 0.35); }
.pw-likeb:active:not(.mine) { transform: translateY(2px); box-shadow: 0 1px 0 #0a1d45; }
.pop > img { animation: pwHeart 0.42s cubic-bezier(0.2, 1.8, 0.4, 1) both; }
@keyframes pwHeart { 0% { scale: 0.55; } 60% { scale: 1.22; } 100% { scale: 1; } }
.pw-introcard { position: relative; }
.pw-likebig { position: absolute; right: 4px; top: 6px; z-index: 1; width: 62px; min-height: 0; padding: 2px 0; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; background: none; border: 0; color: #fff; font: 400 18px/1 var(--font-fun); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
.pw-likebig img { width: 54px; height: 54px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); }
.pw-likebig:active img { translate: 0 2px; }
.pw-likerow { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 16px; cursor: pointer; text-align: left; color: #fff; background: rgba(4, 14, 38, 0.55); border: 2px solid rgba(90, 150, 235, 0.55); }
.pw-likerow img { width: 48px; height: 48px; flex: 0 0 48px; }
.pw-likerow span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pw-likerow b { font: 400 18px/1.05 var(--font-fun); }
.pw-likerow .y, .pw-likerow.on .n { display: none; }
.pw-likerow.on .y { display: block; }
.pw-likerow small { font: 500 12.5px/1.2 var(--font-ui); color: var(--pw-dim); }
.pw-likerow small b { font: 400 14px/1 var(--font-fun); color: #fff; }
.pw-likerow.on { border-color: #ff8a98; background: rgba(150, 18, 40, 0.4); box-shadow: 0 0 16px rgba(255, 90, 110, 0.3); }
.pw-report { align-self: center; min-height: 44px; margin-top: -6px; padding: 0 16px; display: inline-flex; align-items: center; gap: 7px; border-radius: 12px; cursor: pointer; font: 600 13.5px/1 var(--font-ui); color: #ffb3b3; background: none; border: 0; }
.pw-report svg { width: 17px; height: 17px; }
.pw-report.done { color: var(--pw-dim); cursor: default; }
/* loading: cards that shimmer where the courses will be, a spinning ring */
.pw-skel { pointer-events: none; }
.pw-skel .pw-thumb, .pw-skel .pw-ci i { display: block; background: linear-gradient(90deg, rgba(110, 160, 235, 0.14) 20%, rgba(170, 210, 255, 0.32) 50%, rgba(110, 160, 235, 0.14) 80%) 0 0 / 300% 100%; animation: pwShim 1.3s linear infinite; }
.pw-skel .pw-ci i { height: 14px; border-radius: 7px; margin-top: 6px; }
.pw-skel .pw-ci i:first-child { width: 72%; height: 20px; }
.pw-skel .pw-ci i:nth-child(2) { width: 52%; }
.pw-skel .pw-ci i:nth-child(3) { width: 38%; }
.pw-skel .pw-ci i.btn { width: 84px; height: 34px; border-radius: 11px; margin-top: auto; }
@keyframes pwShim { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.pw-spin { display: inline-block; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 4px solid rgba(31, 214, 247, 0.22); border-top-color: var(--pw-cyan); animation: pwSpin 0.8s linear infinite; }
.pw-spin.sm { width: 16px; height: 16px; border-width: 3px; }
@keyframes pwSpin { to { rotate: 360deg; } }
.pw-more { width: 100%; }
.pw-lerr .pw-empty-art.sm, .pw-empty-art.sm { width: 84px; }
.pw-lerr { border-color: rgba(255, 93, 93, 0.55); }
.pw-lerr .pw-btn { margin-top: 6px; }
/* Enter code: six letters show big and spaced out; looking one up */
.pw-code.in.short { min-height: 0; height: 74px; padding: 14px 10px 10px; text-align: center; text-transform: uppercase; font: 400 34px/1.3 var(--font-fun); letter-spacing: 0.22em; color: #fff; }
.pw-code.in.short::placeholder { font: 400 20px/1.9 var(--font-fun); letter-spacing: 0.04em; text-transform: none; color: rgba(168, 194, 230, 0.55); }
.pw-cstate.wait { display: flex; background: rgba(31, 214, 247, 0.1); border: 2px solid rgba(31, 214, 247, 0.55); }
/* Share: the code, letter by letter */
.pw-onbox { display: flex; flex-direction: column; gap: 14px; }
.pw-onbox:empty { display: none; }
.pw-oncode {
  display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 14px 12px 14px; border-radius: 20px; text-align: center;
  background: linear-gradient(180deg, rgba(24, 62, 132, 0.96), rgba(12, 36, 86, 0.96)); border: 3px solid var(--pw-gold); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25), 0 0 24px rgba(255, 211, 90, 0.25), 0 8px 18px rgba(0, 0, 0, 0.4);
}
.pw-oncode.wait { border-color: rgba(31, 214, 247, 0.7); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25), 0 8px 18px rgba(0, 0, 0, 0.4); }
.pw-oncode .pw-lab { margin: 0; }
.pw-oncode > p { margin: 0; font: 500 13.5px/1.3 var(--font-ui); color: var(--pw-dim); }
.pw-oncode > p b { color: #fff; }
.pw-oncode .pw-ost { justify-content: center; }
.pw-tiles { display: flex; align-items: center; gap: clamp(3px, 1.2vw, 6px); }
.pw-tiles i { width: clamp(4px, 2vw, 10px); }
.pw-tiles b {
  width: clamp(34px, 11.5vw, 46px); aspect-ratio: 4 / 5; display: grid; place-items: center; border-radius: 12px; font: 400 clamp(26px, 9vw, 36px)/1 var(--font-fun); color: #3b2204; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, #fff6c9, var(--pw-gold) 55%, #f2a81c); border: 2.5px solid var(--pw-gold-hi); box-shadow: 0 4px 0 var(--pw-gold-lo), 0 6px 10px rgba(0, 0, 0, 0.35);
  animation: pwTile 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; animation-delay: calc(var(--i) * 70ms);
}
@keyframes pwTile { from { opacity: 0; scale: 0.4; translate: 0 10px; } }
.pw-tiles.wait b { animation: pwShim 1.3s linear infinite; border-color: rgba(120, 175, 245, 0.5); box-shadow: 0 4px 0 #0a1d45; background: linear-gradient(90deg, rgba(110, 160, 235, 0.16) 20%, rgba(170, 210, 255, 0.36) 50%, rgba(110, 160, 235, 0.16) 80%) 0 0 / 300% 100%; }
.pw-onhide { display: flex; align-items: center; gap: 6px; color: var(--pw-gold) !important; }
.pw-onhide svg { width: 18px; height: 18px; flex: 0 0 auto; }
.pw-oncode.err { flex-direction: row; flex-wrap: wrap; justify-content: center; text-align: left; border-color: rgba(255, 93, 93, 0.75); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25), 0 8px 18px rgba(0, 0, 0, 0.4); }
.pw-onwarn { width: 56px; flex: 0 0 56px; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45)); }
.pw-onerr { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pw-onerr b { font: 400 19px/1.05 var(--font-fun); color: #fff; }
.pw-onerr span { font: 500 13px/1.3 var(--font-ui); color: var(--pw-dim); }
.pw-retry { flex: 1 0 100%; min-height: 46px; }
.pw-onnote { margin: -4px 0 0; text-align: center; font: 500 13px/1.3 var(--font-ui); color: var(--pw-dim); }
/* Share: the long code, folded away (it opens by itself when the course can't go online) */
.pw-long { border-radius: 16px; background: rgba(6, 18, 44, 0.78); border: 2px solid rgba(90, 150, 235, 0.45); overflow: hidden; }
.pw-long.open { border-color: var(--pw-cyan); }
.pw-longh { width: 100%; min-height: 54px; padding: 8px 14px 8px 12px; display: flex; align-items: center; gap: 10px; text-align: left; background: transparent; border: 0; box-shadow: none; color: #fff; cursor: pointer; }
.pw-longh > svg:first-child { width: 24px; height: 24px; color: var(--pw-cyan); }
.pw-longh span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pw-longh b { font: 400 17px/1.05 var(--font-fun); }
.pw-longh small { font: 500 12.5px/1.25 var(--font-ui); color: var(--pw-dim); }
.pw-longh > svg:last-child { width: 20px; height: 20px; rotate: 180deg; opacity: 0.8; transition: rotate 0.2s; }
.pw-long.open .pw-longh > svg:last-child { rotate: 0deg; }
.pw-longb { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease; }
.pw-long.open .pw-longb { grid-template-rows: 1fr; }
.pw-longb > div { overflow: hidden; }
.pw-longi { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; }
/* My courses: a course that's online has a strip along the bottom of its card */
.pw-cc { flex-wrap: wrap; }
.pw-onl { flex: 1 0 100%; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 5px 5px 5px 10px; margin-top: -2px; border-radius: 14px; background: rgba(4, 14, 38, 0.62); border: 1.5px solid rgba(31, 214, 247, 0.5); }
.pw-onc { display: flex; flex-direction: column; gap: 3px; margin-right: auto; min-width: 0; }
.pw-onc small { display: flex; align-items: center; gap: 4px; font: 400 10.5px/1 var(--font-fun); letter-spacing: 0.06em; text-transform: uppercase; color: var(--pw-cyan); white-space: nowrap; }
.pw-onc small svg { width: 12px; height: 12px; }
.pw-onc b { font: 400 20px/1 var(--font-fun); letter-spacing: 0.12em; color: var(--pw-gold); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.pw-on1 { min-width: 44px; display: flex; flex-direction: column; align-items: center; gap: 3px; font: 600 10.5px/1 var(--font-ui); color: var(--pw-dim); }
.pw-on1 b { font: 400 18px/1 var(--font-fun); color: #fff; }
.pw-ondown { flex: 1; font: 600 12px/1.25 var(--font-ui); color: var(--pw-gold); }
.pw-onl.down { border-color: rgba(255, 211, 90, 0.6); }
.pw-onl.down .pw-onc small { color: var(--pw-gold); }
.pw-off { flex: 0 0 44px; width: 44px; height: 44px; min-height: 0; margin-left: 2px; padding: 0; display: grid; place-items: center; border-radius: 12px; cursor: pointer; color: #cfe3ff; background: rgba(255, 255, 255, 0.07); border: 1.5px solid rgba(150, 190, 245, 0.4); }
.pw-off svg { width: 24px; height: 24px; }
.pw-off:active { transform: translateY(2px); }
@media (prefers-reduced-motion: reduce) {
  .pw-skel .pw-thumb, .pw-skel .pw-ci i, .pw-tiles.wait b, .pw-spin { animation-duration: 3s; }
  .pw-tiles b, .pop > img { animation: none; }
}

/* ---------- PitchWorks online, part 2 (2 Oct 2026): following creators, reports with a reason, the admin's review ---------- */
/* the library's four lists: two rows of two */
.pw-libtabs { grid-template-columns: 1fr 1fr; }
/* a creator's name: a link to their card once we know they've a username */
.pw-auth {
  position: relative; display: inline-flex; align-items: center; gap: 3px; min-height: 0; max-width: 100%; padding: 2px 7px 2px 4px; margin: -2px 0; vertical-align: middle; border-radius: 9px; cursor: pointer;
  font: 600 13px/1.1 var(--font-ui); color: var(--pw-cyan-hi); background: rgba(31, 214, 247, 0.14); border: 1.5px solid rgba(31, 214, 247, 0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pw-auth::after { content: ""; position: absolute; inset: -9px -4px; }   /* (finger-sized) */
.pw-auth svg { width: 14px; height: 14px; flex: 0 0 auto; }
.pw-by .pw-auth { font-size: 14px; }
/* a player's crest, or their initial on a badge */
.pw-crest { display: inline-grid; place-items: center; flex: 0 0 auto; font-style: normal; }
.pw-crest svg { width: 100%; height: 100%; }
.pw-ini { --s: 30px; flex: 0 0 var(--s); width: var(--s); height: var(--s); display: inline-grid; place-items: center; border-radius: 50%; font: 400 calc(var(--s) * 0.5)/1 var(--font-fun); font-style: normal; color: #3b2204; background: linear-gradient(180deg, #fff0a8, var(--pw-gold) 55%, #f2a81c); border: 2px solid var(--pw-gold-hi); box-shadow: 0 2px 0 var(--pw-gold-lo); }
/* Following: the creators along the top */
.pw-who { touch-action: pan-x; display: flex; gap: 8px; margin: 0 -16px; padding: 2px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.pw-who::-webkit-scrollbar { display: none; }
.pw-whoc { flex: 0 0 auto; min-height: 44px; display: flex; align-items: center; gap: 7px; padding: 4px 13px 4px 5px; border-radius: 22px; cursor: pointer; font: 400 15px/1 var(--font-fun); color: #fff; background: rgba(10, 30, 72, 0.9); border: 2px solid rgba(90, 150, 235, 0.55); }
.pw-whoc .pw-crest { width: 30px; height: 30px; }
/* a creator's card */
.pw-crcard { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; border-radius: 22px; background: linear-gradient(180deg, rgba(24, 62, 132, 0.95), rgba(12, 36, 86, 0.95)); border: 3px solid #4d8ff0; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25), 0 8px 18px rgba(0, 0, 0, 0.4); }
.pw-crtop { display: flex; align-items: center; gap: 14px; }
.pw-crtop > .pw-crest { width: 84px; height: 84px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)); }
.pw-crtop > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pw-crtop h2 { margin: 0; font: 400 28px/1.05 var(--font-fun); color: #fff; overflow-wrap: anywhere; text-shadow: 0 3px 0 #06224f; }
.pw-crclub { margin: 0; font: 400 16px/1.1 var(--font-fun); color: var(--pw-gold); }
.pw-crsince { margin: 0; font: 600 12.5px/1.2 var(--font-ui); color: var(--pw-dim); }
.pw-crcard .pw-facts { justify-content: flex-start; margin: 0; }
.pw-follow { width: 100%; }
.pw-follow.on { box-shadow: 0 4px 0 var(--pw-cyan-lo), 0 0 16px rgba(31, 214, 247, 0.35); }
.pw-crnote { margin: -4px 0 0; text-align: center; font: 500 13px/1.3 var(--font-ui); color: var(--pw-dim); }
.pw-crme { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 14px; font: 400 17px/1 var(--font-fun); color: var(--pw-green); background: rgba(99, 226, 125, 0.12); border: 2px dashed rgba(99, 226, 125, 0.5); }
.pw-crme svg { width: 20px; height: 20px; }
.pw-crcard.pw-skel { min-height: 210px; }
.pw-crcard.pw-skel i { display: block; height: 16px; border-radius: 8px; background: linear-gradient(90deg, rgba(110, 160, 235, 0.14) 20%, rgba(170, 210, 255, 0.32) 50%, rgba(110, 160, 235, 0.14) 80%) 0 0 / 300% 100%; animation: pwShim 1.3s linear infinite; }
.pw-crcard.pw-skel i.pw-crsk { width: 84px; height: 84px; border-radius: 50%; }
.pw-crcard.pw-skel i:nth-child(2) { width: 60%; height: 24px; }
.pw-crcard.pw-skel i:nth-child(3) { width: 100%; height: 54px; border-radius: 16px; margin-top: auto; }
/* Share: get a username so mates can follow you */
.pw-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px; border-radius: 16px; background: rgba(31, 214, 247, 0.1); border: 2px dashed rgba(31, 214, 247, 0.55); }
.pw-nudge > svg { width: 34px; height: 34px; flex: 0 0 auto; color: var(--pw-cyan); }
.pw-nudge > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pw-nudge b { font: 400 17px/1.1 var(--font-fun); color: #fff; }
.pw-nudge span { font: 500 13px/1.3 var(--font-ui); color: var(--pw-dim); }
.pw-nudge .pw-btn { flex: 1 0 100%; min-height: 46px; }
#pwNudge:empty { display: none; }
/* a red button (Report, Keep it down) */
.pw-btn.red { color: #fff; background: linear-gradient(180deg, #ff8a8a, #e04444 50%, #b8262a); border-color: #ffc9c9; box-shadow: 0 4px 0 #6e1416, 0 6px 14px rgba(0, 0, 0, 0.35); }
.pw-btn.red:active { box-shadow: 0 1px 0 #6e1416, 0 3px 6px rgba(0, 0, 0, 0.3); }
/* the report sheet: four reasons, a note for "something else", what happens next */
.pw-reasons { display: flex; flex-direction: column; gap: 8px; }
.pw-reason { box-shadow: none; width: 100%; min-height: 56px; display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 14px; cursor: pointer; text-align: left; color: #fff; background: rgba(6, 18, 44, 0.6); border: 2.5px solid rgba(90, 150, 235, 0.45); }
.pw-reason > svg { width: 28px; height: 28px; flex: 0 0 auto; color: var(--pw-cyan); }
.pw-reason span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pw-reason b { font: 400 16.5px/1.1 var(--font-fun); }
.pw-reason small { font: 500 12px/1.25 var(--font-ui); color: var(--pw-dim); }
.pw-reason.on { border-color: #ff8a8a; background: rgba(150, 24, 30, 0.42); box-shadow: 0 0 0 3px rgba(255, 110, 110, 0.25); }
.pw-reason.on > svg { color: #ffb3b3; }
.pw-repnote { display: flex; flex-direction: column; gap: 6px; }
.pw-repnote[hidden] { display: none; }
.pw-repnote .pw-lab { margin: 2px 0 0; }
.pw-note { -webkit-user-select: text; user-select: text; touch-action: pan-y; width: 100%; min-height: 84px; resize: none; padding: 10px 12px; border-radius: 14px; font: 500 16px/1.35 var(--font-ui); color: #fff; background: #0a2152; border: 3px solid #3f82e6; box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.45); outline: none; }
.pw-note:focus { border-color: var(--pw-cyan); }
.pw-note::placeholder { color: rgba(168, 194, 230, 0.6); }
.pw-count { align-self: flex-end; margin-top: -2px; font: 600 11.5px/1 var(--font-ui); color: var(--pw-dim); }
.pw-repinfo { margin: 0; display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px; border-radius: 13px; font: 500 13px/1.35 var(--font-ui); color: var(--pw-text); background: rgba(255, 211, 90, 0.1); border: 1.5px solid rgba(255, 211, 90, 0.45); }
.pw-repinfo svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--pw-gold); margin-top: 1px; }
.pw-cstate > svg { width: 30px; height: 30px; flex: 0 0 auto; color: var(--pw-gold); }
@media (pointer: coarse) { .pw-modal:has(.pw-repm) { place-items: start center; padding-top: calc(var(--safe-t, 0px) + 18px); } .pw-repm .pw-mart { width: 56px; } }
/* the admin: the hub's button, the review, a card's Coach's pick toggle */
.pw-adminbar { box-shadow: none; width: 100%; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 16px; cursor: pointer; text-align: left; color: #fff; background: linear-gradient(180deg, rgba(120, 22, 30, 0.92), rgba(70, 10, 18, 0.92)); border: 2.5px solid #ff8a8a; box-shadow: 0 4px 0 #4a0b10, 0 6px 14px rgba(0, 0, 0, 0.35); }
.pw-adminbar > svg:first-child { width: 30px; height: 30px; color: #ffd0d0; flex: 0 0 auto; }
.pw-adminbar span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pw-adminbar b { font: 400 18px/1 var(--font-fun); }
.pw-adminbar small { font: 600 12.5px/1.2 var(--font-ui); color: #ffd0d0; }
.pw-adminbar i { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; display: grid; place-items: center; font: 400 15px/1 var(--font-fun); font-style: normal; color: #3b2204; background: var(--pw-gold); }
.pw-adminbar > svg:last-child { width: 20px; height: 20px; opacity: 0.8; flex: 0 0 auto; }
.pw-pickb { position: relative; min-height: 34px; padding: 0 10px 0 6px; border-radius: 11px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font: 400 14px/1 var(--font-fun); color: var(--pw-dim); background: rgba(4, 14, 38, 0.6); border: 2px dashed rgba(255, 211, 90, 0.55); }
.pw-pickb::after { content: ""; position: absolute; inset: -6px -3px; }
.pw-pickb svg { width: 18px; height: 18px; }
.pw-pickb.on { color: #3b2204; background: linear-gradient(180deg, #fff0a8, var(--pw-gold)); border-style: solid; border-color: var(--pw-gold-hi); }
.pw-qc { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 18px; background: linear-gradient(180deg, rgba(24, 62, 132, 0.95), rgba(12, 36, 86, 0.95)); border: 2.5px solid var(--pw-gold); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.25), 0 6px 16px rgba(0, 0, 0, 0.45); }
.pw-qc.down { border-color: #ff8a8a; }
.pw-qtop { display: flex; gap: 12px; }
.pw-qtop .pw-thumb { height: 150px; flex-basis: 90px; }
.pw-qtop .pw-ci { padding-right: 0; }
.pw-flags i.down { color: #fff; background: #d63a3a; }
.pw-flags i.up { color: #073a16; background: var(--pw-green); }
.pw-flags i.n { color: #fff; background: rgba(255, 255, 255, 0.18); }
.pw-reps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pw-rep { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 10px; border-radius: 13px; background: rgba(4, 14, 38, 0.6); border: 1.5px solid rgba(90, 150, 235, 0.35); }
.pw-rr { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 6px; border-radius: 9px; font: 400 13.5px/1 var(--font-fun); color: #fff; background: #8a2a2e; }
.pw-rr svg { width: 15px; height: 15px; }
.pw-rr.broken { background: #8a5a12; }
.pw-rr.copied { background: #2f4f9e; }
.pw-rr.other { background: #4d5a72; }
.pw-rep q { font: italic 500 13.5px/1.35 var(--font-ui); color: #fff; overflow-wrap: anywhere; }
.pw-rep small { font: 500 12px/1.3 var(--font-ui); color: var(--pw-dim); }
.pw-rep small b { color: #fff; }
.pw-rep small i { font-style: normal; opacity: 0.7; }
.pw-reprec { display: inline-flex; align-items: center; gap: 5px; color: var(--pw-green) !important; }
.pw-reprec.warn { color: var(--pw-gold) !important; }
.pw-reprec svg { width: 14px; height: 14px; }
.pw-qbtns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
.pw-qbtns .pw-btn { min-height: 46px; padding: 0 6px; font-size: 14.5px; gap: 4px; white-space: normal; line-height: 1.05; }
.pw-qbtns .pw-btn svg { width: 17px; height: 17px; }
.pw-adreset { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 18px; background: rgba(8, 24, 60, 0.82); border: 2px solid rgba(120, 175, 245, 0.45); }
.pw-adreset .pw-lab { margin: 0 0 -6px; }
/* My courses: where your courses are kept (with an account: on every device you sign in on) */
.pw-onc small { white-space: normal; max-width: 118px; line-height: 1.15; }   /* (Online · older version: two short lines, clear of the numbers) */
.pw-sync { margin: -4px 0 -2px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 12px; border-radius: 12px; font: 600 12.5px/1.25 var(--font-ui); text-align: center; color: var(--pw-dim); background: rgba(6, 18, 44, 0.6); border: 1.5px solid rgba(90, 150, 235, 0.35); }
.pw-sync svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--pw-cyan); }
.pw-sync.ok { color: #cfeefc; border-color: rgba(31, 214, 247, 0.45); }
.pw-sync.wait svg, .pw-sync.full svg { color: var(--pw-gold); }
.pw-sync.full { color: var(--pw-gold-hi); border-color: rgba(255, 211, 90, 0.5); }
