/* Arcade – Styling für die wiederverwendbare Spielhilfe (arcade-help.js).
   Nutzt --accent / --accent-2 des jeweiligen Spiels, mit Neon-Fallback. */

:root {
  --ah-accent:   var(--accent, #00e5ff);
  --ah-accent-2: var(--accent-2, #ff00e5);
}

/* Schwebender Auslöser unten rechts */
.ah-trigger {
  position: fixed;
  right: clamp(0.9rem, 3vw, 1.5rem);
  bottom: calc(clamp(0.9rem, 3vw, 1.5rem) + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--board-bg, rgba(255, 255, 255, 0.06));
  color: var(--ah-accent);
  font: 800 1.4rem/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 22px -8px rgba(0, 0, 0, 0.6), 0 0 26px -10px var(--ah-accent);
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.ah-trigger:hover { transform: translateY(-2px); border-color: var(--ah-accent); }
.ah-trigger:active { transform: translateY(0); }

/* Platz unten reservieren, damit der schwebende Button keine Steuerung verdeckt. */
body.ah-has-help { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }

/* Backdrop + Dialog */
.ah-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(6, 6, 14, 0.74);
  backdrop-filter: blur(4px);
  animation: ah-fade 0.18s ease;
}
.ah-backdrop[hidden] { display: none; }

.ah-dialog {
  width: 100%;
  max-width: 460px;
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-2, #14142c), var(--bg, #0a0a14));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 70px -20px #000, 0 0 50px -22px var(--ah-accent);
  animation: ah-pop 0.18s ease;
  overflow: hidden;
}

.ah-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ah-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--ah-accent), var(--ah-accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ah-close {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg, #e8e8ff);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.ah-close:hover { border-color: var(--ah-accent); }

.ah-body {
  padding: 1rem 1.1rem 1.3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ah-intro {
  margin: 0 0 1rem;
  color: var(--fg, #e8e8ff);
  font-weight: 600;
}
.ah-sec { margin: 0 0 1.1rem; }
.ah-sec:last-child { margin-bottom: 0; }
.ah-h {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--ah-accent);
}
.ah-p { margin: 0 0 0.5rem; color: var(--muted, #9a9ac0); }
.ah-p:last-child { margin-bottom: 0; }

.ah-list { margin: 0; padding-left: 1.2rem; color: var(--muted, #9a9ac0); }
.ah-list li { margin: 0.3rem 0; }

/* Steuerungs-Tabelle (Tasten ↔ Beschreibung) */
.ah-ctrls { display: flex; flex-direction: column; gap: 0.45rem; }
.ah-ctrl {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.ah-keys {
  flex: none;
  min-width: 6.5rem;
  padding: 0.3rem 0.5rem;
  text-align: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg, #e8e8ff);
  font-weight: 700;
  font-size: 0.9rem;
}
.ah-desc { color: var(--muted, #9a9ac0); }

body.ah-open { overflow: hidden; }

@keyframes ah-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ah-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ah-backdrop, .ah-dialog { animation: none; }
  .ah-trigger { transition: none; }
}
