body.burgundyGame #content {
    overflow: clip;
    background-color: #1c4935;
    background-image:
        radial-gradient(ellipse at top left, #42734a 0%, transparent 68%),
        linear-gradient(145deg, #28583c, #143a2d);
}
body.burgundyGame #game { background: transparent; }

#CastlesOfBurgundy2 .cobLogHighlightShape {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

    #CastlesOfBurgundy2 .cobLogHighlightShape polygon {
        fill: transparent;
        stroke: #0078d4;
        stroke-width: 4;
    }

body.burgundyGame #game {
    min-width: 0;
    min-height: 0;
    overflow: visible;
    padding: 0;
}

body.burgundyGame #board {
    min-width: 0;
    padding: 0;
    width: 100%;
}

#cobFrame {
    position: relative;
    margin: 0;
    width: 100%;
    overflow: visible;
}

#CastlesOfBurgundy2 {
    position: absolute;
    width: 1000px;
    height: 830px;
    transform-origin: top left;
    font: 18px/1.25 Georgia,serif;
    color: #342820;
    background: transparent;
    border-radius: 8px;
}

    #CastlesOfBurgundy2 button {
        font: inherit;
        color: inherit;
        cursor: default;
        touch-action: manipulation;
    }

        #CastlesOfBurgundy2 button.active, #CastlesOfBurgundy2 .cobInfo {
            cursor: pointer;
        }

        #CastlesOfBurgundy2 button:disabled {
            opacity: 1;
        }

        #CastlesOfBurgundy2 button:focus-visible, #CastlesOfBurgundy2 .playerDataBasic:focus-visible {
            outline: 4px solid #0276c9;
        }

    #CastlesOfBurgundy2 .cobSelected {
        outline: 3px solid #d18a0d;
    }

    #CastlesOfBurgundy2 #playerData {
        display: grid;
        grid-template-columns: repeat(auto-fit,minmax(min(calc((100% - 2px) / 2),150px),1fr));
        gap: 2px;
        margin: 0;
        width: 100%;
        font: 0.875rem/1.25 system-ui, sans-serif;
    }

        #CastlesOfBurgundy2 #playerData .playerData {
            min-width: 0;
            border: 1px solid var(--cob-player-color);
            border-radius: 0.4rem 0.4rem 0 0;
            background-color: color-mix(in srgb, var(--cob-player-color) 22%, white);
            padding: 0.2em 0.4em;
            cursor: pointer;
        }

        #CastlesOfBurgundy2 #playerData .playerData.cobViewedPlayer {
            background-color: color-mix(in srgb, var(--cob-player-color) 36%, white);
            box-shadow: inset 0 -3px var(--cob-player-color);
        }

        #CastlesOfBurgundy2 #playerData .playerDataBasic {
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            column-gap: 4px;
            padding: 0 0 3px;
            border: 0;
            cursor: pointer;
        }

        #CastlesOfBurgundy2 #playerData .basicDesc {
            display: flex;
            flex: 1 1 auto;
            align-items: center;
            white-space: nowrap;
            min-width: 0;
            padding-left: 0;
        }

        #CastlesOfBurgundy2 #playerData .playerInfoLogin,
        #CastlesOfBurgundy2 #playerData .cobStarter {
            font: inherit;
        }

        #CastlesOfBurgundy2 #playerData .playerInfoLogin {
            white-space: normal;
            overflow-wrap: anywhere;
        }

        #CastlesOfBurgundy2 #playerData .cobStarter {
            flex-shrink: 0;
        }

        #CastlesOfBurgundy2 #playerData .playerDataDetail {
            display: flex;
            justify-content: flex-start;
            flex-wrap: nowrap;
            gap: 0.2em;
            padding: 0;
            border: 0;
        }

        #CastlesOfBurgundy2 #playerData .cobResource {
            display: inline-flex;
            align-items: center;
            gap: 0.2em;
            font-size: inherit;
        }

        #CastlesOfBurgundy2 #playerData .cobTabStats {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            justify-content: flex-end;
            margin-inline-start: auto;
            gap: 4px;
            max-width: 100%;
        }

        #CastlesOfBurgundy2 #playerData .cobTabSupplies {
            gap: 5px;
        }

        #CastlesOfBurgundy2 #playerData .cobTabSupply {
            display: inline-flex;
            align-items: center;
            gap: 2px;
            font-variant-numeric: tabular-nums;
        }

        #CastlesOfBurgundy2 #playerData .cobTabSupply .cobResourceIcon {
            width: 15px;
            height: 15px;
        }

        #CastlesOfBurgundy2 #playerData .playerDataBasic[aria-pressed="true"] {
            box-shadow: none;
        }

.cobResourceIcon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
}

