/* ===================== Documentation pages (Rules, Whitepaper) ===================== */
.doc-hero { position: relative; padding: 70px 0 34px; text-align: center; overflow: hidden;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(111,76,177,.35), transparent 70%), radial-gradient(ellipse 40% 50% at 50% 10%, rgba(217,179,90,.1), transparent 70%); }
.doc-hero h1 { font-size: clamp(2.6rem, 5vw, 4.2rem); font-weight: 900; margin: .2rem 0 .6rem; }
.doc-hero p { max-width: 680px; margin: 0 auto; font-size: 1.08rem; color: #c9c3e3; }
.doc-facts { display: inline-flex; flex-wrap: wrap; justify-content: center; margin: 30px auto 0; border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(217,179,90,.25); background: linear-gradient(180deg, rgba(30,24,66,.8), rgba(10,10,30,.9)); box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.doc-facts > div { padding: 14px 26px; text-align: center; border-left: 1px solid rgba(255,255,255,.07); }
.doc-facts > div:first-child { border-left: 0; }
.doc-facts b { display: block; font-size: 1.5rem; font-weight: 900; line-height: 1.1;
  background: linear-gradient(180deg, #fff6d2, #f3d27a 45%, #c9952e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc-facts span { font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #a9a4c4; }

.doc-layout { display: grid; grid-template-columns: 230px 1fr; gap: 34px; align-items: start; margin-top: 30px; }
@media (max-width: 991px) { .doc-layout { grid-template-columns: 1fr; } .doc-toc { display: none !important; } }
.doc-toc { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 18px;
  background: rgba(14,12,36,.75); border: 1px solid rgba(255,255,255,.07); backdrop-filter: blur(6px); }
.dt-title { font-size: .68rem; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; color: #e9c46a; margin: 0 8px 8px; }
.doc-toc a:not(.btn) { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: .88rem; font-weight: 600; color: #b9b3d6; text-decoration: none; }
.doc-toc a:not(.btn) span { font-size: .7rem; font-weight: 800; color: #6f6a90; font-variant-numeric: tabular-nums; }
.doc-toc a:not(.btn):hover, .doc-toc a.active { color: #fff; background: rgba(217,179,90,.1); }
.doc-toc a.active span { color: #e9c46a; }
.dt-cta { margin-top: 12px; border-radius: 999px !important; font-weight: 800; }

.doc-body { display: flex; flex-direction: column; gap: 22px; }
.doc-sec { position: relative; scroll-margin-top: 96px; padding: 30px 32px 28px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, rgba(30,24,66,.78), rgba(10,10,30,.9)); border: 1px solid rgba(217,179,90,.18); box-shadow: 0 18px 40px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05); }
.doc-sec::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 50% 40% at 0% 0%, rgba(217,179,90,.08), transparent 70%); }
.ds-num { position: absolute; right: 26px; top: 14px; font-size: 3.6rem; font-weight: 900; line-height: 1; color: rgba(217,179,90,.1); pointer-events: none; }
.doc-sec h2 { position: relative; font-size: 1.55rem; font-weight: 900; margin: 0 0 14px; }
.doc-sec p { position: relative; color: #c3bddc; line-height: 1.65; }
.doc-sec p:last-child { margin-bottom: 0; }
.doc-sec strong { color: #fff; }
.ds-lead { font-size: 1.12rem; color: #e6e1f6 !important; }
.ds-split { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; }
@media (max-width: 767px) { .ds-split { grid-template-columns: 1fr; } }

/* tiles */
.ds-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ds-tiles.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 767px) { .ds-tiles { grid-template-columns: 1fr; } }
.ds-tiles > div { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); }
.ds-tiles i { grid-row: span 2; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-size: 1.1rem; color: #f3d27a;
  background: rgba(217,179,90,.1); border: 1px solid rgba(217,179,90,.3); }
.ds-tiles b { color: #fff; font-size: .98rem; }
.ds-tiles b em { font-style: normal; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-left: 6px; padding: 2px 8px; border-radius: 99px; color: #a9a4c4; border: 1px solid rgba(255,255,255,.15); }
.ds-tiles b em.live { color: #6fe39a; border-color: rgba(111,227,154,.4); background: rgba(111,227,154,.08); }
.ds-tiles span { font-size: .84rem; color: #a9a4c4; line-height: 1.45; }

/* objective: CP coins */
.cp-duo { display: flex; align-items: center; gap: 16px; }
.cp-duo > i { font-size: 1.6rem; color: #e9c46a; }
.cp-coin { width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 35% 30%, #fff4c2, #e9bf55 45%, #9a6a1e 85%); box-shadow: 0 0 0 3px rgba(255,244,194,.4), 0 10px 26px rgba(0,0,0,.5), 0 0 30px rgba(217,179,90,.35); }
.cp-coin b { font-size: 1.9rem; font-weight: 900; line-height: 1; color: #2a1a04; }
.cp-coin span { font-size: .7rem; font-weight: 900; letter-spacing: .14em; color: #4a3008; }
.cp-zero { background: radial-gradient(circle at 35% 30%, #c9c3e3, #5b5480 50%, #26213f 90%); box-shadow: 0 0 0 3px rgba(255,255,255,.12), 0 10px 26px rgba(0,0,0,.5); }
.cp-zero b, .cp-zero span { color: #f2eeff; }

/* field: mini board */
.mini-board { position: relative; width: 300px; padding: 16px 70px 16px 16px; border-radius: 16px; background: radial-gradient(ellipse at center, rgba(111,76,177,.25), rgba(8,8,24,.9)); border: 1px solid rgba(217,179,90,.25); }
.mb-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mb-row i { aspect-ratio: 5 / 7; border-radius: 4px; border: 1px dashed rgba(201,195,227,.35); background: rgba(255,255,255,.03); }
.mb-row.mine i { border-color: rgba(233,191,85,.55); background: rgba(217,179,90,.06); }
.mb-line { height: 1px; margin: 10px 0; background: linear-gradient(90deg, transparent, #e9bf55, transparent); }
.mb-side { position: absolute; right: 12px; bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.mb-side span { width: 48px; padding: 14px 0; border-radius: 5px; font-size: .52rem; font-weight: 800; text-align: center; line-height: 1.1; color: #e9dcb0; border: 1px solid rgba(217,179,90,.4); background: rgba(217,179,90,.08); }

/* turn: phase line */
.phase-line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: ph; }
@media (max-width: 767px) { .phase-line { grid-template-columns: 1fr 1fr; } }
.phase-line li { position: relative; padding: 18px 16px 16px; border-radius: 14px; text-align: center; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); }
.phase-line li:not(:last-child)::after { content: "\203A"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: #e9c46a; z-index: 1; }
.phase-line i { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 1.15rem; color: #1a1206; background: linear-gradient(180deg, #fff1b8, #e9bf55 55%, #c08d2c); box-shadow: 0 6px 16px rgba(217,179,90,.3); }
.phase-line b { display: block; margin: 10px 0 4px; color: #fff; font-size: 1rem; }
.phase-line span { font-size: .82rem; color: #a9a4c4; }

/* summoning: level ladder */
.lvl-ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 6px; }
@media (max-width: 767px) { .lvl-ladder { grid-template-columns: 1fr 1fr; } }
.ll-step { padding: 16px 12px; border-radius: 14px; text-align: center; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); }
.ll-step.free { border-color: rgba(111,227,154,.35); background: rgba(111,227,154,.05); }
.ll-lvl { font-weight: 900; color: #fff; }
.ll-stars { color: #f3d27a; letter-spacing: 1px; font-size: .8rem; margin: 4px 0 10px; min-height: 1.2em; }
.ll-cost { display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap; }
.ll-cost i { color: #ff8a8a; font-size: 1.05rem; }
.ll-cost span { width: 100%; font-size: .78rem; font-weight: 700; color: #c3bddc; margin-top: 4px; }
.ll-step.free .ll-cost span { color: #6fe39a; }

/* battle outcomes */
.bt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 767px) { .bt-grid { grid-template-columns: 1fr; } }
.bt { padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--bc); }
.bt p { margin: 0; font-size: .9rem; }
.bt-eq { font-weight: 900; font-size: 1.05rem; color: var(--bc2); margin-bottom: 6px; letter-spacing: .04em; }
.bt-eq b { font-size: 1.25rem; padding: 0 4px; }
.bt.win { --bc: rgba(111,227,154,.35); --bc2: #6fe39a; }
.bt.draw { --bc: rgba(201,195,227,.3); --bc2: #c9c3e3; }
.bt.lose { --bc: rgba(255,123,138,.35); --bc2: #ff7b8a; }
.bt.direct { --bc: rgba(217,179,90,.45); --bc2: #f3d27a; }

/* factions */
.fac-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 767px) { .fac-grid { grid-template-columns: 1fr; } }
.fac-tile { padding: 16px 18px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--fc) 10%, transparent), rgba(255,255,255,.02) 60%);
  border: 1px solid color-mix(in srgb, var(--fc) 35%, transparent); }
.ft-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ft-head i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--fc); background: color-mix(in srgb, var(--fc) 15%, #0b0a1f); border: 1px solid color-mix(in srgb, var(--fc) 55%, transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--fc) 35%, transparent); }
.ft-head b { font-size: 1.05rem; color: color-mix(in srgb, var(--fc) 55%, #fff); }
.ft-head span { margin-left: auto; font-size: .72rem; font-weight: 700; color: #a9a4c4; }
.fac-tile p { margin: 0; font-size: .86rem; }

/* rarity table */
.rar-table { border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.rt-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; padding: 12px 18px; font-size: .9rem; color: #c3bddc; border-top: 1px solid rgba(255,255,255,.05); }
.rt-row > span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.rt-head { border-top: 0; font-size: .66rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: #e9c46a; background: rgba(217,179,90,.06); }
.rt-row > span:first-child { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--rc, #fff); }
.rt-row > span:first-child i { width: 11px; height: 11px; transform: rotate(45deg); border-radius: 2px; background: var(--rg, #fff); }
.rt-row.r-mythic { --rc: #ff9ad5; --rg: linear-gradient(90deg, #ff9ad5, #ffe08a, #9dffc9, #8fd8ff); }
.rt-row.r-legendary { --rc: #f3d27a; --rg: linear-gradient(90deg, #b07a1c, #f9e08a); }
.rt-row.r-epic { --rc: #e6ebf4; --rg: linear-gradient(90deg, #8b93a6, #f4f6fb); }
.rt-row.r-rare { --rc: #c9cfdb; --rg: linear-gradient(90deg, #6f7789, #c9cfdb); }
.rt-row.r-common { --rc: #a9afbf; --rg: linear-gradient(90deg, #4c5262, #a9afbf); }

/* spec list */
.spec { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; margin: 0; }
@media (max-width: 767px) { .spec { grid-template-columns: 1fr; } }
.spec > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.spec dt { font-weight: 600; color: #a9a4c4; }
.spec dd { margin: 0; font-weight: 700; color: #fff; text-align: right; }

/* closing CTA */
.doc-end { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 30px; border-radius: 22px;
  background: linear-gradient(135deg, rgba(217,179,90,.14), rgba(111,76,177,.18)); border: 1px solid rgba(217,179,90,.35); }
.doc-end > b { font-size: 1.35rem; font-weight: 900; color: #fff; }
.doc-end > div { display: flex; gap: 10px; flex-wrap: wrap; }
.doc-end .btn { border-radius: 999px; font-weight: 800; }

/* facts strip under the card-wall hero (same hero as the Codex) */
.page-hero .doc-facts { display: flex; width: fit-content; max-width: 100%; margin: 26px auto 0; position: relative; }

/* phones: the column never grows wider than the screen (wide blocks shrink instead of being cut) */
.doc-body { min-width: 0; }
@media (max-width: 991px) { .doc-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 575px) {
  .doc-sec { padding: 22px 18px 20px; border-radius: 18px; }
  .doc-sec h2 { font-size: 1.3rem; }
  .ds-num { font-size: 2.6rem !important; right: 14px !important; }
  .phase-line, .lvl-ladder { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
}
