/* Wordernario — tablero, lobby y efectos (tema Cielo en cielo-theme.css) */

:root {
    --color-primary-bg: #f0f9ff;
    --color-secondary-bg: #e0f2fe;
    --color-surface: rgba(255, 255, 255, 0.94);
    --color-surface-hover: #fff7ed;
    --color-surface-glass: rgba(255, 251, 235, 0.88);
    --color-primary: #0ea5e9;
    --color-primary-hover: #38bdf8;
    --color-primary-light: #7dd3fc;
    --color-accent: #dc2626;
    --color-gold: #fcd34d;
    --color-gold-light: #fef9c3;
    --color-text-primary: #0c4a6e;
    --color-text-secondary: #334155;
    --color-text-muted: #64748b;
    --color-border: rgba(12, 74, 110, 0.18);
    --color-success: #2ecc71;
    --color-error: #e74c3c;
    --color-warning: #ff8800;
    --color-danger: #e74c3c;
    --btn-radius: 3px;
    --btn-transition: 0.2s ease;
    --text-clash-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* —— Shared solid control —— */
/* Botones: layout base (piel Arcane en arcane-theme.css) */
.btn-game,
[class*="btn-clash"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    border: none;
    border-radius: var(--btn-radius, 3px);
}

[class*="btn-clash"]:disabled,
.btn-game:disabled,
.disable-any-action [class*="books-"],
.disable-any-action .condimento-chip {
    opacity: 0.55;
    filter: saturate(0.65);
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

.btn-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 8px 12px;
}

.btn-icon-fa {
    font-size: 1.05rem;
    margin-right: 6px;
    opacity: 0.95;
}

[class*="btn-clash"] .btn-icon-fa {
    pointer-events: none;
}

.btn-actions .col-12 {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

/* Pestañas del lobby: arcane-theme.css en .arcane-skin */

/* —— Libros: superficie + acento superior (sin franja lateral) —— */
.book-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 0 4px;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.62rem;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

#pnBooks .book-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    vertical-align: middle;
}

.legend-chip[class*="books-"] {
    border-top: 3px solid var(--cat-accent, var(--color-primary));
}

.book-lock-icon {
    color: var(--color-accent);
    font-size: 0.95em;
}

#pnBooks .book-badge-label {
    line-height: 1.15;
}

#pnBooks .book-badge[class*="books-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px !important;
    margin: 6px 4px !important;
    border-radius: var(--btn-radius);
    background: var(--color-surface) !important;
    color: var(--color-text-primary) !important;
    text-shadow: var(--text-clash-shadow) !important;
    border: 2px solid #000 !important;
    border-top: 4px solid var(--cat-accent, var(--color-primary)) !important;
    box-shadow: 0 4px 0 #1a0a28 !important;
    transition:
        transform var(--btn-transition),
        background-color var(--btn-transition),
        box-shadow var(--btn-transition);
}

#pnBooks .book-badge[class*="books-"]:hover {
    background: var(--color-surface-hover) !important;
    transform: translateY(-2px);
}

#pnBooks .book-badge[class*="books-"]:active {
    transform: translateY(1px);
    box-shadow: var(--btn-shadow-active) !important;
}

