/* Manual (manual.php) — standalone reference page.
   ManualCtrl outputs <body class="manual"> directly (no redesign shell), so it
   only loads the legacy gpack theme. ManualCtrl injects tokens.css + this sheet
   via headExtraStyles; everything here is scoped to body.manual and overrides
   the legacy theme with !important. */

body.manual {
  position: relative;
  /* gpack sets body.manual { width:474px; float:left } — that floated, narrow
     body breaks the full-width layout and swallows clicks; force a normal block */
  width: auto !important;
  float: none !important;
  display: block !important;
  overflow-x: hidden;
  margin: 0 !important;
  padding: 30px 16px 56px !important;
  min-height: 100vh;
  background: transparent !important;
  color: var(--cor-panel-text, #c9d2e0) !important;
  font-family: var(--cor-font-body, "Source Sans Pro"), "Segoe UI", sans-serif !important;
  -webkit-font-smoothing: antialiased;
}
/* Same SIMPLE BLURRED Game-BG as the support page. Put on `html` (behind the now-
   transparent body) so the body's own background can't cover it. manual.css only
   loads on manual.php, so bare html rules are safe/scoped in practice. */
html {
  min-height: 100%;
  background: #0a0d14 !important;
}
html::before {
  content: "";
  position: fixed;
  inset: -40px;
  z-index: -2;
  background: url('../../img/Game-BG.jpeg') center center / cover no-repeat;
  filter: blur(9px) brightness(0.66) saturate(1.05);
  transform: scale(1.06);
  pointer-events: none;
}
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 80% at 50% 40%, rgba(8, 10, 16, 0.22) 0%, rgba(5, 7, 12, 0.6) 100%),
    linear-gradient(180deg, rgba(6, 8, 13, 0.26) 0%, rgba(4, 6, 10, 0.48) 100%);
  pointer-events: none;
}
/* keep the reference panels above the fixed background */
body.manual #troops,
body.manual #buildings,
body.manual #anwersQuestionMark,
body.manual #content,
body.manual .contentContainer,
body.manual .midContainer {
  position: relative;
  z-index: 1;
}

/* Centre + panelise the two reference sections */
body.manual #troops,
body.manual #buildings {
  max-width: 900px;
  margin: 0 auto 22px !important;
  padding: 18px 24px 24px !important;
  background: rgba(18, 22, 31, 0.92) !important;
  border: 1px solid rgba(201, 162, 78, 0.18) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.5) !important;
}

/* Section titles ("Units", "Buildings") */
body.manual h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid rgba(201, 162, 78, 0.22) !important;
  color: var(--cor-gold-bright, #f0d080) !important;
  font-family: var(--cor-font-display, "Cinzel"), serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: none !important;
  text-shadow: none !important;
}
body.manual h3 img {
  flex: 0 0 auto;
  transform: scale(0.9);
}

