@import url('https://fonts.googleapis.com/css2?family=Caprasimo&family=Figtree:wght@400;600;700&display=swap');

/* ==========================================================================
   Personagem 3D — tema "Campo Aberto" (design 1a)
   Substitui por completo o css/style.css anterior. Todos os seletores,
   ids e classes usados pelo JS existente foram mantidos — nenhum ficheiro
   js/*.js precisa de mudar por causa deste tema.
   ========================================================================== */

:root {
  --bg: #f5ead8;
  --surface: #ebddc5;
  --surface-2: #f9f4ed;
  --text: #201e1d;
  --muted: #645c50;
  --muted-2: #82796a;
  --line: rgba(32, 30, 29, 0.12);

  --accent: #c67139;
  --accent-100: #fff2eb;
  --accent-200: #ffe1d0;
  --accent-300: #ffc6a5;
  --accent-400: #f6a06b;
  --accent-600: #b2622d;
  --accent-700: #8c491a;

  --sage: #7a8a5e;
  --sage-100: #f0fae1;
  --sage-200: #e1eecc;
  --sage-300: #ccdbb2;
  --sage-500: #8fa073;
  --sage-700: #56633f;

  --sand-300: #dcd3c4;
  --ink: #2e2b25;

  --font-heading: "Caprasimo", Georgia, serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;

  --shadow-sm: 0 1px 2px rgba(46, 43, 37, 0.14);
  --shadow-md: 0 3px 10px rgba(46, 43, 37, 0.16);
  --shadow-lg: 0 12px 32px rgba(46, 43, 37, 0.22);

  --tabbar-h: 74px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Utilitario generico de esconder; regras mais especificas (ex:
   #battle-hud.hidden) tem prioridade quando precisam de valores
   diferentes de display:none em conjunto com outras propriedades */
.hidden {
  display: none;
}

html, body {
  min-height: 100%;
  min-height: 100dvh;
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

a { color: var(--accent-700); text-underline-offset: 3px; }
a:hover { color: var(--accent-600); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(198, 113, 57, 0.3); }

/* ---------- Cabecalho ---------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 20px 10px;
}

/* Menu de Definicoes (2026-09-22): engrenagem no canto superior direito do
   cabecalho, com um pequeno dropdown por baixo - ver js/settings.js. */
.settings-wrap { position: relative; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover { background: rgba(32, 30, 29, 0.06); }

.settings-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.settings-menu.hidden { display: none; }

.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.settings-menu-item:hover { background: var(--surface); }
.settings-menu-item-danger { color: var(--accent-700); }

.site-header h1 {
  font-size: 21px;
}

.site-title-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.site-title-level {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-700);
  background: var(--accent-200);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Selo "Beta" no cabeçalho (2026-09-24, a pedido - "o site deve alertar que
   está em fase de testes"), sempre visível durante o jogo, não só na
   landing. Cinza/neutro de propósito - não é conquista nem aviso de erro,
   so um lembrete discreto. */
.site-title-beta {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 999px;
}

.site-version-hero {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
}

/* Os botoes Jogo/Perfil antigos continuam no DOM (js/profile.js e
   js/battle.js dependem deles) mas deixam de ser visiveis - a navegacao
   passou para a barra de separadores inferior (#tab-bar, js/nav.js). */
.nav-tabs.legacy-nav {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Abas de tipo "pilula" (usadas pelo leaderboard) */
.nav-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
}

.nav-tab {
  position: relative;
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav-tab:hover { background: rgba(32, 30, 29, 0.06); }

.nav-tab.active {
  background: var(--accent);
  color: var(--bg);
}

.nav-tab.active:hover { background: var(--accent-600); }

.nav-tab:disabled { opacity: 0.45; cursor: not-allowed; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: calc(var(--tabbar-h) + 12px);
}

/* ---------- Barra de separadores inferior (js/nav.js) -------------------- */

#tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 800;
  display: flex;
  justify-content: space-around;
  gap: 2px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.tab-btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 48px;
  padding: 4px 2px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted-2);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn .tab-icon { font-size: 20px; line-height: 1; }
.tab-btn:hover { background: rgba(32, 30, 29, 0.06); }

.tab-btn.active {
  color: var(--accent-700);
  font-weight: 700;
}

/* Badges de notificação (2026-09-18, a pedido - "número no canto superior
   direito a indicar que houve alguma conquista/notificação/relatorio"),
   sobre .tab-btn/.nav-tab (ver renderNavBadges()/setNavBadge(), js/nav.js).
   Cor solida (--warn-ink), nao o --warn-bg pastel do resto do site - a esta
   escala pequena precisa de mais contraste para se ler à distância de um
   relance. box-shadow em vez de border: separa do fundo do botão sem
   precisar de saber a cor exata desse fundo (ativo vs inativo). */
.nav-badge {
  position: absolute;
  top: -4px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--warn-ink);
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

/* Mesma cor/paleta, mas inline - para um badge junto a um título de card
   (ex: "Relatórios de Batalhas"), não sobre um botão de navegação. */
.nav-badge-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--warn-ink);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---------- Paineis ------------------------------------------------------ */

.pane { display: none; }
.pane.active { display: block; }

/* Sub-navegacao dentro do separador Mundo (2026-08-10) - mesmo padrao
   .pane/.pane.active acima, so com nome proprio para nao colidir com o
   nivel de cima (um separador Mundo ativo, com uma sub-aba ativa la dentro). */
.mundo-tabs { margin: 0 16px 16px; }
.mundo-subpane { display: none; }
.mundo-subpane.active { display: block; }

.mundo-soon-card {
  text-align: center;
  padding: 40px 20px;
}

.mundo-soon-icon {
  font-size: 40px;
  margin: 0 0 8px;
}

.mundo-soon-text {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

/* ---------- Visualizador 3D ---------------------------------------------- */

/* Envolve o #viewer para poder pendurar o crachá de nível e a mini-lista
   de equipamento a "sair" pelas bordas do palco (position:absolute
   relativos a este wrapper, nao ao #viewer, que muda de posicionamento
   por completo durante uma luta - ver .battle-fullscreen abaixo). */
#viewer-stage {
  position: relative;
  flex-shrink: 0;
  margin: 20px 16px 0;
}

#viewer {
  position: relative;
  width: 100%;
  height: 56vh;
  min-height: 360px;
  overflow: hidden;
  /* Topo em arco: um raio muito maior nos dois cantos de cima do que em
     baixo, em vez do border-radius uniforme de antes. */
  border-radius: 50% 50% var(--r-lg) var(--r-lg) / 30% 30% 6% 6%;
  background: linear-gradient(180deg, var(--sage-200) 0%, var(--surface) 100%);
}

/* So visivel nos separadores "Personagem"/"Mundo" (2026-08-10: Mundo
   passou a ser o separador de arranque, com o Treino/Campo la dentro -
   sem isto o jogador via a app abrir sem a personagem 3D visivel) - ou
   sempre que houver uma luta a decorrer (js/battle.js poe
   .battle-fullscreen no #viewer). Aplica-se ao wrapper inteiro
   (#viewer-stage), para o crachá de nível/equipamento escondam com o
   resto - :has() traz de volta o wrapper quando o #viewer lá dentro fica
   fullscreen, senao o display:none do wrapper impedia o #viewer de
   aparecer mesmo com position:fixed. */
#view-jogo:not([data-pane="personagem"]):not([data-pane="mundo"]) #viewer-stage { display: none; }
#viewer-stage:has(#viewer.battle-fullscreen) { display: block !important; }

#viewer.battle-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 900;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  background: radial-gradient(circle at 50% 40%, #3d2a1c 0%, #201e1d 68%);
}

#viewer-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#viewer-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted-2);
  font-size: 13px;
  pointer-events: none;
}

/* ---------- Cracha de nivel e mini-lista de equipamento ------------------- */
/* Penduram por cima dos cantos do #viewer-stage (position:absolute,
   metade dentro/metade fora do palco). */

#character-level-badge {
  position: absolute;
  top: -18px;
  left: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}

