/* Artist Factory e.V. – gemeinsamer Rahmen der Vereinsspiele
   Schrift selbst gehostet, keine externen Anfragen. */
@font-face {
  font-family: "Gantari";
  src: url("../../assets/fonts/gantari-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ground: #08080a;
  --ground-2: #0e0d14;
  --ink: #f5f5f5;
  --ink-soft: #b9b7c2;
  --ink-mute: #8a8794;
  --line: rgba(245, 245, 245, 0.14);
  --magenta: #d142fe;
  --brand-gradient: linear-gradient(90deg, #5b2cf7 0%, #a032e2 55%, #ef3aa6 100%);
  --font: "Gantari", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body {
  height: 100%; margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--font); overflow: hidden; overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
::selection { background: rgba(209, 66, 254, 0.45); }
canvas.af-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; outline: none;
}
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 4px; border-radius: 6px; }

/* Kopfleiste */
.af-hud {
  position: fixed; left: 0; right: 0; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: max(10px, env(safe-area-inset-top)) clamp(12px, 3vw, 28px) 10px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(8, 8, 10, 0.72), rgba(8, 8, 10, 0));
}
.af-hud > * { pointer-events: auto; }
.af-back {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px;
  border-radius: 999px; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35);
}
.af-back:hover { background: #fff; color: var(--ground); }
.af-hud__title { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
.af-hud__stats { margin-left: auto; display: flex; gap: 18px; font-variant-numeric: tabular-nums; }
.af-stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.af-stat small { font-size: 0.72rem; color: var(--ink-mute); font-weight: 600; letter-spacing: 0.02em; }
.af-stat b { font-size: 1.35rem; font-weight: 700; }
.af-icon-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 0; cursor: pointer;
  background: transparent; color: var(--ink); display: grid; place-items: center;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35);
}
.af-icon-btn:hover { background: #fff; color: var(--ground); }
.af-icon-btn svg { width: 20px; height: 20px; }
@media (max-width: 560px) {
  .af-hud__title { display: none; }
  .af-back span { display: none; }
  .af-back { padding: 0 10px; }
  .af-hud__stats { gap: 12px; }
  .af-stat b { font-size: 1.15rem; }
}

/* Bildschirme: Start, Pause, Ende */
.af-screen {
  position: fixed; inset: 0; z-index: 10; display: none;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(ellipse at 50% 30%, rgba(60, 20, 120, 0.42), rgba(8, 8, 10, 0.86) 62%), rgba(8, 8, 10, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.af-screen.is-open { display: block; animation: af-fade 0.35s cubic-bezier(.16, 1, .3, 1); }
@keyframes af-fade { from { opacity: 0; } to { opacity: 1; } }
.af-panel {
  min-height: 100%; display: flex; flex-direction: column; justify-content: center;
  max-width: 640px; margin: 0 auto; padding: 84px clamp(16px, 5vw, 40px) 40px;
}
.af-eyebrow { color: var(--ink-mute); font-weight: 600; font-size: 0.95rem; margin: 0 0 12px; }
.af-h1 {
  font-size: clamp(3rem, 11vw, 6.4rem); line-height: 0.95; letter-spacing: -0.04em;
  font-weight: 800; margin: 0 0 18px; text-wrap: balance;
}
.af-h2 { font-size: clamp(2.2rem, 7vw, 4rem); line-height: 1; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 8px; text-wrap: balance; }
.af-lead { color: var(--ink-soft); font-size: clamp(1.08rem, 2.4vw, 1.3rem); line-height: 1.5; margin: 0 0 28px; max-width: 34em; }
.af-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 22px; }
.af-btn {
  font: 700 1.08rem/1 var(--font); height: 56px; padding: 0 1.6em; border-radius: 999px;
  border: 0; cursor: pointer; color: #fff; display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.af-btn--primary { background: var(--brand-gradient); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.6); }
.af-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.7); filter: brightness(1.08); }
.af-btn--ghost { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.95); }
.af-btn--ghost:hover { background: #fff; color: var(--ground); }
.af-btn small { font-weight: 600; opacity: 0.75; font-size: 0.82rem; }
@media (max-width: 480px) { .af-actions .af-btn { width: 100%; justify-content: center; } }
.af-meta { color: var(--ink-soft); font-size: 0.98rem; margin: 0 0 6px; }
.af-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.af-keys { margin: 22px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 0.96rem; }
.af-keys dt { font-weight: 700; color: var(--ink); }
.af-keys dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 560px) { .af-keys { grid-template-columns: 1fr; gap: 2px; } .af-keys dd { margin-bottom: 10px; } }
.af-score-big { font-size: clamp(4.4rem, 18vw, 9rem); line-height: 0.9; font-weight: 800; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; margin: 6px 0 10px; }
.af-badge { align-self: flex-start; display: inline-block; font-weight: 700; font-size: 0.9rem; padding: 6px 12px; border-radius: 999px; background: #fff; color: var(--ground); margin: 0 0 14px; }
.af-sponsors { margin: 24px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
.af-sponsors p { margin: 0 0 10px; color: var(--ink-mute); font-size: 0.9rem; font-weight: 600; }
.af-sponsor-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.af-sponsor-list li { font-size: 0.9rem; padding: 7px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-soft); }
.af-sponsor-list li b { color: var(--ink); }
.af-link { color: var(--ink); font-weight: 600; text-decoration: none; background: linear-gradient(var(--magenta), var(--magenta)) 0 100% / 100% 1.5px no-repeat; padding-bottom: 2px; }
.af-link:hover { color: #fff; background-size: 100% 3px; }
.af-break { margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--ground-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-soft); font-size: 0.98rem; line-height: 1.5; }
.af-break b { color: var(--ink); }

/* kurze Einblendung im Spiel */
.af-toast {
  position: fixed; left: 50%; top: 74px; transform: translateX(-50%); z-index: 6;
  font-weight: 700; font-size: 1rem; padding: 10px 16px; border-radius: 999px;
  background: rgba(14, 13, 20, 0.88); box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none; opacity: 0; transition: opacity 0.25s; white-space: nowrap;
}
.af-toast.is-on { opacity: 1; }
.af-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

body.af-demo .af-hud, body.af-demo .af-screen, body.af-demo .af-toast { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .af-screen.is-open { animation: none; }
  .af-btn { transition: none; }
  .af-btn--primary:hover { transform: none; }
}
