/* Shadowfall site - W11 (creator 2026-10-12: "texturi prea stridente unde e text, mai animat, mai încărcat").
   Calm surfaces under text (rich texture only at the edges), discreet motion (embers, fog, reveal on scroll, a shine on
   the logo, swaying banners, counting numbers, a header that tightens on scroll) and the home page's new sections.
   Everything that moves stops under prefers-reduced-motion. Loaded last, for the medieval / stone themes. */

/* ---- calm under text: a near-solid centre fading to the texture at the edges ---- */
.theme-piatra .feature, .theme-piatra .class-card, .theme-piatra .panel, .theme-piatra .dl-card, .theme-piatra .place,
.theme-piatra .shop-card, .theme-piatra .kingdom-card, .theme-piatra .chapter {
  background: radial-gradient(ellipse 85% 80% at 50% 45%, #121110f5 0%, #121110e6 55%, #12111080 100%),
              var(--t-black) 0 0 / 300px;
  background-clip: padding-box;
}
.theme-piatra section.prose.narrow, .theme-piatra .sheet {
  background: radial-gradient(ellipse 80% 75% at 50% 45%, #e2cfa8f2 0%, #dcc79ce0 55%, #dcc79c55 100%),
              url("../img/tex/parchment.webp") 0 0 / 420px;
}
.theme-piatra .control input, .theme-piatra .control input:focus,
.theme-piatra .news-grid.board .news-card, .theme-piatra .alert, .theme-piatra blockquote {
  background-image: radial-gradient(ellipse at 50% 50%, #00000000 55%, #5a3a142e 100%), url("../img/tex/parchment_soft.webp");
  background-size: auto, 300px;
}
.theme-piatra .step {
  background: var(--rivet) 6px 6px / 9px 9px no-repeat, var(--rivet) calc(100% - 6px) 6px / 9px 9px no-repeat,
              var(--rivet) 6px calc(100% - 6px) / 9px 9px no-repeat, var(--rivet) calc(100% - 6px) calc(100% - 6px) / 9px 9px no-repeat,
              linear-gradient(180deg, #ffffff0c, #00000070), url("../img/tex/iron_soft.webp") 0 0 / 256px;
}
.theme-piatra .hero-stats, .theme-piatra .class-chips li {
  background-image: var(--rivet), var(--rivet), var(--rivet), var(--rivet), linear-gradient(180deg, #ffffff10, #00000070),
                    url("../img/tex/iron_soft.webp");
}

/* ---- header: tightens once the page scrolls ---- */
.topbar-in { transition: height .3s ease; }
.topbar.scrolled .topbar-in { height: 54px; }
.topbar.scrolled { box-shadow: 0 8px 26px #000e; }

/* ---- hero: drifting fog and rising embers ---- */
.hero-fog, .hero-embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-fog::before, .hero-fog::after {
  content: ""; position: absolute; left: -30%; right: -30%; height: 55%; bottom: 0; opacity: .5;
  background: radial-gradient(ellipse 40% 60% at 20% 70%, #9aa0a033, transparent 70%),
              radial-gradient(ellipse 35% 50% at 60% 80%, #b0b4b029, transparent 70%),
              radial-gradient(ellipse 30% 45% at 90% 65%, #8a908c24, transparent 70%);
  filter: blur(8px); animation: fog-drift 60s ease-in-out infinite alternate;
}
.hero-fog::after { bottom: 10%; opacity: .35; animation-duration: 85s; animation-direction: alternate-reverse; }
@keyframes fog-drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
.ember {
  position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #ffd27a 0 30%, #ff8a2a 60%, transparent 70%); box-shadow: 0 0 6px 1px #ff7a1a99;
  animation: ember-rise var(--d, 9s) linear var(--w, 0s) infinite;
}
@keyframes ember-rise {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  10% { opacity: .9; }
  50% { transform: translate(var(--x, 30px), -45vh) scale(.8); opacity: .7; }
  100% { transform: translate(calc(var(--x, 30px) * -0.6), -90vh) scale(.3); opacity: 0; }
}

/* ---- the logo: a slow shine runs over the gold, only where the letters are ---- */
.logo-shine { position: relative; display: block; width: min(640px, 92%); margin: 0 auto 18px; }
.logo-shine .hero-logo { width: 100%; margin: 0; }
.logo-shine::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 40%, #fff6d0cc 50%, transparent 60%) -150% 0 / 250% 100% no-repeat;
  -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat;
  animation: logo-shine 7s ease-in-out 1.5s infinite;
}
@keyframes logo-shine { 0%, 55% { background-position: -150% 0; } 85%, 100% { background-position: 150% 0; } }

/* ---- reveal on scroll (only with JavaScript; site.js adds .reveal and then .in) ---- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal-stagger > * { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal-stagger.in > * { opacity: 1; transform: none; }
.js .reveal-stagger.in > *:nth-child(2) { transition-delay: .08s; } .js .reveal-stagger.in > *:nth-child(3) { transition-delay: .16s; }
.js .reveal-stagger.in > *:nth-child(4) { transition-delay: .24s; } .js .reveal-stagger.in > *:nth-child(5) { transition-delay: .32s; }
.js .reveal-stagger.in > *:nth-child(6) { transition-delay: .40s; } .js .reveal-stagger.in > *:nth-child(7) { transition-delay: .48s; }
.js .reveal-stagger.in > *:nth-child(8) { transition-delay: .56s; } .js .reveal-stagger.in > *:nth-child(9) { transition-delay: .64s; }
.js .reveal-stagger.in > *:nth-child(10) { transition-delay: .72s; }

/* ---- hover: lift + a warm edge ---- */
.theme-medieval .feature, .theme-medieval .class-card, .theme-medieval .chapter, .theme-medieval .place, .theme-medieval .kingdom-card {
  transition: transform .25s ease, filter .25s ease;
}
.theme-medieval .feature:hover, .theme-medieval .class-card:hover, .theme-medieval .chapter.open:hover, .theme-medieval .place:hover {
  transform: translateY(-4px); filter: brightness(1.1) drop-shadow(0 10px 22px #000) drop-shadow(0 0 12px #c9a14a26);
}
.theme-medieval .class-card:hover .class-ico.ghost { opacity: .12; transform: rotate(-6deg) scale(1.05); }
.theme-medieval .class-card .class-ico.ghost { transition: opacity .4s, transform .6s; }
.theme-medieval .step span { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.theme-medieval .step:hover span { transform: scale(1.12) rotate(-6deg); }
.theme-medieval .news-grid.board .news-card { transition: transform .3s ease; }
.theme-medieval .news-grid.board .news-card:hover { transform: rotate(0deg) translateY(-4px) scale(1.02); }
.theme-medieval .package { transition: transform .25s ease, box-shadow .25s ease; }
.theme-medieval .package:hover { transform: translateY(-4px); box-shadow: 0 16px 30px #000c, 0 0 30px #c9a14a22; }
.theme-medieval .package-ico { animation: ruby-glow 3.2s ease-in-out infinite; }
@keyframes ruby-glow { 50% { filter: drop-shadow(0 0 16px #ff3b4a99); } }

/* ---- swaying banners (World page, home "Regatele") ---- */
.kingdom-banner, .banner { transform-origin: 50% 0; animation: sway 6s ease-in-out infinite; }
.kingdom:nth-child(2) .kingdom-banner, .kingdom-card:nth-child(2) .banner { animation-delay: -3s; }
@keyframes sway { 0%, 100% { transform: rotate(-1.6deg) skewX(.6deg); } 50% { transform: rotate(1.6deg) skewX(-.6deg); } }

/* ---- an ornament between sections ---- */
.divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 auto; padding: 8px 16px; max-width: 760px; }
.divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #c9a14a99); }
.divider span:last-child { background: linear-gradient(90deg, #c9a14a99, transparent); }
.divider svg { width: 74px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.4; }
.divider svg .gem { fill: var(--blood); stroke: var(--gold2); }

/* ---- home: the two kingdoms face to face ---- */
.kingdoms-home { display: grid; grid-template-columns: 1fr auto 1fr; gap: 26px; align-items: stretch; margin-top: 34px; }
.kingdom-card { position: relative; padding: 0 30px 30px; text-align: center; border: 18px solid transparent;
  border-image: url("../img/ui/panel_plain.png") 40 / 18px; }
.kingdom-card .banner {
  width: 110px; height: 168px; margin: -18px auto 18px; position: relative; display: grid; place-items: center;
  background: linear-gradient(90deg, #00000055, transparent 25% 75%, #00000055), var(--k);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 50% 100%, 0 88%);
  box-shadow: inset 0 -10px 18px #0007;
}
.kingdom-card .banner::before { content: ""; position: absolute; inset: 0 8px 14px; border: 2px solid #e8c97788; border-top: 0;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 50% 100%, 0 88%); }
.kingdom-card .banner svg { width: 54px; height: 54px; fill: none; stroke: #f3d79a; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 2px 0 #0008); margin-top: -18px; }
.kingdom-card h3 { font-size: 1.8rem; color: color-mix(in srgb, var(--k) 45%, white); margin-bottom: .2em; }
.kingdom-card .motto { font-family: var(--fell, serif); font-style: italic; color: #c9b88f; margin-bottom: .8em; }
.kingdom-card p { color: #d3c9b3; margin: 0; }
.versus { align-self: center; font: 700 2.2rem "Uncial", var(--serif); color: var(--gold); text-shadow: 0 0 20px #c9a14a66, 0 2px 0 #000; }

/* ---- home: the chapters of the story ---- */
.chapters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 30px; }
.chapter { position: relative; padding: 20px 18px 18px; border: 16px solid transparent; border-image: url("../img/ui/panel_plain.png") 40 / 16px; min-height: 190px; }
.chapter .num { font: 600 .78rem var(--serif); letter-spacing: .2em; color: var(--gold); text-transform: uppercase; }
.chapter h3 { font-size: 1.12rem; margin: .35em 0 .3em; }
.chapter .lvl { display: inline-block; font-size: .8rem; padding: .1em .6em; border: 1px solid #c9a14a66; border-radius: 99px; color: #e2d3ad; margin-bottom: .6em; }
.chapter p { font-size: .98rem; color: #cfc4ad; margin: 0; }
.chapter.sealed { filter: saturate(.4) brightness(.75); }
.chapter.sealed h3, .chapter.sealed p { color: #8f8574; }
.chapter.sealed .seal { position: absolute; right: 12px; bottom: 12px; width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 47% 53% 50% 46% / 52% 46% 54% 48%; color: #f3d79a; font-size: 1.1rem;
  background: radial-gradient(circle at 35% 30%, #d0434a 0 12%, #a3171e 40%, #6e0c11 72%, #4a070a 100%); box-shadow: 0 3px 6px #000c; }
.chapter.open .status-tag { display: inline-block; margin-left: 6px; font-size: .74rem; color: #a9d69d; }

/* ---- home: pictures from the world ---- */
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 220px 220px; gap: 12px; margin-top: 30px; }
.gallery figure { position: relative; margin: 0; overflow: hidden; border: 1px solid #000; box-shadow: 0 0 0 1px #c9a14a44, 0 10px 24px #000c; }
.gallery figure:first-child { grid-row: 1 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease, filter .6s ease; filter: saturate(.85) brightness(.85); }
.gallery figure:hover img { transform: scale(1.06); filter: saturate(1) brightness(1); }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; font-family: var(--serif); font-size: .85rem;
  letter-spacing: .08em; color: #f1e6cd; background: linear-gradient(0deg, #000000cc, transparent); }

@media (max-width: 960px) {
  .kingdoms-home { grid-template-columns: 1fr; }
  .versus { justify-self: center; }
  .chapters { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 200px 140px 140px; }
  .gallery figure:first-child { grid-column: 1 / 3; grid-row: auto; }
}
@media (max-width: 620px) { .chapters { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .ember, .hero-fog::before, .hero-fog::after, .logo-shine::after, .kingdom-banner, .banner, .package-ico { animation: none !important; }
  .ember { display: none; }
  .js .reveal, .js .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
}
