/*
 * Tableau de bord — scène 3:2 calée dans la fenêtre (contain).
 * Jamais d’étirement : largeur et hauteur bougent ensemble.
 * Overlay en % / cqi dans la même boîte.
 */

.page-dashboard .site-shell {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.page-dashboard .site-content {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.page-dashboard .site-main {
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.page-dashboard .site-footer {
    flex-shrink: 0;
    padding-left: var(--space-5);
    padding-right: var(--space-5);
}

.page-dashboard .dashboard {
    flex: 1;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.page-dashboard .dashboard [hidden] {
    display: none !important;
}

.page-dashboard .auth-login-required-msg {
    margin: var(--space-5);
}

.page-dashboard #dashboard-content {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    container-type: size;
}

.dash-stage-glow {
    position: absolute;
    inset: -12%;
    width: 124%;
    height: 124%;
    object-fit: cover;
    filter: blur(36px) brightness(0.28) saturate(0.85);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.dash-sanctuary {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: min(100cqw, calc(100cqh * 3 / 2));
    height: min(100cqh, calc(100cqw * 2 / 3));
    aspect-ratio: 3 / 2;
}

.dash-fantasy-ui .dash-kpi__label,
.dash-fantasy-ui .dash-kpi__value,
.dash-fantasy-ui .dash-list li,
.dash-fantasy-ui .dash-mana-n,
.dash-fantasy-ui .dash-panel h3 {
    -webkit-font-smoothing: antialiased;
    text-shadow:
        0 0 1px #000,
        0 1px 0 #000,
        0 -1px 0 #000,
        1px 0 0 #000,
        -1px 0 0 #000,
        0 2px 8px rgba(0, 0, 0, 0.95),
        0 0 14px rgba(0, 0, 0, 0.75);
}

.page-dashboard .dash-mock.is-fantasy {
    position: relative;
    container-type: inline-size;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
    background: var(--showcase-bg);
}

.dash-fantasy-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    user-select: none;
}

.dash-fantasy-vignette {
    display: none;
}

.dash-fantasy-ui {
    position: absolute;
    inset: 0;
    z-index: 2;
    color: var(--showcase-ink);
    pointer-events: none;
}

.dash-fantasy-ui a {
    pointer-events: auto;
}

.dash-fantasy-head {
    position: absolute;
    left: 50%;
    top: 7.7%;
    transform: translate(-50%, -50%);
    width: 4.2%;
    margin: 0;
    text-align: center;
    container-type: inline-size;
}

.dash-fantasy-head .dash-mock__motto {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 14cqi;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff8e0;
    font-weight: 700;
    line-height: 1.05;
    white-space: nowrap;
}

/* ── KPI posés sur l'illustration ── */

.dash-fantasy-kpis {
    position: absolute;
    inset: 0;
}

.dash-fantasy-kpis .dash-kpi {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    transform: translate(-50%, -50%);
    overflow: visible;
    white-space: nowrap;
}

.dash-fantasy-kpis .dash-kpi--slot-u {
    left: 49.9%;
    top: 38.4%;
    width: 6.8%;
    height: 8.3%;
}

.dash-fantasy-kpis .dash-kpi--slot-b {
    left: 56.7%;
    top: 38.7%;
    width: 4.6%;
    height: 8.7%;
}

.dash-fantasy-kpis .dash-kpi--slot-core {
    left: 50.2%;
    top: 28.8%;
    width: 7.7%;
    height: 7.6%;
}

.dash-fantasy-kpis .dash-kpi--slot-r {
    left: 43.3%;
    top: 38.7%;
    width: 6.2%;
    height: 8.3%;
}

.dash-fantasy-kpis .dash-kpi--slot-g {
    left: 50%;
    top: 48.5%;
    width: 6.6%;
    height: 7.1%;
}

.dash-fantasy-kpis .dash-kpi__label {
    font-family: var(--font-heading);
    font-size: 1.05cqi;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--showcase-ink-warm);
    margin: 0 0 0.12cqi;
    font-weight: 700;
}

.dash-fantasy-kpis .dash-kpi__value {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.dash-fantasy-kpis .dash-kpi--slot-u .dash-kpi__value {
    font-size: 1.5cqi;
}

.dash-fantasy-kpis .dash-kpi--slot-b .dash-kpi__value {
    font-size: 1.15cqi;
    color: #fff4c8;
}

.dash-fantasy-kpis .dash-kpi--slot-core .dash-kpi__value {
    font-size: 2cqi;
}

.dash-fantasy-kpis .dash-kpi--slot-r .dash-kpi__value,
.dash-fantasy-kpis .dash-kpi--slot-g .dash-kpi__value {
    font-size: 1.35cqi;
}

/* ── Baies de données ── */

.dash-fantasy-panels {
    position: absolute;
    inset: 0;
}

.dash-fantasy-panels .dash-panel {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    width: 12.5%;
    height: 22%;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: hidden;
}

.dash-fantasy-panels .dash-panel--bay-1 {
    left: 25.3%;
    top: 60.3%;
}

.dash-fantasy-panels .dash-panel--bay-2 {
    left: 41.6%;
    top: 60.3%;
}

.dash-fantasy-panels .dash-panel--bay-3 {
    left: 58.4%;
    top: 60.9%;
}

.dash-fantasy-panels .dash-panel--bay-4 {
    left: 74.6%;
    top: 61.1%;
}

.dash-fantasy-panels .dash-panel h3 {
    flex-shrink: 0;
    margin: 0 0 0.35cqi;
    padding: 0;
    font-family: var(--font-heading);
    font-size: 1cqi;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--showcase-ink-gold);
    text-align: center;
}

.dash-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dash-fantasy-panels .dash-list,
.dash-fantasy-panels .dash-mana-bars {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.dash-fantasy-panels .dash-list li {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.2cqi 0.4cqi;
    padding: 0.18cqi 0;
    font-family: var(--font-body);
    font-size: 0.95cqi;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255, 220, 140, 0.14);
    line-height: 1.25;
}

.dash-fantasy-panels .dash-list li:last-child {
    border-bottom: none;
}

.dash-fantasy-panels .dash-list__main {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-fantasy-panels .dash-list__main strong {
    color: #ffe566;
}

.dash-fantasy-panels .dash-list__meta {
    flex-shrink: 0;
    color: #fff4d0;
    font-weight: 700;
}

.dash-fantasy-panels .dash-list--binders li {
    align-items: center;
}

.dash-binder-dot {
    flex-shrink: 0;
    width: 0.55cqi;
    height: 0.55cqi;
    border-radius: 50%;
    background: var(--binder-color, var(--rail-violet));
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
}

.dash-mana-bars {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.18cqi;
}

.dash-fantasy-panels .dash-mana-row {
    display: grid;
    grid-template-columns: 1.15cqi 1fr 1.5cqi;
    align-items: center;
    gap: 0.35cqi;
}

.dash-fantasy-panels .dash-mana-pip {
    display: grid;
    place-items: center;
    width: 1.15cqi;
    height: 1.15cqi;
    font-family: var(--font-heading);
    font-size: 0.8cqi;
    font-weight: 700;
    border-radius: 50%;
    background: var(--mana);
    color: #12100a;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
}

.dash-fantasy-panels .dash-mana-track {
    height: 0.45cqi;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.75);
    overflow: hidden;
}

.dash-mana-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--mana);
}