#CastlesOfBurgundy2 .cobResourceIcon, body.burgundyGame #log .cobResourceIcon {
    width: 23px;
    height: 23px;
    font-size: 21px;
    object-fit: contain;
}

#CastlesOfBurgundy2 .bi-star-fill, body.burgundyGame #log .bi-star-fill {
    color: #6a440e;
    background: #efce69;
    border: 1px solid #937335;
    border-radius: 50%;
    font-size: 15px;
}

#CastlesOfBurgundy2 .cobSilverling, body.burgundyGame #log .cobSilverling {
    overflow: hidden;
}

#CastlesOfBurgundy2 .cobBonusPair {
    display: inline-flex;
    gap: 3px;
    align-items: flex-end;
    padding: 0 3px;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;}

#CastlesOfBurgundy2 .cobBonusLarge {
    width: 46px;
    height: 46px;
    border: 2px outset #888;
}

#CastlesOfBurgundy2 .cobBonusSmall {
    width: 29px;
    height: 29px;
    border: 2px outset #888;
}

#CastlesOfBurgundy2 img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    vertical-align: middle;
}

#CastlesOfBurgundy2 .cobWorkerCost {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 24px;
    padding: 1px 5px;
    border-radius: 999px;
    border: 2px solid #8e5a1a;
    background: rgba(255,247,223,.98);
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
    color: #342820;
    font: bold 15px/18px Georgia,serif;
    z-index: 2;
    pointer-events: none;
}

    #CastlesOfBurgundy2 .cobWorkerCost .cobResourceIcon {
        width: 17px;
        height: 17px;
        z-index: 1;
        flex-shrink: 0;
    }

#CastlesOfBurgundy2 .cobCell .cobWorkerCost {
    bottom: 4px;
}

#CastlesOfBurgundy2 .cobDie .cobWorkerCost {
    top: calc(100% + 2px);
    bottom: auto;
}

#CastlesOfBurgundy2 .cobDepot > b .cobWorkerCost {
    top: 0;
}

#CastlesOfBurgundy2 .cobStoredGood .cobWorkerCost {
    bottom: 0;
    right:auto;
}

#CastlesOfBurgundy2 .cobWorkerCost--die {
    position: absolute;
}

#CastlesOfBurgundy2 .cobWorkerCost--hex, #CastlesOfBurgundy2 .cobWorkerCost--stack, #CastlesOfBurgundy2 .cobWorkerCost--die {
    position: absolute;
}

#CastlesOfBurgundy2 .cobWorkerCost--hex, #CastlesOfBurgundy2 .cobWorkerCost--stack, #CastlesOfBurgundy2 .cobWorkerCost--die {
    position: absolute;
}

#CastlesOfBurgundy2 .cobWorkerCost--hex, #CastlesOfBurgundy2 .cobWorkerCost--stack, #CastlesOfBurgundy2 .cobWorkerCost--die {
    position: absolute;
}

#CastlesOfBurgundy2 .cobEstate {
    position: absolute;
    right: 0;
    top: 270px;
    width: 800px;
    height: 550px;
    background-size: 800px 550px;
}

#CastlesOfBurgundy2 .cobCell, #CastlesOfBurgundy2 .cobStorage {
    position: absolute;
    width: 70px;
    height: 80px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 40%;
}

#CastlesOfBurgundy2 :is(.cobCell,.cobStorage):has(> .cobTile)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 70 80'%3E%3Cg fill='none' stroke-linejoin='round'%3E%3Cpath d='M3 59V21L35 2 67 21' stroke='%23fff3cc' stroke-opacity='.8' stroke-width='1.5'/%3E%3Cpath d='M67 21V59L35 78 3 59' stroke='%23392a1d' stroke-opacity='.8' stroke-width='1.5'/%3E%3Cpath d='M65 23V58L35 75.5 5 58' stroke='%23392a1d' stroke-opacity='.25'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat;
    pointer-events: none;
}

#CastlesOfBurgundy2 :is(.cobCell,.cobStorage) > .cobTile {
    position: absolute;
    top: 1.5px;
    left: 1.5px;
    width: 67px;
    height: 77px;
}

#CastlesOfBurgundy2 :is(.cobCell,.cobStorage):has(> .cobTile) {
    filter: drop-shadow(.5px 1px 1px #2d211580);
}

