/* Joculus Studios — wiki-koeniginnen.css
   Nur für das Königinnen-Wiki: spielbares Brett, Hinweisblase, Lösungsweg,
   Sieg-Choreografie. Das Brett bleibt hell wie in der App (Tablett #FFFFFF,
   Regionsfarben aus palette.ts, Rahmen #2B2B33, Akzent #28664F). */

.kq-board { margin: 20px 0 30px; max-width: 460px; }
.kq-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 0.86rem; color: var(--text-faint); }
.kq-title { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.kq-clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kq-slots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; min-width: 0; }
.kq-slots i { display: block; width: 16px; height: 16px; opacity: 0.28; filter: grayscale(1); }
.kq-slots i.voll { opacity: 1; filter: none; }
.kq-slots svg { display: block; width: 100%; height: 100%; }

/* Tablett und Gitter (Grid.tsx: TRAY 4 px, Radius 12) */
.kq-tray { padding: 4px; border-radius: 16px; background: #fff; box-shadow: 0 3px 12px rgba(24, 55, 46, 0.08), var(--shadow-card); }
.kq-grid {
  --n: 6;
  position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  border-radius: 12px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; cursor: pointer; outline: none;
}
.kq-grid:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.kq-cell { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.kq-top { border-top: max(2.5px, calc(0.06 * 460px / var(--n))) solid #2b2b33; }
.kq-left { border-left: max(2.5px, calc(0.06 * 460px / var(--n))) solid #2b2b33; }
.kq-top-thin { border-top: 1px solid rgba(0, 0, 0, 0.12); }
.kq-left-thin { border-left: 1px solid rgba(0, 0, 0, 0.12); }
.kq-mark { position: relative; z-index: 2; display: grid; place-items: center; width: 80%; height: 80%; font-weight: 700; line-height: 1; pointer-events: none; }
.kq-mark svg { width: 100%; height: 100%; display: block; }
.kq-x .kq-mark { font-size: calc(min(460px, 100vw - 48px) / var(--n) * 0.36); color: rgba(0, 0, 0, 0.55); }
.kq-autox .kq-mark { font-size: calc(min(460px, 100vw - 48px) / var(--n) * 0.3); color: rgba(0, 0, 0, 0.26); animation: kq-fade 220ms ease-out; }
.kq-erase .kq-mark { opacity: 0.2; }
@keyframes kq-fade { from { opacity: 0; } to { opacity: 1; } }
/* Königin federnd einsetzen: withSpring(1, damping 12, stiffness 320) ab 0,3 */
.kq-pop { animation: kq-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes kq-pop { from { transform: scale(0.3); } to { transform: scale(1); } }
/* zuletzt gesetzte Königin: goldener Rahmen */
.kq-last::after { content: ""; position: absolute; inset: 3px; border: 2px solid #e9b949; border-radius: 6px; opacity: 0.9; pointer-events: none; }
/* Region bekommt ihre Königin: Aufleuchten 0,38 in 110 ms, Ausklang 420 ms */
.kq-glow { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 1; }
.kq-glow.an { animation: kq-glow 530ms ease-out; }
@keyframes kq-glow { 0% { opacity: 0; } 21% { opacity: 0.38; } 100% { opacity: 0; } }
/* Hinweise: Suchbereich getönt, Zielzellen mit Akzentrahmen */
.kq-focus::before { content: ""; position: absolute; inset: 0; background: #28664f; opacity: 0.2; pointer-events: none; }
.kq-hintcell::before { content: ""; position: absolute; inset: 0; border: max(2px, calc(0.07 * 460px / var(--n))) solid #28664f; pointer-events: none; z-index: 3; }
.kq-kbd { box-shadow: inset 0 0 0 3px var(--accent); }
/* Sieg: heller Sweep diagonal über das Brett (WinShimmer.tsx) */
.kq-shimmer {
  position: absolute; top: -30%; bottom: -30%; left: 0; width: 42%; z-index: 4; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05) 12%, rgba(255, 255, 255, 0.12) 30%, rgba(255, 255, 255, 0.26) 50%, rgba(255, 255, 255, 0.12) 70%, rgba(255, 255, 255, 0.05) 88%, transparent);
}
.kq-won { cursor: default; }

/* Werkzeuge */
.kq-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kq-btn {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); cursor: pointer;
  background: var(--surface); color: var(--text); font: 600 0.88rem var(--font-body);
}
.kq-btn:hover:not(:disabled) { background: var(--surface-hover); }
.kq-btn:disabled { opacity: 0.45; cursor: default; }
.kq-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.kq-ghost { background: transparent; }
.kq-toggle[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.kq-msg { min-height: 1.6em; margin: 10px 0 0 !important; font-size: 0.9rem; color: var(--text-faint); }

/* Hinweisblase (HintBubble.tsx) */
.kq-hint { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border: 1.5px solid #28664f; border-radius: 14px; background: #fff; color: #18372e; animation: kq-in 220ms ease-out; }
.kq-hint[hidden] { display: none; }
@keyframes kq-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.kq-hint-icon { font-size: 1.1rem; line-height: 1.4; }
.kq-hint-body { flex: 1; min-width: 0; }
.kq-hint-body p { margin: 0 0 6px; font-size: 0.92rem; line-height: 1.45; color: #18372e; }
.wiki-content .kq-hint-tech { display: inline-block; margin-bottom: 2px; font-size: 0.78rem; font-weight: 700; color: #28664f; text-decoration: none; }
.kq-hint-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.78rem; color: #596e64; }
.kq-link { padding: 0; border: 0; background: none; color: #28664f; font: 700 0.78rem var(--font-body); cursor: pointer; }
.kq-path .kq-hint { animation: none; min-height: 5.2em; }

/* Kleine Tabellenhilfen */
.kq-swatch { display: inline-block; width: 0.9em; height: 0.9em; margin-right: 6px; border-radius: 3px; vertical-align: -0.1em; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.kq-timeline { margin: 18px 0 26px; padding: 0; list-style: none; max-width: 72ch; border-left: 2px solid var(--border-strong); }
.wiki-content .kq-timeline li { position: relative; margin: 0; padding: 4px 0 10px 18px; }
.kq-timeline li::before { content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.kq-timeline b { display: inline-block; min-width: 4.5em; color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .kq-head { flex-wrap: wrap; }
  .kq-slots { order: 3; width: 100%; justify-content: flex-start; }
  .kq-slots i { width: 14px; height: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .kq-pop, .kq-glow.an, .kq-autox .kq-mark, .kq-hint { animation: none; }
}

/* Teilen-Text und Fußnote */
.kq-share { margin: 14px 0 22px; padding: 14px 16px; max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text); font: 1rem/1.35 ui-monospace, Consolas, monospace; white-space: pre; }
.wiki-content .kq-note-small { font-size: 0.86rem; color: var(--text-faint); }
