/* ═══════════════════════════════════════════════════════════════════════
   EPTS – legal pages
   Tokens, header and footer are taken verbatim from worldranking.php so
   every page of the site stays in lockstep.
═══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink:       #0C0C0E;
  --ink2:      #141417;
  --ink3:      #1C1C21;
  --gold:      #FEBC00;
  --gold-lt:   #FFD040;
  --gold-dim:  rgba(254,188,0,0.12);
  --gold-line: rgba(254,188,0,0.22);
  --cream:     #F5EDD8;
  --smoke:     rgba(245,237,216,0.75);
  --mist:      rgba(245,237,216,0.52);
  --fog:       rgba(245,237,216,0.14);
  --green:     #2ECC8A;
  --green-dim: rgba(46,204,138,0.12);
  --purple:    #7C5CBF;
  --red:       #D94F4F;
  --red-dim:   rgba(217,79,79,0.12);
  --border:    rgba(245,237,216,0.08);
  --serif:     'Playfair Display', Georgia, serif;
  --sans:      'DM Sans', system-ui, sans-serif;
  --mono:      'DM Mono', monospace;

  /* legacy aliases used by older markup */
  --primary-gold: #FEBC00;
  --text-grey: rgba(245,237,216,0.52);
}

html { scroll-behavior: smooth; }
body {
  padding-top: 88px;
  font-family: var(--sans);
  background: var(--ink);
  color: var(--cream);
  overflow-x: hidden;
  line-height: 1.6;
  font-size: 15px;
}
a { color: inherit; }
::selection { background: var(--gold-dim); color: var(--cream); }

/* Visible focus for keyboard users on every interactive element */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Base icon rule — global on purpose, masked icons are used outside <nav> too */
.nav-icon, .icon-inline {
  display: inline-block; width: 14px; height: 14px;
  background-color: currentColor;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  flex-shrink: 0;
}
.icon-inline { width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; color: var(--gold); }

/* ═══════════════════════════════════════════
   BACKGROUND ATMOSPHERE
═══════════════════════════════════════════ */
.atmosphere, .aurora-layer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.atm-radial, .aurora-layer {
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(254,188,0,0.06) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(124,92,191,0.07) 0%, transparent 55%);
}
.atm-radial { position: absolute; inset: 0; }
.atm-grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.6;
}
.atm-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 100% 100% at 50% 50%, transparent 40%, rgba(0,0,0,0.55) 100%);
}

/* ═══════════════════════════════════════════
   HEADER — logo + auth only
═══════════════════════════════════════════ */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(12,12,14,0.86);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), border-color 0.3s;
}
.header:hover { border-bottom-color: var(--gold-line); }
.header.hidden { transform: translateY(-100%); }
.header-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 0 48px; height: 88px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; }
.logo img {
  height: 80px; display: block;
  filter: drop-shadow(0 2px 12px rgba(254,188,0,0.15));
  transition: filter 0.3s, transform 0.3s;
}
.logo a:hover img { filter: drop-shadow(0 4px 20px rgba(254,188,0,0.32)); transform: translateY(-1px); }

.header-auth { display: flex; align-items: center; opacity: 0; transition: opacity 0.3s; }
.header-auth.ready { opacity: 1; }
#authGuest { display: flex; gap: 10px; align-items: center; }

.auth-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: 3px;
  font-family: var(--sans); font-size: 0.76rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; transition: all 0.22s; border: none;
  white-space: nowrap; text-decoration: none;
}
.auth-btn.ghost { background: transparent; color: var(--smoke); border: 1px solid var(--border); }
.auth-btn.ghost:hover { border-color: var(--gold-line); color: var(--cream); background: var(--gold-dim); }
.auth-btn.primary { background: var(--gold); color: var(--ink); }
.auth-btn.primary:hover { background: var(--gold-lt); box-shadow: 0 6px 20px rgba(254,188,0,0.28); transform: translateY(-1px); }

