@font-face { font-family:"DM Sans"; src:url("assets/dm-sans-400.ttf") format("truetype"); font-weight:400; font-display:swap; }
@font-face { font-family:"DM Sans"; src:url("assets/dm-sans-500.ttf") format("truetype"); font-weight:500; font-display:swap; }
@font-face { font-family:"DM Sans"; src:url("assets/dm-sans-600.ttf") format("truetype"); font-weight:600; font-display:swap; }
@font-face { font-family:"DM Sans"; src:url("assets/dm-sans-700.ttf") format("truetype"); font-weight:700; font-display:swap; }
@font-face { font-family:"Instrument Serif"; src:url("assets/instrument-serif-400.ttf") format("truetype"); font-style:normal; font-weight:400; font-display:swap; }
@font-face { font-family:"Instrument Serif"; src:url("assets/instrument-serif-italic-400.ttf") format("truetype"); font-style:italic; font-weight:400; font-display:swap; }

:root {
  --paper: #fbf7ef;
  --parchment: #f4ead7;
  --ink: #25231f;
  --muted: #625b52;
  --line: #d8cdbd;
  --red: #a83e2f;
  --red-dark: #833024;
  --green: #42694f;
  --ochre: #bd852f;
  --steel: #a9ada8;
  --error: #8f2f25;
  --radius: 2px;
  --shadow-press: 4px 5px 0 var(--parchment);
  --shadow-press-lg: 6px 7px 0 #e3d5be;
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.25rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(189,133,47,.12), transparent 26rem),
    linear-gradient(145deg, #ece2d2, #f8f3ea 45%, #e7ddcc);
  font-family: "DM Sans", system-ui, sans-serif;
}

button { font: inherit; }

.app-shell {
  width: min(100%, 900px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 70px rgba(50, 39, 24, .14);
}

.screen { display: none; min-height: 100vh; min-height: 100svh; }
.screen.is-active { display: flex; animation: arrive .45s ease both; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  margin: 0 0 .7rem;
  color: var(--red);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
}

.intro-screen {
  position: relative;
  isolation: isolate;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 5rem);
  text-align: left;
}

.intro-sketch { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.intro-screen::after { content: ""; position: absolute; z-index: 1; inset: 0; width: auto; height: auto; border: 0; border-radius: 0; background: linear-gradient(90deg, var(--paper) 0 28%, rgba(251,247,239,.94) 47%, rgba(251,247,239,.08) 73%); pointer-events: none; }
.intro-content { position: relative; z-index: 2; width: min(58%, 520px); }

.kopitiam-mark {
  display: grid;
  width: 6.5rem;
  height: 6.5rem;
  margin-bottom: 1.6rem;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 2rem;
  transform: rotate(-4deg);
}
.kopitiam-mark span { display: block; line-height: .88; }
.brand-name, .result-brand {
  margin: 0 0 .45rem;
  color: var(--red);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .2em;
}
.result-brand { margin: 0 0 1.1rem; }
.result-brand span { font-family: "Instrument Serif", Georgia, serif; font-size: .92rem; letter-spacing: .08em; }

h1, h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  line-height: .95;
}
h1:focus, h2:focus { outline: none; }