.level-badge-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#character-level-badge #character-level-value {
  font-family: var(--font-heading);
  font-size: 26px;
  line-height: 1.1;
}

#equipment-mini-list {
  position: absolute;
  top: -14px;
  right: -6px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Botoes (2026-08-06, a pedido) - abrem o mesmo popup de evolucao que
   tocar na peca no modelo 3D (openWeaponUpgradeModal/openShieldUpgradeModal/
   openArmorUpgradeModal, js/equipment.js), sem precisar de acertar na peca
   certa no modelo (dificil em mobile, sobretudo com a camera afastada). */
.equipment-mini-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 6px;
  border: none;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}

.equipment-mini-item:hover { background: var(--surface); }
.equipment-mini-item:active { box-shadow: none; }

.equipment-mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  background: var(--sand-300);
}

.equipment-mini-item.weapon .equipment-mini-icon { background: var(--accent-200); }
.equipment-mini-item.shield .equipment-mini-icon { background: #dce8f5; }
.equipment-mini-item.armor .equipment-mini-icon { background: var(--sage-200); }

.viewer-hint {
  margin: 10px 16px 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted-2);
}

#view-jogo:not([data-pane="personagem"]):not([data-pane="mundo"]) > .viewer-hint { display: none; }

.floating-combat-text {
  position: absolute;
  transform: translate(-50%, -100%);
  font-family: var(--font-heading);
  font-size: 26px;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  animation: floatUpFade 1s ease-out forwards;
}

/* Cor pela cor da barra de vida de quem leva o acerto (verde=jogador,
   laranja=monstro, ver .hp-bar-fill.player/.monster) - o critico so se
   distingue por ser maior, nao por mudar de cor (2026-08-06). */
.floating-combat-text.on-player { color: #aebf92; }
.floating-combat-text.on-monster { color: #f6a06b; }
.floating-combat-text.critico { font-size: 34px; font-weight: 700; }
.floating-combat-text.miss { color: #f9f4ed; font-family: var(--font-body); font-style: italic; font-weight: 700; font-size: 20px; }

@keyframes floatUpFade {
  from { opacity: 1; margin-top: 0; }
  to { opacity: 0; margin-top: -40px; }
}

/* ---------- HUD do personagem -------------------------------------------- */

/* Ja nao fica sobreposto ao 3D - passou a viver no fluxo normal da pagina,
   por baixo do palco (js/battle.js continua a esconder isto pelo id
   durante uma luta, sem precisar de mudar). */
#character-hud {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px;
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hud-grid p {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.hud-grid p span {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--text);
}

/* Card "N pontos para distribuir": Energia/Força/Resistência em linhas
   verticais, cada uma com o seu botao "+" a direita (em vez das capsulas
   horizontais de antes, agora que ja nao precisam de caber por cima do
   modelo 3D). */
.invest-card {
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--accent-100);
  border: 1px solid var(--accent-300);
}

.invest-card-title {
  margin-bottom: 10px;
  font-family: var(--font-heading);
  font-size: 17px;
  color: var(--accent-700);
}

.invest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.invest-row + .invest-row {
  border-top: 1px solid var(--line);
}

.invest-label {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.invest-value {
  font-family: var(--font-heading);
  font-size: 16px;
  color: var(--text);
}

.btn-hud-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.btn-hud-plus:hover { background: var(--accent-600); }
.btn-hud-plus.hidden { display: none; }

/* ---------- Barra de XP --------------------------------------------------- */

#xp-panel {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 0;
}

.xp-bar-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: var(--sand-300);
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s ease;
}

#xp-progress-text {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Treino -------------------------------------------------------- */

.mode-xp-explanation {
  margin: 12px 16px 0;
  padding: 0 4px;
  font-size: 12px;
  color: var(--muted);
}

#training-readout {
  margin: 16px 16px 0;
  padding: 26px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
}

.training-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.training-distance {
  font-family: var(--font-heading);
  font-size: 54px;
  line-height: 1.08;
}

