/* Joculus Studios — wiki-arrow.css
   Nur für das Arrow-Puzzle-Wiki: Papierflächen, Mini-Brett, Galerie, Kurve.
   Das Spielfeld bleibt hell wie in der App (Papierton #F3ECE0, Tinte #2B3D4F). */

.ap-paper {
  display: block; border-radius: 14px; padding: 6%;
  background:
    radial-gradient(ellipse 70% 55% at 20% 15%, rgba(214, 186, 135, 0.22), transparent 70%),
    radial-gradient(ellipse 60% 50% at 85% 90%, rgba(156, 197, 176, 0.25), transparent 70%),
    #f3ece0;
  box-shadow: inset 0 0 0 1px rgba(43, 61, 79, 0.08), var(--shadow-card);
}
.ap-paper svg { display: block; width: 100%; height: auto; }

/* ---------- Mini-Brett ---------- */
.ap-board { margin: 20px 0 30px; max-width: 520px; }
.ap-board-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.86rem; color: var(--text-faint); }
.ap-hearts { color: #ff6b7a; letter-spacing: 2px; white-space: nowrap; }
.ap-hearts i { font-style: normal; display: inline-block; }
.ap-hearts i.leer { color: var(--border-strong); }
.ap-hearts i.weg { animation: ap-heart 0.6s ease-out; }
@keyframes ap-heart { 0% { transform: scale(1.6); color: #ff6b7a; } 100% { transform: scale(1); } }
.ap-board .ap-paper { cursor: pointer; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
.ap-board-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ap-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);
}
.ap-btn:hover { background: var(--surface-hover); }
.ap-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ap-btn-ghost { background: transparent; }
.ap-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ap-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--text-muted); cursor: pointer; }
.ap-board-msg { min-height: 1.6em; margin: 10px 0 0 !important; font-size: 0.9rem; color: var(--text-faint); }
/* Hinweisring: pulsiert 3×, je 700 ms, out-quad, wächst auf das 1,55-Fache und blendet aus */
.ap-ring { transform-box: fill-box; transform-origin: center; animation: ap-ring 700ms cubic-bezier(0.5, 1, 0.89, 1) 3 both; }
@keyframes ap-ring { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.55); opacity: 0; } }
.ap-done { box-shadow: inset 0 0 0 2px rgba(214, 186, 135, 0.9), 0 0 40px -6px rgba(214, 186, 135, 0.6); transition: box-shadow 0.6s; }
/* Federregen zum Levelende */
.ap-paper { position: relative; overflow: hidden; }
.ap-feather {
  position: absolute; left: 50%; top: 50%; width: 5%; min-width: 10px; aspect-ratio: 1 / 2; pointer-events: none;
  transform: translate(-50%, -50%); opacity: 0; animation: ap-feather 1600ms cubic-bezier(0.33, 1, 0.68, 1) both;
}
.ap-feather svg { display: block; width: 100%; height: 100%; }
@keyframes ap-feather {
  0% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(0.4); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(calc(var(--rot) + 40deg)) scale(1); opacity: 0; }
}

/* Zwei Bretter nebeneinander (Regelvergleich) */
.ap-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin: 18px 0 26px; }
.ap-pair .ap-board { margin: 0; }

/* ---------- Motivreihe ---------- */
.ap-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; margin: 18px 0 26px; min-height: 140px; }
.ap-strip-item { margin: 0 !important; }
.ap-strip-item .ap-paper { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; padding: 10%; box-shadow: inset 0 0 0 1px rgba(43, 61, 79, 0.08); }
.ap-strip-item .ap-paper svg { width: 100%; height: 100%; }
.ap-strip-item figcaption { margin-top: 6px !important; text-align: center; color: var(--text-muted) !important; font-size: 0.85rem !important; }
.ap-strip-item small { display: block; color: var(--text-faint); font-size: 0.75rem; }

/* ---------- Galerie ---------- */
.ap-gallery-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.ap-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-tab {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
  background: var(--bg-elevated); color: var(--text-muted); font: 600 0.88rem var(--font-body);
}
.ap-tab[aria-selected="true"] { background: var(--surface-hover); color: var(--text); border-color: var(--primary); }
.ap-search {
  flex: 1 1 200px; max-width: 280px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font: 0.9rem var(--font-body);
}
.ap-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ap-gallery-count { font-size: 0.85rem; color: var(--text-faint) !important; margin: 0 0 10px !important; }
.ap-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.ap-card {
  display: grid; gap: 6px; padding: 8px 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); cursor: pointer; text-align: left; font: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.ap-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.ap-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ap-thumb { display: block; aspect-ratio: 1; border-radius: 9px; padding: 8%; background: #f3ece0; }
.ap-thumb svg { width: 100%; height: 100%; display: block; }
.ap-card-text { display: flex; gap: 6px; align-items: baseline; font-size: 0.9rem; line-height: 1.25; min-width: 0; }
.ap-card-text b { font-family: var(--font-display); color: var(--accent); }
.ap-card-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-card-meta { font-size: 0.74rem; color: var(--text-faint); }

/* ---------- Leveldialog ---------- */
.ap-dialog {
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--bg-elevated); color: var(--text);
}
.ap-dialog::backdrop { background: rgba(5, 7, 14, 0.75); }
.ap-dialog-close {
  position: absolute; top: 10px; right: 10px; z-index: 1; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.ap-dialog-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; padding: 22px; align-items: center; }
.ap-dialog h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 1.5rem; }
.ap-dialog dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 0.92rem; }
.ap-dialog dt { color: var(--text-faint); }
.ap-dialog dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Schwierigkeitskurve ---------- */
.ap-chart { position: relative; margin: 14px 0 6px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); }
.ap-chart:empty { aspect-ratio: 3 / 1; } /* Platz freihalten, bis die Daten da sind - sonst springen Anker */
.ap-chart-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.ap-grid { stroke: var(--border); stroke-width: 1; }
.ap-axis { fill: var(--text-faint); font: 11px var(--font-body); }
.ap-band-0 { fill: rgba(139, 123, 255, 0.05); }
.ap-band-1 { fill: rgba(55, 214, 232, 0.05); }
.ap-band-label { fill: var(--text-muted); font: 600 11px var(--font-body); }
.ap-bar { fill: var(--accent); opacity: 0.85; }
.ap-bar.on { fill: var(--accent-warm); opacity: 1; }
.ap-hit { fill: transparent; cursor: crosshair; }
.ap-chart-tip {
  position: absolute; top: 6px; transform: translateX(-50%); padding: 6px 10px; border-radius: 8px; pointer-events: none;
  background: var(--surface-hover); border: 1px solid var(--border-strong); color: var(--text); font-size: 0.8rem; line-height: 1.4; white-space: nowrap;
}
.ap-chart-caption { font-size: 0.85rem; color: var(--text-faint) !important; }

@media (max-width: 600px) {
  .ap-dialog-body { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .ap-gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .ap-card-meta { display: none; }
  .ap-search { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-hearts i.weg, .ap-feather { animation: none; }
  .ap-ring { animation: none; opacity: 0.35; }
  .ap-card, .ap-tile { transition: none; }
}

/* Farbmuster in der Farbtabelle */
.ap-colors i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; background: var(--c); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); }
.ap-colors td { white-space: nowrap; font-variant-numeric: tabular-nums; }