h1 { max-width: 650px; font-size: clamp(3.3rem, 8vw, 6.5rem); }
h1 em { color: var(--red); font-weight: 400; }
.lede { max-width: 460px; margin: 1.5rem 0; color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
.manifesto { margin: -.45rem 0 1.5rem; color: var(--red); font-family: "Instrument Serif", Georgia, serif; font-size: clamp(1.45rem, 3vw, 2rem); font-style: italic; }

.promise { display: flex; align-items: center; gap: .7rem; margin-bottom: 2rem; color: var(--muted); font-size: .76rem; font-weight: 600; }
.promise i { width: 3px; height: 3px; border-radius: 50%; background: var(--red); }

.primary-button {
  min-height: 3.25rem;
  padding: .8rem 1.35rem;
  border: 0;
  border-radius: 2px;
  color: #fffaf3;
  background: var(--red);
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(132, 48, 36, .16);
  cursor: pointer;
  transition: background .15s, transform .15s, opacity .15s;
}
.primary-button:hover { background: var(--red-dark); transform: translateY(-1px); }
.primary-button:focus-visible, .text-button:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.primary-button:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.primary-button span { margin-left: .8rem; }
.secondary-button {
  min-height: 3rem;
  padding: .7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: white;
  font-weight: 700;
  cursor: pointer;
}
.secondary-button:hover { border-color: var(--red); box-shadow: var(--shadow-press); }
.secondary-button:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.secondary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.fine-print { margin-top: 1rem; color: var(--muted); font-size: .75rem; }

.queue-screen {
  position: relative;
  align-items: flex-end;
  overflow: hidden;
  padding: clamp(1rem, 4vw, 2rem);
  color: #fffaf3;
  background: #3b342b;
}
.queue-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.queue-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,18,15,.08) 15%, rgba(20,18,15,.82) 85%); }
.queue-card { position: relative; z-index: 1; width: min(100%, 620px); padding: clamp(1.3rem, 4vw, 2.4rem); border: 1px solid rgba(255,255,255,.35); background: rgba(31,27,22,.78); backdrop-filter: blur(12px); }
.queue-card h2 { font-size: clamp(3rem, 9vw, 5.8rem); }
.queue-card > p:not(.eyebrow) { max-width: 480px; color: rgba(255,250,243,.8); line-height: 1.6; }
.queue-track { display: flex; align-items: center; gap: .55rem; margin: 1.5rem 0; color: rgba(255,250,243,.72); font-size: .58rem; font-weight: 700; letter-spacing: .08em; }
.person-dot { width: 1.15rem; height: 1.15rem; border-radius: 50% 50% 42% 42%; background: rgba(255,255,255,.7); }
.you-dot { display: grid; width: 2rem; height: 2rem; place-items: center; color: white; background: var(--red); font-size: .45rem; }
.queue-track i { flex: 1; height: 1px; background: rgba(255,255,255,.32); }

