/* ==========================================================================
   I-Ging-Legung mit Herrn Hao — Spiel-Buehne
   ==========================================================================
   1:1-Kopie der Wangara-Seance (seance/index.html, <style>-Block):
   gleiche Szene, gleicher Zoom, gleiches Dialog-Panel, gleiches
   Reading-Bottom-Sheet, gleiche Z-Indizes, gleiche Werte.

   Getauscht: Bilder (Tempel statt Zelt), Texte (Herr Hao statt Madame),
   Farbwelt (Jade/Bronze statt Gold/Lila), Karten -> Linien.

   Nur diese Datei wird von /i-ging/legung/ geladen. Die geteilte
   css/iging-legung.css (auch /i-ging/orakel/) bleibt unberuehrt.
   ========================================================================== */

/* ============================================================
   SÉANCE — Point-and-Click-Spiel v4: Volle Session
   Szene 1: Nachtmarkt (scene-tent.webp)
   Szene 2: Im Zelt (scene-room.webp)
   Session: Frage -> Legesystem (Madame waehlt) -> Ziehen per
   Klick auf Stapel -> Legungs-Overlay -> gefuehrte Tour mit
   Highlights + Verbindungslinien + scrollbarem Panel unten
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    -webkit-tap-highlight-color: transparent;
}
/* Nur waehrend des Spiels ist die Seite gesperrt. Der Artikel darunter
   bleibt normal scrollbar. */
body.ig-game-active { overflow: hidden; height: 100%; }

#ig-game {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 30;
    background: #050b0a;
    font-family: Georgia, 'Times New Roman', serif;
}
/* Ohne JavaScript bleibt der Artikel bedienbar. */
body.ig-game-done #ig-game { display: none; }

.ig-stage {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

/* ---------- Szene 1: Nachtmarkt ---------- */
#ig-stage-temple {
    background-image: url('/images/iging/scene-temple-outside.webp');
    background-position: 62% 50%;
    cursor: pointer;
    transition: transform 1.5s cubic-bezier(0.55, 0, 0.8, 0.2), filter 1.5s ease, opacity 0.6s ease 1.2s;
    transform-origin: 65% 55%;
}
#ig-game.zooming #ig-stage-temple {
    transform: scale(2.4);
    filter: brightness(0.25) blur(2px);
}

#ig-enter-glow {
    position: absolute;
    left: 60%;
    top: 44%;
    width: 11%;
    height: 24%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 60%, rgba(255, 196, 110, 0.35) 0%, transparent 65%);
    animation: enter-pulse 2.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes enter-pulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

.ig-stage-ui {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.5s ease;
}
#ig-game.zooming .ig-stage-ui { opacity: 0; }

#ig-temple-title { top: 6%; }
#ig-temple-title h1,
#ig-temple-title .ig-stage-title {
    font-size: clamp(2rem, 6vw, 3.4rem);
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #9fd8c6;
    text-shadow:
        0 2px 6px rgba(8, 18, 16, 0.9),
        0 4px 26px rgba(8, 18, 16, 0.8),
        0 0 48px rgba(159, 216, 198, 0.35);
}
#ig-temple-title .ig-stage-subtitle {
    margin-top: 0.5rem;
    font-style: italic;
    font-size: clamp(0.9rem, 2.4vw, 1.15rem);
    color: #d2e2db;
    text-shadow: 0 2px 10px rgba(8, 18, 16, 0.95), 0 0 20px rgba(8, 18, 16, 0.8);
}

/* Der Hinweis sitzt MITTEN auf dem Zelt (nicht am unteren Rand), sonst
   sieht ihn niemand — er laeuft bei hohen Fenstern aus dem Bild.
   Saso-Feedback 26.10.2026. Das Zelt liegt links der Mitte (left: 33%),
   der Text wird darauf zentriert. */
#ig-enter-hint {
    /* Zentriert auf der leuchtenden Tempeltuer (siehe #ig-enter-glow:
       left 60% + 5.5% = 65.5 %, top 44 % + 12 % = 56 %). */
    left: 65.5%;
    right: auto;
    top: 52%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: 40%;
    max-width: 24rem;
    font-size: clamp(0.95rem, 2.4vw, 1.2rem);
    line-height: 1.45;
    letter-spacing: 0.06em;
    color: #f2f7f4;
    text-shadow:
        0 2px 14px rgba(8, 18, 16, 1),
        0 0 30px rgba(8, 18, 16, 1),
        0 0 8px rgba(8, 18, 16, 1),
        0 1px 2px rgba(0, 0, 0, 0.95);
    animation: hint-pulse 2.2s ease-in-out infinite;
}
/* Im Hochformat wandert das Zelt nach links — Text mitnehmen. */
@media (orientation: portrait) {
    #ig-enter-hint { left: 66%; width: 62%; top: 57%; }
}
@keyframes hint-pulse {
    0%, 100% { opacity: 0.88; }
    50% { opacity: 1; }
}