#CastlesOfBurgundy2 .cobStorageHelp {
    position: absolute;
    top: 440px;
    z-index: 2;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
}

    #CastlesOfBurgundy2 .cobStorage.cobSelected {
        outline: 0;
    }

        #CastlesOfBurgundy2 .cobStorage.cobSelected::after {
            content: "";
            position: absolute;
            inset: -3px;
            pointer-events: none;
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='50,2 95,25 95,75 50,98 5,75 5,25' fill='none' stroke='%23d18a0d' stroke-width='5'/%3E%3C/svg%3E") center/100% 100% no-repeat;
        }

    #CastlesOfBurgundy2 .cobStorage.active {
        outline: 0;
    }

    #CastlesOfBurgundy2 .cobStorage.active:not(.cobSelected)::after {
        content: "";
        position: absolute;
        inset: -3px;
        pointer-events: none;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='50,2 95,25 95,75 50,98 5,75 5,25' fill='none' stroke='%23be1d25' stroke-width='5'/%3E%3C/svg%3E") center/100% 100% no-repeat;
    }

#CastlesOfBurgundy2 .cobDie {
    position: absolute;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 0;
}

#CastlesOfBurgundy2 .cobStoredGood {
    position: absolute;
    width: 60px;
    height: 60px;
    padding: 0;
    background: transparent;
    border: 0;
}

#CastlesOfBurgundy2 :is(.cobStoredGoodCount,.cobGoodsCount,.cobResourceCount) {
    position: absolute;
    top: 2px;
    right: 2px;
    border-radius: 999px;
    background: #3d3025;
    color: #fff5dc;
    padding: 1px 5px;
    font: 600 13px/1.2 system-ui,sans-serif;
    pointer-events: none;
}

#CastlesOfBurgundy2 .cobSilver, #CastlesOfBurgundy2 .cobWorkers {
    position: absolute;
    width: 65px;
}

#CastlesOfBurgundy2 .cobSilver {
    left: 44px;
    top: 39px;
    height: 70px;
}

#CastlesOfBurgundy2 .cobSilverCoins {
    position: absolute;
    inset: 8px 3px 15px;
    display: grid;
    grid-template-columns: repeat(var(--cob-silver-columns), minmax(0, 21px));
    grid-auto-rows: minmax(0, 21px);
    place-content: center;
}

#CastlesOfBurgundy2 .cobSilverCoins .cobSilverling {
    width: 100%;
    height: 100%;
    min-height: 0;
}

#CastlesOfBurgundy2 .cobSilver .cobResourceCount {
    top: auto;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
}

#CastlesOfBurgundy2 .cobWorkers {
    left: 44px;
    top: 435px;
}

#CastlesOfBurgundy2 .cobSold {
    position: absolute;
    width: 60px;
    height: 60px;
    background: #f6e6bf;
    border: 1px solid #aa926c;
    font-size: 14px;
}

#CastlesOfBurgundy2 .cobActions {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#CastlesOfBurgundy2 .cobActionArea, #CastlesOfBurgundy2 .cobBonusArea {
    position: absolute;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

    #CastlesOfBurgundy2 .cobActionArea.active {
        pointer-events: auto;
    }

    #CastlesOfBurgundy2 .cobActionArea.cobSelected {
        outline: 0;
    }

#CastlesOfBurgundy2 .cobPending {
    outline: 3px solid #e87900;
    outline-offset: -2px;
}

#CastlesOfBurgundy2 .cobBonusArea {
    pointer-events: auto;
}

#CastlesOfBurgundy2 .cobBonusArea:focus-visible {
    outline: 3px solid #6a2630;
    outline-offset: -2px;
}

#CastlesOfBurgundy2 .cobEstateName {
    position: absolute;
    left: 340px;
    top: 2px;
    font: 0.875rem/1.25 system-ui, sans-serif;
}

#CastlesOfBurgundy2 .cobTutorialLink {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 1;
    display: grid;
    place-items: start end;
    width: 38px;
    height: 38px;
    color: #fff2d3;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
}

#CastlesOfBurgundy2 .cobTutorialLink .bi {
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border-radius: 4px;
    background: #193525;
}

#CastlesOfBurgundy2 .cobTutorialLink:hover .bi,
#CastlesOfBurgundy2 .cobTutorialLink:focus-visible .bi {
    background: #2c4e38;
    color: #fff2d3;
}

#CastlesOfBurgundy2 .cobSetup {
    position: absolute;
    right: 0;
    top: 270px;
    max-width: 800px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #f7ebcc;
    z-index: 2;
}

body.burgundyGame #board.cobShowsAllBoards {
    overflow: auto;
}

@media(max-width:599px) {
    body.burgundyGame #board {
        overflow: auto;
    }

    #cobFrame {
        margin: 0;
    }
}

#CastlesOfBurgundy2 #playerData .itemValue::before {
    content: none;
}

#CastlesOfBurgundy2 button.active {
    outline: 3px solid #be1d25;
    outline-offset: 1px;
}

#CastlesOfBurgundy2 .cobActionArea.active:not([data-kind="Buy"]) {
    outline-offset: -3px;
}

