/* =====================
   Tirada inicial y ventana del ganador (estilo del dado de la Cacería).
   Solo presentación: el resultado lo decide la partida. Se carga después de card-states.css.
   ===================== */

/* ---------- Ventana de lanzamiento (solo INITIAL_ROLL_DICE) ---------- */
.choice-modal.dice-roll-modal.is-initial-roll {
    width: min(560px, calc(100vw - 32px)) !important;
    border: 1px solid rgba(240, 205, 127, .5) !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(240, 205, 127, .12), transparent 60%),
        linear-gradient(180deg, #14231b, #0b130f) !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 0, 0, .4) inset !important;
}
.dice-roll-modal.is-initial-roll .game-message-head { text-align: center !important; justify-content: center !important; }
.dice-roll-modal.is-initial-roll .game-message-head > div { display: grid; gap: 4px; justify-items: center; }
.dice-roll-modal.is-initial-roll .game-message-head strong { color: #f6e3b0; font-size: 1.35rem; }
.dice-roll-modal.is-initial-roll .game-message-head span,
.dice-roll-modal.is-initial-roll .game-message-head small { color: #d8ccaa; }
.initial-roll-eyebrow {
    color: #c9b27a !important;
    font-size: .74rem !important;
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.dice-roll-modal.is-initial-roll .dice-visual-wrap {
    position: relative !important;
    overflow: hidden !important;
    border: 1px solid rgba(240, 205, 127, .35) !important;
    background:
        radial-gradient(circle at center, rgba(240, 205, 127, .16), transparent 12rem),
        linear-gradient(180deg, rgba(10, 18, 14, .96), rgba(20, 35, 27, .9)) !important;
    box-shadow: inset 0 0 36px rgba(0, 0, 0, .75), 0 16px 40px rgba(0, 0, 0, .3) !important;
}
/* Anillo que gira lento detrás del dado. */
.dice-roll-modal.is-initial-roll .dice-visual-wrap::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 172px;
    height: 172px;
    margin: -110px 0 0 -86px;
    border-radius: 50%;
    border: 1px dashed rgba(240, 205, 127, .35);
    box-shadow: 0 0 40px rgba(240, 205, 127, .12) inset;
    animation: ir-ring-spin 18s linear infinite;
    pointer-events: none;
}
/* Destello al caer el dado. */
.dice-roll-modal.is-initial-roll .dice-visual-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    margin: -104px 0 0 -80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(246, 220, 150, .55), rgba(246, 220, 150, 0) 70%);
    opacity: 0;
    transform: scale(.4);
    pointer-events: none;
}
.dice-roll-modal.is-initial-roll .dice-visual-wrap.is-landed::after { animation: ir-burst .7s ease-out 1; }

.dice-roll-modal.is-initial-roll .dice-face {
    position: relative !important;
    z-index: 1 !important;
    width: auto !important;
    height: auto !important;
    min-width: 150px !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: transparent !important;
    color: #f2dca5 !important;
    font-size: clamp(6rem, 16vw, 8.4rem) !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
    text-shadow: 0 0 22px rgba(240, 205, 127, .5), 0 6px 18px rgba(0, 0, 0, .6) !important;
    box-shadow: none !important;
}
.dice-roll-modal.is-initial-roll .dice-face:hover {
    transform: translateY(-2px) scale(1.04) !important;
    filter: brightness(1.08) !important;
    box-shadow: none !important;
}
.dice-roll-modal.is-initial-roll .dice-face.rolling { animation: ir-die-tumble .34s linear infinite !important; }
.dice-roll-modal.is-initial-roll .dice-face.rolled { animation: ir-die-land .45s ease-out 1 !important; }
.dice-roll-modal.is-initial-roll .dice-result-text {
    position: relative;
    z-index: 1;
    border-color: rgba(240, 205, 127, .4) !important;
    background: rgba(10, 18, 14, .7) !important;
    color: #f6e3b0 !important;
}

