/* /castle-siege (owner, 2026-11-01): the siege timeline with its clock, the guild card, the treasury as
   the prize, the land tabs, the board of guilds and the chronicle. Tabs turn into two rows and the
   timeline drops its dates on a phone. */

/* Timeline */
.siege-time {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
}

.siege-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.siege-step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    text-align: center;
    color: #8d98ae;
}

/* The line to the previous step. */
.siege-step + .siege-step::before {
    content: "";
    position: absolute;
    top: 8px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, .12);
}

.siege-step.is-done + .siege-step::before {
    background: #f0c674;
}

.siege-step__dot {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: #111011;
}

.siege-step strong {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.siege-step__when {
    font-size: 11.5px;
}

.siege-step.is-done {
    color: #c9d2ea;
}

.siege-step.is-done .siege-step__dot {
    border-color: #f0c674;
    background: #f0c674;
}

.siege-step.is-now {
    color: #fff;
}

.siege-step.is-now strong {
    color: #ffcc19;
}

.siege-step.is-now .siege-step__dot {
    border-color: #ffcc19;
    background: #ffcc19;
    animation: siege-pulse 1.8s ease-out infinite;
}

.siege-time--battle .siege-step.is-now .siege-step__dot {
    border-color: #ff5a3c;
    background: #ff5a3c;
}

.siege-time--battle {
    border-color: rgba(255, 90, 60, .55);
    box-shadow: 0 0 26px rgba(255, 90, 60, .16);
}

@keyframes siege-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 204, 25, .55); }
    100% { box-shadow: 0 0 0 12px rgba(255, 204, 25, 0); }
}

/* Clock */
.siege-clock {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
}

.siege-clock__lead {
    color: #c9d2ea;
    font-size: 13px;
    text-align: center;
}

.siege-clock__tiles {
    display: flex;
    gap: 8px;
}

.siege-clock__tiles div {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-width: 58px;
    padding: 8px 6px;
    border: 1px solid rgba(240, 198, 116, .2);
    border-radius: 8px;
    background: rgba(0, 0, 0, .35);
}

.siege-clock__tiles strong {
    color: #fff;
    font-size: 24px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.siege-clock__tiles span {
    color: #9fb2c8;
    font-size: 11px;
}

.siege-clock__over {
    margin: 0;
    text-align: center;
}

/* Withdrawing stays out of the way until it is wanted. */
.siege-giveup {
    margin-top: 10px;
}

.siege-giveup summary {
    color: #9fb2c8;
    font-size: 13px;
    cursor: pointer;
}

.siege-giveup[open] summary {
    margin-bottom: 8px;
}

/* The prize */
.siege-prize {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.siege-prize__main {
    flex: 1 1 240px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 14px 18px;
    border: 1px solid rgba(240, 198, 116, .35);
    border-radius: 10px;
    background:
        radial-gradient(120% 120% at 0% 50%, rgba(255, 196, 64, .16), rgba(255, 196, 64, 0) 60%),
        rgba(0, 0, 0, .35);
}

.siege-prize__main img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex: none;
}

.siege-prize__main div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.siege-prize__main strong {
    color: #ffcc19;
    font-size: clamp(24px, 3.2vw, 34px);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.siege-prize__main span {
    color: #c9d2ea;
    font-size: 13px;
}

.siege-prize .siege-treasury__item {
    flex: 0 1 120px;
}

.siege-prize__lead {
    margin: 14px 0 10px;
    color: #e7ecf8;
    line-height: 1.5;
}

.siege-flows {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.siege-flows li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #c9d2ea;
    font-size: 13px;
    line-height: 1.35;
}

.siege-flows img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex: none;
}

/* Land tabs */
.siege-land-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.siege-land-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.siege-land-tab {
    position: relative;
    display: block;
    height: 130px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s;
}

.siege-land-tab img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.55) saturate(.7);
    transition: filter .2s, transform .3s;
}

.siege-land-tab span {
    position: absolute;
    left: 14px;
    bottom: 10px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .9);
}

.siege-land-tab:hover img {
    filter: brightness(.8);
    transform: scale(1.03);
}

#siege-land-stadium:checked ~ .siege-land-tabs .siege-land-tab--stadium,
#siege-land-trials:checked ~ .siege-land-tabs .siege-land-tab--trials {
    border-color: #f0c674;
}

#siege-land-stadium:checked ~ .siege-land-tabs .siege-land-tab--stadium img,
#siege-land-trials:checked ~ .siege-land-tabs .siege-land-tab--trials img {
    filter: none;
}