.dash-fantasy-panels .dash-mana-n {
    font-size: 0.9cqi;
    font-weight: 700;
    text-align: right;
}

/* ── Raccourcis peints dans l'illustration ── */

.dash-fantasy-actions {
    position: absolute;
    left: 20.5%;
    right: 19.5%;
    top: 84.3%;
    height: 7%;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.4cqi 0.55cqi;
    z-index: 3;
}

.dash-fantasy-actions .dash-action {
    --cut: 0.45cqi;
    --cut-r: 0.6cqi;
    padding: 0.4cqi 0.95cqi;
    font-family: var(--font-heading);
    font-size: 0.9cqi;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: #c8caf0;
    border: 0;
    border-radius: 0;
    background-color: #1a1930;
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, transparent 46%),
        radial-gradient(120% 80% at 50% 120%, rgba(180, 190, 255, 0.32), transparent 58%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -3px 0 rgba(180, 190, 255, 0.75),
        0 4px 12px rgba(0, 0, 0, 0.55);
    clip-path: polygon(
        var(--cut) 0,
        calc(100% - var(--cut-r)) 0,
        100% var(--cut-r),
        100% 100%,
        0 100%,
        0 var(--cut)
    );
    transition: transform var(--t-fast) ease, filter var(--t-fast) ease, background var(--t-fast) ease;
}

.dash-fantasy-actions .dash-action:hover {
    transform: translateY(-1px);
    color: #f4f5ff;
    text-decoration: none;
    background-color: #222140;
}