#CastlesOfBurgundy2 .cobCell.active {
    outline: none;
}

#CastlesOfBurgundy2 .cobPlacementGuide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

    #CastlesOfBurgundy2 .cobPlacementGuide polygon {
        stroke-width: 3;
        fill: transparent;
    }

#CastlesOfBurgundy2 .cobLegal polygon {
    stroke: #be1d25;
}

#CastlesOfBurgundy2 .cobReachable polygon {
    stroke: #be1d25;
    stroke-dasharray: 5 4;
    fill: #312e2833;
}

#CastlesOfBurgundy2 .cobInvalid polygon {
    fill: #312e285c;
}

#CastlesOfBurgundy2 .cobPlayers { min-width: 0; max-width: 100%; }

#CastlesOfBurgundy2 .cobScoreButton {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

body.burgundyGame .popover.cobPopover {
    --bs-popover-bg: #f5e8c8;
    --bs-popover-border-color: #a99060;
    --bs-popover-body-color: #243d30;
    --bs-popover-border-radius: 6px;
    max-width: min(520px,calc(100vw - 24px));
    background-image: linear-gradient(145deg, #fcf3db, #eee0b9);
    box-shadow: inset 0 1px #fff8e6, 0 4px 14px #17332650;
}

.cobPopover h3 {
    color: #254638;
    font: 600 1.05rem/1.25 Georgia, serif;
    margin: 0 0 8px;
}

.cobPopover p:last-child {
    margin-bottom: 0;
}

.cobHelpContent {
    max-height: min(60vh,560px);
    max-width: 470px;
    overflow: auto;
    font-size: 14px;
}

body.burgundyGame .popover.cobEstatePopover {
    max-width: min(290px, calc(100vw - 24px));
}

.cobEstatePopover p {
    margin: 0;
}

.cobDepotZoomTiles {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cobPopover .cobDepotZoomContent h3 {
    margin-bottom: 4px;
    font-size: .92rem;
}

body.burgundyGame .popover.cobDepotZoomPopover {
    --bs-popover-body-padding-y: .5rem;
}

body.burgundyGame .popover.cobDepotZoomColumns {
    width: min(560px, calc(100vw - 24px));
    max-width: none;
}

.cobDepotZoomColumns .cobDepotZoomContent {
    max-width: none;
}

.cobDepotZoomColumns .cobDepotZoomTiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
}

.cobDepotZoomTiles li {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.cobDepotZoomTiles img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.cobDepotPopupTake {
    padding: 0;
    border: 0;
    background: transparent;
    outline: 2px solid #9b6824;
    outline-offset: -2px;
    cursor: pointer;
}

.cobDepotPopupTake:is(:hover, :focus-visible) {
    outline: 3px solid #654923;
}

    .cobHelpContent h3 {
        font-size: 17px;
    }

.cobScoreBreakdown { min-width: min(235px,65vw); }
.cobScoreBreakdown h4 {
    margin: 0 0 3px;
    font: 600 .85rem/1.25 system-ui,sans-serif;
}
.cobScoreRows { margin: 0; }
.cobScoreRow {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
}
.cobScoreRow dt { font-weight: 400; }
.cobScoreRow dd { margin: 0; font-variant-numeric: tabular-nums; }
.cobScoreTotal {
    margin: 3px 0 0;
    border-top: 1px solid #b5a57e;
    padding-top: 4px;
    font-weight: 600;
}
.cobScoreProjection {
    margin-top: 9px;
    padding: 7px 8px;
    border-radius: 4px;
    background: #e8e4c6;
}

#CastlesOfBurgundy2 .cobUnchosen {
    display: none;
}

#CastlesOfBurgundy2.cobChoosing .cobMarket {
    display: none;
}

#CastlesOfBurgundy2 .cobSetup:not(:empty) {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(180px,264px));
    justify-content: center;
    gap: 12px;
    background: transparent;
}

#CastlesOfBurgundy2 .cobBoardChoice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #fff7df;
    border: 1px solid #9b8451;
    border-radius: 6px;
    padding: 3px;
}

    #CastlesOfBurgundy2 .cobBoardChoice img {
        width: 100%;
        height: auto;
    }

#CastlesOfBurgundy2.cobPortrait.cobChoosing .cobEstate, #CastlesOfBurgundy2.cobPortrait.cobChoosing .cobSetup {
    top: 220px;
}

#CastlesOfBurgundy2.cobPortrait.cobChoosing .cobSetup {
    grid-template-columns: repeat(3,minmax(0,264px));
}

#CastlesOfBurgundy2.cobChoosing .cobEstate {
    display: none;
}

#CastlesOfBurgundy2 .cobPlacementLegend {
    position: absolute;
    left: 330px;
    top: 25px;
    font-size: 12px;
    line-height: 16px;
    background: #fff8d9db;
    padding: 1px 4px;
    border-radius: 4px;
    pointer-events: none;
}

