  :root {
    --bg: #1F2221;          /* Anthrazit, eine Stufe dunkler als das Logo (#2D302F) */
    --fg: #E6E8E6;
    --soft: rgba(230, 232, 230, .45);
    --red: #FF3B2F;
    --pad: clamp(1.25rem, 3vw, 2.25rem);
  }
  * { box-sizing: border-box; margin: 0; }
  html, body { height: 100%; overflow: hidden; }
  body {
    background: radial-gradient(ellipse at 50% 42%, #2A2E2C 0%, var(--bg) 62%);
    color: var(--fg);
    font-family: Comfortaa, system-ui, sans-serif;
  }
  canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

  /* Kamerasucher: Eckwinkel am Bildrand und ein kleines Kreuz in der Mitte */
  .frame {
    --inset: clamp(.625rem, 1.2vw, 1rem);
    --arm: clamp(1.25rem, 2.4vw, 2rem);
    --line: rgba(230, 232, 230, .38);
    position: fixed; inset: var(--inset); pointer-events: none;
  }
  .frame i { position: absolute; width: var(--arm); height: var(--arm); border: 0 solid var(--line); }
  .frame i:nth-child(1) { top: 0;    left: 0;  border-top-width: 1px;    border-left-width: 1px; }
  .frame i:nth-child(2) { top: 0;    right: 0; border-top-width: 1px;    border-right-width: 1px; }
  .frame i:nth-child(3) { bottom: 0; left: 0;  border-bottom-width: 1px; border-left-width: 1px; }
  .frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
  .frame b {
    position: absolute; left: 50%; top: 50%; width: 1.125rem; height: 1.125rem;
    transform: translate(-50%, -50%);
  }
  .frame b::before, .frame b::after { content: ""; position: absolute; background: rgba(255, 59, 47, .7); }
  .frame b::before { left: 0; right: 0; top: 50%; height: 1px; }
  .frame b::after  { top: 0; bottom: 0; left: 50%; width: 1px; }

  /* Oben rechts: nur die Wortmarke */
  .hud { position: fixed; top: var(--pad); right: var(--pad); }
  /* Wortmarke 42.lab als SVG (Components/Shared/Logo.razor), Größe über font-size */
  .logo {
    display: inline-flex; align-items: baseline; line-height: 1; white-space: nowrap;
    font-size: clamp(1.75rem, 2.6vw, 2.5rem); color: var(--fg); text-decoration: none;
  }
  .logo .logo-mark { display: block; }

  /* Oben links: Standort, Breite und Länge nebeneinander */
  .coords {
    position: fixed; top: var(--pad); left: var(--pad);
    font: 400 .6875rem/1 "JetBrains Mono", ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    display: flex; gap: 1.5rem;
    padding-top: .9rem;   /* optisch auf Höhe der Logo-Grundlinie */
  }
  .coords div { display: flex; gap: .6rem; }
  .coords dt { color: var(--red); opacity: .85; }
  .coords dd { color: var(--fg); opacity: .75; }

  /* Hinweislinie von den Koordinaten zum markierten Punkt auf der Kugel */
  .leader { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
  .leader polyline { fill: none; stroke: var(--fg); stroke-width: 1; stroke-linejoin: round; }
  .leader circle { fill: none; stroke: var(--red); stroke-width: 1; }

  .corner {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-between;
    padding: var(--pad);
    font-size: .75rem;
  }
  .corner a { color: var(--soft); text-decoration: none; }
  .corner a:hover { color: var(--fg); }
  .corner-legal { display: flex; gap: 1.5rem; }
  :focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

  /* Ohne WebGL: ruhiges Bild der Kugel statt der Szene */
  .kugel-bild { display: none; }
  body.no-webgl .kugel-bild {
    display: block; position: fixed; left: 50%; top: 42%; width: min(46vmin, 30rem); aspect-ratio: 1;
    transform: translate(-50%, -50%); background: url(/img/kugel.png) center / contain no-repeat; opacity: .9;
  }
  body.no-webgl .leader { display: none; }

  /* Impressum – Karte im Inneren der Kugel.
     Dickeres Glas für viel Text (HIG materials.md), abgedunkelter Hintergrund (sheets.md),
     weiche Scrollkanten (liquid-glass.md). Nur der Inhalt der Karte scrollt. */
  .scrim {
    position: fixed; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(10, 11, 11, .25) 0%, rgba(10, 11, 11, .6) 100%);
    opacity: 0; transition: opacity .6s ease;
  }
  body.sheet-open .scrim { opacity: 1; }

  .sheet {
    --sheet-bg: rgba(30, 33, 32, .78);
    --label: #E6E8E6;                      /* ≈ 14:1 auf der Karte */
    --label-2: rgba(230, 232, 230, .66);   /* ≈ 7:1 */
    --label-3: rgba(230, 232, 230, .5);    /* ≈ 4,7:1 */
    --sep: rgba(230, 232, 230, .09);
    --fill: rgba(230, 232, 230, .045);
    position: fixed; left: 50%; top: 50%;
    width: min(35rem, calc(100vw - 2 * var(--pad)));
    max-height: min(78svh, 46rem);
    display: flex; flex-direction: column;
    border-radius: 22px;
    background: var(--sheet-bg);
    -webkit-backdrop-filter: blur(28px) saturate(150%); backdrop-filter: blur(28px) saturate(150%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .09),      /* Lichtkante oben */
      inset 0 0 0 1px rgba(255, 255, 255, .05),
      0 40px 90px -20px rgba(0, 0, 0, .65);
    color: var(--label);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    opacity: 0; visibility: hidden;
    transform: translate(-50%, -47%) scale(.97);
    transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
  }
  .sheet.open {
    opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1);
    transition: opacity .6s cubic-bezier(.2, .8, .2, 1), transform .6s cubic-bezier(.2, .8, .2, 1), visibility 0s;
  }
  .sheet:focus { outline: none; }   /* Fokus wird beim Öffnen gesetzt, nicht per Tastatur */

  .sheet-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    padding: 1.75rem 1.75rem 1.25rem;
  }
  .sheet-head h2 {
    font-family: Fraunces, serif; font-weight: 900; font-variation-settings: "opsz" 9;
    font-size: 2rem; line-height: 1; letter-spacing: -.02em;
  }
  .sheet-head p { margin-top: .5rem; font-size: .9375rem; color: var(--label-2); }
  .close {
    flex: none; width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--fill); border: 0; color: var(--label-2); cursor: pointer;
    transition: background-color .2s, color .2s;
  }
  .close:hover { background: rgba(230, 232, 230, .1); color: var(--label); }
  .close:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
  .close svg { width: 12px; height: 12px; }

  .sheet-body {
    overflow-y: auto; overscroll-behavior: contain;
    padding: .25rem 1.75rem 2rem;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%);
    scrollbar-width: thin; scrollbar-color: rgba(230, 232, 230, .2) transparent;
  }
  body.inside .leader, body.inside .coords { opacity: 0; transition: opacity .4s; }
  .leader, .coords { transition: opacity .6s; }

  @media (prefers-reduced-transparency: reduce) {
    .sheet { --sheet-bg: #1E2120; -webkit-backdrop-filter: none; backdrop-filter: none; }
  }
  @media (prefers-contrast: more) {
    .sheet { --label-2: rgba(230, 232, 230, .85); --label-3: rgba(230, 232, 230, .75); --sep: rgba(230, 232, 230, .3); }
  }

  /* Telefon: Karte kommt von unten wie ein Sheet */
  @media (max-width: 560px) {
    .sheet {
      left: 0; right: 0; top: auto; bottom: 0; width: auto;
      max-height: 86svh; border-radius: 22px 22px 0 0;
      transform: translateY(8%);
    }
    .sheet.open { transform: translateY(0); }
    .sheet-head { padding: 1.5rem 1.25rem 1rem; }
    .sheet-body { padding: .25rem 1.25rem calc(2rem + env(safe-area-inset-bottom)); }
    .row { grid-template-columns: 1fr; gap: .15rem; font-size: 1.0625rem; }
    .prose p, .prose h3 { font-size: 1.0625rem; }
  }

  @media (max-width: 560px) {
    .coords { font-size: .625rem; flex-direction: column; gap: .5rem; padding-top: .35rem; }
  }
