/* ===========================================================
   SpieleBibliothek — "Neon Arcade" theme
   =========================================================== */

:root {
  --bg-0: #0a0714;
  --bg-1: #130c26;
  --bg-2: #1c1338;
  --panel: rgba(28, 19, 56, 0.65);
  --panel-solid: #170f2c;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --magenta: #ff3d9a;
  --magenta-2: #ff6ec7;
  --magenta-glow: rgba(255, 61, 154, 0.45);

  --gold: #ffb703;
  --gold-2: #ffd166;
  --gold-glow: rgba(255, 183, 3, 0.45);

  --teal: #2de1c2;
  --teal-2: #6ff5db;
  --teal-glow: rgba(45, 225, 194, 0.45);

  --danger: #ff4d6d;

  --text: #f5f2fb;
  --text-dim: #b3a9d1;
  --text-faint: #7c7196;

  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-body: 'Rubik', system-ui, -apple-system, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.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;
}

/* ---------- background texture ---------- */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(255,61,154,.16), transparent 60%),
    radial-gradient(50% 45% at 85% 10%, rgba(45,225,194,.13), transparent 60%),
    radial-gradient(70% 60% at 50% 100%, rgba(255,183,3,.10), transparent 60%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 45%, var(--bg-2) 100%);
}
.bg-scene::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent 75%);
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(14px);
  background: rgba(10, 7, 20, 0.72);
  border-bottom: 1px solid var(--border);
}
.site-header .nav-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  color: var(--text);
  text-shadow: 0 0 24px var(--magenta-glow);
}
.brand .brand-text { background: linear-gradient(90deg, var(--magenta-2), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: all .2s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: var(--border-strong);
}

.nav-right { display: flex; align-items: center; gap: 10px; }

.age-pill {
  border: 1px solid rgba(255,77,109,.55);
  color: var(--danger);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,77,109,.08);
}

.lang-switch {
  display: flex; align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  background: rgba(255,255,255,.03);
}
.lang-switch button {
  border: 0; background: transparent;
  color: var(--text-faint);
  font-size: 12px; font-weight: 700;
  letter-spacing: .04em;
  padding: 6px 10px;
  border-radius: 999px;
  transition: all .2s ease;
}
.lang-switch button.active {
  color: var(--bg-0);
  background: linear-gradient(90deg, var(--magenta-2), var(--gold-2));
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.04);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 10px;
  align-items: center; justify-content: center;
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--border);
  background: rgba(10,7,20,.96);
}
.mobile-menu.open { display: block; }
.mobile-menu .container { display: flex; flex-direction: column; padding: 14px 20px 18px; gap: 4px; }
.mobile-menu a { padding: 10px 4px; color: var(--text-dim); font-weight: 500; border-bottom: 1px solid var(--border); }
.mobile-menu a:last-child { border-bottom: none; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  background: rgba(10,7,20,.6);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 48px 0 32px;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-col h4 {
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin: 0 0 14px;
}
.footer-col p, .footer-col a {
  font-size: .9rem;
  color: var(--text-faint);
  line-height: 1.6;
}
.footer-col a { display: block; margin-bottom: 8px; transition: color .15s; }
.footer-col a:hover { color: var(--teal-2); }
.footer-col button.link-btn {
  background: none; border: none; padding: 0; text-align: left;
  font-size: .9rem; color: var(--text-faint); cursor: pointer; margin-bottom: 8px;
}
.footer-col button.link-btn:hover { color: var(--teal-2); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px;
  font-size: .82rem;
  color: var(--text-faint);
}
.footer-bottom .age-note { display: flex; align-items: center; gap: 8px; }
.footer-bottom .age-note .age-pill { padding: 3px 7px; }

/* ---------- hero / home ---------- */
.hero {
  padding: 72px 0 24px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 900;
  letter-spacing: .02em;
  margin: 0 0 14px;
  background: linear-gradient(90deg, var(--magenta-2), var(--gold-2) 50%, var(--teal-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(255,61,154,.25);
}
.hero p {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin: 0;
}

.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 48px 0 88px;
}
@media (max-width: 780px) { .game-grid { grid-template-columns: 1fr; } }

.game-card {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%;
  padding: 34px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,0) 60%), var(--panel-solid);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.game-card:hover { transform: translateY(-6px); }
.game-card.theme-gold:hover { border-color: var(--gold); box-shadow: 0 18px 50px -12px var(--gold-glow); }
.game-card.theme-teal:hover { border-color: var(--teal); box-shadow: 0 18px 50px -12px var(--teal-glow); }

.card-badge {
  position: absolute; top: 16px; right: 16px;
  background: var(--danger);
  color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  letter-spacing: .04em;
}

.card-icon {
  width: 88px; height: 88px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
  border: 1px solid var(--border-strong);
}
.theme-gold .card-icon { background: radial-gradient(circle, rgba(255,183,3,.18), transparent 70%); box-shadow: inset 0 0 0 1px rgba(255,183,3,.25), 0 0 30px rgba(255,183,3,.18); }
.theme-teal .card-icon { background: radial-gradient(circle, rgba(45,225,194,.18), transparent 70%); box-shadow: inset 0 0 0 1px rgba(45,225,194,.25), 0 0 30px rgba(45,225,194,.18); }

.card-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-align: center;
  margin: 0 0 12px;
  letter-spacing: .01em;
}
.theme-gold .card-title { color: var(--gold-2); }
.theme-teal .card-title { color: var(--teal-2); }

