/* ─────────────────────────────────────────────────────────────
   face.css · Face the critic (reworked 2026-11-22)
   Standalone sheet for test-face-the-critic.html. The site's faces (Erode, iA Writer Mono, the
   hand of Girl Next Door) and its ground: black, cream, one red, the turmeric of the critic tags.
   The game draws on one canvas; this sheet places the few things around it.
   ───────────────────────────────────────────────────────────── */
@font-face { font-family:'Erode'; src:url('../fonts/Erode-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'iA Writer Mono'; src:url('../fonts/iAWriterMonoS-Regular.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Girl Next Door'; src:url('../fonts/TheGirlNextDoor-Regular.woff2') format('woff2'); font-weight:400 700; font-style:normal; font-display:block; size-adjust:85%; }

:root {
  --display: 'Erode', Georgia, serif;
  --mono:    'iA Writer Mono', ui-monospace, Menlo, monospace;
  --hand:    'Girl Next Door', 'Bradley Hand', 'Marker Felt', cursive;
  --paper: #FCFCFA;
  --ink:   #111110;
  --muted: #8A867D;
  --red:   #E03A1F;
  --black: #0B0B0A;
  --cream: #F4EFE2;
  --tur:   #E3A72F;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  /* set by js/face.js from the layout */
  --say-top: 60vh; --say-h: 120px; --strip-y: 46px; --slot: 44px; --demon-top: 110px;
}

html, body { margin:0; padding:0; }
body { background:var(--black); color:var(--cream); font-family:var(--mono); -webkit-font-smoothing:antialiased; -webkit-text-size-adjust:100%; }
[hidden] { display:none !important; }
.sr { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.dot { color:var(--red); }
.nos { padding:40px 20px; font:400 13px/1.6 var(--mono); }

/* ── Kids: shut ── */
body.kids { background:var(--paper); color:var(--ink); }
#closed { max-width:34rem; margin:0 auto; padding:clamp(48px,14vh,140px) 20px; }
#closed h1 { margin:0 0 20px; font:400 clamp(2.4rem,7vw,4rem)/1 var(--display); letter-spacing:-.01em; }
#closed .k { margin:0 0 14px; font:400 10px/1 var(--mono); letter-spacing:.18em; text-transform:uppercase; color:var(--muted); }
#closed .p { margin:0 0 22px; font:400 13px/1.6 var(--mono); }
#closed .l a { font:400 11px/1 var(--mono); letter-spacing:.16em; text-transform:uppercase; color:var(--ink); }

/* ── the game: one black room ── */
#game { position:fixed; inset:0; overflow:hidden; background:var(--black); -webkit-user-select:none; user-select:none; -webkit-tap-highlight-color:transparent; -webkit-touch-callout:none; }
#cv { position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; outline:none; cursor:default; }
#cv:focus-visible { box-shadow:inset 0 0 0 2px var(--red); }

/* the bar: leave, the critic's name, show me again, sound */
.bar { position:absolute; z-index:4; left:0; right:0; top:var(--sat); height:44px; display:flex; align-items:center; justify-content:space-between; padding:0 calc(4px + var(--sar)) 0 calc(4px + var(--sal)); pointer-events:none; }
.bar .r { display:flex; gap:2px; }
.tb { all:unset; pointer-events:auto; box-sizing:border-box; min-width:44px; height:44px; padding:0 12px; display:inline-grid; place-items:center; font:400 10px/1 var(--mono); letter-spacing:.16em; text-transform:uppercase; color:var(--muted); cursor:pointer; border-radius:2px; position:relative; }
.tb.sq { padding:0; font-size:15px; letter-spacing:0; }
.tb:hover { color:var(--cream); }
.tb:focus-visible, #six button:focus-visible { outline:2px solid var(--cream); outline-offset:-4px; color:var(--cream); }
#leave.cue { color:var(--cream); }
#leave.cue::after { content:''; position:absolute; inset:6px 2px; border:1px solid var(--red); border-radius:2px; animation:faceCue 1s ease-in-out infinite; }
@keyframes faceCue { 50% { opacity:.25; transform:scale(1.06); } }
.bar .tag { position:absolute; left:50%; top:9px; transform:translateX(-50%) rotate(-3deg); max-width:44vw; overflow:hidden; text-overflow:ellipsis; }
.tag { display:inline-block; background:var(--tur); color:#191815; font:400 1.05rem/1 var(--hand); padding:.3em .6em .38em; white-space:nowrap; transition:opacity .4s ease; }
.tag:empty { opacity:0; }

/* the six: a row under the bar; in between faces it comes down to the middle of the room */
#six { position:absolute; z-index:3; left:0; right:0; top:var(--strip-y); margin:0; padding:0; list-style:none; display:flex; justify-content:center; gap:6px; transition:top .6s cubic-bezier(.3,.1,.2,1), gap .6s ease; }
#six li { margin:0; padding:0; }
#six button { all:unset; position:relative; box-sizing:border-box; display:block; width:var(--slot); height:calc(var(--slot) * 1.18); cursor:pointer; border-radius:3px; transition:width .6s cubic-bezier(.3,.1,.2,1), height .6s cubic-bezier(.3,.1,.2,1); }
#six canvas { display:block; width:100%; height:100%; image-rendering:pixelated; }
#six button::after { content:''; position:absolute; left:50%; bottom:-6px; width:4px; height:4px; margin-left:-2px; background:transparent; }
#six button.cur::after { width:14px; margin-left:-7px; height:2px; background:var(--cream); }
#six button.ran::after { background:var(--red); border-radius:50%; }
#six button.cur.ran::after { width:14px; margin-left:-7px; height:2px; border-radius:0; background:var(--red); }
#six button.nudge { animation:faceNudge .3s ease 1; }
@keyframes faceNudge { 25% { transform:translateX(-3px); } 75% { transform:translateX(3px); } }
body.rest #six { top:calc(50% - var(--slot) * 0.75); gap:10px; flex-wrap:wrap; padding:0 16px; }
body.rest #six button { width:calc(var(--slot) * 1.7); height:calc(var(--slot) * 2); }

/* the line: in quotation marks, "to me" under it, as the site shows every critic line */
#say { position:absolute; z-index:2; left:50%; top:var(--say-top); width:min(560px, calc(100% - 32px - var(--sal) - var(--sar))); height:var(--say-h); transform:translateX(-50%); display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; pointer-events:none; transition:opacity .5s ease; }
#say.out { opacity:0; transition-duration:1s; }
.q { margin:0; max-width:100%; font:400 20px/1.16 var(--hand); color:var(--cream); overflow-wrap:break-word; text-shadow:0 0 6px var(--black), 0 0 2px var(--black); }
.q .b { visibility:hidden; }
.q .w { transition:opacity .25s ease, color .4s ease; }
.q .w.gone { opacity:.32; }
#say.loud .q { color:#FFD9CF; }
#say.still .q { color:var(--cream); opacity:.9; }
.to { display:block; margin-top:.45em; font:normal 400 13px/1 var(--hand); color:var(--tur); opacity:0; transition:opacity .4s ease; text-shadow:0 0 4px var(--black); }
.to.on { opacity:.9; }

.err { position:absolute; left:16px; right:16px; top:40%; text-align:center; font:400 12px/1.6 var(--mono); color:var(--muted); }

@media (prefers-reduced-motion: reduce) {
  #six, #six button, #say, .q .w, .to, .tag { transition:none; }
  #leave.cue::after, #six button.nudge { animation:none; }
}
@media print { #game { display:none !important; } }
