/* Mendable Circle: Mendable paper and gold over a sharp nature photograph. */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-weight: var(--fw-body); color: var(--text); background: #1d2326; font-size: var(--fs-body); line-height: var(--lh); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--neon); outline-offset: 2px; }
.hidden, [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ic { display: block; flex: none; }
.ic-slot { display: inline-flex; vertical-align: -4px; }

/* ---------- background: a sharp photograph, gently dimmed and vignetted, never blurred ---------- */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #2a3236; }
#bg .photo { position: absolute; inset: -2%; background-size: cover; background-position: center; transition: opacity .9s var(--ease); }
#bg[data-bg="rain"] .photo { background-image: image-set(url(../assets/bg/rain-window-1280.jpg) 1x, url(../assets/bg/rain-window.jpg) 2x); }
#bg[data-bg="forest"] .photo { background-image: image-set(url(../assets/bg/forest-canopy-1280.jpg) 1x, url(../assets/bg/forest-canopy.jpg) 2x); }
#bg[data-bg="water"] .photo { background-image: image-set(url(../assets/bg/water-stones-1280.jpg) 1x, url(../assets/bg/water-stones.jpg) 2x); }
#bg[data-bg="meadow"] .photo { background-image: image-set(url(../assets/bg/meadow-dusk-1280.jpg) 1x, url(../assets/bg/meadow-dusk.jpg) 2x); }
@media (min-width: 1100px) {
  #bg[data-bg="rain"] .photo { background-image: url(../assets/bg/rain-window.jpg); }
  #bg[data-bg="forest"] .photo { background-image: url(../assets/bg/forest-canopy.jpg); }
  #bg[data-bg="water"] .photo { background-image: url(../assets/bg/water-stones.jpg); }
  #bg[data-bg="meadow"] .photo { background-image: url(../assets/bg/meadow-dusk.jpg); }
}
#bg::after { content: ''; position: absolute; inset: 0; background: var(--vignette), linear-gradient(var(--photo-dim), var(--photo-dim)); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { #bg .photo { animation: drift 90s ease-in-out infinite alternate; } }
@keyframes drift { to { transform: scale(1.035) translate(-.6%, -.4%); } }

/* ---------- frosted paper: the only blur is inside panels ---------- */
.glass, .card, #panel, #topbar .tools, .phasebar, .seat .name, #seamCap, .overlay .card {
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.15); backdrop-filter: blur(var(--glass-blur)) saturate(1.15);
  box-shadow: var(--shadow-2);
}