.card-desc {
  text-align: center;
  color: var(--text-dim);
  line-height: 1.6;
  flex: 1;
  margin: 0 0 22px;
}

.card-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700;
  font-size: .95rem;
  padding: 12px 18px;
  border-radius: 999px;
  transition: gap .2s ease, box-shadow .2s ease;
}
.theme-gold .card-cta { color: var(--bg-0); background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.theme-teal .card-cta { color: var(--bg-0); background: linear-gradient(90deg, var(--teal), var(--teal-2)); }
.game-card:hover .card-cta { gap: 14px; }

/* ---------- legal / static pages ---------- */
.page-wrap { padding: 56px 0 96px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--teal-2);
  font-weight: 600; font-size: .92rem;
  margin-bottom: 28px;
}
.back-link:hover { color: var(--teal); }

.panel {
  max-width: 820px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  backdrop-filter: blur(6px);
}
@media (max-width: 640px) { .panel { padding: 24px 20px; } }

.panel h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 6px;
  background: linear-gradient(90deg, var(--magenta-2), var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.panel .updated { color: var(--text-faint); font-size: .85rem; margin: 0 0 28px; }
.panel > .lead { color: var(--text-dim); line-height: 1.7; margin-bottom: 8px; }

.legal-section {
  border-left: 2px solid var(--border-strong);
  padding-left: 18px;
  margin: 28px 0;
}
.legal-section h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold-2);
  margin: 0 0 10px;
  letter-spacing: .01em;
}
.legal-section h3 {
  font-size: .95rem;
  color: var(--teal-2);
  margin: 16px 0 6px;
}
.legal-section p { color: var(--text-dim); line-height: 1.75; margin: 0 0 10px; }
.legal-section a { color: var(--teal-2); text-decoration: underline; text-underline-offset: 2px; }
.legal-section code { background: rgba(255,255,255,.08); padding: 2px 6px; border-radius: 5px; font-size: .85em; }

.contact-line { color: var(--text-dim); margin: 0 0 8px; }
.contact-line strong { color: var(--text); }

/* ---------- consent: age gate + cookie banner ---------- */
#consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: rgba(12, 8, 24, .97);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -10px 40px rgba(0,0,0,.5);
  padding: 18px 20px;
  backdrop-filter: blur(10px);
}
.consent-inner { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.consent-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.consent-text h3 { margin: 0 0 6px; font-size: 1rem; font-family: var(--font-display); }
.consent-text p { margin: 0; color: var(--text-dim); font-size: .88rem; line-height: 1.5; }
.consent-text a { color: var(--teal-2); text-decoration: underline; }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }

