/* ---- Base Theme (wie zuvor) ---- */
:root{
  --bg:#071423; --panel:#0f2743; --panel-2:#0b1e35;
  --ink:#e9f2ff; --muted:#b8c8e6; --line:rgba(233,242,255,.14);
  --blue:#1c4f91; --blue-2:#153a6b; --orange:#ff8a1f; --orange-2:#ffb36b;
  --metal:#8ea2b8; --metal-2:#c7d2e1;
  --shadow:0 18px 45px rgba(0,0,0,.45);
  /* --radius:18px; --radius-sm:12px; --maxw:980px; */
  --radius:18px; --radius-sm:12px; --maxw:1200px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  --s: 6px; /* control the size */
  --c1:#0f2743;
  --c2:#071423;
  
  --g:#0000 66%,var(--c1) 67% 98%,#0000;
  background:
    radial-gradient(30% 50% at 30% 100%,var(--g)),
    radial-gradient(30% 50% at 70%   0%,var(--g)) var(--s) 0,
    repeating-linear-gradient(90deg,var(--c1) 0 10%,var(--c2) 0 50%);
  background-size: calc(10*var(--s)) calc(6*var(--s));
  color:var(--ink);
  /* background: */
    /* radial-gradient(1200px 800px at 20% 10%, rgba(28,79,145,.35), transparent 60%), */
    /* radial-gradient(900px 700px at 80% 30%, rgba(255,138,31,.18), transparent 60%), */
    /* linear-gradient(180deg, #050d18, var(--bg)); */
  font:22px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  letter-spacing:.2px;
}

/* stars */
body::before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none; opacity:.33;
  /* background-image: */
    /* radial-gradient(1px 1px at 12% 18%, #fff, transparent 60%), */
    /* radial-gradient(1px 1px at 78% 22%, #fff, transparent 60%), */
    /* radial-gradient(1px 1px at 42% 62%, #fff, transparent 60%), */
    /* radial-gradient(1px 1px at 66% 74%, #fff, transparent 60%), */
    /* radial-gradient(1px 1px at 18% 82%, #fff, transparent 60%), */
    /* radial-gradient(2px 2px at 30% 35%, #fff, transparent 60%), */
    /* radial-gradient(2px 2px at 85% 55%, #fff, transparent 60%); */
}

a{
	color: var(--orange);
	text-decoration: none;
}
a:hover{
	color: #fff;
}

/* ---- Sticky header ---- */
.header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(7,20,35,.92), rgba(7,20,35,.55));
  border-bottom: 1px solid var(--line);
}
.header-inner{
  max-width:var(--maxw); margin:0 auto;
  padding:14px 18px;
  display:flex; align-items:center; gap:14px;
}
.brand-badge{
  width:44px; height:44px; border-radius:999px;
  display:grid; place-items:center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,138,31,.55), transparent 45%),
    linear-gradient(180deg, rgba(142,162,184,.45), rgba(15,39,67,.8));
  border:1px solid rgba(233,242,255,.2);
  box-shadow:0 10px 25px rgba(0,0,0,.35);
}
.brand-badge svg{ width:24px; height:24px; opacity:.95; }
.brand{ display:flex; flex-direction:column; line-height:1.1; }
.brand .title{ font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.brand .subtitle{ color:var(--muted); font-size:12px; }
.header-actions{ margin-left:auto; display:flex; gap:10px; }

/* ---- Buttons ---- */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  text-decoration:none;
  font-weight:800;
  border-radius:999px;
  padding:10px 12px;
  background: linear-gradient(180deg, var(--orange), #ff7a00);
  color:#06121f;
  border:1px solid rgba(0,0,0,.12);
  box-shadow:0 10px 20px rgba(0,0,0,.25);
}
.btn:hover{ filter:brightness(1.05); }
.btn.secondary{
  color:var(--ink);
  background: linear-gradient(180deg, rgba(142,162,184,.35), rgba(15,39,67,.75));
  border:1px solid rgba(233,242,255,.14);
  box-shadow:none;
}
.btn.small{ padding:8px 10px; font-size:13px; }

#toggleFlights{
  cursor: pointer;
}

