/* ============================================================
   AI Escape Room – statische Abschlussseite
   Farben, Schrift und Effekte 1:1 aus dem Projekt übernommen
   (tailwind.config.ts, globals.css, HomepageComponents.tsx).
   ============================================================ */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #111827;
  --surface: rgb(31 41 55 / .7);
  --surface-solid: #1f2937;
  --text: #e5e7eb;
  --text-secondary: rgba(204, 204, 204, .8);
  --text-muted: #9ca3af;
  --border: rgb(107 114 128 / .3);
  --primary: #2dd4bf;
  --primary-hover: #14b8a6;
  --error: #ef4444;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Nur für Screenreader sichtbar (wie im Projekt) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* Kein eigener Hintergrund: würde das Video (z-index -1) verdecken, html trägt die Farbe */
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

/* Scrollbar wie im Projekt */
* { scrollbar-width: thin; scrollbar-color: #374151 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: #374151; border-radius: 9999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background-color: #4b5563; }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* ------------------------------------------------------------
   Hintergrund (Video + Overlay wie BackgroundVideo.tsx)
   ------------------------------------------------------------ */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  contain: strict;
  /* Fallback, solange (oder falls) kein Video läuft */
  background:
    radial-gradient(ellipse 60% 50% at 70% 40%, rgb(45 212 191 / .10), transparent 70%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgb(59 130 246 / .08), transparent 70%),
    var(--bg);
}
.bg__video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: brightness(.6);
  opacity: 0;
  transition: opacity 1.2s ease;
}
.bg__video.is-visible { opacity: 1; }
.bg__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgb(0 0 0 / .5), transparent),
    rgb(0 0 0 / .3);
}

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.layout {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: max(40px, env(safe-area-inset-top)) 16px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: center;
  gap: 48px;
}


/* ------------------------------------------------------------
   Intro
   ------------------------------------------------------------ */
.intro {
  width: 100%;
  max-width: 560px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  height: 32px;
  margin: 0 0 28px;
  padding: 0 16px;
  border: 1px solid rgb(239 68 68 / .35);
  border-radius: 999px;
  background: rgb(0 0 0 / .35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fca5a5;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
/* Exakt mittig, unabhängig von den Schriftmetriken:
   Textbox auf Versalhöhe zuschneiden (Chrome 133+, Safari 18.2+),
   Letter-Spacing hinter dem letzten Zeichen ausgleichen */
.status__text {
  display: block;
  margin-right: -.16em;
  text-box: trim-both cap alphabetic;
}
@media (max-width: 380px) {
  .status { gap: 8px; padding: 0 12px; font-size: 11px; letter-spacing: .12em; }
  .status__text { margin-right: -.12em; }
}
.status__dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  box-shadow: 0 0 10px rgb(239 68 68 / .8);
}
.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--error);
  animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping {
  75%, 100% { transform: scale(2.6); opacity: 0; }
}

.logo {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  transition: transform .3s ease;
}
.logo:hover { transform: scale(1.1); }

.title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: .28em;
  row-gap: 0;
  font-size: clamp(2.5rem, 11vw, 4.75rem);
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  font-variant-ligatures: none;
  user-select: none;
}
@media (min-width: 768px) { .title { flex-wrap: nowrap; } }