.books-penta { --cat-accent: #63a9d0; }
.books-histor { --cat-accent: var(--color-success); }
.books-poetry { --cat-accent: var(--color-warning); }
.books-major { --cat-accent: var(--color-error); }
.books-less { --cat-accent: #c97a9a; }
.books-evangelistic { --cat-accent: var(--color-primary); }
.books-acts { --cat-accent: #4db5c9; }
.books-pauline { --cat-accent: #9b6fd4; }
.books-general-letter { --cat-accent: #d67ab0; }
.books-prophetic { --cat-accent: #7a7ee8; }

/* —— Condimentos (dorado sólido, sin neón lateral) —— */
/* condimentos: arcane-theme.css */

/* —— Partidas especiales —— */
.mode-special-card {
    background: var(--color-surface) !important;
    color: var(--color-text-primary) !important;
    border: 2px solid #000 !important;
    border-radius: var(--btn-radius) !important;
    box-shadow: 0 4px 0 #1a0a28 !important;
    min-height: 88px;
}

.mode-special-card strong {
    color: var(--color-text-primary) !important;
    text-shadow: none !important;
}

.mode-special-card small {
    color: var(--color-text-muted) !important;
    font-weight: 600;
}

.mode-special-card img {
    border: 2px solid var(--color-border) !important;
    border-radius: 10px;
    background: #eef2ff;
    box-shadow: none;
}

.mode-special-icon {
    border: 2px solid var(--color-border) !important;
    background: #f5f0ff !important;
    box-shadow: none;
}

.mode-icon-huecos {
    background-color: #dbeafe !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Crect x='8' y='14' width='32' height='6' rx='2' fill='%2363A9D0'/%3E%3Crect x='8' y='28' width='20' height='6' rx='2' fill='%231C8C70'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 56px;
}

.mode-icon-gigante {
    background-color: #fff3d6 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M24 6l4 10h11l-9 7 4 11-10-7-10 7 4-11-9-7h11z' fill='%23D6A84B'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 52px;
}

.mode-icon-rojo {
    background-color: #ffe4ec !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M12 38V14l12-6 12 6v24H12z' fill='%23E16B68'/%3E%3Cpath d='M24 12v24' stroke='%23F4EBD8' stroke-width='3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 52px;
}

.mode-icon-sociedad {
    background-color: #e0f7ff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='16' cy='20' r='6' fill='%231C8C70'/%3E%3Ccircle cx='32' cy='20' r='6' fill='%2363A9D0'/%3E%3Crect x='10' y='30' width='28' height='8' rx='4' fill='%23D6A84B'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 52px;
}

.mode-icon-mapa {
    background-color: #ede9fe !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M8 36V12l10 4 10-4 10 4v24l-10-4-10 4z' fill='none' stroke='%23D6A84B' stroke-width='3'/%3E%3Ccircle cx='18' cy='20' r='3' fill='%231C8C70'/%3E%3Ccircle cx='30' cy='28' r='3' fill='%2363A9D0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 52px;
}

.mode-special-card:not(.mode-special-soon):hover {
    transform: translateY(-2px);
    filter: none;
    background: var(--color-surface-hover) !important;
}

.mode-special-card:not(.mode-special-soon):active {
    transform: translateY(1px);
    box-shadow: var(--btn-shadow-active) !important;
}

.mode-special-badge {
    background: var(--color-primary-bg) !important;
    color: var(--color-text-on-vivid, #fff) !important;
    border-color: var(--color-gold) !important;
}

/* —— Fichas y orden —— */
.words-disorder {
    background-color: #f4f4f4 !important;
    color: #1a1b1f !important;
    border: 1px solid #000 !important;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.word-order,
button.word-order {
    background: linear-gradient(180deg, #5ec4c8, #31a2a6) !important;
    color: #0d2d2f !important;
}

#pnOrderText {
    background-color: rgba(26, 27, 31, 0.94) !important;
    border: 1px solid #000;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.words-disorder,
.word-order,
button.word-order {
    border-radius: 3px !important;
    box-shadow: 0 2px 8px rgba(5, 12, 20, 0.28) !important;
    transition: transform var(--btn-transition), background-color var(--btn-transition);
}

.words-disorder:hover:not(.word-used) {
    transform: translateY(-1px);
}

.word-order,
button.word-order {
    box-shadow: 0 3px 10px rgba(28, 140, 112, 0.35) !important;
}

/* —— HUD 2D —— */
.society-team,
.map-pip {
    border: 1px solid var(--color-border) !important;
    box-shadow: 0 2px 8px rgba(5, 12, 20, 0.28) !important;
    text-shadow: none;
}

#stamp,
.stamp-ok,
.stamp-bad {
    border: 2px solid var(--color-border) !important;
    box-shadow: 0 3px 10px rgba(5, 12, 20, 0.35) !important;
    text-shadow: none;
}

.huecos-hint,
.rojo-narrative {
    text-shadow: none !important;
}

#lbRacha {
    color: var(--color-primary-light) !important;
    text-shadow: none !important;
}

/* Decoración 2D sutil en modal de resultados */
#mdResult .modal-body::before {
    content: "";
    display: block;
    width: 72px;
    height: 12px;
    margin: 0 auto 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 12'%3E%3Ccircle cx='12' cy='6' r='4' fill='%23D6A84B'/%3E%3Ccircle cx='36' cy='6' r='5' fill='%23F0CF83'/%3E%3Ccircle cx='60' cy='6' r='4' fill='%23D6A84B'/%3E%3C/svg%3E")
        center / contain no-repeat;
    opacity: 0.85;
}

.plx-far,
.plx-mid,
.plx-near {
    opacity: 0.55;
}

/* —— Iconografía reutilizada (suite *nario) —— */
.tab-icon,
.chip-icon,
.btn-icon,
.inline-icon,
.img-hud {
    object-fit: contain;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
}

.tab-icon {
    width: 22px;
    height: 22px;
}

.chip-icon {
    width: 24px;
    height: 24px;
}

.btn-icon {
    width: 22px;
    height: 22px;
}

.inline-icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: 6px;
}

.img-hud {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    vertical-align: middle;
    margin-right: 4px;
    flex-shrink: 0;
}

/* HUD tablero: anular Bootstrap img { max-width: 100% } en columnas anchas */
.content-main .header img.img-verso,
.content-main .header img.img-punto,
.img-verso,
.img-punto {
    width: 2em;
    max-width: 2.25em !important;
    height: auto;
    vertical-align: middle;
}

.content-main .header .img-hud {
    width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
}

.arcane-game-band .header .hud-verse-wrap,
.arcane-game-band .header .hud-timer-wrap,
.arcane-game-band .header .hud-score-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.arcane-game-band .header .hud-timer-wrap {
    justify-content: center;
}

.arcane-game-band .header .hud-score-wrap {
    justify-content: flex-end;
}

#lbVersiculo {
    font-size: clamp(0.65rem, 2.5vw, 0.85rem);
    line-height: 1.2;
}

.hud-timer-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.lobby-lead {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.help-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

#pnCondimentos .condimento-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mode-special-card .mode-thumb,
.mode-special-card img {
    object-fit: contain;
    background: var(--color-secondary-bg);
}

.result-icons {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.result-trophy {
    filter: drop-shadow(0 4px 10px rgba(214, 168, 75, 0.35));
}

.fx-confetti-layer {
    position: fixed;
    inset: 0;
    z-index: 1090;
    pointer-events: none;
    overflow: hidden;
}

.fx-confetti-bit {
    position: absolute;
    top: -16px;
    border-radius: 2px;
    opacity: 0.95;
    animation-name: fx-confetti-fall;
    animation-timing-function: ease-in;
    animation-fill-mode: forwards;
    transform: rotate(12deg);
}

@keyframes fx-confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(105vh) rotate(640deg);
        opacity: 0.15;
    }
}

.fx-points-pop {
    position: fixed;
    z-index: 1080;
    color: var(--color-gold-light);
    font-size: 1.1rem;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(5, 12, 20, 0.65);
    transform: translateX(-50%);
}

@media (prefers-reduced-motion: reduce) {
    .fx-confetti-bit {
        display: none;
    }
}

.sound-prefs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.sound-prefs .condimento-chip:not(.condimento-on) {
    opacity: 0.72;
    filter: saturate(0.65);
}

.achievements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: left;
    max-height: min(38vh, 320px);
    overflow-y: auto;
    padding-right: 4px;
}

@media (min-width: 520px) {
    .achievements-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 3px 10px rgba(5, 12, 20, 0.28);
}

.achievement-card img {
    flex-shrink: 0;
    object-fit: contain;
}

.achievement-card img.game-icon {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.achievement-copy strong {
    display: block;
    color: var(--color-parchment);
    font-size: 0.82rem;
}

.achievement-copy small {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.68rem;
    line-height: 1.25;
}

.achievement-card.achievement-on {
    border-color: var(--color-gold);
}

.achievement-card.achievement-locked {
    opacity: 0.55;
    filter: grayscale(0.35);
}

.achievement-card.achievement-locked img {
    opacity: 0.65;
}

.achievement-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-gold);
    color: var(--color-parchment);
    box-shadow: 0 8px 24px rgba(5, 12, 20, 0.5);
    font-size: 0.78rem;
    max-width: min(92vw, 360px);
}

.phaser-board-host {
    width: 100%;
    min-height: 280px;
    margin: 0 auto 8px;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    border-radius: 14px;
    overflow: visible;
    border: 3px solid #000;
    background: rgba(42, 15, 63, 0.92);
    box-shadow: 0 8px 0 #1a0a28, 0 12px 32px rgba(0, 0, 0, 0.45);
}

.phaser-board-host.procedural-bg {
    background: transparent;
}

body:has(.phaser-board-host.procedural-bg) .plx {
    opacity: 0.2;
}

.phaser-board-host canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    touch-action: none;
}

.content-disorder.phaser-on {
    max-height: none !important;
    overflow: visible !important;
    touch-action: none;
    margin-bottom: 8px;
}

.content-disorder.phaser-on #pnDisorderWords {
    padding: 0;
}

.content-order.phaser-compact {
    max-height: none !important;
    overflow: visible !important;
    margin-bottom: 0 !important;
    min-height: 0;
}

.content-order.phaser-compact #pnOrderText {
    min-height: 0;
    padding: 0 !important;
    margin: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.content-order.phaser-compact #stamp:not([hidden]) {
    display: block;
    margin: 6px auto 4px;
}