/* ---------- Konto-Hint am Zelt ---------- */
#ig-account-hint {
    left: 65.5%;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: 46%;
    max-width: 30rem;
    pointer-events: none;
}
#ig-account-hint[hidden] { display: none; }
/* Beide Hinweise lagen sonst exakt uebereinander (Zelteingang) und der
   Text wurde unlesbar vermischt. Saso 27.10.2026. */
#ig-enter-hint[hidden] { display: none; }
#ig-account-hint .ig-hint-title {
    font-size: clamp(1rem, 2.6vw, 1.35rem);
    line-height: 1.4;
    color: #ffe9b0;
    text-shadow: 0 2px 14px rgba(8, 18, 16, 0.98), 0 0 30px rgba(8, 18, 16, 0.95);
}
#ig-account-hint .ig-hint-text {
    margin-top: 0.55rem;
    font-size: clamp(0.85rem, 2.1vw, 1rem);
    line-height: 1.5;
    color: #f0e6d2;
    text-shadow: 0 2px 12px rgba(8, 18, 16, 0.98), 0 0 24px rgba(8, 18, 16, 0.95);
}
@media (orientation: portrait) {
    #ig-account-hint { left: 66%; width: 76%; top: 56%; }
}

/* ---------- Szenen-Fade ---------- */
#ig-stage-altar {
    background-image: url('/images/iging/scene-altar.webp');
    background-position: center 45%;
    display: none;
}
#ig-stage-altar.active { display: block; animation: room-in 1.3s ease; }
@keyframes room-in {
    from { opacity: 0; transform: scale(1.1); }
    to   { opacity: 1; transform: scale(1); }
}
@media (orientation: portrait) {
    #ig-stage-altar { background-position: center 42%; }
    #ig-stage-temple { background-position: 68% center; }
}

.ig-stage-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 120% 100% at 50% 45%, transparent 58%, rgba(3, 8, 7, 0.55) 100%);
    z-index: 2;
}

/* ---------- Szene 2: Prompt + Deck-Auswahl ---------- */
#ig-room-prompt {
    top: 6.5%;
    font-size: clamp(1.05rem, 2.8vw, 1.55rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #efe8d6;
    text-shadow: 0 2px 14px rgba(9, 18, 16, 0.95), 0 0 32px rgba(9, 18, 16, 0.85);
    z-index: 5;
    transition: opacity 0.4s ease;
}

#ig-methods-wrap {
    position: absolute;
    bottom: 7%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 6;
}
/* Hinweis mit Pfeil auf die Objekte: der User soll verstehen, dass
   Muenzen/Staengel selbst klickbar sind (Saso 30.10.2026). */
