/* ---------- page layout: scene | panel ---------- */
.rw-layout{ display:grid; grid-template-columns:minmax(0,1fr) minmax(360px,420px); gap:24px;
  max-width:1500px; margin:0 auto; height:calc(100vh - var(--rw-top, 90px) - 18px); min-height:480px; }
.rw-stage{ position:relative; display:flex; flex-direction:column; min-height:0; min-width:0; }
.rw-fit{ position:relative; flex:1; min-height:0; }
.rw-scene{ position:absolute; left:0; top:0; width:900px; height:560px; transform-origin:0 0; }

/* the casting cloth: woven indigo, gold border, the 24 staves around the edge */
.rw-cloth{ position:absolute; inset:0; width:900px; height:560px; filter:drop-shadow(0 18px 40px rgba(var(--shadow-rgb),.55)); }
.rw-cloth-glyph{ font-family:var(--font-rune); font-size:15px; fill:var(--gold); fill-opacity:.5; }

/* the three positions */
.rw-slot{ position:absolute; width:190px; text-align:center; }
.rw-slot-label{ font-family:var(--font-heading); font-size:calc(0.8125rem * var(--text-scale)); letter-spacing:.14em; text-transform:uppercase; color:var(--gold); }
.rw-slot-sub{ font-family:var(--font-body); font-style:italic; font-size:calc(0.75rem * var(--text-scale)); color:var(--frost); opacity:.6; margin-top:3px; }
.rw-spot{ position:absolute; width:150px; height:200px; box-sizing:border-box; border:1px solid rgba(var(--gold-rgb),.2); border-radius:30px;
  background:radial-gradient(ellipse at 50% 45%, rgba(var(--vignette-rgb),.45), rgba(var(--vignette-rgb),.15) 70%);
  box-shadow:inset 0 2px 10px rgba(var(--shadow-rgb),.45);
  display:flex; align-items:center; justify-content:center; font-family:var(--font-heading); font-size:26px; color:rgba(var(--gold-rgb),.22);
  transition:border-color .3s, box-shadow .3s; }
.rw-spot.active{ border-color:rgba(var(--gold-rgb),.6); box-shadow:inset 0 2px 10px rgba(var(--shadow-rgb),.45), 0 0 28px rgba(var(--gold-rgb),.22); }

/* rune stones */
.rw-stone{ position:absolute; width:150px; height:200px; perspective:900px; cursor:pointer;
  transition:transform .75s cubic-bezier(.18,.72,.24,1), opacity .35s ease; }
.rw-stone-inner{ position:relative; width:100%; height:100%; transform-style:preserve-3d; transition:transform .8s cubic-bezier(.4,.2,.2,1); }
.rw-stone.flipped .rw-stone-inner{ transform:rotateY(180deg); }
.rw-face{ position:absolute; inset:0; backface-visibility:hidden; -webkit-backface-visibility:hidden; display:flex; align-items:center; justify-content:center; }
.rw-face img{ width:100%; height:100%; object-fit:contain; display:block; filter:drop-shadow(0 10px 16px rgba(var(--shadow-rgb),.6)); }
.rw-front{ transform:rotateY(180deg); }
.rw-stone.merkstave .rw-front img, .rw-stone.merkstave .rw-front .rw-glyphface{ transform:rotate(180deg); }
.rw-glyphface{ width:100%; height:100%; border-radius:12px; background:var(--stone-face); color:var(--stone-glyph); font-size:84px; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-rune); box-shadow:0 10px 16px rgba(var(--shadow-rgb),.6); }
.rw-stone.active .rw-face img{ filter:drop-shadow(0 0 14px rgba(var(--gold-rgb),.55)) drop-shadow(0 10px 16px rgba(var(--shadow-rgb),.6)); }
.rw-stone.active:not(.flipped) .rw-back{ animation:rw-glow 1.8s ease-in-out infinite; }
@keyframes rw-glow{ 0%,100%{ filter:brightness(1); } 50%{ filter:brightness(1.35) drop-shadow(0 0 12px rgba(var(--gold-rgb),.6)); } }
@media (hover:hover){ .rw-stone:hover{ z-index:5; } .rw-stone:not(.flying):hover .rw-stone-inner{ transform:translateY(-6px); }
  .rw-stone.flipped:not(.flying):hover .rw-stone-inner{ transform:rotateY(180deg) translateY(-6px); } }

