/* =====================================================================
   Project Horizon — tier.css (Foundation / Apollo Archives)
   Avis du public — tier list anonyme (vue verdict + vue vote).
   ===================================================================== */

.ph-tier .ph-main { padding: 0; }

/* ---------- Bandeau ticker événement -------------------------------- */

.tier-marquee {
    position: relative;
    overflow: hidden;
    background: rgba(232, 163, 61, 0.05);
    border-top: 1px solid rgba(232, 163, 61, 0.30);
    border-bottom: 1px solid rgba(232, 163, 61, 0.30);
    padding: 11px 0;
    z-index: 3;
}
.tier-marquee::before,
.tier-marquee::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 64px;
    pointer-events: none;
    z-index: 1;
}
.tier-marquee::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg-warm) 0%, transparent 100%);
}
.tier-marquee::after {
    right: 0;
    background: linear-gradient(90deg, transparent 0%, var(--bg-warm) 100%);
}
.tier-marquee__track {
    display: flex;
    width: max-content;
    will-change: transform;
    animation: tier-marquee-scroll 36s linear infinite;
}
.tier-marquee__line {
    display: inline-block;
    padding-right: 64px;
    font-family: var(--font-tech);
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--c-amber);
    white-space: nowrap;
}
@keyframes tier-marquee-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .tier-marquee__track { animation: none; }
}

/* Honeypot — caché en CSS, indétectable visuellement */
.tier-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    opacity: 0; pointer-events: none;
}

/* ---------- Hero compact ------------------------------------------- */

.tier {
    position: relative;
    padding: 56px 32px 96px;
    max-width: 1280px; margin: 0 auto;
}
.tier::before,
.tier::after {
    content: '';
    position: absolute;
    width: 24px; height: 24px;
    border: 1px solid var(--c-amber);
    opacity: 0.55;
}
.tier::before {
    top: 32px; left: 32px;
    border-right: 0; border-bottom: 0;
}
.tier::after {
    bottom: 32px; right: 32px;
    border-left: 0; border-top: 0;
}

.tier__head { margin-bottom: 40px; max-width: 760px; }

.tier__stamp {
    display: inline-flex; align-items: center; gap: 12px;
    margin: 0 0 24px;
    font-family: var(--font-tech);
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--c-amber);
}
.tier__stamp::before {
    content: ''; width: 8px; height: 8px;
    background: var(--c-amber); border-radius: 50%;
    box-shadow: 0 0 10px rgba(232, 163, 61, 0.6);
}
.tier__title {
    margin: 0;
    font-family: var(--font-editorial);
    font-weight: 400;
    font-size: clamp(40px, 5.5vw, 64px);
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--c-bone);
}
.tier__rule {
    width: 80px; height: 1px;
    background: var(--c-amber);
    margin: 24px 0 20px;
    opacity: 0.7;
}
.tier__lead {
    font-family: var(--font-editorial);
    font-style: italic; font-weight: 400;
    font-size: clamp(17px, 1.6vw, 19px);
    line-height: 1.55;
    color: var(--c-bone-soft);
    margin: 0 0 16px;
}
.tier__caption {
    font-family: var(--font-tech);
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--c-bone-dim);
    margin: 0;
    display: flex; flex-wrap: wrap; gap: 12px;
    align-items: center;
}
.tier__caption-count { color: var(--c-bone); }
.tier__caption-sep   { opacity: 0.4; }

/* ---------- Compteur live ------------------------------------------ */

.tier-live {
    display: inline-flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 18px;
    padding: 8px 16px 9px;
    background: rgba(232, 163, 61, 0.06);
    border: 1px solid rgba(232, 163, 61, 0.35);
    border-left: 2px solid var(--c-amber);
    position: relative;
}
.tier-live__dot {
    width: 8px; height: 8px;
    background: var(--c-amber);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(232, 163, 61, 0.65);
    align-self: center;
    animation: tier-live-pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    flex-shrink: 0;
}
@keyframes tier-live-pulse {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(0.85); }
}
@media (prefers-reduced-motion: reduce) {
    .tier-live__dot { animation: none; }
}

.tier-live__count {
    font-family: var(--font-editorial);
    font-style: italic;
    font-weight: 500;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--c-amber);
    /* Petit "tick" visuel quand le nombre change (anim ajoutée en JS) */
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tier-live__count.is-bump {
    transform: scale(1.18);
}
.tier-live__label {
    font-family: var(--font-tech);
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--c-bone-soft);
    line-height: 1;
}

/* ---------- Banner (déjà voté / merci) ----------------------------- */