#ig-methods-hint {
    margin: 0 0 0.4rem;
    font-size: clamp(0.78rem, 1.9vw, 0.92rem);
    letter-spacing: 0.08em;
    color: #e6c98d;
    text-shadow: 0 2px 10px rgba(8, 18, 16, 0.95);
    text-align: center;
    animation: hint-pulse 2.4s ease-in-out infinite;
    pointer-events: none;
}
.ig-hint-arrow {
    display: block;
    width: 0;
    height: 0;
    margin: 0.35rem auto 0.15rem;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 13px solid #e6c98d;
    filter: drop-shadow(0 2px 6px rgba(8, 18, 16, 0.95));
}
#ig-methods {
    display: flex;
    gap: clamp(0.45rem, 1.6vw, 1rem);
}
@media (orientation: portrait) {
    #ig-methods-wrap { bottom: 3.5%; }
}
.ig-method-pack {
    position: relative;
    width: clamp(96px, 16vw, 132px);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    transition: transform 0.28s ease;
    opacity: 0;
    animation: pack-in 0.7s ease forwards;
}
.ig-method-pack:nth-child(1) { animation-delay: 0.9s; transform: rotate(-6deg) translateY(10px); }
.ig-method-pack:nth-child(2) { animation-delay: 1.05s; transform: rotate(-2deg) translateY(3px); }
.ig-method-pack:nth-child(3) { animation-delay: 1.2s; transform: rotate(2deg) translateY(3px); }
.ig-method-pack:nth-child(4) { animation-delay: 1.35s; transform: rotate(6deg) translateY(10px); }
@keyframes pack-in { to { opacity: 1; } }
.ig-method-pack:hover, .ig-method-pack:focus-visible {
    transform: rotate(0deg) translateY(-14px) scale(1.1);
    z-index: 7;
    outline: none;
}
/* ---------- Methoden-Auswahl: die Objekte selbst statt Kartendecks ---------- */
.ig-method-pack .ig-choice {
    display: block;
    position: relative;
    height: clamp(64px, 11vw, 88px);
}
.ig-method-pack .ig-choice--coins i {
    position: absolute;
    bottom: 0;
    width: clamp(30px, 5.4vw, 44px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, #e2b56b 0%, #c08a3e 45%, #8a6330 100%);
    border: 2px solid #6e4f26;
    box-shadow: inset 0 0 6px rgba(0,0,0,0.45), 0 6px 14px rgba(0,0,0,0.55);
}
.ig-method-pack .ig-choice--coins i::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26%;
    height: 26%;
    transform: translate(-50%, -50%);
    background: #10221d;
    border: 1px solid #5d7c6e;
    border-radius: 2px;
}
.ig-method-pack .ig-choice--coins i:nth-child(1) { left: 0; bottom: 8%; transform: rotate(-10deg); }
.ig-method-pack .ig-choice--coins i:nth-child(2) { left: 50%; transform: translateX(-50%) rotate(4deg); z-index: 1; }
.ig-method-pack .ig-choice--coins i:nth-child(3) { right: 0; bottom: 8%; transform: rotate(12deg); }
.ig-method-pack .ig-choice--yarrow i {
    position: absolute;
    bottom: 0;
    width: clamp(5px, 0.9vw, 7px);
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(180deg, #cdb98a 0%, #a8895a 60%, #7d6440 100%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.55);
}
.ig-method-pack .ig-choice--yarrow i:nth-child(1) { left: 16%; transform: rotate(-9deg); }
.ig-method-pack .ig-choice--yarrow i:nth-child(2) { left: 27%; transform: rotate(-5deg); height: 93%; }
.ig-method-pack .ig-choice--yarrow i:nth-child(3) { left: 50%; transform: translateX(-50%) rotate(1deg); z-index: 1; }
.ig-method-pack .ig-choice--yarrow i:nth-child(4) { right: 27%; transform: rotate(6deg); height: 94%; }
.ig-method-pack .ig-choice--yarrow i:nth-child(5) { right: 16%; transform: rotate(10deg); }
.ig-method-pack .ig-method-label {
    display: block;
    margin-top: 7px;
    text-align: center;
    font-size: clamp(0.68rem, 1.6vw, 0.88rem);
    letter-spacing: 0.08em;
    color: #fdf3dd;
    text-shadow: 0 1px 8px rgba(6, 15, 13, 0.95), 0 0 16px rgba(6, 15, 13, 0.9);
}

/* ============================================================
   SESSION-LAYER
   ============================================================ */

/* ---------- Dialog-Panel der Madame ---------- */
#ig-dialog {
    position: absolute;
    left: 50%;
    bottom: 6%;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 1.6rem));
    background: linear-gradient(170deg, rgba(28, 16, 40, 0.94) 0%, rgba(14, 8, 24, 0.96) 100%);
    border: 1px solid rgba(192, 138, 62, 0.55);
    border-radius: 16px;
    padding: 1.2rem 1.4rem 1.3rem;
    z-index: 30;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(159, 216, 198, 0.12);
    display: none;
    animation: dialog-in 0.45s ease;
}
#ig-dialog.visible { display: block; }
@keyframes dialog-in {
    from { opacity: 0; transform: translateX(-50%) translateY(18px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
#ig-dialog .ig-hao-line {
    font-style: italic;
    color: #efe8d6;
    font-size: clamp(0.95rem, 2.3vw, 1.1rem);
    line-height: 1.55;
    margin-bottom: 0.9rem;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
#ig-dialog .ig-hao-line em { color: #9fd8c6; font-style: normal; }

#ig-question-input {
    width: 100%;
    background: rgba(8, 4, 14, 0.8);
    border: 1px solid rgba(192, 138, 62, 0.4);
    border-radius: 10px;
    color: #efe8d6;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.65rem 0.9rem;
    resize: none;
    outline: none;
}
#ig-question-input:focus { border-color: rgba(159, 216, 198, 0.8); }
#ig-question-input::placeholder { color: #8fa8a2; font-style: italic; }

.ig-btn-bronze {
    display: inline-block;
    margin-top: 0.9rem;
    padding: 0.6rem 1.7rem;
    background: linear-gradient(135deg, #c08a3e, #8a6330);
    color: #10201c;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0,0,0,0.45), 0 0 18px rgba(192, 138, 62, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ig-btn-bronze:hover, .ig-btn-bronze:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.5), 0 0 26px rgba(192, 138, 62, 0.4);
    outline: none;
}
.ig-btn-bronze:disabled { opacity: 0.45; cursor: wait; transform: none; }

.ig-btn-ghost {
    display: inline-block;
    margin-top: 0.9rem;
    margin-left: 0.6rem;
    padding: 0.6rem 1.4rem;
    background: none;
    border: 1px solid rgba(192, 138, 62, 0.45);
    border-radius: 999px;
    color: #d2e2db;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.ig-btn-ghost:hover { border-color: #9fd8c6; color: #fff; }

#ig-throw-choice {
    font-size: 0.92rem;
    color: #cfc7e2;
    line-height: 1.55;
    margin-top: 0.2rem;
}
#ig-throw-choice strong { color: #9fd8c6; font-weight: 700; }


/* ---------- Zugangs-Gate (Konto / Bezahlung, Saso 26.10.2026) ---------- */
.ig-gate {
    text-align: center;
    padding: 2rem 1.2rem 1.6rem;
    color: #cfc7e2;
    line-height: 1.6;
}
.ig-gate-icon {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 0.6rem;
    color: #9fd8c6;
    text-shadow: 0 0 18px rgba(159, 216, 198, 0.45);
}
.ig-gate h3 {
    margin: 0 0 0.5rem;
    color: #efe8d6;
    font-size: 1.15rem;
    font-weight: 700;
}
.ig-gate p { margin: 0 0 0.7rem; font-size: 0.95rem; }
.ig-gate-hint { color: #8fa8a2; font-size: 0.85rem; font-style: italic; }
.ig-gate-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}
.ig-gate-actions .ig-btn { margin: 0; }
.ig-gate-balance {
    display: inline-block;
    font-size: 0.85rem;
    color: #9fd8c6;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(159, 216, 198, 0.35);
    border-radius: 999px;
}
.ig-gate-error {
    margin-top: 1rem !important;
    color: #e8a0a0;
    font-size: 0.88rem;
}

/* ---------- Legungs-Overlay ---------- */
#ig-table-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    flex-direction: column;
    background: radial-gradient(ellipse 120% 90% at 50% 40%, rgba(7, 16, 14, 0.42) 0%, rgba(5, 2, 8, 0.62) 100%);
}
#ig-table-overlay.visible { display: flex; animation: veil-in 0.5s ease; }
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }

#ig-table-head {
    text-align: center;
    padding: 0.9rem 1rem 0.4rem;
    z-index: 3;
}
#ig-table-head .ig-spread-name {
    font-size: clamp(1rem, 2.4vw, 1.3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9fd8c6;
    text-shadow: 0 2px 14px rgba(8, 18, 16, 0.95);
}
#ig-table-head .ig-spread-status {
    margin-top: 0.3rem;
    font-size: clamp(0.82rem, 2vw, 0.95rem);
    color: #d2e2db;
    font-style: italic;
    text-shadow: 0 1px 8px rgba(8, 18, 16, 0.9);
}