.ritual-screen { flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.2rem 3rem; text-align: center; }
.ritual-progress { display: flex; width: min(100%, 260px); align-items: center; margin-bottom: clamp(2rem, 7vw, 4rem); }
.ritual-progress span { display: grid; width: 1.8rem; height: 1.8rem; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: .68rem; font-weight: 700; }
.ritual-progress span.is-current { border-color: var(--red); color: #fff; background: var(--red); }
.ritual-progress i { flex: 1; height: 1px; background: var(--line); }
.hawker-bubble { position: relative; margin: .6rem 0 2rem; padding: 1.1rem 1.5rem; border: 1px solid var(--line); color: var(--ink); background: white; font-family: "Instrument Serif", serif; font-size: clamp(1.8rem, 6vw, 2.8rem); box-shadow: 5px 6px 0 var(--parchment); }
.hawker-bubble::after { content: ""; position: absolute; right: 20%; bottom: -.55rem; width: 1rem; height: 1rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; transform: rotate(45deg); }
.hawker-bubble span { display: block; margin-bottom: .25rem; color: var(--red); font-family: "DM Sans", sans-serif; font-size: .55rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.stallholder-encounter { position: relative; width: min(100%, 680px); margin: .4rem auto 1.6rem; }
.stallholder-encounter > img { display: block; width: 100%; max-height: 19rem; object-fit: cover; object-position: center 34%; filter: saturate(.9) contrast(1.02); }
.stallholder-encounter .hawker-bubble { position: absolute; right: 5%; bottom: -1.4rem; max-width: 72%; margin: 0; text-align: left; }
.compact-encounter { width: min(100%, 560px); }
.compact-encounter > img { max-height: 13rem; }
.compact-encounter .hawker-bubble { font-size: clamp(1.35rem, 4vw, 2rem); }
.ritual-screen h2 { font-size: clamp(3.2rem, 10vw, 6rem); }
.ritual-copy { max-width: 470px; margin: 1rem 0 1.7rem; color: var(--muted); line-height: 1.55; }
.rice-options { display:grid; width:min(100%,820px); grid-template-columns:repeat(5,1fr); gap:.7rem; }
.gravy-options { display: grid; width: min(100%, 680px); grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.ritual-choice { min-height: 9.5rem; padding: 1rem .6rem; border: 1px solid var(--line); color: var(--ink); background: white; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.ritual-choice:hover { border-color: var(--red); box-shadow: 4px 5px 0 var(--parchment); transform: translateY(-2px); }
.ritual-choice:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.ritual-choice strong { display: block; margin-top: .85rem; font-size: .86rem; }
.ritual-choice small { display: block; margin-top: .25rem; color: var(--muted); font-size: .65rem; }
.rice-bowl { position: relative; display: block; width: 4.2rem; height: 2.2rem; margin: .8rem auto 0; border: 4px solid #d5d7d2; border-top: 0; border-radius: 0 0 50% 50%; background: linear-gradient(90deg, #f0f0ec, #fff); box-shadow: 0 5px 6px rgba(45,38,28,.12); }
.rice-bowl::before { content: ""; position: absolute; left: 8%; bottom: 45%; width: 84%; height: var(--rice-height, 1.8rem); border-radius: 50% 50% 24% 24%; background: repeating-radial-gradient(ellipse, #fffdf4 0 3px, #e7e2d1 4px 5px); }
.rice-bowl.brown::before { background:repeating-radial-gradient(ellipse,#caa878 0 3px,#8f704f 4px 5px); }
.rice-bowl.none::before { display: none; }
.gravy-swatch { display: block; width: 3.7rem; height: 3.7rem; margin: .4rem auto; border: 7px solid #e5e5df; border-radius: 50%; box-shadow: 0 4px 8px rgba(45,38,28,.14); }
.gravy-swatch.curry { background: #c17c29; }
.gravy-swatch.braise { background: #69412b; }
.gravy-swatch.mix { background: linear-gradient(135deg, #c17c29 0 49%, #69412b 51%); }
.gravy-swatch.none { background: #f5f3e9; }
.gravy-recap { margin: -.2rem 0 1.2rem; color: var(--ink); font-family: "Instrument Serif", serif; font-size: 1.2rem; }

.choice-grid { display: grid; gap: .75rem; }
.missing-start { width: min(100%, 680px); grid-template-columns: 1fr 1fr; }
.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: white;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}
.choice-card:hover { border-color: var(--red); box-shadow: var(--shadow-press); transform: translateY(-1px); }
.choice-card:focus-visible, .choice-card:has(input:focus-visible) { outline: 3px solid var(--ochre); outline-offset: 3px; }
.choice-card.is-selected, .choice-card:has(input:checked) { border-color: var(--red); background: #fff8ee; box-shadow: inset 4px 0 0 var(--red); }
.choice-card.is-selected::after, .choice-card:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: .55rem;
  right: .65rem;
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--red);
  font-size: .72rem;
  font-weight: 700;
}
.choice-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.choice-card-medium { min-height: 5rem; justify-content: center; font-weight: 700; text-align: center; }
.choice-card-compact { min-height: 3.35rem; font-size: .82rem; font-weight: 600; }
.choice-card:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: none; }
.missing-detail { width: min(100%, 680px); margin-top: 1rem; text-align: left; }
.missing-detail[hidden] { display: none; }
.question-block { margin-bottom: 1rem; padding: 1rem; border: 1px solid var(--line); background: white; box-shadow: var(--shadow-press); }
.question-block.is-compact { margin: 0 0 1rem; box-shadow: none; }
.question-kicker { margin: 0 0 .35rem; color: var(--red); font-size: .68rem; font-weight: 700; letter-spacing: .14em; }
.question-block h3 { margin: 0 0 .8rem; font-family: "Instrument Serif", serif; font-size: clamp(1.45rem, 4vw, 2rem); font-weight: 400; line-height: 1.08; }
.question-block > p:last-child:not(.character-count) { margin: -.35rem 0 .8rem; color: var(--muted); line-height: 1.45; }
.field { display: grid; gap: .5rem; font-size: .82rem; font-weight: 700; }
.field textarea, .field input, .field select {
  width: 100%;
  min-height: 3.5rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper);
  font: inherit;
}
.field textarea { min-height: 5.25rem; resize: none; line-height: 1.45; }
.field textarea:focus-visible, .field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.character-count { margin: .45rem 0 0; color: var(--muted); font-size: .75rem; text-align: right; }
.counterfactual-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.missing-undo { display: block; margin: .5rem auto 0; }
.missing-continue { margin-top: 1.2rem; }
.inline-notice { width: min(100%, 680px); margin: 1rem auto 0; padding: .8rem 1rem; border-left: 4px solid var(--ochre); color: var(--ink); background: white; font-size: .82rem; line-height: 1.45; text-align: left; }
.inline-notice[hidden] { display: none; }
.inline-notice.is-error { border-left-color: var(--error); color: var(--error); }

.stall-screen { flex-direction: column; padding: 1.1rem 0 2rem; }
.stall-header { display: flex; align-items: flex-start; justify-content: space-between; padding: .7rem 1.1rem .4rem; }
.stall-header h2 { font-size: clamp(2.5rem, 7vw, 4rem); }
.text-button { padding: .3rem 0; border: 0; border-bottom: 1px solid currentColor; color: var(--muted); background: transparent; font-size: .76rem; cursor: pointer; }
.instruction { margin: .8rem 1.1rem 1rem; color: var(--muted); font-size: .82rem; }
.pulse-dot { display: inline-block; width: .45rem; height: .45rem; margin-right: .3rem; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(168,62,47,.13); }
.stallholder-observation { display: grid; grid-template-columns: 3.3rem 1fr; align-items: center; gap: .8rem; margin: .35rem 1.1rem 1rem; padding: .65rem; border: 1px solid var(--line); background: white; transition: border-color .25s, box-shadow .25s, transform .25s; }
.stallholder-observation img { width: 3.3rem; height: 3.3rem; border-radius: 50%; object-fit: cover; object-position: center 30%; transition: filter .25s, transform .25s; }
.stallholder-observation span { color: var(--red); font-size: .55rem; font-weight: 700; letter-spacing: .14em; }
.stallholder-observation p { margin: .16rem 0 0; font-family: "Instrument Serif", serif; font-size: 1.15rem; line-height: 1.1; }
.stallholder-observation.is-watching img { transform: scale(1.04); }
.stallholder-observation.is-waiting { border-color: rgba(168,62,47,.55); box-shadow: 3px 4px 0 var(--parchment); }
.stallholder-observation.is-waiting img { filter: saturate(.9) contrast(1.08); transform: scale(1.08); }
.stallholder-observation.is-impatient { border-color: var(--red); box-shadow: 4px 5px 0 rgba(168,62,47,.16); transform: rotate(-.18deg); }
.stallholder-observation.is-impatient img { filter: saturate(.78) contrast(1.18); transform: scale(1.12); }

@media (prefers-reduced-motion: reduce) {
  .stallholder-observation, .stallholder-observation img { transition: none; }
  .stallholder-observation.is-impatient { transform: none; }
}

.counter-wrap { position: relative; margin-top: 2.1rem; }
.stall-sign {
  position: absolute;
  z-index: 2;
  top: -2.25rem;
  left: 50%;
  display: flex;
  width: 12rem;
  height: 3.2rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid #f2d9b2;
  color: #faead1;
  background: var(--red);
  box-shadow: 0 4px 8px rgba(45,35,25,.22);
  transform: translateX(-50%) rotate(-1deg);
}
.stall-sign b { font-family: "Instrument Serif", serif; font-size: 1.1rem; letter-spacing: .12em; }
.stall-sign span { margin-top: .05rem; font-size: .48rem; font-weight: 700; letter-spacing: .2em; }

.counter { position: relative; overflow: hidden; aspect-ratio: 1586 / 992; border-block: 8px solid #5b5e59; background: #777; box-shadow: 0 14px 26px rgba(38,31,23,.28); }
.counter > img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.tray-grid { position: absolute; inset: 0; }
.tray-geometry { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tray-fill { fill: transparent; transition: fill .15s; }
.tray-selection-outer, .tray-selection-inner, .tray-focus-ring { fill: none; stroke-linejoin: round; opacity: 0; }
.tray-selection-outer { stroke: #fff7df; stroke-width: 8; }
.tray-selection-inner { stroke: var(--red); stroke-width: 4; }
.tray-focus-ring { stroke: var(--ochre); stroke-width: 7; }
.tray-visual.is-hovered .tray-fill { fill: rgba(25,24,21,.13); }
.tray-visual.is-selected .tray-fill { fill: rgba(168,62,47,.16); }
.tray-visual.is-selected .tray-selection-outer, .tray-visual.is-selected .tray-selection-inner, .tray-visual.is-focused .tray-focus-ring { opacity: 1; }
.tray-button {
  position: absolute;
  z-index: 3;
  padding: 0;
  border: 0;
  color: white;
  background: transparent;
  cursor: pointer;
}
.tray-button:focus-visible { outline: none; }
.tray-label {
  position: absolute;
  left: var(--label-x);
  top: var(--label-y);
  max-width: 90%;
  padding: .25rem .45rem;
  border-radius: 3px;
  color: #fff;
  background: rgba(25,24,21,.86);
  font-size: clamp(.72rem, 1.7vw, .8rem);
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, calc(-100% + 5px));
  transition: opacity .15s, transform .15s;
  white-space: nowrap;
}
.tray-button:hover .tray-label, .tray-button:focus-visible .tray-label, .tray-button.is-selected .tray-label { opacity: 1; transform: translate(-50%, -100%); }
.tray-number { position: absolute; left: var(--marker-x); top: var(--marker-y); display: none; width: 1.45rem; height: 1.45rem; place-items: center; border-radius: 50%; color: #fff; background: var(--red); font-size: .7rem; font-weight: 700; transform: translate(-50%, -50%); }
.tray-button.is-selected .tray-number { display: grid; }
.glass-sheen { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 15%, rgba(255,255,255,.12) 38%, transparent 55%); mix-blend-mode: screen; }
.counter-edge { display: flex; height: 1rem; justify-content: space-around; background: linear-gradient(#bfc3be, #737872); box-shadow: 0 5px 8px rgba(0,0,0,.16); }
.counter-edge span { width: 8px; height: 1.8rem; background: #696c68; }

.counter-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .7rem; padding: .85rem 1.1rem .15rem; }
.counter-nav > span { color: var(--muted); font-size: .68rem; font-weight: 600; text-align: center; }
.counter-arrow { min-height: 2.75rem; padding: .5rem .7rem; border: 1px solid var(--line); color: var(--ink); background: white; font-size: .75rem; font-weight: 700; cursor: pointer; }
.counter-arrow:last-child { justify-self: end; }
.counter-arrow:disabled { opacity: .35; cursor: not-allowed; }
.counter-arrow:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }

.selection-readout { display: flex; justify-content: space-between; padding: 1rem 1.1rem .4rem; color: var(--ink); font-size: .76rem; font-weight: 700; }
.selection-hint { color: var(--muted); font-weight: 400; }

.plate-dock { display: grid; grid-template-columns: minmax(170px, 1fr) 1fr; align-items: center; gap: clamp(1rem, 5vw, 4rem); margin: 1rem 1.1rem 0; padding: clamp(1rem, 4vw, 2.4rem); border: 1px solid var(--line); background: var(--parchment); }
.plate { position: relative; width: min(100%, 280px); aspect-ratio: 1; border: 12px solid #e3e4df; border-radius: 50%; background: radial-gradient(circle, #fbfbf7 0 56%, #d4d6d1 58% 64%, #f1f1ec 66%); box-shadow: 0 9px 18px rgba(65,51,33,.18), inset 0 0 4px #bbb; }
.rice { position: absolute; top: 23%; left: 24%; width: 52%; height: 46%; border-radius: 48% 52% 45% 55%; background: radial-gradient(ellipse at 40% 35%, #fff 0 8%, transparent 9%), radial-gradient(ellipse at 55% 55%, #fff 0 8%, transparent 9%), repeating-radial-gradient(ellipse, #f8f5e8 0 3px, #e6e1ce 4px 5px); box-shadow: 2px 6px 8px rgba(65,55,35,.18); transform: rotate(-7deg); }
.rice span { position: absolute; width: 14%; height: 5%; border-radius: 100%; background: #fffdf2; box-shadow: 0 1px 2px #d4cfbf; }
.rice span:nth-child(1) { top: 20%; left: 22%; transform: rotate(28deg); }
.rice span:nth-child(2) { top: 43%; left: 55%; transform: rotate(-18deg); }
.rice span:nth-child(3) { top: 68%; left: 31%; transform: rotate(12deg); }
.rice.is-less { width: 43%; height: 37%; top: 29%; left: 28%; }
.rice.is-more { width: 62%; height: 56%; top: 19%; left: 19%; }
.rice.is-brown { background:radial-gradient(ellipse at 40% 35%,#d4b184 0 8%,transparent 9%),radial-gradient(ellipse at 55% 55%,#c79b68 0 8%,transparent 9%),repeating-radial-gradient(ellipse,#caa878 0 3px,#8f704f 4px 5px); }
.rice.is-none { display: none; }
.serving { position: absolute; width: 36%; aspect-ratio: 1; overflow: hidden; border: 3px solid rgba(255,255,255,.75); border-radius: 48% 52% 45% 55%; background-image: url("assets/cai-fan-counter.jpg"); background-repeat: no-repeat; box-shadow: 1px 5px 7px rgba(35,28,20,.28); animation: scoop .25s ease both; }
@keyframes scoop { from { opacity: 0; transform: scale(.55) rotate(-8deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
.serving:nth-child(1) { top: 9%; right: 10%; }
.serving:nth-child(2) { right: 4%; bottom: 11%; }
.serving:nth-child(3) { bottom: 4%; left: 17%; }
.serving:nth-child(4) { top: 12%; left: 3%; }
.order-copy { min-width: 0; }
.order-copy > p:not(.eyebrow) { min-height: 3.5rem; margin: 0 0 1.2rem; font-family: "Instrument Serif", serif; font-size: clamp(1.3rem, 4vw, 2rem); line-height: 1.15; }

.result-screen { position: relative; flex-direction: column; align-items: center; padding: clamp(2.3rem, 7vw, 5rem) 1.3rem 4rem; text-align: center; }
.result-reset { position: absolute; top: 1.4rem; right: 1.3rem; }
.stallholder-verdict { position: relative; width: min(100%, 540px); margin: .5rem 0 2.6rem; }
.stallholder-verdict img { display: block; width: 100%; height: clamp(12rem, 35vw, 19rem); object-fit: cover; object-position: center 30%; filter: saturate(.88); }
.stallholder-verdict blockquote { position: absolute; right: -1rem; bottom: -1.5rem; width: min(88%, 430px); margin: 0; padding: 1rem 1.2rem; border: 1px solid var(--line); color: var(--ink); background: white; box-shadow: 5px 6px 0 var(--parchment); font-family: "Instrument Serif", serif; font-size: clamp(1.1rem, 3.5vw, 1.55rem); line-height: 1.2; text-align: left; }
.result-glyph { display: grid; width: 5.2rem; height: 5.2rem; margin: .5rem 0 1.2rem; place-items: center; border: 2px solid var(--red); border-radius: 50%; color: var(--red); font-family: "Instrument Serif", serif; font-size: 2rem; transform: rotate(-3deg); }
.result-screen h2 { max-width: 700px; font-size: clamp(3.6rem, 11vw, 7rem); }
.result-tagline { max-width: 580px; margin: 1.4rem 0 1.7rem; color: var(--red); font-family: "Instrument Serif", serif; font-size: clamp(1.35rem, 4vw, 1.9rem); line-height: 1.25; }
.result-rule { width: 4rem; height: 1px; margin-bottom: 1.6rem; background: var(--line); }
.result-body { max-width: 610px; margin: 0; color: var(--muted); font-size: .98rem; line-height: 1.7; }
.near-tie-note { max-width: 540px; margin: 1.1rem 0 0; padding: .7rem 1rem; border: 1px solid var(--line); color: var(--red); font-family: "Instrument Serif", serif; font-size: 1.1rem; }
.signal-label { margin: 2.2rem 0 -.9rem; }
.trait-bars { width: min(100%, 540px); margin: 2.2rem 0; }
.trait { display: grid; grid-template-columns: 7rem 1fr; align-items: center; gap: .7rem; margin: .8rem 0; text-align: left; font-size: .84rem; font-weight: 700; }
.bar { height: 5px; background: var(--line); }
.bar span { display: block; height: 100%; background: var(--red); transform-origin: left; animation: grow .7s .2s ease both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.plate-pairing { width: min(100%, 540px); margin: 0 0 2rem; padding: 1.3rem; border: 1px solid var(--line); text-align: left; }
.plate-pairing h3 { margin: .45rem 0; font-family: "Instrument Serif", serif; font-size: 1.7rem; font-weight: 400; }
.plate-pairing > p:last-child { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.55; }
.plate-recap { width: min(100%, 540px); padding: 1.3rem; border-block: 1px solid var(--line); }
.result-plate-evidence { display:grid; margin:0 auto 1.35rem; place-items:center; }
.result-plate-evidence .plate { width:min(72vw,260px); }
.plate-recap #result-order { margin: 0; font-family: "Instrument Serif", serif; font-size: 1.25rem; }
.plate-recap .result-ritual { margin: .55rem 0 0; color: var(--muted); font-family: "DM Sans", sans-serif; font-size: .84rem; }
.result-recovery { display: grid; width: min(100%, 540px); grid-template-columns: 1fr auto; gap: .35rem 1rem; align-items: center; margin-top: 1rem; padding: .9rem 1rem; color: #fffaf0; background: #251b17; text-align: left; }
.result-recovery[hidden] { display: none; }
.result-recovery span { color: #d8cdbd; font-size: .84rem; }
.result-recovery strong { letter-spacing: .12em; }
.result-recovery button { grid-row: 1 / 3; grid-column: 2; min-height: 2.6rem; padding: .5rem .8rem; border: 1px solid #ffffff44; color: inherit; background: transparent; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.result-recovery button:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.share-button { margin-top: 1.6rem; }
.method-note { width: min(100%, 540px); margin-top: 1.4rem; color: var(--muted); font-size: .84rem; line-height: 1.5; text-align: left; }
.method-note summary { cursor: pointer; text-align: center; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .25rem; }
.method-note summary:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.method-note p { margin: .8rem 0 0; padding: .9rem 1rem; border: 1px solid var(--line); background: white; }

@media (max-width: 560px) {
  .intro-screen { justify-content: flex-end; padding: 2rem 1.25rem 2.3rem; text-align: center; }
  .intro-sketch { height: 48%; object-position: 68% center; }
  .intro-screen::after { background: linear-gradient(0deg, var(--paper) 0 55%, rgba(251,247,239,.92) 66%, rgba(251,247,239,0) 88%); }
  .intro-content { width: 100%; padding-top: 39vh; }
  .kopitiam-mark { width: 4.5rem; height: 4.5rem; margin: 0 auto .7rem; font-size: 1.2rem; }
  .brand-name { margin-bottom: .7rem; }
  .intro-screen h1 { font-size: clamp(2.9rem, 13.5vw, 4.1rem); }
  .intro-screen .lede { margin: 1rem auto; font-size: .9rem; }
  .promise { justify-content: center; gap: .45rem; margin-bottom: 1.2rem; font-size: .61rem; }
  .plate-dock { grid-template-columns: 42% 1fr; gap: .8rem; padding: .8rem; }
  .plate { border-width: 7px; }
  .order-copy .primary-button { width: 100%; padding-inline: .7rem; font-size: .78rem; }
  .order-copy > p:not(.eyebrow) { min-height: 3rem; font-size: 1.15rem; }
  .trait { grid-template-columns: 6.2rem 1fr; }
  .result-screen h2 { font-size: clamp(2.9rem, 12vw, 4rem); }
  .rice-options { grid-template-columns: repeat(6, 1fr); }
  .rice-options .ritual-choice { grid-column: span 2; }
  .rice-options .ritual-choice:nth-last-child(-n+2) { grid-column: span 3; }
  .gravy-options { grid-template-columns: repeat(2, 1fr); }
  .stallholder-encounter .hawker-bubble { right: 3%; max-width: 86%; }
  .missing-start { grid-template-columns: 1fr; }
  .counterfactual-options { grid-template-columns: 1fr; }
  .choice-card-medium { min-height: 4.25rem; }
  .stallholder-verdict blockquote { right: -.2rem; }
  .ritual-choice { min-height: 8.5rem; }
  .queue-card { padding: 1.2rem; }
  .counter-nav { padding-inline: .7rem; }
  .counter-arrow { font-size: .72rem; }
}

.consent-dialog { width:min(560px,calc(100% - 2rem)); padding:0; border:1px solid var(--line); border-radius:var(--radius); color:var(--ink); background:var(--paper); box-shadow:var(--shadow-press-lg); }
.consent-dialog::backdrop { background:rgba(37,35,31,.72); }
.consent-dialog form { padding:clamp(1.5rem,5vw,2.75rem); }
.consent-dialog h2,.calibration-card h2 { margin:.5rem 0 1rem; font-family:"Instrument Serif",serif; font-size:clamp(2.2rem,6vw,3.5rem); font-weight:400; line-height:.96; }
.paper-stamp { width:max-content; margin:0 0 1.3rem; padding:.35rem .55rem; border:1px solid var(--red); color:var(--red); font-size:.64rem; font-weight:700; letter-spacing:.12em; transform:rotate(-1deg); }
.consent-points { display:grid; gap:.55rem; margin:1.25rem 0 1.5rem; font-size:.9rem; }
.consent-points span::before { content:"✓"; margin-right:.55rem; color:var(--red); font-weight:700; }
.form-error { min-height:1.2em; color:var(--error); font-size:.85rem; }
.recovery-note { position:fixed; z-index:30; right:1rem; bottom:1rem; display:grid; grid-template-columns:auto auto; gap:.1rem .65rem; align-items:center; padding:.7rem .9rem; border:1px solid var(--line); border-radius:var(--radius); color:var(--ink); background:var(--paper); box-shadow:var(--shadow-press); font-size:.75rem; }
.recovery-note[hidden] { display:none; }
.recovery-note span { color:var(--muted); }
.recovery-note strong { grid-row:2; letter-spacing:.12em; }
.recovery-note button { grid-row:1/3; grid-column:2; padding:.4rem .2rem .4rem .75rem; border:0; border-left:1px solid var(--line); color:inherit; background:none; cursor:pointer; }
.calibration-screen { min-height:100svh; padding:clamp(1rem,5vw,4rem); place-items:center; background:radial-gradient(circle at 75% 10%,rgba(189,133,47,.12),transparent 30%),var(--parchment); }
.calibration-card { position:relative; width:min(720px,100%); padding:clamp(1.5rem,5vw,3rem); border:1px solid var(--line); border-radius:var(--radius); background:var(--paper); box-shadow:var(--shadow-press-lg); }
.calibration-card::before { content:""; position:absolute; top:0; left:1.25rem; width:4.5rem; height:4px; background:var(--red); }
.calibration-card[hidden] { display:none; }
.calibration-card .primary-button { width:100%; margin-top:1.25rem; }
.calibration-card>.text-button { display:block; margin:1.1rem auto 0; }
.research-boundary { display:grid; gap:.25rem; margin:1.5rem 0 .5rem; padding:1rem; border-left:4px solid var(--ochre); background:var(--parchment); font-size:.9rem; }
.research-boundary span { color:var(--muted); }
.research-progress { display:flex; align-items:center; gap:.55rem; margin:0 0 2rem; color:var(--muted); font-size:.68rem; font-weight:700; letter-spacing:.04em; }
.research-progress i { flex:1; height:1px; background:var(--line); }
.research-progress span.is-current { color:var(--red); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin:1.5rem 0; }
.form-grid label { display:grid; grid-template-rows:minmax(2.65rem,auto) 3.5rem; align-content:start; gap:.4rem; font-weight:600; font-size:.86rem; }
.form-grid select { width:100%; height:3.5rem; padding:.8rem; border:1px solid var(--line); border-radius:var(--radius); color:var(--ink); background:white; font:inherit; }
.form-grid select:focus-visible,.prior-results select:focus-visible,.prior-results input:focus-visible { outline:3px solid var(--ochre); outline-offset:2px; }
.prior-results { margin-top:1.5rem; padding:1.1rem; border:1px solid var(--line); background:white; }
.prior-results .question-block { margin-bottom:1rem; padding:0; border:0; background:transparent; }
.prior-results>label,.colour-result-row label,.prior-context-row label { display:grid; gap:.4rem; margin-top:.8rem; font-size:.82rem; font-weight:600; }
.prior-results select,.prior-results input { width:100%; height:3.5rem; min-width:0; padding:.75rem; border:1px solid var(--line); border-radius:var(--radius); color:var(--ink); background:var(--paper); font:inherit; }
.colour-result-row,.prior-context-row { display:grid; grid-template-columns:1fr 1fr; gap:.8rem; }
.assessment-progress { display:flex; align-items:center; gap:1rem; margin-bottom:1.5rem; color:var(--muted); font-size:.8rem; }
.assessment-progress i { flex:1; height:5px; overflow:hidden; background:var(--line); }
.assessment-progress b { display:block; width:5%; height:100%; background:var(--red); transition:width .25s ease; }
.assessment-card h2 { min-height:2em; display:flex; align-items:center; }
.scale-options { display:grid; gap:.55rem; margin:1.5rem 0; }
.scale-options .choice-card { width:100%; }
.scale-options b { display:grid; width:1.8rem; height:1.8rem; flex:0 0 auto; place-items:center; border-radius:50%; background:var(--parchment); }
.scale-options .is-selected b { color:white; background:var(--red); }
.assessment-back { display:block; margin:.25rem auto 0; }
.assessment-back[hidden] { display:none; }
.result-error { margin-top:2rem; }

@media (max-width:560px) {
  .form-grid { grid-template-columns:1fr; }
  .form-grid label { grid-template-rows:auto 3.5rem; }
  .colour-result-row,.prior-context-row { grid-template-columns:1fr; }
  .calibration-screen { padding:.75rem; align-items:start; }
  .calibration-card { padding:1.35rem; }
  .recovery-note { right:.65rem; bottom:.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