#siege-land-stadium:focus-visible ~ .siege-land-tabs .siege-land-tab--stadium,
#siege-land-trials:focus-visible ~ .siege-land-tabs .siege-land-tab--trials {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.siege-lands .siege-land {
    display: none;
}

#siege-land-stadium:checked ~ .siege-land--stadium,
#siege-land-trials:checked ~ .siege-land--trials {
    display: block;
}

.siege-land__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.siege-land h3 {
    margin: 0 0 6px;
    color: #f0c674;
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.siege-land__facts p {
    margin: 0;
    color: #c9d2ea;
    font-size: 14px;
    line-height: 1.5;
}

.siege-land__sub {
    margin-top: 18px !important;
}

.siege-land__monsters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}

.siege-land__monsters li {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 10px 6px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(0, 0, 0, .3);
    text-align: center;
    transition: border-color .15s, transform .15s;
}

.siege-land__monsters li:hover {
    border-color: rgba(240, 198, 116, .45);
    transform: translateY(-2px);
}

.siege-land__monsters img {
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.siege-land__monsters span {
    color: #e7ecf8;
    font-size: 12px;
    line-height: 1.25;
}

.siege-land__boss {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
    padding: 14px 18px;
    border: 1px solid rgba(240, 198, 116, .35);
    border-radius: 10px;
    background:
        radial-gradient(90% 140% at 0% 50%, rgba(255, 120, 40, .16), rgba(255, 120, 40, 0) 65%),
        rgba(0, 0, 0, .35);
}

.siege-land__boss > img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    flex: none;
}

.siege-land__boss strong {
    display: block;
    margin: 2px 0 6px;
    color: #fff;
    font-size: 19px;
}

.siege-land__boss p {
    margin: 0 0 8px;
    color: #c9d2ea;
    font-size: 14px;
    line-height: 1.5;
}

.siege-land__loot {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.siege-land__loot li {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e7ecf8;
    font-size: 12.5px;
}

.siege-land__loot img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* The guilds */
.siege-board {
    display: grid;
    gap: 12px;
}

.siege-board .siege-section-head {
    margin: 0;
}

.siege-board__sub {
    margin: 4px 0 0;
    color: #f0c674;
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.siege-defender {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(240, 198, 116, .4);
    border-radius: 10px;
    background: rgba(0, 0, 0, .35);
}

.siege-defender svg {
    width: 22px;
    height: 22px;
    fill: #ffcc19;
    flex: none;
}

.siege-defender span {
    color: #9fb2c8;
    font-size: 13px;
}

.siege-defender strong {
    color: #fff;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.siege-call {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border: 1px dashed rgba(240, 198, 116, .4);
    border-radius: 10px;
    background: rgba(0, 0, 0, .3);
}

.siege-call p {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.siege-rivals {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.siege-rival {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    background: rgba(0, 0, 0, .35);
}

.siege-rival--top {
    border-color: rgba(240, 198, 116, .35);
}

.siege-rival__body {
    display: grid;
    flex: 1 1 auto;
    gap: 3px;
    min-width: 0;
}

.siege-rival__meta {
    color: #9fb2c8;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.siege-rival__bar {
    display: block;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, .1);
    overflow: hidden;
}

.siege-rival__bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #c48b31, #ffd76a);
}

/* The chronicle */
.siege-chronicle {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.siege-chronicle__row {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 18px;
    padding: 0 0 18px;
}

.siege-chronicle__row time {
    color: #9fb2c8;
    font-size: 13px;
    text-align: right;
}

.siege-chronicle__row > div {
    position: relative;
    padding-left: 18px;
    border-left: 2px solid rgba(240, 198, 116, .3);
}

.siege-chronicle__row > div::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f0c674;
}

.siege-chronicle__row > div > span {
    display: block;
    color: #c9d2ea;
    font-size: 13px;
}

.siege-chronicle__won {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.siege-chronicle__won li {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(240, 198, 116, .14);
    color: #ffcc19;
    font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
    .siege-step.is-now .siege-step__dot {
        animation: none;
    }

    .siege-land-tab img,
    .siege-land__monsters li {
        transition: none;
    }
}

@media (max-width: 860px) {
    .siege-time {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .siege-step__when {
        display: none;
    }

    .siege-step strong {
        font-size: 12px;
    }

    .siege-clock__tiles div {
        min-width: 54px;
    }

    .siege-flows,
    .siege-land__facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .siege-land-tab {
        height: 92px;
    }

    .siege-land-tab span {
        left: 10px;
        font-size: 15px;
    }

    .siege-land__boss {
        flex-direction: column;
        text-align: center;
    }

    .siege-land__loot {
        justify-content: center;
    }

    .siege-chronicle__row {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }

    .siege-chronicle__row time {
        text-align: left;
    }
}
