/* Command-deck header: native controls over the existing dark game texture. */
body[data-theme=modern] .realm-shell-header.command-header{isolation:isolate;position:relative;flex:none;border:0;background:linear-gradient(110deg,#101212ed,#121312ed 45%,#0c0f0eee),url('../themes/bnet/res/d2-bg.jpg') center/480px auto;box-shadow:inset 0 1px #b49560,inset 0 -1px #c6a66b,0 7px 24px #0006}
body[data-theme=modern] .command-header::before{content:'';position:absolute;z-index:1;inset:5px;pointer-events:none;border:1px solid #80623c;box-shadow:0 0 0 1px #1c1712,inset 0 0 0 1px #d3ad6420;background:linear-gradient(135deg,transparent 15px,#99764b 15px,#99764b 16px,transparent 16px) top left/40px 40px no-repeat,linear-gradient(225deg,transparent 15px,#99764b 15px,#99764b 16px,transparent 16px) top right/40px 40px no-repeat,linear-gradient(45deg,transparent 15px,#99764b 15px,#99764b 16px,transparent 16px) bottom left/40px 40px no-repeat,linear-gradient(315deg,transparent 15px,#99764b 15px,#99764b 16px,transparent 16px) bottom right/40px 40px no-repeat}
body[data-theme=modern] .command-header::after{content:'';position:absolute;z-index:1;inset:9px;pointer-events:none;background:radial-gradient(circle at 5px 5px,#c1a16c 1px,#685034 3px,#17140e 5px,transparent 6px) top left/16px 16px no-repeat,radial-gradient(circle at 11px 5px,#c1a16c 1px,#685034 3px,#17140e 5px,transparent 6px) top right/16px 16px no-repeat,radial-gradient(circle at 5px 11px,#c1a16c 1px,#685034 3px,#17140e 5px,transparent 6px) bottom left/16px 16px no-repeat,radial-gradient(circle at 11px 11px,#c1a16c 1px,#685034 3px,#17140e 5px,transparent 6px) bottom right/16px 16px no-repeat}
body[data-theme=modern] .command-header .realm-tools{position:relative;z-index:2;display:grid;grid-template-columns:240px minmax(0,1fr) 200px 170px;align-items:center;width:min(var(--realm-shell-width),calc(100% - 64px));height:110px;min-height:110px;box-sizing:border-box;margin:0 auto;padding:0;gap:18px;flex-wrap:nowrap;border:0;background:none}
body[data-theme=modern] .command-header .realm-tools>.realm-wordmark{position:relative;display:grid;grid-template-columns:58px minmax(0,1fr);grid-template-rows:1fr 1fr;align-items:center;column-gap:12px;width:240px;min-width:0;height:90px;padding:0 14px 0 0;margin:0;color:#e4c382;font:33px/1 Georgia,serif;letter-spacing:0;white-space:nowrap;box-sizing:border-box}
body[data-theme=modern] .command-header .realm-tools>.realm-wordmark::after{content:'';position:absolute;right:0;top:21px;bottom:21px;width:1px;background:linear-gradient(transparent,#a38c5a77,transparent)}
body[data-theme=modern] .command-header .realm-wordmark .brand-crest{position:static;grid-column:1;grid-row:1/3;width:58px;height:68px;filter:drop-shadow(0 4px 5px #0009)}
body[data-theme=modern] .command-header .realm-wordmark .command-brand-name{grid-column:2;grid-row:1;align-self:end;display:block;margin:0;padding:0;font:33px/1 Georgia,serif;font-variant:small-caps;color:#e5c584;text-shadow:0 2px 4px #000}
body[data-theme=modern] .command-header .realm-wordmark small{grid-column:2;grid-row:2;align-self:start;display:block;width:auto;margin:9px 0 0;padding:0;color:#bca373;font:10px/1.2 Arial,sans-serif;letter-spacing:5.5px}
body[data-theme=modern] .command-header .classic-main-nav{position:relative;display:flex;align-items:stretch;justify-content:center;min-width:0;width:auto;max-width:none;height:110px;margin:0;padding:0;gap:18px;border:0;flex:none}
body[data-theme=modern] .command-header .classic-main-nav a{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:0;min-height:44px;height:110px;margin:0;padding:0 2px;border:0;font:18px/1.3 Georgia,serif;color:#ded6c0;white-space:nowrap;text-shadow:0 2px 4px #000}
body[data-theme=modern] .command-header .classic-main-nav a:hover{color:#ffdfa0}
body[data-theme=modern] .command-header .classic-main-nav a[aria-current=page]{border:0;color:#f2cf87}
body[data-theme=modern] .command-header .classic-main-nav a[aria-current=page]::after{content:'';position:absolute;left:5%;right:5%;bottom:22px;height:2px;background:linear-gradient(90deg,transparent,#f3d58b 20%,#ffe7b6 50%,#f3d58b 80%,transparent);filter:none;box-shadow:0 0 9px #edbf6099}
body[data-theme=modern] .command-header .command-download{grid-column:3;grid-row:1;display:inline-flex;align-items:center;justify-content:center;gap:10px;box-sizing:border-box;width:200px;min-height:48px;padding:10px 13px;border:2px ridge #c9a464;background:linear-gradient(110deg,#a47632,#d3ac5d 34%,#ac7d34 75%,#805a27);box-shadow:inset 0 0 0 2px #3d2c15,inset 0 1px 8px #ffedbe70,0 0 14px #ceab4e22;border-radius:2px;color:#221a0e;font:bold 16px/1.3 Georgia,serif;text-decoration:none;text-shadow:0 1px #f7d68e;white-space:nowrap;clip-path:polygon(9px 0,calc(100% - 9px) 0,100% 9px,100% calc(100% - 9px),calc(100% - 9px) 100%,9px 100%,0 calc(100% - 9px),0 9px)}
body[data-theme=modern] .command-header .command-download>span{font:25px/1 Arial,sans-serif;color:#33220f}
body[data-theme=modern] .command-header .command-download:hover{border-color:#f3d38d;background:linear-gradient(110deg,#c39043,#e6c778 34%,#c39345 75%,#a07233)}
body[data-theme=modern] .command-header #open-registration{grid-column:4;grid-row:1;display:inline-flex;align-items:center;justify-content:center;gap:10px;box-sizing:border-box;width:170px;min-width:0;min-height:46px;height:46px;margin:0;padding:8px 12px;border:2px ridge #8f774e;border-radius:2px;background:linear-gradient(#1c211d,#0a0f0d);box-shadow:inset 0 0 0 2px #060a08;color:#dfcea8;font:15px/1.3 Georgia,serif;white-space:nowrap}
body[data-theme=modern] .command-header #open-registration span{display:inline-block;margin:0;color:#c7a666;font:22px/1 Georgia,serif}
body[data-theme=modern] .command-header #open-registration:hover{border-color:#cdb276;color:#f4dfb0;background:linear-gradient(#272c22,#121810)}
body[data-theme=modern] .command-header :is(.realm-wordmark,.classic-main-nav a,.command-download,#open-registration,#refresh-services):focus-visible{outline:2px solid #f6d898;outline-offset:5px}
body[data-theme=modern] .command-header .command-download:focus-visible{clip-path:none}
body[data-theme=modern] .command-header #realm-services{position:relative;z-index:2;box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr) 40px;width:min(var(--realm-shell-width),calc(100% - 64px));height:74px;margin:0 auto;padding:0;border:0;border-top:3px double #917345;background:linear-gradient(#11171399,#080e0c99);box-shadow:none}
body[data-theme=modern] .command-header .realm-monitor-label{display:none}
body[data-theme=modern] .command-header #service-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));height:71px;gap:0;margin:0;align-items:center;min-width:0}
body[data-theme=modern] .command-header #service-cards .service-card{position:relative;display:grid;grid-template-columns:10px minmax(0,1fr) 58px;grid-template-rows:auto auto;grid-template-areas:'light name chart' 'light code chart';align-content:center;align-items:center;column-gap:10px;row-gap:2px;box-sizing:border-box;height:58px;min-width:0;padding:0 18px;border:0;border-left:1px solid #a38b4d55;background:none;overflow:visible}
body[data-theme=modern] .command-header #service-cards .service-card:first-child{border-left:0}
body[data-theme=modern] .command-header #service-cards .service-card h3{grid-area:name;min-width:0;width:auto;margin:0;padding:0;color:#e0d6b9;font:16px/21px Georgia,serif;white-space:nowrap;text-overflow:clip;overflow:visible;letter-spacing:0}
body[data-theme=modern] .command-header #service-cards .service-card p{grid-area:code;width:auto;margin:0;padding:0;color:#b0ac95;font:12px/16px Arial,sans-serif;white-space:nowrap;letter-spacing:.4px;text-overflow:clip;overflow:visible}
body[data-theme=modern] .command-header #service-cards .service-card p::before{content:none}
body[data-theme=modern] .command-header #realm-services .service-card .service-light{grid-area:light;position:static;display:block;width:7px;height:7px;margin:0;border-radius:50%;transform:none;box-shadow:none}
body[data-theme=modern] .command-header #service-cards .service-sparkline{grid-area:chart;position:relative;display:block;flex:none;width:58px;min-width:0;height:24px;margin:0;padding:0}
body[data-theme=modern] .command-header #service-cards .service-sparkline svg{display:block;width:100%;height:24px;overflow:visible}
body[data-theme=modern] .command-header #service-cards .service-sparkline>span{position:absolute;left:0;top:5px;max-width:100%;overflow:hidden;text-overflow:ellipsis;color:#9eac90;font:10px/14px Arial,sans-serif;white-space:nowrap}
body[data-theme=modern] .command-header .service-monitor-meta{display:flex;align-items:center;justify-content:center;height:58px;min-width:0;padding:0;gap:0}
body[data-theme=modern] .command-header #refresh-services{box-sizing:border-box;width:36px;min-width:36px;height:40px;margin:0;padding:0;border:0;background:none;color:#c6a96a;font-size:0}
body[data-theme=modern] .command-header #refresh-services span{display:inline-block;margin:0;font:26px/40px Arial,sans-serif}
body[data-theme=modern] .realm-page-footer .realm-wordmark small{font-size:10px}
@media(min-width:1180px) and (max-width:1350px){
 body[data-theme=modern] .command-header .realm-tools{grid-template-columns:210px minmax(0,1fr) 182px 152px;gap:12px}
 body[data-theme=modern] .command-header .realm-tools>.realm-wordmark{grid-template-columns:50px minmax(0,1fr);column-gap:10px;width:210px;padding-right:10px}
 body[data-theme=modern] .command-header .realm-wordmark .brand-crest{width:50px;height:60px}
 body[data-theme=modern] .command-header .realm-wordmark .command-brand-name{font-size:29px}
 body[data-theme=modern] .command-header .realm-wordmark small{letter-spacing:4px}
 body[data-theme=modern] .command-header .classic-main-nav{gap:11px}
 body[data-theme=modern] .command-header .classic-main-nav a{font-size:15px}
 body[data-theme=modern] .command-header .command-download{width:182px;font-size:15px;padding-inline:9px;gap:7px}
 body[data-theme=modern] .command-header #open-registration{width:152px;font-size:14px;gap:6px;padding-inline:9px}
 body[data-theme=modern] .command-header #service-cards .service-card{grid-template-columns:8px minmax(0,1fr) 38px;column-gap:7px;padding-inline:12px}
 body[data-theme=modern] .command-header #service-cards .service-card h3{font-size:14px}
 body[data-theme=modern] .command-header #service-cards .service-sparkline{width:38px}
}
/* Basic narrow fallback; the reviewed desktop header stays one fixed row. */
@media(max-width:1179px){
 body[data-theme=modern] .command-header .realm-tools{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;width:calc(100% - 32px);height:auto;min-height:150px;padding:12px 0;gap:10px}
 body[data-theme=modern] .command-header .realm-tools>.realm-wordmark{flex:0 0 210px;grid-template-columns:47px minmax(0,1fr);width:210px;min-width:0;height:65px;column-gap:9px;margin:0;padding:0}
 body[data-theme=modern] .command-header .realm-wordmark .brand-crest{width:47px;height:56px}
 body[data-theme=modern] .command-header .realm-wordmark .command-brand-name{font-size:27px}
 body[data-theme=modern] .command-header .realm-wordmark small{font-size:10px;letter-spacing:4px;margin-top:6px}
 body[data-theme=modern] .command-header .classic-main-nav{order:5;flex:1 0 100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:4px 16px;width:100%;height:auto;min-height:42px;margin:0;padding:0}
 body[data-theme=modern] .command-header .classic-main-nav a{height:36px;min-height:36px;padding:0 1px;font-size:14px}
 body[data-theme=modern] .command-header .classic-main-nav a[aria-current=page]::after{bottom:3px}
 body[data-theme=modern] .command-header .command-download{position:static;width:180px;min-height:42px;height:42px;padding:8px 10px;font-size:14px;gap:7px}
 body[data-theme=modern] .command-header #open-registration{position:static;width:145px;min-height:42px;height:42px;padding:8px;min-width:0;margin:0;font-size:13px;gap:7px}
 body[data-theme=modern] .command-header #realm-services{grid-template-columns:minmax(0,1fr) 30px;width:calc(100% - 32px);height:144px;margin:0 auto;padding:0}
 body[data-theme=modern] .command-header #service-cards{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,1fr);height:141px}
 body[data-theme=modern] .command-header #service-cards .service-card{height:64px;padding-inline:9px;grid-template-columns:8px minmax(0,1fr) 30px;column-gap:7px;row-gap:1px}
 body[data-theme=modern] .command-header #service-cards .service-card:nth-child(odd){border-left:0}
 body[data-theme=modern] .command-header #service-cards .service-card h3{font-size:13px;line-height:16px;white-space:normal}
 body[data-theme=modern] .command-header #service-cards .service-card p{font-size:10px;line-height:14px}
 body[data-theme=modern] .command-header #service-cards .service-sparkline{width:30px}
 body[data-theme=modern] .command-header #realm-services .service-card .service-light{width:6px;height:6px}
 body[data-theme=modern] .command-header .service-monitor-meta{height:64px}
 body[data-theme=modern] .command-header #refresh-services{width:30px;min-width:30px}
}
@media(prefers-reduced-motion:reduce){body[data-theme=modern] .command-header :is(a,button,.service-light){transition:none}}
/* Give navigation its own row before fixed action buttons can squeeze its text. */
@media(min-width:761px) and (max-width:1179px){
 body[data-theme=modern] .command-header .realm-tools{display:grid;grid-template-columns:minmax(210px,1fr) 182px 152px;grid-template-rows:auto auto;height:auto;min-height:0;gap:6px 18px;padding:12px 0 0}
 body[data-theme=modern] .command-header .realm-tools>.realm-wordmark{grid-column:1;grid-row:1}
 body[data-theme=modern] .command-header .command-download{grid-column:2;grid-row:1;width:182px}
 body[data-theme=modern] .command-header #open-registration{grid-column:3;grid-row:1;width:152px}
 body[data-theme=modern] .command-header .classic-main-nav{grid-column:1/-1;grid-row:2;width:100%;height:54px;min-height:54px;gap:22px}
 body[data-theme=modern] .command-header .classic-main-nav a{height:54px;font-size:16px}
}
@media(max-width:760px){
 body[data-theme=modern] .realm-shell-header.command-header .realm-tools{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:auto auto auto;min-height:0;height:auto;width:calc(100% - 32px)!important;padding:12px 0!important;gap:8px!important}
 body[data-theme=modern] .command-header .realm-tools>.realm-wordmark{grid-column:1/-1!important;grid-row:1!important;justify-self:center;width:210px;height:68px}
 body[data-theme=modern] .command-header .command-download{grid-column:1;grid-row:2;width:100%;min-width:0;font-size:13px;padding-inline:5px;gap:5px}
 body[data-theme=modern] .command-header #open-registration{grid-column:2!important;grid-row:2!important;width:100%;min-width:0;margin:0;font-size:12px;padding-inline:5px}
 body[data-theme=modern] .command-header .classic-main-nav{grid-column:1/-1;grid-row:3;display:flex;flex-wrap:wrap;justify-content:center;gap:0 14px;height:auto;min-height:42px;margin:0}
 body[data-theme=modern] .command-header .classic-main-nav a{font-size:13px;min-height:40px;height:40px}
}
