/* Veinhaven – Idle Mining — Landingpage „Abstieg in die Mine“ (Nutzer 14.10.2026, Stil A).
   Beim Scrollen fährt man von der Oberfläche bis in die Kristallhöhle hinunter.
   Alles lokal (Schrift, Bilder) — keine Anfragen an fremde Server. */

@font-face {
  font-family: 'Jersey 10';
  src: url('fonts/Jersey10_400Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  --ink: #1e120b;
  --text: #f6e7c8;
  --text-dim: #c9b08a;
  --gold: #ffd86a;
  --gold-btn: #d99a1e;
  --gold-btn-light: #f5c83a;
  --gold-btn-shadow: #8a5a10;
  --gold-btn-text: #2a1a08;
  --wood: #6b4428;
  --wood-light: #9a6440;
  --wood-shadow: #452a18;
  --panel: rgba(30, 18, 11, 0.78);
  --crystal: #9ff0ff;
  --gutter: 16px;
  --font: 'Jersey 10', 'Trebuchet MS', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  background: #1c1714;
  color: var(--text);
  font-family: var(--font);
  font-size: 22px;
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  image-rendering: pixelated;
  max-width: 100%;
}

a {
  color: var(--gold);
}

h1,
h2 {
  font-weight: 400;
  margin: 0 0 12px;
  line-height: 0.95;
  text-shadow: 0 3px 0 var(--ink);
}

h1 {
  font-size: clamp(56px, 11vw, 104px);
  color: var(--gold);
}

h1 span {
  color: var(--text);
}

h2 {
  font-size: clamp(40px, 7vw, 64px);
  color: var(--gold);
}

p {
  margin: 0 0 14px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--gold);
  color: var(--ink);
  padding: 6px 10px;
  z-index: 100;
}

.skip:focus {
  left: 8px;
}

.wrap {
  width: min(1100px, 100% - 2 * var(--gutter));
  margin: 0 auto;
}

.kicker {
  color: var(--text-dim);
  font-size: 22px;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.lead {
  font-size: 25px;
}

.text {
  background: var(--panel);
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--wood-light);
  border-radius: 10px;
  padding: 20px 22px 10px;
}

.text-center {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 24px;
}

.list {
  padding-left: 0;
  list-style: none;
  margin: 0 0 14px;
}

.list li {
  padding-left: 26px;
  position: relative;
  margin-bottom: 4px;
}

.list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 7px;
  width: 10px;
  height: 10px;
  background: var(--gold);
  box-shadow: 2px 2px 0 var(--gold-btn-shadow);
  transform: rotate(45deg);
}

/* ---------- Knöpfe im Spiel-Stil ---------- */
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
}

.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 26px;
  line-height: 1;
  padding: 12px 22px 13px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  border: 3px solid var(--ink);
  transition: transform 0.08s;
}

.btn:active {
  transform: translateY(2px);
}

.btn-gold {
  background: var(--gold-btn);
  color: var(--gold-btn-text);
  box-shadow: inset 0 3px 0 var(--gold-btn-light), inset 0 -4px 0 var(--gold-btn-shadow);
}

.btn-wood {
  background: var(--wood);
  color: var(--text);
  box-shadow: inset 0 3px 0 var(--wood-light), inset 0 -4px 0 var(--wood-shadow);
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--crystal);
  outline-offset: 2px;
}

/* ---------- Kopfleiste ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--gutter);
  background: linear-gradient(rgba(28, 23, 20, 0.92), rgba(28, 23, 20, 0.75));
  border-bottom: 3px solid var(--ink);
  backdrop-filter: blur(4px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  text-decoration: none;
  font-size: 30px;
}

.brand img {
  border-radius: 8px;
  image-rendering: auto;
}

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

.nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 24px;
}

.nav a:hover {
  color: var(--gold);
}

.nav-cta {
  background: var(--gold-btn);
  color: var(--gold-btn-text) !important;
  padding: 2px 12px 4px;
  border-radius: 6px;
  border: 2px solid var(--ink);
}

/* ---------- Tiefenmesser rechts ---------- */
.depth {
  position: fixed;
  right: 6px;
  top: 76px;
  bottom: 20px;
  width: 14px;
  z-index: 40;
  pointer-events: none;
}