#ig-lines-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.6rem 0.3rem;
    z-index: 2;
}
#ig-lines-grid {
    display: grid;
    gap: clamp(4px, 0.9vw, 10px);
}

/* ---------- Wandlungszeichen: zweite Spalte rechts vom Linien-Raster ---------- */
#ig-wand-grid {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 0.9vw, 10px);
    align-self: center;
    margin-left: clamp(10px, 2.2vw, 22px);
    width: clamp(48px, 11vw, 104px);
}
#ig-wand-grid[hidden] { display: none; }
#ig-wand-label {
    position: absolute;
    top: -1.5em;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9fd8c6;
    opacity: 0.8;
}
.ig-wand-line {
    height: clamp(6px, 1.1vh, 10px);
    border-radius: 4px;
    background: rgba(226, 218, 200, 0.5);
}
.ig-wand-line--yin {
    background: linear-gradient(90deg,
        rgba(226, 218, 200, 0.5) 0 40%, transparent 40% 60%, rgba(226, 218, 200, 0.5) 60% 100%);
}
.ig-wand-line--changed {
    background: #9fd8c6;
    box-shadow: 0 0 8px rgba(159, 216, 198, 0.45);
}
.ig-wand-line--changed.ig-wand-line--yin {
    background: linear-gradient(90deg, #9fd8c6 0 40%, transparent 40% 60%, #9fd8c6 60% 100%);
}
#ig-wand-nr {
    position: absolute;
    bottom: -1.6em;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    color: #d2e2db;
    opacity: 0.9;
}
#ig-lines-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    overflow: visible;
}

.ig-place {
    position: relative;
    aspect-ratio: auto;
    height: clamp(34px, 6.2vh, 52px);
    width: 100%;
    border-radius: 7px;
    transition: filter 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}
.ig-place .ig-slot-mark {
    position: absolute;
    inset: 0;
    border: 1.5px dashed rgba(192, 138, 62, 0.35);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.5rem, 1.3vw, 0.68rem);
    color: rgba(192, 138, 62, 0.55);
    text-align: center;
    padding: 2px;
    line-height: 1.2;
}
.ig-place .ig-flip {
    position: absolute;
    inset: 0;
    border-radius: 7px;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.1, 0.2, 1);
    opacity: 0;
}
.ig-place.filled .ig-flip { opacity: 1; }
.ig-place.filled .ig-slot-mark { display: none; }
.ig-place .ig-flip.open { transform: rotateY(180deg); }
.ig-place .ig-face {
    position: absolute;
    inset: 0;
    border-radius: 7px;
    backface-visibility: hidden;
    overflow: hidden;
    border: 1px solid rgba(192, 138, 62, 0.6);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}
