/* WordPressDemo/boat-map-demo/css/boat-map-demo.css
   The Boat Map demo page. The map's own look (labels, popups, selection) is
   copied from HSPortal's wwwroot/css/boat-map.css; everything is scoped to
   this page so it can't clash with a WordPress theme (the page is shown in
   an iframe). */

:root {
    --bmd-text: #212529;
    --bmd-muted: #6c757d;
    --bmd-border: #dee2e6;
    --bmd-accent: #0b5ed7;
    --bmd-water: #bcdcf0;
    --bmd-water-deep: #a7cfe8;
    --bmd-bg: #ffffff;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bmd-bg);
    color: var(--bmd-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.bmd-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

/* Inside the website's iframe: the WordPress page gives the margins. */
.bmd-embedded .bmd-page {
    max-width: none;
    padding: 2px;
}

.bmd-embedded body { overflow: hidden; }

/* ---- Above the map: the one thing to know ---- */

.bmd-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 10px;
}

.bmd-intro h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
}

.bmd-lead {
    margin: 2px 0 0;
    font-size: 1.05rem;
}

.bmd-lead strong { color: var(--bmd-accent); }

/* One sentence for a mouse, another for a touch screen. */
.bmd-touch-only { display: none; }
.bmd-touch .bmd-touch-only { display: inline; }
.bmd-touch .bmd-mouse-only { display: none; }

/* Things only the full (wide screen) layout has, such as the boat yard. */
html:not([data-layout="full"]) .bmd-full-only { display: none; }
html[data-layout="full"] .bmd-compact-only { display: none; }