.user-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #c89600);
  border: 2px solid var(--gold-line);
  color: var(--ink); font-family: var(--mono);
  font-size: 0.85rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.22s; position: relative; overflow: hidden;
  box-shadow: 0 2px 12px rgba(254,188,0,0.25);
}
.user-avatar img.nav-avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%; display: block;
}
.user-avatar:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 20px rgba(254,188,0,0.4);
  border-color: var(--gold);
}
.user-avatar::after {
  content: 'My Account';
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--ink2); border: 1px solid var(--gold-line);
  color: var(--cream); font-family: var(--sans); font-size: 0.72rem;
  font-weight: 500; letter-spacing: 0.05em;
  padding: 6px 12px; border-radius: 4px; white-space: nowrap;
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: all 0.18s;
}
.user-avatar:hover::after { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════
   PAGE SHELL
═══════════════════════════════════════════ */
.main-container {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto;
  padding: 0 48px 96px;
}
.main-container.wide { max-width: 1320px; }

/* Hero */
.legal-hero, .hero { padding: 72px 0 44px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--gold-line); background: var(--gold-dim);
  padding: 8px 18px; border-radius: 3px; margin-bottom: 26px;
  transition: border-color 0.25s, background 0.25s;
}
.eyebrow:hover { border-color: rgba(254,188,0,0.4); background: rgba(254,188,0,0.18); }
.eyebrow .nav-icon { width: 13px; height: 13px; }

.legal-hero h1, .hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 900; line-height: 1.04; letter-spacing: -0.02em;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  flex-wrap: wrap;
}
.legal-hero h1 em, .hero h1 em { font-style: italic; font-weight: 400; color: var(--gold); }
.hero-icon { height: 54px; width: auto; object-fit: contain; }
.legal-hero h1 .hero-icon.ic, .hero h1 .hero-icon.ic { height: auto; }
.legal-hero p, .hero p {
  font-size: 0.98rem; color: var(--mist); font-weight: 300;
  max-width: 620px; margin: 0 auto;
}
.legal-hero .meta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 22px;
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: rgba(245,237,216,0.3);
}

/* ═══════════════════════════════════════════
   TABLE OF CONTENTS
═══════════════════════════════════════════ */
.toc {
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--ink2); padding: 26px 28px; margin-bottom: 40px;
}
.toc-label {
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(245,237,216,0.32); margin-bottom: 16px;
}
.toc ol { list-style: none; counter-reset: toc; columns: 2; column-gap: 32px; }
.toc li { counter-increment: toc; margin-bottom: 9px; break-inside: avoid; }
.toc a {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-size: 0.86rem; color: var(--mist); text-decoration: none;
  font-weight: 300; transition: color 0.2s, padding-left 0.2s;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--mono); font-size: 0.62rem;
  color: rgba(254,188,0,0.35); flex-shrink: 0;
}
.toc a:hover { color: var(--cream); padding-left: 5px; }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* ═══════════════════════════════════════════
   CONTENT BLOCKS
═══════════════════════════════════════════ */
.legal-content { position: relative; }

.legal-section {
  background: var(--ink2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 38px 40px;
  margin-bottom: 16px;
  position: relative;
  transition: border-color 0.3s;
  scroll-margin-top: 110px;
}
.legal-section::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--gold-line), transparent 55%);
  opacity: 0; transition: opacity 0.3s;
}
.legal-section:hover { border-color: rgba(245,237,216,0.14); }
.legal-section:hover::before { opacity: 1; }

.legal-section h2 {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 700;
  color: var(--cream); line-height: 1.2; margin-bottom: 20px;
  display: flex; align-items: center; gap: 13px;
}
.legal-section h2 .sec-icon {
  width: 20px; height: 20px; background-color: var(--gold); flex-shrink: 0;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  transition: transform 0.25s cubic-bezier(0.34,1.4,0.64,1);
}
.legal-section:hover h2 .sec-icon { transform: scale(1.12); }
.legal-section h2 .sec-num {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 400;
  color: rgba(254,188,0,0.4); letter-spacing: 0.1em;
}

.legal-section h3 {
  font-family: var(--sans); font-size: 1rem; font-weight: 500;
  color: var(--cream); margin: 26px 0 10px;
}
.legal-section h3:first-of-type { margin-top: 0; }

