/*
 * Citadelle Économie : page joueurs. Suit le thème « La Citadelle » : ses couleurs viennent de ses
 * variables (--primary-color, --secondary-color, --important-color, --interaction-color,
 * --text-color, --detail-color), réglées dans la configuration du thème.
 */

.ce-page {
    --ce-up: #81d99f;
    --ce-down: #f2757a;
}

.ce-intro {
    max-width: 760px;
    color: var(--text-color-darker, #d0d0d0);
}

.ce-muted {
    color: var(--text-color-double-darker, #b3b3b3);
}

.ce-up {
    color: var(--ce-up);
}

.ce-down {
    color: var(--ce-down);
}

.ce-currency {
    font-size: .75em;
    font-weight: 600;
    color: var(--interaction-color);
}

/* Bannières : bonus, fermetures */
.ce-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 5px;
    background: var(--secondary-color);
}

.ce-banner--bonus {
    border: 2px solid var(--important-color);
    background: linear-gradient(90deg, color-mix(in srgb, var(--important-color), transparent 80%), var(--secondary-color));
}

.ce-banner--closed {
    border: 2px solid var(--interaction-color);
}

/* Chiffres clés */
.ce-stat {
    position: relative;
    padding: 1.1rem 1.25rem;
}

/* The label never runs under the icon of the corner. */
.ce-stat .ce-stat-label {
    padding-right: 2rem;
}

.ce-stat-icon {
    position: absolute;
    top: .9rem;
    right: 1rem;
    font-size: 1.6rem;
    color: var(--detail-color);
    opacity: .8;
}

.ce-stat-label {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-color-double-darker, #b3b3b3);
}

.ce-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    margin-top: .2rem;
}

.ce-stat-hint {
    font-size: .85rem;
    color: var(--text-color-double-darker, #b3b3b3);
}

.ce-stat-trend {
    font-size: .85rem;
    font-weight: 700;
}

.ce-stat-trend.ce-up {
    color: var(--ce-up);
}

.ce-stat-trend.ce-down {
    color: var(--ce-down);
}

/* Offres du moment */
.ce-offer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 1rem .75rem;
    border: 1px solid var(--important-color) !important;
    color: var(--text-color);
    cursor: pointer;
}

.ce-offer-name {
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.ce-offer-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--important-color);
}

.ce-tag {
    display: inline-block;
    padding: .1rem .5rem;
    border-radius: 50rem;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--interaction-color), transparent 75%);
    color: var(--interaction-color);
}

.ce-tag--ok {
    background: color-mix(in srgb, var(--important-color), transparent 75%);
    color: var(--important-color);
}

/* Icônes d'objets (pixel art) */
.ce-item-icon,
.ce-item-icon-lg {
    image-rendering: pixelated;
    object-fit: contain;
    flex-shrink: 0;
}

.ce-item-icon {
    width: 28px;
    height: 28px;
}

.ce-item-icon-lg {
    width: 56px;
    height: 56px;
}

/* Explorateur des objets */
.ce-input,
.ce-input-icon {
    background: var(--primary-color) !important;
    color: var(--text-color) !important;
    border-color: var(--detail-color) !important;
}

.ce-input:focus {
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--interaction-color), transparent 70%) !important;
    border-color: var(--interaction-color) !important;
}

.ce-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    height: 100%;
    padding: .65rem .8rem;
    border: 1px solid transparent !important;
    color: var(--text-color);
    text-align: left;
    transition: border-color .15s ease-in, transform .15s ease-in;
}

.ce-item:hover,
.ce-item:focus-visible {
    border-color: var(--interaction-color) !important;
    transform: translateY(-2px);
    outline: none;
}

.ce-item-body {
    flex-grow: 1;
    min-width: 0;
}

.ce-item-name {
    display: block;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ce-item-meta {
    font-size: .8rem;
    color: var(--text-color-double-darker, #b3b3b3);
}

.ce-item-value {
    text-align: right;
    font-weight: 800;
    white-space: nowrap;
}

.ce-trend {
    display: block;
    font-size: .75rem;
    font-weight: 700;
}

/* Listes (ventes HDV, classement, mes ventes) */
.ce-list li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--detail-color), transparent 75%);
}

.ce-nowrap {
    white-space: nowrap;
}

.ce-list .ce-tag {
    white-space: nowrap;
    flex-shrink: 0;
}

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

.ce-rank {
    width: 1.8rem;
    text-align: center;
    font-weight: 800;
    color: var(--detail-color);
}

.ce-podium-1 .ce-rank { color: #f7c948; }
.ce-podium-2 .ce-rank { color: #c9d1d9; }
.ce-podium-3 .ce-rank { color: #d69a6a; }

/* Quêtes */
.ce-quest {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.1rem;
    border-top: 3px solid var(--interaction-color) !important;
}

.ce-reward {
    font-weight: 800;
    color: var(--important-color);
}

.ce-progress {
    height: 8px;
    border-radius: 50rem;
    background: color-mix(in srgb, var(--detail-color), transparent 70%);
    overflow: hidden;
    margin-bottom: .4rem;
}

.ce-progress > div {
    height: 100%;
    background: linear-gradient(90deg, var(--detail-color), var(--important-color));
}

/* Graphiques */
.ce-chart {
    position: relative;
    height: 280px;
}

.ce-modal {
    background: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--detail-color);
}

@media (max-width: 575.98px) {
    .ce-chart {
        height: 220px;
    }

    .ce-stat-value {
        font-size: 1.25rem;
    }

    .ce-stat-icon {
        font-size: 1.25rem;
        right: .75rem;
    }

    .ce-stat .ce-stat-label {
        padding-right: 1.5rem;
    }

    /* Long lines (name, state, price) go on two rows instead of squeezing every part. */
    .ce-list--wrap li {
        flex-wrap: wrap;
        row-gap: .15rem;
    }

    .ce-list--wrap li > :first-child {
        flex-basis: 100%;
    }
}

/* Récompenses quotidiennes : le cycle */
.ce-daily-day--next {
    outline: 2px solid var(--important-color);
}

.ce-daily-day--done {
    opacity: .6;
}

.ce-item-icon--sm {
    width: 18px;
    height: 18px;
}

/* Succès */
.ce-progress {
    height: .5rem;
    border-radius: 50rem;
    overflow: hidden;
    background: color-mix(in srgb, var(--text-color, #fff), transparent 88%);
}

.ce-progress > span {
    display: block;
    height: 100%;
    background: var(--important-color, #f7c472);
}

.ce-success-branch > summary {
    cursor: pointer;
    list-style: none;
    padding: .5rem .75rem;
    border-radius: .5rem;
    background: color-mix(in srgb, var(--text-color, #fff), transparent 94%);
}

.ce-success-branch > summary::-webkit-details-marker {
    display: none;
}

.ce-success-branch[open] > summary {
    background: color-mix(in srgb, var(--interaction-color, #3b7ddd), transparent 85%);
}

.ce-success {
    padding: .75rem;
    border-radius: .5rem;
    border: 1px solid color-mix(in srgb, var(--text-color, #fff), transparent 88%);
}

.ce-success--done {
    border-color: color-mix(in srgb, var(--important-color, #f7c472), transparent 40%);
}

.ce-success--locked .ce-item-icon {
    filter: grayscale(1);
    opacity: .6;
}

.ce-success-tier {
    margin-bottom: .35rem;
}

.ce-success-tier--done::marker {
    color: var(--ce-up);
}

.ce-success-rarity {
    font-size: .75rem;
}

[data-ce-success-hidden] {
    display: none !important;
}