/* ---- Layout ---- */
.wrapper{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 130px 18px 70px; /* vorher ~90px */
}
.hero{
  margin-top:18px;
  padding:22px 20px;
  border-radius:var(--radius);
  background:
    linear-gradient(135deg, rgba(28,79,145,.25), transparent 55%),
    linear-gradient(0deg, rgba(255,138,31,.08), transparent 60%),
    linear-gradient(180deg, rgba(15,39,67,.9), rgba(11,30,53,.6));
  border:1px solid rgba(233,242,255,.14);
  box-shadow:var(--shadow);
  position:relative; overflow:hidden;
}
.hero::after{
  content:"";
  position:absolute; inset:-40px -40px auto auto;
  width:240px; height:70px;
  transform:rotate(18deg);
  background: repeating-linear-gradient(45deg, rgba(255,138,31,.85) 0 10px, rgba(7,20,35,0) 10px 20px);
  opacity:.35;
}
.hero h1{ margin:0 0 8px; font-size:28px; letter-spacing:.03em; }
/* .hero p{ margin:0; color:var(--muted); max-width:72ch; } */
.hero p{ margin:0; color:var(--muted); }

/* ---- Horizontale Sprunglink-Leiste ---- */
.top-toc{
  position: fixed;
  top: 68px; /* Höhe des Headers */
  left: 0;
  right: 0;
  z-index: 900;

  background: linear-gradient(
    180deg,
    rgba(15,39,67,.95),
    rgba(11,30,53,.85)
  );

  border-bottom: 1px solid rgba(233,242,255,.12);
  backdrop-filter: blur(6px);
}

.top-toc-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 18px;

  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-toc-inner::-webkit-scrollbar{
  display: none;
}

.top-toc a{
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;

  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;

  transition: all .15s ease;
}

.top-toc a:hover{
  color: var(--ink);
  border-color: rgba(255,138,31,.6);
  background: rgba(255,138,31,.08);
}

/* ---- Panels ---- */
.panel{
  margin-top:18px;
  border-radius:var(--radius);
  background: linear-gradient(180deg, rgba(15,39,67,.92), rgba(11,30,53,.55));
  border:1px solid rgba(233,242,255,.14);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.panel-header{
  padding:14px 16px;
  display:flex; align-items:baseline; justify-content:space-between; gap:12px;
  border-bottom:1px solid rgba(233,242,255,.12);
  background: linear-gradient(90deg, rgba(28,79,145,.35), transparent 50%);
}
.panel-header h2{
  margin:0; font-size:26px;
  letter-spacing:.06em; text-transform:uppercase;
}
.panel-header .tag{
  font-size:12px; color:var(--muted);
  border:1px solid rgba(233,242,255,.14);
  padding:4px 8px; border-radius:999px;
}
.panel-body{ padding:16px; }

/* ---- TOC (Sprunglinks) ---- */
.toc{
  position: sticky;
  top: 76px; /* header height-ish */
  z-index: 5;
}
@media (max-width: 920px){
  .toc{ position: static; }
}

.toc-list{
  margin:0;
  padding-left: 18px;
  display:grid;
  gap: 6px;
}
.toc-list a{
  color: var(--ink);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  display:inline-block;
}
.toc-list a:hover{
  border-color: rgba(255,138,31,.55);
  background: rgba(255,138,31,.06);
}

/* ---- Prose / Lesbarkeit ---- */
.prose{
  /* max-width: 82ch; */
}
.prose section{
  padding: 6px 0 18px;
  border-bottom: 1px dashed rgba(233,242,255,.14);
}
.prose section:last-child{ border-bottom: 0; padding-bottom: 0; }

.prose .lead{
  color: var(--muted);
  font-size: 15px;
}

.prose h2{
  margin: 14px 0 8px;
  font-size: 26px;
  letter-spacing: .02em;
  position: relative;
}
.prose h2::before{
  content:"";
  position:absolute;
  left:-12px; top:.35em;
  width:6px; height:1.15em;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--orange), rgba(255,138,31,.15));
  opacity: .95;
}

