/* ══════════════════════════════════════════════════════════════
   Leas 7. Piratenfest — düstere Nebelbucht
   ══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Pirata One';
  src: url('/assets/fonts/pirata-one-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Pirata One';
  src: url('/assets/fonts/pirata-one-latin-ext-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Crimson Pro';
  src: url('/assets/fonts/crimson-pro-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Crimson Pro';
  src: url('/assets/fonts/crimson-pro-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  --ink:        #05080a;
  --abyss:      #080d10;
  --deep:       #0d161a;
  --sea:        #10262c;
  --mist:       #7f9ca3;

  --parchment:  #e6d7b4;
  --parch-mid:  #d8c49a;
  --parch-edge: #a8906a;
  --sepia:      #3a2c1b;
  --sepia-soft: #5b4830;

  --brass:      #c9a227;
  --brass-lo:   #8a6c16;
  --brass-hi:   #f2d894;
  --blood:      #8c2b22;

  --shadow-deep: 0 24px 60px rgba(0,0,0,.65);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: #d9e2e4;
  font-family: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ───────────────────────── Szene ───────────────────────── */

.scene {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(130% 68% at 50% 2%,  #16303a 0%, #0c1a20 38%, transparent 70%),
    radial-gradient(100% 50% at 50% 100%, #0a1418 0%, transparent 60%),
    linear-gradient(#070c0f 0%, var(--abyss) 45%, #060a0c 100%);
}

.moon {
  position: absolute; top: 4vh; left: 50%;
  width: min(42vw, 190px); aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #e8f0ee 0%, #b9cbc8 42%, #7f9a9a 70%, #4f6a6d 100%);
  box-shadow: 0 0 90px 30px rgba(190,220,220,.14), 0 0 200px 80px rgba(120,170,175,.08);
  opacity: .55;
}
.moon::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 60%, rgba(60,80,85,.4) 0 8%, transparent 9%),
    radial-gradient(circle at 65% 35%, rgba(60,80,85,.35) 0 6%, transparent 7%),
    radial-gradient(circle at 58% 70%, rgba(60,80,85,.3) 0 5%, transparent 6%);
}

.sea {
  position: absolute; left: -10%; right: -10%; top: 38vh; bottom: 0;
  background:
    linear-gradient(to bottom, rgba(23,56,65,.85) 0%, rgba(8,18,22,.95) 40%, var(--ink) 100%);
  box-shadow: inset 0 1px 0 rgba(170,210,215,.18);
}
.sea::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 28vh;
  background: repeating-linear-gradient(
    to bottom,
    rgba(180,215,220,.05) 0 1px,
    transparent 1px 7px);
  mask-image: linear-gradient(to bottom, #000, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
}

.ship {
  position: absolute; top: 38vh; left: 50%;
  width: min(62vw, 300px);
  transform: translate(-54%, -100%);
  color: #040809;
  opacity: .9;
  filter: drop-shadow(0 0 18px rgba(0,0,0,.9));
  animation: bob 11s ease-in-out infinite;
}
.ship svg { display: block; width: 100%; height: auto; }

@keyframes bob {
  0%, 100% { transform: translate(-54%, -100%) rotate(-.7deg); }
  50%      { transform: translate(-52%, calc(-100% - 7px)) rotate(.7deg); }
}

.fog {
  position: absolute; left: -60%; right: -60%;
  height: 46vh;
  background:
    radial-gradient(45% 60% at 20% 55%, rgba(170,200,205,.11), transparent 70%),
    radial-gradient(38% 55% at 52% 45%, rgba(190,215,220,.09), transparent 70%),
    radial-gradient(50% 65% at 82% 60%, rgba(160,195,200,.10), transparent 70%);
  filter: blur(14px);
}
.fog--far  { top: 24vh; animation: drift 90s linear infinite; }
.fog--near { top: 46vh; opacity: .8; animation: drift 58s linear infinite reverse; }

@keyframes drift {
  from { transform: translateX(-12%); }
  to   { transform: translateX(12%); }
}

.grain {
  position: absolute; inset: 0;
  opacity: .32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ───────────────────────── Layout ───────────────────────── */

.wrap {
  position: relative; z-index: 1;
  width: min(100% - 32px, 620px);
  margin: 0 auto;
  padding: max(5vh, 36px) 0 56px;
}

/* ───────────────────────── Hero ───────────────────────── */

.hero { text-align: center; padding-bottom: 46px; }

.emblem {
  width: min(44vw, 150px);
  margin: 0 auto 22px;
  animation: breathe 7s ease-in-out infinite;
}
.emblem svg { display: block; width: 100%; height: auto; }
.emblem__bones  { fill: #c3b79c; opacity: .55; }
.emblem__skull  { fill: #e9e2d2; }
.emblem__dark   { fill: #0a1014; }
.emblem__glint  { fill: var(--brass); animation: glint 5s ease-in-out infinite; }

@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes glint   { 0%,88%,100% { opacity: .85; } 93% { opacity: .15; } }

.eyebrow {
  margin: 0 0 10px;
  font-size: .78rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--mist);
}

.title {
  font-family: 'Pirata One', 'Pirata One Fallback', serif;
  font-weight: 400;
  margin: 0;
  font-size: clamp(3.4rem, 17vw, 6rem);
  line-height: .9;
  letter-spacing: .02em;
  color: #f3ead6;
  text-shadow:
    0 2px 0 rgba(0,0,0,.6),
    0 0 36px rgba(201,162,39,.28),
    0 0 90px rgba(0,0,0,.9);
}
.title__num {
  display: inline-block;
  color: var(--brass-hi);
  font-size: 1.32em;
  text-shadow: 0 0 30px rgba(201,162,39,.55), 0 3px 0 rgba(0,0,0,.6);
}

.lede {
  margin: 20px auto 0;
  max-width: 30ch;
  color: #b7c6c9;
  font-size: 1.06rem;
}

/* Countdown */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 30px;
}
.cd {
  padding: 12px 4px 10px;
  border: 1px solid rgba(201,162,39,.28);
  border-radius: 3px;
  background: linear-gradient(rgba(12,24,28,.75), rgba(6,12,15,.6));
  box-shadow: inset 0 1px 0 rgba(201,162,39,.12);
}
.cd__v {
  display: block;
  font-family: 'Pirata One', serif;
  font-size: 1.95rem;
  line-height: 1;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums;
}
.cd__l {
  display: block;
  margin-top: 5px;
  font-size: .66rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mist);
}

/* ───────────────────────── Pergament ───────────────────────── */

.sheet {
  position: relative;
  margin: 0 0 30px;
  padding: 34px 22px 30px;
  color: var(--sepia);
  background:
    radial-gradient(80% 55% at 18% 12%, rgba(255,250,232,.5), transparent 60%),
    radial-gradient(60% 40% at 85% 85%, rgba(128,98,56,.22), transparent 70%),
    radial-gradient(28% 18% at 72% 26%, rgba(150,118,70,.2), transparent 70%),
    linear-gradient(162deg, var(--parchment) 0%, var(--parch-mid) 58%, #c8b188 100%);
  border-radius: 2px 14px 3px 12px / 12px 3px 14px 3px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.22),
    inset 0 0 44px rgba(120,88,46,.35),
    inset 0 0 8px rgba(70,48,22,.4),
    var(--shadow-deep);
}
.sheet::after {
  content: ''; position: absolute; inset: 7px;
  border: 1px solid rgba(90,66,34,.28);
  border-radius: inherit;
  pointer-events: none;
}
.sheet + .sheet { transform: rotate(-.25deg); }

.sheet__title {
  font-family: 'Pirata One', serif;
  font-weight: 400;
  margin: 0;
  text-align: center;
  font-size: clamp(2.1rem, 8vw, 2.7rem);
  line-height: 1;
  color: #2a1f12;
  text-shadow: 0 1px 0 rgba(255,250,235,.45);
}

.rope {
  height: 11px;
  margin: 14px auto 20px;
  max-width: 260px;
  background:
    repeating-linear-gradient(68deg,
      rgba(120,92,52,.85) 0 5px,
      rgba(168,138,92,.85) 5px 10px);
  border-radius: 6px;
  box-shadow: inset 0 -2px 3px rgba(60,42,18,.5), inset 0 2px 2px rgba(255,240,210,.3);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.sheet__intro {
  margin: -4px 0 22px;
  text-align: center;
  color: var(--sepia-soft);
}

/* Fakten */
.facts { margin: 0 0 24px; }
.fact {
  display: grid;
  grid-template-columns: 5.4rem 1fr;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px dashed rgba(90,66,34,.35);
}
.fact:last-of-type { border-bottom: 0; }
.fact dt {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #6d5634;
  padding-top: .35em;
}
.fact dd { margin: 0; }
.fact strong { font-weight: 700; color: #241a0e; }

.maplink {
  display: inline-block;
  margin-top: 6px;
  color: #7a3b22;
  text-decoration-color: rgba(122,59,34,.4);
  text-underline-offset: 3px;
  font-size: .95rem;
}
.maplink:hover { color: var(--blood); }

/* ───────────────────────── Formular ───────────────────────── */

.field { margin-bottom: 20px; }

label {
  display: block;
  margin-bottom: 7px;
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6d5634;
}
.req { color: var(--blood); }
.opt {
  letter-spacing: .08em;
  text-transform: none;
  color: #8a7149;
  font-style: italic;
}

input[type=text], textarea {
  width: 100%;
  padding: 12px 13px;
  font-family: inherit;
  font-size: 1.05rem;
  color: #1f160c;
  background: rgba(255,250,236,.5);
  border: 1px solid rgba(90,66,34,.4);
  border-radius: 2px;
  box-shadow: inset 0 2px 5px rgba(90,66,34,.14);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
textarea { resize: vertical; min-height: 86px; }

input[type=text]::placeholder, textarea::placeholder { color: #a4906c; }

input[type=text]:focus, textarea:focus {
  outline: none;
  border-color: var(--brass-lo);
  box-shadow: inset 0 2px 5px rgba(90,66,34,.14), 0 0 0 3px rgba(201,162,39,.3);
}

/* Upload */
.drop {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 20px 14px;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  font-size: 1rem;
  color: #6b5331;
  text-align: center;
  cursor: pointer;
  background: rgba(255,250,236,.32);
  border: 1.5px dashed rgba(90,66,34,.5);
  border-radius: 3px;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.drop:hover, .drop.is-over { background: rgba(255,250,236,.6); border-color: var(--brass-lo); }
.drop__ico { width: 22px; height: 22px; flex: none; opacity: .75; }

.preview {
  position: relative;
  margin-top: 12px;
  border: 1px solid rgba(90,66,34,.4);
  border-radius: 3px;
  overflow: hidden;
  background: rgba(40,28,14,.1);
}
.preview img { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.preview__x {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  font-size: 20px; line-height: 1;
  color: #f0e6d2;
  background: rgba(10,16,20,.78);
  border: 1px solid rgba(240,230,210,.3);
  border-radius: 50%;
  cursor: pointer;
}
.preview__x:hover { background: var(--blood); }

.hint { margin: 8px 0 0; font-size: .88rem; color: #7b6540; font-style: italic; }

.err {
  margin: 7px 0 0;
  font-size: .9rem;
  color: var(--blood);
  font-weight: 600;
}
.formerr {
  margin: 14px 0 0;
  padding: 11px 13px;
  font-size: .95rem;
  color: #4a1510;
  background: rgba(140,43,34,.14);
  border-left: 3px solid var(--blood);
  border-radius: 2px;
}

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 15px 20px;
  font-family: 'Pirata One', serif;
  font-size: 1.4rem;
  letter-spacing: .04em;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: transform .12s var(--ease), filter .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--gold {
  margin-top: 6px;
  color: #241a06;
  background: linear-gradient(#f2d894 0%, var(--brass) 45%, #a07c17 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,245,210,.8),
    inset 0 -2px 0 rgba(90,66,10,.45),
    0 6px 18px rgba(0,0,0,.35);
}
.btn--gold:hover { filter: brightness(1.07); }
.btn--gold[disabled] { opacity: .65; cursor: progress; }

.btn--ghost {
  color: #4a3720;
  background: transparent;
  border: 1.5px solid rgba(90,66,34,.45);
  font-size: 1.15rem;
}
.btn--ghost:hover { background: rgba(90,66,34,.1); border-color: var(--brass-lo); }

.btn__spin { display: none; width: 17px; height: 17px; border: 2px solid rgba(36,26,6,.3); border-top-color: #241a06; border-radius: 50%; }
.is-busy .btn__spin { display: block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Erfolg */
.done { text-align: center; padding: 6px 0 4px; }
.done__flag { width: 108px; margin: 0 auto 14px; color: #5b4830; }
.done__flag svg { width: 100%; height: auto; }
.done__cloth { fill: #2a1f12; animation: wave 3.4s ease-in-out infinite; transform-origin: 12px 26px; }
@keyframes wave { 0%,100% { transform: skewY(0deg); } 50% { transform: skewY(-2.5deg); } }

.done__title {
  font-family: 'Pirata One', serif;
  font-weight: 400;
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 7.5vw, 2.4rem);
  line-height: 1.08;
  color: #2a1f12;
}
.done__title span { color: #7a3b22; }
.done__txt { margin: 0 auto 22px; max-width: 34ch; color: var(--sepia-soft); }

/* ───────────────────────── Fuß ───────────────────────── */

.foot {
  text-align: center;
  color: #6f8288;
  font-size: .85rem;
  line-height: 1.7;
}
.foot p { margin: 0; }
.foot__small { margin-top: 6px; opacity: .72; font-size: .78rem; }

/* ───────────────────────── Größere Schirme ───────────────────────── */

@media (min-width: 560px) {
  body { font-size: 18px; }
  .sheet { padding: 40px 34px 34px; }
  .countdown { gap: 12px; }
  .cd__v { font-size: 2.3rem; }
  .btn { width: auto; min-width: 260px; }
  .btn--gold { display: flex; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
