/* Componentes de jogo: .gm-panel, .gm-btn, .gm-pill, .gm-ic. */
.wb-game-ui .gm-panel {
    background: var(--gm-panel);
    color: var(--gm-text);
    border: var(--gm-border) solid var(--gm-outline);
    border-radius: var(--gm-radius);
    box-shadow: var(--gm-shadow);
    font-family: var(--gm-font-label);
}

.wb-game-ui .gm-btn {
    --gm-btn-bg: var(--gm-blue);
    /* Texto escuro em todas as variantes: AA (azul 6,30:1; rosa 5,68:1; verde 10,03:1; ouro 13,29:1) */
    --gm-btn-fg: var(--gm-text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--gm-touch);
    min-width: var(--gm-touch);
    padding: 8px 20px;
    background: var(--gm-btn-bg);
    color: var(--gm-btn-fg);
    border: var(--gm-border) solid var(--gm-outline);
    border-radius: var(--gm-radius);
    box-shadow: var(--gm-shadow);
    font-family: var(--gm-font);
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.wb-game-ui .gm-btn:active {
    transform: translateY(3px);
    box-shadow: none;
}

.wb-game-ui .gm-btn:focus-visible {
    outline: 3px solid var(--gm-accent);
    outline-offset: 2px;
}

.wb-game-ui .gm-btn--play {
    --gm-btn-bg: var(--gm-green);
}

.wb-game-ui .gm-btn--blue {
    --gm-btn-bg: var(--gm-blue);
}

.wb-game-ui .gm-btn--gold {
    --gm-btn-bg: var(--gm-accent);
}

.wb-game-ui .gm-btn--pink {
    --gm-btn-bg: var(--gm-pink);
}

.wb-game-ui .gm-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 2px 12px;
    background: var(--gm-panel);
    color: var(--gm-text);
    border: 1.5px solid var(--gm-outline);
    border-radius: 999px;
    font-family: var(--gm-font);
    font-size: 1rem;
}

.wb-game-ui .gm-ic {
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: currentColor;
    vertical-align: middle;
    object-fit: contain;
    filter: drop-shadow(0 2px 0 rgba(10, 15, 61, 0.34));
}

/* Modais ainda não migrados: só cor e fonte, o layout segue como está. */
.wb-game-ui .modal-content {
    background: var(--gm-panel);
    color: var(--gm-text);
    border-color: var(--gm-outline);
}

.wb-game-ui .modal-title {
    font-family: var(--gm-font);
}

@media (prefers-reduced-motion: reduce) {
    .wb-game-ui .gm-btn {
        transition: none;
    }
}

/* Crédito dos ícones (CC BY 3.0): só aparece com a camada de jogo ligada. */
.qs-game-credit {
    display: none;
}

/* Ícone semântico comum das telas secundárias. Os SVGs são do mesmo catálogo
   usado pelos modos e power-ups, evitando misturar Bootstrap Icons e emojis. */
.wb-game-ui .gm-ui-ic {
    display: inline-block;
    width: 1.35em;
    height: 1.35em;
    flex: 0 0 auto;
    object-fit: contain;
    vertical-align: middle;
    pointer-events: none;
    filter: drop-shadow(0 2px 0 rgba(10, 15, 61, 0.34));
}

/* Linguagem dos ícones WordBlaster: silhueta branca do game-icons.net sobre
   uma placa escura e compacta. A cor fica no componente, não no desenho. */
.wb-game-ui :is(.gm-pg-ic, .gm-st-ic, .gm-hud-ic) {
    object-fit: contain;
    filter: drop-shadow(0 2px 0 rgba(10, 15, 61, 0.34));
}

.wb-game-ui .qs-game-credit {
    display: block;
    margin: 8px 4px 0;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.85;
}