.ig-place .ig-face.ig-back {
    background: linear-gradient(168deg, #1d453d 0%, #102a25 55%, #16382f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ig-place .ig-face.ig-back::after {
    content: '✦';
    color: rgba(159, 216, 198, 0.85);
    font-size: clamp(0.7rem, 1.8vw, 1.1rem);
    text-shadow: 0 0 14px rgba(159, 216, 198, 0.6);
}
.ig-place .ig-face.ig-front {
    transform: rotateY(180deg);
    background: #0f2a24;
}
.ig-place .ig-face.ig-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- Wurf-Buehne: Muenzen/Staengel landen in der Bildmitte ---------- */
#ig-toss {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(0.8rem, 2.4vh, 1.3rem);
    z-index: 12;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(8, 18, 16, 0.6) 0%, rgba(8, 18, 16, 0) 72%);
}
#ig-toss[hidden] { display: none; }
.ig-toss-objects {
    display: flex;
    gap: clamp(0.7rem, 2.4vw, 1.4rem);
    align-items: flex-end;
    justify-content: center;
}
.ig-toss-coin {
    width: clamp(58px, 11vw, 88px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, #e2b56b 0%, #c08a3e 45%, #8a6330 100%);
    border: 3px solid #6e4f26;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5), 0 16px 34px rgba(0, 0, 0, 0.7);
    position: relative;
    animation: toss-drop 0.55s cubic-bezier(0.2, 0.7, 0.3, 1.25) backwards;
}
/* Kopf: die glatte Bronzeseite mit dem quadratischen Loch */
.ig-toss-coin::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 24%;
    height: 24%;
    transform: translate(-50%, -50%);
    background: #10221d;
    border: 2px solid #5d7c6e;
    border-radius: 3px;
}
/* Zahl: die Schriftseite — vier Stempel um das Loch, dunklerer Ton */
.ig-toss-coin--schrift {
    background: radial-gradient(circle at 32% 30%, #caa15c 0%, #a3762f 45%, #7a5527 100%);
}
.ig-toss-coin--schrift::before {
    content: "";
    position: absolute;
    inset: 14%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 20%, #4d3a1e 0 8%, transparent 9%),
        radial-gradient(circle at 50% 80%, #4d3a1e 0 8%, transparent 9%),
        radial-gradient(circle at 20% 50%, #4d3a1e 0 8%, transparent 9%),
        radial-gradient(circle at 80% 50%, #4d3a1e 0 8%, transparent 9%);
}
/* Stengel-Haufen: was gezaehlt wurde, mit Anzahl darunter */
.ig-toss-heap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    animation: toss-drop 0.55s cubic-bezier(0.2, 0.7, 0.3, 1.25) backwards;
}
.ig-toss-heap i {
    width: clamp(48px, 9vw, 72px);
    height: clamp(5px, 1vw, 8px);
    border-radius: 4px;
    background: linear-gradient(180deg, #cdb98a 0%, #a8895a 60%, #7d6440 100%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}
.ig-toss-heap i:nth-child(2) { transform: rotate(-3deg); }
.ig-toss-heap i:nth-child(3) { transform: rotate(2.5deg) translateY(-2px); }
.ig-toss-heap b {
    font-size: clamp(0.85rem, 2vw, 1.05rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #d2e2db;
    text-shadow: 0 2px 10px rgba(8, 18, 16, 0.95);
}
.ig-toss-value {
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    letter-spacing: 0.1em;
    color: #e6c98d;
    text-shadow: 0 2px 12px rgba(8, 18, 16, 0.95);
    animation: toss-fade 0.4s ease 0.4s backwards;
}
@keyframes toss-drop {
    0% { transform: translateY(-48vh) rotate(220deg) scale(0.55); opacity: 0; }
    60% { opacity: 1; }
    100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
}
@keyframes toss-fade { from { opacity: 0; transform: translateY(8px); } }

/* Hinweis links neben dem Wurf-Symbol */
#ig-pile-hint {
    position: absolute;
    right: calc(clamp(0.8rem, 3vw, 2.4rem) + clamp(104px, 18vw, 148px) + 0.9rem);
    bottom: clamp(1.4rem, 4.5vh, 3rem);
    max-width: 220px;
    margin: 0;
    text-align: right;
    font-size: clamp(0.78rem, 1.9vw, 0.92rem);
    letter-spacing: 0.07em;
    color: #e6c98d;
    text-shadow: 0 2px 10px rgba(8, 18, 16, 0.95);
    animation: hint-pulse 2.4s ease-in-out infinite;
    pointer-events: none;
    z-index: 8;
}
#ig-pile-hint[hidden] { display: none; }

/* Der Stapel */
#ig-throw-pile {
    position: absolute;
    right: clamp(0.8rem, 3vw, 2.4rem);
    bottom: clamp(0.9rem, 3vh, 2rem);
    z-index: 8;
    width: clamp(104px, 18vw, 148px);
    height: clamp(72px, 12vw, 100px);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: transform 0.25s ease;
    filter: drop-shadow(0 14px 24px rgba(0,0,0,0.6));
}
#ig-throw-pile:hover, #ig-throw-pile:focus-visible { transform: translateY(-6px) scale(1.04); outline: none; }

/* ---------- Drei Muenzen (Methode: coins) ---------- */
#ig-throw-pile .ig-pile-coins,
#ig-throw-pile .ig-pile-yarrow {
    position: absolute;
    inset: 0;
    display: none;
}
#ig-throw-pile.ig-pile--coins .ig-pile-coins { display: block; }
#ig-throw-pile .ig-pile-coins i {
    position: absolute;
    bottom: 0;
    width: clamp(34px, 6vw, 50px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, #e2b56b 0%, #c08a3e 45%, #8a6330 100%);
    border: 2px solid #6e4f26;
    box-shadow: inset 0 0 6px rgba(0,0,0,0.45), 0 6px 14px rgba(0,0,0,0.5);
}
/* Klassische I-Ging-Muenze: quadratisches Loch in der Mitte */
#ig-throw-pile .ig-pile-coins i::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26%;
    height: 26%;
    transform: translate(-50%, -50%);
    background: #10221d;
    border: 1px solid #5d7c6e;
    border-radius: 2px;
}
#ig-throw-pile .ig-pile-coins i:nth-child(1) { left: 0; bottom: 10%; transform: rotate(-10deg); }
#ig-throw-pile .ig-pile-coins i:nth-child(2) { left: 50%; transform: translateX(-50%) rotate(4deg); z-index: 1; }
#ig-throw-pile .ig-pile-coins i:nth-child(3) { right: 0; bottom: 10%; transform: rotate(12deg); }

/* ---------- Staengelbuendel (Methode: yarrow) ---------- */
#ig-throw-pile.ig-pile--yarrow .ig-pile-yarrow { display: block; }
#ig-throw-pile .ig-pile-yarrow i {
    position: absolute;
    bottom: 0;
    width: clamp(4px, 0.8vw, 6px);
    height: clamp(56px, 10vw, 86px);
    border-radius: 3px;
    background: linear-gradient(180deg, #cdb98a 0%, #a8895a 60%, #7d6440 100%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
#ig-throw-pile .ig-pile-yarrow i:nth-child(1) { left: 18%; transform: rotate(-9deg); }
#ig-throw-pile .ig-pile-yarrow i:nth-child(2) { left: 28%; transform: rotate(-5deg); height: 92%; }
#ig-throw-pile .ig-pile-yarrow i:nth-child(3) { left: 50%; transform: translateX(-50%) rotate(1deg); z-index: 1; }
#ig-throw-pile .ig-pile-yarrow i:nth-child(4) { right: 28%; transform: rotate(6deg); height: 94%; }
#ig-throw-pile .ig-pile-yarrow i:nth-child(5) { right: 18%; transform: rotate(10deg); }

#ig-throw-pile .ig-pile-count {
    position: absolute;
    top: -10px;
    right: -10px;
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, #c08a3e, #8a6330);
    color: #10201c;
    font-weight: 700;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
#ig-throw-pile.hidden { display: none; }

/* Tour-Highlights */
.ig-place.ig-dim { filter: brightness(0.32) saturate(0.55); }
.ig-place.ig-spot {
    filter: none;
    transform: scale(1.12);
    z-index: 5;
    box-shadow: 0 0 0 2px #9fd8c6, 0 0 26px rgba(159, 216, 198, 0.55), 0 10px 30px rgba(0,0,0,0.7);
}
.ig-place.ig-related {
    filter: brightness(0.85);
    z-index: 4;
    box-shadow: 0 0 0 1.5px rgba(159, 216, 198, 0.8), 0 0 16px rgba(159, 216, 198, 0.3);
}

/* ---------- Deutungs-Panel unten ---------- */
#ig-reading-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 32;
    background: linear-gradient(180deg, rgba(7, 16, 14, 0.92) 0%, rgba(4, 10, 9, 0.98) 100%);
    border-top: 1px solid rgba(192, 138, 62, 0.45);
    padding: 0.75rem clamp(0.9rem, 3vw, 2rem) 0.7rem;
    transform: translateY(105%);
    transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.3, 1);
    max-height: 42vh;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
#ig-reading-panel.visible { transform: translateY(0); }
#ig-reading-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    flex-shrink: 0;
}
#ig-reading-head .ig-rh-label {
    font-size: clamp(0.85rem, 2vw, 1rem);
    color: #9fd8c6;
    letter-spacing: 0.06em;
}
#ig-reading-head .ig-rh-count {
    font-size: 0.78rem;
    color: #8fa8a2;
    white-space: nowrap;
}
#ig-reading-text {
    overflow-y: auto;
    color: #e7e0d0;
    font-size: clamp(0.88rem, 2.1vw, 1rem);
    line-height: 1.62;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(192, 138, 62, 0.4) transparent;
    min-height: 3.2rem;
    flex: 1;
}
#ig-reading-text em { color: #9fd8c6; font-style: normal; }
#ig-reading-text .ig-arrow-note {
    display: inline-block;
    margin-top: 0.35rem;
    color: #a9c6bd;
    font-size: 0.86em;
}
#ig-reading-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}
#ig-btn-next { margin-top: 0; }
#ig-reading-progress-track {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(192, 138, 62, 0.18);
    overflow: hidden;
}
#ig-reading-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #c08a3e, #9fd8c6);
    border-radius: 3px;
    transition: width 0.5s ease;
}