.bmd-button {
    flex: none;
    padding: 6px 14px;
    border: 1px solid #6c757d;
    border-radius: 6px;
    background: #fff;
    color: var(--bmd-text);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.bmd-button:hover { background: #f1f3f5; }

.bmd-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

/* Close (full screen only). */
.bmd-close {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #6c757d;
    border-radius: 50%;
    background: #fff;
    color: var(--bmd-text);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

/* ---- Phones: a preview in the page, the demo itself full screen ---- */

/* Over the preview map: open the demo full screen. */
.bmd-start {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 1200;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
    font: inherit;
    cursor: pointer;
}

html[data-layout="compact"]:not(.bmd-full) .bmd-start { display: flex; }
html[data-layout="compact"]:not(.bmd-full) .bmd-map-hint,
html[data-layout="compact"]:not(.bmd-full) #bmd-reset { display: none; }

.bmd-start-pill {
    padding: 12px 28px;
    border-radius: 999px;
    background: var(--bmd-accent);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.bmd-start-note {
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--bmd-text);
    font-size: 0.85rem;
}

/* The full-screen page (index.html?full=1): just the map, with the one
   instruction, Start again and Close above it. The page can't scroll or
   zoom, so nothing moves under a finger. */
html.bmd-full,
html.bmd-full body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

html.bmd-full .bmd-page {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    max-width: none;
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
    background: var(--bmd-bg);
}

html.bmd-full .bmd-intro {
    flex-wrap: nowrap;
    margin-bottom: 8px;
}

html.bmd-full .bmd-intro h1,
html.bmd-full .bmd-below { display: none; }

html.bmd-full .bmd-lead {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.3;
}

html.bmd-full .bmd-close { display: inline-flex; align-items: center; justify-content: center; }

/* The first screen (the intro and the map) fills the page. */
html.bmd-full .bmd-screen {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

html.bmd-full .bmd-map-holder {
    flex: 1 1 auto;
    min-height: 0;
}

/* Fill the space, whatever shape the layout's view (the map fits the view
   into it). Beats the aspect ratio the script sets on the element. */
html.bmd-full .boat-map-container {
    height: 100%;
    min-height: 0;
    aspect-ratio: auto !important;
}

html.bmd-full,
html.bmd-full .bmd-map-holder,
html.bmd-full .bmd-map-holder .leaflet-container {
    touch-action: none;
}

html.bmd-full button { touch-action: manipulation; }
html.bmd-full .bmd-details { touch-action: pan-y; }

/* ---- The map ---- */

.bmd-map-holder {
    position: relative;
}

/* The view is fixed, so Leaflet sets no touch-action of its own. Without
   this a two-finger pinch on the map zooms the whole page, which can then
   be panned. One finger still scrolls the page. Set on the map as well as
   its holder: the map's overflow: hidden can stop browsers looking further up. */
.bmd-map-holder,
.bmd-map-holder .leaflet-container {
    touch-action: pan-x pan-y;
}

.boat-map-container {
    width: 100%;
    /* Until the script sets it from the chosen layout's view (demoHarbour.js):
       the full layout is about 2.3 times as wide as it is tall. */
    aspect-ratio: 2.3 / 1;
    min-height: 260px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #9ec5e3;
}

.boat-map-container.leaflet-container {
    background: radial-gradient(ellipse at 70% 40%, var(--bmd-water) 0%, var(--bmd-water-deep) 100%);
    font-family: inherit;
    /* No browser text-selection or touch menus while holding a boat. */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* "Press and hold a boat" over the map until the first boat is picked up.
   At the top: the Rafting Area's and Boat Yard's names are at the bottom. */
.bmd-map-hint {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(33, 37, 41, 0.8);
    color: #fff;
    font-size: 0.85rem;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 300ms ease;
}

.bmd-map-hint.is-hidden { opacity: 0; }

/* Messages over the top of the map. */
.bmd-toasts {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: min(22rem, calc(100% - 20px));
    pointer-events: none;
}

.bmd-toast {
    padding: 8px 12px;
    border-left: 5px solid #1c7ed6;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    font-size: 0.875rem;
    line-height: 1.35;
    transition: opacity 300ms ease;
}

.bmd-toast.is-success { border-left-color: #2f9e44; }
.bmd-toast.is-warning { border-left-color: #f59f00; }
.bmd-toast.is-leaving { opacity: 0; }

/* Tap moves: what to tap next, with Cancel. */
.bmd-tap-bar {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 20px);
    padding: 6px 6px 6px 12px;
    border-radius: 8px;
    background: #1864ab;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
    /* Taps go through the bar to the map (it covers the top of mooring M1
       on a phone); only Cancel takes them. */
    pointer-events: none;
}

.bmd-tap-bar[hidden] { display: none; }

@media (max-width: 480px) {
    .bmd-tap-bar {
        top: 6px;
        width: calc(100% - 12px);
        max-width: none;
        padding: 4px 4px 4px 10px;
        font-size: 0.8rem;
    }
}

.bmd-tap-bar button {
    flex: none;
    padding: 3px 10px;
    border: 1px solid #fff;
    border-radius: 5px;
    background: transparent;
    color: #fff;
    font: inherit;
    cursor: pointer;
    pointer-events: auto;
}

/* Compact (phone) layout: details in a card over the bottom of the map, so
   the map never has to move to show a popup. */
.bmd-details {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    z-index: 1060;
    max-height: 65%;
    overflow-y: auto;
    padding: 10px 40px 10px 12px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
    font-size: 0.875rem;
}

.bmd-details[hidden] { display: none; }

.bmd-details-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #495057;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

/* ---- KPIs, just under the map (full layout) ---- */

.bmd-kpis {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 4px 28px;
    align-items: center;
    margin-top: 14px;
    padding: 14px 18px;
    border: 1px solid var(--bmd-border);
    border-radius: 8px;
    background: #f8f9fa;
}

/* Only in the demo's own tab, where boats move. */
html:not(.bmd-tab) .bmd-kpis { display: none; }

@media (max-width: 760px) {
    .bmd-kpis { grid-template-columns: minmax(0, 1fr); }
}

.bmd-kpis h2 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bmd-muted);
}

.bmd-kpi-figure {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 12px;
}

.bmd-kpi-pct {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--bmd-accent);
    font-variant-numeric: tabular-nums;
}

.bmd-kpi-sub { color: var(--bmd-muted); font-size: 0.95rem; }

.bmd-kpi-bar {
    position: relative;
    height: 20px;
    margin: 6px 0 4px;
    border-radius: 10px;
    background: #dee2e6;
}

.bmd-kpi-fill {
    width: 0;
    height: 100%;
    border-radius: 10px;
    background: var(--bmd-accent);
    transition: width 0.4s ease;
}

/* The most these boats can reach. */
.bmd-kpi-best {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    margin-left: -1px;
    background: var(--bmd-text);
}

.bmd-kpi-best-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--bmd-muted);
}

.bmd-kpi-parts {
    margin: 0;
    font-size: 0.95rem;
}

.bmd-kpi-parts > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    border-bottom: 1px solid var(--bmd-border);
}

.bmd-kpi-parts > div:last-child { border-bottom: 0; }

.bmd-kpi-parts dt { color: var(--bmd-muted); }

.bmd-kpi-parts dd {
    margin: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.bmd-kpi-more {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--bmd-muted);
}