.dash-fantasy-actions .dash-action--primary {
    color: #0c0b18;
    background-color: #e8c84a;
    background-image:
        linear-gradient(180deg, rgba(255, 246, 196, 0.55) 0%, transparent 42%),
        radial-gradient(120% 80% at 50% 120%, rgba(255, 224, 138, 0.35), transparent 58%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -3px 0 #8a6a12,
        0 0 14px rgba(232, 200, 74, 0.28);
}

.dash-list__empty {
    font-style: italic;
    opacity: 0.8;
    justify-content: center;
}

/* ── Téléphone seulement : l’illustration devient une image d’en-tête ── */

@media (max-width: 900px) {
    .page-dashboard .site-shell,
    .page-dashboard .site-content {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .page-dashboard .site-main {
        display: block;
        overflow: visible;
        padding: var(--space-5) var(--space-4) var(--space-6);
    }

    .page-dashboard .dashboard,
    .page-dashboard #dashboard-content {
        display: block;
        height: auto;
        flex: none;
        overflow: visible;
        container-type: normal;
    }

    .dash-stage-glow {
        display: none;
    }

    .page-dashboard .site-footer {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .dash-sanctuary {
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        overflow: visible;
        flex: none;
    }

    .page-dashboard .dash-mock.is-fantasy {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        max-height: none;
        aspect-ratio: auto;
        display: flex;
        flex-direction: column;
        transform: none;
    }

    .dash-fantasy-frame {
        position: relative;
        aspect-ratio: 3 / 2;
        height: auto;
        object-fit: cover;
        object-position: center top;
    }

    .dash-fantasy-ui {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        padding: var(--space-4);
        background: var(--showcase-panel);
        pointer-events: auto;
    }

    .dash-fantasy-head,
    .dash-fantasy-kpis,
    .dash-fantasy-panels,
    .dash-fantasy-actions,
    .dash-fantasy-panels .dash-panel,
    .dash-fantasy-kpis .dash-kpi {
        position: static;
        transform: none;
        width: auto;
        height: auto;
        left: auto;
        top: auto;
    }

    .dash-fantasy-head .dash-mock__motto {
        font-size: var(--fs-lg);
    }

    .dash-fantasy-kpis {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-2);
    }

    .dash-fantasy-kpis .dash-kpi {
        padding: var(--space-3);
        background: rgba(20, 14, 32, 0.9);
        border-radius: var(--radius);
        border: 1px solid var(--border);
        overflow: visible;
        white-space: nowrap;
    }

    .dash-fantasy-kpis .dash-kpi__label {
        font-size: var(--fs-2xs);
    }

    .dash-fantasy-kpis .dash-kpi__value,
    .dash-fantasy-kpis .dash-kpi--slot-u .dash-kpi__value,
    .dash-fantasy-kpis .dash-kpi--slot-b .dash-kpi__value,
    .dash-fantasy-kpis .dash-kpi--slot-core .dash-kpi__value,
    .dash-fantasy-kpis .dash-kpi--slot-r .dash-kpi__value,
    .dash-fantasy-kpis .dash-kpi--slot-g .dash-kpi__value {
        font-size: var(--fs-lg);
    }

    .dash-fantasy-panels {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    .dash-fantasy-panels .dash-panel {
        padding: var(--space-4);
        border: 1px solid var(--border);
        background: rgba(12, 8, 20, 0.9);
        border-radius: var(--radius);
        overflow: visible;
    }

    .dash-fantasy-panels .dash-list,
    .dash-fantasy-panels .dash-mana-bars {
        overflow: visible;
    }

    .dash-fantasy-panels .dash-panel h3 {
        font-size: var(--fs-sm);
        margin: 0 0 var(--space-2);
    }

    .dash-fantasy-panels .dash-list li {
        font-size: var(--fs-sm);
        gap: 0.35rem;
        padding: 0.2rem 0;
    }

    .dash-fantasy-panels .dash-mana-row {
        grid-template-columns: 1.35rem 1fr 1.75rem;
        gap: 0.35rem;
    }

    .dash-fantasy-panels .dash-mana-pip {
        width: 1.35rem;
        height: 1.35rem;
        font-size: var(--fs-2xs);
    }

    .dash-fantasy-panels .dash-mana-track {
        height: 0.38rem;
    }

    .dash-fantasy-panels .dash-mana-n {
        font-size: var(--fs-xs);
    }

    .dash-binder-dot {
        width: 0.45rem;
        height: 0.45rem;
    }

    .dash-fantasy-actions {
        flex-wrap: wrap;
        height: auto;
        gap: 0.4rem;
    }

    .dash-fantasy-actions .dash-action {
        --cut: 6px;
        --cut-r: 8px;
        font-size: var(--fs-xs);
        padding: 0.45rem 0.9rem;
    }
}

@media (max-width: 640px) {
    .page-dashboard .site-footer {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
    .dash-fantasy-kpis {
        grid-template-columns: 1fr 1fr;
    }

    .dash-fantasy-panels {
        grid-template-columns: 1fr;
    }
}
