* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #120d09; color: #f1e6cf; font-family: Georgia, "Times New Roman", serif; overflow: hidden; }
body { background: radial-gradient(ellipse at 50% 30%, #3b2d22 0%, #1d1510 55%, #0c0806 100%); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 2px, transparent 2px 9px); }
#wall { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#portrait { margin-bottom: 5vh; height: min(86vh, calc(100vw * 880 / 700)); aspect-ratio: 700 / 880; filter: drop-shadow(0 30px 40px rgba(0,0,0,.65)); }
.art { position: relative; width: 100%; height: 100%; }
.art svg { width: 100%; height: 100%; display: block; }
.art canvas.texture { position: absolute; left: 7.142857%; top: 6.818182%; width: 85.714286%; height: 86.363636%;
  mix-blend-mode: overlay; opacity: .7; pointer-events: none; }
#caption { position: fixed; left: 50%; bottom: 1.2vh; transform: translateX(-50%); width: min(780px, 92vw); text-align: center;
  font-style: italic; font-size: clamp(16px, 2.2vh, 24px); line-height: 1.35; color: #f6ead0; text-shadow: 0 2px 6px #000, 0 0 2px #000;
  min-height: 1.4em; transition: opacity .4s; pointer-events: none; }
#caption .who { font-style: normal; font-variant: small-caps; color: #e2c27a; margin-right: .4em; }
#caption.you { color: #bfd3e6; }
body.nocaptions #caption { display: none; }
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8,5,3,.72); z-index: 20; }
.card { background: #2a1f16; border: 2px solid #b8913f; border-radius: 10px; padding: 28px 34px; max-width: 520px; text-align: center; box-shadow: 0 20px 60px #000; }
.card h1 { margin: 0 0 10px; font-weight: normal; letter-spacing: 1px; color: #f0d68e; }
.card button, #controls button, #settings button { font: inherit; background: linear-gradient(#e9c66c, #a77a2c); color: #2a1a06; border: 1px solid #5a3d12; border-radius: 6px; padding: 10px 20px; cursor: pointer; }
.card button { font-size: 20px; margin: 10px 0; }
.small { font-size: 13px; opacity: .8; line-height: 1.6; }
kbd { background: #1a120c; border: 1px solid #6a5030; border-radius: 3px; padding: 0 5px; font-size: 12px; }
#controls { position: fixed; right: 18px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; z-index: 5; opacity: .35; transition: opacity .3s; }
#controls:hover, #controls:focus-within { opacity: 1; }
#controls form { display: flex; gap: 6px; }
#controls input { font: inherit; width: 300px; padding: 8px 10px; background: #1e1610; color: #f1e6cf; border: 1px solid #6a5030; border-radius: 6px; }
#micBtn.on { background: linear-gradient(#ff9b7a, #c0462a); color: #fff; }
body.nocontrols #controls { display: none; }
#settings { position: fixed; top: 16px; right: 16px; width: 330px; background: rgba(30,22,15,.96); border: 1px solid #b8913f; border-radius: 10px; padding: 14px 18px; z-index: 30; font-size: 14px; }
#settings h2 { margin: 0 0 10px; font-weight: normal; color: #f0d68e; font-size: 18px; }
#settings h2 small { font-size: 12px; opacity: .7; }
#settings label { display: block; margin: 9px 0; }
#settings label select, #settings label input[type=range], #settings label input[type=number] { display: block; width: 100%; margin-top: 3px; }
#settings label.row { display: flex; gap: 8px; align-items: center; }
#debug { position: fixed; left: 12px; top: 12px; z-index: 10; font: 12px/1.35 ui-monospace, Menlo, monospace; color: #9f9; background: rgba(0,0,0,.6); padding: 8px; border-radius: 6px; }
#debug .cam { position: relative; width: 240px; height: 180px; }
#debug video, #debug canvas { position: absolute; inset: 0; width: 240px; height: 180px; transform: scaleX(-1); }
#debug pre { margin: 6px 0 0; white-space: pre; }
#video { object-fit: cover; }
#debug.off { left: -10000px; }