/* ---- Below the map: key and instructions ---- */

.bmd-below {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 24px;
    margin-top: 20px;
}

@media (max-width: 760px) {
    .bmd-below { grid-template-columns: minmax(0, 1fr); }
}

.bmd-below h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}

.bmd-below h3 {
    margin: 12px 0 4px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bmd-muted);
}

.bmd-key-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.bmd-key ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9rem;
}

.bmd-key li { margin: 3px 0; }

.bmd-swatch {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.4em;
    vertical-align: -0.15em;
    border: 1px solid #000;
}

/* A boat whose engine is being serviced: a red cross over it. */
.bmd-swatch.is-crossed {
    background-image: linear-gradient(45deg, transparent 42%, #e03131 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, #e03131 42% 58%, transparent 58%);
}

.bmd-swatch.is-ring { border-radius: 50%; }

/* The shore's gravel (as boatMapDraw.js speckles it). */
.bmd-swatch.is-gravel {
    background-image: radial-gradient(circle at 25% 30%, rgba(255,255,255,0.7) 1px, transparent 1.5px),
        radial-gradient(circle at 70% 60%, rgba(90,80,65,0.6) 1px, transparent 1.5px),
        radial-gradient(circle at 45% 80%, rgba(255,255,255,0.6) 1px, transparent 1.5px);
}

/* The rafting area's hatching, in its border colour (as on the map). */
.bmd-swatch.is-hatched {
    background-image: repeating-linear-gradient(-45deg, transparent 0 3px, rgba(92, 159, 209, 0.75) 3px 4px);
}

.bmd-instructions ol {
    margin: 0;
    padding-left: 1.3em;
}

.bmd-instructions li { margin: 6px 0; }

.bmd-instructions p { margin: 8px 0; }

.bmd-note {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f1f3f5;
    font-size: 0.9rem;
}

/* ---- Copied from HSPortal boat-map.css: labels, selection, popups ---- */

.map-label {
    background: none;
    border: none;
}

.map-label-text {
    position: absolute;
    left: 0;
    top: 0;
    text-align: center;
    /* As nowrap, but a "\n" in a label starts a new line (the full layout's
       swing moorings: name, then what they take). */
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    font-weight: 600;
    pointer-events: none;
    user-select: none;
}

.map-item-selected {
    filter: drop-shadow(0 0 2px #ffffff) drop-shadow(0 0 6px rgba(13, 110, 253, 0.9));
}

.boat-map-container.map-vessel-moving,
.boat-map-container.map-vessel-moving .leaflet-interactive {
    cursor: grabbing;
}

.map-popup .leaflet-popup-content {
    margin: 10px 12px;
    font-size: 0.875rem;
}

.vessel-popup-header {
    border-left: 4px solid;
    padding-left: 8px;
    margin-bottom: 8px;
}

.vessel-popup-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
}

.vessel-popup-section + .vessel-popup-section {
    border-top: 1px solid var(--bmd-border);
    margin-top: 6px;
    padding-top: 6px;
}

.vessel-popup-rows {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    column-gap: 0.5rem;
    row-gap: 1px;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.vessel-popup-rows > :nth-child(odd) { color: var(--bmd-muted); }

.bmd-muted {
    color: var(--bmd-muted);
    font-size: 0.8125rem;
}

.bmd-popup-hint {
    margin-top: 8px;
    color: var(--bmd-accent);
    font-size: 0.8125rem;
}

/* ---- Wide screens: a preview in the page, the demo in a tab of its own ---- */

/* In the website: the map is a preview, covered by "Click to start". */
html[data-layout="full"]:not(.bmd-tab) .bmd-start { display: flex; }
html[data-layout="full"]:not(.bmd-tab) .bmd-map-hint,
html[data-layout="full"]:not(.bmd-tab) #bmd-reset { display: none; }

/* Only in the demo's own tab. */
.bmd-brand,
.bmd-timer,
.bmd-tab-foot { display: none; }

/* The tab (index.html?tab=1): the header, the map as big as the window
   allows, then the KPI and Close; the key and help below, off the screen. */
html.bmd-tab .bmd-page {
    max-width: none;
    padding: 0 16px 16px;
}

html.bmd-tab .bmd-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 560px;
    padding-bottom: 12px;
}

html.bmd-tab .bmd-intro { margin: 8px 0; flex-wrap: nowrap; }
html.bmd-tab .bmd-intro h1 { display: none; }
html.bmd-tab .bmd-lead { margin: 0; }

html.bmd-tab .bmd-map-holder {
    flex: 1 1 auto;
    min-height: 0;
}

/* Fill the space, whatever its shape (the map fits the view into it). */
html.bmd-tab .boat-map-container {
    height: 100%;
    min-height: 0;
    aspect-ratio: auto !important;
}

/* Like the website's header, without its menus: a smaller logo, and the
   sign-up, over a navy rule. */
html.bmd-tab .bmd-brand {
    display: flex;
    align-items: center;
    gap: 12px 28px;
    margin: 0 -16px;
    padding: 8px 16px;
    border-bottom: 6px solid #031e3a;
    background: #fff;
    font-family: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.bmd-brand-logo {
    flex: none;
    width: auto;
    height: 64px;
}

.bmd-signup {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 20px;
    margin: 0;
}

.bmd-signup-text {
    margin: 0;
    color: #031e3a;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.bmd-signup-fields {
    grid-row: span 2;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.bmd-field {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
}

.bmd-field input {
    width: 13em;
    margin-top: 2px;
    padding: 6px 8px;
    border: 1px solid #adb5bd;
    border-radius: 4px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--bmd-text);
}

.bmd-field input[name="fullName"] { width: 12em; }

.bmd-field input:focus {
    outline: 2px solid #06488b;
    outline-offset: 0;
    border-color: #06488b;
}

.bmd-field input[aria-invalid="true"] { border-color: #c92a2a; }

/* The honeypot: kept out of sight and out of reach. */
.bmd-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.bmd-signup-send {
    padding: 8px 20px;
    border: 0;
    background: #06488b;
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.bmd-signup-send:hover { background: #031e3a; }
.bmd-signup-send:disabled { opacity: 0.6; cursor: wait; }

.bmd-signup-note,
.bmd-signup-status {
    margin: 0;
    font-size: 0.75rem;
    color: var(--bmd-muted);
}

.bmd-signup-note a { color: #06488b; }

.bmd-signup-status:empty { display: none; }
.bmd-signup-status.is-error { color: #c92a2a; font-weight: 600; }
.bmd-signup-status.is-ok { color: #2b8a3e; font-weight: 600; font-size: 0.85rem; }

/* Sent: the thank-you takes the form's place. */
.bmd-signup.is-sent .bmd-signup-fields,
.bmd-signup.is-sent .bmd-signup-note { display: none; }

@media (max-width: 1100px) {
    html.bmd-tab .bmd-brand { flex-wrap: wrap; }
    .bmd-signup { grid-template-columns: minmax(0, 1fr); }
    .bmd-signup-fields { grid-row: auto; flex-wrap: wrap; }
}

/* The timer, top right of the map (messages go below it). */
html.bmd-tab .bmd-timer {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(3, 30, 58, 0.85);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.bmd-timer-icon {
    width: 0.9em;
    height: 0.9em;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: linear-gradient(currentColor, currentColor) 50% 20% / 2px 35% no-repeat;
}

html.bmd-tab .bmd-timer.is-stopped { background: #2b8a3e; }
html.bmd-tab .bmd-toasts { top: 48px; }

/* Under the map: the KPI, and Close. */
html.bmd-tab .bmd-tab-foot {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
}

html.bmd-tab .bmd-kpis {
    flex: 1 1 auto;
    margin: 0;
    padding: 8px 16px;
}

html.bmd-tab .bmd-kpi-pct { font-size: 1.8rem; }

html.bmd-tab .bmd-kpi-parts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
}

html.bmd-tab .bmd-kpi-parts > div:nth-last-child(2) { border-bottom: 0; }
html.bmd-tab .bmd-kpi-more { margin-top: 2px; }

.bmd-tab-close {
    flex: none;
    align-self: stretch;
    min-width: 110px;
    padding: 10px 24px;
    border: 0;
    background: #031e3a;
    color: #fff;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.bmd-tab-close:hover { background: #06488b; }

/* ---- Alerts over the map: STOP, WAIT, Well done ---- */

.bmd-alert {
    position: absolute;
    top: 14%;
    left: 50%;
    z-index: 1150;
    width: min(460px, 90%);
    transform: translateX(-50%);
    padding: 16px 20px 14px;
    border: 3px solid #1c7ed6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    text-align: center;
    /* A boat can still be dragged past it. */
    pointer-events: none;
}

.bmd-alert[hidden] { display: none; }

.bmd-alert-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.bmd-alert-text { margin: 4px 0 10px; }

.bmd-alert-ok {
    pointer-events: auto;
    padding: 6px 26px;
    border: 0;
    border-radius: 6px;
    background: #1c7ed6;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.bmd-alert.is-stop { border-color: #c92a2a; }
.bmd-alert.is-stop .bmd-alert-title { color: #c92a2a; }
.bmd-alert.is-stop .bmd-alert-ok { background: #c92a2a; }
.bmd-alert.is-wait { border-color: #f08c00; }
.bmd-alert.is-wait .bmd-alert-title { color: #d9480f; }
.bmd-alert.is-wait .bmd-alert-ok { background: #e8590c; }
.bmd-alert.is-success { border-color: #2b8a3e; }
.bmd-alert.is-success .bmd-alert-title { color: #2b8a3e; }
.bmd-alert.is-success .bmd-alert-ok { background: #2b8a3e; }

/* ---- "How to move a boat": the demo's own tab, before anything else ----
   Over the To be allocated area (placed by boatMapDemo.js); the map behind
   is dimmed and can't be used until it's closed. */

.bmd-howto {
    position: absolute;
    inset: 0;
    z-index: 1200;
    background: rgba(16, 32, 48, 0.35);
}

.bmd-howto[hidden] { display: none; }

.bmd-howto-box {
    position: absolute;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 22px 18px;
    border: 3px solid #1c7ed6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    font-size: 1rem;
    line-height: 1.4;
}

.bmd-howto-box h2 {
    margin: 0 28px 8px 0;
    font-size: 1.3rem;
    color: #1c4f8a;
}

.bmd-howto-box p { margin: 0 0 10px; }

.bmd-howto-main {
    font-size: 1.2rem;
}

.bmd-howto-main strong {
    color: #c92a2a;
    animation: bmd-howto-flash 1s ease-in-out 4;
}

@keyframes bmd-howto-flash {
    50% { opacity: 0.25; }
}

.bmd-howto-x {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #343a40;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.bmd-howto-x:hover, .bmd-howto-x:focus-visible { background: #e9ecef; }

.bmd-howto-start {
    align-self: center;
    margin-top: 4px;
    padding: 10px 30px;
    border: 0;
    border-radius: 999px;
    background: #1c7ed6;
    color: #fff;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
}

.bmd-howto-start:hover, .bmd-howto-start:focus-visible { background: #1864ab; }

/* Phones (compact layout): under the map, a pointer to the PC demo. */
.bmd-try-pc {
    flex: none;
    margin: 6px 0 0;
    padding: 6px 10px;
    border-radius: 6px;
    background: #e7f1fc;
    color: #1c4f8a;
    font-size: 0.9rem;
    line-height: 1.3;
    text-align: center;
}

/* ---- "Please allocate the berths for me" (full layout) ----
   In the website's preview, under Click to start (opens the tab and plays);
   in the demo's tab, beside Start again and in "How to move a boat". */

#bmd-auto { display: none; }
html.bmd-tab[data-layout="full"] #bmd-auto { display: inline-block; }

.bmd-auto-button {
    border-color: #2b8a3e;
    color: #2b8a3e;
    font-weight: 600;
}

.bmd-auto-button:hover { background: #ebfbee; }

.bmd-start-auto {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 14%;
    z-index: 1210;
    transform: translateX(-50%);
    padding: 9px 22px;
    border: 2px solid #2b8a3e;
    border-radius: 999px;
    background: #fff;
    color: #2b8a3e;
    font: inherit;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

html[data-layout="full"]:not(.bmd-tab) .bmd-start-auto { display: block; }
.bmd-start-auto:hover { background: #ebfbee; }

.bmd-howto-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.bmd-howto-auto {
    padding: 8px 18px;
    border: 2px solid #2b8a3e;
    border-radius: 999px;
    background: #fff;
    color: #2b8a3e;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.bmd-howto-auto:hover, .bmd-howto-auto:focus-visible { background: #ebfbee; }

/* While it plays: clicks on the map are swallowed. */
.bmd-auto-block {
    position: absolute;
    inset: 0;
    z-index: 1120;
    cursor: progress;
}

.bmd-auto-bar {
    position: absolute;
    left: 50%;
    top: 10px;
    z-index: 1160;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(-50%);
    padding: 6px 8px 6px 16px;
    border-radius: 999px;
    background: rgba(33, 37, 41, 0.88);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.bmd-auto-bar button {
    padding: 4px 14px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #212529;
    font: inherit;
    cursor: pointer;
}

.bmd-auto-block[hidden], .bmd-auto-bar[hidden] { display: none; }
