@font-face {
    font-display: swap;
    font-family: "WFD Tinos";
    font-style: normal;
    font-weight: 700;
    src: url("../fonts/Tinos-Bold.ttf") format("truetype");
}

@font-face {
    font-display: swap;
    font-family: "WFD Tinos";
    font-style: italic;
    font-weight: 700;
    src: url("../fonts/Tinos-BoldItalic.ttf") format("truetype");
}

.wfd-app,
.wfd-placeholder {
    --wfd-ink: #24302f;
    --wfd-muted: #65706c;
    --wfd-paper: #f5f0e4;
    --wfd-card: #fffdf8;
    --wfd-line: #d8cfbb;
    --wfd-accent: #456c64;
    --wfd-accent-dark: #2f4f49;
    --wfd-danger: #9a3f3f;
    color: var(--wfd-ink);
    font-family: inherit;
}

.wfd-app *,
.wfd-placeholder * {
    box-sizing: border-box;
}

.wfd-test-console {
    background:
        linear-gradient(rgba(255, 253, 248, .92), rgba(255, 253, 248, .92)),
        repeating-linear-gradient(0deg, transparent 0 23px, rgba(74, 66, 48, .04) 24px);
    border: 1px solid var(--wfd-line);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(44, 49, 43, .08);
    padding: clamp(16px, 2.5vw, 30px);
}

.wfd-test-hero,
.wfd-toolbar,
.wfd-actions,
.wfd-game-summary,
.wfd-power-grid,
.wfd-grid {
    display: flex;
    gap: 12px;
}

.wfd-test-hero {
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid var(--wfd-line);
    margin-bottom: 18px;
    padding-bottom: 18px;
}

