
/* Passing a Zillot-marked floor must not erase the informational amber tint. */
.cell.zillot:has(.x){background:#493a1a!important}
.map-inner{min-width:0;width:100%}
.map-scroll{overflow-x:hidden}
.gridrow{width:100%;grid-template-columns:44px repeat(15,minmax(0,1fr))}
.gridrow .cell:not(.floor){min-width:0;font-size:clamp(11px,1.1vw,17px)}
.gridrow.header .cell:not(.floor){font-size:clamp(9px,.9vw,13px)}
.cell.floor{padding-left:8px}
.legend{display:none}
.map-scroll{height:calc(100dvh - 224px);min-height:420px;max-height:none}
.layout>.card:first-child{display:flex;flex-direction:column;min-height:calc(100dvh - 224px)}
.layout>.card:first-child>.map-scroll{flex:1 1 auto;height:0;min-height:420px}
.footer{display:none}
.hint.zillot-warning{border-color:#c18a2f;background:#453314;color:#ffe1a0}
.route-summary{border-bottom:1px solid #294459;padding:12px 15px;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.route-summary h3{margin:0 12px 0 0;font-size:15px}
.route-summary .line{margin:0;gap:9px}
.route-summary .hint{margin:0;flex:1 1 240px}
.route-summary .position{font-size:18px}
@media(max-width:700px){.route-summary{gap:10px}.route-summary .line{flex:1 1 140px}.route-summary .hint{flex-basis:100%}}
.map-selected-summary{margin-left:auto;max-width:55%;padding:0 0 0 16px;border:0;border-left:1px solid #2a465b;min-width:230px}
.map-selected-summary h3{margin:0 0 5px;font-size:14px;color:#b7d2e6}
.map-selected-summary #selectedInfo{font-size:12px;line-height:1.5}
.map-selected-summary .set-position{margin-top:8px;white-space:nowrap}
#mapPage .layout>.card>.toolbar{align-items:flex-start;flex-wrap:nowrap;gap:16px;padding:12px 16px}
#mapPage .layout>.card>.toolbar>strong{flex:0 0 auto;align-self:flex-start;line-height:34px}
.map-selected-summary{max-width:none;min-width:0;flex:1 1 auto;display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap;padding-left:16px}
.map-selected-summary h3{margin:0;white-space:nowrap;font-size:13px}
.map-selected-summary #selectedInfo{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px;min-width:0}
.map-selected-summary #selectedInfo>span,.map-selected-summary #selectedInfo>strong{white-space:nowrap}
.map-selected-summary .set-position{margin:0;padding:8px 10px}
@media(max-width:900px){#mapPage .layout>.card>.toolbar{flex-wrap:wrap}.map-selected-summary{flex-basis:100%;justify-content:flex-start;padding-left:0;border-left:0}.map-selected-summary #selectedInfo{justify-content:flex-start}}
@media(max-width:700px){.map-selected-summary{width:100%;margin:0;padding:8px 0 0}.map-selected-summary #selectedInfo{gap:7px}}
.map-actions-row{display:grid;grid-template-columns:minmax(260px,1fr) minmax(360px,1.7fr);gap:0;border-top:1px solid #294459}
.map-actions-row>.panel{min-width:0;border-bottom:0;padding:14px}
.map-actions-row>.panel+.panel{border-left:1px solid #294459}
.map-actions-row .event-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.map-actions-row .event{min-height:46px}
@media(max-width:900px){.map-actions-row{grid-template-columns:1fr}.map-actions-row>.panel+.panel{border-left:0;border-top:1px solid #294459}}
@media(max-width:700px){.map-selected-summary{max-width:none;min-width:0;width:100%;margin:10px 0 0;padding:10px 0 0;border-left:0;border-top:1px solid #2a465b}.map-actions-row .event-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.gridrow .cell.unreachable{background:#091522!important;color:#45586b!important;cursor:not-allowed;pointer-events:none}
.gridrow .cell.unreachable:before{content:none}
/* Only the signed-in player's own route history gets the turquoise X styling. */
.gridrow .cell.my-trail{box-shadow:inset 0 0 0 2px #19d4b3;background-color:#103c3c}
.gridrow .cell.my-trail .x{color:#33f5d1!important;font-weight:900;text-shadow:0 0 7px #19d4b388}
@media(max-width:700px){.gridrow{grid-template-columns:34px repeat(15,minmax(0,1fr))}.gridrow .cell:not(.floor){font-size:11px}.gridrow.header .cell:not(.floor){font-size:9px}.cell.floor{padding-left:5px;font-size:11px}}
@media(max-width:700px){.map-scroll{height:calc(100dvh - 252px);min-height:380px}}
@media(max-width:1150px){.layout>.card:first-child{min-height:calc(100dvh - 224px)}.layout>.card:first-child>.map-scroll{height:calc(100dvh - 290px);flex:auto}}
@media(max-width:700px){.layout>.card:first-child{min-height:calc(100dvh - 252px)}.layout>.card:first-child>.map-scroll{height:calc(100dvh - 318px);min-height:380px}}
/* Mobile: the grid must appear immediately after a compact title/selection bar.
   The player's route details and movement controls follow the grid. */
@media(max-width:700px){
  main{padding:12px 10px 24px}
  aside{padding:8px 10px;gap:5px}
  aside .brand{font-size:16px;margin-right:7px}
  aside .nav{font-size:12px;padding:9px 10px}
  .top{gap:9px;margin-bottom:12px}
  .top h1{font-size:21px}
  .top .controls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;width:100%}
  .top .controls label{min-width:0;margin:0}
  .top .controls select{width:100%;min-width:0}
  .top .controls .pill{white-space:nowrap;padding:9px}
  .top .controls .auth-button{grid-column:1/-1;justify-self:start}
  .map-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:0 0 12px}
  .map-tools label{grid-column:1/-1;min-width:0}
  .map-tools label select{width:100%;max-width:none}
  .map-tools .smallbtn{min-height:42px}
  .map-tools #managePrivateMap{grid-column:1/-1;justify-self:start}
  .map-tools .map-access-panel{grid-column:1/-1}
  .stats{gap:6px;margin-bottom:12px}
  .stat{min-width:0;padding:9px 8px}
  .stat small{font-size:10px;line-height:1.2;display:block;min-height:30px}
  .stat b{font-size:23px}
  #mapPage .layout>.card:first-child{display:flex;flex-direction:column;min-height:0}
  #mapPage .layout>.card>.toolbar{order:0;display:grid;grid-template-columns:1fr;gap:6px;padding:11px 12px;align-items:start}
  #mapPage .layout>.card>.toolbar>strong{line-height:1.35;white-space:normal;overflow-wrap:anywhere;font-size:15px}
  .map-selected-summary{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;row-gap:4px;border:0;border-top:1px solid #294459;padding:8px 0 0;margin:0}
  .map-selected-summary h3{grid-column:1/-1;font-size:12px}
  .map-selected-summary #selectedInfo{justify-content:flex-start;font-size:11px;min-width:0;overflow-wrap:anywhere}
  .map-selected-summary #selectedInfo>span,.map-selected-summary #selectedInfo>strong{white-space:normal}
  .map-selected-summary .set-position{font-size:11px;white-space:normal;max-width:115px;padding:6px 8px;align-self:center}
  #mapPage .layout>.card:first-child>#importStatus{order:1}
  #mapPage .layout>.card:first-child>.map-scroll{order:2;height:52dvh;min-height:300px;flex:none}
  #mapPage .layout>.card:first-child>.map-actions-row{order:3}
  #mapPage .layout>.card:first-child>.legend{order:4}
  #mapPage .layout>.card:first-child>.route-summary{order:5;padding:12px;border-top:1px solid #294459}
  .map-actions-row>.panel{padding:10px}
  .action{padding:9px 3px}
  .right{margin-top:10px}
}