.content-disorder.dom-board-on {
    max-height: none !important;
    overflow: visible !important;
    touch-action: none;
    margin-bottom: 8px;
}

.content-disorder.dom-board-on #pnDisorderWords.phrase-board-lane {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 8px 14px;
    min-height: 100px;
}

#pnDisorderWords .phrase-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 14px !important;
    margin: 4px 2px !important;
    border-radius: var(--btn-radius);
    background: var(--color-surface) !important;
    color: var(--color-text-primary) !important;
    text-shadow: var(--text-clash-shadow) !important;
    border: 2px solid #000 !important;
    border-top: 4px solid var(--cat-accent, var(--color-primary)) !important;
    box-shadow: 0 4px 0 #1a0a28 !important;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transition:
        transform var(--btn-transition),
        background-color var(--btn-transition),
        box-shadow var(--btn-transition);
}

#pnDisorderWords .phrase-chip:hover {
    background: var(--color-surface-hover) !important;
    transform: translateY(-2px);
}

#pnDisorderWords .phrase-chip:active {
    transform: translateY(1px);
    box-shadow: var(--btn-shadow-active) !important;
}

#pnDisorderWords .phrase-chip.phrase-chip-dragging {
    cursor: grabbing;
    opacity: 1 !important;
    transform: scale(1.04);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.45),
        0 4px 0 #1a0a28 !important;
}