/* ---------- reading panel ---------- */
.rw-chip{ height:30px; padding:0 12px; border-radius:15px; border:1px solid rgba(var(--gold-rgb),.3); background:none;
  color:var(--frost); font-family:var(--font-heading); font-size:calc(0.71875rem * var(--text-scale)); letter-spacing:.06em; cursor:pointer; transition:background .2s, color .2s, border-color .2s; }
.rw-view.swap > *{ animation:rw-in .35s ease both; }
@keyframes rw-in{ from{ opacity:0; transform:translateY(6px); } to{ opacity:1; transform:none; } }
.v-card{ display:flex; gap:16px; align-items:center; margin:14px 0 12px; padding-top:12px; border-top:1px solid rgba(var(--frost-rgb),.1); }
.v-stone{ flex-shrink:0; width:66px; height:88px; }
.v-stone img{ width:100%; height:100%; object-fit:contain; display:block; filter:drop-shadow(0 4px 8px rgba(var(--shadow-rgb),.5)); }
.v-stone.merkstave img, .v-stone.merkstave .rw-glyphface{ transform:rotate(180deg); }
.v-stone .rw-glyphface{ font-size:38px; border-radius:7px; }
.v-name{ font-family:var(--font-heading); font-size:calc(1.375rem * var(--text-scale)); line-height:1.2; color:var(--bone); }
.v-meta{ font-size:calc(0.78125rem * var(--text-scale)); font-style:italic; color:var(--frost); opacity:.65; margin-top:3px; }
.v-orient{ display:inline-block; margin-top:7px; font-size:calc(0.625rem * var(--text-scale)); letter-spacing:.12em; text-transform:uppercase; padding:2px 8px; border-radius:999px;
  color:var(--aurora); border:1px solid rgba(var(--aurora-soft-rgb),.4); }
.v-facedown{ margin:18px 0; padding:22px; text-align:center; border:1px dashed rgba(var(--gold-rgb),.3); border-radius:10px; }
.v-synth{ white-space:pre-line; font-size:calc(0.90625rem * var(--text-scale)); line-height:1.75; color:var(--frost); margin:12px 0 18px; }

/* while the AI reading is being written: five runes (FREYA) light up in turn */
.v-thinking-runes span{ opacity:.18; animation:rw-rune 2.2s ease-in-out infinite; }
@keyframes rw-rune{ 0%,100%{ opacity:.18; transform:none; text-shadow:none; }
                    35%{ opacity:1; transform:translateY(-3px); text-shadow:0 0 14px rgba(var(--gold-light-rgb),.7); } }
.v-thinking small{ font-size:calc(0.75rem * var(--text-scale)); color:var(--frost); opacity:.6; }
.v-row{ display:flex; align-items:baseline; gap:10px; width:100%; padding:9px 4px; background:none; border:0; border-bottom:1px solid rgba(var(--frost-rgb),.08);
  text-align:left; cursor:pointer; color:var(--frost); font-family:var(--font-body); font-size:calc(0.84375rem * var(--text-scale)); }
.v-row .p{ font-family:var(--font-heading); color:var(--gold); width:84px; flex-shrink:0; font-size:calc(0.75rem * var(--text-scale)); letter-spacing:.06em; }
.v-row .g{ font-family:var(--font-rune); color:var(--gold-light); width:20px; flex-shrink:0; font-size:calc(1rem * var(--text-scale)); }

@media (max-width:1000px){
  .rw-layout{ display:block; height:auto; min-height:0; }
  .rw-fit{ flex:none; }   /* height set by rwFit() */
}
@media (prefers-reduced-motion: reduce){
  .rw-stone.active:not(.flipped) .rw-back, .rw-view.swap > *{ animation:none; }
  .v-thinking-runes span{ animation:none; opacity:.7; }
}