#ig-reading-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: #d2e2db;
    font-style: italic;
    flex: 1;
}
.ig-hao-spin {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #c2eadf, #3f8f79 60%, #17453c);
    box-shadow: 0 0 18px rgba(127, 196, 178, 0.7);
    animation: orb-pulse 1.4s ease-in-out infinite;
}
@keyframes orb-pulse {
    0%, 100% { transform: scale(0.85); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

#ig-reading-text.summary-view {
    display: grid;
    gap: 0.7rem;
}
#ig-reading-text .ig-sum-block h3 {
    color: #9fd8c6;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

/* ---------- Verlassen + Closed ----------
   Der Konto-Pill (js/account.js) sitzt rechts oben (right: 1rem).
   "Verlassen" sitzt deshalb LINKS oben — sonst liegen beide uebereinander.
   Saso-Feedback 26.10.2026. */
#ig-exit {
    position: absolute;
    top: 1rem;
    left: 1.2rem;
    z-index: 40;
    padding: 0.45rem 1rem;
    background: rgba(13, 8, 18, 0.6);
    border: 1px solid rgba(192, 138, 62, 0.4);
    border-radius: 999px;
    color: #e7e0d0;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
#ig-exit:hover { border-color: #9fd8c6; color: #fff; }

#ig-closed-msg {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 30rem;
    width: calc(100% - 3rem);
    padding: 1.2rem 1.8rem;
    background: rgba(8, 16, 14, 0.82);
    border: 1px solid rgba(192, 138, 62, 0.5);
    border-radius: 14px;
    color: #efe8d6;
    font-size: 1rem;
    line-height: 1.6;
    text-align: center;
    z-index: 45;
    display: none;
}
#ig-closed-msg.visible { display: block; }