#pnDisorderWords .phrase-chip-gap {
    display: inline-block;
    box-sizing: border-box;
    margin: 4px 2px !important;
    border-radius: var(--btn-radius);
    border: 2px dashed rgba(214, 168, 75, 0.55);
    background: rgba(103, 232, 249, 0.08);
    vertical-align: top;
    pointer-events: none;
}

#pnDisorderWords.phrase-board-locked .phrase-chip {
    pointer-events: none;
    cursor: default;
}

#pnDisorderWords .phrase-guide-num,
#pnDisorderWords .word-disorder-number,
.badge.word-disorder-number {
    display: none !important;
}

@media (min-width: 1280px) {
    #pnDisorderWords .phrase-guide-num {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 1.4em;
        padding: 2px 5px;
        margin-right: 2px;
        font-size: 0.75em;
        font-weight: 800;
        border-radius: 6px;
        background: rgba(0, 0, 0, 0.35);
        color: var(--color-text-primary);
    }

    #pnDisorderWords .word-disorder-number,
    .badge.word-disorder-number {
        display: inline-flex !important;
    }
}

.content-order.dom-board-compact {
    max-height: none !important;
    overflow: visible !important;
    margin-bottom: 0 !important;
    min-height: 0;
}

.content-order.dom-board-compact #pnOrderText {
    min-height: 0;
    padding: 0 !important;
    margin: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.content-order.dom-board-compact #stamp:not([hidden]) {
    display: block;
    margin: 6px auto 4px;
}

