/* Realms of Elynia — forge-rituaalin ulkoasu (lataus, säteily, reveal, reroll-
   vertailu). OMA tiedosto, koska sekä peli (index.html) ETTÄ wikin Forge-
   simulaattori lataavat sen: rituaalin pitää näyttää ja tuntua identtiseltä
   molemmissa, eikä sitä saa ylläpitää kahtena kopiona.

   .sheet-backdrop on KOPIO styles.css:stä. Alkuperäinen jää sinne, koska
   muutkin modaalit nojaavat siihen (character-sheet, character, forge,
   professions); peli lataa molemmat tiedostot ja säännöt ovat identtiset,
   wiki saa taustan vain täältä. */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(36, 28, 18, .55);
}

/* ============================================================ Ascension ritual */
.forge-ascend .ascend-info { margin: 4px 0 12px; font-size: 14px; color: var(--night-text, #EDE4CF); }
.ascend-fervor { color: var(--gold); font-weight: 700; }
.ascend-plus { color: var(--rarity-uncommon); font-weight: 700; }

.ascend-backdrop {
  display: flex; align-items: center; justify-content: center;
  /* forge.jpg näkyy himmeänä rituaalin takana (sama alttari mistä juuri
     klikkasit) — tumma radial-gradient scrim päällä pitää kortin luettavana. */
  background-image:
    radial-gradient(120% 90% at 50% 40%, rgba(20,14,6,.86), rgba(10,7,3,.95)),
    url('/assets/scenes/forge.jpg');
  background-size: cover, cover;
  background-position: center, center 30%;
}
.ascend-stage {
  position: relative; width: min(440px, 92vw); padding: 26px 22px 22px; text-align: center;
  border: 1px solid var(--bronze); border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, #2A2114, #1A140C);
  box-shadow: 0 10px 44px rgba(0,0,0,.6);
}
.ascend-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ascend-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .03em; }
.ascend-arrow { font-size: 14px; color: var(--night-text); }

.ascend-core { position: relative; width: 150px; height: 150px; margin: 4px auto; display: grid; place-items: center; }
.ascend-glow {
  position: absolute; width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,75,.95), rgba(201,162,75,.18) 60%, transparent 72%);
  filter: blur(2px); opacity: .45;
}
.ascend-ring { position: absolute; width: 118px; height: 118px; border-radius: 50%; border: 2px dashed rgba(201,162,75,.5); opacity: .5; }
.ascend-spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); opacity: 0; }

.ascend-bar { height: 8px; border-radius: 5px; margin: 14px auto 2px; width: 82%; background: rgba(0,0,0,.4); border: 1px solid var(--bronze); overflow: hidden; }
.ascend-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--bronze), var(--gold)); box-shadow: 0 0 10px var(--gold); }

.ascend-stage.charging .ascend-fill { animation: ascend-fill 1.8s cubic-bezier(.45,.05,.55,1) forwards; }
.ascend-stage.charging .ascend-glow { animation: ascend-pulse .55s ease-in-out infinite alternate; }
.ascend-stage.charging .ascend-ring { animation: ascend-spin 2.2s linear infinite; }
@keyframes ascend-fill { from { width: 0; } to { width: 100%; } }
@keyframes ascend-pulse { from { opacity: .45; transform: scale(.85); } to { opacity: 1; transform: scale(1.28); } }
@keyframes ascend-spin { to { transform: rotate(360deg); } }

.ascend-stage.reveal-success .ascend-glow { opacity: 1; animation: ascend-burst .7s ease-out forwards; }
.ascend-stage.reveal-success .ascend-ring { border-color: var(--gold); opacity: 1; box-shadow: 0 0 24px var(--gold); }
@keyframes ascend-burst { 0% { transform: scale(.6); opacity: 1; } 60% { transform: scale(2.4); opacity: .9; } 100% { transform: scale(3.3); opacity: 0; } }
.ascend-stage.reveal-success::after { content: ""; position: absolute; inset: 0; pointer-events: none; animation: ascend-flash .6s ease-out forwards; }
@keyframes ascend-flash { 0% { box-shadow: inset 0 0 0 rgba(201,162,75,0); } 25% { box-shadow: inset 0 0 70px rgba(201,162,75,.6); } 100% { box-shadow: inset 0 0 0 rgba(201,162,75,0); } }

.ascend-stage.reveal-fail .ascend-glow { opacity: .15; transform: scale(.6); background: radial-gradient(circle, rgba(150,60,50,.5), transparent 65%); transition: all .5s; }
.ascend-stage.reveal-fail .ascend-ring { border-color: rgba(150,70,60,.5); opacity: .3; }

.ascend-result { min-height: 40px; margin-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ascend-msg { margin: 0; font-size: 16px; }
.ascend-msg.success { font-family: var(--font-display); font-weight: 700; letter-spacing: .03em; }
.ascend-msg.fail { color: #D9B7A9; font-size: 14px; }
.ascend-done { min-width: 140px; min-height: 42px; }

/* Reroll keep/take -päätös: nykyiset vs uudet affiksit + kaksi valintaa. */
.reroll-decide { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.reroll-compare {
  display: flex; align-items: stretch; justify-content: center; gap: 12px;
  flex-wrap: wrap; width: 100%;
}
.reroll-col {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  padding: 8px 12px; border: 1px solid var(--night-line); border-radius: 8px;
  background: rgba(20, 15, 8, .4); min-width: 120px;
}
.reroll-col-title {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--night-muted, #b7a98c);
}
.reroll-col .ritual-affixes { margin-left: 0; flex-direction: column; gap: 4px; }
.reroll-none { opacity: .6; font-style: italic; }
.reroll-arrow { align-self: center; font-size: 20px; color: var(--bronze); }
.reroll-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.reroll-take, .reroll-keep { min-width: 140px; min-height: 42px; }
.reroll-note { margin: 0; font-size: 12px; color: var(--night-muted, #b7a98c); }
.reroll-err { margin: 4px 0 0; font-size: 13px; color: #D9B7A9; }
.ascend-mute {
  position: absolute; top: 8px; right: 10px; background: transparent; border: 1px solid var(--bronze);
  color: var(--night-text); border-radius: 4px; font-size: 11px; padding: 3px 8px; cursor: pointer;
}
.ascend-mute[aria-pressed="true"] { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  .ascend-stage.charging .ascend-fill { animation: none; width: 100%; }
  .ascend-stage.charging .ascend-glow, .ascend-stage.charging .ascend-ring,
  .ascend-stage.reveal-success .ascend-glow, .ascend-stage.reveal-success::after { animation: none; }
}