.legal-section p { color: var(--smoke); font-size: 0.9rem; line-height: 1.85; font-weight: 300; margin-bottom: 12px; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section strong { color: var(--cream); font-weight: 500; }
.legal-section a:not(.back-button):not(.auth-btn) {
  color: var(--gold); text-decoration: none;
  border-bottom: 1px solid var(--gold-line);
  transition: color 0.2s, border-color 0.2s;
}
.legal-section a:not(.back-button):not(.auth-btn):hover { color: var(--gold-lt); border-color: var(--gold-lt); }

.legal-section ul, .legal-section ol { list-style: none; margin: 12px 0 16px; }
.legal-section li {
  position: relative; padding-left: 20px; margin-bottom: 9px;
  color: var(--smoke); font-size: 0.88rem; line-height: 1.75; font-weight: 300;
}
.legal-section ul > li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 5px; height: 5px; border-radius: 50%; background: rgba(254,188,0,0.5);
}
.legal-section ol { counter-reset: li; }
.legal-section ol > li { padding-left: 26px; counter-increment: li; }
.legal-section ol > li::before {
  content: counter(li) '.'; position: absolute; left: 0; top: 0;
  font-family: var(--mono); font-size: 0.75rem; color: rgba(254,188,0,0.5);
}
.legal-section li.no::before {
  content: ''; width: 9px; height: 9px; border-radius: 0; top: 9px;
  background-color: var(--red);
  -webkit-mask-image: url('../bilder/icons/x.svg'); mask-image: url('../bilder/icons/x.svg');
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}

/* Callouts */
.info-box, .warning-box, .tip-box, .success-box, .highlight-box, .example-box, .contact-box {
  border: 1px solid var(--border); border-left: 2px solid var(--border);
  border-radius: 4px; padding: 20px 22px; margin: 18px 0;
  background: rgba(245,237,216,0.02);
  transition: border-color 0.25s, background 0.25s;
}
.info-box    { border-left-color: var(--gold);   background: rgba(254,188,0,0.045); }
.warning-box { border-left-color: var(--red);    background: rgba(217,79,79,0.05); }
.tip-box     { border-left-color: var(--purple); background: rgba(124,92,191,0.06); }
.success-box { border-left-color: var(--green);  background: rgba(46,204,138,0.05); }
.highlight-box, .example-box { border-left-color: var(--gold-line); }
.info-box:hover, .warning-box:hover, .tip-box:hover, .success-box:hover,
.highlight-box:hover, .example-box:hover, .contact-box:hover {
  border-color: rgba(245,237,216,0.16);
}
.info-box:hover    { border-left-color: var(--gold); }
.warning-box:hover { border-left-color: var(--red); }
.tip-box:hover     { border-left-color: var(--purple); }
.success-box:hover { border-left-color: var(--green); }