.facilitator-bar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(18, 7, 31, 0.92);
    border-bottom: 3px solid #000;
    color: var(--color-text-primary);
    text-shadow: var(--text-clash-shadow);
}

.facilitator-code {
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--color-gold-light);
    color: #1a0a28;
    letter-spacing: 0.12em;
}

body.facilitator-on .content-main .header .col-5,
body.facilitator-on #rowGameActions,
body.facilitator-on #btnOtherVerse {
    display: none !important;
}

body.facilitator-on .titulo {
    font-size: 1.35em;
}

#pnDisorderWords .phrase-hint-glow {
    box-shadow:
        0 0 0 3px rgba(255, 209, 102, 0.95),
        0 4px 0 #1a0a28 !important;
    animation: hint-pulse 1.2s ease-in-out infinite;
}

#pnDisorderWords .phrase-hint-pin {
    border-top-color: var(--color-gold-light) !important;
}

@keyframes hint-pulse {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

.confirm-hint {
    color: var(--color-gold-light);
    text-align: center;
    margin: 4px 0;
}

.verse-context {
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.book-badge.book-locked {
    opacity: 0.55;
    filter: grayscale(0.35);
    cursor: not-allowed;
}

body.facilitator-on #btnFacilitator,
#btnFacilitator.condimento-on {
    border-color: var(--color-gold-light);
    box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.5);
}

#nav-online .online-actions .btn-clash-yellow,
#nav-online .online-actions .btn-clash-violet,
#nav-online .online-actions .btn-clash-teal {
    width: 100%;
    max-width: 280px;
}

/* btn-clash-teal: ver arcane-theme.css */

#nav-online .online-join input {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
}

#mdOnline {
    z-index: 1100;
}

.online-room-panel {
    padding: 12px 10px;
}

.online-hint-ok {
    color: #7dcea0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.online-hint-warn {
    color: #ffd166 !important;
}

.btn-actions.game-toolbar {
    position: relative;
    z-index: 2;
    margin-top: 0;
    padding-top: 8px;
}

.game-toolbar-inner,
.btn-actions.game-toolbar .col-12,
.btn-actions .game-toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
}

@media (max-width: 420px) {
  .game-toolbar-inner [class*="btn-clash"] {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.76rem;
    }

    .game-toolbar-inner [class*="btn-clash"]:not(#btnConfirm) span:not(.sr-only) {
        display: none;
    }

    .game-toolbar-inner .btn-icon,
    .game-toolbar-inner .btn-icon-fa {
        margin-right: 0 !important;
    }
}

[class*="btn-clash"]:focus-visible,
.btn-game:focus-visible,
#pnCondimentos .condimento-chip:focus-visible,
#pnBooks .book-badge[class*="books-"]:focus-visible,
.mode-special-card:focus-visible,
#mdWelcome .welcome-tab-slider .nav-link:focus-visible {
    outline: 2px solid var(--color-gold-light);
    outline-offset: 2px;
}