/* ---------- top bar ---------- */
#topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; gap: 10px; align-items: center; padding: 10px var(--gutter); padding-top: max(10px, env(safe-area-inset-top)); }
#topbar .brand { margin-right: auto; display: flex; gap: 8px; align-items: center; font-size: 17px; font-weight: 700; color: var(--on-photo); text-shadow: 0 1px 8px rgba(0,0,0,.45); white-space: nowrap; }
#topbar .brand b { font-weight: 800; }
#brandglyph svg { display: block; filter: drop-shadow(0 1px 4px rgba(0,0,0,.4)); }
#topbar .tools { display: flex; gap: 4px; align-items: center; padding: 4px; border-radius: var(--r-pill); }
.tbtn, .ibtn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; border-radius: var(--r-pill); padding: 7px 12px; font-size: 14px; font-weight: 700; color: var(--text); transition: background var(--dur-2) var(--ease); min-height: 38px; }
.ibtn { padding: 7px; width: 38px; justify-content: center; }
.tbtn:hover, .ibtn:hover { background: var(--hover); }
.tbtn.real { background: var(--neon); color: var(--on-neon); box-shadow: 0 2px 0 var(--neon-d); }
.tbtn.real:hover { background: #FFD24A; }
.tbtn.quiet { color: var(--muted); }
.ibtn[aria-pressed="true"] { color: var(--text); }
.ibtn[aria-pressed="false"] { color: var(--muted); }
.vol { display: flex; align-items: center; }
.vol input { width: 76px; accent-color: var(--neon-d); }
@media (max-width: 760px) { .tbtn .lbl { display: none; } .tbtn { padding: 7px 9px; } .vol input { display: none; } #topbar .brand > span:last-child { display: none; } }

/* ---------- layout and cards (Mendable paper) ---------- */
main { padding: 76px var(--gutter) 28px; max-width: 1120px; margin: 0 auto; min-height: 100vh; }
.card { border-radius: var(--r-panel); padding: 26px 28px; max-width: 600px; margin: 18px auto; position: relative; }
.card h1, .card h2 { font-size: var(--fs-title); font-weight: 800; margin: 0 0 6px; line-height: 1.2; letter-spacing: -.01em; }
.card h2 { font-size: 21px; }
.card p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-14); }
.eyebrow { font-size: var(--fs-eyebrow); line-height: var(--lh-eyebrow); letter-spacing: var(--tr-eyebrow); text-transform: uppercase; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.eyebrow.red { color: var(--lacquer); font-size: 13px; letter-spacing: .07em; margin-top: 18px; }
.hero-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.hero-head > div:nth-child(2) { flex: 1; }
.hero-vase { width: 72px; flex: none; filter: var(--paper-drop); }
.hero-vase svg { width: 72px; height: auto; display: block; }
.hero-ic { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 16px; background: var(--raised); color: var(--text); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.row.cta { margin: 18px 0 10px; }
.row.toggles { margin-top: 12px; }
.spendline { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }
.linkbtn { display: inline-flex; gap: 6px; align-items: center; margin: 8px auto 0; background: none; border: 0; color: var(--muted); font-size: 13px; font-weight: 700; padding: 4px 6px; border-radius: 8px; }
.linkbtn:hover { color: var(--text); background: var(--hover); }
#scrStart .card { text-align: left; }
#scrStart .linkbtn { display: flex; }

/* buttons: Mendable chunky paper, one gold */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; background: var(--card); color: var(--text); border: 1px solid var(--hair); border-radius: var(--r-btn); padding: 9px 18px; font-size: 15px; font-weight: 700; box-shadow: 0 2px 0 var(--hair); transition: transform var(--dur-1) var(--ease), background var(--dur-2) var(--ease); }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--hair); }
.btn.primary { background: var(--neon); color: var(--on-neon); border-color: var(--neon-d); box-shadow: 0 3px 0 var(--neon-d); }
.btn.primary:hover { background: #FFD24A; }
.btn:disabled { background: var(--disabled); color: var(--disabled-text); border-color: var(--disabled); box-shadow: none; cursor: not-allowed; transform: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-pill); padding: 7px 14px; font-size: 14px; font-weight: 700; min-height: 38px; }
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"] { border-color: var(--neon-d); box-shadow: inset 0 0 0 1px var(--neon-d); background: var(--gold-l); }

/* start: role seats and scenes */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0; }
.role { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 12px 8px 10px; text-align: center; font-size: 15px; font-weight: 800; box-shadow: 0 2px 0 var(--hair); display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform var(--dur-2) var(--ease-gentle); }
.role small { font-weight: 600; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.worlds { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip.world { flex-direction: column; align-items: flex-start; gap: 0; border-radius: var(--r-card); padding: 7px 14px; line-height: 1.2; }
.chip.world small { font-weight: 600; color: var(--muted); font-size: 12px; }
.role .portrait { display: block; width: 64px; height: 64px; border-radius: 50%; background: var(--raised); }
.role:hover { transform: translateY(-2px); }
.role[aria-pressed="true"] { border-color: var(--neon-d); box-shadow: 0 0 0 2px var(--neon), 0 3px 0 var(--neon-d); }
.scenes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.scene { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; border: 0; padding: 0; overflow: hidden; background-size: cover; background-position: center; box-shadow: 0 2px 0 var(--hair); }
.scene span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-size: 12px; font-weight: 800; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.6)); line-height: 1.2; }
.scene[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--neon), 0 3px 0 var(--neon-d); }
@media (max-width: 520px) { .scenes { grid-template-columns: repeat(2, 1fr); } }