.box-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 10px;
}
.info-box .box-label    { color: var(--gold); }
.warning-box .box-label { color: var(--red); }
.tip-box .box-label     { color: #A98BEF; }
.success-box .box-label { color: var(--green); }
.box-label .icon-inline { color: inherit; margin: 0; }

.contact-box { background: rgba(245,237,216,0.03); border-left-color: var(--gold-line); }
.contact-box p { margin-bottom: 7px; }
.contact-box p:last-child { margin-bottom: 0; }

/* Tables */
.data-table, .ranking-table {
  width: 100%; border-collapse: collapse; margin: 18px 0;
  font-size: 0.85rem;
}
.data-table th, .ranking-table th {
  text-align: left; padding: 12px 14px;
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mist); border-bottom: 1px solid var(--border);
  background: rgba(245,237,216,0.03);
}
.data-table td, .ranking-table td {
  padding: 13px 14px; color: var(--smoke); font-weight: 300;
  border-bottom: 1px solid rgba(245,237,216,0.05); vertical-align: top;
}
.data-table tr, .ranking-table tr { transition: background 0.18s; }
.data-table tbody tr:hover, .ranking-table tbody tr:hover { background: rgba(254,188,0,0.04); }
.data-table td strong, .ranking-table td strong { color: var(--cream); font-weight: 500; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Back button */
.back-button {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 40px auto 0; padding: 14px 28px;
  border: 1px solid var(--gold-line); border-radius: 3px;
  background: transparent; color: var(--gold);
  font-family: var(--sans); font-size: 0.76rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; transition: all 0.22s;
}
.back-button:hover { background: var(--gold-dim); color: var(--gold-lt); border-color: var(--gold-lt); transform: translateY(-2px); }
.back-button .icon-inline { color: inherit; margin: 0; transition: transform 0.22s; }
.back-button:hover .icon-inline { transform: translateX(-3px); }


/* ═══════════════════════════════════════════
   INLINE ICONS — masked SVG, sized in em so they
   scale with the text they sit in
═══════════════════════════════════════════ */
.ic {
  display: inline-block; width: 1em; height: 1em;
  background-color: currentColor; flex-shrink: 0;
  vertical-align: -0.14em;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}
.ic-book-open { -webkit-mask-image: url('../bilder/icons/book-open.svg'); mask-image: url('../bilder/icons/book-open.svg'); }
.ic-gamepad-2 { -webkit-mask-image: url('../bilder/icons/gamepad-2.svg'); mask-image: url('../bilder/icons/gamepad-2.svg'); }
.ic-trophy { -webkit-mask-image: url('../bilder/icons/trophy.svg'); mask-image: url('../bilder/icons/trophy.svg'); }
.ic-coins { -webkit-mask-image: url('../bilder/icons/coins.svg'); mask-image: url('../bilder/icons/coins.svg'); }
.ic-graduation-cap { -webkit-mask-image: url('../bilder/icons/graduation-cap.svg'); mask-image: url('../bilder/icons/graduation-cap.svg'); }
.ic-medal { -webkit-mask-image: url('../bilder/icons/medal.svg'); mask-image: url('../bilder/icons/medal.svg'); }
.ic-clipboard-list { -webkit-mask-image: url('../bilder/icons/clipboard-list.svg'); mask-image: url('../bilder/icons/clipboard-list.svg'); }
.ic-timer { -webkit-mask-image: url('../bilder/icons/timer.svg'); mask-image: url('../bilder/icons/timer.svg'); }
.ic-gavel { -webkit-mask-image: url('../bilder/icons/gavel.svg'); mask-image: url('../bilder/icons/gavel.svg'); }
.ic-armchair { -webkit-mask-image: url('../bilder/icons/armchair.svg'); mask-image: url('../bilder/icons/armchair.svg'); }
.ic-scroll-text { -webkit-mask-image: url('../bilder/icons/scroll-text.svg'); mask-image: url('../bilder/icons/scroll-text.svg'); }
.ic-pin { -webkit-mask-image: url('../bilder/icons/pin.svg'); mask-image: url('../bilder/icons/pin.svg'); }
.ic-triangle-alert { -webkit-mask-image: url('../bilder/icons/triangle-alert.svg'); mask-image: url('../bilder/icons/triangle-alert.svg'); }
.ic-circle-check { -webkit-mask-image: url('../bilder/icons/circle-check.svg'); mask-image: url('../bilder/icons/circle-check.svg'); }
.ic-target { -webkit-mask-image: url('../bilder/icons/target.svg'); mask-image: url('../bilder/icons/target.svg'); }
.ic-video { -webkit-mask-image: url('../bilder/icons/video.svg'); mask-image: url('../bilder/icons/video.svg'); }
.ic-dices { -webkit-mask-image: url('../bilder/icons/dices.svg'); mask-image: url('../bilder/icons/dices.svg'); }
.ic-refresh-cw { -webkit-mask-image: url('../bilder/icons/refresh-cw.svg'); mask-image: url('../bilder/icons/refresh-cw.svg'); }
.ic-megaphone { -webkit-mask-image: url('../bilder/icons/megaphone.svg'); mask-image: url('../bilder/icons/megaphone.svg'); }
.ic-alarm-clock { -webkit-mask-image: url('../bilder/icons/alarm-clock.svg'); mask-image: url('../bilder/icons/alarm-clock.svg'); }
.ic-clock { -webkit-mask-image: url('../bilder/icons/clock.svg'); mask-image: url('../bilder/icons/clock.svg'); }
.ic-circle { -webkit-mask-image: url('../bilder/icons/circle.svg'); mask-image: url('../bilder/icons/circle.svg'); }

/* Marker colours — the icon replaces what an emoji used to signal */
.ic-pin, .ic-target        { background-color: var(--gold); }
.ic-triangle-alert         { background-color: var(--red); }
.ic-circle-check           { background-color: var(--green); }
.ic-video, .ic-dices,
.ic-refresh-cw, .ic-megaphone,
.ic-alarm-clock, .ic-clock { background-color: var(--mist); }

/* Hero */
.hero-icon.ic {
  width: 1em; height: 1em; background-color: var(--gold);
  vertical-align: -0.08em;
  filter: drop-shadow(0 4px 18px rgba(254,188,0,0.28));
}

/* ═══════════════════════════════════════════
   RULE BOOK — search, tabs, accordion
═══════════════════════════════════════════ */
.search-container { margin-bottom: 18px; }
.search-box { position: relative; width: 100%; }
.search-input {
  width: 100%; font-family: var(--sans); font-size: 14px; color: var(--cream);
  background: rgba(245,237,216,.04); border: 1px solid var(--border);
  border-radius: 13px; padding: 14px 20px 14px 48px; outline: none;
  transition: border-color .22s, background .22s, box-shadow .22s,
              padding .22s cubic-bezier(.22,1,.36,1), font-size .22s cubic-bezier(.22,1,.36,1);
}
.search-input::placeholder { color: rgba(245,237,216,.32); }
.search-input:hover { border-color: rgba(245,237,216,.16); }
.search-input:focus {
  border-color: var(--gold-line); background: rgba(245,237,216,.06);
  box-shadow: 0 0 0 4px rgba(254,188,0,.07);
  font-size: 19px; padding: 20px 24px 20px 56px;
}
.search-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; background-color: rgba(245,237,216,.4);
  -webkit-mask-image: url('../bilder/icons/search.svg');
  mask-image: url('../bilder/icons/search.svg');
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  pointer-events: none; transition: background-color .22s, width .22s, height .22s;
}
.search-box:hover .search-icon { background-color: rgba(245,237,216,.6); }
.search-input:focus ~ .search-icon { background-color: var(--gold); width: 19px; height: 19px; }
.search-clear {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: rgba(245,237,216,.06); cursor: pointer; display: none;
  align-items: center; justify-content: center; transition: background .18s;
}
.search-clear:hover { background: rgba(217,79,79,.2); }
.search-clear span {
  display: block; width: 11px; height: 11px; background-color: var(--mist);
  -webkit-mask-image: url('../bilder/icons/x.svg'); mask-image: url('../bilder/icons/x.svg');
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  transition: background-color .18s;
}
.search-clear:hover span { background-color: var(--red); }

