/* Fortificações realistas e terreno interior — módulo visual independente */
.castle-courtyard-ground {
  position:absolute;
  display:block;
  clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);
  background:
    linear-gradient(135deg,#ffffff1d,transparent 34%,#18201320 72%),
    url('../assets/castle/courtyard_texture.jpg') center/cover no-repeat;
  filter:drop-shadow(0 12px 13px #15201675) saturate(.92) contrast(1.05);
  pointer-events:none;
}
.castle-courtyard-ground::before {
  content:"";
  position:absolute;
  inset:10px;
  clip-path:inherit;
  border:0;
  background:
    radial-gradient(ellipse at 22% 33%,#b7a06a35 0 7%,transparent 16%),
    radial-gradient(ellipse at 70% 69%,#644b2d28 0 8%,transparent 18%),
    repeating-linear-gradient(28deg,transparent 0 74px,#e4d7ad12 75px 78px,transparent 79px 150px);
  box-shadow:inset 0 0 70px #20281955;
}
.castle-courtyard-ground::after {
  content:"";
  position:absolute;
  inset:0;
  clip-path:inherit;
  background:linear-gradient(90deg,#2a321d40,transparent 12% 88%,#20281a48),linear-gradient(#eef2ce12,transparent 20% 80%,#17201638);
}
.castle-courtyard-inner { position:absolute; inset:22px; clip-path:inherit; box-shadow:inset 0 0 0 2px #d4c79b55,inset 0 0 34px #23301e66; }
.castle-courtyard-detail { position:absolute; width:95px; height:42px; border-radius:50%; opacity:.28; background:radial-gradient(ellipse,#5e482d 0 25%,transparent 65%); filter:blur(3px); }
.castle-courtyard-detail.detail-a { left:18%; top:40%; transform:rotate(-15deg); }
.castle-courtyard-detail.detail-b { right:21%; top:28%; transform:rotate(24deg) scale(1.4); }
.castle-courtyard-detail.detail-c { left:47%; bottom:19%; transform:rotate(6deg) scale(.8); }

.castle-iso-tile.unlocked { background:transparent!important; outline-color:transparent!important; }
.castle-iso-tile.unlocked:hover { background:#f7d66a3b!important; outline:2px solid #f6d882b8!important; }
.castle-iso-tile.locked { background:#1720191f!important; outline-color:transparent!important; }
.castle-iso-road {
  background:
    linear-gradient(27deg,#7f7460aa,#c7b994c4 48%,#857966aa),
    repeating-linear-gradient(90deg,#c9bfa5 0 10px,#716b60 11px 12px,#a9a18e 13px 23px)!important;
  box-shadow:inset 0 0 7px #4a4133aa,0 2px 2px #1f261d50!important;
  opacity:.78;
}
.road-x::after,.road-y::after { display:none!important; }

.castle-real-wall {
  position:absolute;
  width:108px;
  height:90px;
  pointer-events:none;
  transform-origin:50% 72%;
}
.castle-real-wall svg { width:100%; height:100%; overflow:visible; }
.castle-real-wall.wall-y-back,.castle-real-wall.wall-x-front { transform:scaleX(-1); }
.castle-real-wall.wall-x-back,.castle-real-wall.wall-y-front { transform:none; }
.castle-real-wall.fort-level-1 { filter:saturate(.76) brightness(.82); }
.castle-real-wall.fort-level-2 { filter:saturate(.84) brightness(.9); }
.castle-real-wall.fort-level-4,.castle-real-wall.fort-level-5 { filter:contrast(1.05) saturate(.94); }
.castle-real-wall.fort-level-5 { filter:drop-shadow(0 0 3px #b7862d88) contrast(1.06); }

.castle-real-tower {
  position:absolute;
  width:170px;
  height:220px;
  pointer-events:none;
  transform-origin:50% 88%;
}
.castle-real-tower svg { width:100%; height:100%; overflow:visible; }

.castle-real-gate {
  position:absolute;
  width:220px;
  height:182px;
  border:0;
  padding:0;
  background:transparent;
  cursor:pointer;
  transform-origin:50% 88%;
  transition:filter .15s,transform .15s;
}
.castle-real-gate svg { width:100%; height:100%; overflow:visible; pointer-events:none; }
.castle-real-gate:hover { filter:brightness(1.12); transform:translateY(-5px) scale(1.025); }
.castle-real-gate:focus-visible { outline:3px solid #f1ca65; outline-offset:2px; border-radius:12px; }

.stage-1 .castle-real-wall,.stage-1 .castle-real-tower,.stage-1 .castle-real-gate { filter:saturate(.72) brightness(.8); }
.stage-4 .castle-courtyard-ground,.stage-5 .castle-courtyard-ground { filter:drop-shadow(0 13px 15px #10181188) saturate(.96) contrast(1.08); }
.stage-5 .castle-real-wall,.stage-5 .castle-real-tower,.stage-5 .castle-real-gate { filter:drop-shadow(0 0 3px #bd8b2f77) contrast(1.08); }
.castle-iso-wall-segment.castle-real-wall { clip-path:none!important; background:none!important; border:0!important; border-bottom:0!important; box-shadow:none!important; }
.castle-iso-wall-segment.castle-real-wall::before { display:none!important; }
.castle-gate.castle-real-gate { clip-path:none!important; box-shadow:none!important; color:inherit!important; font-size:0!important; }
.castle-gate.castle-real-gate::before { display:none!important; }
