@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500&display=swap');
:root{--paper:#f6f5f0;--ink:#263c33;--muted:#7d8379;--line:#dedfd5;--green:#365a45;--light:#eae8d5;--dark:#879c7c}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:'DM Sans',sans-serif;font-size:14px}button,select{font:inherit;color:inherit}button{cursor:pointer}button:disabled{opacity:.4;cursor:default}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #ca8c34;outline-offset:3px}button{transition:background .18s,transform .18s}header{height:92px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 5.3%}.brand{display:flex;align-items:center;text-decoration:none;color:var(--ink);font-size:23px;letter-spacing:-1px;font-weight:700}.plus{font-weight:400}.brand-icon{font-size:36px;padding-right:10px}.header-note,.eyebrow,.section-label,.field-label,.edition span,footer{font-size:10px;font-weight:600;letter-spacing:1.7px}.header-note{color:var(--muted)}.text-button{border:0;background:transparent;font-size:12px}.text-button span{margin-left:16px}main{max-width:1240px;padding:0 40px;margin:auto}.intro{display:flex;align-items:center;justify-content:space-between;padding:43px 0 35px}.eyebrow{color:#7d896e;margin:0 0 14px}h1{font-family:'Playfair Display',Georgia,serif;font-size:48px;line-height:1.18;font-weight:500;letter-spacing:-1.6px;margin:0 0 14px}h1 em{color:#79906d;font-weight:500}.subtitle{color:var(--muted);font-size:13px;margin:0}.edition{display:flex;flex-direction:column;gap:9px;text-align:right;padding-top:32px}.edition span{color:var(--muted);font-size:9px}.edition b{font-size:12px;font-weight:500}.workspace{display:grid;grid-template-columns:minmax(0,650px) minmax(320px,380px);gap:64px;align-items:start}.play-area{min-width:0}.player-line{height:59px;display:flex;align-items:center;gap:12px}.player-line>div:nth-child(2){display:flex;flex-direction:column;gap:4px}.player-line strong{font-size:13px;font-weight:600}.player-line span:not(.player-tag){font-size:10px;color:var(--muted)}.avatar{height:36px;width:36px;border-radius:50%;background:#dedfd4;display:grid;place-items:center;font-size:25px}.avatar.light{background:#eeeadc}.player-tag{margin-left:auto;font-size:9px;letter-spacing:1.4px;padding:5px 9px;border:1px solid var(--line);border-radius:4px;color:#6f786c}.board-frame{background:#d9ddce;padding:9px;border-radius:5px;box-shadow:0 12px 32px #30472b12}.board{display:grid;grid-template-columns:repeat(8,1fr);aspect-ratio:1}.square{border:0;padding:0;border-radius:0;position:relative;display:grid;place-items:center;aspect-ratio:1;background:var(--light);min-width:0}.square.dark{background:var(--dark)}.square.last{background:#c9ce8e}.square.dark.last{background:#a8b279}.square.selected{background:#d9bc74}.square.check{background:#c88374}.square .piece{font-family:Georgia,'DejaVu Sans',serif;font-size:clamp(28px,4.8vw,59px);line-height:1;z-index:1;position:relative;filter:drop-shadow(0 2px 1px #0002);color:#fdfbf1;-webkit-text-stroke:1.4px #374939;text-shadow:0 1px #374939;pointer-events:none}.square .piece.black{color:#283c32;-webkit-text-stroke:.6px #182c22;text-shadow:0 1px #d5dbbf}.piece small{font-family:'DM Sans',sans-serif;position:absolute;right:-3px;bottom:-1px;font-size:12px;line-height:17px;width:17px;height:17px;border-radius:50%;background:#f9f4de;color:#284231;-webkit-text-stroke:0;text-shadow:none;font-weight:700;border:1px solid #728767}.square .coord{position:absolute;font-size:9px;color:#617250;z-index:2;font-weight:600}.square.dark .coord{color:#ecedde}.coord.rank{top:5px;left:5px}.coord.file{right:5px;bottom:3px}.square.target:after{content:'';width:23%;height:23%;border-radius:50%;background:#243e3650;position:absolute;z-index:2;pointer-events:none}.square.target.occupied:after{width:87%;height:87%;background:none;border:5px solid #314e3d70}.bottom{margin-top:6px}.board-toolbar{display:flex;align-items:center;margin-top:9px;color:var(--muted);min-height:32px;gap:5px}.board-toolbar span{font-size:11px;margin-right:auto}.board-toolbar button{border:1px solid var(--line);background:transparent;width:31px;height:30px;border-radius:4px;font-size:20px}.panel{padding:26px;border:1px solid var(--line);border-radius:9px;background:#fbfbf7}.section-label{display:flex;align-items:center;gap:7px;color:#7b8676;font-size:9px;letter-spacing:1.3px}.status-dot{width:6px;height:6px;border-radius:50%;background:#7d9671}h2{font-family:'Playfair Display',Georgia,serif;font-weight:500;font-size:27px;letter-spacing:-.5px;margin:15px 0 25px}.field-label{display:block;letter-spacing:.2px;font-size:11px;margin:20px 0 10px}.army-options{display:grid;grid-template-columns:1fr 1fr;gap:9px}.army-choice{position:relative;display:flex;flex-direction:column;align-items:start;gap:7px;border:1px solid var(--line);border-radius:6px;padding:14px 12px;background:transparent;text-align:left}.army-choice.selected{border:1px solid #6d8562;background:#eef1e6;box-shadow:inset 0 0 0 1px #6d8562}.army-choice strong{font-size:11px;letter-spacing:-.1px}.army-choice>span:last-of-type{font-size:9px;color:var(--muted)}.army-symbol{position:relative;font-size:34px;line-height:40px}.army-symbol small{font-size:17px;position:absolute;right:-9px;top:-3px}.army-choice i{position:absolute;top:11px;right:10px;font-size:10px;font-style:normal;color:#718869;visibility:hidden}.army-choice.selected i{visibility:visible}.segmented{display:flex;background:#eeeee7;border-radius:5px;padding:4px;gap:3px}.segmented button{width:50%;padding:8px;border:0;border-radius:3px;background:transparent;font-size:11px;display:flex;align-items:center;justify-content:center;gap:8px}.segmented button.selected{background:#fffef8;box-shadow:0 1px 4px #0001}.color-dot{width:11px;height:11px;border-radius:50%;border:1px solid #b2b7a6}.color-dot.white{background:#fff}.color-dot.black{background:#354435;border-color:#354435}select{width:100%;border:1px solid var(--line);border-radius:5px;background:#fbfbf7;padding:12px 9px;font-size:11px}.primary,.secondary{width:100%;border-radius:5px;padding:14px 16px;font-size:12px;font-weight:500;text-align:left;display:flex;justify-content:space-between;align-items:center}.primary{border:1px solid var(--green);background:var(--green);color:#fff;margin-top:23px}.primary:hover{background:#294935}.secondary{border:1px solid var(--line);background:transparent;margin-top:18px}.engine-note{font-size:8px;text-align:center;color:#91958a;margin:12px -8px 0}.engine-note span{margin:0 4px}.upgrades{padding:26px 1px 0}.upgrades>.section-label{justify-content:space-between;margin-bottom:10px}.upgrades>.section-label>span{color:#aaa}.upgrades article{display:flex;gap:13px;padding:15px 0;border-bottom:1px solid var(--line)}.upgrades article:last-child{border-bottom:0}.mini-piece{position:relative;width:39px;flex-shrink:0;align-self:center;height:42px;border-radius:5px;background:#ebece3;font-size:30px;display:grid;place-items:center}.mini-piece small{position:absolute;font-size:11px;right:3px;bottom:2px}h3{font-size:12px;font-weight:600;margin:1px 0 6px}h3 span{font-size:7px;color:#98a18e;letter-spacing:.8px;display:inline-block;margin-left:5px}.upgrades p{font-size:10px;line-height:1.5;color:var(--muted);margin:0}footer{margin-top:34px;padding:23px 0;border-top:1px solid var(--line);display:flex;justify-content:space-between;color:#929789;font-size:8px;letter-spacing:1px}footer span:first-child{font-family:Georgia,serif;font-style:italic;font-size:13px;letter-spacing:0}footer b{margin:0 10px;font-weight:400}.muted{color:var(--muted);font-size:12px;line-height:1.7}.moves-heading{display:flex;justify-content:space-between;border-bottom:1px solid var(--line);padding:18px 0 12px;font-size:8px;letter-spacing:1px;color:var(--muted)}.move-gap{display:inline-block;width:20px}.move-list{min-height:180px;max-height:260px;overflow-y:auto;padding:7px 0;font-variant-numeric:tabular-nums}.move-row{display:grid;grid-template-columns:40px 1fr 1fr;gap:8px;padding:8px 9px;border-radius:3px;font-size:12px}.move-row:nth-child(even){background:#efefe7}.move-row span:first-child{color:var(--muted)}.move-empty{color:#9a9f93;text-align:center;padding:65px 0;font-size:11px}#error{margin-top:12px;padding:12px;background:#f1e0d6;color:#853f2b;border-radius:5px;font-size:12px;line-height:1.5}dialog{border:1px solid var(--line);border-radius:12px;padding:35px;background:var(--paper);color:var(--ink);max-width:580px;width:calc(100% - 32px);box-shadow:0 24px 80px #17221c40}dialog::backdrop{background:#1c2d2675;backdrop-filter:blur(3px)}dialog p,dialog li{font-size:13px;line-height:1.8}dialog li{margin:12px 0}dialog ul{padding-left:20px}.dialog-close{position:absolute;right:15px;top:12px;background:transparent;border:0;font-size:25px}.dialog-actions{display:flex;gap:15px}.dialog-actions button{margin-top:10px}#promotion-choices{display:flex;gap:9px}#promotion-choices button{flex:1;border:1px solid var(--line);background:#edeee4;border-radius:5px;padding:15px 5px;font-size:11px}#promotion-choices span{display:block;font-size:32px;margin-bottom:8px}#cancel-promotion{margin-top:20px}[hidden]{display:none!important}@media(min-width:1400px){main{max-width:1260px}.workspace{gap:80px}}@media(max-width:1000px){.workspace{gap:30px;grid-template-columns:minmax(0,1fr) 310px}main{padding:0 26px}.panel{padding:20px}.header-note{display:none}h1{font-size:40px}.square .piece{font-size:5vw}h3 span{display:block;margin:4px 0 0}}@media(max-width:740px){header{height:72px;padding:0 22px}.brand{font-size:19px}.brand-icon{font-size:30px}main{padding:0 18px}.intro{padding:30px 0 20px}.edition{display:none}h1{font-size:36px}.subtitle{font-size:11px}.workspace{grid-template-columns:1fr;gap:22px}.play-area{max-width:560px;width:100%;margin:auto}.square .piece{font-size:clamp(25px,8vw,52px)}aside{display:grid;grid-template-columns:1fr;gap:0;max-width:560px;width:100%;margin:auto}.setup-panel{order:0}.upgrades{padding-top:25px}.army-choice{padding:12px 18px}.army-options{gap:14px}.army-choice strong{font-size:13px}.army-choice>span:last-of-type{font-size:10px}footer{gap:20px;line-height:1.8}footer span:last-child{text-align:right;font-size:7px}.intro .eyebrow{font-size:9px}.board-toolbar span{font-size:10px}h3 span{display:inline-block;margin-left:5px}.board-frame{padding:6px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

/* The transparent sheet contains matching light/dark crowns. The background
   windows frame each sprite without modifying the generated artwork. */
.dragon-sprite {
  display: inline-block;
  width: .7em;
  height: .86625em;
  flex-shrink: 0;
  background-image: url('/assets/dragon-ferz-sprites.png');
  background-size: 261.25% 211.111111%;
  background-position: 12.144703% 48.636364%;
  background-repeat: no-repeat;
  vertical-align: middle;
  pointer-events: none;
}
.dragon-sprite.black { background-position-x: 87.726098%; }
.army-symbol:has(.dragon-sprite) { display: grid; place-items: center; height: 40px; width: 30px; }
.mini-piece .dragon-sprite { font-size: 34px; }
#promotion-choices .promotion-icon { display: flex; height: 38px; align-items: center; justify-content: center; }
#promotion-choices .dragon-sprite { display: inline-block; margin: 0; }

/* Elephant sheet: two reference-inspired profiles, framed at matching scale. */
.elephant-sprite {
  display: inline-block;
  width: .776564em;
  height: .86625em;
  flex-shrink: 0;
  background-image: url('/assets/elephant-sprites.png');
  background-size: 292.739274% 131.213018%;
  background-position: 14.212329% 52.132701%;
  background-repeat: no-repeat;
  vertical-align: middle;
  pointer-events: none;
}
.elephant-sprite.black { background-position-x: 84.760274%; }
.mini-piece .elephant-sprite { font-size: 34px; }
#promotion-choices .elephant-sprite { display: inline-block; margin: 0; }

.army-test { margin-top: 32px; }
.test-watch { display:grid;grid-template-columns:minmax(260px,480px) minmax(220px,1fr);gap:32px;margin-top:24px;align-items:center; }
.watch-player { font-size:12px;font-weight:600; }
#test-board .square { cursor:default; }
#test-board .piece { font-size:clamp(24px,4vw,46px); }
.test-call-panel h3 { margin-top:24px;font-size:16px; }
.test-call-panel button { max-width:330px; }
@media(max-width:740px) { .test-watch { grid-template-columns:minmax(0,1fr);gap:12px; } #test-board .piece { font-size:clamp(22px,7vw,46px); } }
.test-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.test-heading h2 { margin-bottom: 8px; }
.test-controls { display: flex; align-items: center; gap: 10px; flex-wrap:wrap; }
.test-controls select { width:auto; }
.test-controls label { font-size: 12px; }
.test-controls input { width: 80px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); }
.test-controls button { width: auto; white-space: nowrap; margin: 0; }
.test-tally { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 22px 0; }
.test-tally div { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.test-tally span { display: block; font-size: 11px; color: var(--muted); }
.test-tally strong { display: block; margin-top: 8px; font-size: 30px; font-weight: 500; }
#test-status { font-size: 13px; }
#test-progress { width: 100%; height: 8px; accent-color: var(--green); }
.test-details { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 22px 0; }
.test-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.test-table th,.test-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.test-table th { font-size: 10px; color: var(--muted); font-weight: 500; }
.test-results-scroll { max-height: 240px; overflow-y: auto; }
#test-error { color: #853f2b; }
.test-method { margin-bottom: 0; }
/* Supplied SVG artwork, with matching hand-recolored sage pieces. */
.square .piece-svg { width:94%;height:94%;object-fit:contain;filter:drop-shadow(0 1px 1px #0002); }
/* Lift dark squares 20% toward white without changing the piece palette. */
:root { --dark:#9fb096; }
.piece-svg[src$="-rook.svg"] { transform:scale(.95); }
.piece-svg[src$="-knight.svg"] { transform:scale(1.05); }
.avatar .piece-svg { width:30px;height:30px; }
.mini-piece .piece-svg { width:38px;height:40px; }
.army-symbol .piece-svg { width:36px;height:40px; }
#promotion-choices .piece-svg { width:38px;height:38px; }
html[data-theme="dark"]{--paper:#2d3431;--ink:#eee1c4;--muted:#c0b99f;--line:#59635d;--green:#769b77;--light:#e7e0c7;--dark:#93a890}
html[data-theme="dark"] body{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] .panel{background:#373f3b}
html[data-theme="dark"] .army-choice.selected{background:#3c5949}
html[data-theme="dark"] .segmented{background:#20332e}
html[data-theme="dark"] .segmented button.selected,html[data-theme="dark"] select{background:#3b5148;color:var(--ink)}
html[data-theme="dark"] .move-row:nth-child(even),html[data-theme="dark"] .test-tally div{background:#373f3b}
html[data-theme="dark"] .mini-piece{background:#3d574a}
html[data-theme="dark"] .board-frame{background:#465d4d}
@media(max-width:740px) { .test-heading { align-items: start; flex-direction: column; gap: 10px; } .test-tally { grid-template-columns: 1fr 1fr; } .test-details { grid-template-columns: 1fr; gap: 24px; } }

/* Reforged introduction and compact variant footer. */
.intro .subtitle { max-width:900px;line-height:1.75; }
.variant-footer { align-items:center;gap:16px; }
.variant-footer span:first-child { font:inherit;letter-spacing:inherit; }
.variant-footer span:last-child { font-size:11px;letter-spacing:.2px; }
/* Public navigation, account controls, and reserved advertising space. */
header nav{display:flex;align-items:center;gap:18px}a{color:inherit}header nav a{text-decoration:none;font-size:12px}header nav a:hover{text-decoration:underline}
.ad-banner{display:flex;max-width:970px;width:100%;height:90px;margin:26px auto 0;align-items:center;justify-content:center;border:1px dashed var(--line);border-radius:6px;background:color-mix(in srgb,var(--ink) 3%,transparent);color:var(--muted);font-size:9px;letter-spacing:2px}.ad-banner a{color:inherit;text-decoration:none;letter-spacing:1px}.ad-banner a:hover{text-decoration:underline;color:var(--accent)}
.home-hero{text-align:center;max-width:760px;margin:55px auto 65px}.home-hero h1{font-size:76px}.home-lead{font-size:20px;line-height:1.6}.home-actions{display:flex;gap:16px;max-width:490px;margin:28px auto}.home-actions a{margin:0;text-decoration:none;font-size:15px}.hero-pieces{display:flex;align-items:center;justify-content:center;gap:24px;margin:35px 0}.hero-pieces img{height:115px;width:115px}.hero-pieces span{font-family:Georgia,serif;font-style:italic;color:var(--muted)}
.about-copy{max-width:780px;margin:50px auto}.about-copy p,.about-copy dd{font-size:15px;line-height:1.85;color:var(--muted)}.about-copy h2{margin-top:36px;margin-bottom:12px}.rule-list dt{font-weight:600;margin-top:18px}.rule-list dd{margin:7px 0 0}.about-copy a{text-decoration:underline}
#player-dialog input:not([type="checkbox"]){width:100%;padding:12px;background:var(--paper);border:1px solid var(--line);border-radius:5px;color:var(--ink);font:inherit}.check-label{display:flex;gap:10px;align-items:center;line-height:1.5}.check-label input{flex-shrink:0}#player-dialog{max-height:90vh;overflow:auto}.clock{margin-left:auto;font-size:22px!important;font-variant-numeric:tabular-nums;color:var(--ink)!important}.clock+.player-tag{margin-left:0}.online-history{margin-top:18px}.online-history a{display:block;margin-top:15px;font-size:12px}
@media(max-width:740px){header{height:auto;min-height:90px;flex-wrap:wrap;gap:14px;padding:18px}header nav{width:100%;justify-content:space-between;gap:8px}header nav .text-button{padding:0}.home-hero{margin:34px auto}.home-hero h1{font-size:52px}.home-lead{font-size:17px}.ad-banner{height:60px}.home-actions{flex-direction:column}.about-copy{margin:30px auto}.about-copy h1{font-size:35px}.clock{font-size:19px!important}}
.brand-icon{width:42px;height:42px;padding-right:10px;object-fit:contain;font-size:0}