.search-meta { display: flex; justify-content: flex-end; height: 22px; margin-top: 10px; }
.faq-count {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--mist);
  opacity: 0; transition: opacity .25s;
}
.faq-count.on { opacity: 1; }

.category-nav-wrapper { margin-bottom: 26px; }
.category-nav-container { display: flex; gap: 8px; flex-wrap: wrap; }
.category-tab {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--mist);
  background: rgba(245,237,216,.03); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 16px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s, transform .12s;
}
.category-tab:hover { color: var(--cream); border-color: rgba(245,237,216,.18); background: rgba(245,237,216,.06); }
.category-tab.active { color: var(--gold); border-color: var(--gold-line); background: var(--gold-dim); }
.category-tab:active { transform: scale(0.96); }
/* Category marker sits in the gold rule above each group. */
.category-icon { width: 1.15em; height: 1.15em; background-color: var(--gold); vertical-align: -0.2em; }
.category-title { transition: color 0.2s; }
.category-title:hover .category-icon { transform: scale(1.1); }
.category-icon { transition: transform 0.25s cubic-bezier(0.34,1.4,0.64,1); }

.faq-category { margin-bottom: 16px; }
.faq-category[hidden], .faq-item[hidden] { display: none; }
.category-title {
  font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 13px; margin: 52px 0 18px;
}
.faq-category:first-child .category-title { margin-top: 24px; }
.category-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.faq-item {
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--ink2); margin-bottom: 10px; overflow: hidden;
  position: relative;
  transition: border-color 0.25s, background 0.25s;
}
.faq-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--gold); transform: scaleY(0); transform-origin: center;
  transition: transform 0.25s;
}
.faq-item:hover { border-color: rgba(245,237,216,0.16); background: #16161A; }
.faq-item:hover::before, .faq-item.active::before, .faq-item.open::before { transform: scaleY(1); }
.faq-item.active, .faq-item.open { border-color: var(--gold-line); }
.faq-question {
  width: 100%; text-align: left; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; background: transparent; border: none;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 500; color: var(--cream);
  transition: color 0.2s, background 0.2s;
}
.faq-question:hover { background: rgba(245,237,216,0.03); }
.faq-question:active { background: rgba(245,237,216,0.05); }
.faq-q { flex: 1; }
.faq-item.active .faq-question, .faq-item.open .faq-question { color: var(--gold); }
.toggle-icon {
  width: 14px; height: 14px; flex-shrink: 0; background-color: var(--mist);
  -webkit-mask-image: url('../bilder/icons/chevron-down.svg');
  mask-image: url('../bilder/icons/chevron-down.svg');
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  transition: transform 0.28s cubic-bezier(0.22,1,0.36,1), background-color 0.2s;
}
.faq-item.active .toggle-icon, .faq-item.open .toggle-icon { transform: rotate(180deg); background-color: var(--gold); }
.faq-question:hover .toggle-icon { background-color: var(--cream); }
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.22,1,0.36,1);
}
.faq-item.active .faq-answer, .faq-item.open .faq-answer { max-height: 3000px; }
.faq-body {
  padding: 2px 24px 24px;
  color: var(--smoke); font-size: 0.9rem; line-height: 1.85; font-weight: 300;
}
.faq-body > *:last-child { margin-bottom: 0; }
.faq-body p { margin-bottom: 12px; }
.faq-body strong { color: var(--cream); font-weight: 500; }
.faq-body ul, .faq-body ol { margin: 10px 0 14px; padding-left: 0; list-style: none; }
.faq-body li { position: relative; padding-left: 18px; margin-bottom: 7px; }
.faq-body ul > li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 5px; height: 5px; border-radius: 50%; background: rgba(254,188,0,0.5);
}
.faq-body img { max-width: 100%; height: auto; border-radius: 4px; }
.faq-body table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.84rem; }
.faq-body th, .faq-body td { padding: 11px 12px; text-align: left; border-bottom: 1px solid rgba(245,237,216,0.06); }
.faq-body th {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mist); background: rgba(245,237,216,0.03);
}
.faq-body tbody tr { transition: background 0.18s; }
.faq-body tbody tr:hover { background: rgba(254,188,0,0.04); }