/* contract */
.rolecard { display: flex; gap: 14px; align-items: flex-start; background: var(--raised); border-radius: var(--r-card); padding: 12px 14px; margin: 6px 0 12px; }
.rolecard .eyebrow.red { margin-top: 0; }
.rolecard p { margin: 0 0 8px; }
.rolecard .portrait { width: 64px; height: 64px; border-radius: 50%; background: var(--card); }
ul.guides { margin: 0 0 12px; padding: 0; list-style: none; }
ul.guides li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--hair); font-weight: 600; }
ul.guides li:last-child { border-bottom: 0; }
ul.guides .ic-slot { color: var(--neon-d); }
.listen { background: var(--raised); }
.listen.playing { background: var(--neon); color: var(--on-neon); }
.hold { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; margin-top: 14px; background: var(--neon); color: var(--on-neon); border: 0; border-radius: var(--r-btn); padding: 10px 20px 10px 10px; min-height: 60px; font-weight: 800; font-size: 16px; box-shadow: 0 3px 0 var(--neon-d); user-select: none; -webkit-user-select: none; touch-action: none; }
.hold svg { width: 42px; height: 42px; transform: rotate(-90deg); }
.hold .ring { fill: none; stroke: var(--on-neon); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; }
.hold .track { fill: none; stroke: rgba(36,40,44,.18); stroke-width: 4; }
.hold:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--neon-d); }
.hold.done { animation: pop .5s var(--ease-gentle); }
@keyframes pop { 50% { transform: scale(1.03); } }
.fadeout { animation: fade .6s forwards; }
@keyframes fade { to { opacity: 0; transform: translateY(-6px); } }

/* breath */
.breathcard { text-align: center; max-width: 420px; }
.breath { width: 150px; height: 150px; margin: 22px auto; border-radius: 50%; border: 3px solid var(--neon); box-shadow: 0 0 24px var(--neon-glow), inset 0 0 18px var(--neon-wash); transform: scale(.68); }
.breath.in { transition: transform 4s ease-in-out; transform: scale(1); }
.breath.out { transition: transform 6s ease-in-out; transform: scale(.68); }

/* ---------- circle: a ring of seats around the kintsugi vessel ---------- */
.phasebar { display: flex; gap: 12px; align-items: center; justify-content: center; width: max-content; max-width: 100%; margin: 0 auto 6px; padding: 6px 14px 6px 8px; border-radius: var(--r-pill); }
.phase-tag { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 800; }
.phase-tag .pic { width: 30px; height: 30px; border-radius: 50%; background: var(--neon); color: var(--on-neon); display: grid; place-items: center; }
.phase-dots { display: flex; gap: 5px; }
.phase-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--t4); }
.phase-dots i.done { background: var(--neon-d); }
.phase-dots i.now { background: var(--neon); box-shadow: 0 0 0 3px var(--neon-wash); }
.phase-change .phasebar { animation: pop .6s var(--ease-gentle); }

