:root{
  /* لوحة ألوان مستوحاة من الخريطة والدرع */
  --bg:#0f1115;
  --panel:#1a1e25;
  --line:#2a2f39;
  --text:#f5f6f7;
  --muted:#c7c9ce;
  --gold:#d7b24a;
  --gold-2:#b8922a;
  --steel:#6f7684;
  --teal:#2e7b9f;
  --hp:#c65858;
  --en:#4aa1d9;
  --green:#65c97a;
  --shadow: 0 10px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Cairo", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 80% -20%, #16202a 0%, var(--bg) 55%);
  color:var(--text);
}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 18px;
  background:linear-gradient(180deg, #151922, #12161e);
  border-bottom:1px solid #202532;
  position:sticky; top:0; z-index:10;
}
.brand{ font-weight:800; letter-spacing:.5px; }
.resources{ display:flex; gap:10px; align-items:center; }
.res-chip{
  display:flex; align-items:center; gap:6px; padding:6px 10px;
  background:linear-gradient(180deg, #1c212c, #171b24); border:1px solid #2c3340;
  border-radius:999px; box-shadow:var(--shadow); color:var(--muted); font-weight:600; font-size:14px;
}
.res-chip svg{ width:18px; height:18px; color:var(--gold) }

.layout{
  display:grid; gap:16px; padding:16px;
  grid-template-columns: 420px minmax(0, 1fr);
}
.panel{
  background:linear-gradient(180deg, #1b2029 0%, #151a22 100%);
  border:1px solid var(--line); border-radius:16px; padding:14px; box-shadow:var(--shadow);
}
.panel h3{margin:0 0 8px 0}
.panel-sub{ margin-top:12px; }

.hero-card{ display:flex; gap:12px; }
.hero-img{ width:160px; height:auto; border-radius:12px; border:2px solid #2b303b; box-shadow:var(--shadow); background:#0b0d11; }
.hero-info{ flex:1; min-width:0; }
.hero-info h2{ margin:0 0 8px 0; }
.glow{ text-shadow:0 0 14px rgba(215,178,74,.25); color:var(--gold); }

.stats{ display:grid; grid-template-columns: repeat(3, 1fr); gap:8px; margin-bottom:10px; }
.stat{
  background:#12161e; border:1px solid #242a36; padding:6px 8px; border-radius:10px; display:flex; justify-content:space-between; align-items:center;
  font-weight:700; color:#d9dde6;
}
.stat span{ color:#a9afbb; font-weight:600; }

.bars{ display:grid; gap:8px; }
.bar{ display:grid; grid-template-columns: 46px 1fr auto; gap:8px; align-items:center; font-weight:700; }
.bar-track{ height:12px; background:#0f131a; border:1px solid #222836; border-radius:999px; overflow:hidden; }
.bar-fill{ height:100%; background:linear-gradient(90deg, var(--gold), var(--gold-2)); }
.bar-fill.hp{ background:linear-gradient(90deg, var(--hp), #8b2e2e); }
.bar-fill.en{ background:linear-gradient(90deg, var(--en), #256ea1); }
.bar label{ color:#9aa2b1; font-weight:700; }
.bar span{ color:#cfd3db; }

.actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.btn{
  display:inline-flex; gap:6px; align-items:center; justify-content:center;
  padding:8px 12px; border-radius:12px; background:linear-gradient(180deg, #e0b045, #b78d2e);
  color:#12141b; font-weight:900; border:1px solid #7b6324; cursor:pointer; box-shadow:var(--shadow);
}
.btn svg{ width:18px; height:18px; }
.btn.ghost{ background:linear-gradient(180deg, #202737, #181d27); color:#e7e9ee; border:1px solid #2a3342; }
.btn.small{ padding:6px 10px; font-size:14px; }

.log{
  background:linear-gradient(180deg, #0f131a, #0c0f15);
  border:1px solid #1f2632; border-radius:12px; padding:10px; height:150px; overflow:auto; color:#cfd3db;
}

.map-wrap{ position:relative; border-radius:14px; overflow:hidden; border:1px solid #2b3240; }
.map-img{ width:100%; display:block; }
.spot{
  position:absolute; transform:translate(50%,-50%);
  width:42px; height:42px; border-radius:999px; border:2px solid #2a3746;
  background: radial-gradient(70% 70% at 30% 30%, #274055, #1a2633);
  color:var(--gold); display:flex; align-items:center; justify-content:center; cursor:pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,.35), 0 0 0 2px rgba(24,30,40,.6) inset;
}
.spot:hover{ box-shadow: 0 8px 18px rgba(0,0,0,.5), 0 0 0 2px rgba(215,178,74,.35) inset; }
.spot svg{ width:22px; height:22px; }

.building-card{
  margin-top:12px; background:linear-gradient(180deg, #161b23, #12161d);
  border:1px solid #252c39; border-radius:14px; padding:12px;
}
.bc-head{ display:flex; align-items:center; justify-content:space-between; }
.bc-head h3{ margin:0; color:var(--gold); }
.close{ appearance:none; background:#1c2230; color:#e3e6ec; border:1px solid #2c3545; border-radius:8px; width:32px; height:32px; cursor:pointer; }

.bc-actions{ display:flex; gap:8px; margin-top:10px; }

/* Modal */
.modal{ position:fixed; inset:0; display:grid; place-items:center; background:rgba(0,0,0,.5); }
.modal-card{ width:min(640px, 96vw); background:linear-gradient(180deg, #171c25, #12161d); border:1px solid #2a3140; border-radius:16px; padding:12px; box-shadow:var(--shadow); }
.mc-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.enemy-line{ color:#e5e8ee; margin-bottom:8px; }
.battle-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.battle-log{ height:180px; }

/* Responsive */
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .hero-card{ flex-direction:row; }
  .hero-img{ width:140px; }
}