/* Keep numbered depots within their allocated rectangle: tiles, die, goods. */

/* Responsive chrome stays at its normal text size; only estate geometry scales. */
body.burgundyGame #board {
    overflow: auto;
    scrollbar-gutter: stable;
}
#cobFrame { position: relative; width: 100%; height: auto; }
#CastlesOfBurgundy2 {
    position: relative;
    display: grid;
    container-type: inline-size;
    grid-template-columns: max-content minmax(0,1fr);
    align-content: start;
    gap: 0.2em;
    width: 100%;
    height: auto;
    padding: 0.2em;
    font-size: 1rem;
    transform: none;
}

#CastlesOfBurgundy2 .cobEstateFrame { grid-column: 2; min-width: 0; overflow: hidden; }
#CastlesOfBurgundy2 .cobEstate {
    position: relative; inset: auto; transform-origin: top left; margin: 0;
}
#CastlesOfBurgundy2 .cobSetup {
    position: relative; inset: auto; grid-column: 1 / -1; max-width: none;
}
#CastlesOfBurgundy2 .cobSetup:empty { display: none; }
#CastlesOfBurgundy2.cobChoosing .cobEstateFrame { display: none; }
#CastlesOfBurgundy2 .cobSetup:not(:empty),
#CastlesOfBurgundy2.cobPortrait.cobChoosing .cobSetup {
    grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),264px));
}
.cobFlight { pointer-events: none; object-fit: contain; z-index: 1100; }

/* Keep confirmed and provisional scores together as one readable value. */
#CastlesOfBurgundy2 .cobResourcePoints .itemValue {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
:is(#CastlesOfBurgundy2, body.burgundyGame #log) .cobConfirmedPoints {
    display: grid;
    place-items: center;
    isolation: isolate;
    position: relative;
    width: 26px;
    height: 26px;
}
:is(#CastlesOfBurgundy2, body.burgundyGame #log) .cobConfirmedPoints .cobResourceIcon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}
:is(#CastlesOfBurgundy2, body.burgundyGame #log) .cobConfirmedPoints::before {
    content: "";
    position: absolute;
    inset: 1px 3px;
    background: radial-gradient(ellipse, #d47924 49%, #c45c20 63%, transparent 77%);
    z-index: -1;
}
:is(#CastlesOfBurgundy2, body.burgundyGame #log) .cobConfirmedValue {
    color: #ffe075;
    font-size: .75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 1px #532103;
}

/* The market spans both rows while the status groups wrap over the estate. */
#CastlesOfBurgundy2 .cobSupport {
    display: flex;
    flex-wrap: wrap;
    align-self: start;
    align-content: start;
    align-items: stretch;
    justify-content: space-between;
    gap: 3px 8px;
    container: cob-status / inline-size;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    padding: 3px;
    border-radius: 5px;
}
#CastlesOfBurgundy2 .cobCalendar,
#CastlesOfBurgundy2 .cobHarbour,
#CastlesOfBurgundy2 .cobBonuses {
    position: relative;
    box-sizing: border-box;
    max-width: 100%;
    padding: 3px 5px;
    border: 1px solid var(--cob-status-border);
    border-radius: 6px;
    background: linear-gradient(145deg, var(--cob-status-light), var(--cob-status-dark));
    box-shadow: inset 0 1px #ffffff80, 0 1px 2px #49391f26;
    cursor: pointer;
}
#CastlesOfBurgundy2 .cobCalendar {
    --cob-status-light: #f8edd0;
    --cob-status-dark: #e7d6a8;
    --cob-status-border: #b69c65;
    align-content: center;
}
#CastlesOfBurgundy2 .cobHarbour {
    --cob-status-light: #e9eed4;
    --cob-status-dark: #c5d2a5;
    --cob-status-border: #91a16c;
}
#CastlesOfBurgundy2 .cobBonuses {
    --cob-status-light: #e7d6a8;
    --cob-status-dark: #f8edd0;
    --cob-status-border: #b69c65;
}
#CastlesOfBurgundy2 .cobStatusHelp {
    position: absolute;
    inset: 0;
    z-index: 1;
    border: 0;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}