#stage { position: relative; width: 100%; max-width: min(760px, calc((100vh - 76px - 30vh - 200px) * 1.5)); min-width: min(100%, 420px); aspect-ratio: 1.5; margin: 0 auto; }
#mat { position: absolute; left: 50%; top: 50%; width: 80%; height: 72%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(ellipse at center, rgba(255,255,255,.20), rgba(255,255,255,.06) 60%, transparent 72%); border: 1.5px solid rgba(255,255,255,.38); box-shadow: 0 0 0 1px rgba(0,0,0,.05) inset; }
#center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); filter: drop-shadow(0 10px 18px rgba(0,0,0,.35)); }
#center svg { display: block; }
#center.mend { animation: mend 1.4s var(--ease-gentle); }
@keyframes mend { 30% { filter: drop-shadow(0 0 22px var(--neon-glow)) drop-shadow(0 10px 18px rgba(0,0,0,.35)); transform: translate(-50%, -54%) scale(1.06); } }
#seamCap { position: absolute; left: 50%; top: 82%; transform: translate(-50%, 0); padding: 6px 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; max-width: 92%; text-align: center; opacity: 0; pointer-events: none; transition: opacity .5s; z-index: 4; display: flex; gap: 6px; align-items: center; }
#seamCap.on { opacity: 1; }
#seamCap .ic { color: var(--neon-d); }
.seat { position: absolute; transform: translate(-50%, -50%); text-align: center; width: calc(var(--seat) + 44px); transition: transform .5s var(--ease), opacity .4s; z-index: 2; }
.seat .face { position: relative; width: var(--seat); height: var(--seat); margin: 0 auto; border-radius: 50%; background: var(--glass-strong); border: 3px solid var(--glass-line); overflow: hidden; display: grid; place-items: center; box-shadow: var(--shadow-2); transition: transform .4s var(--ease-gentle), box-shadow .4s, border-color .4s; }
.seat .face svg { width: 100%; height: 100%; display: block; }
.seat .face svg.swap { animation: swap .35s var(--ease); }
@keyframes swap { from { opacity: .3; transform: scale(.96); } }
.seat .name { display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; padding: 2px 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 800; white-space: nowrap; box-shadow: var(--shadow); }
.seat .name small { font-weight: 600; color: var(--muted); }
.seat.listening { opacity: .9; }
.seat.speaking { opacity: 1; }
.seat.speaking .face { border-color: var(--neon); box-shadow: 0 0 0 3px var(--neon-wash), 0 0 26px var(--neon-glow), var(--shadow-2); transform: scale(1.08); }
.seat.speaking .name { background: var(--neon); color: var(--on-neon); border-color: var(--neon-d); }
.seat.speaking .name small { color: var(--on-neon); }
.seat.you .face { border-color: var(--text); }
.seat .wave { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); display: none; gap: 3px; align-items: flex-end; height: 14px; padding: 3px 6px; border-radius: 99px; background: var(--neon); }
.seat .wave i { width: 3px; height: 4px; border-radius: 2px; background: var(--on-neon); animation: wave .9s ease-in-out infinite; }
.seat .wave i:nth-child(2) { animation-delay: .15s; } .seat .wave i:nth-child(3) { animation-delay: .3s; }
.seat.voicing .wave { display: flex; }
@keyframes wave { 50% { height: 9px; } }
.seat.nod .face { animation: nod .45s; }
@keyframes nod { 50% { transform: translateY(3px); } }
.seat .dots { position: absolute; top: -8px; right: 6px; background: var(--glass-strong); border-radius: 999px; padding: 2px 8px; display: flex; gap: 3px; box-shadow: var(--shadow); }
.seat .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite; }
.seat .dots i:nth-child(2) { animation-delay: .2s; } .seat .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 30% { transform: translateY(-3px); background: var(--text); } }
#stone { position: absolute; width: 34px; height: 34px; transform: translate(-50%, -50%); transition: left .7s var(--ease-gentle), top .7s var(--ease-gentle); z-index: 3; color: #D6D2CB; filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); }
#stone svg { width: 34px; height: 34px; }
#stone.moving { animation: hop .7s var(--ease); }
@keyframes hop { 50% { transform: translate(-50%, -80%) rotate(14deg) scale(1.1); } }
#stone.glow { filter: drop-shadow(0 0 10px var(--neon)) drop-shadow(0 3px 4px rgba(0,0,0,.45)); }