.no-results {
  text-align: center; padding: 70px 20px;
  color: var(--mist); font-size: 0.9rem; font-weight: 300;
  border: 1px solid var(--border); border-radius: 6px; background: var(--ink2);
}
.no-results[hidden] { display: none; }
.no-results h3 { font-family: var(--serif); font-size: 1.4rem; color: var(--cream); margin-bottom: 8px; }

/* ═══════════════════════════════════════════
   SKELETON — shown until the page is ready
═══════════════════════════════════════════ */
.sk-wrap { display: block; }
.sk-wrap[hidden] { display: none; }
.sk-block {
  background: var(--ink2); border: 1px solid var(--border);
  border-radius: 6px; padding: 38px 40px; margin-bottom: 16px;
}
.sk-bar {
  height: 12px; border-radius: 5px; margin-bottom: 12px;
  background: linear-gradient(90deg, rgba(245,237,216,.04) 25%, rgba(245,237,216,.09) 37%, rgba(245,237,216,.04) 63%);
  background-size: 400% 100%;
  animation: sk 1.5s ease-in-out infinite;
}
.sk-bar.t { height: 22px; width: 42%; margin-bottom: 22px; }
.sk-bar.s { width: 62%; }
.sk-block:nth-child(2) .sk-bar { animation-delay: .12s; }
.sk-block:nth-child(3) .sk-bar { animation-delay: .24s; }
@keyframes sk { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* ═══════════════════════════════════════════
   SCROLL REVEAL
═══════════════════════════════════════════ */
.rv {
  opacity: 0; transform: translateY(22px);
  transition: opacity .62s cubic-bezier(.22,1,.36,1), transform .62s cubic-bezier(.22,1,.36,1);
}
.rv.vis { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .06s; }
.rv-d2 { transition-delay: .13s; }
.rv-d3 { transition-delay: .20s; }

/* Reading progress bar */
#readbar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt));
  z-index: 200; transition: width 0.1s linear;
}

/* Back to top */
#btt {
  position: fixed; bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  background: var(--ink2); border: 1px solid var(--gold-line);
  border-radius: 4px; color: var(--gold); cursor: pointer;
  display: none; align-items: center; justify-content: center;
  transition: all .22s; z-index: 99;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
