/* Estudo da expansão de Alexandre. Monocromático, hairline, currentColor. */

.estudo-page.alexandre-page,
.alexandre-page .estudo-body,
.alexandre-page .content {
    overflow: visible;
}

.alexandre-page {
    /* Atlas de bronze: base escura, tinta creme, tres imperios em matizes bem
       separadas (ouro, carmim, turquesa). O emblema desempata para quem nao
       separa vermelho de verde. */
    --ax-agua: #08131f;
    --ax-mac: #f2c14e;
    --ax-per: #d2544f;
    --ax-ind: #35a89b;
    --ax-mac-forte: #ffd873;
    --ax-per-forte: #ef6f68;
    --ax-ind-forte: #4fc7b8;
    /* Conquista recente: clarão que esfria para a cor assentada em meio ano de
       campanha. É o que faz a expansão se ler como movimento, e não como mancha. */
    --ax-mac-novo: #fff4cd;
    --ax-terra: #e9dcc0;
    --ax-terra-novo: #fffdf6;
    --ax-brasa: #ff7a4d;
    /* A rota é a única linha vermelha do mapa. Precisa dessa cor para não se
       confundir com as bordas de satrapia, que são finas e claras. */
    --ax-rota: #e2503c;
    --ax-rota-casca: rgba(8, 19, 31, 0.55);
    --ax-tiles: brightness(0.6) saturate(0.5) contrast(1.06) sepia(0.4);
    --ax-tiles-atlas: brightness(0.46) saturate(0.34) contrast(1.2) sepia(0.55);
    --ax-cortina: rgba(8, 19, 31, 0.72);
    --ax-cortina-linha: rgba(255, 255, 255, 0.22);
}

[data-theme="light"] .alexandre-page {
    --ax-agua: #cfdce4;
    --ax-mac: #a5761a;
    --ax-per: #b03c33;
    --ax-ind: #1e7a70;
    --ax-mac-forte: #7d5806;
    --ax-per-forte: #8c2a22;
    --ax-ind-forte: #145d55;
    --ax-mac-novo: #e8ae24;
    --ax-terra: #4a4237;
    --ax-terra-novo: #9a8a6a;
    --ax-brasa: #c1401c;
    --ax-rota: #b7261a;
    --ax-rota-casca: rgba(255, 252, 245, 0.6);
    --ax-tiles: saturate(0.72) sepia(0.2) brightness(1.02);
    --ax-tiles-atlas: saturate(0.6) sepia(0.28) contrast(1.04);
    --ax-cortina: rgba(255, 252, 245, 0.86);
    --ax-cortina-linha: rgba(0, 0, 0, 0.22);
}

html:has(.alexandre-page) {
    overflow-x: clip;
}

.alexandre-page .ax-figure {
    margin: 2.5rem 0 3rem;
    overflow: visible;
}

.ax-viewport {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 100dvh;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border: var(--line-width) solid var(--border-color);
    color: var(--text-primary);
    background: var(--ax-agua);
    isolation: isolate;
    position: relative;
    z-index: 1;
}

.ax-figure__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1.25rem;
    flex: 0 0 auto;
    margin: 0;
    padding: 0.55rem 0.9rem 0.6rem;
    background: var(--bg-primary);
    border-bottom: var(--line-width) solid var(--border-color);
    position: relative;
    z-index: 8;
    pointer-events: auto;
}

.ax-figure__title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0;
}

.ax-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 12rem;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.ax-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    color: var(--text-primary);
    background: transparent;
    border: var(--line-width) solid var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.ax-play:hover,