/* —— Layout lobby / modos (sin estilos clash heredados) —— */
.plx {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.plx-layer {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

.plx-far {
    width: 58vw;
    height: 58vw;
    left: -14vw;
    top: -16vh;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 68%);
}

.plx-mid {
    width: 48vw;
    height: 48vw;
    right: -12vw;
    top: 14vh;
    background: radial-gradient(circle, rgba(255, 136, 0, 0.42), rgba(255, 136, 0, 0) 70%);
}

.plx-near {
    width: 40vw;
    height: 40vw;
    left: 18vw;
    bottom: -12vh;
    background: radial-gradient(circle, rgba(49, 162, 166, 0.45), rgba(49, 162, 166, 0) 72%);
}

.body-bg-default .content-main {
    position: relative;
    z-index: 1;
}

.welcome-modal {
    z-index: 1060;
}

/* Por encima del lobby de inicio (1060) cuando ambos están abiertos */
.warehouse-modal {
    z-index: 1120;
}

.shop-notice-modal {
    z-index: 1140;
}

/* Por encima de welcome-modal (1060) al buscar rival */
.versus-match-modal {
    z-index: 1160;
}

.duel-invite-modal {
    z-index: 1180;
}

.welcome-progress-modal {
    z-index: 1130;
}

.welcome-modal.fade .modal-dialog,
.welcome-modal .modal-content {
    transition: none;
}

.welcome-modal:not(.welcome-ready) .modal-dialog {
    visibility: visible;
}

.welcome-modal .modal-backdrop.show {
    opacity: 0.94;
    background-color: #060608;
}

.welcome-modal.show {
    padding-right: 0 !important;
}

#stamp.stamp-badge {
    position: absolute;
    right: 8px;
    top: -14px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 6px;
    border: 3px solid #000;
    border-radius: 12px;
    box-shadow: 0 4px #000;
    font-size: 0.85rem;
    pointer-events: none;
}

#stamp .stamp-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.fx-points-pop,
.fx-wallet-pop {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: fixed;
    z-index: 1200;
    pointer-events: none;
    color: #ffe08a;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    font-size: 0.82rem;
}

.fx-points-pop {
    position: fixed;
}

.fx-points-pop .fx-coin {
    width: 18px;
    height: 18px;
}

.fx-coin-layer {
    position: fixed;
    inset: 0;
    z-index: 1255;
    pointer-events: none;
    overflow: visible;
}

.fx-flying-coin {
    position: fixed;
    left: 0;
    top: 0;
    pointer-events: none;
    will-change: transform;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.fx-wallet-collect {
    position: fixed;
    transform: translate(-50%, -50%);
}

.arcane-skin .hud-wallet-row.wallet-coin-charging .hud-wallet-coin {
    filter: drop-shadow(0 0 8px rgba(255, 200, 80, 0.85));
}

.arcane-skin .hud-wallet-row.wallet-coin-charging .wallet-amount {
    color: #ffe6a8;
    text-shadow: 0 0 10px rgba(255, 190, 60, 0.55);
}

.result-points-line {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 1.35rem;
}

.result-points-line .result-coin {
    width: 40px;
    height: 40px;
}

.result-points-line .result-points-num {
    font-size: 1.5rem;
    color: #ffe08a;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.stamp-ok {
    background: #4ade80;
    color: #052e16;
}

.stamp-bad {
    background: #e22a4a;
    color: #fff;
}

#pnOrderText {
    position: relative;
}

.content-disorder {
    overflow-x: visible;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 12px;
}

.content-disorder.phaser-on {
    overflow: visible !important;
    overflow-y: visible !important;
    max-height: none !important;
    padding-bottom: 4px;
}

#pnDisorderWords {
    padding: 4px 2px 16px;
    overflow: visible;
}

.content-disorder .words-disorder {
    vertical-align: middle;
}

.fly-ghost {
    position: fixed;
    z-index: 30;
    margin: 0;
    pointer-events: none;
}

.chip-flash {
    box-shadow: 0 0 0 3px #ffc107;
}

.map-pip-now {
    outline: 2px solid var(--color-gold);
    transform: scale(1.05);
}

.rojo-sub {
    color: var(--color-text-secondary);
    margin: 0;
}