/* Tab strip (race tabs / Infrastructure-Military-Resources) -> pills */
body.manual .contentNavi.tabNavi {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}
body.manual .contentNavi.tabNavi .container {
  float: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
body.manual .contentNavi.tabNavi .background-start,
body.manual .contentNavi.tabNavi .background-end {
  display: none !important;
}
body.manual .contentNavi.tabNavi .content {
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border: none !important;
  height: auto !important;
  width: auto !important;
}
body.manual .contentNavi.tabNavi a.tabItem {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 6px !important;
  background: rgba(0, 0, 0, 0.3) !important;
  color: #8a96a8 !important;
  font-family: var(--cor-font-body, sans-serif) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none !important;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
body.manual .contentNavi.tabNavi .container.active a.tabItem {
  color: #1a1208 !important;
  background: var(--cor-btn-gold-solid, #c9a24e) !important;
  border-color: var(--cor-gold-bright, #f0d080) !important;
}
body.manual .contentNavi.tabNavi a.tabItem:hover {
  color: var(--cor-gold, #d4ad5a) !important;
  border-color: rgba(201, 162, 78, 0.5) !important;
}

/* Link lists -> responsive grid of dark chips */
body.manual #troops ul:not(.hide),
body.manual #buildings ul:not(.hide) {
  list-style: none !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.manual ul.hide {
  display: none !important;
}
body.manual #troops li,
body.manual #buildings li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  padding: 8px 10px !important;
  background: rgba(0, 0, 0, 0.22) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 8px !important;
  list-style: none !important;
}
body.manual #troops li:hover,
body.manual #buildings li:hover {
  border-color: rgba(201, 162, 78, 0.35) !important;
  background: rgba(201, 162, 78, 0.06) !important;
}
/* the buildings loop emits a stray trailing empty <li> per row — hide it */
body.manual #buildings li:empty {
  display: none !important;
}
body.manual li img {
  flex: 0 0 auto;
}
/* Building icons: real gpack building illustrations (120px) scaled to icon size,
   so buildings match the units, which already have sprite icons. */
body.manual #buildings li img.crz-bicon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}
body.manual #buildings h3 img.crz-bicon--h {
  width: 26px;
  height: 26px;
  object-fit: contain;
  transform: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}
body.manual li a {
  color: var(--cor-panel-text, #c9d2e0) !important;
  text-decoration: none !important;
  font-size: 13px !important;
  line-height: 1.3;
}
body.manual li a:hover {
  color: var(--cor-gold-bright, #f0d080) !important;
}

/* "More in answers" question-mark link */
body.manual #anwersQuestionMark {
  max-width: 900px;
  margin: 6px auto 0 !important;
  text-align: right;
}

body.manual a {
  color: var(--cor-panel-accent-blue, #7fb2e6);
}
body.manual a:hover {
  color: var(--cor-gold-bright, #f0d080);
}

/* ============================================================
   Detail pages (manual.php?typ=1&s=… units / ?typ=4&gid=… buildings)
   — same treatment as support: centred dark card on the blurred bg.
   ============================================================ */
body.manual .cor-manual-detail,
body.manual .answers {
  position: relative;
  z-index: 1;
}
body.manual .cor-manual-detail {
  max-width: 620px;
  margin: 0 auto !important;
  padding: 24px 30px 28px !important;
  background: rgba(18, 22, 31, 0.94) !important;
  border: 1px solid rgba(201, 162, 78, 0.2) !important;
  border-radius: 16px !important;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55) !important;
}
/* back-to-overview link */
body.manual .cor-manual-detail .manualBack {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--cor-panel-accent-blue, #7fb2e6) !important;
  font-weight: 600;
  text-decoration: none !important;
}
body.manual .cor-manual-detail .manualBack:hover {
  color: var(--cor-gold-bright, #f0d080) !important;
}
/* title + icon */
body.manual .cor-manual-detail h1.titleInHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px !important;
  padding: 0 0 12px !important;
  background: none !important;
  border: none !important;
  border-bottom: 1px solid rgba(201, 162, 78, 0.22) !important;
  color: var(--cor-gold-bright, #f0d080) !important;
  font-family: var(--cor-font-display, "Cinzel"), serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
  text-transform: none !important;
}
body.manual .cor-manual-detail h1 .tribe {
  color: var(--cor-panel-text-muted, #9aa6b8);
  font-size: 14px;
  font-weight: 400;
}
body.manual .cor-detail-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}
/* building illustration (real gpack art) */
body.manual .cor-detail-illus,
body.manual .cor-manual-detail .bigUnitSection {
  float: right;
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin: 0 0 12px 18px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}
/* Legacy purge batch A (V6, GD 2026-10-24): the unit picture kept the legacy 140 x 205 size inside its 128 px float and
   spilled over the cost row; it now fills its frame, and the stat cards flow beside the float (no overlap). */
body.manual .cor-manual-detail .bigUnitSection img.unitSection {
  display: block;
  width: 128px !important;
  height: 128px !important;
  border-radius: 12px;
}
body.manual .cor-manual-detail .boxes.boxesColor { display: flow-root !important; }
/* body copy */
body.manual .cor-manual-detail p,
body.manual .cor-manual-detail .description,
body.manual .cor-manual-detail #t_desc {
  color: var(--cor-panel-text, #c9d2e0) !important;
  font-size: 14px;
  line-height: 1.6;
}
body.manual .cor-manual-detail .costsHeader b,
body.manual .cor-manual-detail #prereqs b {
  color: var(--cor-gold, #d4ad5a) !important;
}
body.manual .cor-manual-detail .inlineIconList {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 6px 0;
}
body.manual .cor-manual-detail .inlineIcon.duration {
  margin-top: 8px;
}
body.manual .cor-manual-detail #prereqs {
  margin-top: 18px;
}
body.manual .cor-manual-detail #prereqs a {
  color: var(--cor-panel-accent-blue, #7fb2e6) !important;
}
/* unit-detail rounded gpack boxes -> flat dark cards */
body.manual .cor-manual-detail .boxes.boxesColor {
  float: none !important;
  width: auto !important;
  margin: 14px 0 !important;
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.22) !important;
  border: 1px solid rgba(201, 162, 78, 0.16) !important;
  border-radius: 12px !important;
}
body.manual .cor-manual-detail .boxes.boxesColor > [class^="boxes-"]:not(.boxes-contents) {
  display: none !important;
}
body.manual .cor-manual-detail .boxes-contents {
  display: block !important;
  padding: 8px 12px !important;
  background: none !important;
}
body.manual .cor-manual-detail table {
  width: 100% !important;
  background: transparent !important;
  border: none !important;
}
body.manual .cor-manual-detail table th,
body.manual .cor-manual-detail table td {
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 8px 10px !important;
  background: transparent !important;
  color: var(--cor-panel-text, #c9d2e0) !important;
}
body.manual .cor-manual-detail table th {
  color: var(--cor-panel-text-muted, #9aa6b8) !important;
  text-align: left !important;
  font-weight: 600;
}
/* answers link, centred under the card */
body.manual .answers {
  max-width: 620px;
  margin: 12px auto 0 !important;
  text-align: right;
}
body.manual .answers .a.arrow {
  color: var(--cor-panel-accent-blue, #7fb2e6) !important;
  text-decoration: none;
}
body.manual .answers .a.arrow:hover {
  color: var(--cor-gold-bright, #f0d080) !important;
}

/* Arabic: the standalone manual page now carries body.rtl + dir="rtl"; mirror the
   LTR-only placements above (illustration float, table headers, answers link). */
body.manual.rtl .cor-detail-illus,
body.manual.rtl .cor-manual-detail .bigUnitSection {
  float: left;
  margin: 0 18px 12px 0;
}
body.manual.rtl .cor-manual-detail table th {
  text-align: right !important;
}
body.manual.rtl .answers {
  text-align: left;
}

/* L5 (GD 2026-10-19): the two index panels were floated by the gpack (narrow, side by side at the top left, and
   490 px wide on a 390 px phone): one centred column; on phones 44 px rows and tabs that wrap. */
body.manual #troops,
body.manual #buildings {
  float: none !important;
  width: auto !important;
  box-sizing: border-box;
}
/* the gpack floats the lists too (221 px, left): they spilled out of their panels once the panels stopped floating */
body.manual #troops ul,
body.manual #buildings ul { float: none !important; width: auto !important; }
body.manual #troops ul li,
body.manual #buildings ul li { float: none !important; width: auto !important; min-width: 0; }
body.manual #troops li a,
body.manual #buildings li a { color: #f3e6c4 !important; font-weight: 700; text-decoration: none !important; }
@media (max-width: 720px) {
  body.manual { padding: 16px 12px 40px !important; }
  body.manual #troops,
  body.manual #buildings { padding: 14px 12px 16px !important; }
  body.manual #troops ul:not(.hide),
  body.manual #buildings ul:not(.hide) { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; }
  body.manual #troops li,
  body.manual #buildings li { min-height: 44px; box-sizing: border-box; font-size: 14px; }
  body.manual #troops li a,
  body.manual #buildings li a { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
  body.manual .contentNavi.tabNavi a.tabItem { min-height: 40px; padding: 0 14px !important; font-size: 12.5px !important; }
}
