:root{
 --dts-bg:#090e14;--dts-panel:#111922;--dts-panel-2:#18232c;--dts-line:#3e4a52;
 --dts-amber:#d9a052;--dts-amber-hi:#f0c37f;--dts-text:#f3ead9;--dts-muted:#aab5b8;
 --dts-danger:#d45d58;--dts-ok:#5c9d7b;
}
body:has(.home-shell){
 margin:0;background:#090e14!important;
 background-image:radial-gradient(ellipse at 50% -15%,#303c48 0,#111922 38%,#080d12 80%)!important;
 color:var(--dts-text);font:15px/1.65 system-ui,-apple-system,"Microsoft JhengHei","PingFang TC",sans-serif;
}
body:has(.home-shell)>.title{font-size:0!important;line-height:1;margin:18px auto 8px!important;text-decoration:none!important}
body:has(.home-shell)>.title:after{content:"終局戰場";font:800 28px/1.2 Georgia,"Microsoft JhengHei",serif;letter-spacing:.16em;color:#f4e5c9;text-shadow:0 3px 24px #d8973f44}
body:has(.home-shell)>.headerlink{max-width:1180px;margin:0 auto 14px;display:flex;justify-content:center;gap:5px;flex-wrap:wrap;padding:0 12px;box-sizing:border-box}
body:has(.home-shell)>.headerlink a{display:inline-flex;align-items:center;min-height:36px;padding:3px 10px;border:1px solid #3d4952;background:#17212a;color:#cbd3d2;text-decoration:none;border-radius:2px;font-size:12px;transition:border-color .2s,color .2s,background .2s}
body:has(.home-shell)>.headerlink a:hover{border-color:var(--dts-amber);color:#ffe0aa;background:#222b31}
body:has(.home-shell)>.headerlink a:focus-visible,.home-shell a:focus-visible,.home-shell input:focus-visible,.home-shell button:focus-visible{outline:3px solid #ffd38d;outline-offset:2px}
.home-shell{max-width:1440px;margin:0 auto 42px;padding:0 14px;box-sizing:border-box;text-align:left}
.home-hero{position:relative;min-height:510px;overflow:hidden;border:1px solid #6c665c;border-top:2px solid var(--dts-amber);background:url("/img/dts-battlefield-dusk.webp") center 48%/cover no-repeat;box-shadow:0 24px 60px #000a}
.home-hero-shade{position:absolute;inset:0;background:linear-gradient(90deg,#080d12f2 0%,#0b1118c4 38%,#0a0f1650 68%,#070b10c8 100%),linear-gradient(0deg,#090e14 0%,transparent 47%)}
.home-hero-content{position:relative;z-index:1;width:min(620px,72%);padding:92px 64px 130px}
.home-eyebrow{display:block;margin-bottom:12px;color:var(--dts-amber-hi);font:700 11px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.2em}
.home-hero h1{margin:0;color:#fff2d9;font:900 clamp(42px,6vw,78px)/1.04 Georgia,"Microsoft JhengHei",serif;letter-spacing:.09em;text-shadow:0 8px 26px #000}
.home-hero p{max-width:540px;margin:20px 0 28px;color:#d1d5cf;font-size:17px;line-height:1.8}
.home-actions{display:flex;gap:10px;flex-wrap:wrap}.home-actions a{display:inline-flex;justify-content:center;align-items:center;min-height:48px;padding:0 22px;border-radius:2px;text-decoration:none;font-weight:800;letter-spacing:.04em;transition:transform .2s,filter .2s,background .2s}
.home-primary{background:linear-gradient(180deg,#e1ad60,#9b682f);border:1px solid #f0c67e;color:#17130f}.home-secondary{background:#0c1218cc;border:1px solid #7a766d;color:#eee4d0}
.home-actions a:hover{transform:translateY(-2px);filter:brightness(1.08)}
.home-trust{position:absolute;z-index:2;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(3,1fr);background:#0a1017e8;border-top:1px solid #5a5e5b;backdrop-filter:blur(8px)}
.home-trust span{display:flex;align-items:center;gap:12px;min-height:76px;padding:0 24px;color:#c0c9c8;font-size:13px}.home-trust span+span{border-left:1px solid #40494c}.home-trust b{color:var(--dts-amber-hi);font:700 12px ui-monospace,monospace}
.home-console{margin-top:16px;border:1px solid #4b555c;border-top:2px solid #b78343;background:linear-gradient(145deg,#17212a,#0d141a 65%);box-shadow:0 18px 42px #0008;overflow:hidden}
.home-grid{width:min(1180px,100%)!important;margin:0 auto!important;border-spacing:10px!important;padding:16px!important;box-sizing:border-box;color:#dce0db}
.home-grid td{border-color:#3e4a52!important}.home-grid>tbody>tr:first-child td,.home-grid>tbody>tr:nth-child(2) td,.home-grid>tbody>tr:nth-child(3) td{background:#141e26;border:1px solid #3d4951;padding:8px 10px}
.home-grid .yellow{color:#e6b86f!important}.home-grid .evergreen,.home-grid .evergreen2{color:#cfe0d5!important}.home-grid .grey{color:#9aa7aa!important}.home-grid .red{color:#e47e74!important}.home-grid .lightblue{color:#8fc6d7!important}
#home-status-panel,#live-rooms{padding:18px!important;background:#0d151c!important;border:1px solid #596067!important;box-shadow:0 10px 24px #0007;vertical-align:top!important}
#home-status-panel:before{content:"戰況與登入";display:block;margin:0 0 14px;padding-bottom:10px;border-bottom:1px solid #404c54;color:#f0ce98;font-weight:800;letter-spacing:.07em}
#live-rooms:before{content:"即時房間";display:block;margin:0 0 14px;padding-bottom:10px;border-bottom:1px solid #404c54;color:#f0ce98;font-weight:800;letter-spacing:.07em}
.home-grid form{margin:14px 0;padding:14px;background:#151f27;border:1px solid #3e4c55}
.home-grid input[type=text],.home-grid input[type=password]{min-height:40px;margin:5px 8px;padding:4px 10px;box-sizing:border-box;border:1px solid #68747b;border-radius:2px;background:#0b1218;color:#f5eee1;font-size:15px}
.home-grid input[type=submit],.home-grid input[type=button],.home-grid button{min-height:42px;padding:5px 14px;border:1px solid #b78749;border-radius:2px;background:linear-gradient(#b47a36,#765027);color:#fff1d5;font:700 13px system-ui;cursor:pointer}
.home-grid .gscroll{width:100%!important;max-width:100%;overflow:auto!important;border:1px solid #3d4951;background:#0a1117}
.home-grid .gscroll table{min-width:620px;width:100%;border-collapse:collapse}.home-grid .gscroll td{padding:7px 6px;border:1px solid #344048!important}.home-grid .gscroll .b1{background:#26313a!important;color:#e8c68f!important}.home-grid .gscroll .b3{background:#111a21!important;color:#d5dad5!important}
body:has(.home-shell) #footer,body:has(.home-shell) .footer{color:#89979b}
@media(max-width:900px){
 body:has(.home-shell)>.title:after{font-size:23px}.home-shell{padding:0 10px}.home-hero{min-height:520px}.home-hero-content{width:auto;padding:65px 22px 160px}.home-hero h1{font-size:48px}.home-hero p{font-size:15px}.home-trust span{padding:0 10px;min-height:70px;font-size:11px;gap:6px}
 .home-grid{display:block!important;padding:10px!important}.home-grid>tbody,.home-grid>tbody>tr,.home-grid>tbody>tr>td{display:block!important;width:auto!important;height:auto!important}.home-grid>tbody>tr>td:empty{display:none!important}
 .home-grid>tbody>tr:first-child td,.home-grid>tbody>tr:nth-child(2) td,.home-grid>tbody>tr:nth-child(3) td{margin:4px 0}.home-grid>tbody>tr:first-child td:nth-child(3),.home-grid>tbody>tr:nth-child(2) td:nth-child(3),.home-grid>tbody>tr:nth-child(3) td:nth-child(3){display:none!important}
 #home-status-panel,#live-rooms{margin-top:10px;padding:14px!important}.home-grid input[type=text],.home-grid input[type=password]{display:block;width:100%;margin:7px 0}.home-grid input[type=submit]{width:100%;margin-top:6px}
}
@media(max-width:480px){body:has(.home-shell)>.headerlink{display:none}.home-hero{min-height:560px}.home-hero-content{padding-top:56px}.home-hero h1{font-size:42px}.home-actions a{width:100%;box-sizing:border-box}.home-trust{grid-template-columns:1fr}.home-trust span{min-height:44px}.home-trust span+span{border-left:0;border-top:1px solid #394247}.home-hero-content{padding-bottom:170px}}
@media(max-width:480px){body:has(.home-shell) .headerlink{display:flex!important;padding:0 10px!important;margin-bottom:10px!important;gap:5px!important}body:has(.home-shell) .headerlink a{display:none!important}body:has(.home-shell) .headerlink a:nth-child(-n+3){display:inline-flex!important;flex:1;align-items:center;justify-content:center;min-width:0;min-height:44px;padding:3px 5px!important}}
@media(prefers-reduced-motion:reduce){.home-shell *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
/* UX layout v2: user-first lobby */
.home-hero{min-height:440px}
.home-hero-content{padding-top:72px;padding-bottom:112px}
.home-trust span{min-height:64px}
.home-dashboard{margin-top:18px;padding:26px;border:1px solid #45515a;border-top:2px solid var(--dts-amber);background:linear-gradient(145deg,#141e26,#0b1218 72%);box-shadow:0 18px 42px #0008}
.home-section-head,.home-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}
.home-section-head{padding-bottom:18px;border-bottom:1px solid #35424a}
.home-section-kicker{display:block;margin-bottom:4px;color:#b88a4e;font:700 10px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.2em}
.home-section-head h2,.home-panel-head h2{margin:0;color:#f2dfbd;font:800 26px/1.2 Georgia,"Microsoft JhengHei",serif;letter-spacing:.06em}
.home-round-state{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px;max-width:55%}
.home-round-state span,.home-round-state strong{min-height:34px;padding:6px 10px;display:inline-flex;align-items:center;border:1px solid #45525a;background:#111a21;color:#cbd5d2;font-size:13px}
.home-round-state strong:last-child{border-color:#7f633e;color:#f0c17b}
.home-meta-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;margin:18px 0}
.home-meta-card:has(strong:empty){display:none}
.home-meta-card{min-width:0;padding:14px 16px;border:1px solid #35434b;background:#101920}
.home-meta-card span{display:block;margin-bottom:5px;color:#8d9b9e;font-size:11px;letter-spacing:.08em}
.home-meta-card strong{display:block;overflow-wrap:anywhere;color:#e2e7df;font-size:14px;line-height:1.45}
.home-lobby-grid{display:grid;grid-template-columns:minmax(330px,.9fr) minmax(520px,1.4fr);gap:18px;align-items:stretch}
#home-status-panel.home-panel,#live-rooms.home-panel{width:auto!important;margin:0!important;padding:24px!important;background:#0d151c!important;border:1px solid #45525a!important;box-shadow:0 12px 28px #0007;text-align:left!important}
#home-status-panel:before,#live-rooms:before{content:none!important;display:none!important}
.home-panel-head{min-height:54px;margin-bottom:18px;padding-bottom:14px;border-bottom:1px solid #344149}
.home-panel-head h2{font-size:22px}
.home-status-badge{min-height:30px;padding:5px 9px;border:1px solid #59656a;background:#151e24;color:#bec8c7;font-size:12px;font-weight:800}
.home-status-badge.is-live{border-color:#4e8068;color:#93d1ad}
.home-status-summary{padding:16px;border-left:3px solid #a7753b;background:#121c23}
.home-status-summary p{margin:4px 0}
.home-lead{color:#f3e6ce;font-size:17px}
.home-muted{color:#99a5a7}
.home-last-result{margin-top:12px!important;padding-top:12px;border-top:1px solid #344149;color:#b8c2c1}
.home-detail-note{display:grid;gap:3px;margin:14px 0;padding:11px 13px;border:1px solid #4b4850;background:#191923}
.home-detail-note strong{color:#d7b881}.home-detail-note span{color:#a8afb1;font-size:12px}
.home-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:14px 0}
.home-stat-grid>div{min-width:0;padding:12px;border:1px solid #35434b;background:#111a21}
.home-stat-grid span{display:block;color:#8e9b9e;font-size:11px}.home-stat-grid strong{display:block;margin-top:4px;color:#ead7b5;font-size:14px}
.home-warning{margin:12px 0;padding:10px 12px;border-left:3px solid #b55e56;background:#231719;color:#d9b9b5;font-size:13px}
.home-account-area{margin-top:16px;padding-top:16px;border-top:1px solid #344149}
.home-welcome{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.home-welcome span{color:#93a0a3;font-size:12px}.home-welcome strong{color:#eee1c9}
.home-account-actions{display:grid;grid-template-columns:2fr 1fr;gap:10px}
.home-action-form{margin:0!important;padding:0!important;border:0!important;background:transparent!important}
.home-account-actions input{width:100%;min-height:48px!important;margin:0!important}
.home-enter-button{border-color:#d6a35e!important;background:linear-gradient(180deg,#d39a4a,#8c5b27)!important;color:#16110b!important;font-size:15px!important}
.home-logout-button{border-color:#47545c!important;background:#172129!important;color:#bbc4c3!important}
.home-login-form{display:grid;grid-template-columns:1fr 1fr auto;gap:10px;margin:0!important;padding:0!important;border:0!important;background:transparent!important}
.home-login-form label span{display:block;margin-bottom:5px;color:#9ba7a9;font-size:12px}
.home-login-form input[type=text],.home-login-form input[type=password]{width:100%;min-height:46px;margin:0}
.home-login-form .home-enter-button{align-self:end;min-height:46px}
.home-login-form p{grid-column:1/-1;margin:0;color:#8e9a9c;font-size:12px}
.home-room-list{max-width:100%;overflow:hidden}
.home-room-list .gscroll{width:100%!important;max-width:100%;overflow:auto!important;border:1px solid #36444c;background:#091117}
.home-room-list .gscroll table{width:100%;min-width:650px;border-collapse:collapse}
.home-new-player{margin-top:16px;padding:16px;border:1px solid #3a474f;background:#111a21}
.home-new-player>strong{color:#ecd2a5;font-size:15px}.home-new-player p{margin:5px 0 12px;color:#9ca7a9}
.home-new-player>div{display:flex;flex-wrap:wrap;gap:8px}
.home-new-player a{min-height:42px;padding:8px 12px;display:inline-flex;align-items:center;border:1px solid #7f623c;text-decoration:none;font-weight:800}
.home-guide-link{background:#2b2117;color:#efc47e}.home-alt-link{border-color:#425f69!important;background:#14232a;color:#9bcbd6}
@media(max-width:1050px){.home-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.home-lobby-grid{grid-template-columns:1fr}.home-round-state{max-width:60%}}
@media(max-width:700px){.home-dashboard{padding:14px}.home-section-head,.home-panel-head{gap:10px}.home-section-head{display:block}.home-round-state{justify-content:flex-start;max-width:none;margin-top:12px}.home-meta-grid{grid-template-columns:1fr}.home-lobby-grid{display:block}.home-panel+.home-panel{margin-top:12px!important}.home-stat-grid{grid-template-columns:1fr 1fr}.home-account-actions{grid-template-columns:1fr}.home-login-form{grid-template-columns:1fr}.home-login-form .home-enter-button{width:100%}.home-new-player a{width:100%;justify-content:center}}
@media(max-width:480px){.home-hero{min-height:520px}.home-hero-content{padding-bottom:150px}.home-meta-card{padding:12px}#home-status-panel.home-panel,#live-rooms.home-panel{padding:16px!important}.home-stat-grid{grid-template-columns:1fr 1fr}}


/* First-session onboarding path */
.home-onboarding{
  margin-top:18px;
  padding:24px 26px;
  border:1px solid #4b5860;
  border-top:2px solid var(--dts-amber);
  background:linear-gradient(135deg,#17222b,#0d151c 72%);
  box-shadow:0 16px 38px #0007;
}
.home-onboarding-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:24px;
  padding-bottom:18px;
  border-bottom:1px solid #35424a;
}
.home-onboarding-head h2{
  margin:0;
  color:#f3dfbd;
  font:800 clamp(22px,2.4vw,30px)/1.25 Georgia,"Microsoft JhengHei",serif;
  letter-spacing:.04em;
}
.home-onboarding-head p{
  margin:8px 0 0;
  color:#aab5b6;
  line-height:1.7;
}
.home-onboarding-head>a{
  flex:0 0 auto;
  min-height:44px;
  padding:9px 13px;
  display:inline-flex;
  align-items:center;
  border:1px solid #59676e;
  color:#c9d2d1;
  text-decoration:none;
  font-weight:700;
}
.home-onboarding-steps{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin:18px 0;
  padding:0;
  list-style:none;
}
.home-onboarding-steps li{
  min-width:0;
  padding:16px;
  display:grid;
  grid-template-columns:38px minmax(0,1fr);
  gap:12px;
  border:1px solid #37454d;
  background:#0e171e;
}
.home-onboarding-steps li>span{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:1px solid #8a673c;
  color:#f0bf76;
  font:800 12px ui-monospace,Consolas,monospace;
}
.home-onboarding-steps strong{
  display:block;
  color:#ead9bb;
  font-size:15px;
}
.home-onboarding-steps p{
  margin:5px 0 0;
  color:#95a2a4;
  font-size:13px;
  line-height:1.65;
}
.home-onboarding-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}
.home-onboarding-actions a{
  min-height:46px;
  padding:10px 16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #8c6a3d;
  text-decoration:none;
  font-weight:800;
}
.home-onboarding-primary{
  background:linear-gradient(180deg,#d5a254,#936129);
  color:#17120c;
}
.home-onboarding-secondary{
  border-color:#50616a!important;
  background:#142029;
  color:#c8d2d1;
}
.home-onboarding-actions>span{
  color:#9da9aa;
  font-size:13px;
}
@media(max-width:820px){
  .home-onboarding-head{display:block}
  .home-onboarding-head>a{margin-top:14px}
  .home-onboarding-steps{grid-template-columns:1fr}
}
@media(max-width:520px){
  .home-onboarding{padding:18px 14px}
  .home-onboarding-actions a{width:100%}
}


/* ===== Home world-building v1: survival broadcast, not a dashboard ===== */
body:has(.home-shell)>.headerlink{counter-reset:home-nav}
body:has(.home-shell)>.headerlink a:before{
  counter-increment:home-nav;
  content:counter(home-nav,decimal-leading-zero);
  margin-right:6px;
  color:#718084;
  font:700 9px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
}
body:has(.home-shell)>.headerlink a.is-active:before{color:#e5ad5e}
.home-hero{
  isolation:isolate;
  border-radius:0;
  box-shadow:0 30px 80px #000c,inset 0 0 80px rgba(0,0,0,.2);
}
.home-hero:before{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:
    linear-gradient(rgba(102,151,156,.12) 1px,transparent 1px),
    linear-gradient(90deg,rgba(102,151,156,.1) 1px,transparent 1px),
    linear-gradient(90deg,transparent 49.85%,rgba(224,169,86,.16) 50%,transparent 50.15%),
    linear-gradient(transparent 49.85%,rgba(224,169,86,.12) 50%,transparent 50.15%);
  background-size:72px 72px,72px 72px,100% 100%,100% 100%;
  mask-image:linear-gradient(90deg,black,rgba(0,0,0,.2) 78%,transparent);
}
.home-hero:after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:-20%;
  z-index:2;
  height:18%;
  pointer-events:none;
  background:linear-gradient(to bottom,transparent,rgba(111,209,204,.12),rgba(229,172,86,.24),transparent);
  filter:blur(8px);
  animation:home-sector-scan 8.5s cubic-bezier(.35,0,.65,1) infinite;
}
.home-hero-shade{z-index:0}
.home-hero-content{z-index:3;animation:home-hero-in .65s cubic-bezier(.2,.8,.2,1) both}
.home-hero-content:after{
  content:"SECTOR 07  /  SURVIVAL BROADCAST  /  LIVE";
  display:block;
  width:max-content;
  max-width:100%;
  margin-top:22px;
  padding:6px 9px;
  border-left:2px solid #d8a154;
  background:rgba(6,14,19,.7);
  color:#8fa1a4;
  font:700 9px/1.2 ui-monospace,SFMono-Regular,Consolas,monospace;
  letter-spacing:.14em;
}
.home-trust{z-index:3}
.home-trust span{position:relative}
.home-trust span:after{
  content:"";
  position:absolute;
  right:18px;
  width:5px;
  height:5px;
  border-radius:50%;
  background:#5e9d83;
  box-shadow:0 0 10px rgba(94,157,131,.6);
}
.home-dashboard,
.home-onboarding{
  position:relative;
  border-radius:0;
  overflow:hidden;
  background:
    linear-gradient(135deg,rgba(217,160,79,.05),transparent 35%),
    repeating-linear-gradient(90deg,transparent 0 63px,rgba(100,145,149,.025) 63px 64px),
    linear-gradient(145deg,#141e26,#0b1218 72%);
}
.home-dashboard:before,
.home-onboarding:before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:74px;
  height:2px;
  background:#e0a453;
  box-shadow:0 0 20px rgba(224,164,83,.3);
}
.home-meta-card,
#home-status-panel.home-panel,
#live-rooms.home-panel,
.home-onboarding-steps li,
.home-new-player{
  border-radius:0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.018);
}
.home-meta-card:before{
  content:"";
  display:block;
  width:18px;
  height:2px;
  margin-bottom:9px;
  background:#5e7479;
}
.home-section-head h2,
.home-panel-head h2,
.home-onboarding-head h2{
  font-family:"Bahnschrift Condensed","Arial Narrow","Microsoft JhengHei",sans-serif;
  letter-spacing:.04em;
}
.home-status-badge.is-live:before{
  content:"";
  width:6px;
  height:6px;
  margin-right:6px;
  border-radius:50%;
  background:#69c990;
  animation:dts-signal-pulse 2.4s ease-in-out infinite;
}
.home-actions a,
.home-onboarding-actions a,
.home-new-player a{
  border-radius:0;
}
.home-actions a:active,
.home-onboarding-actions a:active,
.home-new-player a:active{transform:translateY(1px) scale(.985)}
@keyframes home-sector-scan{0%,14%{transform:translateY(-30vh);opacity:0}30%{opacity:1}100%{transform:translateY(135vh);opacity:0}}
@keyframes home-hero-in{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
@media(max-width:700px){
  .home-hero-content:after{width:auto;line-height:1.5}
  .home-trust span:after{right:9px}
}
@media(max-width:480px){
  body:has(.home-shell)>.headerlink a:before{display:none}
  .home-hero:before{background-size:48px 48px,48px 48px,100% 100%,100% 100%}
}
@media(prefers-reduced-motion:reduce){
  .home-hero:after,.home-hero-content,.home-status-badge.is-live:before{animation:none!important}
}