/* ---- Cartão de dicionário da partida (#gm-dict, dentro de .gm-dict-slot) ----
   Altura fixa: o espaço vem do grid da partida (match.css), então palavra e texto de qualquer
   tamanho não mexem no tabuleiro. O texto é cortado com reticências (3 linhas no retrato, 5 na
   paisagem) e o title do cartão guarda o significado inteiro. */
html.wb-game-ui body.wb-board-active .gm-dict {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    padding: 5px 10px;
    overflow: hidden;
    color: var(--gm-text-dark);
    background: #fff9ea;
    border: var(--gm-border) solid var(--gm-outline);
    border-radius: 14px;
    box-shadow: var(--gm-shadow);
    white-space: normal;
}

html.wb-game-ui body.wb-board-active .gm-dict-ic {
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    /* o SVG é branco; no creme vira escuro */
    filter: brightness(0) opacity(0.78);
}

html.wb-game-ui body.wb-board-active .gm-dict-body {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--gm-font-label);
    font-size: 13px;
    line-height: 15px;
    font-weight: 600;
}

html.wb-game-ui body.wb-board-active .gm-dict-word {
    display: block;
    overflow: hidden;
    font-family: var(--gm-font);
    font-size: 15px;
    line-height: 18px;
    font-weight: 400;
    letter-spacing: 0.03em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

html.wb-game-ui body.wb-board-active .gm-dict-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow-wrap: anywhere;
}

html.wb-game-ui body.wb-board-active .gm-dict-hint {
    display: none;
    align-self: center;
    margin: 0;
    font-family: var(--gm-font-label);
    font-size: 14px;
    font-weight: 600;
    opacity: 0.75;
}

html.wb-game-ui body.wb-board-active .gm-dict.is-empty .gm-dict-hint {
    display: block;
}

html.wb-game-ui body.wb-board-active .gm-dict.is-empty .gm-dict-body {
    display: none;
}

html.wb-game-ui body.wb-board-active .gm-dict.is-empty .gm-dict-ic {
    margin-top: 0;
    align-self: center;
}

@media (orientation: landscape) {
    html.wb-game-ui body.wb-board-active .gm-dict-body {
        font-size: 12px;
        line-height: 14px;
    }

    html.wb-game-ui body.wb-board-active .gm-dict-text {
        -webkit-line-clamp: 5;
        line-clamp: 5;
    }
}

@media (orientation: landscape) and (min-width: 1100px) {
    html.wb-game-ui body.wb-board-active .gm-dict {
        gap: 12px;
        padding: 10px 16px;
    }

    html.wb-game-ui body.wb-board-active .gm-dict-ic {
        width: 30px;
        height: 30px;
    }

    html.wb-game-ui body.wb-board-active .gm-dict-body {
        font-size: clamp(1rem, 1.25vw, 1.3rem);
        line-height: 1.3;
    }

    html.wb-game-ui body.wb-board-active .gm-dict-word {
        font-size: clamp(1.15rem, 1.5vw, 1.6rem);
        line-height: 1.3;
    }

    html.wb-game-ui body.wb-board-active .gm-dict-hint {
        font-size: clamp(1rem, 1.3vw, 1.3rem);
    }
}

/* O cartão assume o lugar do aviso de definição antigo */
html.wb-game-ui body.wb-board-active #definition-toast {
    display: none !important;
}

/* Oferta de vídeo na pré-partida (bombas e bônus grátis): botão dourado, claramente opcional */
.pre-match-ad-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.5rem 1rem;
    line-height: 1.15;
    white-space: normal;
    font-weight: 800;
    color: #fff3c4 !important;
    background: rgba(255, 210, 74, 0.16) !important;
    border: 2px solid #ffd24a !important;
    text-shadow: none;
}
.pre-match-ad-btn:hover:not(:disabled),
.pre-match-ad-btn:focus-visible {
    background: rgba(255, 210, 74, 0.28) !important;
}
.pre-match-ad-btn:disabled {
    opacity: 0.6;
}