#btt.show { display: flex; }
#btt:hover { border-color: var(--gold); background: var(--gold-dim); transform: translateY(-2px); }
#btt .icon-inline { color: inherit; margin: 0; width: 16px; height: 16px; }

/* ═══════════════════════════════════════════
   FOOTER — identical to worldranking.php
═══════════════════════════════════════════ */
.footer { border-top: 1px solid var(--border); position: relative; z-index: 1; background: rgba(12,12,14,0.6); }
.footer-main {
  max-width: 1320px; margin: 0 auto; padding: 96px 48px 72px;
  display: grid; grid-template-columns: repeat(3, 1fr) 1.3fr; gap: 52px;
}
.footer-col h4 {
  font-family: var(--mono); font-size: 0.82rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 24px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 14px; }
.footer-col ul a {
  color: var(--mist); text-decoration: none;
  font-size: 0.9rem; font-weight: 300;
  transition: color 0.2s; position: relative;
}
.footer-col ul a:hover { color: var(--cream); }

.footer-social { display: flex; gap: 10px; margin-bottom: 28px; }
.social-btn {
  width: 46px; height: 46px;
  background: var(--ink3); border: 1px solid var(--border);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; text-decoration: none;
}
.social-btn:hover { border-color: var(--gold-line); background: var(--gold-dim); transform: translateY(-2px); }
.social-btn img { width: 22px; height: 22px; object-fit: contain; }
.footer-logo img { height: 60px; opacity: 0.6; transition: opacity 0.2s; }
.footer-logo img:hover { opacity: 0.9; }