.ax-play[aria-pressed="true"] {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.ax-play__ico {
    width: 0.95rem;
    height: 0.95rem;
    display: block;
}

.ax-play[aria-pressed="false"] .ax-play__ico--pause,
.ax-play[aria-pressed="true"] .ax-play__ico--play {
    display: none;
}

.ax-slider {
    flex: 1;
    min-width: 0;
    accent-color: var(--text-primary);
    height: 1.2rem;
}

/* Chave liga-desliga: ícone, rótulo e um trilho com o cursor que corre. Apagado
   fica cinza e sem preenchimento; aceso fica na tinta cheia. */
.ax-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: inherit;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    background: transparent;
    border: var(--line-width) solid var(--border-color);
    padding: 0.34rem 0.5rem 0.34rem 0.45rem;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.ax-toggle__ico {
    width: 1.05rem;
    height: 1.05rem;
    display: block;
    flex-shrink: 0;
}

.ax-toggle__txt {
    display: block;
}

.ax-toggle__sw {
    position: relative;
    display: block;
    width: 1.6rem;
    height: 0.8rem;
    flex-shrink: 0;
    border: var(--line-width) solid currentColor;
}

.ax-toggle__sw::after {
    content: "";
    position: absolute;
    top: 1px;
    bottom: 1px;
    left: 1px;
    width: calc(50% - 2px);
    background: currentColor;
    opacity: 0.45;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ax-toggle[aria-pressed="true"] {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.ax-toggle[aria-pressed="true"] .ax-toggle__sw::after {
    transform: translateX(100%);
    opacity: 1;
}

.ax-toggle:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.ax-toggle:focus-visible {
    outline: 2px solid var(--ax-mac-forte);
    outline-offset: 2px;
}

.ax-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    flex: 1 1 auto;
    min-height: 0;
    color: var(--text-primary);
    position: relative;
    z-index: 0;
    isolation: isolate;
}

.ax-mapa {
    position: relative;
    isolation: isolate;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.ax-palco {
    position: relative;
    z-index: 0;
    min-width: 0;
    height: 100%;
    min-height: 22rem;
    background: var(--ax-agua);
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    pointer-events: auto;
}

.ax-palco.leaflet-container {
    width: 100%;
    height: 100%;
    background: var(--ax-agua) !important;
    font-family: inherit;
}

/* O filtro entra em cada tile, nunca no contêiner da camada nem no painel: no
   contêiner o navegador precisa rasterizar o mosaico inteiro a cada quadro do
   arrasto, e o mapa pisca enquanto o leitor move. */
.ax-figure {
    --ax-recuo: opacity(1);
}

/* Com as cores dos imperios ligadas o mapa de base recua mais um passo, para a
   mancha colorida ser a primeira coisa que o olho encontra. */
.ax-figure.is-cores {
    --ax-recuo: grayscale(0.5) brightness(0.9);
}

.ax-tiles-relevo .leaflet-tile,
.ax-tiles-fisico .leaflet-tile {
    filter: var(--ax-tiles) var(--ax-recuo);
}

.ax-tiles-antigos .leaflet-tile {
    filter: var(--ax-tiles-atlas) var(--ax-recuo);
}

.ax-divico {
    background: none;
    border: none;
}

/* Batalha em cena: o emblema vira brasa e solta dois aneis de choque, para o
   momento da batalha ser visivel sem ler o painel. */
.ax-divico--bat {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ax-bat-brasa,
.ax-bat-brasa::after {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 50%;
    border: 2px solid var(--ax-brasa);
    opacity: 0;
    pointer-events: none;
}

.ax-bat-brasa::after {
    content: "";
    margin: -15px 0 0 -15px;
}

.ax-divico--bat.is-now .ax-bat-brasa {
    animation: ax-brasa 1.9s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}

.ax-divico--bat.is-now .ax-bat-brasa::after {
    animation: ax-brasa 1.9s cubic-bezier(0.2, 0.6, 0.3, 1) infinite 0.95s;
}

.ax-divico--bat.is-now .ax-ico {
    color: var(--ax-brasa);
    filter: drop-shadow(0 0 0.55rem var(--ax-brasa));
    transform: scale(1.18);
}

.ax-divico--bat .ax-ico {
    transition: transform 0.35s ease, color 0.35s ease;
}

@keyframes ax-brasa {
    0% { transform: scale(0.55); opacity: 0.85; }
    70% { opacity: 0.28; }
    100% { transform: scale(3.4); opacity: 0; }
}

.ax-divico--pos {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.ax-divico--pos {
    color: var(--ax-mac-forte);
}

.ax-divico--pos .ax-ico {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    color: inherit;
    filter: drop-shadow(0 0 0.5rem currentColor);
}

.ax-pos__nome {
    color: inherit;
    font-size: 0.76rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

.ax-divico--lab {
    transition: opacity 0.35s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.ax-lab__ico .ax-ico {
    width: 20px;
    height: 20px;
}

.ax-rotulo {
    font-size: 13px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-primary);
    opacity: 0.72;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.ax-ico {
    width: 30px;
    height: 30px;
    display: block;
    overflow: visible;
    color: var(--text-primary);
}

.ax-ico__fundo {
    fill: var(--ax-agua);
    stroke: currentColor;
    stroke-width: 1;
}

.ax-ico__traco {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ax-ico__sol {
    fill: currentColor;
}

.ax-ico__sol-miolo {
    fill: var(--ax-agua);
    stroke: currentColor;
    stroke-width: 0.8;
}

/* Dica de satrapia no hover: caixa de cortina, sem a seta do Leaflet. */
.ax-tip-reg {
    background: var(--ax-cortina);
    border: var(--line-width) solid var(--ax-cortina-linha);
    box-shadow: none;
    color: var(--text-primary);
    font-size: 0.78rem;
    line-height: 1.35;
    padding: 0.45rem 0.6rem 0.5rem;
    backdrop-filter: blur(2px);
    white-space: nowrap;
}

.ax-tip-reg::before {
    display: none;
}

.ax-tip-reg strong {
    display: block;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ax-tip-reg__l {
    display: block;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.ax-regiao {
    cursor: help;
}

/* Sob o cursor a satrapia acende e engrossa a borda, mantendo a própria cor: o
   leitor precisa ver a qual mancha a etiqueta se refere, e são manchas de
   formato irregular que se encostam. */
.ax-regiao:hover {
    fill-opacity: 0.6;
    stroke-opacity: 1;
    stroke-width: 2.6;
}

.ax-regiao.is-oculta {
    pointer-events: none;
}

.ax-fronteira {
    fill: none;
}

.ax-tip-bat {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--text-primary);
    font-size: 12.5px;
    letter-spacing: 0.04em;
    padding: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.ax-tip-bat::before {
    display: none;
}

.ax-palco .leaflet-control-attribution {
    background: rgba(8, 16, 28, 0.62);
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
    max-width: 70%;
}

.ax-palco .leaflet-control-attribution a {
    color: inherit;
}

.ax-palco:active,
.ax-palco.is-zoomed {
    cursor: grabbing;
}

.ax-mar {
    fill: var(--ax-agua);
}

.ax-zoom {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 7;
    pointer-events: auto;
}

.ax-zoom__btn {
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: var(--line-width) solid var(--border-color);
    cursor: pointer;
    opacity: 0.9;
}

.ax-zoom__btn:hover {
    border-color: var(--text-primary);
}

/* ⌂ aceso: a camera esta seguindo a area conquistada. Apagado: o leitor
   assumiu a navegacao e um clique devolve o enquadramento automatico. */
.ax-zoom__btn--casa.is-on {
    color: var(--ax-mac-forte);
    border-color: var(--ax-mac-forte);
}

.ax-mapa-legenda {
    position: absolute;
    left: 0.6rem;
    bottom: 1.9rem;
    margin: 0;
    padding: 0.65rem 0.8rem 0.7rem;
    list-style: none;
    display: grid;
    gap: 0.4rem;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    background: var(--ax-cortina);
    border: var(--line-width) solid var(--ax-cortina-linha);
    backdrop-filter: blur(2px);
    z-index: 5;
    pointer-events: none;
}

.ax-mapa-legenda li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ax-mapa-legenda .ax-leg--mac,
.ax-divico--lab.ax-lab--mac { color: var(--ax-mac-forte); }

.ax-mapa-legenda .ax-leg--per,
.ax-divico--lab.ax-lab--per { color: var(--ax-per-forte); }

.ax-mapa-legenda .ax-leg--ind,
.ax-divico--lab.ax-lab--ind { color: var(--ax-ind-forte); }

.ax-divico--lab .ax-ico {
    color: inherit;
}

.ax-divico--lab .ax-rotulo {
    color: inherit;
    opacity: 0.85;
}

.ax-leg-ico {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    overflow: visible;
}

.ax-leg-ico .ax-ico__fundo {
    fill: var(--ax-agua);
    stroke: currentColor;
    stroke-width: 1;
}

.ax-leg-ico .ax-ico__traco {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ax-leg-ico .ax-ico__sol {
    fill: currentColor;
}

.ax-leg-ico .ax-ico__sol-miolo {
    fill: var(--ax-agua);
    stroke: currentColor;
    stroke-width: 0.8;
}

.ax-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.ax-terra {
    fill: currentColor;
    fill-opacity: 0.11;
    stroke: currentColor;
    stroke-width: 0.7;
    stroke-opacity: 0.32;
    stroke-linejoin: round;
}

.ax-lagos {
    fill: var(--ax-agua);
    stroke: currentColor;
    stroke-width: 0.4;
    stroke-opacity: 0.25;
}

.ax-imperio path {
    fill: currentColor;
    fill-opacity: 0.18;
    stroke: none;
    opacity: 0;
}

.ax-figure.is-cores .ax-imperio path {
    fill-opacity: 0.46;
    stroke: currentColor;
    stroke-width: 0.4;
    stroke-opacity: 0.22;
}

.ax-figure.is-cores .ax-imperio path[data-imperio="macedonio"] {
    fill: var(--ax-mac);
}

.ax-figure.is-cores .ax-imperio path[data-imperio="aquemenida"] {
    fill: var(--ax-per);
}

.ax-figure.is-cores .ax-imperio path[data-imperio="india"] {
    fill: var(--ax-ind);
}

.ax-ico__fundo {
    fill: var(--ax-agua);
    stroke: currentColor;
    stroke-width: 1;
}

.ax-ico__traco {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ax-ico__sol {
    fill: currentColor;
}

.ax-ico__sol-miolo {
    fill: var(--ax-agua);
    stroke: currentColor;
    stroke-width: 0.8;
}

.ax-rota {
    fill: none;
    stroke: var(--ax-rota);
    stroke-width: 2.3;
    stroke-linejoin: round;
    stroke-linecap: round;
    stroke-dasharray: 7 5;
    /* Traço e tracejado em pixels de tela: durante o voo da câmera o contêiner
       do SVG é escalado, e sem isso as pinceladas cresceriam e encolheriam
       junto com o zoom. */
    vector-effect: non-scaling-stroke;
    opacity: 1;
}

/* Fio escuro por baixo do tracejado: sem ele o vermelho some no relevo claro
   do deserto. */
.ax-rota-casca {
    fill: none;
    stroke: var(--ax-rota-casca);
    stroke-width: 4.6;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    opacity: 1;
}

.ax-rotulo {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    fill: currentColor;
    opacity: 0.4;
    text-anchor: middle;
}

.ax-tropa {
    fill: none;
    stroke: currentColor;
}

.ax-tropa--inimigo {
    stroke-width: 1.1;
    opacity: 0.45;
}

.ax-tropa--alexandre {
    fill: currentColor;
    fill-opacity: 0.22;
    stroke-width: 1.15;
}

.ax-batalha {
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
}

.ax-batalha.is-on {
    opacity: 1;
    pointer-events: auto;
}

.ax-batalha.is-now .ax-tropa--alexandre {
    fill-opacity: 0.4;
}

.ax-batalha__miolo {
    fill: currentColor;
}

.ax-batalha__nome {
    font-size: 10px;
    fill: currentColor;
    opacity: 0.7;
}

.ax-pos {
    fill: var(--bg-primary);
    stroke: currentColor;
    stroke-width: 1.6;
}

.ax-lado {
    border-left: var(--line-width) solid var(--border-color);
    padding: 1.1rem 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 0;
    overflow-y: auto;
    background: var(--bg-primary);
}

.ax-ano {
    font-family: var(--font-serif);
    font-size: 2rem;
    line-height: 1;
    letter-spacing: 0.02em;
    margin: 0;
}

.ax-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin: 0;
}

.ax-titulo {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.ax-texto {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
}

.ax-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding-top: 0.4rem;
    border-top: var(--line-width) solid var(--border-color);
}

.ax-stat__n {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.05rem;
}

.ax-stat__k {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.ax-barras {
    display: grid;
    gap: 0.45rem;
}

.ax-bar {
    display: grid;
    grid-template-columns: 5.5rem 1fr auto;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.75rem;
}

.ax-bar__lab {
    color: var(--text-secondary);
}

.ax-bar__track {
    height: 6px;
    background: var(--border-color);
}

.ax-bar__fill {
    display: block;
    height: 100%;
    background: currentColor;
}

.ax-bar__fill--ghost {
    opacity: 0.4;
}

.ax-bar__n {
    font-variant-numeric: tabular-nums;
}

.ax-bar__note {
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--text-tertiary);
    margin: 0.2rem 0 0;
    grid-column: 1 / -1;
}

.ax-legenda {
    list-style: none;
    margin: 0;
    padding: 0.6rem 0 0;
    border-top: var(--line-width) solid var(--border-color);
    display: grid;
    gap: 0.55rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.ax-legenda[hidden] {
    display: none;
}

.ax-legenda li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ax-legenda--imperios li {
    align-items: flex-start;
}

.ax-leg__txt {
    display: block;
}

.ax-leg__txt strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* A bandeira da legenda e o mesmo emblema que aparece no mapa, na cor do
   imperio, para o olho ligar mancha e simbolo sem ler o texto. */
.ax-bandeira {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: var(--line-width) solid currentColor;
    background: color-mix(in srgb, currentColor 22%, transparent);
}

.ax-leg-emb {
    width: 24px;
    height: 24px;
    overflow: visible;
}

.ax-leg-emb .ax-ico__fundo {
    fill: none;
    stroke: none;
}

.ax-leg-emb .ax-ico__traco {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ax-leg-emb .ax-ico__sol {
    fill: currentColor;
}

.ax-leg-emb .ax-ico__sol-miolo {
    fill: none;
    stroke: currentColor;
    stroke-width: 0.9;
}

.ax-leg--mac { color: var(--ax-mac-forte); }
.ax-leg--per { color: var(--ax-per-forte); }
.ax-leg--ind { color: var(--ax-ind-forte); }
.ax-leg--tomado { color: var(--ax-mac-forte); }

.ax-legenda--imperios .ax-leg__txt {
    color: var(--text-secondary);
}

.ax-bandeira--tomado {
    border-style: solid;
    border-color: var(--ax-per-forte);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ax-mac-forte) 60%, transparent);
}

.ax-swatch {
    width: 18px;
    height: 12px;
    border: var(--line-width) solid currentColor;
    flex-shrink: 0;
}

.ax-swatch--fill {
    background: currentColor;
    opacity: 0.32;
}

.ax-swatch--rota {
    height: 0;
    border: 0;
    border-top: 2px dashed var(--ax-rota);
    width: 18px;
}

.ax-swatch--mac,
.ax-swatch--per,
.ax-swatch--ind {
    border-color: transparent;
}

.ax-swatch--mac {
    background: var(--ax-mac);
}

.ax-swatch--per {
    background: var(--ax-per);
}

.ax-swatch--ind {
    background: var(--ax-ind);
}

.ax-swatch--dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: currentColor;
    border: 0;
}

.ax-swatch--dot.ax-swatch--mac { background: var(--ax-mac-forte); }
.ax-swatch--dot.ax-swatch--per { background: var(--ax-per-forte); }

.ax-ticks {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
}

.ax-ticks__nota {
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--text-tertiary);
    margin: 0.55rem 0 0;
}

.ax-tick {
    font-family: inherit;
    font-size: 0.72rem;
    text-align: left;
    color: var(--text-secondary);
    background: transparent;
    border: var(--line-width) solid var(--border-color);
    padding: 0.65rem 0.75rem 0.7rem;
    cursor: pointer;
    display: grid;
    gap: 0.5rem;
    width: 100%;
}

.ax-tick__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
}

.ax-tick strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.88rem;
}

.ax-tick__tropas {
    display: grid;
    gap: 0.35rem;
}

.ax-fila {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 0.4rem 0.65rem;
    align-items: start;
}

.ax-fila__lab {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding-top: 0.1rem;
}

.ax-fila__icos {
    display: flex;
    flex-wrap: wrap;
    gap: 1px 2px;
}

.ax-guerreiro {
    width: 9px;
    height: 15px;
    display: block;
    flex-shrink: 0;
    fill: currentColor;
    overflow: visible;
}

.ax-fila--inimigo .ax-guerreiro {
    fill-opacity: 0.32;
}

.ax-tick:hover,
.ax-tick.is-active {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.ax-tick.is-active .ax-fila--alex .ax-guerreiro {
    fill: var(--ax-mac);
}

.ax-tick.is-active .ax-fila--inimigo .ax-guerreiro {
    fill: var(--ax-per);
    fill-opacity: 0.7;
}

.ax-figure__source {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-tertiary);
    margin: 0.75rem 0 0;
}

.ax-table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0 0;
    border: var(--line-width) solid var(--border-color);
}

.ax-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.ax-table th,
.ax-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: var(--line-width) solid var(--border-color);
    vertical-align: top;
}

.ax-table th {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 500;
}

.ax-table tr:last-child td {
    border-bottom: 0;
}

.ax-table__vazio {
    color: var(--text-tertiary);
    font-style: italic;
}

.ax-table .num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ax-erro {
    padding: 2rem;
    color: var(--text-secondary);
}

@media (max-width: 860px) {
    /* Empilhado, mapa e painel deixam de disputar a mesma linha: o mapa fica
       com uma altura propria e o painel corre abaixo dele. */
    .ax-viewport {
        height: auto;
        min-height: 0;
    }

    .ax-stage {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .ax-mapa {
        height: 62dvh;
        min-height: 320px;
    }

    .ax-lado {
        border-left: 0;
        border-top: var(--line-width) solid var(--border-color);
        overflow: visible;
    }

    /* A legenda de icones nao pode comer o mapa: duas colunas e tipo menor. */
    .ax-mapa-legenda {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.3rem 0.7rem;
        max-width: calc(100% - 1.2rem);
        font-size: 0.68rem;
        padding: 0.45rem 0.55rem 0.5rem;
    }

    .ax-leg-ico {
        width: 19px;
        height: 19px;
    }

    .ax-fila {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ax-imperio path,
    .ax-batalha,
    .ax-rota,
    .ax-divico--bat .ax-ico {
        transition: none;
    }

    .ax-divico--bat.is-now .ax-bat-brasa,
    .ax-divico--bat.is-now .ax-bat-brasa::after {
        animation: none;
        opacity: 0.5;
    }
}

/* --- Retrato de abertura -------------------------------------------- */

/* A abertura entra em duas colunas: todo o texto de entrada à esquerda, a
   estampa à direita, alinhadas pelo topo. O h1 e o filete continuam largos. */
.alexandre-page .intro {
    margin-bottom: 2rem;
}

.ax-abertura {
    display: flex;
    align-items: flex-start;
    gap: 2.8rem;
}

.ax-abertura .section-description {
    margin-top: 0;
}

.ax-abertura__texto {
    flex: 1 1 auto;
    min-width: 0;
}

.ax-abertura__texto p:last-child {
    margin-bottom: 0;
}

/* A prancha é gravura de linha: tinta escura sobre papel claro. Ela não
   sobrevive à inversão do tema, então entra como estampa, com o papel dela
   e moldura fina. A legenda fica fora da estampa, no papel da página, senão
   o texto claro do tema escuro cai em cima do papel claro da gravura. */
.ax-retrato {
    order: 2;
    flex: 0 0 300px;
    width: 300px;
    margin: 0;
}

.ax-retrato img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

/* No tema escuro o papel branco brilha demais ao lado do texto. */
[data-theme="dark"] .ax-retrato img {
    filter: brightness(0.88) contrast(1.04);
}

.ax-retrato figcaption {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.ax-retrato__credito {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--text-tertiary);
}

/* O link herda o tratamento de link do site (main.css usa `.content a:not(...)`,
   de especificidade alta). Aqui só o tamanho. */
.ax-retrato__credito a {
    font-size: inherit;
}

@media (max-width: 860px) {
    .ax-abertura {
        display: block;
    }

    .ax-retrato {
        width: 100%;
        max-width: 320px;
        margin: 0 auto 1.6rem;
    }
}