.training-live-stats {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.training-detected-activity {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.training-calories-row {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.training-calories-row span { font-weight: 700; color: var(--text); }

/* Mapa de territorios descobertos (2026-08-15, secção 18.1). Altura fixa: o
   Leaflet precisa de um contentor com altura definida, senao colapsa a 0.
   Desenhado num mockup a parte (mockup-mapa.html) antes de entrar aqui:
   foto de satelite real desfocada, cinzenta onde nao se treinou, a cores
   onde ja se pos os pes. */
#hex-map {
  height: 320px;
  width: 100%;
  border-radius: var(--r-md);
  margin-top: 12px;
  background: #10151c;
  overflow: hidden;

  /* Contraste acrescentado ao territorio descoberto (2026-09-17, a pedido -
     "mais contraste as cores"): sem contrast() as cores do territorio ja
     pisado ficavam apagadas/lavadas. O blur tinha sido reduzido de 8px para
     5px no mesmo pedido, mas voltou ao valor original a pedido pouco depois. */
  --hexmap-blur: 8px;
  --hexmap-dark: 0.45;
  --hexmap-contrast: 1.25;
  /* 2026-09-17, a pedido - "mais saturação" (a seguir ao contraste acima),
     depois ajustada para 2, depois para 3. */
  --hexmap-saturate: 3;
}

/* Por explorar: cinzento, escuro, desfocado. */
.leaflet-hexfog-pane {
  filter: blur(var(--hexmap-blur)) grayscale(1) brightness(var(--hexmap-dark));
}

/* Ja descoberto: a mesma foto, a cores, com o mesmo desfoque - recortada
   (updateClips, js/hexes.js) aos hexagonos ja pisados. */
.leaflet-hexclear-pane {
  filter: blur(var(--hexmap-blur)) contrast(var(--hexmap-contrast)) saturate(var(--hexmap-saturate));
}

/* Canvas por cima das duas camadas de foto - icones das minas encontradas e
   o contorno do territorio (js/hexes.js). Sem grelha hexagono a hexagono por
   dentro do territorio, a pedido - so o traco na margem. */
.hex-map-canvas {
  position: absolute;
  top: 0;
  left: 0;
}

/* Botao "recentrar em mim" (js/hexes.js). Azul como o ponto do jogador -
   e o mesmo assunto: onde estou. Alvo de 40px para o dedo. */
.hex-recenter-btn {
  width: 40px;
  height: 40px;
  margin: 10px 10px 0 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(140, 220, 255, 0.35);
  border-radius: 50%;
  background: rgba(16, 21, 28, 0.82);
  color: #9fdcff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.hex-recenter-btn:hover {
  background: rgba(28, 38, 50, 0.92);
  color: #d9f2ff;
}

.hex-recenter-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* Enquanto o GPS nao responde. */
.hex-recenter-btn.locating {
  animation: hex-recenter-wait 1s ease-in-out infinite;
}

@keyframes hex-recenter-wait {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  .hex-recenter-btn.locating { animation: none; opacity: 0.6; }
}

/* Onde estas. Azul-branco de proposito: o dourado ja e do territorio e do
   distrito, o jogador tem de se distinguir dos dois num relance. */
.hex-player-dot i {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(78, 190, 255, 0.95), 0 0 16px 5px rgba(120, 215, 255, 0.7);
}

/* O anel a pulsar foi removido a pedido (2026-09-07). Existia para chamar a
   atencao para o ponto; o cone de direcao faz isso melhor e sem animacao a
   correr sem parar - que, com o wake lock a manter o ecra ligado durante o
   treino todo, era mais uma coisa a desenhar para ninguem (secção 4.8). */

.hex-count-row {
  font-size: 15px;
  color: var(--muted);
}

.hex-count-row span {
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
}

.hex-district-row {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.hex-district-row span {
  font-weight: 700;
  color: var(--text);
}

.hex-map-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted-2);
}

/* Diagnostico do sinal de GPS ao vivo (2026-08-11, secção 4.2) - so
   visivel para admin, deliberadamente discreto/monoespacado: e uma
   ferramenta de diagnostico, nao informacao de jogo. */
.training-gps-diag {
  margin-top: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted-2);
  word-break: break-word;
}

/* Aviso persistente de "em construção" (2026-08-11, a pedido - secção da
   Masmorra enquanto a arena top-down/combate ainda estao a ser
   trabalhados, secção 9 da documentação) - mesmo estilo do .speed-warning
   abaixo (aviso persistente, nao um toast efemero), reutilizavel noutras
   seccoes que venham a precisar do mesmo aviso. */
.construction-warning {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--accent-200);
  border: 1px solid var(--accent-400);
  color: var(--accent-700);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.speed-warning {
  margin: 12px 16px 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--accent-200);
  border: 1px solid var(--accent-400);
  color: var(--accent-700);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

#training-panel {
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  padding: 18px 16px;
}

.panel-screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.panel-screen.hidden { display: none; }

/* O contentor deixou de ser um card com fundo proprio (2026-08-15): agora
   os cards sao os proprios treinos, e dois fundos encaixados um no outro
   ficavam pesados. Fica so o rotulo "Treinos de hoje" e a pilha. */
#training-today-card {
  margin-top: 4px;
  padding: 0;
}