.btn {
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: .88rem;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.04);
  color: var(--text-dim);
  transition: all .18s ease;
  white-space: nowrap;
}
.btn:hover { color: var(--text); border-color: var(--text-faint); }
.btn-primary { background: linear-gradient(90deg, var(--magenta), var(--magenta-2)); border-color: transparent; color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 20px var(--magenta-glow); color: #fff; }
.btn-accent { background: linear-gradient(90deg, var(--teal), var(--teal-2)); border-color: transparent; color: var(--bg-0); }
.btn-accent:hover { box-shadow: 0 6px 20px var(--teal-glow); color: var(--bg-0); }

#age-denied p { color: var(--danger); text-align: center; margin: 0; font-size: .92rem; }

/* ---------- consent settings modal ---------- */
#consent-settings {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(6,4,14,.78);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
#consent-settings.open { display: flex; }
.modal-card {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 26px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h2 { font-family: var(--font-display); font-size: 1.15rem; margin: 0; }
.modal-close { background: none; border: none; color: var(--text-faint); font-size: 1.6rem; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-sub { color: var(--text-dim); font-size: .88rem; margin: 0 0 20px; }

.cookie-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 12px;
}
.cookie-row h3 { margin: 0; font-size: .92rem; color: var(--text); }
.cookie-row p { margin: 4px 0 0; font-size: .8rem; color: var(--text-faint); }
.tag-static { background: rgba(255,255,255,.06); color: var(--text-dim); font-size: .74rem; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,.15);
  border-radius: 999px; transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: white; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: linear-gradient(90deg, var(--teal), var(--teal-2)); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* ---------- game pages ---------- */
.game-main {
  min-height: calc(100vh - 65px);
  display: flex; align-items: center; justify-content: center;
  padding: 90px 16px 40px;
  position: relative;
  overflow: hidden;
}
.game-main.theme-gold { background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,183,3,.12), transparent 60%), var(--bg-0); }
.game-main.theme-teal { background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(45,225,194,.12), transparent 60%), var(--bg-0); }

.game-back {
  position: fixed; top: 78px; left: 16px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(20,14,38,.8);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  font-size: .85rem; font-weight: 600;
  backdrop-filter: blur(6px);
  transition: all .18s ease;
}
.game-back:hover { color: var(--text); border-color: var(--text-faint); }

.game-stage { position: relative; z-index: 5; width: 100%; display: flex; flex-direction: column; align-items: center; }
.canvas-frame { position: relative; display: inline-block; }
.canvas-frame canvas {
  display: block;
  border-radius: 18px;
  background: #0c0818;
}
.theme-gold .canvas-frame canvas { box-shadow: 0 0 0 2px rgba(255,183,3,.35), 0 0 60px rgba(255,183,3,.18), 0 24px 60px rgba(0,0,0,.55); }
.theme-teal .canvas-frame canvas { box-shadow: 0 0 0 2px rgba(45,225,194,.35), 0 0 60px rgba(45,225,194,.18), 0 24px 60px rgba(0,0,0,.55); }

.game-label {
  position: absolute; top: 12px; left: 16px;
  font-family: var(--font-display);
  font-size: .85rem; font-weight: 700; letter-spacing: .04em;
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
}
.theme-gold .game-label { color: var(--gold-2); }
.theme-teal .game-label { color: var(--teal-2); }

.pause-btn {
  position: absolute; top: 10px; right: 14px;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .75rem;
  color: var(--text-dim);
  display: none;
}
.pause-btn:hover { color: var(--text); }

.score-bar {
  margin-top: 18px;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(16px, 5vw, 48px);
  width: 100%; max-width: 640px;
  font-family: var(--font-display);
}
.score-side { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.score-side .label { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.score-side .value { font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 900; }
.score-side.p1 .value { color: var(--teal-2); }
.score-side.p2 .value { color: var(--magenta-2); }

.game-status { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.game-status .msg { font-size: .82rem; color: var(--gold-2); animation: pulse 1.8s ease-in-out infinite; font-family: var(--font-body); font-weight: 600; }
.level-bar { display: none; flex-direction: column; align-items: center; gap: 6px; }
.level-bar .lvl-text { font-size: .72rem; color: var(--text-faint); letter-spacing: .05em; }
.level-dots { display: flex; gap: 3px; }
.level-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.15); }
.level-dots span.filled { background: var(--gold); box-shadow: 0 0 6px var(--gold-glow); }

@keyframes pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti-piece { position: absolute; top: -12px; border-radius: 2px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall {
  to { transform: translateY(105vh) rotate(540deg); opacity: .3; }
}

/* utility */
.gradient-underline {
  height: 3px; width: 56px; margin: 10px auto 0;
  background: linear-gradient(90deg, var(--magenta), var(--gold), var(--teal));
  border-radius: 999px;
}
