/* ============ IMPERIO — tema medieval ============ */
:root {
  --bg: #221610;
  --bg2: #2e1f14;
  --parch: #f0e2c0;
  --parch2: #e6d3a8;
  --ink: #3b2a1a;
  --ink2: #6b5433;
  --wood: #4a3421;
  --gold: #c9a227;
  --gold1: #d4b237;
  --gold2: #e8c95a;
  --red: #8a2f2a;
  --green: #4a7a3a;
  --ok: #3f6f2f;
  --no: #9c3428;
}

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

html, body { height: 100%; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(201, 162, 39, .07), transparent 60%),
    linear-gradient(160deg, var(--bg2), var(--bg) 55%, #1a100a);
  color: #e8dcc0;
  min-height: 100%;
}

.hidden { display: none !important; }

/* ---------- fundo da tela de login ---------- */
body.on-auth {
  background:
    linear-gradient(rgba(18, 10, 4, .5), rgba(18, 10, 4, .82)),
    url('../img/auth-bg.jpg') center / cover no-repeat fixed,
    var(--bg);
}

/* ---------- banner da cidade ---------- */
.city-banner {
  position: relative; height: 200px;
  border-radius: 10px; overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
  background: url('../img/city-banner.jpg') center 35% / cover no-repeat;
  margin-bottom: 16px;
}
.banner-shade {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 25%, rgba(18, 10, 4, .88));
}
.banner-text { position: absolute; left: 16px; right: 16px; bottom: 8px; }
.banner-text .sub { margin-bottom: 0; }

/* ---------- painel do mapa ---------- */
.map-board {
  position: relative;
  background: url('../img/map-parchment.jpg') center / cover;
  border: 2px solid #8a6a3a; border-radius: 10px;
  padding: 12px;
  box-shadow: inset 0 0 46px rgba(90, 60, 20, .35), 0 4px 14px rgba(0,0,0,.5);
}
.tile .cap-img {
  width: 74%; height: 74%; object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.55));
  pointer-events: none;
}

