@font-face {
  font-family: Excalifont;
  src: url('./fonts/Excalifont-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --paper: #f7f7f2;
  --panel: #fcfcf7;
  --ink: #262621;
  --outline: #262621;
  --muted: #75766d;
  --line: #26262130;
  --shadow: #e3e3db;
  --rim: #e8e5d9;
  --purple: #d5c7ed;
  --lime: #e1e9a6;
  --hand: 'Excalifont', cursive;
  --body: 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
  font-family: var(--body);
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --paper: #20211f;
  --panel: #282925;
  --ink: #f0eee5;
  --muted: #b5b7aa;
  --line: #efeee52c;
  --shadow: #151613;
  --rim: #52534a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; }
button, input { font: inherit; color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; background: none; }
button:disabled { cursor: default; opacity: .4; }
button:not(:disabled):active { transform: translate(1px, 2px); }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 3px solid #a38ac6; outline-offset: 5px; }
[hidden] { display: none !important; }
svg { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.paper-fill { fill: var(--paper); }
.header { height: 126px; display: flex; gap: 16px; align-items: center; justify-content: space-between; margin: 0 5.3%; border-bottom: 1.5px solid var(--ink); position: relative; z-index: 5; }
.header::after { content: ''; position: absolute; bottom: -3px; left: 0; width: 100%; border-bottom: 1px solid var(--line); transform: rotate(-.12deg); pointer-events: none; }
.brand { display: flex; min-width: 0; align-items: center; gap: 13px; text-decoration: none; color: inherit; font-family: var(--hand); font-size: 21px; line-height: 1.2; letter-spacing: -.6px; }
.brand > span { min-width: 0; white-space: normal; }
.brand-mark { flex-shrink: 0; width: 47px; height: 47px; transform: rotate(-8deg); stroke: var(--outline); stroke-width: 2; }
.brand-period { color: #a98bc9; }
.header-actions { display: flex; flex-shrink: 0; align-items: center; gap: 16px; }
.icon-button { width: 38px; height: 38px; border: 1.6px solid var(--ink); border-radius: 46% 54% 49% 51% / 52% 42% 58% 48%; display: grid; place-items: center; padding: 6px; }
.icon-button:hover { background: var(--line); }
.icon-button svg { width: 22px; height: 22px; stroke-width: 1.6; }
.mute-slash, .sun-icon { display: none; }
#sound-toggle[aria-pressed='false'] .mute-slash { display: block; }
[data-theme='dark'] .moon-icon { display: none; }
[data-theme='dark'] .sun-icon { display: block; }
.text-button { border: 0; text-decoration: underline; text-underline-offset: 5px; font-size: 14px; padding: 5px 0; }
.setup { min-height: calc(100svh - 192px); display: grid; place-items: center; padding: 56px 7%; }
.list-editor { width: min(100%, 510px); display: grid; justify-items: center; gap: 18px; }
.export-list { color: var(--muted); padding: 8px 12px; }
.export-list:not(:disabled):hover { color: var(--ink); }
.project-panel { width: min(100%, 510px); border: 2px solid var(--outline); border-radius: 5px 14px 6px 11px / 11px 5px 12px 5px; padding: 33px 30px 24px; position: relative; background: var(--panel); box-shadow: 5px 6px 0 var(--shadow); transform: rotate(.25deg); }
.project-panel::before { content: ''; position: absolute; inset: 3px -4px -3px 2px; border: 1px solid var(--line); pointer-events: none; border-radius: 7px 4px 10px 3px; transform: rotate(-.5deg); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 26px; }
 h1 { font-family: var(--hand); font-weight: 400; }
.panel-heading h1 { font-size: 35px; letter-spacing: -1px; margin: 0; }
#list-count { font-size: 12px; white-space: nowrap; color: var(--muted); }
.input-wrap { display: flex; align-items: center; padding: 7px 8px 7px 14px; border: 1.6px solid var(--ink); border-radius: 5px 3px 6px 2px; background: var(--paper); gap: 12px; transform: rotate(-.25deg); }
.colour-dot { width: 17px; height: 17px; border: 1.5px solid var(--outline); border-radius: 44% 56% 50% 43%; flex-shrink: 0; background: var(--purple); display: block; }
input { min-width: 0; width: 100%; border: 0; background: transparent; padding: 8px 0; font-size: 16px; }
input:focus-visible { outline: none; }
.input-wrap:focus-within { outline: 2px solid #a38ac6; outline-offset: 3px; }
input::placeholder { color: var(--muted); }
#add-project { border: 1.5px solid var(--outline); border-radius: 3px 5px 2px 4px; background: var(--lime); color: var(--outline); width: 35px; height: 35px; flex-shrink: 0; font-size: 26px; line-height: 1; }
.import-zone { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; column-gap: 7px; margin-top: 12px; padding: 7px 9px; min-height: 36px; border: 1px dashed var(--muted); border-radius: 4px 7px 3px 5px; color: var(--muted); }
.is-importing .import-zone { background: var(--line); border-color: var(--ink); }
.import-zone > span { font-size: 12px; }
.import-zone button { padding: 3px 0; border: 0; font-size: 14px; color: inherit; }
#import-browse { text-decoration: underline; text-underline-offset: 3px; }
.import-zone button:hover { color: var(--ink); }
body.is-importing::after { content: ''; position: fixed; inset: 12px; border: 2px dashed var(--ink); border-radius: 7px 12px 5px 9px; pointer-events: none; z-index: 20; }
.import-feedback { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 40px); width: max-content; margin: 0; padding: 12px 17px; border: 1.5px solid var(--ink); border-radius: 5px 8px 3px 6px; background: var(--panel); color: var(--ink); font-size: 14px; line-height: 1.6; z-index: 20; }
.form-message { font-size: 12px; margin: 7px 0; color: var(--muted); }
.form-message:empty { margin: 0; }
.project-list { list-style: none; margin: 15px 0 0; padding: 0; max-height: 360px; min-height: 60px; overflow-y: auto; scrollbar-width: thin; }
.project-row { display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); min-height: 51px; font-size: 16px; padding: 5px 0; }
.project-row.import-reveal { animation: choice-arrive 360ms cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--import-order) * 75ms); transform-origin: center; border-radius: 4px 6px 3px 5px; }
@keyframes choice-arrive {
  0% { opacity: 0; transform: translateY(4px) scale(.96); background-color: transparent; }
  35% { opacity: 1; transform: translateY(-1px) scale(1.012); background-color: color-mix(in srgb, var(--choice-colour) 28%, transparent); }
  100% { opacity: 1; transform: none; background-color: transparent; }
}
.project-name { flex: 1; overflow-wrap: anywhere; }
.colour-control { display: grid; place-items: center; border: 0; padding: 9px; margin-left: -7px; border-radius: 6px; }
.colour-control:hover { background: var(--line); }
.remove-project { border: 0; color: var(--muted); font-size: 23px; width: 32px; height: 32px; }
.remove-project:hover { color: var(--ink); background: var(--line); border-radius: 45%; }
.panel-footer { margin-top: 26px; }
.primary-button { display: flex; justify-content: center; align-items: center; gap: 17px; width: 100%; border: 1.8px solid var(--outline); background: var(--lime); color: var(--outline); padding: 14px 23px; font-size: 16px; font-weight: 500; border-radius: 4px 8px 3px 6px / 6px 3px 8px 3px; box-shadow: 2px 3px 0 var(--outline); }
.primary-button:not(:disabled):hover { background: #d5df8e; }
.primary-button svg { width: 38px; height: 24px; stroke: var(--outline); stroke-width: 1.7; }
.minimum-note { text-align: center; font-size: 12px; color: var(--muted); margin: 16px 0 0; }
.minimum-note:empty { display: none; }
.footer { height: 66px; display: flex; align-items: center; justify-content: center; margin: 0 5.3%; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; position: relative; z-index: 3; background: var(--paper); }
body:has(#wheel-view:not([hidden])) .footer { border-color: transparent; }
.wheel-view { height: calc(100svh - 192px); min-height: 470px; position: relative; overflow: hidden; }
#wheel { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; outline-offset: -7px; }
#wheel.dragging { cursor: grabbing; }
#wheel.spinning { cursor: default; }
.pointer { position: absolute; width: 96px; height: 65px; transform-origin: 85% 50%; pointer-events: none; z-index: 2; }
.pointer svg { width: 100%; height: 100%; stroke: var(--outline); stroke-width: 2.4; }
.pointer-shadow { stroke: none; fill: #0003; transform: translate(3px, 5px); }
.decision-panel { position: absolute; left: 62%; right: 6%; top: 50%; transform: translateY(-50%); pointer-events: none; }
.decision-panel > * { pointer-events: auto; }
.drag-cue { font-family: var(--hand); font-size: 34px; margin: 0 0 23px; color: var(--muted); transform: rotate(-3deg); }
.direction-controls { display: flex; gap: 14px; }
.direction-controls .icon-button, .retry-button { width: 41px; height: 41px; }
.direction-controls svg, .retry-button svg { width: 25px; height: 25px; }
#result-name { overflow-wrap: anywhere; font-size: clamp(32px, 4.1vw, 62px); line-height: 1.2; margin: 0 0 28px; }
#colour-picker { position: fixed; inset: auto; margin: 0; width: 320px; max-width: calc(100vw - 20px); max-height: calc(100svh - 20px); overflow-y: auto; padding: 14px; border: 1.6px solid var(--outline); border-radius: 7px 4px 9px 3px; background: var(--panel); color: var(--ink); box-shadow: 3px 4px 0 var(--shadow); }
#colour-picker::backdrop { background: transparent; }
.colour-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.colour-swatch { display: grid; place-items: center; width: 100%; min-width: 0; height: 39px; border: 0; border-radius: 5px; }
.colour-swatch .colour-dot { width: 25px; height: 25px; }
.colour-swatch[aria-pressed='true'] { outline: 1.5px solid var(--ink); outline-offset: -2px; }
.colour-swatch:hover { background: var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 720px) {
  .header { height: 99px; margin: 0 6%; }
  .brand { font-size: 17px; gap: 9px; }
  .brand-mark { width: 38px; height: 38px; }
  .header-actions { gap: 10px; }
  .icon-button { width: 33px; height: 33px; }
  #edit-projects { font-size: 12px; max-width: 55px; text-align: left; line-height: 1.4; }
  .setup { min-height: calc(100svh - 165px); padding: 42px 7% 48px; }
  .project-panel { padding: 27px 22px 24px; }
  .panel-heading h1 { font-size: 30px; }
  .project-list { max-height: 285px; }
  .footer { margin: 0 6%; }
  .wheel-view { height: calc(100svh - 165px); min-height: 560px; }
  .pointer { width: 75px; height: 51px; }
  .decision-panel { top: calc(min(160px, 23%) + 40vw + 15svh); bottom: auto; left: 43%; right: 7%; transform: translateY(-50%); }
  .drag-cue { font-size: 26px; margin-bottom: 23px; white-space: nowrap; }
  #result-name { font-size: clamp(26px, 7.3vw, 36px); margin-bottom: 22px; }
}
@media (max-width: 380px) {
  .header-actions { gap: 7px; }
  .brand { font-size: 15px; gap: 6px; }
  .brand-mark { width: 31px; height: 31px; }
  .icon-button { width: 29px; height: 29px; padding: 4px; }
  #edit-projects { max-width: 49px; }
  .decision-panel { left: 42%; right: 5%; }
  .drag-cue { font-size: 24px; }
}
@media (max-width: 720px) and (min-aspect-ratio: 1/1) {
  .decision-panel { top: min(160px, 23%); bottom: auto; left: 64%; right: 5%; transform: translateY(-25%); }
}
@media (prefers-reduced-motion: reduce) {
  .project-row.import-reveal { animation: none; }
  * { scroll-behavior: auto !important; transition: none !important; }
}