@media (max-width: 700px) {
    #ig-dialog { bottom: 4%; padding: 1rem 1.05rem 1.1rem; }
    #ig-reading-panel { max-height: 46vh; }
}
/* ---------- PDF/Druck ----------
   Das Layout des Druck-Sheets liegt in css/print-sheet.css (geteilt mit
   der Seance und dem Konto). Hier nur noch die Spiel-Sonderregeln:
   im PDF zaehlt ausschliesslich das Druck-Sheet — Artikel (inkl. "Legung
   starten"), Sprachausgabe-Buttons ("Alles vorlesen"), Header und Footer
   verschwinden komplett. */
@media print {
    body.ig-game-active { overflow: visible; }
    body.ig-game-active > *:not(#ig-print-sheet) { display: none !important; }
    #ig-game { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .ig-method-pack { opacity: 1; }
}
/* ============================================================
   I-Ging-Eigenheiten (Linien statt Karten, Herr Hao)
   ============================================================ */

/* Der Tempel: die Tuere ist das Ziel, nicht die Bildmitte. */
#ig-stage-temple { background-position: 62% 50%; }

/* Sechs Linien untereinander — von unten (1) nach oben (6). */
#ig-lines-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(5px, 1.1vh, 9px);
    width: min(340px, 82vw);
}
#ig-lines-wrap { padding: 0.4rem 0.8rem 0.3rem; }

/* Der Wurf-Stapel: eine Wurfhandvoll Muenzen. */
#ig-throw-pile .ig-pile-glyph { color: #9fd8c6; }