#CastlesOfBurgundy2 .cobStatusHelp:focus-visible {
    outline: 2px solid #654923;
    outline-offset: -2px;
}
#CastlesOfBurgundy2 .cobCalendar {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 3px 8px;
}
#CastlesOfBurgundy2 .cobPhase {
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 2px;
    width: min(100%,180px);
}
#CastlesOfBurgundy2 .cobPhaseSlot {
    position: relative;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 4px;
    background: linear-gradient(#f4eccd9c,#c4bd8659);
}
#CastlesOfBurgundy2 .cobPhaseSlot::before {
    content: "";
    width: min(100%,32px);
    aspect-ratio: 56 / 92;
    background: url('../images/phase-markers.webp') var(--cob-phase-art-position) center / 500% 100% no-repeat;
}
#CastlesOfBurgundy2 .cobPhaseSlot > span {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
}
#CastlesOfBurgundy2 .cobCurrentPhase {
    border-color: #654923;
    background: linear-gradient(#fbefd1,#dcc685);
    box-shadow: inset 0 0 0 1px #fff6db;
}
#CastlesOfBurgundy2 .cobRound {
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 10px;
    width: min(100%,240px);
}
#CastlesOfBurgundy2 .cobRoundSlot { position: relative; min-width: 0; }
#CastlesOfBurgundy2 .cobRoundSlot img { display: block; width: 100%; aspect-ratio: 1; }
#CastlesOfBurgundy2 .cobRoundSlot:not(:last-child)::after {
    content: "";
    position: absolute;
    top: calc(50% - 3px);
    right: -7px;
    width: 5px;
    height: 5px;
    border: solid #80613e;
    border-width: 2px 2px 0 0;
    transform: rotate(45deg);
}
#CastlesOfBurgundy2 .cobHarbour { flex: 0 1 299px; width: min(100%,299px); display: grid; align-content: center; gap: 2px; }
#CastlesOfBurgundy2 .cobTrack {
    position: relative;
    width: 100%;
    aspect-ratio: 800 / 110;
    background: url('../images/harbour-strip.webp') center / 100% 100% no-repeat;
    border-radius: 5px;
}
#CastlesOfBurgundy2 .cobTrackSpace { position: absolute; top: 0; width: 11%; height: 100%; }
#CastlesOfBurgundy2 .cobTrack {
    width: min(100%, var(--cob-track-width, 299px));
    justify-self: center;
}
#CastlesOfBurgundy2 .cobShipMarker { position: absolute; left: 50%; width: 80%; max-width: 37px; aspect-ratio: 3 / 2; transform: translate(-50%,-50%); border: 0; padding: 0; background: transparent; cursor: pointer; }
#CastlesOfBurgundy2 .cobShipMarker img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 69%; }
#CastlesOfBurgundy2 .cobBonuses { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-content: center; align-items: center; gap: 3px; }
#CastlesOfBurgundy2 .cobBonuses .cobBonusPair {
    width: 100%;
    max-width: var(--cob-bonus-size, 46px);
    padding: 0;
    gap: 2px;
}
#CastlesOfBurgundy2 .cobBonusSource { position: relative; display: grid; width: 100%; }
#CastlesOfBurgundy2 .cobBonusSourceSmall { width: 66%; }
#CastlesOfBurgundy2 .cobBonusSource > :is(.cobBonusLarge, .cobBonusSmall) {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
}
#CastlesOfBurgundy2 .cobBonusOwner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 82%;
    transform: translate(-50%,-50%);
}
@container cob-status (min-width: 900px) {
    #CastlesOfBurgundy2 .cobCalendar,
    #CastlesOfBurgundy2 .cobHarbour,
    #CastlesOfBurgundy2 .cobBonuses { flex: 1 1 0; min-width: 0; }
    #CastlesOfBurgundy2 .cobPhaseSlot::before { width: 100%; }
    #CastlesOfBurgundy2 .cobHarbour { justify-items: center; }
    #CastlesOfBurgundy2 .cobShipMarker { max-width: none; }
    #CastlesOfBurgundy2 .cobBonuses { justify-content: center; }
}
@container cob-status (max-width: 780px) {
    #CastlesOfBurgundy2 .cobCalendar { flex: 1 1 100%; }
    #CastlesOfBurgundy2 .cobPhase { width: min(100%,155px); }
    #CastlesOfBurgundy2 .cobRound { width: min(100%,215px); }
    #CastlesOfBurgundy2 .cobBonuses { --cob-bonus-size: 34px; }
}
@container cob-status (min-width: 540px) {
    #CastlesOfBurgundy2 .cobSupport > :is(.cobCalendar,.cobHarbour,.cobBonuses) {
        flex: 1 1 0;
        min-width: 0;
    }
    #CastlesOfBurgundy2 .cobPhase {
        flex: 3 0 min(100%, 155px);
        max-width: 210px;
    }
    #CastlesOfBurgundy2 .cobRound {
        flex: 4 0 min(100%, 195px);
        max-width: 260px;
    }
    #CastlesOfBurgundy2 .cobRoundSlot::after { right: -5px; width: 4px; height: 4px; }
    #CastlesOfBurgundy2 .cobBonuses {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}