.training-today-list {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

/* Card de um treino ja feito - a mesma cara do painel de treino ao vivo
   (#training-readout), so que mais compacto: e um resumo, nao o ecra
   principal. Ver renderTrainingCard em js/training.js. */
.training-card {
  padding: 18px 18px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
}

.training-card .training-distance { font-size: 38px; }

.training-card .summary-grid {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.training-today-empty {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Botoes -------------------------------------------------------- */

.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 999px;
  padding: 15px 26px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover { background: var(--accent-600); }
.btn-primary:active { background: var(--accent-700); }

.btn-primary:disabled {
  background: var(--sand-300);
  color: var(--muted-2);
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 13px 22px;
}

.btn-secondary:hover { background: rgba(32, 30, 29, 0.06); }

/* Botao de parar um treino/luta em curso - preto solido, distinto do
   laranja do btn-primary (2026-08-06, a pedido: precisa de se destacar
   como uma acao "de paragem", nao mais uma acao "de avancar"). */
.btn-stop {
  border: none;
  border-radius: 999px;
  padding: 15px 26px;
  background: var(--ink);
  color: var(--surface-2);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
}

.btn-stop:hover { background: #1a1817; }

.btn-danger {
  background: transparent;
  border: 1px solid var(--accent-600);
  color: var(--accent-700);
  font-weight: 700;
}

.btn-danger:hover { background: var(--accent-200); }

/* ---------- Cards --------------------------------------------------------- */

.card {
  margin: 16px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

/* Separador entre cards consecutivos (2026-08-07, a pedido) - o visual
   "campo aberto" (v1.12.2) nao tem caixa/fundo a delimitar cada card, o
   que no Perfil (varios cards com listas longas empilhados) ficava
   confuso, sem se perceber onde um terminava e o outro comecava. */
.card + .card {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 12px;
}

/* ---------- Batalhas (lista vertical de criaturas) ------------------------ */

#monsters-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 2px 10px;
}

.monster-item {
  width: 100%;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid transparent;
}

.monster-item.locked { opacity: 0.5; }

.monster-item.boss { background: var(--ink); color: var(--surface-2); }
.monster-item.boss .monster-stats,
.monster-item.boss .monster-locked-label { color: #c0b6a5; }

.monster-item.miniboss { border-color: var(--sage-300); }

.monster-item.next-target {
  border-color: var(--accent);
  border-width: 2px;
  box-shadow: var(--shadow-md);
}

.monster-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 17px;
  line-height: 1.2;
  margin-bottom: 8px;
}

/* Retrato: circulo antes do nome, sem precisar de tocar em js/monsters.js
   (o tier ja vem como classe .boss / .miniboss no card). */
.monster-header::before {
  content: "🗿";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--sage-200);
  font-size: 22px;
}

.monster-item.boss .monster-header::before {
  content: "👹";
  background: rgba(246, 160, 107, 0.22);
}

.monster-item.locked .monster-header::before { content: "🔒"; }

.monster-name { flex: 1; min-width: 0; }

.monster-stats,
.monster-locked-label {
  font-size: 13px;
  color: var(--muted);
}

.defeated-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sage-200);
  color: var(--sage-700);
  font-family: var(--font-body);
}

.monster-item.boss .defeated-badge { background: rgba(204, 219, 178, 0.25); color: #ccdbb2; }

.creature-stars {
  width: 100%;
  font-size: 16px;
  letter-spacing: 2px;
  font-family: var(--font-body);
}

.creature-stars .star.filled { color: var(--accent); }
.creature-stars .star.empty { color: var(--sand-300); }
.monster-item.boss .creature-stars .star.empty { color: #645c50; }

.btn-battle {
  width: 100%;
  margin-top: 12px;
  padding: 12px 18px;
  font-size: 15px;
}

.monster-item.boss .btn-battle { color: var(--ink); }

.btn-view-all {
  margin-top: 12px;
  width: 100%;
}

/* ---------- Conquistas ---------------------------------------------------- */

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

#achievements-grid-full {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achievement-category-title {
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.achievement-category-title:first-child { margin-top: 0; }

.achievement-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 12px 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid transparent;
  cursor: pointer;
}

.achievement-item:hover { background: var(--sand-300); }

/* Ponto "por ver" (2026-09-20): clicar no item confirma a notificacao e tira-o. */
.achievement-item,
.horde-report-row { position: relative; }
.achievement-item.unseen::after,
.horde-report-row.unseen::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--warn-ink);
  box-shadow: 0 0 0 2px var(--surface);
}

/* Destaque do item por abrir (2026-09-20, a pedido - "ficam destacados"):
   anel e fundo na cor de accent, com um pulso suave no anel. Seletores com
   3 classes para vencer .achievement-item.unlocked (verde) mais abaixo. */
.achievement-item.unlocked.unseen,
.achievement-item.unlocked.unseen:hover,
.horde-report-row.unseen,
.horde-report-row.unseen:hover {
  background: var(--accent-200);
  border-color: var(--accent-600);
  box-shadow: 0 0 0 2px var(--accent-400);
  animation: unseen-pulse 2.2s ease-in-out infinite;
}
@keyframes unseen-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent-400); }
  50% { box-shadow: 0 0 0 5px var(--accent-300); }
}
@media (prefers-reduced-motion: reduce) {
  .achievement-item.unlocked.unseen,
  .horde-report-row.unseen { animation: none; }
}
.achievement-item.read-only { cursor: default; }

.achievement-item.locked { opacity: 0.45; filter: grayscale(1); }

.achievement-item.unlocked {
  background: var(--sage-100);
  border-color: var(--sage-300);
}

.achievement-item.unlocked:hover { background: var(--sage-200); }

.achievement-icon { font-size: 24px; }

.achievement-name {
  font-size: 10px;
  line-height: 1.2;
}

/* ---------- Popups -------------------------------------------------------- */

#achievement-detail-modal,
#mission-complete-modal,
#horde-report-modal,
#feedback-modal,
.equip-upgrade-modal,
#player-trophies-modal {
  position: fixed;
  inset: 0;
  z-index: 960;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(32, 30, 29, 0.45);
}

#achievement-detail-modal.hidden,
#mission-complete-modal.hidden,
#horde-report-modal.hidden,
#feedback-modal.hidden,
.equip-upgrade-modal.hidden,
#player-trophies-modal.hidden { display: none; }

.achievement-detail-box,
.equip-upgrade-box,
.player-trophies-box,
.feedback-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 330px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 26px 22px 22px;
  border-radius: var(--r-lg);
  background: var(--bg);
  border: none;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.achievement-detail-box h3,
.equip-upgrade-box h3 {
  font-family: var(--font-heading);
  font-size: 22px;
}

/* Popup "Missao concluida" (2026-09-21). */
#mission-complete-modal .wallet { justify-content: center; }

.achievement-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 7px 14px;
  font-size: 12px;
}

.achievement-detail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--accent-200);
  font-size: 30px;
}

.equip-upgrade-stats-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.equip-upgrade-stats-row p {
  flex: 1;
  margin: 0;
  padding: 12px 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
}

.equip-upgrade-stats-row strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 400;
  color: var(--text);
}