.depth-rail {
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(var(--wood-light) 0 6px, transparent 6px 10px);
  opacity: 0.7;
}

.depth-cage {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 18px;
  background: var(--wood);
  border: 2px solid var(--ink);
  box-shadow: inset 0 2px 0 var(--wood-light);
  border-radius: 2px;
  transform: translateY(calc(var(--progress, 0) * (100cqh - 18px)));
}

.depth {
  container-type: size;
}

.depth-label {
  position: absolute;
  right: 18px;
  top: -3px;
  white-space: nowrap;
  font-size: 20px;
  color: var(--gold);
  text-shadow: 0 2px 0 var(--ink);
}

/* ---------- Schichten (Abschnitte) ---------- */
.layer {
  position: relative;
  padding: 90px 0 0;
}

.layer > .wrap {
  padding-bottom: 70px;
}

.layer-sky {
  background: linear-gradient(#4a8fd8, #8cc4ef 60%, #6aa35a 100%);
  padding-top: 84px;
}

.layer-dawn {
  background: linear-gradient(#58884a, #4c6a3a 30%, #5a4430 100%);
}

.layer-dusk {
  background: linear-gradient(#5a4430, #4a3426 50%, #3a281c 100%);
}

.layer-cave {
  background: linear-gradient(#3a281c, #2a1d15 60%, #20160f 100%);
}

.layer-deep {
  background: linear-gradient(#20160f, #181009 100%);
}

.layer-crew {
  background: linear-gradient(#181009, #141018 100%);
}

.layer-crystal {
  background: radial-gradient(ellipse at 50% 70%, #1f4a5a 0%, #12222c 45%, #0c1016 100%);
  padding-bottom: 60px;
}

/* Gesteinsschicht zwischen zwei Abschnitten, mit Tiefenangabe */
.strata {
  position: relative;
  height: 46px;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(0, 0, 0, 0.18) 7% 9%, transparent 9% 31%,
      rgba(0, 0, 0, 0.18) 31% 33%, transparent 33% 64%, rgba(0, 0, 0, 0.18) 64% 66%, transparent 66%),
    var(--strata, #4a3424);
  border-top: 4px solid rgba(0, 0, 0, 0.35);
  border-bottom: 4px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 12%, 6% 0, 14% 10%, 22% 2%, 31% 12%, 40% 0, 52% 9%, 61% 1%, 70% 11%, 79% 0, 88% 10%,
      96% 2%, 100% 8%, 100% 100%, 0 100%);
}

.strata span {
  color: rgba(246, 231, 200, 0.7);
  font-size: 20px;
  letter-spacing: 2px;
}

.strata-grass {
  --strata: #4f6b34;
}

.strata-dirt {
  --strata: #5e4630;
}

.strata-rock {
  --strata: #3e2f25;
}

.strata-deep {
  --strata: #2a201a;
}

.strata-crystal {
  --strata: #1d2228;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}

.hero-text {
  background: var(--panel);
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--wood-light);
  border-radius: 10px;
  padding: 22px 24px 12px;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--text-dim);
}

.facts li {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Szenen aus dem Spiel (Ebenen übereinander, 1 : 2 wie im Spiel) ---------- */
.scene {
  position: relative;
  width: min(380px, 100%);
  aspect-ratio: 1 / 2;
  margin: 0 auto;
  border: 4px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--wood-light), 0 18px 40px rgba(0, 0, 0, 0.45);
  background: #2a1c13;
}

.scene .sc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene .clouds {
  animation: drift 40s linear infinite alternate;
}

.scene .sun {
  inset: auto;
  left: 64%;
  top: 5%;
  width: 22%;
  height: auto;
  animation: bob 6s ease-in-out infinite;
}

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

@keyframes bob {
  50% {
    transform: translateY(-1.5%);
  }
}

/* Bilderbogen: Hintergrund-Ausschnitt, das Bild wählt main.js */
.sprite {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: calc(var(--frames) * 100%) 100%;
  background-position: calc(var(--frame, 0) * 100% / (var(--frames) - 1)) 0;
  image-rendering: pixelated;
}

.sprite-borin {
  --frames: 15;
  background-image: url('img/sprites/dwarf-day.png');
}

.sprite-smith {
  --frames: 9;
  background-image: url('img/scene/forge-smith-evening.png');
}

.sprite-ella {
  --frames: 15;
  background-image: url('img/sprites/ella-day.png');
}

.sprite-miner {
  --frames: 15;
}

.sprite-kobold {
  --frames: 4;
  background-image: url('img/shaft/kobold.png');
}

.sprite-boulder {
  --frames: 3;
  background-image: url('img/shaft/boulder.png');
  background-size: 300% 400%;
  background-position: calc(var(--frame, 0) * 50%) calc(var(--row, 0) * 100% / 3);
}

.sprite-chest {
  --frames: 2;
  background-image: url('img/shaft/chest.png');
  background-size: 200% 400%;
  background-position: calc(var(--frame, 0) * 100%) calc(var(--row, 3) * 100% / 3);
}

/* Borin läuft vor dem Berg hin und her (Bild 40 × 46 in einer 180 breiten Szene) */
.walker {
  position: absolute;
  left: 8%;
  top: 74%;
  width: 22%;
  aspect-ratio: 40 / 46;
  transition: left 0.1s linear;
}

.walker.flip .sprite {
  transform: scaleX(-1);
}

/* Schmiedin am Amboss (wie im Spiel: x 194, y 388, 96 × 92 in 360 × 720) */
.smith {
  position: absolute;
  left: 53.9%;
  top: 53.9%;
  width: 26.67%;
  height: 12.78%;
}

/* ---------- Zweispaltig: Szene + Text ---------- */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: center;
}

.split-rev {
  grid-template-columns: 1.1fr 0.9fr;
}

.ore-row {
  display: flex;
  gap: 10px;
  margin: 4px 0 12px;
}

/* ---------- Expeditionen ---------- */
.expedition {
  display: grid;
  grid-template-columns: 150px repeat(3, 1fr);
  gap: 14px;
  align-items: end;
}

.ella {
  aspect-ratio: 60 / 62;
  width: 150px;
}

.level {
  margin: 0;
  border: 4px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--wood-light);
  background: #000;
}

.level img {
  display: block;
  width: 100%;
  aspect-ratio: 480 / 204;
}

.level figcaption {
  padding: 6px 10px 8px;
  background: var(--panel);
  color: var(--text-dim);
}

/* ---------- Schacht ---------- */
.shaft {
  position: relative;
  width: min(420px, 100%);
  aspect-ratio: 180 / 200;
  margin: 0 auto;
  border: 4px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--wood-light), 0 18px 40px rgba(0, 0, 0, 0.5);
}

.shaft .sc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 115%;
  object-fit: cover;
  object-position: center top;
}

.shaft-wall {
  position: absolute;
  right: -6%;
  top: -2%;
  height: 104%;
  width: auto;
  max-width: none;
}

.shaft.hit .shaft-wall {
  animation: wall-shake 0.14s;
}

@keyframes wall-shake {
  30% {
    transform: translateX(3px);
  }

  70% {
    transform: translateX(-2px);
  }
}

.shaft-miner {
  position: absolute;
  width: 36%;
  aspect-ratio: 60 / 62;
}

.shaft-miner.m1 {
  left: 6%;
  top: 30%;
}

.shaft-miner.m2 {
  left: 20%;
  top: 40%;
}

.shaft-miner.m3 {
  left: 34%;
  top: 50%;
}

.kobold {
  position: absolute;
  left: 40%;
  top: 8%;
  width: 18%;
  aspect-ratio: 1;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
  pointer-events: none;
}

.kobold.on {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.finale {
  width: 144px;
  aspect-ratio: 72 / 60;
  margin: 6px 0 14px;
}

.finale.shake {
  animation: wall-shake 0.12s;
}

/* ---------- Figuren ---------- */
.crew {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.member {
  position: relative;
  background: var(--panel);
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 2px #c9c2b8;
  border-radius: 10px;
  padding: 10px 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s;
  font: inherit;
  color: inherit;
  width: 100%;
}

.member:hover {
  transform: translateY(-3px);
}

.member-pic {
  display: block;
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 6px;
}

.member-pic img,
.member-pic .sprite {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.member-pic .sprite {
  opacity: 0;
  transform: scale(1.15) translateY(-4%);
}

.member.active .member-pic img {
  opacity: 0;
}

.member.active .member-pic .sprite {
  opacity: 1;
}

.member-name {
  display: block;
  font-size: 24px;
  color: var(--text);
}



.hint-touch {
  color: var(--gold);
}


/* ---------- Beta / Kristallhöhle ---------- */
.beta {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  background: rgba(12, 20, 26, 0.82);
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 2px #4aa8c0, 0 0 60px rgba(159, 240, 255, 0.18);
  border-radius: 12px;
  padding: 18px 22px 16px;
}

.beta h2 {
  color: var(--crystal);
}

.chest {
  width: 120px;
  aspect-ratio: 40 / 36;
  margin: -70px auto 8px;
  filter: drop-shadow(0 0 18px rgba(159, 240, 255, 0.5));
}

.signup {
  display: grid;
  gap: 12px;
  text-align: left;
  margin-top: 10px;
}

.field span {
  display: block;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.field input,
.field select {
  width: 100%;
  font: inherit;
  font-size: 22px;
  color: var(--text);
  background: #1a1410;
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 2px #4a3a2e;
  border-radius: 8px;
  padding: 8px 10px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 18px;
  color: var(--text-dim);
}

.check input {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  flex: none;
  accent-color: var(--gold-btn);
}

.signup .btn {
  justify-self: center;
}

.signup-msg {
  text-align: center;
  min-height: 1.2em;
  color: var(--crystal);
  margin: 0;
}

/* ---------- Fuß ---------- */
.footer {
  background: #0a0c10;
  border-top: 3px solid var(--ink);
  padding: 18px 0 24px;
  color: var(--text-dim);
  font-size: 19px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}

.footer p {
  margin: 0;
}

.footer nav {
  display: flex;
  gap: 18px;
}

.credits {
  width: 100%;
  font-size: 16px;
  opacity: 0.7;
}

/* ---------- Einblenden beim Scrollen ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s, transform 0.6s;
}

.reveal.seen {
  opacity: 1;
  transform: none;
}

/* ---------- Unterseiten (Impressum, Datenschutz) ---------- */
.page {
  padding: 100px 0 60px;
  min-height: 100vh;
  background: linear-gradient(#2a1d15, #141018);
}

.page .text {
  max-width: 760px;
  margin: 0 auto;
}

.page h2 {
  font-size: 32px;
  margin-top: 18px;
}

.todo {
  background: rgba(255, 122, 102, 0.15);
  border: 2px dashed #ff7a66;
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffb8a8;
}

/* ---------- Handy ---------- */
@media (max-width: 820px) {
  body {
    font-size: 20px;
  }

  .hero,
  .split,
  .split-rev {
    grid-template-columns: 1fr;
  }

  /* Szene über dem Text, außer in der Schmiede (Text zuerst, Bild danach passt dort) */
  .hero .scene {
    order: -1;
    width: min(260px, 70%);
  }

  .scene {
    width: min(260px, 70%);
  }

  .expedition {
    grid-template-columns: 1fr 1fr;
  }

  .ella {
    width: 110px;
    justify-self: center;
    grid-column: 1 / -1;
  }

  .level:last-child {
    grid-column: 1 / -1;
  }

  .nav {
    gap: 10px;
  }

  .nav a {
    font-size: 21px;
  }

  .depth-label {
    display: none;
  }

  .layer {
    padding-top: 70px;
  }

  .crew {
    grid-template-columns: repeat(2, 1fr);
  }


}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scene .clouds,
  .scene .sun {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
