/* Azulejo de Café — arte completa e azulejos ilustrados. */
.arena-azulejo-theme {
    --azl-board-art: url('/assets/images/arena-azulejo/tabuleiro-cafe.webp');
    --azl-tile-art: url('/assets/images/arena-azulejo/azulejos-cafe.webp');
    background: #160c06 var(--azl-board-art) center top / cover fixed no-repeat;
}
.arena-azulejo-theme::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: rgba(18, 9, 4, .58);
}
.arena-azulejo-theme .app-main,
.arena-azulejo-theme .content-page { background: transparent; }
.arena-azulejo-theme .app-shell { min-height: 100vh; }
.arena-azulejo-theme .app-main {
    min-height: 100vh; display: flex; flex-direction: column;
}
.arena-azulejo-theme .content-page { flex: 1 0 auto; }
.arena-azulejo-theme .footer { margin-top: auto; }

/* O Azulejo usa toda a largura: esta página não renderiza o menu lateral. */
.arena-azulejo-no-sidebar .app-shell,
.arena-azulejo-no-sidebar .app-main { width: 100%; }
.arena-azulejo-no-sidebar .app-main { padding-top: 0; }
.arena-azulejo-no-sidebar .live-bar { left: 0; }
.arena-azulejo-theme .arena-game-wide {
    width: calc(100% - clamp(1rem, 2vw, 2rem)); max-width: 1760px; padding: clamp(.5rem, 1vw, .85rem);
    border: 1px solid rgba(116, 72, 34, .9); border-radius: 22px;
    background: rgba(27, 15, 8, .93); box-shadow: 0 24px 70px rgba(0,0,0,.62);
    backdrop-filter: blur(3px);
}
.arena-azulejo-theme .mem-title,
.arena-azulejo-theme .cafe-header h1 { color: #f2dba6; text-shadow: 0 2px 0 #2c1609; }

/* Cabeçalho compacto: retorno à esquerda, sala e rodada centralizados. */
.arena-azulejo-theme .azl-room-head {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center; gap: .7rem; margin: 0 0 .55rem; padding: .05rem .2rem .55rem;
}
.arena-azulejo-theme .azl-game-back {
    justify-self: start; color: #d2ad79; font-size: .86rem; white-space: nowrap;
}
.arena-azulejo-theme .azl-game-back:hover { color: #f3d69e; }
.arena-azulejo-theme .azl-room-head .mem-head2-main { grid-column: 2; text-align: center; }
.arena-azulejo-theme .azl-room-head .mem-title { font-size: clamp(1.45rem, 2.2vw, 1.9rem); }
.arena-azulejo-theme .azl-room-head .azl-turn-pill { grid-column: 3; justify-self: end; }

/* Fase de jogo: o "Voltar" fica ancorado no canto superior esquerdo (fora do
   fluxo) para NÃO empurrar nada; assim o título e a mesa começam no topo. */
.arena-azulejo-theme .azl-back-inline {
    position: absolute; top: 0; left: 0; z-index: 2;
    display: inline-flex; align-items: center; gap: .35rem; margin: 0;
}
.arena-azulejo-theme .azl-head-center { text-align: center; margin: 0 0 .55rem; }
.arena-azulejo-theme .azl-head-center .mem-kicker { letter-spacing: .14em; }
.arena-azulejo-theme .azl-head-center .mem-title {
    font-size: clamp(1.45rem, 2.2vw, 1.9rem); margin: .12rem 0 .35rem;
}
.arena-azulejo-theme .azl-head-center .azl-turn-pill { display: inline-flex; }

/* Layout: mesa à esquerda e os tabuleiros ilustrados à direita. */
.arena-azulejo-theme .azl-layout {
    /* Título, status, mesa e tabuleiros são filhos DIRETOS, posicionados por
       grid-area — assim o retrato pode dar largura total ao status sem afetar o
       desktop/paisagem (que recriam o layout de antes via áreas). O "zoom" é o
       nº de COLUNAS dos tabuleiros (reflow) dentro da coluna da direita. */
    display: grid; position: relative;
    grid-template-columns: minmax(420px, 1.15fr) minmax(0, 0.85fr);
    grid-template-areas: "title boards" "status boards" "mesa boards";
    align-items: start; gap: clamp(.6rem, 1vw, .9rem);
}
.arena-azulejo-theme .azl-layout.azl-layout-ending {
    grid-template-areas: "banner banner" "title boards" "status boards" "mesa boards";
}
.arena-azulejo-theme .azl-layout.is-done { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
.arena-azulejo-theme .azl-ending-banner { grid-area: banner; }
.arena-azulejo-theme .azl-head-center { grid-area: title; }
.arena-azulejo-theme .azl-table-status { grid-area: status; }
.arena-azulejo-theme .azl-table-col { grid-area: mesa; min-width: 0; }
.arena-azulejo-theme .azl-layout > .azl-boards { grid-area: boards; }

/* Pinça + arraste (estilo BGA): .azl-zoom-viewport recorta a área de jogo e a
   .azl-layout é ampliada/arrastada por transform (via arena-azul.js). Com zoom=1
   nada é recortado e o toque rola a página (touch-action pan-y); ampliado, a
   viewport captura o gesto (touch-action none) e um dedo arrasta. */
.arena-azulejo-theme .azl-zoom-viewport { position: relative; touch-action: pan-y; }
.arena-azulejo-theme .azl-zoom-viewport.is-zoomed { overflow: hidden; touch-action: none; cursor: grab; }
.arena-azulejo-theme .azl-zoom-viewport > .azl-layout { transform-origin: 0 0; }

/* Fim de jogo: a jogada pendente encerra a partida. A mesa fica cinza e um aviso
   aparece para todos; segue assim até a confirmação virar apuração. */
.arena-azulejo-theme .azl-ending-game .azl-table { filter: grayscale(1) brightness(.58); transition: filter .5s ease; }
.arena-azulejo-theme .azl-ending-game .azl-table-status { opacity: .68; }
.azl-ending-banner {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    margin: 0 0 .55rem; padding: .6rem .9rem; border-radius: 12px;
    background: linear-gradient(180deg, rgba(126,28,28,.94), rgba(84,16,16,.94));
    border: 1px solid #f0a2a2; color: #ffe4e4; font-weight: 700; font-size: .96rem;
    text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.4);
    animation: azlEndingPulse 1.6s ease-in-out infinite;
}
.azl-ending-banner i { color: #ffd27a; }
@keyframes azlEndingPulse {
    0%, 100% { box-shadow: 0 6px 18px rgba(0,0,0,.4); }
    50% { box-shadow: 0 6px 26px rgba(232,96,96,.55); }
}

/* Coluna da direita: grade dos tabuleiros que REFLUI conforme o zoom. */
.arena-azulejo-theme .azl-layout .azl-boards {
    position: relative; width: 100%; min-width: 0; padding-left: 42px;
}
.arena-azulejo-theme .azl-layout .azl-boards-grid {
    min-width: 0; width: 100%;
    display: grid; grid-template-columns: repeat(var(--azl-cols, 2), minmax(0, 1fr));
    align-items: start; align-content: start; gap: .6rem;
}
/* Tabuleiros menores lado a lado + mesa maior (mesma cara para 2, 3 ou 4). */
.arena-azulejo-theme .azl-boards .azl-board { width: 100%; max-width: 420px; margin: 0 auto; }

/* Botões de zoom: coluna vertical à esquerda dos tabuleiros (fora do fluxo). */
.arena-azulejo-theme .azl-zoombar {
    position: absolute; left: 2px; top: 0; z-index: 5;
    display: flex; flex-direction: column; gap: .35rem;
}
.arena-azulejo-theme .azl-zoom-btn {
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer; line-height: 1;
    background: rgba(30,20,12,.72); border: 1px solid rgba(224,161,58,.55); color: #f2dba6;
    display: inline-flex; align-items: center; justify-content: center; font-size: .9rem;
}
.arena-azulejo-theme .azl-zoom-btn:hover:not(:disabled) { border-color: #e0a13a; background: rgba(70,46,22,.9); }
.arena-azulejo-theme .azl-zoom-btn:disabled { opacity: .35; cursor: default; }

/* Barra do replay (partidas novas): início · anterior · ir para nº · próxima · fim. */
.azl-replay-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: flex; align-items: center; justify-content: center; gap: .55rem; flex-wrap: wrap;
    padding: .6rem 1rem; background: rgba(20,12,6,.97); border-top: 1px solid #7a4f27;
    color: #f2dba6; box-shadow: 0 -6px 18px rgba(0,0,0,.45);
}
.azl-rp-btn {
    width: 38px; height: 38px; border-radius: 9px; border: 1px solid #9a6b38; background: #2a1a0e;
    color: #f2dba6; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem;
}
.azl-rp-btn:hover:not(:disabled) { border-color: #e0a13a; background: #3a2614; }
.azl-rp-btn:disabled { opacity: .4; cursor: default; }
.azl-rp-mid { font-size: .9rem; color: #e6c193; white-space: nowrap; }
.azl-rp-mid input { width: 3.4rem; text-align: center; background: #170d08; border: 1px solid #9a6b38; color: #f2dba6; border-radius: 6px; padding: .28rem; font: inherit; margin: 0 .15rem; }
.azl-rp-desc { flex-basis: 100%; text-align: center; color: #d2ad79; font-size: .84rem; }
body.azl-has-replay-bar #azlApp { padding-bottom: 96px; }

/* O jogo agora roda com o celular em pé (o layout reflui para 1 coluna). O
   antigo convite bloqueante "gire o celular" foi removido; o zoom no touch é a
   pinça de dois dedos (arena-azul.js: setupPinchZoom). */
.azl-rotate { display: none; }
.azl-rotate .azl-rotate-ic { font-size: 3rem; color: #e0a13a; animation: azlRotateSpin 2.4s ease-in-out infinite; }
@keyframes azlRotateSpin { 0%, 60%, 100% { transform: rotate(0); } 30% { transform: rotate(90deg); } }
.azl-rotate h2 { font-family: 'Newsreader', Georgia, serif; font-size: 1.4rem; margin: 0; color: #f2dba6; }
.azl-rotate p { margin: 0; color: #d2ad79; font-size: .95rem; max-width: 22rem; line-height: 1.5; }
.azl-rotate .azl-rotate-btn {
    margin-top: .4rem; background: #e0a13a; color: #1a1206; border: none; border-radius: 999px;
    padding: .7rem 1.4rem; font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem;
}
.azl-rotate .azl-rotate-back { margin-top: .3rem; color: #d2ad79; font-size: .88rem; }
.azl-rotate .azl-rotate-back:hover { color: #f3d69e; }
@media (prefers-reduced-motion: reduce) {
    .azl-rotate .azl-rotate-ic { animation: none; }
    .azl-status-hint.is-blink { animation: none; }
    .azl-ending-banner { animation: none; }
}
.arena-azulejo-theme .azl-layout.is-done .azl-boards { padding-left: 0; max-width: 960px; margin: 0 auto; }
.arena-azulejo-theme .azl-layout.is-done .azl-boards-grid { max-width: 960px; margin: 0 auto; }

/* Jogador ativo, seleção e cronômetro. */
.azl-table-status {
    width: 100%; margin: 0 auto .42rem; padding: .48rem .8rem;
    display: flex; align-items: center; gap: .7rem; border: 2px ridge #9a6530;
    border-radius: 14px; background: rgba(45, 26, 13, .97); color: #f1dfb7;
    box-shadow: 0 8px 18px rgba(0,0,0,.38);
}
.azl-turn-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid #c59554; }
.azl-turn-avatar-ph { display: inline-flex; align-items: center; justify-content: center; background: #6b3d20; font-weight: 800; }
.azl-table-player { display: flex; flex-direction: column; line-height: 1.1; flex: 0 0 auto; }
.azl-table-player small { color: #b99669; font: 500 .62rem 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: .08em; }
/* Dica no meio da barra: cresce entre nome e cronômetro; pisca na minha vez. */
.azl-status-mid { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: .35rem; text-align: center; }
.azl-status-hint { color: #d4b078; font-size: .86rem; line-height: 1.25; }
.azl-status-hint strong { color: #f2dba6; }
.azl-status-hint.is-blink { color: #ffe08b; animation: azlBlink 1.1s ease-in-out infinite; }
.azl-status-hint .azl-tile.azl-chosen-mini { width: 20px; height: 20px; flex: 0 0 20px; display: inline-block; vertical-align: middle; }
@keyframes azlBlink { 0%, 100% { opacity: 1; } 50% { opacity: .38; } }
.azl-picked { min-width: 90px; margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.azl-picked small { color: #b99a70; font-size: .68rem; text-align: right; }
.azl-picked .azl-tile { width: 29px; height: 29px; flex: 0 0 29px; }
.azl-turn-clock {
    min-width: 72px; padding: .38rem .48rem; border: 1px solid #9a6b38; border-radius: 8px;
    background: #170d08; color: #f1d49a; text-align: center; font: 700 .86rem 'JetBrains Mono', monospace;
}
.azl-turn-clock.is-negative { color: #ff705e; border-color: #b33d32; background: #32100d; animation: azlTimerPulse .8s ease-in-out infinite; }
@keyframes azlTimerPulse { 50% { box-shadow: 0 0 0 4px rgba(215,66,51,.18); } }

.arena-azulejo-theme .azl-action-guide,
.arena-azulejo-theme .azl-hint {
    width: min(100%, 900px); max-width: 900px; margin: 0 auto .42rem; padding: .48rem .65rem;
    background: rgba(38, 21, 11, .96); border-color: #805126;
}
.arena-azulejo-theme .azl-hint-swatch {
    width: 30px; height: 30px; flex: 0 0 30px; border-radius: 7%;
    box-shadow: 0 0 0 2px #c8944f, 0 2px 5px rgba(0,0,0,.45);
}

/* Mesa e pires mantêm a leitura da mesma madeira/parchment da prancha. */
.arena-azulejo-theme .azl-table {
    /* Preenche a largura da coluna (mesma do card do jogador), sem colunas
       vazias nas laterais. */
    width: 100%; max-width: none; margin: .1rem auto .7rem; padding: .35rem .6rem;
    background: radial-gradient(ellipse at 50% 46%, rgba(244,224,181,.96), rgba(139,84,37,.97) 76%);
    border: 7px ridge #70421f; border-radius: 22px;
    box-shadow: inset 0 0 45px rgba(57,27,10,.58), 0 12px 28px rgba(0,0,0,.42);
}
.arena-azulejo-theme .azl-ring {
    width: 100%; max-width: 860px; height: clamp(300px, 23vw, 440px); margin: 0 auto;
}
.arena-azulejo-theme .azl-center-circle {
    width: clamp(132px, 12vw, 184px); height: clamp(98px, 10vw, 132px); padding: 8px;
    border: 0; border-radius: 14px; background: transparent; box-shadow: none;
}
.arena-azulejo-theme .azl-factory {
    z-index: 2; background: #ead6a9; border-color: #936535;
}

/* Atlas real: cinco azulejos ilustrados, sem caracteres ou emoji. */
.arena-azulejo-theme .azl-tile {
    position: relative; display: block; overflow: hidden; border-radius: 8%;
    background-image: var(--azl-tile-art) !important;
    background-size: 500% 100% !important; background-repeat: no-repeat !important;
    background-color: transparent !important;
    box-shadow: inset 0 0 0 1px rgba(71,36,12,.65), 0 1px 3px rgba(0,0,0,.48);
}
.arena-azulejo-theme .azl-tile.t0 { background-position: 0% 0 !important; }
.arena-azulejo-theme .azl-tile.t1 { background-position: 25% 0 !important; }
.arena-azulejo-theme .azl-tile.t2 { background-position: 50% 0 !important; }
.arena-azulejo-theme .azl-tile.t3 { background-position: 75% 0 !important; }
.arena-azulejo-theme .azl-tile.t4 { background-position: 100% 0 !important; }

/* Cada card usa a prancha completa enviada pelo proprietário. */
.arena-azulejo-theme .azl-board {
    position: relative; overflow: visible; padding: 0; border: 0; border-radius: 0;
    background: transparent; color: #f3dfb8; box-shadow: none;
}
.arena-azulejo-theme .azl-board-head {
    position: relative; z-index: 5; min-height: 42px; margin: 0 1.2% .36rem; padding: .48rem .65rem;
    display: flex; align-items: center; gap: .45rem; border: 2px ridge #8a5b2d; border-radius: 12px;
    background: rgba(43,25,13,.97); color: #f2deb5; box-shadow: 0 5px 12px rgba(0,0,0,.38);
}
.arena-azulejo-theme .azl-board-mine .azl-board-head { border-color: #c08a43; }
.arena-azulejo-theme .azl-board-opp { pointer-events: none; }
.arena-azulejo-theme .azl-board-opp.is-turn .azl-board-head { box-shadow: 0 0 0 3px rgba(224,161,58,.3), 0 5px 12px rgba(0,0,0,.38); }
.arena-azulejo-theme .azl-mini-av { width: 27px; height: 27px; border: 2px solid #c59554; }
.arena-azulejo-theme .azl-score { margin-left: auto; color: #f0c77d; }
.azl-you-tag { padding: .08rem .35rem; border: 1px solid #b9864d; border-radius: 999px; color: #e8c992; font: 700 .55rem 'JetBrains Mono', monospace; text-transform: uppercase; }
.arena-azulejo-theme .azl-board.is-finalist {
    padding: .28rem; border: 1px solid #8d572d; border-radius: 14px;
    background: #241107; box-shadow: 0 0 0 2px rgba(202,139,67,.2), 0 12px 28px rgba(0,0,0,.58);
}
.arena-azulejo-theme .azl-board.is-finalist .azl-board-head {
    margin-inline: 0; background: #2a1309; border-color: #d19348;
}
.azl-finalist-tag {
    display: inline-flex; align-items: center; gap: .25rem; margin-left: .25rem; padding: .16rem .38rem;
    border: 1px solid rgba(232,184,102,.55); border-radius: 999px; color: #f2cf92;
    font: 700 .54rem 'JetBrains Mono', monospace; text-transform: uppercase; white-space: nowrap;
}
.azl-tie-break { margin: .1rem 0 0; color: #c7a77a; font-size: .72rem; }

/* Sinal de encerramento sem GIF externo: xícara e café animados em CSS. */
.azl-last-round {
    width: min(100%, 720px); margin: .2rem auto .75rem; padding: .5rem .8rem;
    display: flex; align-items: center; justify-content: center; gap: .8rem;
    border: 1px solid #805126; border-radius: 14px; background: #2a140a; color: #f1d9ab;
    box-shadow: inset 0 0 24px rgba(0,0,0,.25), 0 7px 18px rgba(0,0,0,.3);
}
.azl-last-round > span:last-child { display: flex; flex-direction: column; }
.azl-last-round small { color: #b99669; }
.azl-coffee-brew { position: relative; width: 54px; height: 42px; flex: 0 0 54px; }
.azl-coffee-brew b {
    position: absolute; left: 8px; bottom: 2px; width: 34px; height: 24px;
    border: 4px solid #e4bd7a; border-top: 0; border-radius: 0 0 13px 13px;
}
.azl-coffee-brew b::after {
    content: ""; position: absolute; right: -14px; top: 3px; width: 12px; height: 12px;
    border: 4px solid #e4bd7a; border-left: 0; border-radius: 0 9px 9px 0;
}
.azl-coffee-brew i,
.azl-coffee-brew i::before,
.azl-coffee-brew i::after {
    content: ""; position: absolute; top: 0; width: 3px; height: 18px; border-radius: 50%;
    background: linear-gradient(transparent, rgba(245,222,174,.9), transparent);
    animation: azlCoffeeSteam 1.35s ease-in-out infinite;
}
.azl-coffee-brew i { left: 17px; }
.azl-coffee-brew i::before { left: 9px; top: 2px; animation-delay: -.45s; }
.azl-coffee-brew i::after { left: 18px; top: 0; animation-delay: -.9s; }
@keyframes azlCoffeeSteam { 0%,100% { opacity: .15; transform: translateY(5px) scaleY(.75); } 50% { opacity: 1; transform: translateY(-3px) scaleY(1.05); } }

.azl-finished-section { margin-top: 1.2rem; }
#azlFinished { display: grid; gap: .55rem; }
.azl-finished-item {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .65rem .75rem;
    border: 1px solid rgba(137,88,45,.7); border-radius: 12px; background: rgba(39,21,11,.92);
}
.azl-finished-item > span:first-child { display: flex; flex-direction: column; color: #edd3a0; }
.azl-finished-item small { color: #af8d63; }
.azl-finished-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.arena-azulejo-theme .azl-boards-count-3 .azl-board-head,
.arena-azulejo-theme .azl-boards-count-4 .azl-board-head {
    min-height: 36px; padding: .32rem .45rem; font-size: .82rem;
}
.arena-azulejo-theme .azl-boards-count-3 .azl-mini-av,
.arena-azulejo-theme .azl-boards-count-4 .azl-mini-av { width: 24px; height: 24px; }

.arena-azulejo-theme .azl-board-main {
    position: relative; display: block; width: 100%; aspect-ratio: 1280 / 901; overflow: hidden;
    border-radius: 1.4%; background: var(--azl-board-art) center / 100% 100% no-repeat;
    box-shadow: 0 12px 26px rgba(0,0,0,.52);
}

/* Linhas 1–5 sobre os espaços vazios da própria arte. */
.arena-azulejo-theme .azl-lines {
    position: absolute; z-index: 3; left: 6.8%; top: 4.3%; width: 40.7%; height: 62.2%;
    display: grid; grid-template-rows: repeat(5, 1fr); gap: .4%; align-items: stretch;
}
.arena-azulejo-theme .azl-line {
    --azl-line-slots: 5; width: calc(var(--azl-line-slots) * 20%); min-width: 0;
    margin-left: auto; display: grid; grid-template-columns: repeat(var(--azl-line-slots), 1fr);
    align-items: center; gap: 1.2%;
    padding: .2%; border: 0; border-radius: 8px; background: transparent; box-shadow: none;
}
.arena-azulejo-theme .azl-line .azl-slot {
    width: 100%; height: 84%; aspect-ratio: 1 / 1;
    border-radius: 8%; background: transparent; box-shadow: none;
}
.arena-azulejo-theme .azl-line.is-valid {
    cursor: pointer; outline: 3px dotted #080503; outline-offset: -3px;
    background: rgba(8,5,3,.12); box-shadow: 0 0 0 1px rgba(238,210,164,.45), 0 0 14px rgba(0,0,0,.42);
}
.arena-azulejo-theme .azl-line.is-valid:hover { background: rgba(8,5,3,.22); }
.arena-azulejo-theme .azl-line-ro { pointer-events: none; }

/* Parede estática da arte; só o estado preenchido recebe realce. */
.arena-azulejo-theme .azl-wall {
    position: absolute; z-index: 3; left: 53%; top: 4.05%; width: 44.2%; height: 62.8%;
    display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); gap: .35%;
    padding: 0; background: transparent; isolation: isolate;
}
.arena-azulejo-theme .azl-wall::before {
    content: ""; position: absolute; z-index: 0; inset: 0;
    background: #ead7ac; pointer-events: none;
}
.arena-azulejo-theme .azl-wc {
    position: relative; z-index: 1; width: auto; height: auto; border: 0; border-radius: 7%;
    background: transparent; box-shadow: none; pointer-events: none;
}
.arena-azulejo-theme .azl-wc .azl-ghost { width: 100%; height: 100%; opacity: .50; }
.arena-azulejo-theme .azl-wc.is-on {
    outline: 2px solid #ffe08b; outline-offset: -3px;
    box-shadow: inset 0 0 12px rgba(255,230,147,.78), 0 0 8px rgba(255,188,58,.75);
}
.arena-azulejo-theme .azl-wc.is-on .azl-tile { width: 100%; height: 100%; opacity: 1; }

/* Chão alinhado aos sete nichos do Azul: -1, -1, -2, -2, -2, -3 e -3. */
.arena-azulejo-theme .azl-floor {
    position: absolute; z-index: 4; left: .9%; top: 68.1%; width: 72.4%; height: 31%;
    display: grid; grid-template-columns: repeat(7, 1fr); gap: .18%; margin: 0;
}
.arena-azulejo-theme .azl-fslot {
    position: relative; width: auto; height: auto; display: flex; align-items: center; justify-content: center;
    padding-top: 20%; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.arena-azulejo-theme .azl-fslot small { display: none; }
.arena-azulejo-theme .azl-fslot .azl-tile { width: 43%; height: auto; aspect-ratio: 1 / 1; }
.arena-azulejo-theme .azl-fslot .azl-first { width: 38%; height: auto; aspect-ratio: 1 / 1; }
.arena-azulejo-theme .azl-tofloor {
    margin: .45rem auto 0 1.2%; display: block; border-color: #8f251c; color: #fff0eb;
    background: #a83228; box-shadow: 0 5px 12px rgba(50,5,3,.32);
}
.arena-azulejo-theme .azl-tofloor:hover { border-color: #d55b4f; background: #c23c31; color: #fff; }

/* Pontuação por rodada e bônus finais. */
.azl-wc, .azl-board-head { position: relative; }
.azl-score-outline {
    position: absolute; z-index: 14; display: block; pointer-events: none;
    border: 5px solid #fff; border-radius: 7px;
    box-shadow: 0 0 4px #fff, 0 0 13px #fff, 0 0 28px rgba(255,231,166,.98), inset 0 0 10px rgba(255,255,255,.58);
    animation: azlScoreOutline 1.5s ease-in-out both;
}
.azl-score-outline-value {
    position: absolute; z-index: 1; right: -12px; top: -22px; min-width: 40px; padding: 3px 7px;
    border: 3px solid #fff; border-radius: 999px; background: #2c160d; color: #fff;
    box-shadow: 0 0 10px #fff, 0 3px 8px rgba(0,0,0,.52);
    text-align: center; font: 900 .8rem 'JetBrains Mono', monospace;
}
.azl-score-outline.is-diagonal .azl-score-outline-value { transform: rotate(var(--azl-counter-rotation)); }
@keyframes azlScoreOutline {
    0% { opacity: 0; filter: brightness(1); }
    12%, 82% { opacity: 1; filter: brightness(1.35); }
    38% { box-shadow: 0 0 8px #fff, 0 0 22px #fff, 0 0 38px rgba(255,218,124,1), inset 0 0 16px rgba(255,255,255,.8); }
    100% { opacity: 0; filter: brightness(1); }
}
.azl-point-pop {
    position: absolute; z-index: 12; left: 50%; top: 50%; transform: translate(-50%,-50%);
    color: #fff4bd; text-shadow: 0 2px 4px #351609, 0 0 8px #d58e30;
    font: 900 1.15rem 'JetBrains Mono', monospace; pointer-events: none;
    animation: azlPointHalf 1.5s ease-out forwards;
}
.azl-point-pop.is-penalty { color: #ff7768; text-shadow: 0 2px 4px #390a06; font-size: 1.35rem; }
.azl-point-pop.is-bonus { left: auto; right: 2.5rem; color: #ffe188; font-size: 1.25rem; }
.azl-point-pop.is-total { left: auto; right: 1rem; color: #9ff2aa; font-size: 1rem; white-space: nowrap; }
.arena-azulejo-theme .azl-score.is-updated { animation: azlScoreTotal 1.5s ease; }
@keyframes azlPointHalf {
    0% { opacity: 0; transform: translate(-50%,-15%) scale(.65); }
    35% { opacity: 1; transform: translate(-50%,-80%) scale(1.18); }
    100% { opacity: 0; transform: translate(-50%,-145%) scale(.92); }
}
.azl-wc.is-score-pop { z-index: 6; animation: azlTileScore 1.5s ease; }
.azl-floor.is-penalty-pop { animation: azlPenalty 1.5s ease; }
.azl-wc.is-bonus-flash { z-index: 6; animation: azlBonusFlash 1.5s ease; }
@keyframes azlTileScore { 50% { transform: scale(1.12); box-shadow: 0 0 0 4px rgba(255,211,107,.7), 0 0 18px #ffcd58; } }
@keyframes azlPenalty { 50% { transform: translateX(3px); filter: saturate(1.8); } }
@keyframes azlBonusFlash { 15%, 85% { filter: brightness(1.8); box-shadow: 0 0 0 4px #fff, 0 0 22px #fff; } }
@keyframes azlScoreTotal { 35% { color: #a9f3b2; transform: scale(1.18); text-shadow: 0 0 12px rgba(126,255,148,.75); } }
.live-rbtn.is-cooldown { opacity: .45; filter: grayscale(.65); cursor: not-allowed; }

@media (max-width: 1080px) {
    /* HORIZONTAL/tablet: comportamento ORIGINAL (empilhado). Sem áreas: os filhos
       (título, status, mesa, tabuleiros) empilham na ordem do DOM, como antes.
       O layout de duas colunas fica só no bloco de RETRATO abaixo. */
    .arena-azulejo-theme .azl-layout,
    .arena-azulejo-theme .azl-layout.azl-layout-ending {
        grid-template-columns: minmax(0, 1fr); grid-template-areas: none; padding-bottom: 6.5rem;
    }
    .arena-azulejo-theme .azl-layout > .azl-boards {
        width: 100%; min-width: 0; max-width: 940px; margin: 0 auto; justify-content: center;
    }
}
/* Só em RETRATO: o card "jogando agora" vai para ABAIXO da mesa (pedido do
   usuário). A coluna vira flex e o status recebe order maior para ir por último;
   o "Voltar" é absoluto, então não entra nessa ordenação. Em paisagem fica como
   estava (status acima da mesa). */
@media (max-width: 1080px) and (orientation: portrait) {
    /* Retrato (celular em pé): tudo mais compacto e com fontes menores.
       IMPORTANTE: só afeta retrato — o horizontal fica intacto. */
    /* Status ocupa a LARGURA TODA no topo; abaixo, mesa (mais larga) | tabuleiros.
       O "Voltar" e o título também ficam na faixa de cima. */
    .arena-azulejo-theme .azl-layout {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
        grid-template-areas: "back back" "title title" "status status" "mesa boards";
        gap: .5rem;
    }
    .arena-azulejo-theme .azl-layout.azl-layout-ending {
        grid-template-areas: "banner banner" "back back" "title title" "status status" "mesa boards";
    }
    /* "Voltar" no fluxo, na própria faixa (não sobrepõe banner/título/status). */
    .arena-azulejo-theme .azl-back-inline { position: static; grid-area: back; margin: 0; }
    .arena-azulejo-theme .azl-layout > .azl-boards { max-width: none; margin: 0; padding-left: 30px; }
    /* Card "jogando agora" no TOPO (largura total) e mais compacto. */
    .arena-azulejo-theme .azl-table-status { padding: .34rem .55rem; margin-bottom: .4rem; }
    /* Azulejos da mesa bem menores (mais compactos). */
    .arena-azulejo-theme .azl-src { width: 16px; height: 16px; }
    .arena-azulejo-theme .azl-factory-empty { width: 16px; height: 16px; }
    /* Cabeçalho geral menor. */
    .arena-azulejo-theme .azl-head-center .mem-title { font-size: 1.15rem; }
    .arena-azulejo-theme .azl-head-center .mem-kicker { font-size: .58rem; }
    /* Cards dos jogadores com ALTURA ~ da foto (não esticar): sem altura mínima,
       menos padding, foto define o tamanho. Fontes menores e sem negrito pesado;
       nome corta com reticências se for longo; placar à direita. */
    .arena-azulejo-theme .azl-board-head { min-height: 0; padding: .22rem .42rem; gap: .34rem; border-radius: 9px; }
    .arena-azulejo-theme .azl-mini-av { width: 26px; height: 26px; }
    .arena-azulejo-theme .azl-board-head strong {
        font-size: .66rem; font-weight: 600; min-width: 0;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .arena-azulejo-theme .azl-board-head .azl-score { font-size: .66rem; font-weight: 600; }
    .arena-azulejo-theme .azl-you-tag { font-size: .46rem; padding: .04rem .26rem; }
    /* Card "jogando agora": fontes menores, negrito aliviado. */
    .arena-azulejo-theme .azl-status-hint { font-size: .7rem; }
    .arena-azulejo-theme .azl-status-hint strong { font-weight: 600; }
    .arena-azulejo-theme .azl-table-player strong { font-size: .76rem; font-weight: 600; }
    .arena-azulejo-theme .azl-table-player small { font-size: .52rem; }
    .arena-azulejo-theme .azl-turn-clock { font-size: .78rem; min-width: 56px; }
    .arena-azulejo-theme .azl-turn-avatar { width: 30px; height: 30px; }
    /* Números do chão menores. */
    .arena-azulejo-theme .azl-fslot small { font-size: .58rem; }
}
@media (max-width: 620px) {
    .arena-azulejo-theme { background-size: auto 100vh; }
    .arena-azulejo-theme .arena-game-wide { width: calc(100% - .5rem); padding: .5rem; border-radius: 14px; }
    /* Mesa na coluna estreita da esquerda: proporcional à largura (antes 300px
       fixos deixavam a mesa alta e magra ao lado dos tabuleiros). */
    .arena-azulejo-theme .azl-ring { height: clamp(150px, 46vw, 300px); transform: none; margin-bottom: 0; }
    .arena-azulejo-theme .azl-center-circle { width: clamp(76px, 24vw, 128px); height: clamp(58px, 18vw, 96px); }
    .azl-table-status { flex-wrap: wrap; }
    .azl-picked { order: 3; width: 100%; justify-content: flex-start; }
    .azl-turn-clock { margin-left: auto; }
    .arena-azulejo-theme .azl-board-head { margin-inline: 0; }
    .arena-azulejo-theme .azl-layout .azl-boards-grid { grid-template-columns: minmax(0, 1fr); }
    .arena-azulejo-theme .azl-boards-count-3 .azl-board:last-child {
        grid-column: auto; width: 100%; justify-self: stretch;
    }
    .arena-azulejo-theme .azl-board-main { border-radius: 5px; }
    .arena-azulejo-theme .azl-line.is-valid { outline-width: 2px; }
    .arena-azulejo-theme .azl-room-head { grid-template-columns: 1fr auto; }
    .arena-azulejo-theme .azl-room-head .mem-head2-main { grid-column: 1 / -1; grid-row: 1; }
    /* Escopo no cabeçalho da APURAÇÃO: sem o prefixo isso pegava também o "Voltar"
       do jogo (agora filho direto do grid) e o jogava para o meio da tela. */
    .arena-azulejo-theme .azl-room-head .azl-game-back { grid-column: 1; grid-row: 2; }
    .arena-azulejo-theme .azl-room-head .azl-turn-pill { grid-column: 2; grid-row: 2; }
    .azl-finalist-tag { order: 5; width: 100%; margin-left: 0; justify-content: center; }
    .azl-finished-item { align-items: stretch; flex-direction: column; }
    .azl-finished-actions { justify-content: stretch; }
    .azl-finished-actions > * { flex: 1; text-align: center; }
}
/* Celular DEITADO (altura baixa): mesa à esquerda + tabuleiros à direita,
   compactos, para caber sem rolar. Empilhar (o padrão ≤1080) jogava os
   tabuleiros para fora da tela. Vem depois dos blocos acima para vencê-los. */
@media (orientation: landscape) and (max-height: 540px) {
    .arena-azulejo-theme .azl-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "back boards" "status boards" "mesa boards";
        gap: .4rem; padding-bottom: .4rem;
    }
    .arena-azulejo-theme .azl-layout.azl-layout-ending {
        grid-template-areas: "banner banner" "back boards" "status boards" "mesa boards";
    }
    .arena-azulejo-theme .azl-head-center { display: none; }          /* poupa altura */
    /* Aqui o "Voltar" volta ao fluxo (título escondido), na sua própria área. */
    .arena-azulejo-theme .azl-back-inline { position: static; grid-area: back; margin: 0 0 .25rem; font-size: .78rem; }
    .arena-azulejo-theme .azl-table-status { padding: .28rem .5rem; margin-bottom: .3rem; gap: .5rem; }
    .arena-azulejo-theme .azl-turn-avatar { width: 26px; height: 26px; }
    .arena-azulejo-theme .azl-status-hint { font-size: .74rem; }
    .arena-azulejo-theme .azl-turn-clock { min-width: 56px; padding: .26rem .38rem; font-size: .76rem; }
    .arena-azulejo-theme .azl-table { padding: .25rem; margin: 0 0 .3rem; }
    .arena-azulejo-theme .azl-ring { height: clamp(140px, 58vh, 250px); max-width: 100%; transform: none; margin-bottom: 0; }
    .arena-azulejo-theme .azl-center-circle { width: 88px; height: 66px; }
    .arena-azulejo-theme .azl-boards { padding-left: 30px; }
    .arena-azulejo-theme .azl-board { max-width: none; }
    .arena-azulejo-theme .azl-zoom-btn { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
    .azl-turn-clock.is-negative, .azl-wc.is-score-pop, .azl-floor.is-penalty-pop,
    .azl-wc.is-bonus-flash, .azl-point-pop, .azl-score-outline,
    .arena-azulejo-theme .azl-score.is-updated, .azl-coffee-brew i,
    .azl-coffee-brew i::before, .azl-coffee-brew i::after { animation: none; }
}