.equip-upgrade-next {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.equip-upgrade-next.hidden { display: none; }

.equip-upgrade-next .equip-upgrade-stats-row p {
  background: var(--accent-200);
  color: var(--accent-700);
}

.equip-upgrade-next .equip-upgrade-stats-row strong { color: var(--accent-700); }

.equip-upgrade-next-label {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.equip-upgrade-box .btn-primary,
.achievement-detail-box .btn-primary { width: 100%; }

/* Popup "Dar feedback" (2026-09-22) - texto a esquerda, ao contrario do resto
   da achievement-detail-box que e centrada, porque aqui o conteudo e um
   formulario, nao uma mensagem curta. */
.feedback-box { align-items: stretch; text-align: left; max-width: 360px; }
.feedback-box h3 { text-align: center; }
.feedback-box .auth-text { text-align: center; }

.feedback-textarea {
  height: auto;
  min-height: 110px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  resize: vertical;
  font-family: var(--font-body);
  text-align: left;
  box-sizing: border-box;
}

.feedback-attach-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
}

.feedback-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.feedback-preview.hidden { display: none; }

.feedback-preview img {
  max-width: 100%;
  max-height: 160px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

/* ---------- Avisos flutuantes --------------------------------------------- */

/* Container partilhado por todos os .game-toast (2026-08-07, corrigido a
   pedido). Antes cada .game-toast tinha a sua propria position:fixed no MESMO
   top/left - dois avisos a aparecer perto um do outro (ex: subir de nivel +
   uma conquista desbloqueada ao mesmo tempo) ficavam exatamente sobrepostos,
   o de cima escondendo por completo o de baixo. Agora empilham-se
   verticalmente dentro deste container fixo, em vez de cada um ter a sua
   propria posicao fixa igual a todos os outros.
   `pointer-events: none` porque os toasts sao so informativos, nunca clicaveis. */
#game-toast-container {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 980;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.game-toast {
  max-width: 90vw;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: floatUpFade 3.5s ease-out forwards;
}

.game-toast-equipamento { background: var(--sage-200); color: var(--sage-700); }
.game-toast-conquista { background: var(--accent-200); color: var(--accent-700); }
.game-toast-nivel { background: var(--ink); color: var(--surface-2); }
.game-toast-medalha { background: var(--accent); color: var(--bg); }
.game-toast-aviso { background: var(--accent-700); color: var(--bg); }

/* ---------- Popups fullscreen de conquistas/novidades ---------------------- */

#achievements-modal,
#changelog-modal {
  position: fixed;
  inset: 0;
  z-index: 950;
  padding: 20px 16px calc(var(--tabbar-h) + 20px);
  background: var(--bg);
  overflow-y: auto;
}

#achievements-modal.hidden,
#changelog-modal.hidden { display: none; }

.player-trophies-title {
  margin-bottom: 14px;
  font-family: var(--font-heading);
  font-size: 19px;
}

.player-trophies-box .achievements-grid { grid-template-columns: repeat(3, 1fr); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

/* ---------- Combate ------------------------------------------------------- */

#battle-hud {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: calc(100% - 32px);
  max-width: 480px;
}

#battle-hud.hidden { display: none; }

.battle-side {
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: rgba(32, 30, 29, 0.6);
  color: #f9f4ed;
}

.battle-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.hp-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(249, 244, 237, 0.16);
  overflow: hidden;
}

.hp-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.hp-bar-fill.player { background: #aebf92; }
.hp-bar-fill.monster { background: #d67f48; }

#battle-player-hp-text,
#battle-monster-hp-text {
  margin-top: 5px;
  font-size: 11px;
  color: #c0b6a5;
}

#battle-panel {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: rgba(46, 43, 37, 0.9);
  color: #f9f4ed;
  text-align: center;
}

#battle-panel.hidden { display: none; }

/* Legenda por cima do painel de log, a lembrar que o vazio entre o HUD e
   o painel e onde o modelo 3D dos combatentes aparece (2026-08-06). */
.battle-stage-caption {
  margin-bottom: 12px;
  font-size: 11px;
  color: #82796a;
}

/* Ultima linha do combate em destaque (cor/peso conforme o tipo do
   evento - ver BATTLE_LOG_VARIANT_CLASS em js/battle.js), as anteriores
   ficam por baixo como historico curto, mais discretas. */
.battle-log-headline {
  font-family: var(--font-heading);
  font-size: 18px;
  color: #f9f4ed;
}

.battle-log-headline.critico { color: #f6a06b; }
.battle-log-headline.miss { font-style: italic; color: #c0b6a5; }

.battle-log-history {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.battle-log-history p {
  font-size: 13px;
  color: #82796a;
}

.battle-result {
  margin: 12px 0;
  font-family: var(--font-heading);
  font-size: 21px;
  color: #f6a06b;
}

.battle-stat-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}

.battle-stat-pill {
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(249, 244, 237, 0.1);
  color: #c0b6a5;
  font-size: 12px;
  font-weight: 600;
}

#battle-panel .btn-secondary {
  width: 100%;
  border-color: #645c50;
  color: #f9f4ed;
}

#battle-panel .btn-secondary:hover { background: rgba(249, 244, 237, 0.08); }

/* Joystick virtual (2026-08-11, vista da Masmorra/Arena passa a top-down
   com movimento livre - secção 9 da documentação) - canto inferior
   esquerdo, para nao sobrepor o #battle-panel centrado acima. touch-action:
   none impede o browser de fazer scroll/zoom ao arrastar o dedo em cima.
   O "knob" e posicionado via JS (js/main.js updateJoystickKnobPosition) -
   a base fica sempre no mesmo sitio, so o knob se desloca dentro dela. */
#battle-joystick {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 5;
}

#battle-joystick.hidden { display: none; }

#battle-joystick-base {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: rgba(249, 244, 237, 0.12);
  border: 2px solid rgba(249, 244, 237, 0.35);
  touch-action: none;
}

#battle-joystick-knob {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(249, 244, 237, 0.55);
  position: relative;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ---------- Debug (admin) -------------------------------------------------- */

#debug-card {
  margin: 16px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.debug-vars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.debug-vars label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.debug-hint { font-weight: 400; color: var(--muted); }

.debug-vars input[type="number"],
.debug-row input[type="number"],
#name-picker-input {
  width: 100%;
  max-width: 12rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 15px;
}

.debug-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.debug-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.debug-row input[type="number"] { width: 6rem; }

.debug-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.debug-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

#debug-character-info p { font-size: 13px; margin-bottom: 4px; }

