/* Build Kingdom — estilo cartoon inspirado em Clash of Clans */
:root {
  --wood-dark: #4a2c14;
  --wood: #7a4a22;
  --wood-light: #a8703a;
  --parchment: #f6e7c4;
  --parchment-dark: #e6cf9c;
  --ink: #3b2412;
  --gold: #ffcc33;
  --gold-dark: #c78a00;
  --green: #5cbf2a;
  --green-dark: #2f7a12;
  --red: #e2463a;
  --red-dark: #8f1d14;
  --blue: #3fa3e8;
  --blue-dark: #1a5f96;
  --shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  --font: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  /* títulos e números do HUD: Lilita One (assets/fonts, licença OFL) */
  --display: 'Lilita One', 'Trebuchet MS', 'Arial Black', sans-serif;
  /* "vidro" escuro translúcido das barras do HUD */
  --glass: linear-gradient(rgba(12, 10, 6, 0.38), rgba(12, 10, 6, 0.56));
  --glass-edge: rgba(0, 0, 0, 0.5);
  --glass-shine: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
}
/* O cursor nativo some: a luva é desenhada pela página (main.js) e pode passar de 32 px. */
html, html * { cursor: none !important; }
.game-cursor {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  width: 53px; height: 62px; will-change: transform;
}

@font-face {
  font-family: 'Lilita One';
  src: url('assets/fonts/LilitaOne-Regular.ttf') format('truetype');
  font-display: swap;
}