#CastlesOfBurgundy2.cobChoosing .cobSupport { display: none; }

@container cob-status (max-width: 540px) {
    #CastlesOfBurgundy2 :is(.cobHarbour,.cobBonuses) {
        flex: 1 1 100%;
        min-width: 0;
    }
    #CastlesOfBurgundy2 .cobShipMarker { max-width: none; }
    #CastlesOfBurgundy2 .cobBonuses {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        justify-items: center;
    }
    #CastlesOfBurgundy2 .cobBonuses { --cob-bonus-size: 46px; }
}


/* One tile geometry for the estate and every depot, independent of all-estates mode. */
#CastlesOfBurgundy2 .cobEstateFrame { align-self: start; }
#CastlesOfBurgundy2 .cobSold { padding: 0; background: transparent; border: 0; }
.cobPopover .cobSoldType { display: inline-flex; align-items: center; gap: 4px; margin: 4px; }
.cobPopover .cobSoldType img { width: 44px; height: 44px; }
#CastlesOfBurgundy2 .cobDistributed { filter: grayscale(1); opacity: .3; }
#CastlesOfBurgundy2 #playerData .playerDataDetail { flex-wrap: wrap; }

#CastlesOfBurgundy2 .cobEstatePanel { grid-column: 2; grid-row: 1; min-width: 0; align-self: start; }
#CastlesOfBurgundy2.cobChoosing .cobEstatePanel { grid-column: 1 / -1; grid-row: auto; }
#CastlesOfBurgundy2 .cobEstateFrame:not(.cobPrimaryEstate) { grid-column: 2; }
#CastlesOfBurgundy2.cobStackDepots {
    grid-template-columns: minmax(0, 1fr);
}
#CastlesOfBurgundy2.cobStackDepots :is(.cobEstatePanel,.cobMarket,.cobEstateFrame) {
    grid-column: 1;
}
#CastlesOfBurgundy2.cobStackDepots .cobMarket {
    grid-row: 2;
}
/* Compact depot squares keep their size independently of the estate scale. */
#CastlesOfBurgundy2 .cobMarket {
    --cob-depot-square: min(max(18px, 6cqw), var(--cob-depot-height-limit,52px));
    --cob-depot-die: min(24px, var(--cob-depot-square));
    --cob-depot-pair: calc(2 * var(--cob-depot-square) + 2px);
    display: grid;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: minmax(0,1fr);
    width: calc(var(--cob-depot-die) + 2 * var(--cob-depot-pair) + 30px);
    gap: 4px;
    align-self: start;
}
#CastlesOfBurgundy2 .cobDepot {
    display: grid;
    grid-template-columns: var(--cob-depot-die) repeat(2, var(--cob-depot-pair));
    gap: 8px;
    align-items: center;
    padding: 6px;
    background: linear-gradient(110deg,#f4e8c6,#dfd3a9);
    border: 1px solid #aa9565;
    border-radius: 6px;
    box-shadow: inset 0 1px #fff5d7;
}
#CastlesOfBurgundy2 .cobDrawPiles {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff2d5;
}
@container (min-width: 275px) {
    #CastlesOfBurgundy2.cobStackDepots .cobMarket {
        /* Each depot needs four squares, the die, and its gaps and padding. */
        --cob-depot-square: min(52px, calc((100cqw - 120px) / 8));
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #CastlesOfBurgundy2.cobStackDepots .cobDrawPiles {
        grid-column: 1 / -1;
    }
    #CastlesOfBurgundy2.cobStackDepots .cobDepot:not([data-depot="6"]) {
        justify-content: center;
    }
    #CastlesOfBurgundy2.cobStackDepots .cobDepot[data-depot="6"] .cobDepotTiles {
        grid-template-columns: repeat(auto-fill, var(--cob-depot-square));
    }
}
#CastlesOfBurgundy2 .cobDrawPiles > b,
#CastlesOfBurgundy2 .cobDepot[data-depot="6"] > b > span:first-child {
    margin-inline-end: auto;
    font: 600 .78rem/1.25 "Trebuchet MS",system-ui,sans-serif;
    letter-spacing: .04em;
}
#CastlesOfBurgundy2 .cobDrawPileButton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 2px;
    border: 1px solid #aa9565;
    border-radius: 4px;
    background: #eadcb6;
    color: #493621;
    font: 600 .78rem/1.25 "Trebuchet MS",system-ui,sans-serif;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}