/* ---------- Rodape --------------------------------------------------------- */

.site-footer {
  padding: 18px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted-2);
}

/* ---------- Autenticacao / nome / contagem decrescente --------------------- */

#auth-modal,
#name-picker-modal,
#welcome-modal,
#weight-reminder-modal {
  position: fixed;
  inset: 0;
  z-index: 990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  /* Reforco para browsers sem interactive-widget=resizes-content (ver
     <meta name="viewport"> no index.html): se o teclado nao encolher o
     viewport, pelo menos da para fazer scroll ate ao campo em vez de ficar
     escondido atras dele sem hipotese nenhuma de chegar la. */
  overflow-y: auto;
}

#auth-modal.hidden,
#name-picker-modal.hidden,
#welcome-modal.hidden,
#weight-reminder-modal.hidden { display: none; }

#training-countdown-modal {
  position: fixed;
  inset: 0;
  z-index: 980;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(32, 30, 29, 0.72);
}

#training-countdown-modal.hidden { display: none; }

/* Pausa do treino (2026-08-15, secção 4.7). Sem forma de fechar por fora:
   as unicas saidas sao Retomar e Terminar - fechar por engano deixaria o
   treino a contar tempo parado. */
#training-pause-modal {
  position: fixed;
  inset: 0;
  z-index: 985;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(32, 30, 29, 0.86);
}

#training-pause-modal.hidden { display: none; }

.pause-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  padding: 26px 22px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.pause-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* Numeros alinhados: sem isto o contador "salta" a cada segundo. */
.pause-elapsed {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pause-hint {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.pause-actions button { width: 100%; }

/* Resumo no fim do treino (secção 4.7). */
#training-summary-modal {
  position: fixed;
  inset: 0;
  z-index: 986;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(32, 30, 29, 0.86);
}

#training-summary-modal.hidden { display: none; }

.summary-box { gap: 12px; }

.summary-mode {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

/* Rotulo a esquerda, valor a direita, alinhados em duas colunas. */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 16px;
  width: 100%;
  margin: 0;
  text-align: left;
}

.summary-grid dt {
  font-size: 13px;
  color: var(--muted);
}

.summary-grid dd {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#training-countdown-modal .auth-box {
  padding: 30px 24px;
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-lg);
}

.training-countdown-number {
  font-family: var(--font-heading);
  font-size: 76px;
  line-height: 1;
  color: var(--accent);
}

.auth-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 330px;
  text-align: center;
}

.auth-box .card-title { margin-bottom: 0; font-size: 26px; }

.auth-text {
  font-size: 14px;
  color: var(--muted);
  text-wrap: pretty;
}

.auth-box .btn-primary { width: 100%; }

#name-picker-input { max-width: none; text-align: center; }

/* ---------- Pagina de entrada (2026-09-21, a pedido - "o home page esta pobre") ----------
   Vive dentro do #auth-modal (so se ve sem sessao), como irmao de #login-view
   (2026-09-22, a pedido - "separa a landing page do login": o cartao de
   login saiu do herói para um ecrã próprio, mostrado só ao carregar em
   "Criar a minha conta"/"Já tenho conta" - ver showLandingView/showLoginView
   em js/auth.js). Mobile primeiro: texto e depois o resto por baixo; a
   partir de 860px o herói passa a duas colunas (texto | arte). */
#auth-modal {
  align-items: flex-start;
  padding: 24px 20px 40px;
}

.landing {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* Mesma especificidade que .hidden (0,1,0) - sem o par ID/classe aqui, quem
   ganhava era quem viesse depois no ficheiro, nao a classe .hidden (bug
   real, 2026-09-22: a landing ficava com display:flex mesmo escondida). */
.landing.hidden { display: none; }

/* Barra fixa no topo da landing (2026-09-24, a pedido - "opção para ir para
   login logo no início da página"): sempre visível, mesmo a meio do scroll
   da landing, para quem já tem conta não ter de percorrer a página toda até
   ao CTA do fundo. position:sticky dentro de #auth-modal (o proprio
   scroller, overflow-y:auto) - nao precisa de position:fixed nem de gerir
   z-index contra o resto do jogo. */
.landing-topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px 12px;
  background: var(--bg);
}

.landing-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--ink);
}

.landing-topbar-logo {
  display: block;
  border-radius: 7px;
}

/* Anuncio de beta fechada (2026-09-24, a pedido) - pilula centrada no topo
   da landing, antes do herói. Numero de vagas vem de beta_vagas_restantes()
   (js/auth.js) - escondido ate essa resposta chegar, para nunca mostrar um
   número errado por instantes. */
.landing-beta-banner {
  align-self: center;
  margin: 0;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent-200);
  color: var(--accent-700);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-wrap: balance;
}

.landing-hero {
  display: grid;
  grid-template-areas: "text" "art";
  gap: 28px;
  align-items: center;
}
.landing-hero-text { grid-area: text; }
.landing-art { grid-area: art; }

.landing-hero-text { text-align: left; }

.landing-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-700);
}

.landing-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(46px, 13vw, 76px);
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
}

.landing-tagline {
  margin: 10px 0 0;
  font-family: var(--font-heading);
  font-size: clamp(20px, 5.4vw, 28px);
  line-height: 1.2;
  color: var(--accent-700);
  text-wrap: balance;
}

.landing-lead {
  margin: 14px 0 0;
  max-width: 46ch;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.landing-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.landing-stats li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}

.landing-stats strong { color: var(--ink); }

.landing-art {
  display: block;
  width: min(100%, 300px);
  height: auto;
  margin: 0 auto;
}

.landing-art .landing-hex-fog { fill: var(--sand-300); stroke: var(--line); stroke-width: 1; }
.landing-art .landing-hex-land { fill: var(--sage-200); stroke: var(--sage-500); stroke-width: 1.2; }
.landing-art .landing-hex-home { fill: var(--accent); stroke: var(--accent-700); stroke-width: 1.4; }

/* Ecrã de login/criar conta (2026-09-22) - separado da landing (ver
   #auth-modal acima): mesmo #auth-modal, sozinho a preencher o ecrã como os
   outros popups simples (#name-picker-modal etc.), sem cartão à parte por
   cima da landing como tinha antes. */