/* ícones PNG dos sprites (ui/icons.js) */
.ico { width: 1.35em; height: 1.35em; object-fit: contain; vertical-align: -0.3em; user-select: none; -webkit-user-drag: none; }
.ico.big { width: 40px; height: 40px; }
.ico.huge { width: 56px; height: 56px; }
.with-ico { display: inline-flex; align-items: center; gap: 5px; }
.sprite-thumb { display: inline-block; background-repeat: no-repeat; background-position: 0 0; flex-shrink: 0; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d2b12; font-family: var(--font); color: var(--ink); user-select: none; touch-action: none; cursor: none; }
input, textarea, select, a, label, summary, canvas { cursor: none; }
#app { position: fixed; inset: 0; }
button { font-family: inherit; cursor: none; }
h2, h3 { margin: 0.4em 0; }
h3 { font-size: 15px; color: var(--wood-dark); text-transform: uppercase; letter-spacing: 0.04em; }
.hidden { display: none !important; }
.muted { color: #7b6346; font-size: 12px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.ok { color: var(--green-dark); }
.bad { color: var(--red); font-weight: bold; }
.empty { padding: 18px; text-align: center; color: #8a7050; font-style: italic; }

/* ---------- botões ---------- */
.btn {
  border: 2px solid var(--wood-dark);
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: bold;
  font-size: 14px;
  color: var(--ink);
  background: linear-gradient(#fff5d8, #e8cf98);
  box-shadow: 0 3px 0 var(--wood-dark);
  transition: transform 0.05s, filter 0.1s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wood-dark); }
.btn:disabled { filter: grayscale(1) opacity(0.55); cursor: none; transform: none; }
.btn.primary { color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); background: linear-gradient(#8ee04f, var(--green)); border-color: var(--green-dark); box-shadow: 0 3px 0 var(--green-dark); }
.btn.danger { color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); background: linear-gradient(#ff7a6b, var(--red)); border-color: var(--red-dark); box-shadow: 0 3px 0 var(--red-dark); }
.btn.gray { color: #f4efe4; background: linear-gradient(#6e675d, #454039); border-color: #2c271f; box-shadow: 0 3px 0 #2c271f; }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.btn.big { padding: 12px 26px; font-size: 18px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.actions.left { justify-content: flex-start; }
.actions.spread { justify-content: space-between; width: 100%; }
.actions.column { flex-direction: column; align-items: stretch; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- formulários ---------- */
.field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-weight: bold; font-size: 13px; }
.input {
  font: inherit; font-size: 15px; padding: 9px 12px; border-radius: 8px;
  border: 2px solid var(--wood-light); background: #fffdf5; color: var(--ink); outline: none; user-select: text;
}
.input:focus { border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(255, 204, 51, 0.35); }
.input.invalid { border-color: var(--red); animation: shake 0.25s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---------- telas de login / vilas ---------- */
.auth-screen, .select-screen, .loading-screen {
  position: absolute; inset: 0; display: flex; overflow: hidden;
}
.loading-screen {
  flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(ellipse at center, #6dbb3c 0%, #3d7f22 55%, #1e4512 100%);
  overflow: auto;
}
.loading-screen.overlay { z-index: 50; }
.auth-screen, .select-screen {
  align-items: stretch; justify-content: flex-end;
  background: #1a120c;
}
.scene-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: left center;
  pointer-events: none; -webkit-user-drag: none;
}
/* painel da direita: transparente na borda esquerda e mais escuro junto à borda da tela */
.scene-panel {
  position: relative; z-index: 1;
  width: min(760px, 54vw); min-width: 300px; height: 100%;
  display: flex; justify-content: flex-end;
  background: linear-gradient(90deg,
    rgba(10, 7, 4, 0) 0%,
    rgba(10, 7, 4, 0.22) 18%,
    rgba(8, 6, 3, 0.55) 40%,
    rgba(6, 4, 2, 0.78) 68%,
    rgba(4, 3, 2, 0.9) 100%);
  overflow: hidden;
}
.scene-stack {
  width: min(360px, 100%); height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 8px;
  padding: 28px 40px 28px 16px;
  overflow: auto;
}
.scene-logo {
  width: min(300px, 100%); height: auto; margin-bottom: 4px; flex-shrink: 0;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6));
  pointer-events: none; -webkit-user-drag: none;
}
.loading-logo {
  width: min(340px, 72vw); height: auto;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45));
  pointer-events: none; -webkit-user-drag: none;
}
.install-screen {
  position: absolute; inset: 0; z-index: 60; overflow: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
  text-align: center; color: #fff6df;
  background: radial-gradient(ellipse at center, #3d7f22 0%, #1e4512 58%, #12280c 100%);
}
.install-screen h1 {
  margin: 0; font: 400 28px/1.15 var(--display); letter-spacing: 0.03em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
.install-screen p { margin: 0; max-width: 340px; font-size: 15px; line-height: 1.4; }
.install-steps {
  padding: 12px 14px; border-radius: 12px;
  background: rgba(8, 16, 4, 0.45); border: 1px solid rgba(255, 236, 190, 0.28);
}
.auth-card {
  width: min(320px, 100%); padding: 4px 0 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none;
  display: flex; flex-direction: column; gap: 8px;
}
.auth-card h2 {
  margin: 0 0 4px; text-align: center;
  font: 400 22px/1.2 var(--display); color: #fff6df; letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}
.auth-card .input { width: 100%; }
.scene-panel .input {
  background: rgba(0, 0, 0, 0.32); color: #fff8e8;
  border-color: rgba(255, 214, 140, 0.42);
}
.scene-panel .input::placeholder { color: rgba(255, 236, 200, 0.5); }
.scene-panel .input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 204, 51, 0.28); }
.server-config { margin-top: 10px; color: rgba(246, 231, 196, 0.8); font-size: 12px; }
.server-config summary { cursor: none; opacity: 0.85; }
.scene-panel .field { color: #f6e7c4; }
.village-grid {
  width: min(340px, 100%); display: flex; flex-direction: column; gap: 10px;
}
.village-card {
  padding: 12px 12px 10px; border-radius: 14px;
  background: rgba(12, 10, 6, 0.28);
  border: 1px solid rgba(255, 220, 160, 0.28);
  box-shadow: none; backdrop-filter: blur(3px);
  display: flex; flex-direction: column; gap: 8px; align-items: stretch; color: #fff6df;
}
.village-card .hud-level { width: 100%; }
.village-card .hud-level-plate { flex: 1; min-width: 0; }
.village-card .hud-village-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.village-card.new {
  border-style: dashed; background: rgba(255, 244, 220, 0.04);
  border-color: rgba(255, 220, 160, 0.42);
}
.village-card h3 { font-size: 20px; text-transform: none; }
.select-title {
  margin: 2px 0 6px; text-align: center; flex-shrink: 0;
  font: 400 28px/1.1 var(--display); color: #fff6df;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}
.user-box {
  width: min(340px, 100%); margin-top: 6px; flex-shrink: 0;
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  color: #fff6df; font-weight: bold; text-shadow: 0 1px 0 #000;
}
/* a lista rola; logo, título e sair permanecem na tela */
.select-screen .scene-stack { justify-content: flex-start; overflow: hidden; padding-top: 18px; padding-bottom: 16px; }
.select-screen .scene-logo { width: min(250px, 100%); }
.select-screen .village-grid { flex: 1 1 auto; min-height: 0; overflow: auto; justify-content: safe center; width: 100%; }
.select-screen .village-crest { font-size: 36px; }
.select-screen .village-card { padding: 10px 12px; }
.select-screen .village-card .actions { margin-top: 4px; justify-content: center; }
.village-crest { font-size: 54px; }
.village-name { font-size: 20px; font-weight: 900; }
.village-meta { font-size: 13px; color: rgba(246, 231, 196, 0.78); }
.loading-bar { width: min(360px, 70vw); height: 18px; border-radius: 9px; background: rgba(0, 0, 0, 0.5); border: 2px solid var(--wood-dark); overflow: hidden; }
.loading-fill { width: 0; height: 100%; border-radius: 7px; background: linear-gradient(#ffe98f, #f0a30a); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5); transition: width 0.15s; }
.loading-screen .muted { color: #fff; font-size: 14px; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); }
.spinner { width: 48px; height: 48px; border: 6px solid rgba(255, 255, 255, 0.3); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tela do jogo ---------- */
.game-screen { position: absolute; inset: 0; }
.map-host { position: absolute; inset: 0; }
.map-host canvas { display: block; }
.map-cursor {
  position: fixed; left: 0; top: 0; z-index: 35; width: 36px; height: 36px; pointer-events: none; will-change: transform;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
}
.seed-cursor {
  position: fixed; z-index: 36; pointer-events: none; transform: translate(14px, 16px);
  width: 42px; height: 42px; display: grid; place-items: center;
}
.seed-cursor-icon { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)); }
.seed-cursor-icon .sprite-thumb { display: block; }
.seed-cursor-qty {
  position: absolute; top: -4px; right: -8px; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 11px; background: #c0392b; color: #fff; border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); font: 700 12px/18px sans-serif; text-align: center;
}
.npc-tags { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.npc-tag {
  position: absolute; left: 0; top: 0;
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) translate(-50%, -100%) scale(var(--tag-scale, 1));
  transform-origin: center bottom;
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 86px; padding: 3px 7px 4px;
  border-radius: 8px; background: rgba(12, 10, 6, 0.28); color: #fff; border: 0; box-shadow: none; white-space: nowrap;
}
.npc-say {
  position: absolute; left: 0; top: 0; z-index: 7;
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) translate(-50%, -100%);
  transform-origin: center bottom;
  max-width: 168px; margin: 0; padding: 5px 8px 7px; border-radius: 12px;
  background: #fffdf6; color: #3b2412; border: 2px solid #3b2412;
  font-size: 11px; line-height: 1.25; text-align: center; pointer-events: none;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
.npc-say p { margin: 0; }
.npc-say::after {
  content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #3b2412;
}
.talk { display: flex; gap: 16px; align-items: stretch; min-height: 190px; }
.talk-portrait {
  flex: 0 0 150px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
  background: radial-gradient(circle at 50% 30%, rgba(255, 214, 120, 0.35), rgba(20, 14, 8, 0.15) 70%);
  border-radius: 12px; padding: 8px 8px 10px;
}
.talk-portrait .sprite-thumb { image-rendering: auto; }
.talk-job { font-size: 12px; color: var(--wood); font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.talk-bubble {
  flex: 1; margin: 0; padding: 16px 18px; border-radius: 4px 16px 16px 16px;
  background: linear-gradient(rgba(16, 12, 8, 0.88), rgba(8, 6, 4, 0.94));
  border: 3px solid var(--gold); color: #fff; font-size: 18px; line-height: 1.45;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.talk-bubble p { margin: 0; }
.gather-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin: 0 0 8px; padding: 10px 12px;
  border-radius: 12px; text-align: left; color: var(--ink); font: inherit; cursor: none; }
  background: linear-gradient(#fffdf4, #f2dfb3); border: 3px solid var(--wood-light); box-shadow: 0 3px 0 var(--wood);
}
.gather-choice:hover { border-color: var(--gold-dark); }
.gather-choice:disabled { cursor: none; filter: grayscale(0.55); opacity: 0.7; }
.gather-choice b { font-size: 15px; }
.gather-choice .res { font-weight: 900; color: var(--wood-dark); }
.npc-tag-name { font: 400 13px/1.1 var(--display); letter-spacing: 0.02em; text-shadow: 0 1px 2px #000, 0 0 4px rgba(0, 0, 0, 0.85); }
.npc-tag-job { font-size: 10px; opacity: 0.9; text-shadow: 0 1px 2px #000; }
.meter.mini { width: 78px; height: 12px; margin-top: 2px; }
.meter.mini .meter-text { font-size: 9px; line-height: 10px; }
.meter.sat .meter-fill.good { background: linear-gradient(#ffe08a, #e0a020); }
.meter.sat .meter-fill.mid { background: linear-gradient(#ffc46b, #d07010); }
.meter.sat .meter-fill.low { background: linear-gradient(#ff8b80, var(--red)); }

.hud-col, .hud-row, .hud-dock { position: absolute; z-index: 5; pointer-events: none; }
.hud-col > *, .hud-row > *, .hud-dock > * { pointer-events: auto; }
.hud-left { top: 8px; left: 10px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.hud-center { top: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; }
.hud-center .hud-pill { min-width: 118px; padding-right: 18px; }
.hud-center .hud-pill.cap { min-width: 94px; }
.hud-right { top: 16px; right: 12px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.hud-dock { bottom: 14px; display: flex; align-items: flex-end; gap: 8px; }
.hud-build-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hud-build-row { display: flex; align-items: flex-end; gap: 6px; }
.minimap {
  display: block; width: 200px; height: 150px; border-radius: 12px; touch-action: none;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(18, 32, 12, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35);
}
.hud-action.farm-back, .hud-action.farm-upgrade { display: none; }
body.in-farm .hud-action.farm-back, body.in-farm .hud-action.farm-upgrade { display: grid; }
body.in-farm .minimap-slot,
body.in-farm .hud-jump-col,
body.in-farm .hud-action.attack,
body.in-farm .hud-dock.right > .hud-jump { display: none; }
.back-arrow {
  width: 34px; height: 34px; margin-top: -16px; pointer-events: none;
  background: center / contain no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23fff' stroke='%233b2412' stroke-width='4' stroke-linejoin='round' d='M40 8 L16 32 L40 56 V42 H54 V22 H40 Z'/%3E%3C/svg%3E");
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.45));
}
.farm-side {
  display: flex; flex-direction: column; gap: 8px; align-self: flex-end; width: max-content; max-width: 220px;
  max-height: 52vh; overflow-x: hidden; overflow-y: auto; pointer-events: auto;
}
.farm-side-box {
  padding: 8px 10px 10px; border-radius: 12px; color: #fff8e6;
  background: linear-gradient(#8d5a2b, #5c3416);
  border: 2px solid #3a220f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 3px 6px rgba(0, 0, 0, 0.35);
}
.farm-side-title {
  margin: 0 0 8px; text-align: center; color: #fff6df;
  font: 400 14px/1 var(--display); letter-spacing: 0.03em;
  -webkit-text-stroke: 3px #3a220f; paint-order: stroke fill;
}
.farm-side-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 8px 8px 2px 2px; }
.farm-side-empty { font-size: 12px; color: #fff6df; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45); }
.seed-box {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border-radius: 10px; border: 2px solid #6a4320;
  background: linear-gradient(#e4c48a, #c4924e);
  box-shadow: inset 0 1px 0 rgba(255, 244, 214, 0.45), 0 2px 4px rgba(0, 0, 0, 0.28);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.seed-box.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.seed-box b {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: #fff; color: var(--blue-dark); font-size: 11px;
  display: grid; place-items: center;
}
.seed-empty { color: #fff; font-size: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.hud-jump-col { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.hud-jump {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; overflow: visible;
  border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.34));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 2px 4px rgba(0, 0, 0, 0.28);
}
.hud-jump .btn-badge {
  top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; font-size: 12px; z-index: 1;
  background: #fff; color: var(--blue-dark); border-color: #fff;
}
.hud-jump:hover { filter: brightness(1.12); }
.hud-jump:active { transform: translateY(1px); }
.hud-dock.right .hud-jump .ico { width: 26px; height: 26px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
/* duas fileiras de atalho: 38 + 4 + 38 */
.hud-build-row > .hud-action.big { width: 80px; height: 80px; }
.hud-build-row > .hud-action.big.farm-back { width: 168px; }
.hud-build-row > .hud-action.big.farm-back .hud-action-label { font-size: 12px; }
.hud-build-row > .hud-action.big .ico { width: 56px; height: 56px; margin-top: -4px; }
.hud-build-row > .hud-action.big .hud-action-label { font-size: 13px; }
.hud-dock.left { left: 14px; }
.hud-dock.right { right: 14px; }
.hud-shop-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hud-shop-row { display: flex; gap: 8px; align-items: flex-end; }

.hud-level {
  position: relative; display: flex; align-items: center; padding: 0; border: 0; background: none; color: #fff; text-align: left;
}
.hud-level > .btn-badge {
  top: -4px; left: 46px; right: auto; z-index: 2;
  -webkit-text-stroke: 0; paint-order: normal; text-shadow: none; letter-spacing: 0;
}
.hud-level.level-up { animation: level-pop 0.55s ease-in-out 2; transform-origin: left center; }
@keyframes level-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
/* escudo atrás do nível da vila (assets/sprites/icons/shield.png) */
.hud-shield {
  width: 68px; height: 68px; margin-right: -22px; z-index: 1; display: grid; place-items: center;
  background: center / contain no-repeat; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.55));
}
.hud-shield b { font: 400 27px/1 var(--display); padding-bottom: 5px; }
.hud-level-plate {
  display: flex; flex-direction: column; gap: 4px; min-width: 176px; padding: 6px 14px 7px 30px;
  background: var(--glass); border: 1px solid var(--glass-edge); border-top-color: var(--glass-shine); border-radius: 10px;
  box-shadow: var(--glass-shadow); backdrop-filter: blur(2px);
}
.hud-village-name { font: 400 16px/1 var(--display); }
.hud-xp { position: relative; height: 14px; border-radius: 7px; background: rgba(0, 0, 0, 0.55); box-shadow: inset 0 1px 2px #000; overflow: hidden; }
.hud-xp-fill { position: absolute; inset: 0 auto 0 0; border-radius: 7px; background: linear-gradient(#a6e4ff, #2f9be8 55%, #1a6fc0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.hud-xp-text { position: relative; display: block; text-align: center; font: 400 11px/14px var(--display); }

.hud-trophy { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.hud-medal { width: 40px; height: 40px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); }

/* barras de recurso: vidro escuro translúcido com o ícone sobreposto na ponta */
.hud-level, .hud-pill, .hud-action-label, .hud-menu-item, .mode-hint, .hud-zoom {
  -webkit-text-stroke: 3px #17100a; paint-order: stroke fill; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55); letter-spacing: 0.02em;
}
.hud-pill {
  position: relative; display: flex; align-items: center; justify-content: flex-start; height: 22px; min-width: 0;
  margin: 0 0 0 16px; padding: 0 12px 0 22px; gap: 6px; color: #fff; font: 400 13px/1 var(--display);
  background: var(--glass); border: 1px solid var(--glass-edge); border-top-color: var(--glass-shine); border-radius: 8px;
  box-shadow: var(--glass-shadow); backdrop-filter: blur(2px); transition: filter 0.1s, transform 0.05s;
}
button.hud-pill:hover { filter: brightness(1.2); }
button.hud-pill:active { transform: translateY(1px); }
.hud-pill.warn { border-color: #ff6a5c; box-shadow: 0 0 0 1px #ff6a5c, 0 0 10px rgba(255, 70, 50, 0.7); }
.hud-pill.warn .hud-val { color: #ffb3a8; }
.hud-ico {
  position: absolute; left: -14px; top: 50%; width: 34px; height: 34px; transform: translateY(-50%);
  object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); pointer-events: none;
}
.hud-pill.food { min-width: 0; }
.hud-food-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, rgba(92, 191, 42, 0.15), rgba(92, 191, 42, 0.72));
  pointer-events: none;
}
.hud-pill.food.warn .hud-food-fill { background: linear-gradient(90deg, rgba(226, 70, 58, 0.2), rgba(226, 70, 58, 0.75)); }
.hud-food-time { position: relative; z-index: 1; font-size: 10px; opacity: 0.92; }
.hud-val { position: relative; white-space: nowrap; }
.hud-right .hud-pill { margin-left: 0; }
.hud-right .hud-pill.wealth { gap: 10px; margin-right: 0; padding: 0 12px; }
.hud-right .hud-pill:not(.wealth) { margin-right: 16px; padding: 0 22px 0 12px; }
.hud-right .hud-pill:not(.wealth) .hud-ico { left: auto; right: -14px; }
.hud-coin { display: flex; align-items: center; gap: 4px; }
.hud-coin b { font-weight: 400; }
.hud-coin .ico { width: 16px; height: 16px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6)); }
/* habitantes: três rostos flutuando à esquerda */
.hud-pill.people { padding-left: 64px; }
.hud-faces { position: absolute; left: -14px; top: 50%; display: flex; align-items: center; transform: translateY(-50%); pointer-events: none; }
.hud-faces .ico { width: 28px; height: 28px; margin-right: -12px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6)); }
.hud-faces .ico:nth-child(2) { z-index: 1; width: 32px; height: 32px; }
.hud-faces .ico:last-child { margin-right: 0; }

.hud-action {
  position: relative; display: grid; place-items: center; padding: 0; color: #3b2412;
  border: 3px solid #5a3410; border-radius: 16px;
  background: linear-gradient(#ffe98f 0%, #ffc93a 48%, #f29a0c 52%, #e58406 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), inset 0 -3px 0 rgba(120, 60, 0, 0.35), 0 5px 0 #5a3410, 0 9px 14px rgba(0, 0, 0, 0.4);
}
.hud-action:hover { filter: brightness(1.08); }
.hud-action:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.65), 0 2px 0 #5a3410; }
.hud-action .ico { filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.45)); pointer-events: none; }
.hud-action.big { width: 88px; height: 88px; border-radius: 18px; }
.hud-action.attack { width: 76px; height: 76px; border-radius: 18px; }
.hud-action.attack .ico { width: 52px; height: 52px; margin-top: -12px; }
.hud-action.big .ico { width: 66px; height: 66px; margin-top: -8px; }
.hud-action.big.shop { background: linear-gradient(#c8f59a 0%, #86d94a 48%, #58b524 52%, #45991a 100%); border-color: #24520c; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(20, 70, 0, 0.35), 0 5px 0 #24520c, 0 9px 14px rgba(0, 0, 0, 0.4); }
.hud-action.big.manage { background: linear-gradient(#f6e7b2 0%, #e2c15a 48%, #c89222 52%, #9a6d12 100%); border-color: #6a4a0c; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 0 rgba(80, 50, 0, 0.35), 0 5px 0 #6a4a0c, 0 9px 14px rgba(0, 0, 0, 0.4); }
.manage-board { display: flex; flex-direction: column; gap: 16px; }
.manage-card {
  overflow: hidden; border: 2px solid #b88a52; border-radius: 16px;
  background: linear-gradient(#fffdf8, #f6e7cb);
  box-shadow: 0 4px 0 rgba(90, 52, 16, 0.18);
}
.manage-card-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: linear-gradient(#7a4e28, #4e2e14); color: #fff8e8;
}
.manage-card-ico { width: 36px; height: 36px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.manage-card-title { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.manage-card-title b { font-size: 16px; }
.manage-card-title span { font-size: 12px; opacity: 0.8; }
.manage-count {
  min-width: 54px; padding: 4px 10px; border-radius: 999px; text-align: center;
  background: rgba(255, 248, 232, 0.16); border: 1px solid rgba(255, 248, 232, 0.35); font-weight: bold;
}
.manage-card-body { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.manage-card-foot { display: flex; justify-content: flex-end; padding-top: 4px; }
.manage-person {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid #ead7b4;
}
.manage-person-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.manage-person-id { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.manage-name { font: 400 18px/1 var(--display); color: var(--wood-dark); }
.manage-best { display: flex; align-items: center; gap: 6px; color: var(--wood-dark); font-size: 13px; font-weight: bold; }
.manage-best-ico { width: 28px; height: 28px; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.35)); }
.manage-skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.skill-meter {
  min-width: 0; padding: 6px 8px 7px; border-radius: 12px;
  background: linear-gradient(#fffaf0, #f6e4bf);
  border: 2px solid #e2c48a; box-shadow: inset 0 1px 0 #fff, 0 2px 0 rgba(122, 74, 34, 0.12);
}
.skill-meter.current { border-color: var(--gold-dark); box-shadow: 0 0 0 2px rgba(255, 204, 51, 0.55), inset 0 1px 0 #fff; }
.skill-meter-top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; min-width: 0; }
.skill-meter-ico { width: 26px; height: 26px; flex: 0 0 auto; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.35)); }
.skill-meter-lv {
  flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 7px;
  background: linear-gradient(#ffe98f, #e7a31a); border: 2px solid #8a5a10;
  color: #3d280c; font: 400 13px/1 var(--display);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 2px 0 #8a5a10;
}
.skill-meter-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #6a4520; font-size: 12px; font-weight: bold;
}
.skill-meter-bar {
  position: relative; height: 16px; border-radius: 8px; overflow: hidden;
  background: #241507; border: 2px solid #120a04;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.45);
}
.skill-meter-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(#b6f56d, #5cbf2a 55%, #2f7a12);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.skill-meter.current .skill-meter-fill { background: linear-gradient(#ffe98f, #f0b429 55%, #c78a00); }
.skill-meter-xp {
  position: relative; z-index: 1; display: block; text-align: center;
  color: #fff; font: 400 11px/12px var(--display); text-shadow: 0 1px 0 #000;
}
.manage-pick { position: relative; }
.manage-pick-face {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border: 2px solid var(--wood-dark); border-radius: 12px; color: var(--ink);
  background: linear-gradient(#fff6d8, #e7c56a); font: 400 15px/1 var(--display); text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 3px 0 var(--wood-dark);
}
.manage-pick-face:hover { filter: brightness(1.06); }
.manage-pick.open .manage-pick-face { border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(255, 204, 51, 0.45), 0 3px 0 var(--wood-dark); }
.manage-pick-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-pick-ico { width: 24px; height: 24px; flex: 0 0 auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }
.manage-pick-caret {
  width: 0; height: 0; flex: 0 0 auto;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--wood-dark);
}
.manage-pick.open .manage-pick-caret { transform: rotate(180deg); }
.manage-pick-menu {
  position: fixed; z-index: 46; max-height: 280px; overflow: auto; overscroll-behavior: contain; pointer-events: auto;
  padding: 8px; border-radius: 14px; border: 3px solid var(--wood-dark);
  background: linear-gradient(#fffdf6, #f3e0b4);
  box-shadow: 0 6px 0 rgba(74, 44, 20, 0.28), 0 16px 28px rgba(0, 0, 0, 0.35);
}
.manage-pick-caption { padding: 2px 6px 6px; color: var(--gold-dark); font: 400 13px/1 var(--display); letter-spacing: 0.04em; }
.manage-pick-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 4px; padding: 7px 8px;
  border: 2px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, 0.62);
  color: var(--ink); text-align: left; font: 400 14px/1.1 var(--display);
}
.manage-pick-opt-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-pick-opt small { font: 11px var(--font); color: #7b6346; font-weight: bold; }
.manage-pick-opt:hover { background: #fff1b8; border-color: var(--gold-dark); }
.hud-action.small {
  width: 52px; height: 52px; border-radius: 14px; border-color: rgba(0, 0, 0, 0.55); background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 3px 6px rgba(0, 0, 0, 0.4); backdrop-filter: blur(2px);
}
.hud-action.small .ico { width: 38px; height: 38px; }
.hud-action.small:active { box-shadow: inset 0 1px 0 var(--glass-shine); }
.hud-action-label {
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  font: 400 15px/1 var(--display); color: #fff; white-space: nowrap; pointer-events: none;
}
.hud-zoom-wrap { position: relative; }
.hud-zoom {
  display: flex; align-items: center; gap: 2px; height: 52px; padding: 0 12px 0 6px;
  border-radius: 14px; border: 3px solid rgba(0, 0, 0, 0.55); background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-shine), 0 3px 6px rgba(0, 0, 0, 0.4); backdrop-filter: blur(2px);
  color: #fff; font: 400 16px/1 var(--display); cursor: none; }
}
.hud-zoom:hover { filter: brightness(1.12); }
.hud-zoom .ico { width: 36px; height: 36px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.hud-gear { position: relative; }
.hud-menu {
  position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 168px; padding: 6px;
  display: flex; flex-direction: column; gap: 4px;
  background: linear-gradient(rgba(12, 10, 6, 0.72), rgba(12, 10, 6, 0.86)); border: 1px solid var(--glass-edge); border-top-color: var(--glass-shine); border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px);
}
.hud-menu-item {
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: #fff;
  font: 400 16px/1 var(--display); text-align: left;
}
.hud-menu-item:hover { background: rgba(255, 255, 255, 0.12); }
.hud-menu.settings { min-width: 248px; max-height: calc(100vh - 120px); overflow: auto; padding: 10px; touch-action: pan-y; }
.settings-title { padding: 2px 8px 6px; color: var(--gold); font: 400 15px/1 var(--display); }
.settings-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center;
  padding: 6px 8px 8px; color: #fff; font: 400 14px/1.2 var(--display);
}
.settings-range { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: #e0a020; cursor: none; }
.settings-val { color: #ffe08a; }
.btn-badge { position: absolute; top: -9px; right: -9px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; background: linear-gradient(#ff7a6b, var(--red)); color: #fff; font: 400 14px/1 var(--display); border: 2px solid #fff; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5); display: grid; place-items: center; }
.mode-hint {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: min(560px, 46vw);
  padding: 8px 18px; border-radius: 12px; text-align: center;
  background: linear-gradient(rgba(12, 10, 6, 0.6), rgba(12, 10, 6, 0.78)); color: #fff; font: 400 15px/1.25 var(--display);
  border: 1px solid var(--gold); box-shadow: var(--glass-shadow); backdrop-filter: blur(3px); pointer-events: none;
}
.wall-select {
  position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%); z-index: 7;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; white-space: nowrap;
  background: linear-gradient(rgba(12, 10, 6, 0.72), rgba(12, 10, 6, 0.9)); color: #fff;
  border: 1px solid var(--gold); box-shadow: var(--glass-shadow); backdrop-filter: blur(3px);
  font: 400 16px/1.2 var(--display);
}
.wall-select .btn { font-family: var(--font); }
.wall-select .btn:disabled { opacity: 0.45; }
.hold-ring {
  position: fixed; z-index: 8; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
  pointer-events: none; background: conic-gradient(#ffcc33 calc(var(--p) * 1%), rgba(255, 255, 255, 0.18) 0);
  box-shadow: 0 0 0 3px rgba(23, 16, 10, 0.85);
}
.hold-ring::after {
  content: ''; position: absolute; inset: 6px; border-radius: 50%; background: rgba(23, 16, 10, 0.72);
}
.xp-bar { position: relative; height: 16px; border-radius: 8px; background: #241507; border: 2px solid #000; overflow: hidden; }
.xp-bar.big { height: 26px; margin: 8px 0 16px; }
.xp-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#7fe0ff, #1f8bd6); }
.xp-text { position: relative; display: block; text-align: center; font-size: 11px; font-weight: bold; color: #fff; text-shadow: 0 1px 0 #000; line-height: 12px; }
.xp-bar.big .xp-text { font-size: 14px; line-height: 22px; }
.segment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.segment-name { font-weight: bold; margin-bottom: 4px; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ---------- modais ---------- */
#modals { position: fixed; inset: 0; pointer-events: none; z-index: 45; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; pointer-events: auto; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: var(--parchment); border: 4px solid var(--wood); border-radius: 18px;
  box-shadow: 0 8px 0 var(--wood-dark), 0 20px 50px rgba(0, 0, 0, 0.5); animation: pop 0.18s ease-out;
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 13px 13px 0 0;
  background: linear-gradient(var(--wood-light), var(--wood)); border-bottom: 3px solid var(--wood-dark);
}
.modal-title { font: 400 22px/1.1 var(--display); color: #fff; -webkit-text-stroke: 3px var(--wood-dark); paint-order: stroke fill; text-shadow: 0 2px 0 var(--wood-dark); letter-spacing: 0.02em; }
.modal-close { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--red-dark); background: linear-gradient(#ff7a6b, var(--red)); color: #fff; font-size: 18px; font-weight: 900; box-shadow: 0 3px 0 var(--red-dark); }
.modal-body {
  --modal-pad-y: 14px; --modal-pad-x: 18px;
  padding: var(--modal-pad-y) var(--modal-pad-x) 18px; overflow: auto; user-select: text; flex: 1 1 auto; min-height: 0;
  touch-action: pan-y;
}
.modal-footer {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px;
  padding: 10px 16px 14px; border-top: 3px solid var(--parchment-dark);
  background: linear-gradient(#fff8e4, #f0ddb0); border-radius: 0 0 14px 14px;
}
.modal-footer .actions { margin-top: 0; }
.confirm-text { font-size: 16px; text-align: center; margin: 10px 0; }

/* ---------- toasts e tooltip ---------- */
#toasts { position: fixed; left: 50%; bottom: 118px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 40; pointer-events: none; }
.toast {
  display: flex; gap: 8px; align-items: center; max-width: 380px; padding: 10px 14px; border-radius: 12px;
  background: linear-gradient(rgba(12, 10, 6, 0.7), rgba(12, 10, 6, 0.84)); color: #fff; border: 1px solid var(--gold); font-weight: bold; font-size: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); animation: slidein 0.25s ease-out; pointer-events: auto;
}
.toast.error { border-color: var(--red); background: linear-gradient(rgba(96, 16, 8, 0.82), rgba(70, 10, 6, 0.9)); }
.toast.success { border-color: var(--green); }
.toast.leaving { opacity: 0; transform: translateX(30px); transition: 0.3s; }
.toast-icon { font-size: 20px; }
.toast-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.tooltip {
  position: fixed; z-index: 30; pointer-events: none; min-width: 180px; max-width: 300px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(rgba(12, 10, 6, 0.58), rgba(12, 10, 6, 0.74)); backdrop-filter: blur(4px); color: #fff; font-size: 12px;
  border: 1px solid var(--glass-edge); border-top-color: var(--glass-shine); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.tt-title { font: 400 16px/1.15 var(--display); letter-spacing: 0.02em; margin-bottom: 5px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }
.tt-level { color: var(--gold); margin-left: 6px; }
.tt-row { display: flex; justify-content: space-between; gap: 10px; }
.tt-sub { margin-top: 6px; opacity: 0.8; font-size: 11px; }
.tooltip .ok { color: #9ff07a; }
.tooltip .bad { color: #ff8b80; }

/* ---------- conteúdo dos painéis ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 12px; border-bottom: 3px solid var(--parchment-dark); }
.tabs.village-tabs { padding-top: 12px; overflow: visible; }
.tab.skills-tab { position: relative; overflow: visible; }
.tab.skills-tab > .btn-badge { top: -9px; right: -9px; z-index: 1; }
.attack-hub-head {
  position: sticky; top: 0; z-index: 2;
  margin: calc(var(--modal-pad-y) * -1) calc(var(--modal-pad-x) * -1) 10px;
  padding: var(--modal-pad-y) var(--modal-pad-x) 8px;
  background: var(--parchment);
}
.attack-hub-head .tabs { margin-bottom: 0; }
.attack-seek { width: 100%; margin: 0 0 10px; }
.tabs.wrap { flex-wrap: wrap; border-bottom: none; }
.tab { border: 2px solid var(--wood-light); border-bottom: none; border-radius: 10px 10px 0 0; padding: 6px 12px; background: var(--parchment-dark); font-weight: bold; color: var(--wood); }
.tabs.wrap .tab { border-radius: 10px; border-bottom: 2px solid var(--wood-light); }
.tab.active { background: var(--wood); color: #fff; border-color: var(--wood-dark); }
.summary { padding: 8px 12px; margin-bottom: 10px; border-radius: 10px; background: rgba(122, 74, 34, 0.12); border: 1px solid rgba(122, 74, 34, 0.25); font-size: 13px; }
.section { margin: 12px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { padding: 4px 10px; border-radius: 14px; background: #fffaf0; border: 2px solid var(--parchment-dark); font-size: 12px; font-weight: bold; color: var(--ink); }
button.chip:hover { border-color: var(--gold-dark); }
.chip.active { background: var(--gold); border-color: var(--gold-dark); }
.tag { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--parchment-dark); font-size: 11px; font-weight: bold; margin-left: 4px; }
.tag.tactic { background: #ffe08a; color: var(--wood-dark); }
.focus-board { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.focus-col { min-width: 0; max-height: min(52vh, 460px); overflow: auto; padding: 8px; border-radius: 12px; background: #efe0b8; border: 1px solid var(--parchment-dark); }
.focus-col > h3 { position: sticky; top: 0; z-index: 1; margin: 0 0 8px; padding-bottom: 4px; background: #efe0b8; }
.focus-section { margin: 0 0 10px; }
.focus-section h4 { margin: 2px 0 4px; font-size: 11px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; color: var(--wood); }
.focus-list { display: flex; flex-direction: column; gap: 3px; }
.focus-row { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 6px; border-radius: 6px; background: #fffaf0; border: 1px solid var(--parchment-dark); font-size: 13px; line-height: 1.1; }
.focus-row.on { border-color: var(--gold-dark); background: #fff6d4; cursor: grab; }
.focus-row.dragging { opacity: 0.45; }
.focus-row.drop { box-shadow: inset 0 2px 0 var(--wood); }
.focus-row .pos { width: 16px; font-size: 11px; font-weight: 900; color: var(--wood); text-align: center; flex: 0 0 auto; }
.focus-row .grow { flex: 1; min-width: 0; font-weight: bold; }
.focus-row .titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.focus-kind { font-size: 11px; font-style: italic; font-weight: normal; color: #8a6840; line-height: 1.1; }
.focus-ico { width: 16px; text-align: center; flex: 0 0 auto; }
.focus-grip { color: #a08050; font-size: 12px; letter-spacing: -1px; user-select: none; flex: 0 0 auto; }
.focus-go { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.focus-arrow { font-size: 14px; line-height: 1; }
.focus-row .btn.small { flex: 0 0 auto; padding: 2px 8px; }
.badge { font-size: 12px; font-weight: bold; white-space: nowrap; }
.big-icon { font-size: 28px; width: 40px; text-align: center; }

.list-row, .row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fffaf0; border: 1px solid var(--parchment-dark); margin-bottom: 6px; }
.building-group { margin-bottom: 12px; }
.building-list { display: flex; flex-direction: column; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.card { padding: 10px; border-radius: 12px; background: #fffaf0; border: 2px solid var(--parchment-dark); }
.card-icon { font-size: 28px; }
.card .btn { white-space: normal; max-width: 100%; }

.catalog-jump {
  position: sticky; top: calc(var(--modal-pad-y) * -1); z-index: 3;
  margin: calc(var(--modal-pad-y) * -1) calc(var(--modal-pad-x) * -1) 12px;
  padding: 8px var(--modal-pad-x) 0; background: var(--parchment);
}
.catalog-jump .tabs { margin: 0 0 8px; }
.catalog-jump .tabs:last-child { margin-bottom: 0; }
.catalog-section { margin-bottom: 14px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.catalog-card {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 8px; border-radius: 14px; text-align: center;
  background: linear-gradient(#fffdf4, #f2dfb3); border: 3px solid var(--wood-light); box-shadow: 0 4px 0 var(--wood); cursor: none; }
}
.catalog-card:hover { transform: translateY(-2px); border-color: var(--gold-dark); }
.catalog-card.locked { filter: grayscale(0.9); opacity: 0.65; cursor: none; transform: none; }
.catalog-icon { font-size: 40px; line-height: 1.1; }
.catalog-name { font-weight: 900; font-size: 13px; }
.catalog-size, .catalog-time { font-size: 11px; color: #7b6346; }
.catalog-cost { font-size: 12px; font-weight: bold; }
.catalog-desc { font-size: 11px; color: #a14a2a; }

.grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.grid-list.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.item-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; border-radius: 14px; text-align: center;
  background: linear-gradient(#fffdf4, #f2dfb3); border: 3px solid var(--wood-light); box-shadow: 0 3px 0 var(--wood); color: var(--ink); font: inherit;
}
button.item-card:hover { border-color: var(--gold-dark); }
.item-card.locked { filter: grayscale(0.8); opacity: 0.7; }
.item-card.wide { max-width: 420px; margin: 10px auto; }
.item-icon { font-size: 36px; }
.item-name { font-weight: 900; }
.item-qty { font-weight: bold; color: var(--wood); }
.seed-order { display: flex; flex-direction: column; gap: 8px; }
.seed-order .item-card { flex-direction: row; text-align: left; justify-content: space-between; gap: 12px; }
.seed-move { display: flex; flex-direction: column; gap: 4px; }
.seed-info { flex: 1; }

.progress { position: relative; height: 20px; border-radius: 10px; background: #3b2412; border: 2px solid #000; overflow: hidden; margin: 6px 0; }
.progress.thin { height: 8px; border-width: 1px; }
.progress-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ffe066, #f0a90a); transition: width 0.9s linear; }
.progress-fill.ready, .progress-fill.green { background: linear-gradient(#a8f070, var(--green)); }
.progress-fill.low { background: linear-gradient(#ff8b80, var(--red)); }
.food-meters { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.food-meter-label { font-size: 11px; font-weight: 900; color: var(--wood); text-transform: uppercase; letter-spacing: 0.04em; }
.progress-fill.blue { background: linear-gradient(#8fd3ff, var(--blue)); }
.progress-fill.purple { background: linear-gradient(#d8a6ff, #8a3fe0); }
.progress-text { position: relative; display: block; text-align: center; font-size: 11px; font-weight: bold; color: #fff; text-shadow: 0 1px 0 #000; line-height: 16px; }

/* seleção de habitantes */
.combat-sheet { margin-top: 0; }
.combat-sheet > h3, .combat-soldiers > h3 { margin: 0 0 10px; }
.combat-split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(148px, 1fr); gap: 12px; align-items: stretch; }
.combat-stats { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px 12px; align-items: center; }
.combat-label { font-size: 12px; font-weight: 900; color: var(--wood-dark); text-transform: uppercase; letter-spacing: 0.04em; }
.combat-stats .progress { margin: 0; }
.combat-weapon { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.combat-weapon .muted { flex-basis: 100%; }
.combat-weapon .chip { margin: 0; }
.combat-defense { display: flex; align-items: center; gap: 8px; font: 400 22px/1 var(--display); letter-spacing: 0.02em; }
.combat-defense .ico { width: 28px; height: 28px; }
.combat-next {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px;
  border-radius: 14px; background: linear-gradient(#fffdf4, #f2dfb3); border: 3px solid var(--wood-light); box-shadow: 0 3px 0 var(--wood);
}
.combat-next h3 { margin: 0; font-size: 13px; }
.combat-next .btn { margin-top: auto; width: 100%; }
.combat-k { display: block; font-size: 10px; font-weight: 900; color: #7b6346; text-transform: uppercase; letter-spacing: 0.04em; }
.combat-meters { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.combat-meters b { font-weight: 800; }
.combat-inline { white-space: normal; line-height: 1.35; }
.combat-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; padding: 8px;
  border-radius: 12px; background: rgba(122, 74, 34, 0.1); border: 1px solid rgba(122, 74, 34, 0.25);
}
.picker { border-radius: 12px; border: 2px solid var(--parchment-dark); background: rgba(255, 255, 255, 0.4); }
.picker-toolbar { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--parchment-dark); }
.picker-toolbar .muted { flex: 1; }
.picker-list { max-height: 300px; overflow: auto; padding: 6px; touch-action: pan-y; }
.picker-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 9px; cursor: none; border: 2px solid transparent; margin-bottom: 3px; background: #fffaf0; }
.picker-row:hover { border-color: var(--gold); }
.picker-row.checked { background: #fff1b8; border-color: var(--gold-dark); }
.picker-row.disabled { opacity: 0.5; cursor: none; }
.picker-row.disabled:hover { border-color: transparent; }
.picker-row.exhausted .picker-sub { color: var(--red); }
.picker-row.busy .picker-sub { color: var(--blue-dark); }
.check { font-size: 18px; }
.picker-main { flex: 1; min-width: 0; }
.picker-name { font-weight: bold; font-size: 13px; }
.picker-sub { font-size: 11px; color: #7b6346; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-row .picker-sub.combat { color: #7b6346; white-space: normal; }

.energy-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.energy-left { font-size: 10px; line-height: 1.1; color: #7b6346; white-space: nowrap; }
.meter { position: relative; width: 90px; height: 16px; border-radius: 8px; background: #3b2412; border: 1px solid #000; overflow: hidden; flex-shrink: 0; }
.meter-fill { position: absolute; inset: 0 auto 0 0; }
.meter-fill.good { background: linear-gradient(#a8f070, var(--green)); }
.meter-fill.mid { background: linear-gradient(#ffe066, #f0a90a); }
.meter-fill.low { background: linear-gradient(#ff8b80, var(--red)); }
.meter-text { position: relative; display: block; text-align: center; font-size: 10px; font-weight: bold; color: #fff; text-shadow: 0 1px 0 #000; line-height: 14px; }

/* tabelas */
.table { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; touch-action: pan-x pan-y; }
.focus-col { touch-action: pan-y; }
.table-head, .table-row { display: grid; grid-template-columns: 1.6fr 1.1fr 128px 70px 1.6fr 1.4fr; gap: 8px; align-items: center; padding: 6px 10px; font-size: 13px; }
.table-head.foods, .table-row.foods { grid-template-columns: 2.2fr 1fr 1fr 1.4fr; }
.table-head { font-weight: 900; color: var(--wood); font-size: 11px; text-transform: uppercase; }
.table-row { background: #fffaf0; border-radius: 9px; border: 1px solid var(--parchment-dark); }
.table-row.exhausted { background: #fde6e2; }
.table-row.busy { background: #eaf4fd; }
.activity { font-size: 12px; color: #5f4a30; }
.mini-xp { height: 4px; border-radius: 2px; background: #d9c597; margin-top: 2px; overflow: hidden; }
.mini-xp > div { height: 100%; background: var(--blue); }

/* animais */
.animal-icon { position: relative; font-size: 30px; width: 44px; text-align: center; }
.level-dot { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--blue-dark); color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center; border: 2px solid #fff; }

/* vila */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.stat { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #fffaf0; border: 1px solid var(--parchment-dark); }
.stat-icon { font-size: 24px; }
.stat-label { font-size: 11px; color: #7b6346; text-transform: uppercase; }
.stat-value { font-weight: 900; }
.coin-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin: 10px 0; }
.coin { display: flex; flex-direction: column; align-items: center; min-width: 100px; padding: 10px; border-radius: 14px; border: 3px solid; background: #fffaf0; }
.coin span { font-size: 30px; }
.coin b { font-size: 22px; }
.coin.gold { border-color: var(--gold-dark); }
.coin.silver { border-color: #9aa3ad; }
.coin.bronze { border-color: #a8663a; }

/* skills */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.skill-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: linear-gradient(#fffdf4, #f2dfb3); border: 3px solid var(--wood-light); box-shadow: 0 3px 0 var(--wood); }
.skill-card.has { border-color: var(--gold-dark); }
.skill-head { display: flex; justify-content: space-between; align-items: center; }
.skill-pts { font-weight: 900; color: var(--blue-dark); }
.skill-desc { font-size: 12px; color: #5f4a30; flex: 1; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--wood-light); border-radius: 5px; border: 2px solid var(--parchment); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Ícones PNG dentro dos painéis ---------- */
.modal-title { display: flex; align-items: center; gap: 8px; }
.modal-title .ico { width: 32px; height: 32px; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.45)); }
.modal-title .sprite-thumb { filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.45)); }
.catalog-icon { display: grid; place-items: center; height: 82px; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3)); }
.with-thumb { display: flex; align-items: center; gap: 8px; }
.item-icon .ico { vertical-align: middle; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.3)); }
.item-icon .ico + .ico { margin-left: -18px; }
.animal-icon .ico { width: 40px; height: 40px; vertical-align: middle; }
.chip .ico { width: 22px; height: 22px; vertical-align: -6px; }
.stat-icon .ico, .big-icon .ico { vertical-align: middle; }
.coin .ico { margin-bottom: 2px; }
.tt-title .with-ico, .tt-row .with-ico, .tt-sub .with-ico { gap: 4px; }
.tt-row .ico, .tt-sub .ico, .tt-title .ico { width: 18px; height: 18px; vertical-align: -4px; }
.btn .ico { width: 20px; height: 20px; vertical-align: -5px; }

.game-screen.raid .hud-dock { visibility: hidden; }
.game-screen.raid .hud-col,
.game-screen.raid .hud-col > *,
.game-screen.raid .hud-row,
.game-screen.raid .hud-row > * { pointer-events: none; }
.raid-search {
  position: absolute; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(12, 16, 24, 0.55);
}
.raid-search.hidden { display: none; }
.raid-search-card {
  display: grid; justify-items: center; gap: 14px; min-width: 280px; padding: 28px 32px;
  border-radius: 18px; background: rgba(28, 22, 16, 0.92); color: #fff8e8;
  border: 3px solid var(--wood-light); text-align: center;
}
.raid-bar {
  position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 24;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  pointer-events: auto;
}
.raid-bar.hidden { display: none; }
.raid-army, .raid-stolen {
  display: flex; flex-direction: column; gap: 6px; max-width: 32vw;
  padding: 8px 10px; border-radius: 14px; background: rgba(28, 22, 16, 0.88);
  border: 2px solid var(--wood-light); color: #fff8e8;
}
.raid-caption { font: 700 12px/1 var(--display); letter-spacing: 0.04em; opacity: 0.8; }
.raid-scroll { display: flex; gap: 8px; overflow-x: auto; max-width: 44vw; padding-bottom: 2px; }
.raid-unit {
  flex: 0 0 auto; width: 64px; min-height: 78px; padding: 4px 2px 6px;
  display: grid; justify-items: center; align-content: start; gap: 1px;
  border-radius: 12px; border: 2px solid transparent; background: rgba(255, 255, 255, 0.06); color: #fff8e8;
}
.raid-unit.on { border-color: #7ddea0; background: rgba(46, 160, 90, 0.28); }
.raid-unit b { font-size: 14px; line-height: 1; }
.raid-unit span { font-size: 10px; opacity: 0.85; }
.raid-unit.static { width: auto; min-width: 72px; grid-template-columns: auto; padding: 6px; }
.raid-loot-row { display: flex; gap: 10px; align-items: center; }
.raid-loot { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.raid-loot .ico { width: 22px; height: 22px; }
.raid-cursor {
  position: fixed; z-index: 36; pointer-events: none; transform: translate(16px, 18px);
  display: grid; justify-items: center; opacity: 0.82;
}
.raid-cursor.hidden { display: none; }
.raid-cursor b {
  margin-top: -8px; min-width: 18px; padding: 0 5px; border-radius: 9px;
  background: #1c3b28; color: #fff; border: 2px solid #fff; font-size: 12px; text-align: center;
}
.raid-history { display: flex; flex-direction: column; gap: 8px; }
.raid-history-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  text-align: left; padding: 10px 12px; border-radius: 12px;
  border: 2px solid var(--wood-light); background: #fff8ea; color: var(--ink);
}
.raid-summary { display: flex; flex-direction: column; gap: 14px; color: var(--ink); }
.raid-summary h3 { margin: 0 0 8px; }
.raid-summary section { min-width: 0; }
.raid-versus { margin: 0; font-size: 18px; }
.raid-versus b { font-size: 20px; }
.raid-stats { display: flex; gap: 10px; }
.raid-stats > div {
  flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 8px 12px;
  border-radius: 12px; background: #fff8e6; border: 2px solid var(--wood-light);
}
.raid-stats span { font-size: 12px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; color: #7b6346; }
.raid-stats b { font: 400 26px/1 var(--display); color: var(--ink); }
.raid-summary-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.raid-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.raid-card {
  display: flex; align-items: center; gap: 8px; min-width: 148px; padding: 6px 10px 6px 6px;
  border-radius: 12px; background: #fff8e6; border: 2px solid var(--wood-light); color: var(--ink);
}
.raid-card div { display: flex; flex-direction: column; gap: 1px; }
.raid-card b { font: 400 22px/1 var(--display); }
.raid-card span { font-size: 13px; font-weight: 700; color: var(--ink); }
.raid-none { margin: 0; color: #7b6346; font-style: italic; }
.raid-summary .raid-loot-row { flex-wrap: wrap; }
.raid-summary .raid-loot {
  padding: 6px 10px; border-radius: 10px; background: #fff8e6; border: 2px solid var(--wood-light); color: var(--ink);
}
.raid-summary .raid-loot .ico { width: 28px; height: 28px; }
.raid-summary .raid-loot b { font: 400 20px/1 var(--display); }

/* Celular de lado: o HUD encolhe e os modais usam a tela curta sem cortar o conteúdo. */
@media (orientation: landscape) and (max-height: 540px) {
  .hud-left { top: 4px; left: 6px; gap: 6px; }
  .hud-center {
    top: 6px; gap: 6px; max-width: calc(100vw - 340px); overflow-x: auto; justify-content: flex-start;
    pointer-events: auto; touch-action: pan-x; padding-bottom: 2px;
  }
  .hud-right { top: 6px; right: 6px; gap: 5px; }
  .hud-dock { bottom: 8px; gap: 6px; }
  .hud-shield { width: 48px; height: 48px; margin-right: -16px; }
  .hud-shield b { font-size: 20px; }
  .hud-level-plate { min-width: 120px; padding: 4px 8px 4px 22px; }
  .hud-village-name { font-size: 14px; }
  .hud-xp { height: 12px; }
  .hud-trophy { gap: 4px; margin-left: 4px; }
  .hud-medal { width: 28px; height: 28px; }
  .hud-pill { height: 20px; margin-left: 14px; padding: 0 10px 0 18px; font-size: 12px; }
  .hud-pill.food { gap: 6px; }
  .hud-pill.people { padding-left: 48px; }
  .hud-center .hud-pill { min-width: 100px; padding-right: 14px; }
  .hud-center .hud-pill.cap { min-width: 85px; }
  .hud-food-time { display: none; }
  .hud-ico { width: 28px; height: 28px; left: -12px; }
  .hud-right .hud-pill { height: 20px; margin-left: 0; font-size: 12px; }
  .hud-right .hud-pill.wealth { gap: 6px; padding: 0 8px; }
  .hud-right .hud-pill:not(.wealth) { margin-right: 14px; padding: 0 18px 0 10px; }
  .hud-right .hud-pill:not(.wealth) .hud-ico { left: auto; right: -12px; }
  .hud-coin .ico { width: 14px; height: 14px; }
  .hud-faces { left: -12px; }
  .hud-faces .ico { width: 24px; height: 24px; }
  .hud-faces .ico:nth-child(2) { width: 26px; height: 26px; }
  .hud-action.big { width: 72px; height: 72px; }
  .hud-action.big .ico { width: 48px; height: 48px; }
  .minimap { width: 132px; height: 99px; }
  .hud-build-row > .hud-action.big { width: 68px; height: 68px; }
  .hud-build-row > .hud-action.big.farm-back { width: 128px; }
  .hud-build-row > .hud-action.big.farm-back .hud-action-label { font-size: 10px; }
  .hud-build-row > .hud-action.big .ico { width: 44px; height: 44px; }
  .hud-dock.right .hud-jump .ico { width: 22px; height: 22px; }
  .hud-action.attack { width: 60px; height: 60px; }
  .hud-action.attack .ico { width: 40px; height: 40px; }
  .hud-action.small { width: 42px; height: 42px; }
  .hud-action.small .ico { width: 30px; height: 30px; }
  .hud-jump { width: 32px; height: 32px; }
  .hud-action-label { font-size: 13px; }
  .mode-hint { top: 42px; max-width: min(560px, 70vw); font-size: 13px; }
  .wall-select { bottom: 92px; }

  .modal-backdrop { padding: 6px; }
  .modal { width: 100% !important; max-width: 100%; max-height: 100%; border-width: 3px; border-radius: 12px; }
  .modal-body { --modal-pad-y: 8px; --modal-pad-x: 10px; padding-bottom: 10px; }
  .modal-header { padding: 6px 10px; }
  .modal-title { font-size: 16px; min-width: 0; }
  .modal-title .ico { width: 24px; height: 24px; }
  .modal-close { width: 28px; height: 28px; }
  .modal-footer { padding: 8px 10px; }
  .focus-col { max-height: 34vh; }
  .picker-list { max-height: 28vh; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
  .catalog-icon { height: 56px; }
  .skill-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .grid-list, .cards { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .coin { min-width: 72px; padding: 6px; }
  .coin b { font-size: 16px; }
  .table-head, .table-row { min-width: 680px; }
  .combat-split { grid-template-columns: minmax(0, 1fr) minmax(120px, 180px); }
  .raid-summary-split { gap: 8px; }
  .raid-history-row { gap: 8px; }
  h3 { margin: 0.2em 0; }
}

@media (max-width: 720px) {
  .focus-board, .raid-summary-split, .combat-split { grid-template-columns: 1fr; }
  .combat-stats { grid-template-columns: 72px minmax(0, 1fr); }
}
