.piece-relief, .arcane-prologue { display: none; }
.theme-toggle, .gore-toggle { min-height: 32px; padding: 7px 10px; border: 1px solid #75613b; color: #d1b582; font-size: 10px; white-space: nowrap; transition: border-color 160ms, background 160ms; }
.theme-toggle:hover, .gore-toggle:hover { border-color: #d1b582; background: #d1b58212; }
.gore-toggle { border-color: #793f39; color: #e6a79b; font-size: 9px; padding-inline: 7px; }

html[data-theme="arcane"] {
  --ink: #101b1b;
  --surface: #192421;
  --surface-light: #26332c;
  --line: #605841;
  --line-soft: #4e4936;
  --text: #efe5cf;
  --muted: #beb69e;
  --faint: #a4ab94;
  --gold: #d6b77c;
  --red: #e08872;
  --jade: #8dcfbd;
}
html[data-theme="arcane"] body {
  background: radial-gradient(ellipse at 5% 37%, #76372850, transparent 37%), radial-gradient(ellipse at 91% 40%, #26645146, transparent 36%), radial-gradient(ellipse at 48% 2%, #79704526, transparent 54%), repeating-linear-gradient(115deg, #d6bf9010 0 1px, transparent 1px 115px), #0c1717;
}
html[data-theme="arcane"] .scene-grain { opacity: .12; background-size: 3px 3px; mask-image: none; }
html[data-theme="arcane"] .scene-glow { top: 16%; left: -310px; width: 720px; height: 720px; border-color: #c9915230; box-shadow: 0 0 0 40px #cb854609, 0 0 0 120px #cb854606, 0 0 90px #ae58330d; }
html[data-theme="arcane"] .site-header { border-bottom-color: #9b855337; }
html[data-theme="arcane"] .brand-seal { color: #f8dcc1; background: linear-gradient(145deg, #b76544, #5f211e 75%); border: 2px ridge #cdac70; box-shadow: 0 4px 0 #362820, 0 7px 14px #050e0d, inset 0 0 0 3px #8c5b3040; }
html[data-theme="arcane"] .brand-copy strong { color: #f5e6bf; text-shadow: 0 2px 2px #050d0d; }
html[data-theme="arcane"] .theme-toggle { color: #e9dab7; border-color: #b39866; background: linear-gradient(160deg, #514d34, #292e25); box-shadow: inset 0 1px 0 #dfcc8850, 0 2px 0 #060e0d; }
html[data-theme="arcane"] .gore-toggle[aria-pressed="true"] { background: #9a382524; box-shadow: inset 0 1px 0 #f0b49018; }
html[data-theme="arcane"] .battle-heading h1 { color: #f4e9d0; text-shadow: 0 2px 2px #061211; }
html[data-theme="arcane"] .battle-heading h1 em { color: #df9b79; }
html[data-theme="arcane"] .arcane-prologue { display: flex; align-items: center; justify-content: center; gap: 19px; margin: -3px 0 25px; color: #d7b476; font: 15px var(--serif); letter-spacing: .17em; }
html[data-theme="arcane"] .arcane-prologue::before, html[data-theme="arcane"] .arcane-prologue::after { content: ""; height: 1px; max-width: 150px; flex: 1; background: linear-gradient(90deg, transparent, #ae8c51); }
html[data-theme="arcane"] .arcane-prologue::after { transform: scaleX(-1); }
html[data-theme="arcane"] .arcane-prologue i { margin: 0 14px; font: 9px var(--sans); color: #9da28e; letter-spacing: .2em; font-style: normal; }
html[data-theme="arcane"] .arcane-prologue small { font: 8px var(--sans); color: #a29f82; letter-spacing: .22em; }
html[data-theme="arcane"] .arcane-rune { font-size: 24px; color: #debe76; text-shadow: 0 0 15px #ed95384a; }
html[data-theme="arcane"] .player-strip { padding: 10px 14px; background: linear-gradient(90deg, #6487731d, transparent 72%), #16232199; border: 1px solid #77715146; box-shadow: inset 0 1px 0 #d5c0800c; }
html[data-theme="arcane"] .self-strip { background: linear-gradient(90deg, #9c533529, transparent 72%), #16232199; }
html[data-theme="arcane"] .player-strip.is-turn { border-color: #bf975586; box-shadow: inset 3px 0 0 #c4a065, 0 0 24px #d6a3530b; }
html[data-theme="arcane"] .player-avatar { width: 46px; height: 48px; border: 2px ridge #86ac9c; color: #d1ece0; clip-path: polygon(12% 0, 88% 0, 100% 15%, 100% 76%, 50% 100%, 0 76%, 0 15%); background: radial-gradient(at 28% 15%, #739087, #345247 44%, #102925); box-shadow: inset 0 0 0 5px #09191670; }
html[data-theme="arcane"] .player-avatar.red { border-color: #d0ab75; color: #f6cfaa; background: radial-gradient(at 28% 15%, #be8a59, #823d2f 44%, #39201b); }
html[data-theme="arcane"] .player-time strong { color: #ccdfd2; text-shadow: 0 2px 1px #071713; }
html[data-theme="arcane"] .player-strip.is-turn .player-time strong { color: #f1d299; }
html[data-theme="arcane"] .board-surround { filter: drop-shadow(0 12px 22px #030908b0); }
html[data-theme="arcane"] .board-rim {
  padding: 19px;
  border: 3px ridge #a99466;
  background: repeating-linear-gradient(2deg, #060e0a36 0 2px, transparent 3px 7px), linear-gradient(130deg, #bb9f62 0, #4e4c35 7%, #2c3b33 25%, #545441 49%, #21362c 72%, #aa9058 100%);
  box-shadow: 0 9px 0 #111c17, 0 11px 0 #5e62424d, 0 15px 0 #08110e, 0 27px 45px #020a0990, inset 0 0 0 4px #111b1766, inset 0 0 0 5px #d4bc776a, inset 0 0 0 9px #253024, inset 0 0 15px #050f08;
}
html[data-theme="arcane"] .board-rim::before { content: ""; position: absolute; inset: 10px; border: 1px solid #b8a16a96; box-shadow: inset 0 0 0 2px #101e15, 0 0 0 2px #101e1555; pointer-events: none; z-index: 4; }
html[data-theme="arcane"] .rim-corner { width: 30px; height: 30px; border-color: #f0d593; border-width: 2px; }
html[data-theme="arcane"] .rim-corner::after { content: ""; position: absolute; width: 6px; height: 6px; border: 1px solid #eee0b6; background: #beaa64; box-shadow: 0 1px 0 #352e1c, 0 0 9px #ddb15c35; transform: rotate(45deg); }
html[data-theme="arcane"] .rim-corner.tl::after, html[data-theme="arcane"] .rim-corner.bl::after { left: 4px; }
html[data-theme="arcane"] .rim-corner.tr::after, html[data-theme="arcane"] .rim-corner.br::after { right: 4px; }
html[data-theme="arcane"] .rim-corner.tl::after, html[data-theme="arcane"] .rim-corner.tr::after { top: 4px; }
html[data-theme="arcane"] .rim-corner.bl::after, html[data-theme="arcane"] .rim-corner.br::after { bottom: 4px; }
html[data-theme="arcane"] .chess-board { border: 1px solid #cfbb7f6b; background: #29332c; box-shadow: inset 0 0 40px #06140bcc; }
html[data-theme="arcane"] .board-watermark { color: #f5bf7530; }
html[data-theme="arcane"] .board-watermark span { text-shadow: 0 0 15px #de5d44; }

html[data-theme="arcane"] .piece {
  --metal-light: #edd9a7;
  --metal-mid: #b69663;
  --metal-dark: #5c4530;
  --jewel: #d94c3c;
  isolation: isolate;
  border-radius: 43% 43% 39% 39%;
  border: 2px ridge #e3c994;
  background: radial-gradient(ellipse at 26% 13%, #fff2cda8, transparent 34%), repeating-conic-gradient(from 12deg, #2f190805 0 10deg, #fff2cb09 10deg 20deg), linear-gradient(155deg, #eddcb2 0%, #d1b37d 18%, #a78151 59%, #765032 83%, #c5a16c 100%);
  color: #7c251f;
  box-shadow: 0 5px 0 #483724, 0 7px 0 #b2946040, 0 11px 9px #04100db0, inset 0 1px 0 #fff8dc, inset 0 0 0 2px #f1dfb380, inset 0 0 0 4px #78502c, inset 0 0 0 5px #d4b780;
  transition: box-shadow 180ms, border-color 180ms;
}
html[data-theme="arcane"] .piece.black {
  --metal-light: #bed8c7;
  --metal-mid: #719b87;
  --metal-dark: #274539;
  --jewel: #84e1c6;
  color: #bce3d3;
  border-color: #b1c9b2;
  background: radial-gradient(ellipse at 26% 13%, #e0fff052, transparent 36%), repeating-conic-gradient(from 12deg, #0b241a05 0 10deg, #c2e4c10a 10deg 20deg), linear-gradient(155deg, #789984 0%, #4c7866 22%, #284c3e 60%, #152d28 84%, #68917a 100%);
  box-shadow: 0 5px 0 #132f24, 0 7px 0 #7caa8860, 0 11px 9px #03100eb0, inset 0 1px 0 #e0f4d5, inset 0 0 0 2px #9cbaa950, inset 0 0 0 4px #142b23, inset 0 0 0 5px #6a998180;
}
html[data-theme="arcane"] .piece::before { content: ""; position: absolute; z-index: -1; inset: 72% -5% -14%; border-radius: 44%; border: 1px solid var(--metal-mid); background: linear-gradient(180deg, var(--metal-mid), var(--metal-dark) 70%, #061410); box-shadow: 0 4px 5px #00110ec0; pointer-events: none; }
html[data-theme="arcane"] .piece::after { content: ""; position: absolute; width: 9%; height: 9%; border: 1px solid var(--metal-light); bottom: 9%; left: 46%; transform: rotate(45deg); background: var(--jewel); box-shadow: 0 0 5px var(--jewel), inset 1px 1px 0 #fff5; pointer-events: none; }
html[data-theme="arcane"] .piece-ring { inset: 13%; border-radius: 37% 37% 44% 44%; border: 1px solid var(--metal-light); opacity: .53; box-shadow: inset 0 0 0 1px #0a190740; }
html[data-theme="arcane"] .piece-face { top: 12%; z-index: 2; font-size: calc(var(--board-cell, 70px) * .39); text-shadow: 0 1px 0 #ffecc275, 0 -1px 0 #271306b0; }
html[data-theme="arcane"] .piece.black .piece-face { text-shadow: 0 1px 0 #061c17, 0 0 7px #72d1b02a; }
html[data-theme="arcane"] .piece-relief { display: block; position: absolute; pointer-events: none; z-index: 3; width: 53%; height: 47%; top: -19%; left: 24%; color: var(--metal-light); filter: drop-shadow(1px 2px 0 var(--metal-dark)) drop-shadow(0 3px 3px #02110a99); }
html[data-theme="arcane"] .piece-relief svg { width: 100%; height: 100%; overflow: visible; }
html[data-theme="arcane"] .carving-body { stroke: var(--metal-dark); stroke-width: 1.7; stroke-linejoin: round; }
html[data-theme="arcane"] .carving-inset { fill: var(--metal-dark); stroke: var(--metal-mid); }
html[data-theme="arcane"] .carving-line { fill: none; stroke: #fff1c4; stroke-width: 1; opacity: .72; }
html[data-theme="arcane"] .carving-jewel { fill: var(--jewel); stroke: var(--metal-mid); stroke-width: 1; }
html[data-theme="arcane"] .piece[data-type="general"] { border-radius: 25% 25% 44% 44%; border-width: 3px; }
html[data-theme="arcane"] .piece[data-type="general"] .piece-relief { top: -25%; width: 73%; height: 51%; left: 14%; }
html[data-theme="arcane"] .piece[data-type="rook"] { border-radius: 23%; }
html[data-theme="arcane"] .piece[data-type="horse"] { border-radius: 38% 47% 33% 36%; }
html[data-theme="arcane"] .piece[data-type="cannon"] { border-radius: 30% 30% 39% 39%; }
html[data-theme="arcane"] .piece[data-type="advisor"] { border-radius: 28% 28% 48% 48%; }
html[data-theme="arcane"] .piece[data-type="elephant"] .piece-ring { border-style: double; border-width: 3px; }
html[data-theme="arcane"] .piece[data-type="soldier"] .piece-relief { width: 38%; left: 31%; }
html[data-theme="arcane"] .piece.is-selected { z-index: 4; border-color: #ffedb6; box-shadow: 0 5px 0 #594025, 0 10px 8px #04100dc0, 0 0 0 3px #dab7756e, 0 0 25px #eaca7860, inset 0 0 0 4px #fff0c350; }
html[data-theme="arcane"] .piece.is-checked { border-color: #ff826c; box-shadow: 0 5px 0 #542718, 0 10px 8px #04100dc0, 0 0 0 3px #cf3e467a, 0 0 27px #d44b4980; }
html[data-theme="arcane"] .piece:not(:disabled):hover { border-color: #fff0bc; box-shadow: 0 5px 0 var(--metal-dark), 0 10px 8px #04100dc0, 0 0 15px #e9c56e66, inset 0 0 0 4px #f4e1ac40; }
html[data-theme="arcane"] .move-target::after { width: 19%; height: 19%; border: 1px solid #fff1b7; background: #dfba76; border-radius: 0; transform: rotate(45deg); box-shadow: 0 0 10px #ecb658, 0 0 0 5px #d4b67b20; }
html[data-theme="arcane"] .capture-target { border: 2px solid #f2957b; box-shadow: inset 0 0 18px #d0523940, 0 0 18px #dd5f4555; }
html[data-theme="arcane"] .capture-target::after { inset: -5px; border: 1px dashed #d68766; }
html[data-theme="arcane"] .last-marker { border-color: #d1ba6b55; }

html[data-theme="arcane"] .turn-banner { border: 1px solid #b2905670; background: linear-gradient(90deg, #806d3737, #253128a6 65%); box-shadow: inset 0 1px 0 #e5c58715, 0 3px 10px #07110b3b; }
html[data-theme="arcane"] .turn-banner[data-check="true"] { background: linear-gradient(90deg, #72241d70, #2a272180); border-color: #c86b57; }
html[data-theme="arcane"] .turn-glyph { color: #f0d096; text-shadow: 0 0 12px #cc9e5033; }
html[data-theme="arcane"] .match-panel, html[data-theme="arcane"] .history-panel { border: 1px solid #94805770; background: repeating-linear-gradient(0deg, #dde2bd03 0 1px, transparent 1px 5px), radial-gradient(ellipse at 10% 0, #777a4840, transparent 64%), #192622e8; box-shadow: inset 0 0 0 3px #091b1460, inset 0 0 0 4px #96805820, 0 8px 20px #04120c44; }
html[data-theme="arcane"] .panel-heading .eyebrow { letter-spacing: .26em; color: #e4c389; }
html[data-theme="arcane"] .match-panel h2 { color: #f3e7c9; }
html[data-theme="arcane"] .mode-tabs { border-color: #8e825257; background: #0e2018; }
html[data-theme="arcane"] .mode-tabs button.active { background: linear-gradient(150deg, #655e37, #373f2b); color: #f1dcae; box-shadow: inset 0 1px 0 #ceb57150; }
html[data-theme="arcane"] .text-field { border-color: #7f815955; background: #0f201acc; color: #efe6cc; box-shadow: inset 0 2px 6px #081509; }
html[data-theme="arcane"] .primary-button { color: #ffe5c0; background: linear-gradient(155deg, #b9744d, #873c2e 46%, #5d261f); border: 1px solid #d8af7180; box-shadow: 0 3px 0 #38291e, inset 0 1px 0 #f0c79088, inset 0 0 0 3px #9c5f2925; }
html[data-theme="arcane"] .primary-button:not(:disabled):hover { border-color: #f2d092; background: linear-gradient(155deg, #d18d5a, #a34932 50%, #67271f); }
html[data-theme="arcane"] .outline-button { border-color: #b59a6770; background: linear-gradient(150deg, #96825812, #0b1b1555); color: #e2c691; box-shadow: inset 0 1px 0 #d7bb7015, 0 2px 0 #06170f; }
html[data-theme="arcane"] .soul-character { color: #efcea1; border: 2px ridge #d2b178; background: radial-gradient(at 25% 20%, #b69862, #715634 44%, #342b1d); box-shadow: 0 5px 0 #182118, inset 0 0 0 5px #4b3b22; }
html[data-theme="arcane"] .soul-copy strong { color: #f0e3c1; }
html[data-theme="arcane"] .game-dialog { border: 2px ridge #b49b62; background: radial-gradient(ellipse at 0 0, #b29c4940, transparent 60%), #172922; box-shadow: 0 32px 100px #030b08, inset 0 0 0 5px #23352b, inset 0 0 0 6px #c6ab5730; }
html[data-theme="arcane"] .game-dialog::backdrop { background: #050e0bea; }
html[data-theme="arcane"] .preview-arena { border: 2px ridge #978358; background: radial-gradient(ellipse at center, #44513a, #162b25 80%); box-shadow: inset 0 0 22px #02130fcc; }
html[data-theme="arcane"] .preview-river { color: #e199735e; text-shadow: 0 0 20px #ce6543; }
html[data-theme="arcane"] .result-seal { border: 3px ridge #d2b078; color: #ffe7c1; background: radial-gradient(at 24% 18%, #c38852, #67281e 72%); box-shadow: 0 7px 0 #253025, 0 20px 30px #03170b80, inset 0 0 0 7px #3f271e7a; }
html[data-theme="arcane"] .captured-token { border-radius: 24%; border-color: #ad85577a; color: #ddb084; background: #8a603725; }
html[data-theme="arcane"] .captured-token.black { color: #b1d1bd; border-color: #789b8080; background: #4e846121; }
html[data-theme="arcane"] .toast { color: #f4ddad; background: #2a3c2dfa; border-color: #c0a460; box-shadow: 0 12px 30px #03150c99; }
html[data-theme="arcane"] .site-footer { border-color: #98865d44; color: #a3a78c; }

@media (max-width: 1100px) { html[data-theme="arcane"] .header-actions { gap: 10px; } html[data-theme="arcane"] .site-header { gap: 20px; } }
@media (min-width: 1024px) and (max-height: 950px) { html[data-theme="arcane"] .board-rim { padding: 14px; } html[data-theme="arcane"] .arcane-prologue { margin-bottom: 20px; } html[data-theme="arcane"] .player-strip { padding: 8px 12px; } }
@media (max-width: 900px) { html[data-theme="arcane"] .site-header { gap: 14px; } html[data-theme="arcane"] .main-nav { gap: 12px; } .theme-toggle { font-size: 9px; padding: 6px 8px; } html[data-theme="arcane"] .board-rim { padding: 14px; } html[data-theme="arcane"] .arcane-prologue small { display: none; } }
@media (max-width: 700px) {
  .theme-toggle { width: 24px; min-height: 28px; padding: 2px; font-size: 0; }
  .theme-toggle::after { content: "魔"; font: 15px var(--serif); }
  html[data-theme="arcane"] .site-header { min-height: 104px; height: auto; padding: 14px 0 12px; row-gap: 10px; }
  html[data-theme="arcane"] .header-actions { width: 100%; margin: 0; justify-content: flex-end; gap: 14px; }
  html[data-theme="arcane"] .theme-toggle { width: auto; margin-right: auto; min-height: 30px; padding: 6px 10px; font-size: 10px; }
  html[data-theme="arcane"] .theme-toggle::after { display: none; }
  html[data-theme="arcane"] .gore-toggle { min-height: 30px; }
  html[data-theme="arcane"] .header-actions .setting-toggle { width: 28px; min-height: 30px; justify-content: center; }
  html[data-theme="arcane"] .arcane-prologue { gap: 9px; font-size: 12px; margin-bottom: 23px; letter-spacing: .08em; }
  html[data-theme="arcane"] .arcane-prologue i { margin-inline: 8px; }
  html[data-theme="arcane"] .arcane-rune { font-size: 19px; }
  html[data-theme="arcane"] .player-strip { padding: 8px 10px; }
  html[data-theme="arcane"] .player-avatar { width: 37px; height: 41px; }
  html[data-theme="arcane"] .board-rim { padding: 13px; border-width: 2px; }
  html[data-theme="arcane"] .board-rim::before { inset: 8px; }
  html[data-theme="arcane"] .rim-corner { width: 23px; height: 23px; }
  html[data-theme="arcane"] .piece { border-width: 1.5px; box-shadow: 0 3px 0 #483724, 0 5px 6px #04100db0, inset 0 1px 0 #fff8dc, inset 0 0 0 2px #eddbac70, inset 0 0 0 3px #78502c; }
  html[data-theme="arcane"] .piece.black { box-shadow: 0 3px 0 #132f24, 0 5px 6px #03100eb0, inset 0 1px 0 #d5f3dc88, inset 0 0 0 2px #9cbaa950, inset 0 0 0 3px #142b23; }
  html[data-theme="arcane"] .piece[data-type="general"] { border-width: 2px; }
}
@media (prefers-reduced-motion: no-preference) {
  html[data-theme="arcane"] .arcane-prologue { animation: arcane-arrival 650ms 80ms ease-out both; }
}
@keyframes arcane-arrival { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { html[data-theme="arcane"] *, html[data-theme="arcane"] *::before, html[data-theme="arcane"] *::after { animation: none !important; transition: none !important; } }