/* transcript panel */
#panel { border-radius: var(--r-panel); max-width: 780px; margin: 8px auto 0; padding: 14px 16px 10px; }
#transcript { max-height: 30vh; overflow-y: auto; padding-right: 4px; scroll-behavior: smooth; }
.line { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; }
/* NT-4.5: bubbles of one turn group together, name only on the first */
.line:has(+ .line.cont) { margin-bottom: 4px; }
.line.cont .av { height: 0; background: none; }
.line .av { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--raised); overflow: hidden; }
.line .av svg { width: 32px; height: 32px; display: block; }
.line .tx { flex: 1; min-width: 0; }
.line b { display: block; font-size: 13px; font-weight: 800; color: var(--muted); }
.line.you .tx { background: var(--gold-l); border-radius: 12px 4px 12px 12px; padding: 6px 10px; }
.line.you b { color: var(--text); }
.line.bc { font-size: 14px; color: var(--muted); }
.line.bc .av { width: 22px; height: 22px; } .line.bc .av svg { width: 22px; height: 22px; }
.line.pass { color: var(--muted); font-style: italic; }
.line.flash .tx { background: var(--neon-wash); border-radius: 8px; }
.w { opacity: 0; transition: opacity .25s; }
.w.on { opacity: 1; }
#composer { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
#composer textarea { flex: 1; resize: none; min-height: 46px; max-height: 120px; background: var(--glass-strong); color: var(--text); border: 1px solid var(--hair); border-radius: var(--r-btn); padding: 11px 12px; font: inherit; box-shadow: var(--inner); }
#composer textarea:disabled { opacity: .7; }
#composer textarea:not(:disabled) { border-color: var(--neon-d); box-shadow: 0 0 0 3px var(--neon-wash); }
.ibtn.mic { width: 46px; height: 46px; background: var(--card); border: 1px solid var(--hair); box-shadow: 0 2px 0 var(--hair); border-radius: var(--r-btn); color: var(--text); }
.ibtn.mic.is-listening { background: var(--lacquer); color: #fff; border-color: var(--lacquer-deep); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--lacquer-wash); } }
#cue { font-size: 14px; color: var(--muted); min-height: 20px; margin-top: 6px; font-weight: 600; }
#keeperchips { margin-top: 8px; }
@media (max-width: 520px) { #composer { flex-wrap: wrap; } #composer textarea { flex-basis: calc(100% - 54px); } #btnSay, #btnPass { flex: 1; } }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(10,12,14,.35); display: grid; place-items: center; padding: var(--gutter); overflow-y: auto; animation: ovIn .25s var(--ease); }
@keyframes ovIn { from { opacity: 0; } }
.overlay .card { margin: 0; width: 100%; background: var(--glass-strong); animation: cardIn .35s var(--ease-gentle); }
@keyframes cardIn { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.overlay .card.freeze { max-width: 620px; }
.freeze-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.freeze-head .fic { width: 44px; height: 44px; border-radius: 14px; background: var(--neon); color: var(--on-neon); display: grid; place-items: center; }
.opts { display: grid; gap: 8px; margin: 12px 0; }
.opt { text-align: left; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-btn); padding: 12px 14px; font-weight: 600; box-shadow: 0 2px 0 var(--hair); transition: transform var(--dur-1); }
.opt:hover:not(:disabled) { background: var(--hover); transform: translateY(-1px); }
.opt:disabled { cursor: default; color: var(--muted); }
.opt.right { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); box-shadow: 0 2px 0 var(--ok-line); }
.opt.wrong { border-color: var(--lacquer-line); background: var(--lacquer-wash); color: var(--lacquer-deep); }
.verdict { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 18px; margin: 4px 0 8px; }
.verdict.ok { color: var(--ok-ink); } .verdict.no { color: var(--lacquer); }
.anchor { display: flex; gap: 10px; align-items: center; background: var(--raised); border-radius: var(--r-card); padding: 10px; margin: 8px 0; border-left: 4px solid var(--neon); }
.anchor .portrait { width: 44px; height: 44px; border-radius: 50%; background: var(--card); flex: none; }
.credits-list { font-size: 13px; padding-left: 18px; }
.credits-list li { margin-bottom: 6px; }

/* debrief */
.debrief-card { max-width: 1000px !important; }
.debrief { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.vesselbox { text-align: center; background: var(--raised); border-radius: var(--r-card); padding: 14px; }
.vesselbox svg { display: block; margin: 0 auto; }
.legend { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; text-align: left; }
.legend li { display: flex; gap: 8px; align-items: center; padding: 4px 0; color: var(--muted); font-weight: 600; }
.legend li::before { content: ''; flex: none; width: 16px; height: 3px; border-radius: 2px; background: var(--t5); }
.legend li.done { color: var(--text); }
.legend li.done::before { background: var(--neon); box-shadow: 0 0 6px var(--neon-glow); }
.beh { border-bottom: 1px solid var(--hair); padding: 12px 0; }
.beh h3 { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.lid { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 10px; margin: 2px 4px 2px 0; border: 1px solid; }
.lid.e { color: var(--ok-ink); border-color: var(--ok-line); background: var(--ok-bg); }
.lid.l { color: var(--lacquer-deep); border-color: var(--lacquer-line); background: var(--lacquer-wash); }
.beh-yes, .beh-no { margin-top: 6px; }
.beh-no { border-left: 3px solid var(--lacquer-line); padding-left: 8px; }
.beh-no .small, .beh-yes .small { margin-bottom: 4px; }
details summary { cursor: pointer; font-weight: 800; padding: 8px 0; }
#dTrans .line { font-size: 14px; }
@media (max-width: 760px) { .debrief { grid-template-columns: 1fr; } }

/* stream (shares the card look) */
#scrStream .card .portrait { width: 96px; height: 96px; border-radius: 50%; background: var(--raised); }
.glyph { display: none; }

/* phone */
@media (max-width: 520px) {
  main { padding-top: 68px; }
  .card { padding: 20px 18px; }
  #stage { aspect-ratio: 1; margin: 18px auto 22px; max-width: none; min-width: 0; }
  #mat { width: 76%; height: 76%; }
  .seat .name { font-size: 12px; padding: 1px 8px; }
  .seat .name small { display: none; }
  #transcript { max-height: 30vh; }
  .hero-vase, .hero-vase svg { width: 56px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* wide screens: the ring on the left, the talk on the right */
@media (min-width: 1000px) {
  #scrCircle:not(.hidden) { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr); grid-template-rows: auto 1fr; column-gap: 24px; align-items: start; height: calc(100vh - 92px); }
  #scrCircle .phasebar { grid-column: 1; margin-bottom: 0; }
  #scrCircle #stage { grid-column: 1; grid-row: 2; aspect-ratio: 1; width: 100%; max-width: min(100%, calc(100vh - 170px)); min-width: 0; margin: 0 auto; align-self: center; }
  #scrCircle #panel { grid-column: 2; grid-row: 1 / 3; margin: 0; max-width: none; height: 100%; display: flex; flex-direction: column; }
  #scrCircle #transcript { flex: 1; max-height: none; }
  #mat { width: 78%; height: 78%; }
}

/* kintsugi seam flowing in (same motion as Mendable components.css) */
.vase .seam-flow { animation: seamIn 1600ms 400ms var(--ease-out) forwards; }
@keyframes seamIn { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .vase .seam-flow { animation: none !important; stroke-dashoffset: 0; } }
#stone, #stone svg { width: 40px; height: 40px; }
#stone { color: #E4E0D8; }
@media (max-width: 520px) {
  #scrCircle .phasebar { margin-bottom: 0; }
  #stage { max-width: 330px; margin: 6px auto 14px; --seat: 54px; }
  #stone, #stone svg { width: 30px; height: 30px; }
  #transcript { max-height: 27vh; }
}

/* H3 perspective accuracy and H8 ledger */
.persp{padding:12px 14px;border-radius:14px;background:var(--raised, rgba(255,255,255,.06));margin-bottom:12px}
.persp-n{font-size:30px;line-height:1.1;margin-bottom:8px}.persp-n b{display:inline-block;line-height:1.05;color:var(--text);font-size:40px;border-bottom:4px solid var(--gold);padding:0 4px}
.ledger{margin-bottom:12px}.lg-p{margin:8px 0}.lg-h{display:flex;align-items:center;gap:8px}
.ledger ul{margin:4px 0 0 34px;padding:0}.ledger li{margin:3px 0}.ledger li.done>span:first-child{font-weight:700}.ledger li.done::marker{color:var(--gold)}.ledger li::marker{color:var(--muted)}
.harmcard{margin-bottom:12px}.hc-p{margin:8px 0}.hc-cols{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:4px 0 0 34px}
.hc-k{font-size:12px;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.hc-cols ul{margin:2px 0 0 16px;padding:0}.hc-cols li{margin:3px 0}.hc-cols li.done>span:first-child{font-weight:700}.hc-cols li.done::marker{color:var(--gold)}
@media (max-width:560px){.hc-cols{grid-template-columns:1fr;margin-left:0}}
.tr-res{padding-left:18px}.tr-res li{margin:8px 0}.tr-res li.done::marker{color:var(--gold)}
#trSay{width:100%;box-sizing:border-box}
#trSay{resize:none;background:var(--glass-strong);color:var(--text);border:1px solid var(--neon-d);border-radius:var(--r-btn);padding:11px 12px;font:inherit;box-shadow:0 0 0 3px var(--neon-wash);margin:4px 0 10px}
.tr-line{display:flex;gap:10px;align-items:center;margin:6px 0 10px}
.mono{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:50%;font-weight:800;font-size:16px;color:#fff;background:hsl(var(--h) 22% 44%);box-shadow:inset 0 -3px 0 rgba(0,0,0,.18)}

/* H10 pass token: the piece rests by a seat that passed */
.seat .passTok { position: absolute; left: calc(50% + var(--seat) / 2 - 10px); top: 2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-strong); border: 2px solid var(--glass-line); box-shadow: var(--shadow); opacity: .85; animation: swap .35s var(--ease); }
/* H19 earned peer line in the closing round */
.line.reaccept .tx { border-left: 3px solid var(--neon); padding-left: 8px; }

/* H13: brief overlap. The cut-in sits tucked under the line it interrupts. */
.line.cutover .tx { opacity: .72; }
.line.cutover .tx::after { content: ''; display: inline-block; width: 1.4em; border-bottom: 2px dashed var(--muted); margin-left: 4px; vertical-align: middle; }
.line.overlap { margin-top: -10px; margin-left: 28px; }
.line.overlap .tx { border-left: 3px solid var(--lacquer); padding-left: 8px; font-weight: 700; }
#dExport .ic { vertical-align: -3px; margin-right: 4px; }

/* Print: the debrief on plain paper, no background photo, top bar or buttons */
@media print {
  #bg, #topbar, #overlay, #scrDebrief .btn, #scrDebrief .row:has(.btn) { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  .card, .debrief-card { background: #fff !important; box-shadow: none !important; backdrop-filter: none !important; border: 0 !important; }
  #scrDebrief .lid { border: 1px solid #999; }
  .beh, .card section { break-inside: avoid; }
}

/* study mode */
.role.locked, .role:disabled { opacity: .4; filter: grayscale(.6); cursor: not-allowed; }
.role.locked:hover { transform: none; }
#stuckBtn { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px); }
.study-sum { border: 1px solid var(--hair); border-radius: var(--r-card); padding: 14px 16px; margin: 10px 0 14px; background: var(--raised); }
.study-sum h2 { font-size: 18px; margin: 0 0 6px; }
.study-sum ul { margin: 4px 0 10px; padding-left: 1.2em; }
.study-sum li { margin: 3px 0; }
.study-cta { display: flex; justify-content: center; margin: 12px 0; }
.study-cta .btn { min-width: 240px; min-height: 52px; font-size: 17px; }

.seat .dots .dl { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; margin-right: 4px; }
.seat .dots { align-items: center; }
.study-card { border: 1px solid var(--hair, var(--t4)); border-radius: 14px; padding: 12px 14px; margin: 8px 0 12px; }
.study-card p { margin: 6px 0; }
.study-you { font-size: 17px; }