#CastlesOfBurgundy2 .cobDrawPileButton img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
#CastlesOfBurgundy2 .cobHexStack {
    width: 16px;
    height: 18px;
    background: linear-gradient(#d9c49a 55%, #9e8050 55% 70%, #c2a573 70% 80%, #806338 80%);
    clip-path: polygon(50% 0, 100% 24%, 100% 74%, 50% 100%, 0 74%, 0 24%);
}
#CastlesOfBurgundy2 [data-depot="6"] .cobHexStack {
    background: linear-gradient(#88877a 55%, #55554a 55% 70%, #77766a 70% 80%, #3c3d35 80%);
}
.cobDrawContents {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    text-align: center;
}
.cobDrawContents img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}
#CastlesOfBurgundy2 .cobDepot > b { position: relative; }
#CastlesOfBurgundy2 .cobDepot:not([data-depot="6"]) > b {
    display: grid;
    justify-items: center;
}
#CastlesOfBurgundy2 .cobDepot > b > img { display: block; width: var(--cob-depot-die); height: var(--cob-depot-die); }
#CastlesOfBurgundy2 .cobDepotZoom {
    display: grid;
    place-items: center;
    width: 24px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font-size: 14px;
    line-height: 1;
}
#CastlesOfBurgundy2 .cobDepotZoom:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}
#CastlesOfBurgundy2 .cobDepotTile,
#CastlesOfBurgundy2 .cobGood {
    width: var(--cob-depot-square);
    height: var(--cob-depot-square);
    padding: 0;
    border: 0;
    background: none;
}
#CastlesOfBurgundy2 .cobDepotTile > img,
#CastlesOfBurgundy2 .cobGood > img {
    display: block;
    width: 100%;
    height: 100%;
}
#CastlesOfBurgundy2 .cobGood, .cobExtraGood { position: relative; }
#CastlesOfBurgundy2 .cobGood .cobStoredGoodCount, .cobExtraGood .cobStoredGoodCount {
    position: absolute;
    top: 1px;
    right: 1px;
    border-radius: 999px;
    padding: 1px 4px;
    background: #3d3025;
    color: #fff5dc;
    font: 600 10px/1.2 system-ui,sans-serif;
    pointer-events: none;
}
#CastlesOfBurgundy2 .cobGoodsOverflow {
    border: 0;
    border-radius: 3px;
    background: #cbbd94;
    color: #493621;
    font-weight: 600;
    padding: 0;
}
.cobExtraGoods { display: flex; gap: 4px; }
.cobExtraGood { width: 44px; height: 44px; border: 0; padding: 0; background: none; }
.cobExtraGood img { display: block; width: 100%; height: 100%; }
#CastlesOfBurgundy2 .cobDepotTiles,
#CastlesOfBurgundy2 .cobDepotGoods {
    display: grid;
    grid-auto-rows: var(--cob-depot-square);
    gap: 2px;
}
#CastlesOfBurgundy2 .cobDepot:not([data-depot="6"]) .cobDepotTiles {
    grid-template: repeat(2, var(--cob-depot-square)) / repeat(2, var(--cob-depot-square));
}
#CastlesOfBurgundy2 .cobDepotGoods {
    grid-template: repeat(2, var(--cob-depot-square)) / repeat(2, var(--cob-depot-square));
    align-self: start;
}
#CastlesOfBurgundy2 .cobEmptyGoodsSlot {
    background: url('../images/depot/crate.webp') center / 58% no-repeat;
    opacity: .38;
    pointer-events: none;
}
#CastlesOfBurgundy2 .cobDepot:not([data-depot="6"]) :is(.cobDepotTiles,.cobDepotGoods) {
    --cob-slot-step: calc(var(--cob-depot-square) + 2px);
    border-radius: 3px;
    background:
        linear-gradient(to right, transparent calc(100% - 2px), #cbbd94 0),
        linear-gradient(to bottom, transparent calc(100% - 2px), #cbbd94 0),
        #7d6e3b21;
    background-size: var(--cob-slot-step) var(--cob-slot-step);
}
#CastlesOfBurgundy2 .cobDepot[data-depot="6"] {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    background: linear-gradient(125deg,#3d483b,#29362f);
    border-color: #77785c;
    color: #f5e8c8;
    box-shadow: inset 0 1px #79806a;
}
#CastlesOfBurgundy2 .cobDepot[data-depot="6"] > b {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#CastlesOfBurgundy2 .cobDepot[data-depot="6"] .cobDepotTiles {
    grid-template-columns: repeat(4, var(--cob-depot-square));
}

#CastlesOfBurgundy2 .cobDepotTile.active {
    position: relative;
    outline-offset: -3px;
}

#CastlesOfBurgundy2 button.cobGood.active {
    outline-color: transparent;
}

#CastlesOfBurgundy2 .cobGood.active::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 2px #25282b, inset 0 0 0 4px #ffea00;
    pointer-events: none;
}

#CastlesOfBurgundy2 button.cobGood.active:focus-visible {
    outline-color: #25282b;
}
