/* v0.29 — carved stone, lacquer, ivory and patinated bronze. */
:root{--hall-bronze:#b29b70;--hall-light:#ede1c8;--hall-ink:#0c1723}
.brand-mark{width:32px;height:40px;background:none!important;border:0!important;box-shadow:none!important;overflow:visible;flex:none}
.brand-mark svg{width:100%;height:100%;fill:none;stroke:#d1b57d;stroke-width:1.5;stroke-linejoin:round;filter:drop-shadow(0 2px 2px #0008)}
.brand-mark svg path:first-child{fill:#c9b17e22;stroke-width:1.1}
.duel3d .game .topbar,.duel3d[lang=en] .game .topbar{background:linear-gradient(180deg,#09121dfc,#162330f7);border-bottom:1px solid #aa947447;box-shadow:0 1px #030b12,0 7px 22px #02081145}
.duel3d .game .nav>button{border:0;border-radius:0;background:none;color:#aeb9c3;padding:8px;box-shadow:none}.duel3d .game .nav>button:hover{color:#f0deb6;background:#c8af7e0e}.duel3d .game .brand{color:#e8dbbf}
#duel3d-view{background:radial-gradient(ellipse at 47% 41%,#36506700 32%,#08162980 100%),linear-gradient(180deg,#1225377d,#1a324737 60%,#0b1a2bc7),url('home-mountains-v2.jpg') center 37%/cover}
#duel3d-view::after{height:100%;background:linear-gradient(#08111b85,transparent 16%,transparent 80%,#071322a8);box-shadow:inset 0 0 140px #07132355}
/* Compact suspended phase ornament, not a full-width dashboard strip. */
.duel3d .battle-hud,.duel3d[lang=en] .battle-hud{left:calc(var(--rail-left) + 18px);right:calc(var(--rail-right) + 18px);top:9px;height:51px;grid-template-columns:130px minmax(180px,1fr);gap:10px;padding:0 22px;background:linear-gradient(90deg,#101c29e8,#1d2d3bf0 50%,#101c29e8);border:0;border-top:1px solid #c5aa736b;border-bottom:1px solid #c5aa734f;border-radius:0;clip-path:polygon(2% 0,98% 0,100% 50%,98% 100%,2% 100%,0 50%);box-shadow:inset 0 2px #e7d3a31a,inset 0 -2px #0005;overflow:visible}
.duel3d .battle-hud::before{display:none}.duel3d .duel-turn{display:grid;gap:2px;text-align:center;border-right:1px solid #b99a643b;padding-right:14px}.duel3d .duel-turn small{font-size:9px;letter-spacing:2px;color:#92b7c7}.duel3d .duel-turn strong{font-family:var(--display-font);font-size:19px;color:#e9d7b2;letter-spacing:1px}
.duel3d .phase-rail li{height:31px;border:0;color:#768997;background:none;font-size:12px;gap:9px}.duel3d .phase-rail li i{border-radius:0;width:17px;height:17px;border:1px solid #8d9a9a55;font-size:9px;box-shadow:none;transform:rotate(45deg);font-style:normal;color:transparent}.duel3d .phase-rail li.current{background:radial-gradient(ellipse,#bc995331,transparent 75%);color:#f2dfb5}.duel3d .phase-rail li.current i{background:#c7ad77;box-shadow:inset 0 0 0 3px #2f3840,0 0 8px #bdab6b35;border-color:#d8c396;color:transparent}.duel3d .duel-pulse{display:none}
/* Portrait seals and resource pips keep identity, life and Qi visually distinct. */
.duel3d .master{--master-accent:#80adbd;left:20px;width:calc(var(--rail-left) - 32px);padding:14px 10px 10px;min-height:198px;height:auto;max-height:none;gap:8px;align-items:center;justify-content:flex-start;flex-direction:column;border:0;border-top:1px solid #c3a97977;border-bottom:1px solid #c3a97955;border-radius:0;background:radial-gradient(ellipse at 50% 20%,#40526952,transparent 65%),linear-gradient(90deg,#0b1724ec,#182838f2 50%,#0b1724ec);box-shadow:inset 1px 0 #d8c39425,inset -1px 0 #d8c39425,0 14px 28px #02091659;text-align:center}
.duel3d .master::before{content:'';position:absolute;inset:4px;pointer-events:none;border:1px solid #ba9e6930;clip-path:polygon(0 0,25% 0,25% 5%,75% 5%,75% 0,100% 0,100% 100%,75% 100%,75% 95%,25% 95%,25% 100%,0 100%)}
.duel3d .master-foe{top:78px;--master-accent:#bd897e}.duel3d .master-mine{bottom:calc(var(--hand-h) + 10px)}
.duel3d .master .avatar{display:block;position:absolute;right:10px;top:51px;width:64px;height:64px;border:1px solid #bfa66f;background-size:150%;background-position:center 13%;border-radius:50%;box-shadow:0 0 0 3px #0b1622,0 0 0 4px #8c795b70,inset 0 0 12px #06101c;opacity:.9}
.duel3d .master .master-copy{width:100%}.duel3d .master-name,.duel3d[lang=en] .master-name{font-size:11px;line-height:1.35;letter-spacing:.3px;color:#d8d4c7;font-weight:500}.duel3d .master .master-sub{justify-content:center;font-size:9px;margin-top:3px;color:#8e9eac;gap:12px}
.duel3d .master .vitals{width:100%;display:grid;gap:6px;margin:0}.duel3d .master .hp{display:flex;flex-direction:column;align-items:center;justify-content:center;width:62px;height:66px;margin:4px 0 2px;background:radial-gradient(ellipse,#31405270,transparent 70%);line-height:1;position:relative}
.duel3d .master .hp b{font:400 38px/1 Georgia,serif;color:#f4e9d0;text-shadow:0 2px 3px #0008}.duel3d .master .hp small{font:9px/1.3 var(--ui-font);margin-top:5px;color:#a4adb1}.duel3d .master .track{display:none}
.duel3d .master .hp::after{content:'';position:absolute;bottom:0;left:6px;right:6px;height:2px;background:linear-gradient(90deg,var(--master-accent) var(--life),#53627140 var(--life));box-shadow:0 1px #020b12}
.duel3d .master .qi{display:flex;flex-direction:column;gap:7px;width:100%;padding:5px 0 0;background:none;border:0;color:#a9cbd6;font-size:11px;font-weight:500;line-height:1.2}.qi-copy{display:block}.qi-pips{display:flex;gap:4px;justify-content:center;flex-wrap:wrap}.master .qi .qi-pips i{display:block;width:8px;height:8px;border-radius:0;transform:rotate(45deg);margin:0;background:#142330;border:1px solid #778a8d55;box-shadow:none}.master .qi .qi-pips i.filled{background:linear-gradient(135deg,#d1ece4,#689aa5);border-color:#c0d8d3;box-shadow:0 0 5px #8bd1d333}
.duel3d .master .grave-link{border:0;border-top:1px solid #bda77930;border-radius:0;font-size:9px;padding:7px 2px 0;color:#b4a996;background:none;width:100%;margin:0;line-height:1.2}.duel3d .master .strike-master{margin:8px 0 0;min-height:52px}
/* A lacquer-and-paper folio gives card information a crafted surface. */
.duel3d .scene-brand{top:81px;right:22px;color:#dfcfab;padding-bottom:10px;width:calc(var(--rail-right) - 38px);border-bottom:1px solid #bba4725e}.duel3d .scene-brand span{font-size:18px;letter-spacing:3px}.duel3d[lang=en] .scene-brand span{font-size:11px;letter-spacing:1px}
.duel3d .side{right:20px;top:122px;width:calc(var(--rail-right) - 34px);bottom:calc(var(--hand-h) + 116px);scrollbar-width:thin;scrollbar-color:#9c8863 #111f2d}
.duel3d .side.has-detail>.inspect{padding:12px 13px 15px;border:1px solid #bba37666;border-radius:0;background:linear-gradient(100deg,#142334,#0b1724 70%);box-shadow:inset 0 0 0 3px #0c1722,inset 0 0 0 4px #b2986630,0 10px 30px #02091566}
.duel3d .side .inspect>.small{display:block;font:10px var(--ui-font);color:#b6aa90;letter-spacing:2px;border-bottom:1px solid #a28b5c33;padding:1px 0 10px}
.duel3d .side .inspect-art{height:clamp(138px,20vh,195px);margin:10px 0 14px;border:0;border-bottom:1px solid #b7a17b4d;background-color:#0b1620;background-size:contain;filter:none;box-shadow:inset 0 0 20px #06101b}
.duel3d .side .inspect strong,.duel3d[lang=en] .side .inspect strong{font-family:var(--display-font);font-size:20px;font-weight:400;line-height:1.35;color:#ecd8af;letter-spacing:1px;margin:8px 0 12px}.duel3d[lang=en] .side .inspect strong{font-size:18px;letter-spacing:0}
.duel3d .side .inspect p{font-size:12px;color:#b7c3cf;line-height:1.75;margin:9px 0}.duel3d .side .inspect .cost-copy{color:#baa884;font-size:11px;padding-bottom:10px;border-bottom:1px solid #ad976533}
.duel3d .side .guide-panel,.duel3d .side .quick-guide-coach,.duel3d .side .tutorial-coach{background:linear-gradient(135deg,#152737ef,#0a1929f0);border:1px solid #b4a0765c;border-radius:0;padding:13px;color:#c3c9c9;box-shadow:inset 0 0 0 3px #0b172380}
/* Commands are forged bronze / dark jade, with narrow bevels and clear primary action. */
.duel3d .action-dock,.duel3d[lang=en] .action-dock{right:20px;width:calc(var(--rail-right) - 34px);max-width:none;bottom:calc(var(--hand-h) + 16px);gap:8px}
.duel3d .action-dock .hint{background:none;border:0;border-radius:0;font-size:10px;line-height:1.5;padding:4px 0 8px;color:#a3b8c5;letter-spacing:.5px}
.duel3d .action-dock button,.duel3d[lang=en] .action-dock button{flex:1;min-height:46px;padding:10px 8px;border:1px solid #9d885e;border-radius:0;color:#c5d0d5;background:linear-gradient(#253b49,#0e2230);box-shadow:inset 0 0 0 2px #111e29,inset 0 0 0 3px #b6a47733,0 3px 10px #0005;font:12px/1.3 var(--ui-font)}
.duel3d .action-dock button.gold{background:linear-gradient(135deg,#e1c88b,#a9874e 62%,#d2b57a);color:#252219;border-color:#e7cc90;box-shadow:inset 0 0 0 2px #9a7947,inset 0 0 0 3px #eed6a15e,0 4px 15px #0007;font-weight:600}
.duel3d .action-dock button:hover:not(:disabled){filter:brightness(1.13);border-color:#f0d6a0}
.duel3d .play-controls,.duel3d .choice-prompt,.duel3d[lang=en] .choice-prompt{background:linear-gradient(135deg,#213441f5,#0c1b29fa);border:1px solid #b29b6b8c;box-shadow:inset 0 0 0 2px #0a192b,0 5px 20px #02091380;border-radius:0}
.duel3d .play-actions button{background:linear-gradient(#2e4350,#162733);border-radius:0;border-color:#a791625e}.duel3d .play-actions button.gold{background:linear-gradient(#dcc797,#b0925c);color:#1e2630;border-color:#d3be8b}
/* Keep the name on the lower edge of each creature. Its stats occupy only the safe gap. */
.duel3d .row .unit .unit-title,.duel3d .row .unit.defense-form .unit-title,.duel3d[lang=en] .row .unit .unit-title,.duel3d .row .unit.hidden-unit .unit-title{top:auto;bottom:0;padding:3px 4px;font-size:11px;line-height:1.15;background:linear-gradient(90deg,#101d27ee,#243849f5,#101d27ee);color:#e9e0cd;border-top:1px solid #d1bd8a44;text-shadow:0 1px #000}
.duel3d .row .unit .unit-stats,.duel3d .row .unit.defense-form .unit-stats,.duel3d .row .unit.hidden-unit .unit-stats{top:calc(100% + 2px);bottom:auto;min-height:20px;padding:2px 4px;font-size:14px;border:0;border-radius:0;background:linear-gradient(90deg,transparent,#102130f5 9%,#102130f5 91%,transparent);color:#e7d4a8;box-shadow:inset 0 -1px #baa16b4a;gap:12px}
.duel3d .spell-slot>span:not(.slot-number),.duel3d[lang=en] .spell-slot>span:not(.slot-number){color:#cedbdc;background:linear-gradient(90deg,transparent,#122331dd,transparent);font-size:10px}
.duel3d .row .unit.caption-inset .unit-stats{top:auto;bottom:0}.duel3d .row .unit.caption-inset .unit-title{bottom:22px}
.duel3d .hand{background:linear-gradient(0deg,#081522f5,#0c1c3045 72%,transparent)}.duel3d .hand .card,.duel3d[lang=en] .hand .card{background:#162736;border-color:#b3a17c;box-shadow:0 6px 17px #010916b3,inset 0 0 0 2px #0c1825;border-radius:2px}.duel3d .hand .card>strong,.duel3d[lang=en] .hand .card>strong{background:linear-gradient(#26394a,#182a38);color:#e4d8bd}.duel3d .hand .card .stats{background:#0b1b2a;color:#d2b982;border-top-color:#b8a57855}
/* Small-screen fallback keeps the same colour/material language. */
html:not(.duel3d) .game .master{background:linear-gradient(135deg,#243747,#0c1b29);border-color:#b7a07355}.master .qi{max-width:100%}html:not(.duel3d) .qi-pips{display:none}
@media(min-width:1000px) and (max-height:719px){
 .duel3d .battle-hud,.duel3d[lang=en] .battle-hud{height:43px;padding:0 10px;grid-template-columns:106px 1fr;gap:4px;left:calc(var(--rail-left) + 8px);right:calc(var(--rail-right) + 8px)}.duel3d .duel-turn{padding-right:6px}.duel3d .duel-turn strong{font-size:15px}.duel3d .duel-turn small{font-size:8px;letter-spacing:1px}.duel3d .phase-rail li{font-size:10px;gap:5px}
 .duel3d .master{left:14px;width:calc(var(--rail-left) - 24px);height:128px;min-height:128px;max-height:128px;padding:7px 8px;gap:3px}.duel3d .master-foe{top:67px}.duel3d .master .avatar{width:41px;height:41px;top:38px;right:12px}.duel3d .master .master-sub{display:none}.duel3d .master-name,.duel3d[lang=en] .master-name{font-size:9px;line-height:1.2;max-width:none}.duel3d .master .vitals{gap:2px}.duel3d .master .hp{width:46px;height:42px;margin:0}.duel3d .master .hp b{font-size:27px}.duel3d .master .hp small{font-size:8px;margin-top:2px}.duel3d .master .hp::after{display:none}.duel3d .master .qi{font-size:9px;gap:4px;padding:1px 0}.duel3d .qi-pips{gap:4px}.duel3d .master .qi .qi-pips i{width:5px;height:5px}.duel3d .master .grave-link{padding:4px 0 0;font-size:8px}.duel3d .master-mine{bottom:calc(var(--hand-h) + 10px)}
 .duel3d .scene-brand{top:68px;right:16px;padding-bottom:6px;width:calc(var(--rail-right) - 28px)}.duel3d .scene-brand span{font-size:15px}.duel3d .side{top:98px;right:14px;bottom:calc(var(--hand-h) + 104px);width:calc(var(--rail-right) - 26px)}.duel3d .side .inspect-art{display:none}.duel3d .side.has-detail>.inspect{padding:9px 11px}.duel3d .side .inspect>.small{font-size:9px;padding-bottom:6px}.duel3d .side .inspect strong,.duel3d[lang=en] .side .inspect strong{font-size:15px;margin:7px 0}.duel3d .side .inspect p{font-size:10px;line-height:1.5;margin:7px 0}.duel3d .side .inspect .cost-copy{font-size:10px;padding-bottom:7px}
 .duel3d .action-dock,.duel3d[lang=en] .action-dock{right:14px;width:calc(var(--rail-right) - 26px);gap:6px}.duel3d .action-dock button,.duel3d[lang=en] .action-dock button{font-size:10px;min-height:38px;padding:8px 6px}.duel3d .action-dock .hint{font-size:9px;padding-bottom:4px}
 .duel3d .row .unit .unit-title,.duel3d .row .unit.defense-form .unit-title,.duel3d[lang=en] .row .unit .unit-title{font-size:9px;padding:2px 3px}.duel3d .row .unit .unit-stats,.duel3d .row .unit.defense-form .unit-stats,.duel3d .row .unit.hidden-unit .unit-stats{font-size:11px;min-height:18px;padding:2px 3px;gap:8px}.duel3d .row .unit.caption-inset .unit-title{bottom:18px}
}
/* Center the phase ornament and reserve life/portrait columns explicitly. */
.duel3d .battle-hud,.duel3d[lang=en] .battle-hud{left:calc(50% + (var(--rail-left) - var(--rail-right))/2);right:auto;transform:translateX(-50%);width:min(670px,calc(100% - var(--rail-left) - var(--rail-right) - 28px))}
.duel3d .master .vitals{grid-template-columns:1fr;justify-content:stretch;justify-items:stretch;align-items:start}.duel3d .master .hp{justify-self:start;align-self:start}.duel3d .master .hp b{font-variant-numeric:tabular-nums}
@media(min-width:1000px) and (min-height:720px) and (max-height:819px){
 .duel3d .master{min-height:173px;padding:10px 9px;gap:5px}.duel3d .master .avatar{width:51px;height:51px;top:48px;right:14px}.duel3d .master .hp{height:53px;width:62px;margin:0}.duel3d .master .hp b{font-size:32px}.duel3d .master .master-sub{font-size:8px}.duel3d .master .qi{padding-top:2px;gap:5px}.duel3d .master .grave-link{padding-top:5px}.duel3d .side .inspect-art{height:94px;margin:8px 0 10px}.duel3d .side .inspect strong,.duel3d[lang=en] .side .inspect strong{font-size:17px;margin:7px 0}.duel3d .side .inspect p{font-size:11px;line-height:1.5;margin:7px 0}
}
.duel3d .row .unit .unit-title,.duel3d .row .unit.defense-form .unit-title,.duel3d[lang=en] .row .unit .unit-title,.duel3d .row .unit.hidden-unit .unit-title{display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;max-height:calc(2.3em + 6px);overflow:hidden}
@media(min-width:1000px) and (max-height:719px){.duel3d .row .unit .unit-title,.duel3d .row .unit.defense-form .unit-title,.duel3d[lang=en] .row .unit .unit-title{max-height:calc(2.3em + 4px)}}

.duel3d .master .avatar{pointer-events:none}.duel3d .master .strike-master{position:relative;z-index:2}.duel3d .master:has(.strike-master) .avatar{opacity:.16}
@media(min-width:1000px) and (min-height:820px){.duel3d .master .avatar{top:64px}}
@media(min-width:1000px) and (min-height:720px) and (max-height:819px){.duel3d .master .avatar{top:58px}}