.font-size-08em { font-size: 0.9em !important; }
.font-size-1dot6em { font-size: 1.6em !important; }
.font-size-1dot3em { font-size: 1.3em !important; }
.cursor-pointer { cursor: pointer; }

@media (hover: hover) and (pointer: fine) {
    .arcane-skin .cursor-pointer {
        cursor: var(--arcane-cursor-hand, pointer);
    }
}
.disable-any-action { touch-action: none; pointer-events: none; }
.text-green-lemon { color: #9dff00; }

html, body[class*="body-bg-"] {
    min-height: 100%;
    min-height: 100dvh;
}

body[class*="body-bg-"] {
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.body-bg-default,
.body-bg-pauline,
.body-bg-zaqueo,
.body-bg-jesus {
    background-color: #bae6fd;
}

.arcane-skin.body-bg-default {
    background-color: #e0f2fe;
    background-image:
        var(--arcane-body-glow),
        var(--arcane-body-ember),
        linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(186, 230, 253, 0.2) 100%);
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: center top, right bottom, center;
    background-size: 140% 70%, 90% 60%, cover;
    background-attachment: fixed;
}

.arcane-skin.body-bg-default::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image: var(--arcane-body-glow), var(--arcane-body-ember);
    background-size: 140% 70%, 90% 60%;
    background-position: 0% 40%, 100% 80%;
    animation: arcane-body-glow-shift 18s ease-in-out infinite alternate;
}

.arcane-skin.body-bg-pauline {
    background-color: #fef3c7;
    background-image: linear-gradient(to bottom left, rgba(255, 255, 255, 0.65) 0%, rgba(254, 243, 199, 0.45) 100%);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.arcane-skin.body-bg-zaqueo {
    background-color: #ecfdf5;
    background-image: linear-gradient(to bottom left, rgba(255, 255, 255, 0.7) 0%, rgba(187, 247, 208, 0.4) 100%);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

.arcane-skin.body-bg-jesus {
    background-color: #fff1f2;
    background-image: linear-gradient(to bottom left, rgba(255, 255, 255, 0.72) 0%, rgba(254, 226, 226, 0.42) 100%);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

@media (max-width: 767px) {
    html::before {
        content: "";
        position: fixed;
        inset: -28px;
        z-index: -4;
        pointer-events: none;
        background: url(../img/bg.jpg) center / cover no-repeat;
        filter: blur(14px);
        transform: scale(1.06);
        transform-origin: center;
    }

    html:has(body.arcane-skin.arcane-lite-ui)::before {
        filter: blur(6px);
    }

    body[class*="body-bg-"],
    .arcane-skin.body-bg-default,
    .arcane-skin.body-bg-pauline,
    .arcane-skin.body-bg-zaqueo,
    .arcane-skin.body-bg-jesus {
        background-attachment: scroll;
    }

    .arcane-skin.body-bg-default::before {
        animation: none;
    }
}

@media (min-width: 768px) {
    .body-bg-default,
    .body-bg-pauline,
    .body-bg-zaqueo,
    .body-bg-jesus {
        background-image: url(../img/bgWide.jpg);
    }

    .arcane-skin.body-bg-default {
        background-image:
            var(--arcane-body-glow),
            var(--arcane-body-ember),
            linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, rgba(186, 230, 253, 0.12) 100%),
            url(../img/bgWide.jpg);
        background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
        background-position: center top, right bottom, center, center;
        background-size: 140% 70%, 90% 60%, cover, cover;
    }

    .arcane-skin.body-bg-pauline {
        background-image:
            linear-gradient(to bottom left, rgba(255, 255, 255, 0.55) 0%, rgba(254, 243, 199, 0.35) 100%),
            url(../img/bgWide.jpg);
        background-repeat: no-repeat, no-repeat;
        background-size: cover, cover;
    }

    .arcane-skin.body-bg-zaqueo {
        background-image:
            linear-gradient(to bottom left, rgba(255, 255, 255, 0.55) 0%, rgba(187, 247, 208, 0.32) 100%),
            url(../img/bgWide.jpg);
        background-repeat: no-repeat, no-repeat;
        background-size: cover, cover;
    }

    .arcane-skin.body-bg-jesus {
        background-image:
            linear-gradient(to bottom left, rgba(255, 255, 255, 0.58) 0%, rgba(254, 202, 202, 0.3) 100%),
            url(../img/bgWide.jpg);
        background-repeat: no-repeat, no-repeat;
        background-size: cover, cover;
    }

    .content-main { max-width: 980px; }
}

/* —— Splash de arranque (3 s) —— */
body.splash-active {
    overflow: hidden;
}

.app-splash {
    position: fixed;
    inset: 0;
    z-index: 250000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.app-splash__media {
    position: absolute;
    inset: -20px;
    background-color: #0e0f14;
    overflow: hidden;
    transform: scale(1.02);
}

.app-splash__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    pointer-events: none;
}

.app-splash__shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 50% 35%, rgba(49, 162, 166, 0.18), transparent 65%),
        linear-gradient(180deg, rgba(8, 10, 18, 0.35) 0%, rgba(8, 10, 18, 0.72) 100%);
}

