/* Travel Map, "Station Grid" redesign (2026-10-19).
 *
 * One screen, no page scroll (like the page it replaces): a slim bar under the navbar, then the six maps fill the
 * rest of the viewport, 3 x 2 on a desktop and 2 x 3 on a phone. Tokens (--dz-*) come from site-nav.css. Everything
 * is scoped under .dzt. The station colours (--c on a pin or dot) are set from static/js/travel-map.js.
 */
.dzt {
    --dzt-display: 'Oswald', 'Roboto', system-ui, sans-serif;
    --dzt-mono: 'Roboto Mono', ui-monospace, monospace;
    height: calc(100dvh - 65px);          /* base.html's navbar: h-16 + its 1px bottom border */
    min-height: 460px;
    display: flex;
    flex-direction: column;
    color: var(--dz-text);
    font-size: 15px;
    line-height: 1.5;
}
.dzt *, .dzt *::before, .dzt *::after { box-sizing: border-box; }
.dzt a { color: var(--dz-accent); text-decoration: none; }
.dzt a:hover { color: var(--dz-accent-hover); }
.dzt button { font: inherit; }
.dzt button:focus-visible, .dzt a:focus-visible, .dzt-dialog button:focus-visible, .dzt-dialog a:focus-visible {
    outline: 2px solid var(--dz-accent); outline-offset: 2px;
}
.dzt-mono { font-family: var(--dzt-mono); font-variant-numeric: tabular-nums; }

/* The page is one screen: the footer and base.html's blurred logo backdrop would only push the maps off it. */
body:has(.dzt) > footer { display: none; }
body:has(.dzt) main > div.fixed.pointer-events-none { display: none; }

/* ---- the bar ---- */
.dzt-bar {
    flex: none;
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 10px 14px;
    padding: 12px 20px;
}
.dzt-title { flex: 1 1 360px; min-width: 0; display: flex; align-items: center; gap: 16px; }
.dzt-h1 {
    margin: 0; flex: none;
    font-family: var(--dzt-display); font-weight: 700; font-size: 28px; line-height: 1;
    text-transform: uppercase; letter-spacing: .01em; color: #fff;
}
/* How travel works in two lines: always shown (it is the page's instructions), wraps, never cut mid-sentence. */
.dzt-sub { margin: 0; min-width: 0; max-width: 78ch; font-size: 13px; line-height: 1.4; color: var(--dz-text-2); }