.tier-banner {
    margin: 0 0 32px;
    padding: 14px 20px;
    display: flex; align-items: center; gap: 14px;
    font-family: var(--font-tech);
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.10em; text-transform: uppercase;
    border: 1px solid;
}
.tier-banner--ok {
    color: var(--c-amber);
    border-color: rgba(232, 163, 61, 0.40);
    background: rgba(232, 163, 61, 0.06);
}
.tier-banner--info {
    color: var(--c-bone-soft);
    border-color: rgba(244, 239, 230, 0.15);
    background: var(--bg-warm-2);
}
.tier-banner__icon {
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-family: var(--font-editorial);
    font-style: italic;
    font-size: 14px;
    flex-shrink: 0;
}

/* ---------- Tier rows : grille commune verdict + vote -------------- */

.tier-rows {
    display: grid;
    gap: 1px;
    background: rgba(244, 239, 230, 0.10);
    border: 1px solid rgba(244, 239, 230, 0.10);
}

.tier-row {
    display: grid;
    grid-template-columns: 88px 1fr;
    background: var(--bg-warm);
    min-height: 96px;
    transition: background var(--t-base);
}

/* Label gauche — chiffre romain italique éditorial */
.tier-row__label {
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 12px 8px;
    font-family: var(--font-editorial);
    font-style: italic; font-weight: 400;
    font-size: 36px;
    line-height: 1;
    letter-spacing: -0.02em;
    text-align: center;
    border-right: 1px solid rgba(244, 239, 230, 0.10);
    transition: background var(--t-base);
}
.tier-row__label-sub {
    display: block;
    font-family: var(--font-tech);
    font-style: normal; font-weight: 500;
    font-size: 9px;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--c-bone-dim);
    margin-top: 4px;
}

/* Coloration des labels par tier — palette Foundation */
.tier-row--s_plus  .tier-row__label { background: rgba(245, 158, 11, 0.20);  color: #fbbf24; }
.tier-row--s       .tier-row__label { background: rgba(232, 163, 61, 0.18);  color: var(--c-amber); }
.tier-row--a       .tier-row__label { background: rgba(214, 146, 74, 0.14);  color: var(--c-amber-soft); }
.tier-row--b       .tier-row__label { background: rgba(214, 207, 193, 0.10); color: var(--c-bone-soft); }
.tier-row--c       .tier-row__label { background: rgba(90, 168, 176, 0.14);  color: var(--c-blueprint); }
.tier-row--d       .tier-row__label { background: rgba(154, 148, 133, 0.10); color: var(--c-bone-dim); }
.tier-row--e       .tier-row__label { background: rgba(19, 25, 41, 0.40);    color: var(--c-bone-dim); }
.tier-row--unknown .tier-row__label { background: rgba(14, 19, 32, 0.60);    color: var(--c-bone-dim); font-style: normal; font-size: 22px; }

/* Drop area droite */
.tier-row__drop {
    display: flex; flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    min-height: 96px;
    transition: background var(--t-fast);
}

/* État drag-over */
.tier-row[data-drop-target].is-drag-over .tier-row__drop {
    background: rgba(232, 163, 61, 0.08);
    box-shadow: inset 0 0 0 1px var(--c-amber);
}

/* ---------- Tier card (vignette projet carrée) --------------------- */

.tier-card {
    position: relative;
    width: 76px; aspect-ratio: 1;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bg-warm-3);
    border: 1px solid rgba(244, 239, 230, 0.10);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color var(--t-fast), transform var(--t-fast),
                box-shadow var(--t-fast);
}
.tier-card:hover {
    border-color: rgba(232, 163, 61, 0.55);
    transform: translateY(-1px);
}
.tier-card__img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none; /* le drag opère sur la carte */
}
.tier-card__fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-editorial);
    font-style: italic; font-weight: 400;
    font-size: 24px;
    color: var(--c-amber);
    text-transform: uppercase;
    background: var(--bg-warm-3);
}
/* Nom du projet — overlay bas, lisible mais discret. Toujours visible :
   l'image reste lisible, l'info équipe est dans l'inspecteur en haut. */
.tier-card__name {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 6px 6px 5px;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 14, 26, 0.92) 65%);
    color: var(--c-bone);
    font-family: var(--font-tech);
    font-size: 9px; font-weight: 500;
    letter-spacing: 0.04em;
    text-align: center;
    line-height: 1.15;
    text-transform: uppercase;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: none;
    z-index: 1;
}

/* État inspecté : la card est mise en avant quand l'inspecteur la cible */
.tier-card.is-inspected {
    border-color: var(--c-amber);
    box-shadow: 0 0 0 1px var(--c-amber), 0 0 16px rgba(232, 163, 61, 0.30);
    transform: translateY(-2px);
    z-index: 3;
}

/* ---------- Inspecteur (top bar, mise à jour au hover / drag) ----- */

