/* light-theme: manual
   nexcraft.html "Vom Weizen zum Amethyst" compact tier showcase
   (assets/js/nexcraft-genstory.js). Without JS the tiers are a plain list. */

.gen-story { position: relative; margin: 3rem 0; }

.gs-sticky { padding: 1rem 0; }
.gen-story.is-enhanced .gs-sticky {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.gs-head { text-align: center; }

.gs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border: 2px solid #000;
  background: #3d8a22;
  color: #fff;
  font: 700 0.75rem/1 var(--mc-font, "Monocraft", monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 2px 2px 0 #7fdc58, inset -2px -2px 0 #23560f;
}

.gs-head h2 {
  margin: 0.8rem 0 0;
  font-family: var(--mc-font, "Monocraft", monospace);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  color: #fff;
  text-shadow: 3px 3px 0 #1d4a0c;
}

.gs-head h2 .kw { text-shadow: none; filter: drop-shadow(3px 3px 0 #1d4a0c); }

.gs-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- the block ---------- */
.gs-stage-visual { display: none; position: relative; height: 340px; }
.gen-story.is-enhanced .gs-stage-visual { display: grid; place-items: center; }

.gs-cube {
  --s: 150px;
  position: relative;
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  transform: rotateX(-28deg) rotateY(45deg);
  animation: gsFloat 4s ease-in-out infinite;
}

/* all tiers stay rendered (opacity, not visibility/display) so their textures
   are always decoded; the cube only shows once every texture is ready */
.gs-tier { position: absolute; inset: 0; transform-style: preserve-3d; opacity: 0; }
.gs-tier.is-on { opacity: 1; }
.gs-cube { visibility: hidden; } /* opacity < 1 would flatten the 3D cube */
.gs-cube.is-ready { visibility: visible; }

.gs-cube i {
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
  image-rendering: pixelated;
  outline: 2px solid rgba(0, 0, 0, 0.55);
  outline-offset: -1px;
}

/* Minecraft-style face shading: top full light, sides darker */
.gs-left { filter: brightness(0.8); }
.gs-right { filter: brightness(0.6); }
.gs-top { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.gs-left { transform: translateZ(calc(var(--s) / 2)); }
.gs-right { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }

.gs-cube.is-pop { animation: gsPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), gsFloat 4s ease-in-out 0.5s infinite; }

@keyframes gsFloat {
  0%, 100% { transform: rotateX(-28deg) rotateY(45deg) translateY(0); }
  50% { transform: rotateX(-28deg) rotateY(45deg) translateY(-12px); }
}

/* no filter/opacity on the cube itself: that would flatten the 3D faces
   (the "only one face first" glitch) - the faces flash instead */
@keyframes gsPop {
  0% { transform: rotateX(-28deg) rotateY(45deg) scale(0.7); }
  100% { transform: rotateX(-28deg) rotateY(45deg) scale(1); }
}

.gs-cube.is-pop .gs-tier.is-on i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  animation: gsFlash 0.45s ease-out forwards;
}

@keyframes gsFlash { from { opacity: 0.55; } to { opacity: 0; } }

.gs-shadow {
  position: absolute;
  bottom: 52px;
  width: 170px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(rgba(0, 0, 0, 0.55), transparent 70%);
}

.gs-level {
  position: absolute;
  bottom: 0;
  padding: 0.4rem 0.9rem;
  border: 2px solid #000;
  background: #1c1f26;
  color: #c8c8c8;
  font: 600 0.95rem var(--mc-font, "Monocraft", monospace);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.12), inset -2px -2px 0 rgba(0, 0, 0, 0.5);
}

.gs-level b { color: #ffff55; font-size: 1.15rem; }

/* drops flying out of the block */
.gs-drops { position: absolute; left: 50%; top: 42%; width: 0; height: 0; }
.gs-drop-item {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px;
  background: var(--gs-drop, #ffff55);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.35), 0 0 10px var(--gs-drop, #ffff55);
  animation: gsDrop 1.25s cubic-bezier(0.3, 0.7, 0.5, 1) forwards;
}
@keyframes gsDrop {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  45% { transform: translate(calc(var(--dx) * 0.6), -90px) rotate(var(--dr)); }
  100% { transform: translate(var(--dx), 70px) rotate(calc(var(--dr) * 2)); opacity: 0; }
}

/* ---------- stage cards ---------- */
.gs-stages { display: grid; gap: 1rem; }
.gen-story.is-enhanced .gs-stages { display: grid; grid-template-areas: "stack"; gap: 0; }
.gen-story.is-enhanced .gs-stage {
  grid-area: stack;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.gen-story.is-enhanced .gs-stage.is-active { opacity: 1; transform: none; pointer-events: auto; }

.gs-stage {
  padding: 1.4rem 1.5rem;
  border: 3px solid #000;
  background: #1c1f26;
  box-shadow: inset 4px 4px 0 rgba(255, 255, 255, 0.12), inset -4px -4px 0 rgba(0, 0, 0, 0.5);
}

.gs-stage-kicker { color: #55ffff; font: 600 0.8rem var(--mc-font, "Monocraft", monospace); letter-spacing: 0.06em; }
.gs-stage h3 { margin: 0.35rem 0 0.6rem; color: #fff; font: 700 1.9rem var(--mc-font, "Monocraft", monospace); text-shadow: 3px 3px 0 #3f3f3f; }
.gs-stage p { margin: 0 0 1rem; color: #c8c8c8; line-height: 1.6; }

.gs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin: 0; }
.gs-stats div {
  padding: 0.55rem 0.6rem;
  border: 2px solid #000;
  background: #2b2b2b;
  box-shadow: inset 2px 2px 0 #121212, inset -2px -2px 0 #6b6b6b;
}
.gs-stats dt { color: #aaa; font: 600 0.68rem var(--mc-font, "Monocraft", monospace); letter-spacing: 0.06em; text-transform: uppercase; }
.gs-stats dd { margin: 0.2rem 0 0; color: #ffff55; font: 700 0.9rem var(--mc-font, "Monocraft", monospace); text-shadow: 2px 2px 0 #3f3f15; overflow-wrap: break-word; }

/* ---------- progress steps ---------- */
.gs-progress { display: none; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.gen-story.is-enhanced .gs-progress { display: flex; }
.gs-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  color: #8a8a8a;
  font: 600 0.75rem var(--mc-font, "Monocraft", monospace);
  cursor: pointer;
}
.gs-dot::before {
  content: "";
  width: 46px;
  height: 10px;
  border: 2px solid #000;
  background: #3a3a3a;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.gs-dot.is-done::before { background: #80ff20; box-shadow: 0 0 10px rgba(128, 255, 32, 0.5); }
.gs-dot.is-current { color: #ffff55; }
.gs-dot:hover { color: #fff; }

@media (max-width: 760px) {
  .gs-dot::before { width: 34px; }
  .gs-dot span { display: none; }
  .gs-grid { grid-template-columns: 1fr; gap: 0.6rem; }
  .gs-stage-visual { height: 230px; }
  .gs-cube { --s: 105px; }
  .gs-shadow { bottom: 40px; width: 120px; }
  .gs-stage { padding: 1rem 1.1rem; }
  .gs-stage h3 { font-size: 1.5rem; }
  .gs-stage p { font-size: 0.92rem; margin-bottom: 0.7rem; }
  .gen-story.is-enhanced .gs-sticky { gap: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gs-cube, .gs-cube.is-pop { animation: none; }
  .gen-story.is-enhanced .gs-stage { transition: none; }
}

/* light theme: the Minecraft GUI stays dark-on-light like the rest of the page */
html[data-theme="light"] .gs-head h2 { color: #2b2b2b; text-shadow: 3px 3px 0 #7fdc58; }
html[data-theme="light"] .gs-head h2 .kw { filter: none; }
html[data-theme="light"] .gs-stage { background: #c6c6c6; box-shadow: inset 4px 4px 0 #fff, inset -4px -4px 0 #555; }
html[data-theme="light"] .gs-stage h3 { color: #2b2b2b; text-shadow: none; }
html[data-theme="light"] .gs-stage p { color: #3f3f3f; }
html[data-theme="light"] .gs-stage-kicker { color: #0e7490; }
html[data-theme="light"] .gs-stats div { background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; }
html[data-theme="light"] .gs-stats dt { color: #eee; }
html[data-theme="light"] .gs-dot { color: #555; }
html[data-theme="light"] .gs-dot.is-current { color: #2b2b2b; }