.dzt-seg {
    flex: none; display: flex; align-items: center; gap: 4px; padding: 4px;
    background: var(--dz-field); border: 1px solid var(--dz-line); border-radius: 10px;
}
.dzt-seg__label { padding: 0 6px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dz-muted); }
.dzt-chip {
    min-width: 42px; height: 36px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 0; border-radius: 7px; background: transparent; color: var(--dz-text-2);
    font-weight: 700; font-size: 13px; cursor: pointer;
    transition: background-color .15s var(--dz-ease), color .15s var(--dz-ease);
}
.dzt-chip:hover { background: var(--dz-hover); color: #fff; }
.dzt-chip[aria-pressed="true"] { background: var(--dz-raised); color: #fff; box-shadow: inset 0 0 0 1px var(--dz-line-strong); }
.dzt-num {
    width: 20px; height: 20px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c); color: var(--dz-accent-ink);
    font-family: var(--dzt-mono); font-size: 11px; font-weight: 600; line-height: 1;
}

.dzt-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.dzt-btn {
    height: 44px; padding: 0 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 10px; border: 1px solid var(--dz-line-strong);
    background: var(--dz-field); color: var(--dz-text-2);
    font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap;
    transition: background-color .15s var(--dz-ease), color .15s var(--dz-ease), border-color .15s var(--dz-ease);
}
.dzt-btn:hover { background: #161d33; color: #fff; border-color: rgba(255, 255, 255, .24); }
.dzt-btn svg { flex: none; }
.dzt-btn[aria-pressed="true"],
.dzt-btn--glass {
    background: var(--dz-accent-glass); border-color: var(--dz-accent-glass-line); color: var(--dz-accent-glass-ink);
}
.dzt-btn--glass { font-weight: 700; font-size: 14px; }
.dzt-btn[aria-pressed="true"]:hover,
.dzt-btn--glass:hover { background: var(--dz-accent-glass-hover); border-color: var(--dz-accent); color: var(--dz-accent-glass-ink); }
.dzt-btn--icon { width: 44px; padding: 0; }

/* ---- the maps ---- */
.dzt-grid {
    flex: 1; min-height: 0;
    padding: 0 20px 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.dzt-tile {
    position: relative; min-width: 0; min-height: 0;
    display: flex; flex-direction: column;
    border-radius: 14px; overflow: hidden;
    border: 1px solid var(--dz-line); background: var(--dz-surface);
    transition: border-color .15s var(--dz-ease);
}
.dzt-tile:hover { border-color: rgba(255, 255, 255, .16); }
/* The tile's header row is the "open large" button: name, live players, the expand mark. Above the map, not on it,
   so no label ever covers a station near the terrain's edge. */
.dzt-head {
    flex: none; height: 44px; width: 100%;
    display: flex; align-items: center; gap: 10px; padding: 0 12px 0 14px;
    border: 0; border-bottom: 1px solid var(--dz-line); background: var(--dz-field);
    color: var(--dz-text); cursor: pointer; text-align: left;
    transition: background-color .15s var(--dz-ease);
}
.dzt-head:hover { background: #161d33; }
.dzt-head:focus-visible { outline-offset: -2px; }
.dzt-head__name {
    font-family: var(--dzt-display); font-weight: 600; font-size: 18px; line-height: 1;
    text-transform: uppercase; letter-spacing: .02em; color: #fff; white-space: nowrap;
}
.dzt-head__icon { margin-left: auto; flex: none; color: var(--dz-muted); }
.dzt-head:hover .dzt-head__icon { color: #fff; }
.is-focus .dzt-head__icon { transform: rotate(180deg); }
.dzt-mapbox { position: relative; flex: 1; min-height: 0; }
.dzt-map, .dzt .leaflet-container { position: absolute; inset: 0; background: var(--dz-surface); font: inherit; }

/* labels over a map: above Leaflet's panes (<= 700), below its controls (800) */
.dzt-over { position: absolute; z-index: 750; pointer-events: none; }
.dzt-over > * { pointer-events: auto; }
.dzt-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dz-text-2); white-space: nowrap; }
.dzt-led { width: 8px; height: 8px; border-radius: 50%; background: var(--dz-muted); flex: none; }
.dzt-led[data-tier="room"], .dzt-led[data-tier="active"] { background: #22c55e; }
.dzt-led[data-tier="busy"] { background: #f59e0b; }
.dzt-led[data-tier="full"] { background: #ef4444; }
.dzt-ref {
    bottom: 10px; left: 10px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 10px; border-radius: 8px;
    background: rgba(10, 14, 28, .88); border: 1px solid var(--dz-line);
    font-size: 12px; color: var(--dz-text-2);
}
.dzt-ref[hidden] { display: none; }
.dzt-ref .dzt-mono { color: #fff; }
.dzt-ref__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

/* station pins (Leaflet divIcons) */
.dzt-pin-icon { background: transparent; border: 0; display: flex; align-items: center; justify-content: center; }
.dzt-pin {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--c); color: var(--dz-accent-ink);
    border: 2px solid var(--dz-surface);
    font-family: var(--dzt-mono); font-weight: 600; font-size: 13px; line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .6);
    transition: opacity .15s, transform .15s;
    cursor: pointer;
}
.dzt-pin-icon:hover .dzt-pin { transform: scale(1.15); }
.dzt-pin.is-dim { opacity: .32; }
.dzt-pin.is-sel { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 35%, transparent), 0 4px 14px rgba(0, 0, 0, .6); }
.leaflet-marker-icon.dzt-pin-icon:focus-visible { outline: none; }
.leaflet-marker-icon.dzt-pin-icon:focus-visible .dzt-pin { outline: 2px solid #fff; outline-offset: 2px; }

/* a deep link's spot (#map,x,z: raid alerts link here) */
.dzt-pulse-icon { background: transparent; border: 0; }
.dzt-pulse {
    width: 50px; height: 50px; border-radius: 50%;
    border: 3px solid var(--dz-accent); background: rgba(250, 204, 21, .25);
    animation: dzt-pulse 1.5s ease-out infinite;
}
@keyframes dzt-pulse { from { transform: scale(.7); opacity: 1; } to { transform: scale(2.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dzt-pulse { animation: none; } }

.dzt .leaflet-tooltip { background: var(--dz-panel); color: var(--dz-text); border: 1px solid var(--dz-line-strong); border-radius: 8px; box-shadow: var(--dz-shadow-2); }
.dzt .leaflet-tooltip::before { display: none; }

/* ---- the arrows between the maps (a station picked, all maps shown) ---- */
.dzt-grid { position: relative; }
.dzt-links { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 760; pointer-events: none; overflow: visible; }
.dzt-grid.has-focus .dzt-links { display: none; }
.dzt-link-under { fill: none; stroke: rgba(0, 0, 12, .7); stroke-width: 5; stroke-linecap: round; }
.dzt-link {
    fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round;
    stroke-dasharray: 8 8; animation: dzt-flow 4s ease-in-out infinite alternate;
}
/* The dashes run one way, then back (alternate), as on the old page: every link works in both directions, and a
   flow that only ever ran clockwise read as a one-way route (owner 2026-10-20). Arrowheads sit on both ends too. */
@keyframes dzt-flow { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -32; } }
@media (prefers-reduced-motion: reduce) { .dzt-link { animation: none; } }
/* The arrows' meaning in words, in the grid's bottom-right corner while a station is picked (owner 2026-10-20). */
.dzt-linknote--bar { display: none; }
.dzt-linknote {
    position: absolute; right: 32px; bottom: 32px; z-index: 770; margin: 0;
    display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 64px);
    padding: 7px 12px; border-radius: 10px;
    background: rgba(10, 14, 28, .92); border: 1px solid var(--c, var(--dz-line-strong));
    box-shadow: var(--dz-shadow-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    font-size: 13px; font-weight: 500; color: #fff; pointer-events: none;
}
.dzt-linknote[hidden] { display: none; }
.dzt-linknote svg { flex: none; color: var(--c, var(--dz-accent)); }

/* the hover card of a station pin: the tower symbol, the station and its grid reference */
.dzt .leaflet-tooltip.dzt-tip { padding: 6px 10px; }
.dzt-tip__body { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.dzt-tip__tower { width: 22px; height: 22px; flex: none; color: var(--c); }
.dzt-tip__text { display: flex; flex-direction: column; line-height: 1.2; }
.dzt-tip__text strong { font-size: 13px; color: #fff; }
.dzt-tip__text span { font-family: var(--dzt-mono); font-size: 12px; color: var(--dz-text-2); }

/* ---- one map large: the other tiles hide, the station panel shows beside it ---- */
.dzt-side { display: none; }
.dzt-grid.has-focus { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: minmax(0, 1fr); }
.dzt-grid.has-focus .dzt-tile:not(.is-focus) { display: none; }
.dzt-grid.has-focus .dzt-side {
    display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto;
    padding: 18px; border-radius: 14px;
    background: var(--dz-panel); border: 1px solid var(--dz-line);
}
.dzt-side__head { display: flex; flex-direction: column; gap: 4px; }
.dzt-side h2 {
    margin: 0; font-family: var(--dzt-display); font-weight: 600; font-size: 30px; line-height: 1.1;
    text-transform: uppercase; color: #fff;
}
.dzt-side .dzt-status { font-size: 13px; }
.dzt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.dzt-row { display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.dzt-row.is-sel { background: var(--dz-raised); }
.dzt-row__pick {
    flex: 1; min-width: 0; min-height: 46px;
    display: flex; align-items: center; gap: 12px; padding: 0 10px;
    border: 0; border-radius: 10px; background: transparent; color: var(--dz-text); cursor: pointer; text-align: left;
}
.dzt-row__pick:hover { background: var(--dz-hover); }
.dzt-row__pick .dzt-num { width: 26px; height: 26px; font-size: 13px; flex: none; }
.dzt-row__name { flex: 1; font-weight: 500; }
.dzt-row__grid { font-size: 13px; color: var(--dz-text-2); }
.dzt-row__copy {
    width: 40px; height: 40px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 8px; background: transparent; color: var(--dz-muted); cursor: pointer;
}
.dzt-row__copy:hover { background: var(--dz-hover); color: #fff; }
.dzt-note { margin: 0; font-size: 13px; color: var(--dz-muted); }
.dzt-side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

/* ---- the guide ---- */
dialog.dzt-dialog {
    width: min(880px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
    margin: auto; padding: 28px; border-radius: 20px;
    border: 1px solid var(--dz-line-strong); background: var(--dz-panel); color: var(--dz-text);
    box-shadow: var(--dz-shadow-3);
    font-size: 15px; line-height: 1.5;
}
dialog.dzt-dialog::backdrop { background: rgba(0, 0, 12, .8); backdrop-filter: blur(4px); }
.dzt-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dzt-dialog h2 { margin: 0; font-family: 'Oswald', 'Roboto', sans-serif; font-weight: 600; font-size: 30px; text-transform: uppercase; color: #fff; }
.dzt-dialog__close {
    width: 44px; height: 44px; border-radius: 10px; flex: none;
    border: 1px solid var(--dz-line-strong); background: var(--dz-field); color: var(--dz-text);
    font-size: 26px; line-height: 1; cursor: pointer;
}
.dzt-dialog__close:hover { background: #161d33; }
.dzt-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dzt-steps li { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--dz-field); border: 1px solid var(--dz-line); border-radius: 14px; }
.dzt-steps .dzt-mono { font-weight: 600; font-size: 13px; color: var(--dz-accent); }
.dzt-steps strong { font-size: 16px; color: #fff; }
.dzt-steps span:last-child { font-size: 14px; color: var(--dz-text-2); }
.dzt-dialog p { margin: 16px 0 0; font-size: 14px; color: var(--dz-muted); }
.dzt-dialog a { color: var(--dz-accent); }

.dzt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- below 1600 px the sentence beside the title would be a narrow column: it gets its own full-width row under
   the title, the station picker and the buttons ---- */
@media (max-width: 1599.98px) {
    .dzt-title { display: contents; }
    .dzt-h1 { flex: 1 1 auto; }
    .dzt-sub { order: 5; flex: 1 1 100%; max-width: none; }
}

/* ---- phone: 2 x 3 maps, the station row full width, toggles as icons ---- */
@media (max-width: 768px) {
    .dzt-bar { padding: 8px 8px 8px 12px; gap: 8px; }
    .dzt-sub { order: 2; font-size: 12.5px; }
    .dzt-h1 { font-size: 24px; }
    .dzt-btn__text { display: none; }
    .dzt-btn--text-keep .dzt-btn__text { display: inline; }
    .dzt-actions { gap: 6px; }
    .dzt-actions .dzt-btn:not(.dzt-btn--glass) { width: 44px; padding: 0; }
    .dzt-seg { order: 3; flex: 1 1 100%; }
    .dzt-seg__label { display: none; }
    .dzt-chip { flex: 1; min-width: 0; padding: 0; }
    .dzt-grid {
        padding: 0 8px 8px; gap: 6px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, minmax(0, 1fr));
    }
    .dzt-tile { border-radius: 12px; }
    .dzt-head { height: 34px; gap: 6px; padding: 0 8px 0 10px; }
    .dzt-head__name { font-size: 13px; }
    .dzt-head .dzt-status .dzt-mono { display: none; }
    .dzt-ref { bottom: 6px; left: 6px; padding: 2px 7px; font-size: 11px; }
    .dzt-ref__label { display: none; }
    .dzt-pin { width: 22px; height: 22px; font-size: 11px; border-width: 1.5px; }
    .dzt-linknote--grid { display: none !important; }
    .dzt-linknote--bar:not([hidden]) {
        display: flex; position: static; order: 4; flex: 1 1 100%; max-width: none;
        padding: 4px 10px; font-size: 12px; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    }
    .dzt-pin.is-sel { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 35%, transparent), 0 2px 8px rgba(0, 0, 0, .6); }
    /* one map large on a phone: the map keeps the height, the stations become one row of chips under it */
    .dzt-grid.has-focus { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
    .dzt-grid.has-focus .dzt-side {
        display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
        gap: 8px 10px; padding: 10px; overflow: visible;
    }
    .dzt-side h2 { font-size: 20px; }
    .dzt-side .dzt-status { font-size: 12px; }
    .dzt-list { grid-column: 1 / -1; flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
    .dzt-row { flex: none; background: var(--dz-field); }
    .dzt-row.is-sel { background: var(--dz-raised); box-shadow: inset 0 0 0 1px var(--dz-line-strong); }
    .dzt-row__pick { min-height: 44px; gap: 8px; padding: 0 10px; }
    .dzt-row__pick .dzt-num { width: 22px; height: 22px; font-size: 11px; }
    .dzt-row__name, .dzt-row__copy { display: none; }
    .dzt-side__foot { grid-column: 1 / -1; margin-top: 0; }
    .dzt-side__foot .dzt-note { display: none; }
    .dzt-side__foot a:not([hidden]) { font-size: 13px; }
    dialog.dzt-dialog { padding: 18px 16px; }
    .dzt-dialog h2 { font-size: 22px; }
    .dzt-steps { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .dzt-steps li { padding: 12px; }
}