.tier-inspector {
    margin: 0 0 12px;
    padding: 12px 16px;
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-warm-2);
    border: 1px solid rgba(244, 239, 230, 0.10);
    border-left: 2px solid rgba(232, 163, 61, 0.30);
    min-height: 64px;
    transition: border-left-color var(--t-fast), background var(--t-fast);
    position: sticky;
    top: 64px;            /* sous le header sticky */
    z-index: 5;
    backdrop-filter: blur(8px);
}
.tier-inspector[data-state="active"] {
    border-left-color: var(--c-amber);
    background: var(--bg-warm-3);
}
.tier-inspector[data-state="dragging"] {
    border-left-color: var(--c-amber);
    background: var(--bg-warm-3);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.40);
}

.tier-inspector__thumb {
    flex-shrink: 0;
    width: 48px; height: 48px;
    background: var(--bg-warm-3);
    border: 1px solid rgba(244, 239, 230, 0.10);
    overflow: hidden;
}
.tier-inspector__thumb-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity var(--t-fast);
}
/* En mode "empty" la thumb par défaut est un peu désaturée pour signaler
   qu'aucun projet n'est cible */
.tier-inspector[data-state="empty"] .tier-inspector__thumb-img {
    opacity: 0.55;
    filter: grayscale(0.6);
}