.footer-bottom {
  max-width: 1320px; margin: 0 auto; padding: 28px 48px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.footer-bottom p { font-size: 0.82rem; color: rgba(245,237,216,0.2); font-weight: 300; }
.footer-bottom span {
  font-family: var(--mono); font-size: 0.62rem;
  color: rgba(254,188,0,0.3); letter-spacing: 0.1em;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  body { font-size: 14px; padding-top: 68px; }
  .header-inner { padding: 0 24px; height: 80px; }
  .logo img { height: 62px; }
  .main-container { padding: 0 24px 72px; }
  .legal-hero, .hero { padding: 48px 0 32px; }
  .legal-section { padding: 26px 22px; }
  .legal-section h2 { font-size: 1.35rem; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 28px; padding: 48px 24px 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; padding: 16px 24px; }
}
@media (max-width: 640px) {
  .main-container { padding: 0 16px 56px; }
  .category-nav-container { justify-content: flex-start !important; gap: 6px !important; }
  .category-tab { font-size: 0.56rem; padding: 8px 12px; }
  .faq-question { padding: 16px 16px; font-size: 0.9rem; }
  .faq-body { padding: 2px 16px 18px; }
  .hero-icon { height: 34px; }
  .legal-hero, .hero { padding: 36px 0 26px; }
  .legal-hero h1, .hero h1 { gap: 12px; }
  .hero-icon { height: 38px; }
  .footer-main { grid-template-columns: 1fr; }
  .back-button { width: 100%; justify-content: center; }
  #btt { bottom: 18px; right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .sk-bar { animation: none; }
  .auth-btn.primary:hover, .back-button:hover, .social-btn:hover, #btt:hover { transform: none; }
  .search-input:focus { font-size: 14px; padding: 14px 20px 14px 48px; }
  html { scroll-behavior: auto; }
}

/* ═══════════════════════════════════════════
   PRINT — legal pages get printed, so make it work
═══════════════════════════════════════════ */
@media print {
  body { background: #fff; color: #000; padding-top: 0; font-size: 11pt; }
  .header, .footer, #btt, #readbar, .back-button, .atmosphere, .aurora-layer, .toc { display: none !important; }
  .main-container { max-width: none; padding: 0; }
  .legal-section { border: none; background: none; padding: 0 0 18pt; break-inside: avoid; }
  .legal-section h2 { color: #000; font-size: 14pt; }
  .legal-section p, .legal-section li { color: #222; }
  .rv { opacity: 1; transform: none; }
  a { color: #000; text-decoration: underline; }
}

/* ── iOS zoom on focus ────────────────────────────────────────────────
   Safari on iPhone zooms into any field whose text is smaller than 16px and
   never zooms back out. 16px is the threshold, not a design choice, so it
   only applies on touch devices - desktop keeps the smaller size. */
@media (hover: none) and (pointer: coarse) {
  input, textarea, select { font-size: 16px !important; }
}

/* ═══════════════════════════════════════════
   LANGUAGE SWITCH
   Both language versions live in the same document; the <html> class
   decides which one is rendered. The class is set by an inline script in
   <head>, before the first paint, so nothing flashes.
═══════════════════════════════════════════ */
html.lang-en .lang-de,
html.lang-de .lang-en { display: none !important; }

.lang-switch {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px; border-radius: 6px;
  border: 1px solid var(--gold-line);
  background: rgba(254,188,0,0.05);
}
.lang-opt {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 16px; border-radius: 4px;
  background: transparent; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mist); white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
/* The flag files are not all the same shape, so the height is fixed and the
   width follows — contain, never cover, otherwise a square file loses its
   top and bottom edge. Colour stays on in both states: a grey flag is not
   recognisable, which defeats the point of the switch. */
.lang-opt img {
  display: block;
  height: 17px; width: auto; max-width: 30px;
  object-fit: contain;
  border-radius: 2px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lang-opt:hover { color: var(--cream); background: rgba(255,255,255,0.05); }
.lang-opt:hover img { opacity: 1; }
.lang-opt[aria-pressed="true"] {
  background: var(--gold); color: var(--ink);
  box-shadow: 0 4px 14px rgba(254,188,0,0.22);
}
.lang-opt[aria-pressed="true"] img { opacity: 1; }

/* Primary position: in the reading flow, under the page title. */
.hero-lang { margin-top: 26px; }
.lang-note {
  margin-top: 10px;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em;
  color: var(--text-grey);
}

/* Secondary position: in the header. Drops out as soon as the header gets
   tight, the one in the hero is the one that matters. */
/* Sits next to the logo. margin-right: auto pins it there — the nav is
   absolutely positioned from 1051px up, so without it the switch would drift
   into the middle of the row and end up underneath the menu. */
.header-lang { margin-left: 24px; margin-right: auto; }
.header-lang .lang-opt { padding: 6px 12px; gap: 8px; font-size: 0.62rem; }
.header-lang .lang-opt img { height: 15px; max-width: 26px; }
@media (max-width: 1050px) { .header-lang { display: none; } }

@media (max-width: 480px) {
  .lang-opt { padding: 8px 13px; font-size: 0.63rem; }
  .lang-opt img { height: 15px; max-width: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .lang-opt, .lang-opt img { transition: none; }
}

/* Printing a legal page prints the language on screen, nothing else. */
@media print {
  .lang-switch, .lang-note { display: none !important; }
}

/* The German labels are longer than the English ones — "Registrieren" against
   "Register" — and pushed the header past the right edge on a narrow phone.
   Tightening the buttons here fixes both languages at once. */
@media (max-width: 560px) {
  .header-inner { gap: 8px; }
  #authGuest { gap: 6px; }
  .auth-btn { padding: 8px 12px; font-size: 0.68rem; letter-spacing: 0.05em; }
}
@media (max-width: 400px) {
  .auth-btn { padding: 8px 9px; font-size: 0.62rem; letter-spacing: 0.03em; }
}
@media (max-width: 360px) {
  .header-inner { padding: 0 14px; }
  .logo img { height: 52px; }
  .auth-btn { padding: 7px 8px; font-size: 0.56rem; letter-spacing: 0; }
}

/* German compounds are long — "Geschäftsbedingungen" is wider than a 320px
   phone. The <html> element carries the right lang attribute, so the browser
   can hyphenate properly instead of letting the word run off the edge. */
.legal-hero h1, .hero h1, .legal-hero h1 em, .hero h1 em {
  overflow-wrap: break-word;
  -webkit-hyphens: auto; hyphens: auto;
  /* The heading is a flex row and a flex item refuses to shrink below its
     own content width unless this is set — without it the break never
     happens and the word runs past the edge anyway. */
  min-width: 0;
}

/* On the narrowest phones the heading gets one step smaller so the German
   compounds need at most one break instead of two. */
@media (max-width: 400px) {
  .legal-hero h1, .hero h1 { font-size: 2.05rem; }
}

/* Note on which language version prevails — small, at the end of a page. */
.lang-legal-note {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-grey);
}