.wfd-test-hero h2 {
    color: var(--wfd-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.08;
    margin: 3px 0 8px;
}

.wfd-test-hero p {
    color: var(--wfd-muted);
    margin: 0;
    max-width: 760px;
}

.wfd-kicker {
    color: var(--wfd-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.wfd-status-pill {
    background: #dfece5;
    border: 1px solid #b8d2c1;
    border-radius: 999px;
    color: #27543e;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 11px;
}

.wfd-toolbar,
.wfd-actions {
    align-items: center;
    flex-wrap: wrap;
    margin: 14px 0;
}

.wfd-app button,
.wfd-app select,
.wfd-app input,
.wfd-app textarea {
    border: 1px solid #bcb39f;
    border-radius: 5px;
    font: inherit;
}

.wfd-app button {
    background: var(--wfd-accent);
    border-color: var(--wfd-accent);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 13px;
}

.wfd-app button:hover,
.wfd-app button:focus-visible {
    background: var(--wfd-accent-dark);
}

.wfd-app button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.wfd-app button.wfd-danger {
    background: transparent;
    border-color: #c89595;
    color: var(--wfd-danger);
}

.wfd-app select,
.wfd-app input,
.wfd-app textarea {
    background: #fff;
    color: var(--wfd-ink);
    min-height: 38px;
    padding: 7px 9px;
    width: 100%;
}

.wfd-toolbar select {
    min-width: min(100%, 280px);
    width: auto;
}

.wfd-game-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 18px 0;
}

.wfd-game-summary > div {
    background: rgba(255, 255, 255, .55);
    border-left: 3px solid var(--wfd-accent);
    padding: 10px 12px;
}

.wfd-game-summary span,
.wfd-game-summary small {
    color: var(--wfd-muted);
    display: block;
    font-size: 11px;
}

.wfd-game-summary strong {
    display: block;
    margin: 3px 0;
}

.wfd-grid {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wfd-panel {
    background: var(--wfd-card);
    border: 1px solid var(--wfd-line);
    border-radius: 7px;
    margin-top: 14px;
    padding: 16px;
}

.wfd-panel h3 {
    color: var(--wfd-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
    margin: 0 0 12px;
}

.wfd-panel form {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wfd-panel form label {
    color: var(--wfd-muted);
    font-size: 12px;
    font-weight: 700;
}

.wfd-panel form label > input,
.wfd-panel form label > select,
.wfd-panel form label > textarea {
    display: block;
    margin-top: 4px;
}

.wfd-panel form .wfd-wide {
    grid-column: 1 / -1;
}

.wfd-power-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
}

.wfd-app .wfd-power-card {
    background: #f6f2e8;
    border-color: var(--wfd-line);
    color: var(--wfd-ink);
    min-height: 88px;
    text-align: left;
}

.wfd-app .wfd-power-card:hover,
.wfd-app .wfd-power-card.is-active {
    background: #e1ebe6;
    border-color: var(--wfd-accent);
}

.wfd-power-card strong,
.wfd-power-card span,
.wfd-power-card small {
    display: block;
}

.wfd-power-card span,
.wfd-power-card small {
    color: var(--wfd-muted);
    font-size: 11px;
    margin-top: 3px;
}

.wfd-table-wrap {
    max-width: 100%;
    overflow: auto;
}

.wfd-app table {
    border-collapse: collapse;
    min-width: 680px;
    width: 100%;
}

.wfd-app th,
.wfd-app td {
    border-bottom: 1px solid #e4ddce;
    padding: 9px 8px;
    text-align: left;
    vertical-align: top;
}

.wfd-app th {
    color: var(--wfd-muted);
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.wfd-app tr.is-unread td {
    background: #fff5cf;
}

.wfd-app td button {
    font-size: 11px;
    padding: 5px 7px;
}

.wfd-empty,
.wfd-empty-cell {
    color: var(--wfd-muted);
    padding: 28px;
    text-align: center;
}

.wfd-notice {
    border-left: 4px solid #7b8c87;
    margin: 12px 0;
    padding: 10px 12px;
}

.wfd-notice--success {
    background: #e1f2e7;
    border-color: #3d7d53;
}

.wfd-notice--error {
    background: #fae5e5;
    border-color: var(--wfd-danger);
}

.wfd-notice--warning {
    background: #fff2c7;
    border-color: #b7811d;
}

.wfd-notice--info {
    background: #e7eff0;
    border-color: #50797b;
}

.wfd-checks {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wfd-checks > div {
    background: #f5f2ea;
    border-radius: 4px;
    padding: 8px 10px;
}

.wfd-checks span {
    display: inline-block;
    font-weight: 800;
    margin-right: 8px;
}

.wfd-checks .is-ok span {
    color: #32734a;
}

.wfd-checks .is-failed span {
    color: var(--wfd-danger);
}

.wfd-footnote {
    color: var(--wfd-muted);
    font-size: 12px;
    margin-bottom: 0;
}

.wfd-placeholder {
    background: var(--wfd-paper);
    border: 1px dashed #bcb39f;
    border-radius: 6px;
    padding: 22px;
}

.wfd-placeholder h2 {
    font-family: Georgia, "Times New Roman", serif;
    margin-top: 0;
}

@media (max-width: 980px) {
    .wfd-game-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wfd-power-grid {
        grid-template-columns: repeat(3, minmax(110px, 1fr));
    }
}

@media (max-width: 680px) {
    .wfd-test-hero,
    .wfd-grid {
        display: block;
    }

    .wfd-status-pill {
        display: inline-block;
        margin-top: 12px;
    }

    .wfd-game-summary,
    .wfd-panel form,
    .wfd-checks {
        grid-template-columns: 1fr;
    }

    .wfd-power-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Version 0.2.0: zusammenhängende, responsive Testansichten */
.wfd-sandbox-widget {
    background:
        linear-gradient(rgba(255, 253, 248, .94), rgba(255, 253, 248, .94)),
        repeating-linear-gradient(0deg, transparent 0 23px, rgba(74, 66, 48, .045) 24px);
    border: 1px solid var(--wfd-line);
    border-radius: 12px;
    box-shadow: 0 16px 46px rgba(44, 49, 43, .09);
    margin: 0 0 36px;
    max-width: 100%;
    overflow: hidden;
    padding: clamp(18px, 3vw, 34px);
}

.wfd-sandbox-widget h2,
.wfd-sandbox-widget h3,
.wfd-sandbox-widget p {
    overflow-wrap: anywhere;
}

.wfd-view-hero {
    align-items: flex-start;
    border-bottom: 1px solid var(--wfd-line);
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin: 0 0 22px;
    padding: 0 0 21px;
}

.wfd-view-hero h2 {
    color: var(--wfd-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(28px, 4.4vw, 46px);
    letter-spacing: -.025em;
    line-height: 1.05;
    margin: 4px 0 9px;
}

.wfd-view-hero p {
    color: var(--wfd-muted);
    line-height: 1.65;
    margin: 0;
    max-width: 760px;
}

.wfd-view-toolbar,
.wfd-admin-actions {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

.wfd-control {
    color: var(--wfd-muted);
    display: grid;
    flex: 1 1 230px;
    font-size: 11px;
    font-weight: 800;
    gap: 4px;
    letter-spacing: .035em;
    max-width: 370px;
    text-transform: uppercase;
}

.wfd-control select {
    letter-spacing: normal;
    text-transform: none;
}

.wfd-app button:focus-visible,
.wfd-app select:focus-visible,
.wfd-app input:focus-visible,
.wfd-app textarea:focus-visible,
.wfd-unit-token:focus-visible {
    outline: 3px solid rgba(69, 108, 100, .26);
    outline-offset: 2px;
}

.wfd-preview-badge {
    color: var(--wfd-accent);
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.wfd-empty-state {
    align-items: center;
    background: rgba(255, 255, 255, .5);
    border: 1px dashed #bcb39f;
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 190px;
    padding: 28px;
    text-align: center;
}

.wfd-empty-state h3 {
    font-family: Georgia, "Times New Roman", serif;
    margin: 7px 0;
}

.wfd-empty-state p,
.wfd-muted {
    color: var(--wfd-muted);
}

.wfd-empty-state p {
    margin: 0 0 14px;
    max-width: 560px;
}

.wfd-empty-icon {
    color: var(--wfd-accent);
    font-size: 30px;
    line-height: 1;
}

.wfd-metric-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 18px 0;
}

.wfd-metric {
    background: rgba(255, 255, 255, .62);
    border: 1px solid #e2dac9;
    border-radius: 8px;
    border-top: 3px solid var(--wfd-accent);
    min-width: 0;
    padding: 13px 14px;
}

.wfd-metric span,
.wfd-metric small {
    color: var(--wfd-muted);
    display: block;
    font-size: 11px;
}

.wfd-metric strong {
    display: block;
    font-size: 15px;
    margin: 4px 0;
}

.wfd-participant-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wfd-participant {
    background: #f8f5ed;
    border: 1px solid #e2dac9;
    border-radius: 7px;
    min-width: 0;
    padding: 13px;
}

.wfd-participant-top {
    align-items: center;
    display: flex;
    gap: 7px;
}

.wfd-participant-top strong {
    flex: 1;
}

.wfd-power-dot {
    background: var(--wfd-power, var(--wfd-accent));
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(36, 48, 47, .18);
    display: inline-block;
    flex: 0 0 auto;
    height: 12px;
    width: 12px;
}

.wfd-tag {
    background: #ece7dc;
    border-radius: 999px;
    color: var(--wfd-muted);
    font-size: 9px;
    font-weight: 800;
    padding: 3px 7px;
    text-transform: uppercase;
}

.wfd-participant p {
    color: var(--wfd-muted);
    font-size: 12px;
    margin: 8px 0;
}

.wfd-participant small {
    color: var(--wfd-muted);
    display: block;
    font-size: 10px;
    margin-top: 6px;
}

.wfd-progress {
    background: #e5dfd2;
    border-radius: 999px;
    height: 5px;
    overflow: hidden;
}

.wfd-progress span {
    background: var(--wfd-power);
    display: block;
    height: 100%;
}

.wfd-two-column {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wfd-two-column > .wfd-panel {
    min-width: 0;
}

.wfd-activity-list,
.wfd-check-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wfd-activity-list li {
    align-items: center;
    border-bottom: 1px solid #ebe4d6;
    display: flex;
    gap: 10px;
    padding: 8px 0;
}

.wfd-activity-list li:last-child {
    border-bottom: 0;
}

.wfd-activity-list strong,
.wfd-activity-list small {
    display: block;
}

.wfd-activity-list small {
    color: var(--wfd-muted);
    font-size: 10px;
    margin-top: 2px;
}

.wfd-activity-icon {
    align-items: center;
    background: #e3ece8;
    border-radius: 50%;
    color: var(--wfd-accent-dark);
    display: flex;
    flex: 0 0 auto;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.wfd-check-list li {
    border-bottom: 1px solid #ebe4d6;
    padding: 7px 4px 7px 24px;
    position: relative;
}

.wfd-check-list li::before {
    color: var(--wfd-accent);
    content: "V";
    font-weight: 900;
    left: 3px;
    position: absolute;
}

.wfd-segmented,
.wfd-zoom-controls {
    align-items: center;
    display: flex;
    gap: 3px;
}

.wfd-segmented button,
.wfd-zoom-controls button {
    background: #ece7dc;
    border-color: #d6cdbb;
    color: var(--wfd-ink);
}

.wfd-segmented button.is-active {
    background: var(--wfd-accent);
    border-color: var(--wfd-accent);
    color: #fff;
}

.wfd-zoom-controls span {
    color: var(--wfd-muted);
    font-size: 11px;
    min-width: 42px;
    text-align: center;
}

.wfd-zoom-controls .wfd-zoom-hint {
    min-width: 0;
    white-space: nowrap;
}

.wfd-board-status {
    align-items: center;
    border-left: 4px solid;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 12px 0;
    padding: 10px 13px;
}

.wfd-board-status strong,
.wfd-board-status span {
    display: block;
}

.wfd-board-status span {
    color: var(--wfd-muted);
    font-size: 11px;
    text-align: right;
}

.wfd-board-status.is-warning {
    background: #fff2c7;
    border-color: #b7811d;
}

.wfd-board-status.is-complete {
    background: #e1f2e7;
    border-color: #3d7d53;
}

.wfd-board-workspace {
    position: relative;
}

.wfd-icon-size-control {
    align-items: center;
    backdrop-filter: blur(5px);
    background: rgba(255, 253, 248, .92);
    border: 1px solid rgba(87, 102, 94, .48);
    border-radius: 999px;
    bottom: 14px;
    box-shadow: 0 3px 14px rgba(31, 45, 41, .18);
    color: var(--wfd-ink);
    display: flex;
    gap: 8px;
    padding: 7px 11px;
    position: absolute;
    right: 14px;
    user-select: none;
    z-index: 15;
}

.wfd-icon-size-control span {
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.wfd-app .wfd-icon-size-control input[type="range"] {
    accent-color: var(--wfd-accent);
    cursor: pointer;
    margin: 0;
    min-width: 90px;
    padding: 0;
    touch-action: auto;
    width: 112px;
}

.wfd-icon-size-control output {
    color: var(--wfd-muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    min-width: 38px;
    text-align: right;
}

.wfd-board-viewport {
    aspect-ratio: 1340 / 860;
    background: #c5d0ca;
    border: 1px solid #9faea7;
    border-radius: 9px;
    box-sizing: border-box;
    max-width: 100%;
    overflow: auto;
    padding: 10px;
}

.wfd-board-canvas {
    background-color: #e8e0cd;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(109, 126, 112, .18), transparent 31%),
        linear-gradient(122deg, rgba(255, 255, 255, .3), transparent 45%),
        repeating-linear-gradient(0deg, rgba(74, 66, 48, .025) 0 1px, transparent 1px 22px);
    border: 1px solid rgba(73, 78, 67, .35);
    border-radius: 5px;
    min-height: 535px;
    padding: 18px;
    position: relative;
}

.wfd-board-canvas.is-vector {
    background-color: #dce9e6;
    background-image:
        linear-gradient(rgba(255, 255, 255, .36), rgba(255, 255, 255, .36)),
        linear-gradient(90deg, rgba(69, 108, 100, .08) 1px, transparent 1px),
        linear-gradient(rgba(69, 108, 100, .08) 1px, transparent 1px);
    background-size: auto, 28px 28px, 28px 28px;
}


.wfd-board-viewport {
    -ms-overflow-style: none;
    cursor: grab;
    overscroll-behavior: contain;
    scrollbar-width: none;
    touch-action: none;
}

.wfd-board-viewport::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
}

.wfd-board-viewport.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.wfd-board-canvas.has-svg-map {
    background: #c8d9dc;
    border: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

.wfd-map-svg-host {
    aspect-ratio: 1340 / 860;
    display: block;
    position: relative;
    width: 100%;
}

.wfd-map-svg-host svg {
    display: block;
    height: 100%;
    width: 100%;
}

.wfd-map-svg-host svg {
    inset: 0;
    position: absolute;
}

.wfd-map-reference {
    display: none;
}

.wfd-board-canvas.is-historical .wfd-map-svg-host,
.wfd-board-canvas.is-vector .wfd-map-svg-host {
    background-position: left top;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.wfd-board-canvas.is-historical .wfd-map-svg-host {
    background-color: #c8dcde;
    background-image: var(--wfd-map-historical-image);
}


.wfd-board-canvas.is-historical .wfd-map-svg-host svg {
    z-index: 1;
}

.wfd-board-canvas.is-vector .wfd-map-svg-host {
    background-image: var(--wfd-map-vector-image);
}

.wfd-board-canvas.is-historical .wfd-map-svg-host svg {
    filter: none;
}

.wfd-map-loading {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 480px;
}

.wfd-map-svg-host .wfd-province.is-selected {
    filter: brightness(1.22) saturate(.94);
}

.wfd-map-svg-host .wfd-province.is-legal-target {
    filter: brightness(1.18) saturate(1.12);
    stroke: #b17819 !important;
    stroke-dasharray: 5 3;
    stroke-width: 2.3 !important;
}

.wfd-board-canvas.is-historical #wfd-impassable,
.wfd-board-canvas.is-historical #wfd-coastline,
.wfd-board-canvas.is-historical #wfd-supply-centers,
.wfd-board-canvas.is-vector #wfd-impassable,
.wfd-board-canvas.is-vector #wfd-coastline,
.wfd-board-canvas.is-vector #wfd-supply-centers,
.wfd-board-canvas.is-vector #wfd-labels {
    opacity: 0;
}

.wfd-board-canvas.is-historical .wfd-province,
.wfd-board-canvas.is-vector .wfd-province {
    fill: transparent !important;
    fill-rule: evenodd;
    filter: none !important;
    pointer-events: all;
    stroke: transparent !important;
}

.wfd-board-canvas.is-vector .wfd-province:hover,
.wfd-board-canvas.is-vector .wfd-province:focus {
    fill: rgba(255, 255, 255, .08) !important;
}

.wfd-board-canvas.is-historical .wfd-province.is-selected,
.wfd-board-canvas.is-vector .wfd-province.is-selected {
    fill: rgba(255, 255, 255, .28) !important;
    filter: none !important;
}

.wfd-board-canvas.is-historical .wfd-province.is-legal-target,
.wfd-board-canvas.is-vector .wfd-province.is-legal-target {
    fill: rgba(230, 174, 65, .26) !important;
    filter: none !important;
    stroke: #b17819 !important;
}

.wfd-board-canvas.is-historical .wfd-province.is-selected,
.wfd-board-canvas.is-historical .wfd-province.is-legal-target {
    fill: transparent !important;
}

.wfd-map-svg-host .wfd-province.has-own-unit {
    cursor: pointer;
}

/* NWG is an interaction surface reconstructed behind the surrounding paths. */
.wfd-map-svg-host #wfd-province-NWG.is-selected,
.wfd-map-svg-host #wfd-province-NWG.is-legal-target {
    stroke: transparent !important;
}

.wfd-map-svg-host #wfd-province-NWG.is-legal-target {
    filter: brightness(1.12);
}

.wfd-map-unit {
    cursor: pointer;
    outline: none;
}

#wfd-historical-supply-centers,
#wfd-historical-province-highlights,
#wfd-historical-contours,
.wfd-historical-unit-image {
    display: none;
    pointer-events: none;
}

.wfd-historical-province-layer {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none;
    visibility: hidden;
}

.wfd-board-canvas.is-historical #wfd-historical-supply-centers,
.wfd-board-canvas.is-historical #wfd-historical-contours,
.wfd-board-canvas.is-historical .wfd-historical-unit-image {
    display: inline;
}

.wfd-board-canvas.is-historical #wfd-historical-province-highlights.has-active-province {
    display: inline;
}

.wfd-board-canvas.is-historical .wfd-historical-province-layer.is-selected {
    display: inline !important;
    opacity: 1 !important;
    visibility: visible;
}

.wfd-board-canvas.is-historical .wfd-historical-province-layer.is-sea.is-selected {
    filter: brightness(1.18) saturate(1.05) contrast(1.02);
}

.wfd-board-canvas.is-historical .wfd-historical-province-layer.is-land.is-selected {
    filter: brightness(1.28) saturate(.68) contrast(.88);
}

.wfd-map-unit.is-disabled .wfd-historical-unit-image {
    opacity: .78;
}

.wfd-board-canvas.is-historical .wfd-map-unit-token,
.wfd-board-canvas.is-historical .wfd-map-unit-symbol {
    display: none;
}

.wfd-map-unit.is-disabled {
    cursor: default;
}

.wfd-map-unit-token {
    fill: #fffdf8;
    stroke: var(--wfd-map-power);
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
}

.wfd-map-unit.is-disabled .wfd-map-unit-token {
    fill: #eee9dd;
    opacity: .92;
}

.wfd-map-unit.is-selected .wfd-map-unit-token,
.wfd-map-unit:focus .wfd-map-unit-token {
    filter: none;
    stroke: #d79a22;
    stroke-width: 4;
}

.wfd-map-unit-symbol {
    fill: var(--wfd-map-power);
    font-family: system-ui, sans-serif;
    font-size: 10px;
    font-weight: 900;
    pointer-events: none;
    text-anchor: middle;
}

.wfd-map-order {
    fill: none;
    stroke: #8c4d2f;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 4;
    vector-effect: non-scaling-stroke;
}

.wfd-map-order.is-hold circle:first-child {
    fill: rgba(255, 253, 248, .78);
    stroke-width: 3;
}

.wfd-map-order.is-hold circle:last-child {
    stroke-dasharray: 3 3;
    stroke-width: 2;
}

.wfd-map-watermark {
    align-items: center;
    color: rgba(47, 79, 73, .68);
    display: flex;
    flex-direction: column;
    inset: 44% 0 auto;
    pointer-events: none;
    position: absolute;
    text-align: center;
}

.wfd-map-watermark strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(22px, 3vw, 34px);
}

.wfd-map-watermark span {
    font-size: 10px;
    max-width: 390px;
}

.wfd-map-zones {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: relative;
    z-index: 1;
}

.wfd-map-zone {
    background: color-mix(in srgb, var(--wfd-power) 17%, rgba(255, 255, 255, .78));
    border: 1px solid color-mix(in srgb, var(--wfd-power) 52%, #fff);
    border-radius: 30% 12% 24% 10%;
    min-height: 188px;
    padding: 12px;
}

.wfd-map-zone:nth-child(even) {
    border-radius: 12% 28% 10% 24%;
    transform: translateY(28px);
}

.wfd-map-zone header {
    align-items: center;
    display: flex;
    gap: 7px;
    margin-bottom: 10px;
}

.wfd-map-zone header strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 13px;
}

.wfd-map-units {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.wfd-app .wfd-unit-token {
    background: rgba(255, 253, 248, .86);
    border-color: rgba(36, 48, 47, .2);
    color: var(--wfd-ink);
    min-width: 74px;
    padding: 7px;
    text-align: left;
}

.wfd-app .wfd-unit-token:disabled {
    cursor: default;
    opacity: .72;
}

.wfd-unit-token strong,
.wfd-unit-token small {
    display: block;
}

.wfd-unit-symbol {
    color: var(--wfd-power);
    float: left;
    font-size: 15px;
    margin-right: 6px;
}

.wfd-unit-token small {
    color: var(--wfd-muted);
    font-size: 8px;
    margin-top: 2px;
}

.wfd-app .wfd-unit-token.is-owned {
    border-color: var(--wfd-power);
}

.wfd-app .wfd-unit-token.is-selected {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 0 0 5px var(--wfd-power);
}

.wfd-app .wfd-unit-token.has-order small {
    color: #2d6745;
    font-weight: 800;
}

.wfd-order-dialog {
    box-shadow: 0 14px 38px rgba(39, 48, 44, .28);
    margin: 0;
    max-width: calc(100% - 28px);
    padding: 19px;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 310px;
    z-index: 12;
}

.wfd-order-dialog .wfd-kicker,
.wfd-message-composer .wfd-kicker {
    display: block;
    margin-bottom: 4px;
}

.wfd-message-composer form {
    display: grid;
    gap: 11px;
    grid-template-columns: 1fr;
}

.wfd-message-composer form label {
    color: var(--wfd-muted);
    font-size: 11px;
    font-weight: 800;
}

.wfd-order-dialog-close {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    color: var(--wfd-muted) !important;
    display: flex;
    font-size: 24px !important;
    height: 34px;
    justify-content: center;
    padding: 0 !important;
    position: absolute;
    right: 9px;
    top: 7px;
    width: 34px;
}

.wfd-order-choice-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 13px;
}

.wfd-current-order {
    background: #f3eee2;
    border-left: 3px solid var(--wfd-accent);
    font-size: 12px;
    margin: 10px 0 0;
    padding: 8px 10px;
}

.wfd-order-prompt {
    color: var(--wfd-text);
    font-weight: 700;
    line-height: 1.5;
    margin: 12px 0 0;
}

.wfd-order-back {
    background: #eee7d8 !important;
    color: var(--wfd-text) !important;
    margin-top: 11px;
    width: 100%;
}

.wfd-form-hint {
    color: var(--wfd-muted);
    font-size: 10px;
    line-height: 1.5;
    margin: 0;
}

.wfd-route-panel {
    margin-top: 12px;
}

.wfd-order-routes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wfd-order-route {
    align-items: center;
    background: #f3eee2;
    border: 1px solid #ddd2be;
    border-radius: 999px;
    display: flex;
    gap: 7px;
    padding: 5px 9px;
    text-transform: none;
}

.wfd-order-route span {
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    font-weight: 800;
}

.wfd-order-route small {
    color: var(--wfd-muted);
    font-size: 9px;
}

.wfd-route-arrow {
    color: var(--wfd-accent);
    font-size: 18px !important;
}


.wfd-sr-only {
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

.wfd-public-chat {
    display: grid;
    gap: 10px;
    margin: 0 auto;
    max-width: 980px;
}

.wfd-chat-window {
    background:
        linear-gradient(rgba(245, 240, 228, .82), rgba(245, 240, 228, .82)),
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(74, 66, 48, .05) 32px);
    border: 1px solid var(--wfd-line);
    border-radius: 9px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    min-height: 330px;
    max-height: min(58vh, 560px);
    overflow-y: auto;
    padding: 17px;
    scroll-behavior: smooth;
}

.wfd-chat-empty {
    align-items: center;
    color: var(--wfd-muted);
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-height: 270px;
    text-align: center;
}

.wfd-chat-empty strong {
    color: var(--wfd-ink);
    margin-bottom: 4px;
}

.wfd-chat-message {
    align-self: flex-start;
    max-width: min(78%, 680px);
}

.wfd-chat-message.is-own {
    align-self: flex-end;
}

.wfd-chat-message header {
    align-items: baseline;
    display: flex;
    gap: 9px;
    justify-content: space-between;
    margin: 0 5px 4px;
}

.wfd-chat-message header strong {
    color: var(--wfd-ink);
    font-size: 11px;
}

.wfd-chat-message time,
.wfd-chat-notice time {
    color: var(--wfd-muted);
    font-size: 9px;
    white-space: nowrap;
}

.wfd-chat-bubble {
    background: var(--wfd-card);
    border: 1px solid var(--wfd-line);
    border-left: 4px solid var(--wfd-chat-power);
    border-radius: 4px 11px 11px 11px;
    box-shadow: 0 3px 12px rgba(44, 49, 43, .05);
    line-height: 1.55;
    overflow-wrap: anywhere;
    padding: 10px 12px;
    white-space: pre-wrap;
}

.wfd-chat-message.is-own .wfd-chat-bubble {
    background: #e5eee9;
    border-left: 1px solid var(--wfd-line);
    border-radius: 11px 4px 11px 11px;
    border-right: 4px solid var(--wfd-chat-power);
}

.wfd-chat-notice {
    align-items: center;
    align-self: center;
    background: rgba(255, 253, 248, .78);
    border: 1px dashed #b8ad96;
    border-radius: 999px;
    color: var(--wfd-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 10px;
    gap: 6px;
    justify-content: center;
    max-width: 90%;
    padding: 6px 11px;
    text-align: center;
}

.wfd-chat-notice strong {
    color: var(--wfd-accent-dark);
}

.wfd-chat-composer {
    align-items: stretch;
    display: flex;
    gap: 8px;
}

.wfd-app .wfd-chat-composer input {
    flex: 1 1 auto;
    min-width: 0;
}

.wfd-chat-composer button {
    flex: 0 0 auto;
    min-width: 94px;
}

.wfd-chat-hint {
    color: var(--wfd-muted);
    font-size: 10px;
    margin: -3px 2px 0;
}

.wfd-message-layout {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1.5fr) minmax(270px, .7fr);
}

.wfd-mail-tabs {
    border-bottom: 1px solid var(--wfd-line);
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.wfd-app .wfd-mail-tabs button {
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: var(--wfd-muted);
    margin-bottom: -1px;
}

.wfd-app .wfd-mail-tabs button.is-active {
    border-bottom-color: var(--wfd-accent);
    color: var(--wfd-ink);
}

.wfd-mail-tabs button span {
    background: #a44e48;
    border-radius: 999px;
    color: #fff;
    display: inline-block;
    font-size: 9px;
    margin-left: 5px;
    min-width: 18px;
    padding: 2px 5px;
}

.wfd-message-list {
    display: grid;
    gap: 9px;
}

.wfd-message-card {
    background: var(--wfd-card);
    border: 1px solid var(--wfd-line);
    border-left: 4px solid #a7aaa3;
    border-radius: 7px;
    padding: 14px;
}

.wfd-message-card.is-unread {
    background: #fff9e4;
    border-left-color: #bf8d28;
    box-shadow: 0 4px 18px rgba(81, 65, 26, .07);
}

.wfd-message-card header {
    align-items: start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.wfd-message-card header strong,
.wfd-message-channel {
    display: block;
}

.wfd-message-channel {
    color: var(--wfd-accent);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .09em;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.wfd-message-card time,
.wfd-message-meta {
    color: var(--wfd-muted);
    font-size: 10px;
}

.wfd-message-card time {
    white-space: nowrap;
}

.wfd-message-meta {
    margin: 7px 0 11px;
}

.wfd-message-body {
    line-height: 1.65;
    white-space: pre-wrap;
}

.wfd-message-card footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.wfd-message-card footer button {
    font-size: 10px;
    padding: 5px 8px;
}

.wfd-app button.wfd-link-danger {
    background: transparent;
    border-color: #c89595;
    color: var(--wfd-danger);
}

.wfd-message-composer {
    margin-top: 0;
    position: sticky;
    top: 35px;
}

.wfd-rules-intro {
    align-items: center;
    background: #e4ece7;
    border-left: 4px solid var(--wfd-accent);
    display: grid;
    gap: 4px 20px;
    grid-template-columns: minmax(90px, .3fr) minmax(0, 2fr);
    margin-bottom: 16px;
    padding: 16px;
}

.wfd-rules-intro strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
}

.wfd-rules-intro p {
    line-height: 1.6;
    margin: 0;
}

.wfd-rule-grid {
    display: grid;
    gap: 11px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wfd-rule-card {
    background: var(--wfd-card);
    border: 1px solid var(--wfd-line);
    border-radius: 8px;
    padding: 17px;
    position: relative;
}

.wfd-rule-card > span {
    color: rgba(69, 108, 100, .18);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    position: absolute;
    right: 12px;
    top: 9px;
}

.wfd-rule-card h3 {
    font-family: Georgia, "Times New Roman", serif;
    margin: 0 0 8px;
    position: relative;
}

.wfd-rule-card p {
    color: var(--wfd-muted);
    line-height: 1.55;
    margin: 0;
    position: relative;
}

.wfd-command-list {
    margin: 0;
}

.wfd-command-list > div {
    border-bottom: 1px solid #ebe4d6;
    display: grid;
    gap: 10px;
    grid-template-columns: 110px 1fr;
    padding: 8px 0;
}

.wfd-command-list dt {
    font-weight: 800;
}

.wfd-command-list dd {
    color: var(--wfd-muted);
    margin: 0;
}

.wfd-score-podium {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 22px auto;
    max-width: 860px;
}

.wfd-podium-place {
    background: var(--wfd-card);
    border: 1px solid var(--wfd-line);
    border-top: 5px solid var(--wfd-power);
    border-radius: 9px 9px 3px 3px;
    min-height: 150px;
    padding: 18px;
    position: relative;
    text-align: center;
}

.wfd-podium-place.place-1 {
    min-height: 190px;
    order: 2;
}

.wfd-podium-place.place-2 {
    min-height: 166px;
    order: 1;
}

.wfd-podium-place.place-3 {
    order: 3;
}

.wfd-podium-place .wfd-rank {
    color: rgba(36, 48, 47, .1);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    position: absolute;
    right: 10px;
    top: 6px;
}

.wfd-podium-place h3 {
    font-family: Georgia, "Times New Roman", serif;
    margin: 8px 0 3px;
}

.wfd-podium-place p {
    color: var(--wfd-muted);
    font-size: 11px;
    margin: 0 0 8px;
}

.wfd-inline-power {
    align-items: center;
    display: inline-flex;
    gap: 7px;
}

.wfd-recommendation {
    background: #e6eee9;
    border-color: #b9cec2;
}

.wfd-recommendation p {
    line-height: 1.65;
    margin: 0;
}

.wfd-archive-head {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 16px 0;
}

.wfd-archive-head > div {
    background: rgba(255, 255, 255, .6);
    border-bottom: 2px solid var(--wfd-accent);
    padding: 11px;
}

.wfd-archive-head span,
.wfd-archive-head strong {
    display: block;
}

.wfd-archive-head span {
    color: var(--wfd-muted);
    font-size: 10px;
}

.wfd-timeline {
    display: grid;
    gap: 10px;
    margin-left: 14px;
    padding-left: 22px;
    position: relative;
}

.wfd-timeline::before {
    background: var(--wfd-line);
    content: "";
    inset: 0 auto 0 0;
    position: absolute;
    width: 2px;
}

.wfd-timeline-item {
    background: var(--wfd-card);
    border: 1px solid var(--wfd-line);
    border-radius: 7px;
    position: relative;
}

.wfd-timeline-item summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 10px;
    list-style: none;
    padding: 13px;
}

.wfd-timeline-item summary::-webkit-details-marker {
    display: none;
}

.wfd-timeline-item summary > div {
    flex: 1;
}

.wfd-timeline-item summary strong,
.wfd-timeline-item summary small {
    display: block;
}

.wfd-timeline-item summary small {
    color: var(--wfd-muted);
    font-size: 10px;
    margin-top: 2px;
}

.wfd-timeline-dot {
    background: #a7aaa3;
    border: 3px solid var(--wfd-paper);
    border-radius: 50%;
    box-shadow: 0 0 0 1px #a7aaa3;
    height: 15px;
    left: -31px;
    position: absolute;
    width: 15px;
}

.wfd-timeline-dot.is-resolved {
    background: #3d7d53;
    box-shadow: 0 0 0 1px #3d7d53;
}

.wfd-timeline-dot.is-open {
    background: #b7811d;
    box-shadow: 0 0 0 1px #b7811d;
}

.wfd-timeline-content {
    border-top: 1px solid #ebe4d6;
    padding: 13px;
}

.wfd-result-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.wfd-result-summary span {
    background: #f0ece3;
    border-radius: 999px;
    font-size: 10px;
    padding: 5px 9px;
}

.wfd-admin-actions {
    background: #edf1ed;
    border: 1px solid #d4ded7;
    border-radius: 7px;
    padding: 10px;
}

.wfd-two-column .wfd-table-panel {
    overflow: hidden;
}

.wfd-two-column table {
    min-width: 520px;
}

@media (max-width: 1080px) {
    .wfd-participant-grid,
    .wfd-map-zones {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .wfd-message-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .wfd-message-composer {
        position: static;
    }
}

@media (max-width: 780px) {
    .wfd-view-hero,
    .wfd-board-status {
        align-items: flex-start;
        flex-direction: column;
    }

    .wfd-board-status span {
        text-align: left;
    }

    .wfd-metric-grid,
    .wfd-archive-head,
    .wfd-participant-grid,
    .wfd-rule-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wfd-two-column,
    .wfd-rules-intro {
        grid-template-columns: 1fr;
    }

    .wfd-view-toolbar > *,
    .wfd-control {
        max-width: none;
        width: 100%;
    }

    .wfd-view-toolbar .wfd-segmented,
    .wfd-view-toolbar .wfd-zoom-controls {
        width: auto;
    }
}

@media (max-width: 520px) {
    .wfd-sandbox-widget {
        border-radius: 7px;
        padding: 15px;
    }

    .wfd-metric-grid,
    .wfd-archive-head,
    .wfd-participant-grid,
    .wfd-rule-grid,
    .wfd-score-podium {
        grid-template-columns: 1fr;
    }

    .wfd-podium-place,
    .wfd-podium-place.place-1,
    .wfd-podium-place.place-2 {
        min-height: 0;
        order: initial;
    }

    .wfd-mail-tabs {
        overflow-x: auto;
    }

    .wfd-chat-window {
        min-height: 290px;
        padding: 12px;
    }

    .wfd-chat-message {
        max-width: 90%;
    }

    .wfd-chat-message header {
        align-items: flex-start;
        flex-direction: column;
        gap: 1px;
    }

    .wfd-chat-composer {
        flex-direction: column;
    }

    .wfd-chat-composer button {
        width: 100%;
    }

    .wfd-mail-tabs button,
    .wfd-message-card time {
        white-space: nowrap;
    }

    .wfd-message-card header {
        display: block;
    }

    .wfd-message-card time {
        display: block;
        margin-top: 5px;
    }

    .wfd-command-list > div {
        grid-template-columns: 1fr;
    }
}

.wfd-board-viewport { cursor: grab; }
.wfd-board-viewport.is-dragging { cursor: grabbing; user-select: none; }


@media (max-width: 620px) {
    .wfd-board-viewport {
        aspect-ratio: auto;
        height: clamp(360px, 62vh, 560px);
    }

    .wfd-order-dialog {
        left: 10px;
        max-width: none;
        right: 10px;
        top: 10px;
        width: auto;
    }

    .wfd-icon-size-control {
        bottom: 10px;
        justify-content: center;
        left: 10px;
        right: 10px;
    }

    .wfd-app .wfd-icon-size-control input[type="range"] {
        flex: 1 1 auto;
        max-width: 180px;
    }
}
