.castle-view { min-width: 0; }
.castle-header-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.castle-stat-strip { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)); gap:8px; margin-bottom:10px; }
.castle-stat-strip > div { border:1px solid #6f6044; border-radius:8px; background:linear-gradient(#343a35,#202721); padding:8px 10px; box-shadow:inset 0 1px #ffffff15; }
.castle-stat-strip span { display:block; color:#bdc6b8; font-size:11px; }
.castle-stat-strip strong { display:block; margin-top:2px; color:#f4d98d; font-size:15px; }
.castle-mode-banner { background:#73521f; border:1px solid #dcae4e; color:#fff4d0; padding:9px 12px; border-radius:8px 8px 0 0; text-align:center; font-weight:800; }
.castle-mode-banner button { margin-left:12px; background:#2f2517; border:1px solid #d6b066; color:#fff; border-radius:5px; padding:4px 10px; cursor:pointer; }
.castle-world-shell { position:relative; border:2px solid #6f6044; border-radius:12px; overflow:hidden; background:#131914; box-shadow:0 14px 36px #0008; }
.castle-world-viewport { height:650px; overflow:auto; scrollbar-color:#85714b #1b211d; scrollbar-width:thin; }
.castle-world { width:calc(var(--castle-grid) * var(--castle-tile)); height:calc(var(--castle-grid) * var(--castle-tile)); position:relative; overflow:hidden; background:#79a34e; isolation:isolate; }
.castle-ground { position:absolute; inset:0; z-index:-10; background:
  radial-gradient(circle at 15% 18%,#a4c86d 0 2px,transparent 3px),
  radial-gradient(circle at 72% 34%,#688d43 0 2px,transparent 3px),
  radial-gradient(circle at 35% 80%,#8fb45b 0 3px,transparent 4px),
  repeating-linear-gradient(15deg,#7ea850 0 44px,#83ac55 44px 88px,#789f4c 88px 132px);
  background-size:70px 70px,85px 85px,110px 110px,auto; }
.castle-ground::before { content:""; position:absolute; inset:0; background:radial-gradient(ellipse at center,transparent 35%,#23371d55 100%); }
.castle-river { position:absolute; z-index:-8; left:-120px; top:-78px; width:1200px; height:135px; transform:rotate(-9deg); border-radius:50%; background:linear-gradient(#74cce0,#3f9db5 45%,#24788e); box-shadow:0 0 0 8px #bb9e5c66, inset 0 5px 12px #d7f7ff77; opacity:.9; }
.castle-road { position:absolute; z-index:-7; background:#c7ae70; border:5px solid #927d4f; opacity:.72; border-radius:50%; }
.road-a { width:760px; height:95px; left:95px; top:430px; transform:rotate(8deg); }
.road-b { width:95px; height:700px; left:435px; top:170px; transform:rotate(-5deg); }
.castle-ground-tile { position:absolute; left:calc(var(--tx) * var(--castle-tile)); top:calc(var(--ty) * var(--castle-tile)); width:var(--castle-tile); height:var(--castle-tile); border:1px solid #d6e8aa16; background:#d7efa20a; color:transparent; padding:0; cursor:pointer; z-index:1; transition:.12s; }
.castle-ground-tile span { display:none; }
.castle-ground-tile.unlocked:hover { z-index:4; background:#fff48b35; border-color:#ffeb8fbb; color:#fff; box-shadow:inset 0 0 0 2px #604b23; }
.castle-ground-tile.unlocked:hover span { display:block; font-size:22px; text-shadow:0 2px 2px #000; }
.castle-ground-tile.locked { background:#1e2a1d88; border-color:#18201655; cursor:not-allowed; filter:saturate(.4); }
.castle-ground-tile.locked span { display:block; opacity:.22; font-size:13px; }
.castle-ground-tile.occupied-start:hover { background:#ffffff12; }
.castle-wall { position:absolute; z-index:12; background:linear-gradient(#a9a48c,#77745f 58%,#504d3d); border:2px solid #403c2e; box-shadow:0 5px 8px #0008,inset 0 4px #d9d4bc; pointer-events:none; }
.castle-wall::before { content:""; position:absolute; inset:-8px 0 auto 0; height:12px; background:repeating-linear-gradient(90deg,#aaa58e 0 16px,transparent 16px 23px); filter:drop-shadow(0 2px #4f4b3b); }
.castle-wall-top,.castle-wall-bottom { height:18px; }
.castle-wall-left,.castle-wall-right { width:18px; }
.castle-wall-left::before,.castle-wall-right::before { inset:0 auto 0 -8px; width:12px; height:auto; background:repeating-linear-gradient(0deg,#aaa58e 0 16px,transparent 16px 23px); }
.castle-tower { position:absolute; width:52px; height:52px; border-radius:50%; z-index:15; background:radial-gradient(circle at 45% 38%,#c0baa0 0 25%,#77725d 27% 62%,#424033 64%); border:3px solid #393629; box-shadow:0 7px 10px #0009,inset 0 4px #ddd8bf; pointer-events:none; }
.castle-tower::before { content:""; position:absolute; inset:-7px; border:6px dashed #9d9880; border-radius:50%; }
.castle-gate { position:absolute; z-index:18; width:84px; height:42px; border:3px solid #3e3525; border-radius:10px 10px 2px 2px; background:repeating-linear-gradient(90deg,#5e3d21 0 8px,#3d2716 8px 11px); color:#e6c46d; box-shadow:0 8px 10px #0009; cursor:pointer; font-size:18px; }
.castle-gate:hover { filter:brightness(1.25); }
.castle-building { position:absolute; left:calc(var(--cx) * var(--castle-tile) + 3px); top:calc(var(--cy) * var(--castle-tile) + 3px); width:calc(var(--cw) * var(--castle-tile) - 6px); height:calc(var(--ch) * var(--castle-tile) - 6px); z-index:9; border:0; background:transparent; cursor:pointer; padding:0; color:#261b0d; transition:transform .15s,filter .15s; }
.castle-building:hover { transform:translateY(-5px) scale(1.025); filter:brightness(1.12); z-index:20; }
.castle-building-shadow { position:absolute; left:10%; right:6%; bottom:4px; height:18%; border-radius:50%; background:#0d160c77; filter:blur(3px); }
.castle-building-art { position:absolute; inset:5px 6px 22px; display:flex; align-items:center; justify-content:center; border:3px solid #5d4527; border-radius:9px 9px 5px 5px; background:linear-gradient(150deg,#d2ad6a,#a07139 48%,#684524 50%); box-shadow:0 7px 9px #0008,inset 0 3px #f3d59b; overflow:hidden; }
.castle-building-art::before { content:""; position:absolute; left:10%; right:10%; top:-6px; height:36%; transform:skewX(-20deg); background:repeating-linear-gradient(90deg,#8b3423 0 15px,#b8492e 15px 28px); border:2px solid #59261d; box-shadow:0 4px 4px #0005; }
.castle-building-icon { position:relative; z-index:2; font-size:clamp(27px,3.1vw,46px); filter:drop-shadow(0 3px 1px #fff5) drop-shadow(0 5px 3px #0008); }
.castle-building-label { position:absolute; left:2px; right:2px; bottom:0; min-height:25px; display:flex; justify-content:center; align-items:center; gap:5px; border:1px solid #43321e; border-radius:4px; background:#ead09c; box-shadow:0 2px 4px #0007; font-size:10px; line-height:1; padding:2px; }
.castle-building-label strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.castle-building-label em { font-style:normal; color:#fff0c2; background:#3d2c18; border-radius:7px; padding:2px 5px; white-space:nowrap; }
.castle-building-keep .castle-building-art { background:linear-gradient(145deg,#c9c5b4,#827d69 60%,#575343); border-color:#4a4639; }
.castle-building-keep .castle-building-art::before { height:25%; background:repeating-linear-gradient(90deg,#777262 0 18px,#aaa594 18px 30px); }
.castle-building-watchtower .castle-building-label,.castle-building-decoration .castle-building-label { font-size:8px; }
.castle-building-watchtower .castle-building-art,.castle-building-decoration .castle-building-art { inset:2px 2px 18px; }
.castle-building-decoration .castle-building-art { background:radial-gradient(circle,#d9d18d,#6e8c40 70%); border-radius:50%; }
.castle-building-decoration .castle-building-art::before { display:none; }
.castle-building-level-4 .castle-building-art,.castle-building-level-5 .castle-building-art,.castle-building-level-6 .castle-building-art { box-shadow:0 7px 9px #0008,inset 0 3px #f3d59b,0 0 0 2px #b3aa8a; }
.castle-building-level-7 .castle-building-art,.castle-building-level-8 .castle-building-art,.castle-building-level-9 .castle-building-art,.castle-building-level-10 .castle-building-art { box-shadow:0 7px 9px #0008,inset 0 3px #fff2c5,0 0 0 3px #d2a62c; }
.castle-building-timer { position:absolute; left:8px; right:8px; top:42%; z-index:4; background:#121212dd; color:#fff; border-radius:5px; padding:5px; font-size:10px; }
.castle-building.is-building .castle-building-art { filter:grayscale(.4); }
.castle-building.is-building::after { content:"🚧"; position:absolute; z-index:5; right:6px; top:4px; font-size:20px; }
.castle-building.is-burning::after { content:"🔥"; position:absolute; z-index:5; right:4px; top:0; font-size:25px; animation:castle-fire .55s alternate infinite; }
.castle-flag { position:absolute; z-index:5; left:50%; top:-14px; width:3px; height:30px; background:#332414; }
.castle-flag::after { content:""; position:absolute; left:3px; top:0; width:25px; height:13px; background:#b21e2b; clip-path:polygon(0 0,100% 15%,72% 100%,0 82%); animation:castle-flag 1.2s ease-in-out infinite alternate; transform-origin:left; }
.castle-smoke { position:absolute; z-index:6; width:14px; height:14px; border-radius:50%; background:#e7e4d0aa; filter:blur(2px); left:65%; top:6px; animation:castle-smoke 3s linear infinite; pointer-events:none; }
.castle-smoke-b { animation-delay:1.4s; left:70%; }
.castle-inhabitant { position:absolute; z-index:16; font-size:19px; filter:drop-shadow(0 2px 1px #0007); animation:castle-walk 9s ease-in-out infinite alternate; pointer-events:none; }
.inhabitant-b { animation-duration:12s; animation-direction:alternate-reverse; }
.inhabitant-c { animation-duration:15s; }
.castle-bird { position:absolute; z-index:25; font-size:28px; color:#202b20; animation:castle-bird 6s linear infinite; pointer-events:none; }
.bird-b { animation-delay:2.5s; }
.castle-legend { position:absolute; right:12px; bottom:12px; z-index:40; width:240px; display:flex; flex-direction:column; gap:3px; border:1px solid #735f39; border-radius:8px; background:#1c211ddb; color:#d9dece; padding:9px 11px; font-size:10px; pointer-events:none; backdrop-filter:blur(5px); }
.castle-legend b { color:#f2d58c; font-size:12px; }
.castle-build-menu { max-height:66vh; overflow:auto; padding-right:5px; }
.castle-build-category { border:1px solid #465149; border-radius:8px; margin-bottom:10px; overflow:hidden; }
.castle-build-category h4 { margin:0; padding:8px 10px; color:#f0d58f; background:#2d3730; }
.castle-build-choice { display:grid; grid-template-columns:48px 1fr auto; gap:10px; align-items:center; padding:9px; border-top:1px solid #3b443e; background:#202720; }
.castle-build-choice-icon { font-size:30px; text-align:center; }
.castle-build-choice-main { min-width:0; }
.castle-build-choice-main strong,.castle-build-choice-main small,.castle-build-choice-main span { display:block; }
.castle-build-choice-main small { color:#aeb7ad; margin:2px 0 5px; }
.castle-build-choice-main span { color:#c8b98e; font-size:10px; }
.castle-expansion-preview { display:flex; align-items:center; justify-content:center; gap:22px; margin:15px 0; }
.castle-expansion-preview div { min-width:130px; border:1px solid #625538; border-radius:8px; background:#262c26; padding:12px; text-align:center; }
.castle-expansion-preview strong { display:block; color:#f2d58d; font-size:22px; margin-top:4px; }
.castle-expansion-preview > span { font-size:26px; color:#d8ba6d; }
.castle-fortification-list { display:flex; flex-direction:column; gap:8px; }
.castle-fortification-row { display:grid; grid-template-columns:48px 1fr auto; align-items:center; gap:10px; border:1px solid #4b554e; border-radius:8px; background:#222923; padding:10px; }
.castle-fortification-icon { font-size:31px; text-align:center; }
.castle-fortification-row strong,.castle-fortification-row small { display:block; }
.castle-fortification-row small { color:#abb4ab; }
@keyframes castle-smoke { from { transform:translateY(0) scale(.7); opacity:.8; } to { transform:translate(12px,-48px) scale(1.8); opacity:0; } }
@keyframes castle-fire { from { transform:scale(.85) rotate(-5deg); } to { transform:scale(1.12) rotate(5deg); } }
@keyframes castle-flag { from { transform:scaleX(.78) skewY(-4deg); } to { transform:scaleX(1.05) skewY(5deg); } }
@keyframes castle-walk { from { transform:translateX(-35px); } to { transform:translateX(45px); } }
@keyframes castle-bird { from { transform:translateX(-90px) translateY(0); } to { transform:translateX(130px) translateY(-18px); } }
@media (max-width:1280px) { .castle-stat-strip { grid-template-columns:repeat(3,1fr); } .castle-world-viewport { height:580px; } }
@media (max-width:900px) { .castle-stat-strip { grid-template-columns:repeat(2,1fr); } .castle-build-choice,.castle-fortification-row { grid-template-columns:42px 1fr; } .castle-build-choice .action-btn,.castle-fortification-row .action-btn { grid-column:1/-1; } }

/* v0.1.96 — Zona de clique mais precisa dos edifícios.
   A interação passa a usar uma zona central menor, para edifícios próximos não se sobreporem tanto. */
.castle-building { pointer-events:none; }
.castle-building .castle-building-click-zone {
  position:absolute;
  left:13%;
  right:13%;
  top:9%;
  bottom:18%;
  z-index:30;
  display:block;
  border:0;
  border-radius:12px;
  background:transparent;
  pointer-events:auto;
  cursor:pointer;
}
.castle-building.castle-building-watchtower .castle-building-click-zone,
.castle-building.castle-building-decoration .castle-building-click-zone {
  left:20%;
  right:20%;
  top:12%;
  bottom:20%;
}
.castle-building .castle-building-shadow,
.castle-building .castle-building-art,
.castle-building .castle-building-label,
.castle-building .castle-building-timer,
.castle-building .castle-building-level-badge,
.castle-building .castle-smoke,
.castle-building .castle-flag { pointer-events:none; }