.tier-inspector__body {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.tier-inspector__name {
    font-family: var(--font-editorial);
    font-style: italic;
    font-weight: 500;
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--c-bone);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tier-inspector[data-state="empty"] .tier-inspector__name {
    color: var(--c-bone-dim);
    font-style: normal;
    font-family: var(--font-tech);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.tier-inspector__team {
    font-family: var(--font-body);
    font-size: 13px; line-height: 1.4;
    color: var(--c-bone-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tier-inspector__team .tm-name {
    font-weight: 600;
}
.tier-inspector__team .tm-name + .tm-name {
    margin-left: 2px;
}

/* Variante drag : indique que c'est manipulable */
.tier-card--draggable {
    cursor: grab;
}
.tier-card--draggable:active { cursor: grabbing; }
.tier-card--draggable.is-dragging {
    opacity: 0.40;
    transform: scale(0.95);
}
.tier-card--draggable:focus-visible {
    outline: 2px solid var(--c-amber);
    outline-offset: 2px;
}

/* Variante readonly (vue verdict) — pas de cursor grab, juste link */
.tier-card--readonly {
    cursor: pointer;
}

/* ---------- CTA "Faire mon classement" ----------------------------- */

.tier-cta {
    margin-top: 40px;
    text-align: center;
}
.tier-cta__btn {
    display: inline-flex; align-items: center;
    gap: 14px;
    padding: 16px 32px;
    background: transparent;
    color: var(--c-amber);
    border: 1px solid var(--c-amber);
    font-family: var(--font-tech);
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.22em; text-transform: uppercase;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast),
                box-shadow var(--t-fast);
}
.tier-cta__btn:hover {
    background: var(--c-amber);
    color: var(--bg-warm);
    box-shadow: 0 0 24px rgba(232, 163, 61, 0.40);
}
.tier-cta__note {
    font-family: var(--font-tech);
    color: var(--c-bone-dim);
    font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
    margin: 0;
}

/* ---------- Empty state -------------------------------------------- */

.tier-empty {
    padding: 32px 24px;
    margin: 0 0 24px;
    text-align: center;
    background: var(--bg-warm-2);
    border: 1px dashed rgba(244, 239, 230, 0.15);
    font-family: var(--font-editorial);
    font-style: italic;
    font-size: 17px;
    color: var(--c-bone-soft);
}

/* ---------- Vue vote — instructions + actions ---------------------- */

.tier-view--vote {
    margin-top: 32px;
}
.tier-view--vote .tier-view__head {
    margin-bottom: 24px;
}
.tier-view--vote .tier-view__title {
    margin: 0 0 12px;
    font-family: var(--font-editorial);
    font-weight: 400;
    font-size: clamp(28px, 3.5vw, 40px);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--c-bone);
}
.tier-view--vote .tier-view__intro {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--c-bone-soft);
    max-width: 720px;
}

.tier-actions {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(244, 239, 230, 0.08);
}
.tier-actions__back,
.tier-actions__submit {
    display: inline-flex; align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(244, 239, 230, 0.20);
    font-family: var(--font-tech);
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.20em; text-transform: uppercase;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast),
                border-color var(--t-fast);
}
.tier-actions__back {
    color: var(--c-bone-soft);
}
.tier-actions__back:hover {
    background: rgba(244, 239, 230, 0.04);
    border-color: var(--c-bone-soft);
    color: var(--c-bone);
}
.tier-actions__submit {
    color: var(--c-amber);
    border-color: var(--c-amber);
}
.tier-actions__submit:hover {
    background: var(--c-amber);
    color: var(--bg-warm);
    box-shadow: 0 0 24px rgba(232, 163, 61, 0.40);
}
.tier-actions__submit:disabled {
    opacity: 0.40;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- Modal picker (mobile tap-to-pick) ---------------------- */

.tier-picker {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    opacity: 0; pointer-events: none;
    transition: opacity var(--t-base);
}
.tier-picker[hidden] { display: none; }
.tier-picker.is-open { opacity: 1; pointer-events: auto; }

.tier-picker__backdrop {
    position: absolute; inset: 0;
    background: rgba(10, 14, 26, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.tier-picker__card {
    position: relative;
    width: 100%; max-width: 420px;
    background: var(--bg-warm-2);
    border: 1px solid rgba(232, 163, 61, 0.30);
    padding: 24px 24px 20px;
    transform: translateY(20px) scale(0.96);
    transition: transform var(--t-base);
}
.tier-picker.is-open .tier-picker__card {
    transform: translateY(0) scale(1);
}
.tier-picker__head {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(244, 239, 230, 0.08);
}
.tier-picker__title {
    margin: 0 0 6px;
    font-family: var(--font-tech);
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.20em; text-transform: uppercase;
    color: var(--c-amber);
}
.tier-picker__project {
    margin: 0;
    font-family: var(--font-editorial);
    font-style: italic;
    font-size: 22px; font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--c-bone);
}

.tier-picker__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(244, 239, 230, 0.10);
    border: 1px solid rgba(244, 239, 230, 0.10);
    margin-bottom: 18px;
}
.tier-picker__btn {
    background: var(--bg-warm);
    border: 0;
    padding: 18px 8px;
    font-family: var(--font-editorial);
    font-style: italic;
    font-weight: 400;
    font-size: 24px;
    line-height: 1;
    color: var(--c-bone);
    cursor: pointer;
    transition: background var(--t-fast);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
}
.tier-picker__btn:hover { background: var(--bg-warm-3); }
.tier-picker__btn small {
    font-family: var(--font-tech);
    font-style: normal;
    font-size: 8px;
    letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--c-bone-dim);
    margin-top: 3px;
}
.tier-picker__btn--s_plus  { color: #fbbf24; background: rgba(245, 158, 11, 0.12); }
.tier-picker__btn--s       { color: var(--c-amber); background: rgba(232, 163, 61, 0.10); }
.tier-picker__btn--a       { color: var(--c-amber-soft); background: rgba(214, 146, 74, 0.08); }
.tier-picker__btn--b       { color: var(--c-bone-soft); background: rgba(214, 207, 193, 0.06); }
.tier-picker__btn--c       { color: var(--c-blueprint); background: rgba(90, 168, 176, 0.08); }
.tier-picker__btn--d       { color: var(--c-bone-dim); }
.tier-picker__btn--e       { color: var(--c-bone-dim); background: rgba(19, 25, 41, 0.30); }
.tier-picker__btn--unknown { color: var(--c-bone-dim); font-style: normal; font-size: 16px; }

.tier-picker__cancel {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(244, 239, 230, 0.15);
    font-family: var(--font-tech);
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.20em; text-transform: uppercase;
    color: var(--c-bone-dim);
    cursor: pointer;
    transition: color var(--t-fast), border-color var(--t-fast);
}
.tier-picker__cancel:hover {
    color: var(--c-bone);
    border-color: var(--c-bone-dim);
}

/* ---------- Responsive --------------------------------------------- */

@media (max-width: 720px) {
    .tier { padding: 40px 16px 80px; }
    .tier::before, .tier::after { display: none; }

    .tier__title { font-size: 36px; }

    .tier-inspector {
        padding: 10px 12px;
        gap: 12px;
        min-height: 56px;
        top: 56px;
    }
    .tier-inspector__thumb { width: 40px; height: 40px; }
    .tier-inspector__name { font-size: 15px; }
    .tier-inspector__team { font-size: 12px; }

    .tier-row {
        grid-template-columns: 56px 1fr;
        min-height: 72px;
    }
    .tier-row__label {
        font-size: 26px;
        padding: 8px 4px;
    }
    .tier-row__label-sub { font-size: 8px; }
    .tier-row__drop {
        padding: 6px 8px;
        min-height: 72px;
    }
    .tier-card {
        width: 56px;
    }
    .tier-card__name { font-size: 7px; padding: 4px 4px 3px; }

    .tier-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .tier-actions__back,
    .tier-actions__submit {
        justify-content: center;
        padding: 14px 20px;
    }

    .tier-picker__grid { grid-template-columns: repeat(4, 1fr); }
}