#login-view {
  display: flex;
  align-self: center;
  justify-content: center;
  width: 100%;
}

/* Especificidade de ID bate a de .hidden (classe) - sem isto #login-view
   ficava sempre visivel ao lado da landing, mesmo com .hidden aplicada. */
#login-view.hidden { display: none; }

#login-view .auth-box { text-align: center; }
#login-view #btn-login-back { align-self: flex-start; }

.landing-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.landing-h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(26px, 6vw, 34px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  text-wrap: balance;
}

.landing-sub {
  margin: 0;
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.landing-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.landing-step {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.landing-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--accent-200);
  color: var(--accent-700);
}

.landing-step h3 {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 400;
  color: var(--ink);
}

.landing-step p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.landing-expl {
  padding: 24px 20px;
  border-radius: var(--r-lg);
  background: var(--sage-100);
}

.landing-expl-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.landing-expl-list li {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.landing-expl-list img { grid-row: 1 / 3; }
.landing-expl-nome { font-size: 14px; font-weight: 700; color: var(--ink); }
.landing-expl-rec { font-size: 12px; color: var(--muted); }

.landing-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.landing-final .landing-sub { text-align: center; }
.landing-cta { width: auto; min-width: 240px; }
.landing-install { min-width: 240px; }
.landing-install-hint {
  max-width: 320px;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.landing-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted-2);
}

@media (min-width: 560px) {
  .landing-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 860px) {
  #auth-modal { padding-top: 48px; }
  .landing { gap: 80px; }
  .landing-hero { grid-template-columns: 1.15fr 0.85fr; grid-template-areas: "text art"; gap: 32px 48px; align-items: center; }
  .landing-art { margin-left: 0; }
  .landing-steps { grid-template-columns: repeat(4, 1fr); }
  .landing-expl { padding: 32px; }
}

/* ---------- Leaderboard ----------------------------------------------------- */

.leaderboard-tabs { margin-bottom: 12px; }

.profile-chart-metric-tabs { margin-bottom: 14px; }

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* .hidden e .leaderboard-list tem a mesma especificidade (uma classe cada)
   e .leaderboard-list vem depois no ficheiro - sem isto, o display:flex
   ganhava ao display:none e as 3 listas apareciam todas empilhadas. */
.leaderboard-list.hidden { display: none; }

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid transparent;
  font-size: 14px;
}

.leaderboard-row.own {
  background: var(--sage-100);
  border-color: var(--sage-300);
  font-weight: 700;
}

.leaderboard-rank {
  width: 24px;
  font-family: var(--font-heading);
  color: var(--accent);
}

.leaderboard-name { flex: 1; }

.leaderboard-name-clickable { cursor: pointer; }
.leaderboard-name-clickable:hover { text-decoration: underline; }

.leaderboard-level,
.leaderboard-distance {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Relatórios de horda (js/horde.js, 2026-09-16). Cada linha passou a ter
   várias informações (monstros derrotados, recursos perdidos por tipo em
   caso de derrota - a pedido, "os relatorios devem dizer o numero total de
   monstros e o numero de mostros derrotados... quantidade de recursos
   perdidos individualmente"), por isso deixou de reaproveitar
   .leaderboard-row (uma só linha) e ganhou o seu próprio bloco. A lista em
   si (#horde-reports-list) fica com altura fixa e scroll próprio - "é uma
   espécie de scroll mostrando os 3 relatórios mais recentes" - em vez de um
   botão "Ver todas" à parte: os mais recentes já vêm primeiro (mais
   recente primeiro, ver registarHordaRelatorio), scroll dentro da própria
   caixa revela os mais antigos sem precisar de outro ecrã. */
#horde-reports-list {
  max-height: 260px;
  overflow-y: auto;
}
.horde-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface);
  margin-bottom: 6px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.horde-report-row:last-child { margin-bottom: 0; }
.horde-report-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
}
.horde-report-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}
.horde-report-stat strong {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
}
.horde-report-stat-label {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.horde-report-detail {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.horde-report-loot { margin-top: 6px; }
.horde-report-result {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.horde-report-win { color: var(--sage-700); }
.horde-report-loss { color: var(--warn-ink); }

/* Painel de afinação de câmara (js/camera-debug.js, 2026-09-16) - so dev,
   nunca visivel para jogadores (?debugcamera na URL). Sobreposto ao canvas
   3D, mesmo espirito visual do resto da app mas compacto/monospace por ser
   uma ferramenta tecnica, nao UI de jogo. */
#camera-debug-panel {
  /* fixed (nao absolute) - 2026-09-16, bug reportado: com "absolute" o
     painel deslocava-se com o scroll normal da pagina (fica dentro de
     #viewer) e em telemoveis mais baixos o cabecalho com os separadores
     Idle/Horda acabava por sair do ecra sem hipotese de lhe voltar a tocar.
     "fixed" prende-o ao ecra do telemovel/janela, nunca ao documento. */
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: 8px;
  width: 220px;
  max-width: calc(100% - 16px);
  max-height: calc(100vh - 16px - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  background: rgba(46, 43, 37, 0.92);
  color: var(--surface-2, #fff);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  z-index: 995;
}
.camera-debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.camera-debug-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}
.camera-debug-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.camera-debug-tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 6px;
  color: inherit;
  padding: 4px 0;
  cursor: pointer;
  font-size: 12px;
}
.camera-debug-tab.active { background: var(--sage-500); }
.camera-debug-field {
  display: grid;
  grid-template-columns: 62px 1fr 40px;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.camera-debug-field input[type="range"] { width: 100%; }
.camera-debug-readout {
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 6px;
  margin: 6px 0;
  font-family: monospace;
  font-size: 11px;
}
.camera-debug-copy { width: 100%; }

.leaderboard-divider {
  text-align: center;
  color: var(--muted-2);
  font-size: 14px;
}

.leaderboard-month-header {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.leaderboard-month-header:first-child { margin-top: 0; }

/* ---------- Perfil ----------------------------------------------------------- */

.profile-summary-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.profile-summary-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: none;
  font-size: 14px;
}

.profile-summary-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-summary-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 400;
}

.profile-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.profile-history-group-title {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.profile-history-group-title:first-child { margin-top: 0; }

.profile-history-day-title {
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--text);
}

.profile-history-session-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 0;
  padding-left: 18px;
}

.profile-history-session-list li {
  font-size: 13px;
  color: var(--muted);
}

/* Novidades (2026-08-06, a pedido) - notas de atualizacao em linguagem
   simples, uma entrada por versao "menor" (js/changelog.js, CHANGELOG), mais
   recente primeiro. Classe partilhada (2026-09-29) entre o popup de
   Definicoes (#changelog-modal-list, lista toda, sem limite de altura - o
   proprio popup ja tem scroll) e a landing (#landing-changelog-list, só as
   mais recentes). */
.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#landing-changelog-list {
  max-width: 640px;
}