/* Platzhalter einer noch nicht geworfenen Linie. */
.ig-place .ig-slot-mark {
    font-size: clamp(0.55rem, 1.4vw, 0.72rem);
    color: rgba(192, 138, 62, 0.6);
}
/* Die Linie selbst: yang = durchgehend, yin = gebrochen. */
.ig-line-bar {
    display: block;
    width: 74%;
    height: 7px;
    margin: 0 auto;
    border-radius: 2px;
    background: linear-gradient(90deg, #c08a3e, #e6c98d);
    box-shadow: 0 0 12px rgba(192, 138, 62, 0.45);
}
.ig-line-bar--yin {
    background: none;
    position: relative;
    box-shadow: none;
}
.ig-line-bar--yin::before,
.ig-line-bar--yin::after {
    content: '';
    position: absolute;
    top: 0;
    height: 7px;
    width: 34%;
    border-radius: 2px;
    background: linear-gradient(90deg, #c08a3e, #e6c98d);
    box-shadow: 0 0 12px rgba(192, 138, 62, 0.45);
}
.ig-line-bar--yin::before { left: 0; }
.ig-line-bar--yin::after { right: 0; }
/* Wandelnd = heller Rand, wie die wandelnden Linien im Buch. */
.ig-line-bar--changing {
    outline: 1px solid #9fd8c6;
    outline-offset: 3px;
    border-radius: 3px;
}
/* Linien-Nummer links am Platz. */
.ig-place .ig-line-no {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(0.5rem, 1.2vw, 0.66rem);
    color: rgba(159, 216, 198, 0.75);
    z-index: 3;
}

/* Das Hexagramm nach dem Wurf. */
#ig-hexagram {
    text-align: center;
    margin: 0.1rem 0 0.4rem;
    display: none;
}
#ig-hexagram.visible { display: block; }
#ig-hexagram .ig-hex-uni {
    font-size: clamp(2rem, 6vw, 3.2rem);
    line-height: 1;
    color: #9fd8c6;
    text-shadow: 0 0 26px rgba(159, 216, 198, 0.45);
}
#ig-hexagram .ig-hex-name {
    display: block;
    margin-top: 0.25rem;
    font-size: clamp(0.9rem, 2.2vw, 1.05rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #e6c98d;
}
#ig-hexagram .ig-hex-meta {
    display: block;
    margin-top: 0.2rem;
    font-size: clamp(0.72rem, 1.7vw, 0.85rem);
    color: #a9c6bd;
    font-style: italic;
}

/* Die Deutung im Bottom-Sheet (dunkel, nicht die helle Artikel-Optik). */
.ig-rd-headline {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e6c98d;
    margin: 0 0 0.2rem;
}
.ig-rd-by {
    font-style: italic;
    font-size: 0.8rem;
    color: #8fa8a2;
    margin: 0 0 0.5rem;
}
.ig-rd-block { margin: 0 0 0.55rem; }
.ig-rd-block h4 {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9fd8c6;
    margin: 0 0 0.15rem;
    font-weight: 700;
}
.ig-rd-block p { margin: 0; color: #e7e0d0; }
.ig-rd-line { margin: 0 0 0.45rem; }
.ig-rd-line .ig-rd-lineno {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #9fd8c6;
    margin-bottom: 0.1rem;
}
.ig-rd-closing {
    border-left: 2px solid rgba(192, 138, 62, 0.6);
    padding-left: 0.6rem;
    font-style: italic;
}
.ig-rd-disclaimer {
    font-size: 0.74rem;
    color: #8fa8a2;
    font-style: italic;
    margin: 0.6rem 0 0;
    line-height: 1.45;
}
.ig-rd-paid {
    font-size: 0.78rem;
    color: #9fd8c6;
    margin: 0.4rem 0 0;
}

/* Fehlerzeile im Spiel. */
#ig-game-error {
    position: absolute;
    left: 50%;
    top: 12%;
    transform: translateX(-50%);
    z-index: 25;
    width: min(30rem, calc(100% - 2rem));
    padding: 0.7rem 1rem;
    background: rgba(8, 16, 14, 0.92);
    border: 1px solid rgba(192, 138, 62, 0.55);
    border-radius: 12px;
    color: #e7e0d0;
    text-align: center;
    font-size: 0.92rem;
    display: none;
}
#ig-game-error.visible { display: block; }

/* Startknopf im Artikel (oeffnet die Buehne). */
#ig-start-btn {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.75rem 1.8rem;
    background: linear-gradient(135deg, #c08a3e, #8a6330);
    color: #10201c;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), 0 0 18px rgba(192, 138, 62, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#ig-start-btn:hover, #ig-start-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 26px rgba(192, 138, 62, 0.4);
    outline: none;
}

/* ---------- Nachtraege fuer den Spiel-Betrieb auf der Artikelseite ---------- */
/* Szene 1 verschwindet nach dem Zoom ganz (hidden-Attribut). */
#ig-stage-temple[hidden] { display: none; }

/* Im Spiel ist die Seite die Buehne (wie die Seance gar keinen
   main-header hat): der Site-Header verschwindet, die Button-Reihe
   floatet — sie haengt dann an <body> (js/iging-legung.js) und wird
   von css/header-buttons.css fixiert. */
body.ig-game-active .main-header { display: none; }