/* Comic/Gaming-Schrift aus globals.css */
.text-gaming {
  color: var(--primary);
  letter-spacing: -.02em;
  white-space: nowrap;
  paint-order: stroke fill;
  -webkit-text-stroke: 8px #000;
  filter:
    drop-shadow(1px -1px 0 #2dd4bf)
    drop-shadow(1px 1px 0 #2dd4bf)
    drop-shadow(-1px 1px 0 #2dd4bf)
    drop-shadow(-1px -1px 0 #2dd4bf);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
@media (min-width: 768px) {
  .text-gaming { -webkit-text-stroke: 10px #000; letter-spacing: -.03em; }
}

.tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 18px 0 0;
}
.tagline__line {
  width: 40px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--primary));
}
.tagline__line--rev { background: linear-gradient(to left, transparent, var(--primary)); }
.tagline__text {
  color: var(--primary);
  font-size: clamp(.85rem, 2.6vw, 1.15rem);
  font-weight: 600;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.lead {
  max-width: 30rem;
  margin: 22px 0 0;
  color: var(--text-secondary);
  font-size: 1rem;
  text-shadow: 0 1px 12px rgb(0 0 0 / .7);
}

/* ------------------------------------------------------------
   Button – 1:1 wie "Spiel fortsetzen" (ContinueButton in HomepageComponents.tsx):
   grünes Icon-Quadrat mit Play-Symbol, das sich beim Hover um 120° dreht,
   Neon-Rand + Glow beim Hover
   ------------------------------------------------------------ */
.cta {
  --accent: #22c55e;   /* accent-continue */
  --accent-2: #10b981; /* success */
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 512px;
  margin-top: 36px;
  padding: 24px 24px 24px 104px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(to bottom right, rgb(31 41 55 / .8), rgb(31 41 55 / .4));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  text-decoration: none;
  transition: transform .5s ease, box-shadow .5s ease;
}
@media (min-width: 450px) { .cta { padding-left: 24px; } }

.cta__border {
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 2px;
  border-radius: 16px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity .5s ease;
  animation: gradient-shift 3s ease infinite paused;
}
.cta__border > span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: var(--surface);
}
.cta__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 16px;
  background: linear-gradient(90deg, rgb(34 197 94 / 0), rgb(34 197 94 / .2), rgb(34 197 94 / 0));
  filter: blur(20px);
  opacity: 0;
  transition: opacity .5s ease;
}
.cta__icon {
  position: absolute;
  left: 24px;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-top: -28px;
  border-radius: 12px;
  background: linear-gradient(to bottom right, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  transition: transform .3s ease, box-shadow .3s ease;
}
.cta__icon svg {
  display: block;
  width: 28px;
  height: 28px;
  transition: transform .5s ease;
}
.cta__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  gap: 2px;
  transition: transform .3s ease;
}
.cta__label {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  transition: color .3s ease;
}
@media (min-width: 640px) { .cta__label { font-size: 1.25rem; } }
.cta__sub {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.cta:hover, .cta:focus-visible {
  transform: scale(1.02);
  box-shadow: 0 25px 50px -12px rgb(34 197 94 / .5);
}
.cta:hover .cta__border, .cta:focus-visible .cta__border { opacity: 1; animation-play-state: running; }
.cta:hover .cta__glow, .cta:focus-visible .cta__glow { opacity: 1; }
.cta:hover .cta__icon, .cta:focus-visible .cta__icon {
  transform: scale(1.1);
  box-shadow: 0 25px 50px -12px rgb(34 197 94 / .5);
}
.cta:hover .cta__icon svg, .cta:focus-visible .cta__icon svg { transform: rotate(120deg); }
.cta:hover .cta__text, .cta:focus-visible .cta__text { transform: scale(1.05); }
.cta:hover .cta__label, .cta:focus-visible .cta__label { color: var(--accent); }
.cta:focus-visible { outline-color: var(--accent); outline-offset: 4px; border-radius: 16px; }

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ------------------------------------------------------------
   Labyrinth
   ------------------------------------------------------------ */
.maze-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgb(255 255 255 / .08);
  background: linear-gradient(to bottom right, rgb(30 41 59 / .75), rgb(30 41 59 / .45));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow:
    0 25px 50px -12px rgb(0 0 0 / .6),
    inset 0 1px 0 rgb(255 255 255 / .04);
  animation: card-in .8s .15s ease both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
}

.maze {
  display: block;
  width: 100%;
  border-radius: 14px;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.maze.is-grabbable { cursor: grab; }
.maze.is-dragging { cursor: grabbing; }
.maze:focus-visible { outline-offset: 2px; border-radius: 14px; }

.maze-reset {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / .08);
  border-radius: 10px;
  background: rgb(0 0 0 / .25);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}
.maze-reset svg { width: 16px; height: 16px; transition: transform .4s ease; }
/* Nur das Symbol dreht sich, das Quadrat bleibt stehen */
.maze-reset:hover { color: var(--primary); background: rgb(45 212 191 / .1); }
.maze-reset:hover svg { transform: rotate(90deg); }

/* ------------------------------------------------------------
   Footer (wie Footer.tsx, kompakt)
   ------------------------------------------------------------ */
.footer {
  padding: 22px 16px max(22px, env(safe-area-inset-bottom));
  border-top: 1px solid rgb(255 255 255 / .1);
  background: rgb(17 24 39 / .35);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 12px;
}
.footer__links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease;
}
.footer__links a:hover { color: var(--primary); }
.footer__sep { color: rgb(255 255 255 / .25); }
.footer__copy { margin: 10px 0 0; font-size: 13px; color: var(--text-muted); }

/* Wie PrimaryLink im Projekt: Primärfarbe + fett, ohne Unterstrich, beim Hover etwas dunkler */
.link-primary {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease;
}
.link-primary:hover, .link-primary:focus-visible { color: var(--primary-hover); }

/* ------------------------------------------------------------
   Weniger Bewegung, wenn gewünscht
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .bg__video { display: none; }
}