/* ---------- topo ---------- */
#topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px;
  background: linear-gradient(#4a3421, #382718);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 10px rgba(0,0,0,.55);
}
.tb-brand {
  font-weight: bold; letter-spacing: 3px; color: var(--gold2);
  text-shadow: 1px 1px 0 #000;
}
.tb-name { font-style: italic; color: #d8c8a2; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-res { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #2b1d10; border: 1px solid #6b5433; border-radius: 6px;
  padding: 3px 9px; font-size: 13px;
}
.chip small { color: #9a8a66; font-size: 11px; }
.dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.d-gold { background: var(--gold); }
.d-wood { background: #8a5a2b; }
.d-iron { background: #9a9a9a; }
.d-food { background: #7a9a3a; }
.tb-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pts { color: var(--gold2); font-weight: bold; font-size: 13px; white-space: nowrap; }
.warn {
  background: #5a1712; border: 1px solid #a33; color: #ffb0a0;
  padding: 3px 9px; border-radius: 6px; font-size: 12px; cursor: pointer;
}

/* ---------- navegação ---------- */
#mainnav {
  position: fixed; top: 45px; bottom: 0; left: 0; width: 156px; z-index: 19;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 3px;
  padding: 10px 8px;
  background: linear-gradient(#3a2a1a, #2b1d10);
  border-right: 2px solid var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  overflow-y: auto;
}
.nav-btn {
  font-family: inherit;
  display: flex; flex-direction: row; align-items: center; gap: 9px;
  font-size: 13px; line-height: 1.1; text-align: left;
  background: transparent; color: #c8b88f;
  border: 1px solid transparent; border-radius: 8px;
  padding: 8px 9px; cursor: pointer;
}
.nav-ico { font-size: 18px; line-height: 1; width: 22px; text-align: center; }
.nav-btn.active {
  background: #4a3421; color: var(--gold2);
  border-color: var(--gold);
}
#menu-toggle, #menu-backdrop { display: none; }
#menu-toggle.hidden, #menu-backdrop.hidden { display: none !important; }

/* ---------- conteúdo ---------- */
#view {
  width: calc(100% - 172px); max-width: 1100px; margin: 0 0 0 160px;
  padding: 64px 12px 84px;
}
.view-title { color: var(--gold2); font-size: 22px; letter-spacing: 1px; margin-bottom: 2px; }
.sub { color: #b0a180; font-size: 13px; margin-bottom: 14px; }
h2.view-title { border-bottom: 1px solid #5a4526; padding-bottom: 6px; }

/* ---------- cartões (pergaminho) ---------- */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.card {
  background: linear-gradient(var(--parch), var(--parch2));
  color: var(--ink);
  border: 2px solid #8a6a3a; border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 3px 8px rgba(0,0,0,.45);
  padding: 12px 14px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.card h3 { font-size: 16px; }
.daily-panel { margin: 0 0 16px; padding: 12px 14px; background: linear-gradient(#4a3421, #2b1d10); border: 1px solid #8a6a3a; border-radius: 9px; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
.daily-panel h3 { color: var(--gold2); font-size: 16px; }
.daily-panel p { color: #d8c8a2; font-size: 12px; margin: 3px 0 10px; }
.daily-tasks { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 8px; }
.daily-task { display: grid; gap: 4px; padding: 9px; color: #e8dcc0; border: 1px solid #6b5433; border-radius: 7px; background: rgba(0,0,0,.16); font-size: 12px; }
.daily-task small { color: #c8b88f; }.daily-task span { color: #d9b949; font-size: 11px; min-height: 26px; }
.daily-task .btn { padding: 5px 7px; font-size: 12px; }.daily-task.ready { border-color: var(--gold); }.daily-task.claimed { opacity: .58; }
#daily-float { position: fixed; right: 22px; bottom: 24px; z-index: 30; display:flex; align-items:center; gap:7px; padding:12px 15px; border:2px solid #8a6a3a; border-radius:28px; background:linear-gradient(#4a3421,#2b1d10); color:var(--gold2); font: bold 14px Georgia,serif; cursor:pointer; box-shadow:0 4px 16px rgba(0,0,0,.55); }
#daily-float i { display:none; width:18px; height:18px; border-radius:50%; background:#b63b2c; color:#fff; font-style:normal; line-height:18px; } #daily-float.ready { animation: missionPulse 1.4s infinite; } #daily-float.ready i { display:block; } @keyframes missionPulse { 50% { transform:scale(1.07); box-shadow:0 0 18px #d4b237; } }
.daily-modal { width:min(1080px,100%); max-width:1080px; }.daily-modal h2 { color:#5a3910; margin-bottom:14px; }.daily-modal-grid { display:grid; grid-auto-flow:column; grid-template-rows:1fr; grid-template-columns:repeat(5,minmax(180px,1fr)); grid-auto-columns:minmax(180px,1fr); gap:12px; overflow-x:auto; padding-bottom:5px; }.daily-modal-task { min-width:0; padding:14px; border:1px solid #b79a63; border-radius:8px; background:rgba(255,255,255,.28); }.daily-modal-task h3 { font-size:16px; min-height:38px; }.daily-modal-task p { color:#6b5433; margin:6px 0; }.daily-modal-task small { display:block; min-height:34px; color:#8a6210; margin-bottom:10px; }.daily-modal-task .btn { width:100%; }.daily-modal-empty { grid-column:1 / -1; padding:22px; color:#6b5433; text-align:center; line-height:1.5; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.unit-img {
  width: 52px; height: 52px; object-fit: contain; flex: none;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.3));
}
.unit-sm { width: 20px; height: 20px; object-fit: contain; vertical-align: -4px; }
.badge {
  background: var(--wood); color: var(--gold2);
  border-radius: 5px; padding: 2px 8px; font-size: 12px; white-space: nowrap;
}
.desc { font-size: 13px; color: #5a4526; margin-bottom: 8px; }
.cost { font-size: 13px; margin-bottom: 4px; }
.cost .c { display: inline-block; margin-right: 8px; white-space: nowrap; }
.cost .ok { color: var(--ok); }
.cost .no { color: var(--no); }
.time { font-size: 12px; color: #6b5433; margin-bottom: 8px; }
.locked { color: var(--no); font-size: 13px; font-weight: bold; }
.maxed { color: var(--gold); font-weight: bold; font-size: 13px; }
.cd-line { font-size: 13px; margin-top: 6px; }

/* ---------- botões ---------- */
.btn {
  font-family: inherit; font-weight: bold; font-size: 14px;
  background: linear-gradient(#d8b544, #a87f1f);
  color: #2b1d10;
  border: 1px solid #6b4f14; border-radius: 6px;
  padding: 8px 14px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 3px rgba(0,0,0,.4);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #8a7a58; color: #4a4030; cursor: not-allowed; filter: none; }
.btn.ghost {
  background: transparent; color: #d8c8a2; border-color: #6b5433; box-shadow: none;
  font-weight: normal; padding: 5px 10px;
}
.btn.ghost:hover { border-color: var(--gold); color: var(--gold2); }
.btn.wide { width: 100%; }
.btn.danger { background: linear-gradient(#b04038, #7a2620); color: #f5e0d0; }

/* ---------- barras de progresso ---------- */
.bar-track {
  height: 12px; background: #4a3826; border: 1px solid #2b1d10;
  border-radius: 6px; overflow: hidden; margin: 6px 0 2px;
}
.bar {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
}

/* ---------- mapa ---------- */
.map-wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.map-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.map-frame {
  background: url('../img/terrain/ocean.jpg') center / 220px;
  border: 3px solid #16323f; border-radius: 14px;
  padding: 14px;
  box-shadow: inset 0 0 34px rgba(0, 10, 20, .55), 0 4px 14px rgba(0,0,0,.5);
}
.map-grid {
  display: grid; grid-template-columns: repeat(16, 1fr);
  gap: 2px; width: 100%; max-width: 620px;
}
.tile {
  aspect-ratio: 1; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: bold;
  color: rgba(255, 255, 255, .88);
  text-shadow: 0 1px 2px rgba(0,0,0,.75);
  cursor: pointer; position: relative; overflow: hidden;
  user-select: none;
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 4px rgba(0,0,0,.25);
}
.tile:hover { outline: 2px solid var(--gold2); z-index: 2; filter: brightness(1.12); }
.t-plains   { background-image: url('../img/terrain/plains.jpg'); }
.t-forest   { background-image: url('../img/terrain/forest.jpg'); }
.t-hills    { background-image: url('../img/terrain/hills.jpg'); }
.t-mountain { background-image: url('../img/terrain/mountain.jpg'); }
.tile.owned { box-shadow: inset 0 0 0 2px rgba(90, 23, 18, .8), inset 0 0 14px rgba(90, 23, 18, .4); }
.tile.mine  {
  outline: 2px solid #ffd75e; outline-offset: -2px;
  box-shadow: inset 0 0 14px rgba(255, 215, 94, .35);
}
.compass {
  position: absolute; top: 5px; right: 5px; z-index: 3;
  width: 58px; height: 58px; opacity: .82;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}
.map-legend { font-size: 12px; color: #b0a180; line-height: 1.9; }
.map-legend .lg { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; background-size: cover; border: 1px solid rgba(0,0,0,.4); }
.lg-plains   { background-image: url('../img/terrain/plains.jpg'); }
.lg-forest   { background-image: url('../img/terrain/forest.jpg'); }
.lg-hills    { background-image: url('../img/terrain/hills.jpg'); }
.lg-mountain { background-image: url('../img/terrain/mountain.jpg'); }

/* ---------- chat ---------- */
.chat-box {
  height: 340px; overflow-y: auto;
  background: linear-gradient(var(--parch), var(--parch2));
  color: var(--ink);
  border: 2px solid #8a6a3a; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 10px;
}
.msg { font-size: 14px; padding: 2px 0; word-break: break-word; }
.msg.mine { color: #7a5a10; }
.msg b { margin-right: 4px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }

/* ---------- formulários ---------- */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input:not([type]) {
  font-family: inherit; font-size: 15px;
  background: #fffbe8; color: var(--ink);
  border: 1px solid #8a6a3a; border-radius: 6px;
  padding: 8px 10px; width: 100%;
}
input[type="number"] { width: 90px; }
label { display: block; font-size: 13px; color: #6b5433; margin: 10px 0 4px; }
label input { margin-top: 4px; }

/* ---------- autenticação ---------- */
.auth-wrap { min-height: calc(100vh - 100px); display: flex; align-items: center; justify-content: center; padding: 20px 0; }
.auth-card {
  width: 100%; max-width: 380px;
  background: linear-gradient(var(--parch), var(--parch2));
  color: var(--ink);
  border: 3px double #8a6a3a; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  padding: 26px 26px 22px;
}
.logo {
  text-align: center; font-size: 30px; letter-spacing: 6px;
  color: #7a5a10; text-shadow: 1px 1px 0 rgba(255,255,255,.4);
}
.tagline { text-align: center; font-style: italic; color: #8a6a3a; margin: 2px 0 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tab {
  flex: 1; font-family: inherit; font-size: 14px;
  background: #d8c8a2; border: 1px solid #8a6a3a; border-radius: 6px;
  padding: 7px; cursor: pointer; color: #5a4526;
}
.tab.active { background: var(--wood); color: var(--gold2); }
.auth-form button { margin-top: 16px; }

/* ---------- modal ---------- */
#modal {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10, 5, 0, .65);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-card {
  width: 100%; max-width: 420px; max-height: 86vh; overflow-y: auto;
  background: linear-gradient(var(--parch), var(--parch2));
  color: var(--ink);
  border: 3px double #8a6a3a; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  padding: 18px 20px;
}
.modal-card h3 { font-size: 18px; margin-bottom: 2px; }
.modal-card .m-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0; }
.modal-card .m-row input { width: 90px; }
.troop-picker { display:flex; align-items:center; gap:5px; flex:none; }
.troop-picker input[type="number"] { width:64px; min-height:38px; padding:6px 4px; text-align:center; }
.troop-step,.troop-max { min-width:38px; min-height:38px; border:1px solid #8a6a3a; border-radius:6px; background:#fff7df; color:#3b2a1a; font:700 16px Georgia,serif; cursor:pointer; touch-action:manipulation; }
.troop-max { min-width:48px; padding:0 7px; font-size:12px; }
.troop-step:active,.troop-max:active { background:#e1c46d; transform:translateY(1px); }
.troop-recruit-row { align-items:center; }.troop-recruit-row .troop-picker { flex:1; justify-content:flex-end; }
.modal-card .btn.ghost { color: #3b2a1a; border-color: #7b5c2f; background: rgba(255,250,225,.38); }
.tutorial-card { max-width: 500px; }
.tutorial-progress { color: #6b5433; font-size: 12px; font-weight: bold; margin-bottom: 10px; }
.tutorial-card .desc { font-size: 15px; line-height: 1.5; }
.tutorial-dots { display: flex; gap: 6px; margin: 18px 0 4px; }
.tutorial-dots span { width: 22px; height: 5px; border-radius: 4px; background: #bca77a; }
.tutorial-dots span.done { background: #a87f1f; }
.map-modal-card {
  width: min(1180px, 100%); max-height: 92vh; overflow: auto; position: relative;
  background: linear-gradient(var(--parch), var(--parch2)); color: var(--ink);
  border: 3px double #8a6a3a; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.6);
  padding: 18px 20px;
}
.map-modal-card .view-title { color: #5a3910; text-shadow: none; }
.map-modal-card .sub { color: #5a4526; }
.map-modal-card .btn.ghost {
  color: #3b2a1a; border-color: #7b5c2f;
  background: rgba(255,250,225,.38); font-weight: bold;
}
.map-modal-card .btn.ghost:hover {
  color: #24180f; border-color: #4f3517; background: rgba(255,247,210,.7);
}
.menu-modal-card {
  width: min(980px, 100%); max-height: 92vh; overflow: auto;
  background: linear-gradient(var(--parch), var(--parch2)); color: var(--ink);
  border: 3px double #8a6a3a; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.6);
  padding: 18px 20px;
}
.menu-modal-head { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.menu-modal-card .view-title { color: #5a3910; text-shadow: none; }
.menu-modal-card .sub { color: #5a4526; }
.menu-modal-card .btn.ghost {
  color: #3b2a1a; border-color: #7b5c2f;
  background: rgba(255,250,225,.38); font-weight: bold;
}
.menu-modal-card .btn.ghost:hover { color: #24180f; border-color: #4f3517; background: rgba(255,247,210,.7); }
.map-modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.map-detail { min-width: 250px; flex: 1; background: rgba(255,255,255,.28); border: 1px solid rgba(112,78,35,.35); border-radius: 8px; padding: 12px; }
.map-detail .btn { margin: 4px 4px 0 0; }
.map-modal-card .map-wrap { flex-direction: column; align-items: stretch; }
.map-modal-card .map-frame { width: 100%; }
.map-modal-card .map-grid { max-width: 1000px; margin: 0 auto; }
.map-modal-card .map-detail { width: 100%; min-width: 0; }
.map-attack-backdrop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20,10,3,.68); }
.map-attack-popup { width: min(470px, 100%); max-height: 82vh; overflow-y: auto; padding: 18px; border: 3px double #8a6a3a; border-radius: 10px; background: linear-gradient(var(--parch),var(--parch2)); color: var(--ink); box-shadow: 0 10px 35px rgba(0,0,0,.65); }
.map-attack-popup .m-stats { padding: 8px 10px; margin: 8px 0; background: rgba(255,255,255,.28); border-left: 3px solid #a87f1f; border-radius: 4px; }
.map-attack-popup .cd-line { color: #5a3910; font-weight: bold; }
.village-popup { width: min(760px, 100%); }
.village-modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; clear: both; padding-top: 12px; }
.village-card { padding: 13px; background: rgba(255,255,255,.30); border: 1px solid #b79a63; border-radius: 8px; }
.village-card .card-head h3 { font-size: 15px; }.village-card .unit-sm { width: 30px; height: 30px; }
.village-card .btn { margin-top: 6px; }.village-report { margin-top: 12px; }
.map-attack-popup h3 { margin-bottom: 8px; }.map-attack-close { float: right; }
.map-attack-popup .btn.ghost { color: #3b2a1a; border-color: #7b5c2f; background: rgba(255,250,225,.38); }
.m-close { margin-top: 12px; }
.m-stats { font-size: 13px; color: #5a4526; margin: 8px 0; line-height: 1.6; }

/* ---------- toasts ---------- */
#toasts {
  position: fixed; top: 64px; right: 12px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 320px;
}
.toast {
  background: linear-gradient(var(--parch), var(--parch2));
  color: var(--ink);
  border: 1px solid #8a6a3a; border-left: 5px solid var(--gold);
  border-radius: 6px; padding: 10px 12px;
  font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.5);
  animation: slidein .25s ease-out;
}
.toast.bad  { border-left-color: var(--no); }
.toast.good { border-left-color: var(--green); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- listas ---------- */
.queue-list { list-style: none; margin-top: 12px; }
.queue-list li {
  background: rgba(240, 226, 192, .08);
  border: 1px solid #5a4526; border-radius: 6px;
  padding: 8px 12px; margin-bottom: 6px; font-size: 14px;
}
.section-title { color: var(--gold2); font-size: 16px; margin: 20px 0 8px; }

/* ---------- mercado ---------- */
.offer-form {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.offer-form > div { flex: 1; min-width: 120px; }
.offer-form select {
  font-family: inherit; font-size: 14px;
  background: #fffbe8; color: var(--ink);
  border: 1px solid #8a6a3a; border-radius: 6px;
  padding: 7px 8px; width: 100%;
}
.offer-form input { margin-top: 6px; }
.offer-form .arrow {
  flex: none; font-size: 26px; color: #7a5a10;
  padding-bottom: 6px;
}
.offer-card h3 { font-style: italic; }

/* ---------- modal de confirmação ---------- */
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px;
}

/* ---------- sistema VIP ---------- */
.vip-chip {
  background: #3a2d0a; border: 1px solid var(--gold2); color: var(--gold2);
  font-weight: bold;
}
.vip-list { margin: 4px 0 8px; padding-left: 18px; }
.vip-list li { margin: 2px 0; }
.vip-pack.featured {
  border-color: var(--gold2);
  box-shadow: 0 0 14px rgba(255, 215, 94, .18);
}

/* ---------- loja de diamantes ---------- */
.d-dia { background: #4aa3df; }
.dia-chip {
  border-color: #4aa3df; color: #9fd2f2;
  font-weight: bold;
}
.shop-pack { text-align: center; position: relative; padding-top: 22px; }
.bonus-tag {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  background: #4aa3df; color: #fff; font-size: 11px; font-weight: bold;
  padding: 2px 10px; border-radius: 0 0 8px 8px; white-space: nowrap;
}
.shop-dia {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 26px; margin: 6px 0 2px; color: #9fd2f2;
}
.shop-dia-gem {
  width: 22px; height: 22px; flex: none;
  background: #4aa3df;
  clip-path: polygon(50% 0%, 100% 35%, 50% 100%, 0% 35%);
  display: inline-block;
}

/* ---------- painel do admin ---------- */
.admin-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 18px 18px 10px; max-width: 1240px; margin: 0 auto;
  border-bottom: 1px solid rgba(201,162,39,.35);
}
.admin-head .logo {
  text-align: left; font-size: 20px; letter-spacing: 2px;
  color: var(--gold2); text-shadow: none;
}
.admin-nav {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 18px 16px; max-width: 1240px; margin: 0 auto;
  background: rgba(30,18,10,.55); border-radius: 0 0 10px 10px;
}
.admin-user { color: var(--gold2); font-size: 13px; }
.stat-card { text-align: center; padding: 12px 8px; }
.stat-val {
  display: block; font-size: 22px; color: var(--gold2); margin-bottom: 2px;
}
.sv-row, .nw-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid #8a6a3a; border-radius: 8px;
  background: #fffbe8; color: var(--ink);
  padding: 8px 10px; margin: 6px 0; font-size: 13px;
}
#admin-root .queue-list .sv-row,
#admin-root .queue-list .nw-row {
  background: linear-gradient(#f7e9c7, #e7d19d); color: #332112;
  border-color: #8a6a3a;
}
#admin-root .queue-list .sv-row b,
#admin-root .queue-list .nw-row b { color: #2f1d0e; }
#admin-root .queue-list .sv-row small,
#admin-root .queue-list .nw-row small { color: #5a3910; }
#admin-root main > .sub, #admin-root main > p { color: #e8c95a; }
.sv-row small, .nw-row small { color: #7a5a10; }
.sv-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto;
}
.sv-actions .nav-btn { padding: 4px 8px; font-size: 12px; }
#admin-root textarea, #admin-root select {
  font-family: inherit; font-size: 14px;
  background: #fffbe8; color: var(--ink);
  border: 1px solid #8a6a3a; border-radius: 6px;
  padding: 7px 8px; width: 100%; box-sizing: border-box;
}
#admin-root label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #c9b068; }
#admin-root .no { color: #8a2f2a; font-weight: bold; }
#admin-root main { max-width: 1240px; margin: 0 auto; padding: 8px 18px 60px; }
.admin-login .auth-card { max-width: 400px; padding: 30px; }
.admin-login .tagline { text-align: center; color: #bca77a; margin: -4px 0 22px; }

/* ---------- responsivo ---------- */
@media (max-width: 640px) {
  /* Modais ocupam a área útil do celular e rolam internamente, sem sair da tela. */
  #modal {
    align-items: flex-start;
    overflow-y: auto;
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }
  #modal .modal-card,
  #modal .map-modal-card,
  #modal .menu-modal-card {
    width: 100%; max-width: 100%;
    max-height: calc(100dvh - 16px);
    margin: 0;
    padding: 14px;
    border-radius: 10px;
    overflow: auto;
    overscroll-behavior: contain;
  }
  #modal .modal-card > .m-close,
  #modal .daily-modal > .m-close {
    position: sticky; top: 0; z-index: 2; float: right;
    margin: -2px 0 10px 10px;
    background: var(--parch);
  }
  #modal .map-modal-head { position: sticky; top: -14px; z-index: 2; padding: 8px 0; background: var(--parch); }
  .map-attack-backdrop {
    position: fixed; z-index: 60; align-items: flex-start;
    overflow-y: auto; padding: max(12px, env(safe-area-inset-top)) 12px;
  }
  .map-attack-popup {
    width: 100%; max-height: calc(100dvh - 24px);
    margin: auto 0; padding: 14px; overflow-y: auto;
  }
  #topbar { padding: 6px 8px; gap: 6px; }
  .tb-brand { font-size: 13px; letter-spacing: 2px; }
  .tb-name { display: none; }
  .chip { font-size: 12px; padding: 2px 6px; }
  .chip small { display: none; }
  .pts { display: none; }
  #view { width: auto; max-width: none; margin: 0; padding: 150px 8px 84px; }
  .cards { grid-template-columns: 1fr; }
  .daily-tasks { grid-template-columns: 1fr 1fr; }
  #daily-float { left:14px; right:auto; bottom:18px; }.daily-modal-grid { grid-template-columns:repeat(5, minmax(180px,1fr)); overflow-x:auto; padding-bottom:4px; }

  /* menu vira sheet vertical (hambúrguer) - agora no topo */
  #mainnav {
    flex-direction: column; flex-wrap: nowrap;
    left: 10px; right: 10px; top: 64px; bottom: auto; width: auto;
    max-height: 66vh; overflow-y: auto; scroll-behavior: auto;
    z-index: 26;
    transform: translateY(calc(-100% - 80px));
    transition: transform .22s ease;
    background: linear-gradient(#3a2a1a, #241708);
    border: 1px solid var(--gold); border-top: 1px solid var(--gold);
    border-radius: 14px;
    padding: 8px; gap: 2px;
    box-shadow: 0 6px 24px rgba(0,0,0,.6);
    touch-action: manipulation;
  }
  #mainnav.open { transform: translateY(0); }
  #mainnav .nav-btn {
    flex: none; width: 100%; flex-direction: row; justify-content: flex-start;
    gap: 12px; padding: 10px 12px; font-size: 15px;
    border-radius: 10px; text-align: left;
  }
  #mainnav .nav-btn.active { background: #4a3421; border-color: transparent; }
  #mainnav .nav-ico { font-size: 20px; }
  .village-modal-grid { grid-template-columns: 1fr; }
  #modal .m-row { align-items:flex-start; flex-wrap:wrap; padding:9px 0; border-bottom:1px solid rgba(138,106,58,.26); }
  #modal .m-row > span { width:100%; font-size:14px; }
  #modal .troop-picker { width:100%; justify-content:flex-end; margin-top:5px; }
  #modal .troop-picker input[type="number"] { width:76px; font-size:16px; }
  .map-frame { padding: 8px; }
  .map-detail { min-width: 100%; }

  #menu-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 14px; top: 14px; z-index: 25;
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(#6b4a1f, #4a3318);
    border: 2px solid var(--gold); color: var(--gold1);
    font-size: 24px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.55);
  }
  #menu-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.55); z-index: 24;
  }
  #toasts { left: 12px; max-width: none; }
  .city-banner { height: 140px; }
}

/* ---------- vitória / ranking / relatórios / aliança ---------- */

.victory-banner {
  background: linear-gradient(135deg, #3a2310, #6b4a1f);
  border: 1px solid var(--gold2);
  color: var(--gold1);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}
.victory-banner.won {
  background: linear-gradient(135deg, #3d2a10, #8a6a20);
  color: #ffe9a8;
  font-weight: 600;
  border-color: #ffd75e;
}

.rank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rank-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.rank-table th, .rank-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.rank-table th { color: var(--gold1); font-weight: 600; font-size: 12px; letter-spacing: .5px; }
.tag-chip {
  display: inline-block; background: rgba(159, 210, 242, .12);
  border: 1px solid rgba(159, 210, 242, .4); color: #9fd2f2;
  border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 600;
}

.report-card.rep-win { border-left: 3px solid #6fbf73; }
.report-card.rep-lose { border-left: 3px solid #c0605a; }

.tile.camp { outline: 2px solid rgba(255, 215, 94, .55); }
.camp-ico { font-size: 14px; line-height: 1; }

.msg.sys { color: var(--gold1); font-style: italic; }
.msg.sys b { color: var(--gold2); }

@media (max-width: 760px) {
  .rank-grid { grid-template-columns: 1fr; }
}

/* ---------- áudio & simulador & mapa melhorias ---------- */
.sound-btn {
  font-size: 15px;
  padding: 2px 8px;
  min-width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.map-jump-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, .45);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 94, .25);
  margin: 6px 0 10px;
  flex-wrap: wrap;
}
.map-jump-bar label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gold1);
  font-weight: 600;
}
.map-jump-bar input[type="number"] {
  width: 58px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, .6);
  border: 1px solid rgba(255, 215, 94, .35);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  text-align: center;
}
.map-bookmarks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-left: auto;
}
.btn-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 215, 94, .12);
  border: 1px solid rgba(255, 215, 94, .35);
  color: var(--gold2);
  cursor: pointer;
}
.btn-pill:hover {
  background: rgba(255, 215, 94, .28);
}

.sim-container { display: flex; flex-direction: column; gap: 14px; }
.sim-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 680px) { .sim-cols { grid-template-columns: 1fr; } }
.sim-card {
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 215, 94, .25);
  border-radius: 10px;
  padding: 12px;
}
.sim-card h3 {
  font-size: 15px;
  color: var(--gold2);
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 215, 94, .15);
  padding-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  font-size: 13px;
}
.sim-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sim-input {
  width: 68px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, .6);
  border: 1px solid rgba(255, 215, 94, .3);
  border-radius: 4px;
  color: #fff;
  text-align: center;
  font-size: 12px;
}
.sim-select {
  padding: 4px 8px;
  background: #2b1d10;
  border: 1px solid rgba(255, 215, 94, .3);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
}
.sim-res-banner {
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
  font-size: 15px;
  font-weight: bold;
  margin: 10px 0;
}
.sim-win {
  background: rgba(46, 125, 50, .35);
  border: 1px solid #4caf50;
  color: #a5d6a7;
}
.sim-lose {
  background: rgba(198, 40, 40, .35);
  border: 1px solid #f44336;
  color: #ef9a9a;
}
.sim-power-bar {
  height: 14px;
  background: #222;
  border-radius: 7px;
  overflow: hidden;
  display: flex;
  margin: 8px 0;
  border: 1px solid rgba(255, 255, 255, .1);
}
.sim-bar-att { background: #4caf50; height: 100%; transition: width .3s; }
.sim-bar-def { background: #f44336; height: 100%; transition: width .3s; }
.sim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}
.sim-table th, .sim-table td {
  padding: 5px 6px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .1);
}
.sim-table th { background: rgba(0, 0, 0, .4); color: var(--gold1); }

/* ---------- minimapa & radar do reino & heráldica ---------- */
@media (min-width: 960px) {
  .map-modal-card .map-wrap {
    display: grid !important;
    grid-template-columns: 1fr 340px !important;
    gap: 16px !important;
    align-items: start !important;
  }
}

.minimap-box {
  background: rgba(20, 12, 6, 0.7);
  border: 1px solid rgba(184, 134, 11, 0.45);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  margin-bottom: 12px;
}
.minimap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--gold2);
  margin-bottom: 6px;
  font-weight: bold;
}
.minimap-coords {
  color: #eeddb0;
  font-size: 11px;
}
#minimap-canvas {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1;
  border: 2px solid #8a6a3a;
  border-radius: 6px;
  cursor: crosshair;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .6);
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
}
.minimap-legend {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 10px;
  color: #eeddb0;
  margin-top: 6px;
  flex-wrap: wrap;
}
.dot-lg {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.radar-container {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(112, 78, 35, 0.35);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}
.radar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.radar-head h3 {
  font-size: 13px;
  color: #5a3910;
  margin: 0;
  font-weight: bold;
}
.radar-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.radar-filters .btn-pill.active {
  background: var(--wood);
  color: var(--gold2);
  border-color: var(--gold2);
  font-weight: bold;
}
.radar-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.radar-card {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid #c8b080;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 11px;
}
.radar-card.radar-ally {
  border-left: 3px solid #3498db;
  background: rgba(230, 245, 255, 0.55);
}
.radar-header {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}
.radar-name {
  color: #3b2a1a;
  font-size: 12px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.radar-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6b5433;
  margin: 3px 0 5px;
  font-size: 11px;
}
.radar-dist {
  color: #5a3910;
  font-weight: bold;
}
.radar-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.radar-empty {
  font-size: 11px;
  color: #6b5433;
  font-style: italic;
  text-align: center;
  padding: 10px 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: bold;
  white-space: nowrap;
}
.status-pill.status-on {
  background: rgba(46, 204, 113, 0.22);
  color: #1e824c;
  border: 1px solid #27ae60;
}
.status-pill.status-today {
  background: rgba(241, 196, 15, 0.22);
  color: #8e7000;
  border: 1px solid #d4ac0d;
}
.status-pill.status-off {
  background: rgba(149, 165, 166, 0.22);
  color: #7f8c8d;
  border: 1px solid #bdc3c7;
}

/* Heráldica e Capitais nos Tiles do Mapa */
.tile.cap-enemy {
  outline: 2px solid #c0392b;
  outline-offset: -2px;
  box-shadow: inset 0 0 10px rgba(192, 57, 43, 0.7);
}
.tile.cap-ally {
  outline: 2px solid #2980b9;
  outline-offset: -2px;
  box-shadow: inset 0 0 10px rgba(41, 128, 185, 0.7);
}
.tile.cap-mine {
  outline: 2px solid #f1c40f;
  outline-offset: -2px;
  box-shadow: inset 0 0 12px rgba(241, 196, 15, 0.75);
}
.cap-crown {
  position: absolute;
  top: 1px;
  right: 1px;
  font-size: 9px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8));
}
.tile-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 8px;
  line-height: 10px;
  background: rgba(0, 0, 0, .75);
  color: #ffd75e;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1px;
  pointer-events: none;
}
.tile-online-dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 5px #2ecc71;
  pointer-events: none;
  animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.rank-me {
  background: rgba(255, 215, 94, 0.15) !important;
}
.btn-pill.danger {
  color: #b03a2e;
  border-color: rgba(176, 58, 46, 0.4);
  background: rgba(176, 58, 46, 0.1);
}
.btn-pill.danger:hover {
  background: rgba(176, 58, 46, 0.25);
}