/* ---------- Ventana del ganador ---------- */
.ir2-overlay {
    background:
        radial-gradient(circle at 50% 40%, rgba(240, 205, 127, .1), transparent 55%),
        rgba(2, 6, 10, .82) !important;
}
.choice-modal.initial-roll-summary-modal.ir2 {
    position: relative;
    width: min(720px, calc(100vw - 28px));
    max-width: 720px;
    overflow: hidden;
    padding: 26px 24px 20px;
    border: 1px solid rgba(240, 205, 127, .55);
    border-radius: 24px;
    background: linear-gradient(180deg, #14231b 0%, #0b130f 100%);
    box-shadow: 0 34px 90px rgba(0, 0, 0, .65), 0 0 50px rgba(240, 205, 127, .08);
    text-align: center;
    animation: ir2-enter .45s ease-out 1;
}
.ir2-glow {
    position: absolute;
    inset: -40% 10% auto;
    height: 70%;
    background: radial-gradient(ellipse at center, rgba(240, 205, 127, .22), transparent 70%);
    pointer-events: none;
    opacity: .6;
    transition: opacity .6s ease;
}
.ir2.is-revealed .ir2-glow { opacity: 1; }
.ir2-eyebrow {
    position: relative;
    margin: 0;
    color: #c9b27a;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .24em;
    text-transform: uppercase;
}
.ir2-title {
    position: relative;
    margin: 6px 0 26px;
    color: #f6e3b0;
    font-size: clamp(1.35rem, 3.2vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
}
.ir2.is-revealed .ir2-title { animation: ir2-title-in .5s ease-out 1; }

.ir2-duel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}
.ir2-side {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 5px;
    min-width: 0;
    padding: 22px 12px 16px;
    border: 1px solid rgba(240, 205, 127, .18);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01));
    transition: transform .45s ease, opacity .45s ease, filter .45s ease, border-color .45s ease, box-shadow .45s ease;
}
.ir2.is-revealed .ir2-side.is-winner {
    transform: translateY(-4px) scale(1.04);
    border-color: rgba(240, 205, 127, .75);
    box-shadow: 0 0 0 1px rgba(240, 205, 127, .25), 0 18px 40px rgba(0, 0, 0, .4), 0 0 34px rgba(240, 205, 127, .22);
}
.ir2.is-revealed .ir2-side.is-loser { opacity: .55; filter: saturate(.55); }
.ir2-crown {
    position: absolute;
    top: -16px;
    color: #f0cd7f;
    font-size: 1.8rem;
    line-height: 1;
    text-shadow: 0 0 14px rgba(240, 205, 127, .7);
    opacity: 0;
    transform: translateY(8px) scale(.6);
    transition: opacity .4s ease .1s, transform .4s ease .1s;
}
.ir2.is-revealed .is-winner .ir2-crown { opacity: 1; transform: translateY(0) scale(1); }
.ir2-avatar {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border: 2px solid rgba(240, 205, 127, .55);
    border-radius: 50%;
    background: #0b130f;
}
.ir2-avatar img, .ir2-avatar .avatar-placeholder { width: 100%; height: 100%; object-fit: cover; }
.ir2-label {
    color: #c9b27a;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.ir2-name {
    max-width: 100%;
    overflow: hidden;
    color: #f3ead2;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ir2-die {
    display: inline-block;
    margin-top: 4px;
    color: #f2dca5;
    font-size: clamp(3.6rem, 9vw, 4.8rem);
    line-height: 1;
    text-shadow: 0 0 18px rgba(240, 205, 127, .45);
}
.ir2-die.is-rolling { animation: ir-die-tumble .34s linear infinite; }
/* El número se muestra recién cuando el dado cae (no adelanta el resultado). */
.ir2-die.is-rolling + .ir2-number { visibility: hidden; }
.ir2-die.is-landed { animation: ir-die-land .45s ease-out 1; }
.ir2-number {
    min-width: 34px;
    padding: 2px 10px;
    border: 1px solid rgba(240, 205, 127, .35);
    border-radius: 999px;
    background: rgba(0, 0, 0, .3);
    color: #f6e3b0;
    font-size: .9rem;
}
.ir2-vs {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(240, 205, 127, .55);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #3a3320, #14110a);
    color: #f0cd7f;
    font-weight: 900;
    letter-spacing: .06em;
    box-shadow: 0 0 22px rgba(240, 205, 127, .18);
}
.ir2-note {
    position: relative;
    margin: 18px auto 14px;
    max-width: 520px;
    color: #cdbf9a;
    font-size: .86rem;
    line-height: 1.45;
}
.ir2-footer { position: relative; display: grid; gap: 12px; justify-items: center; }
.ir2-progress {
    width: min(360px, 100%);
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(240, 205, 127, .15);
}
.ir2-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #b88a3c, #f0cd7f);
    transform-origin: left center;
    transform: scaleX(1);
}
.ir2.is-revealed .ir2-progress span { animation: ir2-countdown 4.5s linear 1 forwards; }
/* Botones dorados en estas dos ventanas (en lugar del primario naranja general). */
.dice-roll-modal.is-initial-roll .game-dialog-actions .primary,
.ir2 .ir2-continue {
    min-width: 180px;
    border: 1px solid rgba(255, 236, 190, .65) !important;
    background: linear-gradient(180deg, #f3d48a, #b98a3a) !important;
    color: #1d1608 !important;
    font-weight: 800 !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35), 0 0 18px rgba(240, 205, 127, .2) !important;
}
.dice-roll-modal.is-initial-roll .game-dialog-actions .primary:disabled { opacity: .5 !important; }

@media (max-width: 560px) {
    .choice-modal.initial-roll-summary-modal.ir2 { padding: 22px 14px 16px; }
    .ir2-duel { gap: 8px; }
    .ir2-side { padding: 18px 6px 12px; }
    .ir2-avatar { width: 48px; height: 48px; }
    .ir2-vs { width: 40px; height: 40px; font-size: .8rem; }
    .ir2-die { font-size: 3rem; }
}

@keyframes ir-die-tumble {
    0% { transform: rotate(0deg) translateY(0); }
    25% { transform: rotate(90deg) translateY(-6px); }
    50% { transform: rotate(180deg) translateY(0); }
    75% { transform: rotate(270deg) translateY(-6px); }
    100% { transform: rotate(360deg) translateY(0); }
}
@keyframes ir-die-land { 0% { transform: scale(1.35); } 60% { transform: scale(.92); } 100% { transform: scale(1); } }
@keyframes ir-burst { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.8); } }
@keyframes ir-ring-spin { to { transform: rotate(360deg); } }
@keyframes ir2-enter { 0% { opacity: 0; transform: translateY(14px) scale(.97); } 100% { opacity: 1; transform: none; } }
@keyframes ir2-title-in { 0% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }
@keyframes ir2-countdown { to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
    .dice-roll-modal.is-initial-roll .dice-visual-wrap::before,
    .dice-roll-modal.is-initial-roll .dice-visual-wrap.is-landed::after,
    .dice-roll-modal.is-initial-roll .dice-face.rolling,
    .dice-roll-modal.is-initial-roll .dice-face.rolled,
    .choice-modal.initial-roll-summary-modal.ir2,
    .ir2.is-revealed .ir2-title,
    .ir2-die.is-rolling, .ir2-die.is-landed { animation: none !important; }
    .ir2-side, .ir2-crown, .ir2-glow { transition: none; }
}