.app-splash__content {
    position: relative;
    z-index: 1;
    padding: 24px 20px;
    max-width: 92vw;
}

.app-splash__logo {
    display: block;
    margin: 0 auto 12px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.65));
    animation: splash-logo-in 0.7s cubic-bezier(0.34, 1.25, 0.64, 1) both;
}

.app-splash__title {
    font-size: clamp(1.35rem, 5vw, 1.85rem);
    color: #ffe9a8;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85), 0 0 18px rgba(255, 196, 0, 0.35);
    animation: splash-title-in 0.75s 0.08s cubic-bezier(0.34, 1.25, 0.64, 1) both;
}

.app-splash__tagline {
    margin-top: 6px;
    color: #d4e8ff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
    animation: splash-title-in 0.75s 0.16s cubic-bezier(0.34, 1.25, 0.64, 1) both;
}

.app-splash__bar {
    width: min(280px, 78vw);
    height: 14px;
    margin: 18px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 2px solid rgba(167, 139, 250, 0.45);
    overflow: hidden;
    box-shadow:
        inset 0 2px 5px rgba(91, 33, 182, 0.12),
        0 2px 10px rgba(139, 92, 246, 0.2);
}

.app-splash__bar-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #c4b5fd, #a78bfa, #8b5cf6, #7c3aed);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.65);
    animation: splash-bar-fill 3s linear forwards;
}

.app-splash.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.48s ease, visibility 0s linear 0.48s;
}

@media (max-width: 767px) {
    .app-splash {
        align-items: flex-start;
        justify-content: center;
        padding: max(14px, env(safe-area-inset-top, 0px)) 12px 0;
    }

    .app-splash__media {
        filter: none;
        transform: none;
        inset: 0;
    }

    .app-splash__video {
        object-position: center 68%;
    }

    .app-splash__shade {
        background: transparent;
    }

    .app-splash__content {
        padding: 20px 16px;
        margin: 0 auto;
        width: 100%;
        max-width: 92vw;
        text-align: center;
    }

    .app-splash__logo {
        width: min(168px, 44vw);
        height: auto;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 10px;
    }

    .app-splash__bar {
        margin-top: 14px;
        margin-left: auto;
        margin-right: auto;
    }
}

@keyframes splash-logo-in {
    0% {
        opacity: 0;
        transform: scale(0.82) translateY(16px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes splash-title-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes splash-bar-fill {
    0% { width: 0; }
    100% { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .app-splash__logo,
    .app-splash__title,
    .app-splash__tagline {
        animation: none;
    }

    .app-splash__bar-fill {
        width: 100%;
        animation: none;
    }
}

.panel-verse, .panel-especial {
    max-height: min(58vh, 420px);
    overflow-y: auto;
}
