/* ==========================================================================
   Face Off — styles. Theme tokens and shared components come from
   shared/style.css; the drawing pad is Who's Picasso?'s (picasso/pad.js), so
   its few pc- classes are repeated here.

   The board is a grid of faces, four across, each with its name; a face
   flipped down goes grey and small. The players along the top double as the
   tabs between the boards kept for each opponent.
   ========================================================================== */

.fo { display: grid; gap: .8rem; max-width: 30rem; margin-inline: auto; padding-block: .5rem 2rem; }
.fo-title { font-size: clamp(1.6rem, 7vw, 2.2rem); text-align: center; }
.fo-sub { font-size: 1.2rem; text-align: center; }
.fo-note { font-size: 1.02rem; font-weight: 700; text-align: center; }
.fo-center { text-align: center; }
.fo-center-btn { justify-self: center; }
.fo-sent { font-size: 1.15rem; font-weight: 900; text-align: center; color: var(--olive); }
:root[data-theme="dark"] .fo-sent { color: #b7cc6a; }
.fo-top { display: flex; align-items: center; gap: .6rem; }
.fo-top > .clock { margin-inline-start: auto; }
.fo-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

/* ---------- Menu ---------- */

.fo-menu { display: grid; gap: .5rem; }
.fo-menu__art { font-size: 1.8rem; text-align: center; }
.fo-tagline { font-size: 1.1rem; font-weight: 700; text-align: center; }
.howto { max-width: 30rem; margin: 1.5rem auto 0; padding: .25rem 1rem; }
.howto summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.howto ol { display: grid; gap: .5rem; padding: 0 0 1rem; padding-inline-start: 1.4rem; list-style: decimal; }
.host--small .host__teta { width: 76px; }
.host--small .bubble { padding: .65rem .9rem; font-weight: 700; }

/* ---------- The drawing pad (as in Who's Picasso?) ---------- */

.pc-art { display: block; width: 100%; aspect-ratio: 1; background: #fffdf7; border: 4px solid var(--line); border-radius: 14px 16px 13px 17px; touch-action: none; }
.pc-padbox { display: grid; gap: .6rem; }
.pc-padframe { position: relative; }
.pc-pad { cursor: crosshair; box-shadow: 0 6px 0 var(--line); }
.pc-pad.is-locked { cursor: default; }
.pc-colours { display: flex; justify-content: center; gap: .6rem; }
.pc-colour { width: 46px; height: 46px; background: var(--c); border: 3px solid var(--line); border-radius: 50%; cursor: pointer; }
.pc-colour.is-on { outline: 4px solid var(--sun); outline-offset: 2px; }

/* Face Off's pad: a see-through canvas over the ready-made head and shoulders, with smaller colour buttons. */
.fo-pad .pc-padframe { border-radius: 14px 16px 13px 17px; }
.fo-pad .pc-art { position: relative; background: transparent; }
.fo-padback { position: absolute; inset: 4px; overflow: hidden; border-radius: 10px 12px 9px 13px; pointer-events: none; }
.fo-padback svg, .fo-art--drawn svg { display: block; width: 100%; height: 100%; }
/* The pen's colours above the drawing, where a phone shows them, under the skin tones; each row labelled. */
.fo-pad .pc-padbox { display: flex; flex-direction: column-reverse; }
.fo-pad .pc-colours, .fo-skins { display: flex; align-items: center; justify-content: center; gap: .35rem; }
.fo-pad .pc-colours::before, .fo-skins::before { content: attr(data-label); min-width: 3.2rem; font-size: .85rem; font-weight: 800; color: var(--muted); }
.fo-pad .pc-colour { width: 31px; height: 31px; flex: none; border-width: 2.5px; }
.fo-skin { width: 34px; height: 34px; flex: none; background: var(--c); border: 3px solid var(--line); border-radius: 50%; cursor: pointer; }
.fo-skin.is-on { outline: 4px solid var(--sun); outline-offset: 2px; }

/* ---------- Players, my person ---------- */

.fo-players { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: thin; }
.fo-player { display: grid; justify-items: center; gap: .05rem; flex: none; min-width: 4.4rem; padding: .35rem .5rem; font: inherit; color: var(--text); background: var(--surface); border: 3px solid var(--line); border-radius: 14px 16px 13px 17px; cursor: pointer; }
.fo-player:disabled { cursor: default; opacity: 1; }
.fo-player.is-on { background: var(--sun); color: var(--ink); }
.fo-player.is-turn { box-shadow: 0 0 0 3px var(--tomato); }
.fo-player.is-away { opacity: .5; }
.fo-player__face { font-size: 1.4rem; line-height: 1; }
.fo-player__name { max-width: 5.5rem; overflow: hidden; font-size: .85rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.fo-player b { font-size: .85rem; }

.fo-secret { display: flex; align-items: center; gap: .7rem; padding: .45rem .7rem; background: var(--surface-2); border: 3px solid var(--line); border-radius: 16px 14px 18px 13px; }
.fo-secret__art { width: 3.4rem; flex: none; }
.fo-secret small { display: block; font-weight: 800; color: var(--muted); }
.fo-secret__name { font-size: 1.2rem; font-weight: 900; }

/* ---------- Asking and answering ---------- */

.fo-ask { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.fo-input { min-width: 0; min-height: var(--tap); padding: .5rem .8rem; font: inherit; font-weight: 700; color: var(--text); background: var(--surface); border: 3px solid var(--line); border-radius: 14px; }
.fo-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.fo-question { display: grid; justify-items: center; gap: .2rem; padding: .9rem 1rem; text-align: center; background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 0 var(--line); }
.fo-question small { font-weight: 800; color: var(--muted); }
.fo-question__text { font-size: clamp(1.2rem, 5.5vw, 1.6rem); font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.fo-yesno { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.fo-yesno__yes { --btn-bg: var(--olive); --btn-fg: #fff; }
.fo-yesno__no { --btn-bg: var(--tomato); --btn-fg: #fff; }
.fo-yesno__unsure { grid-column: 1 / -1; }

.fo-last { display: grid; gap: .3rem; padding: .6rem .8rem; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; }
.fo-last > small { font-weight: 800; color: var(--muted); }
.fo-last p { font-weight: 800; overflow-wrap: anywhere; }
.fo-last__q { display: grid; }
.fo-last__q small { font-weight: 700; color: var(--muted); }
.fo-last.is-right { border-color: var(--olive); }
.fo-last.is-wrong { border-color: var(--tomato); }
.fo-answers { display: flex; flex-wrap: wrap; gap: .35rem; }
.fo-answer { display: flex; align-items: center; gap: .3rem; padding: .2rem .6rem; font-size: .9rem; background: var(--surface-2); border-radius: 999px; }
.fo-answer bdi { max-width: 6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.fo-answer.is-yes { background: color-mix(in srgb, var(--olive) 30%, var(--surface-2)); }
.fo-answer.is-no { background: color-mix(in srgb, var(--tomato) 30%, var(--surface-2)); }

/* ---------- The board ---------- */

.fo-board-box { display: grid; gap: .5rem; }
.fo-board__title { display: grid; text-align: center; }
.fo-board__title small { font-weight: 700; color: var(--muted); }
.fo-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.fo-face { display: grid; gap: .15rem; min-width: 0; padding: .25rem; font: inherit; color: var(--text); background: var(--surface); border: 3px solid var(--line); border-radius: 12px 14px 11px 15px; cursor: pointer; transition: transform .15s, opacity .15s, filter .15s; }
.fo-face:disabled { cursor: default; opacity: 1; }
.fo-face:not(:disabled):active { transform: scale(.95); }
.fo-face.is-drawn { border-color: var(--sea); }
:root[data-theme="dark"] .fo-face.is-drawn { border-color: #7cc8ea; }
.fo-face.is-down { opacity: .35; filter: grayscale(1); transform: scale(.9); }
.fo-face.is-guess { outline: 4px solid var(--tomato); outline-offset: 2px; }
.fo-face__name { overflow: hidden; font-size: .78rem; font-weight: 800; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.fo-art { display: block; width: 100%; aspect-ratio: 1; overflow: hidden; background: #fffdf7; border-radius: 8px; }
.fo-art svg { display: block; width: 100%; height: 100%; }
.fo-art--drawn { position: relative; }
.fo-art--drawn canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.fo-history ol { display: grid; gap: .5rem; padding: 0 0 .8rem; padding-inline-start: 1.2rem; }
.fo-history summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.fo-history { padding: .1rem 1rem; }
.fo-history p { font-weight: 800; overflow-wrap: anywhere; }

/* ---------- The end ---------- */

.fo-reveal { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .6rem; }
.fo-reveal__one { display: grid; gap: .25rem; text-align: center; }
.fo-reveal__one p { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fo-bonus { font-weight: 800; color: var(--olive); }
:root[data-theme="dark"] .fo-bonus { color: #b7cc6a; }