.prose h3{
  margin: 18px 0 8px;
  font-size: 18px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--metal-2);
}

.prose p{ margin: 0 0 12px; }
.prose ul{ margin: 0 0 12px; padding-left: 18px; }
.prose li{ margin: 6px 0; }
.prose li::marker{ color: rgba(255,138,31,.9); }

/* Anchor offset, damit Überschriften nicht unter dem Sticky Header verschwinden */
.prose h2, .prose h3{
  scroll-margin-top: 150px;
}

/* ---- Callout ---- */
.callout{
  border-radius:var(--radius-sm);
  border:1px solid rgba(233,242,255,.14);
  background: linear-gradient(180deg, rgba(7,20,35,.45), rgba(7,20,35,.15));
  padding:12px 12px;
  display:grid;
  gap:6px;
  position:relative;
  margin: 10px 0 12px;
}
.callout::before{
  content:"";
  position:absolute; left:0; top:0; bottom:0;
  width:4px;
  border-radius:12px 0 0 12px;
  background: linear-gradient(180deg, var(--orange), rgba(255,138,31,.15));
}
.callout .label{
  font-size:12px;
  color:var(--muted);
  letter-spacing:.08em;
  text-transform:uppercase;
}
.callout strong{ color:#fff; }

/* Back-to-TOC link */
.backtotop{
  display:inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid rgba(233,242,255,.14);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(11,30,53,.35);
}
.backtotop:hover{
  color: var(--ink);
  border-color: rgba(255,138,31,.55);
  box-shadow: 0 0 0 3px rgba(255,138,31,.12);
}

/* ---- Footer ---- */
.footer{
  margin-top:18px;
  color:var(--muted);
  font-size:12px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  opacity:.95;
}
.footer .mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ---- Print ---- */
@media print{
  body{ background:#fff; color:#111; }
  body::before, .header, .toc, .backtotop{ display:none !important; }
  .panel, .hero{ box-shadow:none; border:1px solid #ccc; background:#fff; }
  .panel-header{ background:#f4f6fb; border-bottom:1px solid #ddd; }
}

/* ---- Schiffbild ---- */
/* Outer: Position & Flight */
#plunder-ship{
  position: fixed;
  left: -320px;
  top: 30%;
  width: 280px;          /* steuert Größe */
  max-width:25%
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  will-change: left, top, opacity;
}

/* Middle: Wobble */
#plunder-ship .ship-wobble{
  width: 100%;
  animation: shipWobble 2.6s ease-in-out infinite;
  transform-origin: 50% 50%;
}

/* Inner: Flip/Scale (JS setzt nur CSS-Variablen) */
#plunder-ship .ship-sprite{
  width: 100%;
  height: auto;
  display: block;

  /* Wichtig: Flip & Scale laufen über Variablen */
  transform: scale(var(--shipScale, 1)) scaleX(var(--shipFlip, 1));
  transform-origin: 50% 50%;
  will-change: transform;
}

/* Wobble-Animation nutzt jetzt translateY, kollidiert nicht mehr */
@keyframes shipWobble{
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

/* Optional: kleiner „Nase hoch/runter“-Tilt nur im Wobble Layer */
#plunder-ship.tilt .ship-wobble{
  animation: shipWobbleTilt 2.6s ease-in-out infinite;
}
@keyframes shipWobbleTilt{
  0%   { transform: translateY(0px) rotate(0deg); }
  50%  { transform: translateY(-10px) rotate(-1.2deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}