/* QINGO board screen — Quest Tiles structure (B) + Develop reveal (A). Uses tokens.css. */

/* ── board-screen header ── */
.qhead { display: flex; align-items: center; gap: 12px; margin: 6px 2px 12px; }
.qring { --p: 0; width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--amber) calc(var(--p) * 360deg), #e9eef4 0); }
.qring span { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; color: var(--navy); font-size: .78rem; line-height: 1; text-align: center; }
.qhead .htext { flex: 1; min-width: 0; }
.qhead .htitle { font-family: var(--font-display); font-weight: 800; color: var(--navy); font-size: 1.05rem; line-height: 1.1; }
.qhead .hsub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.qhead .hsub b { color: var(--amber-deep); font-weight: 700; }

/* ── the board: white frame provides the QR quiet zone (needed to scan) ── */
.qboard { position: relative; width: min(100%, 360px); margin: 0 auto; aspect-ratio: 1;
  background: #fff; border-radius: 18px; padding: 10%;
  box-shadow: inset 0 0 0 1px rgba(32, 65, 100, .05), 0 10px 30px rgba(32, 65, 100, .12); }
.qstage { position: relative; width: 100%; height: 100%; }
.qcanvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; border-radius: 2px; }
.qerr { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .85rem; }

/* ── 20 quest tiles overlaying the true QR ── */
.qtiles { position: absolute; inset: 0; }
.qtile { position: absolute; display: grid; place-items: center; }
.qtile > * { position: relative; z-index: 1; }
/* dormant face: an opaque tile inset a hair so tiles read as a grid */
.qtile:not(.lit):not(.developing)::after { content: ''; position: absolute; inset: 1.5px; border-radius: 5px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px rgba(32, 65, 100, .06); }
.qtile.social:not(.lit):not(.developing)::after { background: #f4f1ff; }
.qtile.oou:not(.lit):not(.developing)::after { background: #efeaff; box-shadow: inset 0 0 0 1.5px rgba(123, 92, 255, .55); }
.qtile.playable { cursor: pointer; }
.qtile.playable:not(.lit)::after { background: #fff; box-shadow: inset 0 0 0 1.6px var(--amber); }
.qtile.playable:active { transform: scale(.96); }

.qtile-ico { font-size: clamp(12px, 4.2vw, 20px); line-height: 1; filter: saturate(.9); }
.qtile-verb { font-size: clamp(6.5px, 1.9vw, 9.5px); font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; text-align: center; }
.qtile.oou .qtile-verb { color: var(--spark); }
.qtile.playable .qtile-verb { color: var(--amber-deep); }

/* lit tiles are fully transparent -> the true modules show through with NO gridlines,
   so a completed board is a clean, scannable QR. */
.qtile.lit { background: transparent; }

/* develop reveal (A): opaque face dissolves to reveal the QR modules, amber shimmer sweep */
.qtile.developing { animation: qdevelop .66s var(--ease-out) forwards; border-radius: 5px; overflow: hidden; }
@keyframes qdevelop { 0% { background: var(--surface-2); } 100% { background: transparent; } }
.qshimmer { position: absolute; inset: 0; overflow: hidden; }
.qshimmer::before { content: ''; position: absolute; top: -40%; left: -60%; width: 60%; height: 180%;
  transform: rotate(20deg); background: linear-gradient(90deg, transparent, rgba(255, 214, 140, .9), transparent);
  animation: qsweep .7s var(--ease-out) forwards; }
@keyframes qsweep { to { left: 130%; } }

/* ── always-on finder eyes (top layer, so it always reads as a QR) ── */
.qeye { position: absolute; width: 21.21%; height: 21.21%; z-index: 3; }   /* 7 / 33 */
.qeye.tl { top: 0; left: 0; } .qeye.tr { top: 0; right: 0; } .qeye.bl { bottom: 0; left: 0; }
.qeye-r { position: absolute; inset: 0; background: #0b1017; border-radius: 3px; }
.qeye-m { position: absolute; inset: 14.3%; background: #fff; border-radius: 2px; }
.qeye-c { position: absolute; inset: 28.6%; background: #0b1017; border-radius: 1.5px; }

/* subtle celebratory ring when the board is complete + scannable */
.qboard.complete { box-shadow: inset 0 0 0 1px rgba(32, 65, 100, .05), 0 10px 30px rgba(245, 166, 35, .35), var(--glow-amber); }

/* ── legend ── */
.qlegend { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin: 14px 4px 2px; }
.qlegend .lg { display: flex; align-items: center; gap: 6px; font-size: .68rem; color: var(--muted); font-weight: 600; }
.qlegend .sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.qlegend .sw.skill { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--amber); }
.qlegend .sw.social { background: #f4f1ff; box-shadow: inset 0 0 0 1.5px var(--muted); }
.qlegend .sw.oou { background: #efeaff; box-shadow: inset 0 0 0 1.5px var(--spark); }
.qlegend .sw.done { background: #0b1017; }

/* ── finale footer ── */
.qfinale { margin-top: 16px; border-radius: var(--radius); padding: 15px 16px; display: flex; align-items: center; gap: 13px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px rgba(32, 65, 100, .05); }
.qfinale .fico { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: #fff; box-shadow: var(--shadow-sm); color: var(--muted); font-size: 20px; }
.qfinale .fbody { flex: 1; min-width: 0; }
.qfinale .ft { font-family: var(--font-display); font-weight: 800; color: var(--navy); font-size: .95rem; }
.qfinale .fd { font-size: .76rem; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.qfinale.ready { background: linear-gradient(150deg, #fff, #fff6e9); box-shadow: inset 0 0 0 1px rgba(245, 166, 35, .3); }
.qfinale.ready .fico { color: var(--amber-deep); }
.qfinale.ready .ft { color: var(--amber-deep); }
.qfoot-note { font-size: .7rem; color: var(--muted); text-align: center; margin: 12px 8px 0; line-height: 1.45; }

@media (prefers-reduced-motion: reduce) {
  .qtile.developing { animation: none; background: transparent; }
  .qshimmer::before { animation: none; display: none; }
}