.changelog-entry-title {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--text);
}

.changelog-entry-version {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
}

.changelog-entry-changes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0 0;
  padding-left: 18px;
}

.changelog-entry-changes li {
  font-size: 13px;
  color: var(--muted);
}

.profile-history-empty {
  font-size: 14px;
  color: var(--muted);
}

.profile-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.btn-month-nav {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 16px;
  line-height: 1;
}

.btn-month-nav:disabled { opacity: 0.35; cursor: not-allowed; }

.profile-chart {
  display: flex;
  align-items: flex-start;
  width: 100%;
  height: 124px;
  margin-bottom: 18px;
  padding: 12px 10px;
  border-radius: var(--r-lg);
  background: var(--surface);
}

.profile-chart-yaxis { flex-shrink: 0; }

/* So esta parte tem scroll horizontal - o eixo dos YY fica sempre visivel */
.profile-chart-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.profile-chart-yaxis svg,
.profile-chart-scroll svg { display: block; }

/* As barras dos graficos SVG (js/profile.js desenha-as sem fill inline) */
.profile-chart rect { fill: var(--sage-500); }
.profile-chart text { fill: var(--muted); }

#profile-danger-card {
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--accent-300);
}

#profile-danger-card .btn-danger { width: 100%; }

/* ---------- Aviso de orientacao ---------------------------------------------- */

#rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 21px;
  background: var(--bg);
  color: var(--text);
}

/* Controlado via JS (js/orientation.js) */
#rotate-overlay.visible { display: flex; }

/* Os mesmos campos do resumo, ao vivo dentro do painel de treino
   (secção 4.7). Mais discreto que no popup - ali e o destaque, aqui e
   informacao de fundo enquanto se anda. */
.live-grid {
  margin: 10px 0 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.live-grid dd { font-size: 14px; }

/* XP em destaque no resumo: e o que o jogador ganhou. */
.summary-xp-row {
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

dd.summary-xp-row { color: var(--accent); font-size: 17px; }

/* Sub-abas do Mundo escondidas (2026-09-07, a pedido): Masmorra e Arena
   ficam fora de vista ate o combate estar pronto. Nao sao removidas do
   DOM - js/nav.js exige os quatro botoes e os quatro paineis, e desiste
   de ligar a sub-navegacao se algum faltar. */
.nav-tab-oculta { display: none; }

/* Historico de peso (2026-09-07, secção 20). */
.weight-lock-status {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.weight-chart-title {
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.weight-empty {
  font-size: 13px;
  color: var(--muted-2);
  padding: 10px 0;
}

/* O grafico do peso e de LINHA, nao de barras: o peso e uma serie continua,
   interessa a forma da evolucao, e barras a partir do zero sugeririam uma
   grandeza acumulada que nao existe. */
.wchart-line {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.wchart-dot {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 1.5;
}

.wchart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

/* O #weight-chart reutiliza .profile-chart, cuja regra pinta rect com a cor
   das barras - aqui nao ha rect, mas o texto herda a cor certa. */
#weight-chart text { fill: var(--muted); }

/* Economia de recursos (2026-09-07, secção 21). */
.resources-panel, .warehouse-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
}

.resources-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.resources-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  margin: 0;
}

.resources-grid dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.resources-grid dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* O ritmo e informacao de fundo: nao compete com o numero que interessa. */
.resource-rate {
  margin-left: 8px;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted-2);
}

/* Numero de depositos encontrados do recurso, ao lado do nome (2026-09-21). */
.resource-name { min-width: 68px; }
.resource-deposits {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--sage-200);
  color: var(--sage-700);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* A mesma cor do hexagono no mapa - e o que liga o painel ao territorio. */
.resource-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.resource-full { color: var(--accent-700); }

.resources-warning {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--accent-700);
}

.warehouse-line { font-size: 13px; color: var(--muted); line-height: 1.5; }
.warehouse-cost { font-size: 13px; font-weight: 700; margin: 6px 0 10px; }
.warehouse-panel button { width: 100%; }

/* Cone de direcao do jogador (2026-09-07, a pedido: "o icon deve apontar
   para que lado estas virado e nao apenas um circulo que pisca").
   A direcao vem do GPS (coords.heading), so existe em movimento. */
.hex-player-rot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  /* Origem no centro exato do ponto: e a volta dele que o cone tem de rodar,
     nao a volta de um canto da caixa. */
  transform-origin: 0 0;
  display: none;
}

/* Triangulo a apontar para norte quando a rotacao e 0 - o mapa e sempre
   norte acima, por isso rodar pelos graus do GPS da a direcao certa. */
.hex-player-cone {
  position: absolute;
  left: -13px;
  top: -30px;
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-bottom: 24px solid rgba(78, 190, 255, 0.5);
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
}

/* Contagem de minas encontradas (secção 21). Discreta: e contexto para os
   numeros de producao abaixo, nao um numero de destaque. */
.mines-found {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.mines-found strong { color: var(--text); }

/* Reparticao por modo dentro de um treino (secção 4.9). Fica entre a
   distancia grande e a grelha de tempos: e o detalhe do numero de cima,
   nao mais uma linha da tabela. */
.training-modes {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 14px;
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  text-align: left;
}

.training-modes[hidden] { display: none; }
#summary-modes { width: 100%; margin-top: 0; padding-top: 0; border-top: none; }

.training-modes dt {
  font-size: 13px;
  color: var(--muted);
}

.training-modes dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
