/* ═══════════════════════════════════════════════════════════════════════════
   Tehono Market - Transmutation (public)
   Layout master-detail épuré : moins de cadres, tailles harmonisées.
   ═══════════════════════════════════════════════════════════════════════════ */

.th-tmp-wrap {
    --tmp-bg: rgba(255,255,255,0.025);
    --tmp-card: rgba(255,255,255,0.04);
    --tmp-card-hover: rgba(255,255,255,0.07);
    --tmp-line: rgba(255,255,255,0.08);
    --tmp-line-strong: rgba(255,255,255,0.18);
    --tmp-text: #f5f7f6;
    --tmp-soft: #c8d0cc;
    --tmp-muted: #8b9691;
    --tmp-green: #20f0b4;
    --tmp-green-soft: rgba(32,240,180,.22);
    --tmp-red: #ff6161;
    --tmp-gold: #d4a94f;

    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--tmp-text);
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 20px 80px;
    line-height: 1.6;

    position: relative;
    z-index: 1;
    isolation: isolate;
}

.th-tmp-wrap *,
.th-tmp-wrap *::before,
.th-tmp-wrap *::after { box-sizing: border-box; }

/* ── Feedback ──────────────────────────────────────────────────────────────── */
.th-tmp-feedback {
    display: none;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    line-height: 1.6;
    word-break: break-word;
}
.th-tmp-feedback.is-visible { display: block; }
.th-tmp-feedback code {
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--tmp-soft);
}
.th-tmp-feedback.is-info    { background: rgba(255,255,255,0.04); border-color: var(--tmp-line); color: var(--tmp-soft); }
.th-tmp-feedback.is-success { background: rgba(32,240,180,0.08);  border-color: var(--tmp-green-soft); color: #9ee0b8; }
.th-tmp-feedback.is-error   { background: rgba(255,100,100,0.06); border-color: rgba(255,100,100,0.35); color: #ff9b9b; }

/* ── Shell : liste à gauche, détail à droite ─────────────────────────────── */
.th-tmp-shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    align-items: start;
}

.th-tmp-offers-panel {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 56px);
    overflow: auto;
    padding-right: 4px; /* espace pour la scrollbar */
}

/* Panel top retiré du HTML (titre "OFFRES" + sous-titre supprimés). Les
   règles correspondantes sont devenues inutiles. */

/* ── Liste offres : items aérés ───────────────────────────────────────────── */
.th-tmp-offers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px;
}
.th-tmp-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--tmp-muted);
    font-style: italic;
}

.th-tmp-list-item {
    width: 100%;
    /* Fond léger par défaut : lève la carte du noir, signale qu'elle est cliquable */
    border: 1px solid var(--tmp-line);
    background: rgba(255,255,255,0.025);
    border-radius: 14px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
    text-align: left;
    font-family: inherit;
    color: inherit;
}
.th-tmp-list-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--tmp-line-strong);
}
/* Active : dégradé turquoise franc (rappelle le titre TRANSMUTATION) */
.th-tmp-list-item.is-active {
    background: linear-gradient(135deg, rgba(95,220,198,0.32) 0%, rgba(15,127,106,0.18) 45%, rgba(168,230,207,0.22) 100%);
    border-color: rgba(95,220,198,0.60);
    box-shadow: 0 0 28px rgba(32,240,180,0.18), inset 0 0 0 1px rgba(95,220,198,0.20);
}
.th-tmp-list-item.is-active .th-tmp-list-name {
    color: #ffffff;
}

.th-tmp-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,.4);
    overflow: hidden;
    flex-shrink: 0;
}
.th-tmp-list-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.th-tmp-list-icon-placeholder {
    color: var(--tmp-green);
    font-size: 20px;
    opacity: 0.7;
}

.th-tmp-list-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.th-tmp-list-name {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tmp-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.th-tmp-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.th-tmp-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 19px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    color: var(--tmp-muted);
    background: rgba(255,255,255,.04);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.th-tmp-pill.is-available { color: var(--tmp-green); background: rgba(32,240,180,.10); }
.th-tmp-pill.is-incomplete { color: var(--tmp-red); background: rgba(255,97,97,.10); }
.th-tmp-pill.is-upcoming { color: var(--tmp-gold); background: rgba(212,169,79,.10); }
.th-tmp-pill.is-expired { color: var(--tmp-muted); background: rgba(255,255,255,.03); }

.th-tmp-list-arrow {
    color: var(--tmp-muted);
    font-size: 16px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.th-tmp-list-item:hover .th-tmp-list-arrow,
.th-tmp-list-item.is-active .th-tmp-list-arrow { opacity: 1; }

/* ── Panneau de détail : bordure turquoise + glow doux pour faire écho à
   l'item actif du sommaire (cohérence visuelle "sélectionné = affiché") ─── */
.th-tmp-detail-panel {
    padding: 28px;
    position: relative;
    border: 1px solid rgba(95,220,198,0.40);
    background: rgba(255,255,255,0.015);
    border-radius: 20px;
    box-shadow: 0 0 36px rgba(32,240,180,0.08);
}

.th-tmp-detail {
    position: relative;
    z-index: 1;
}

/* ── Header détail : titre + timer alignés, séparation horizontale subtile ── */
.th-tmp-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--tmp-line);
    margin-bottom: 28px;
}
.th-tmp-detail-header-text { flex: 1; min-width: 0; }
.th-tmp-detail-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--tmp-text);
}
.th-tmp-detail-description {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--tmp-muted);
    font-size: 14px;
    line-height: 1.6;
}
.th-tmp-timer-box {
    text-align: right;
    min-width: 180px;
    flex-shrink: 0;
}
.th-tmp-timer-box.is-expired .th-tmp-timer-label { color: var(--tmp-red); }
.th-tmp-timer-label {
    color: var(--tmp-green);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.th-tmp-timer-value {
    margin-top: 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--tmp-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.th-tmp-timer-date {
    margin-top: 4px;
    color: var(--tmp-muted);
    font-size: 11px;
}

/* ── Layout exchange : plus de boxes, juste deux colonnes + flèche ────────── */
.th-tmp-exchange-layout {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 18px;
    align-items: start;
    margin-bottom: 28px;
}

.th-tmp-exchange-box {
    /* Désormais transparent : plus de cadre, juste du contenu */
    border: none;
    background: transparent;
    padding: 0;
}

.th-tmp-exchange-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}
.th-tmp-exchange-title h3 {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tmp-muted);
    font-weight: 800;
}
.th-tmp-count-badge {
    font-size: 11px;
    color: var(--tmp-muted);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    background: none;
    border: none;
    padding: 0;
}
.th-tmp-count-badge::before {
    content: '·';
    margin-right: 8px;
    opacity: 0.5;
}

/* ── Grille assets : tailles uniformes, auto-fit pour stretch des solos ───── */
/* auto-fit (vs auto-fill) : quand 1 seule carte, elle prend toute la largeur
   de son panneau au lieu de rester coincée dans une demi-colonne avec une
   colonne vide à droite. Avec 10 cartes, comportement identique (2 cols). */
.th-tmp-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.th-tmp-asset-card {
    background: var(--tmp-card);
    border: 1px solid var(--tmp-line);
    border-radius: 14px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    transition: background 0.15s, border-color 0.15s;
}
.th-tmp-asset-card:hover {
    background: var(--tmp-card-hover);
    border-color: var(--tmp-line-strong);
}
.th-tmp-asset-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.th-tmp-asset-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0,0,0,.4);
    object-fit: cover;
    border: 1px solid var(--tmp-line);
    flex-shrink: 0;
    display: grid;
    place-items: center;
}
.th-tmp-asset-img-empty {
    background: rgba(255,255,255,0.04);
    border-style: dashed;
}
.th-tmp-asset-img-runes {
    color: var(--tmp-gold);
    font-weight: 900;
    font-size: 16px;
    background: rgba(212,169,79,.10);
    border-color: rgba(212,169,79,.3);
}
.th-tmp-asset-text-block {
    flex: 1;
    min-width: 0;
}
.th-tmp-asset-name {
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--tmp-text);
    word-break: break-word;
}
.th-tmp-asset-type {
    color: var(--tmp-muted);
    font-size: 11px;
    margin-top: 2px;
    line-height: 1.3;
    word-break: break-word;
}
.th-tmp-asset-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.th-tmp-required {
    color: var(--tmp-soft);
    font-size: 11px;
    font-weight: 700;
}
/* Texte "Détenu : N" en vert (assez détenu) ou rouge (insuffisant) */
.th-tmp-stock {
    font-size: 11px;
    font-weight: 700;
    color: var(--tmp-green);
    flex-shrink: 0;
}
.th-tmp-stock.is-zero {
    color: var(--tmp-red);
}

/* ── Cercle swap : aligné en haut avec les cartes (pas centré vertical) ───── */
.th-tmp-swap-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    align-self: start;
    /* margin-top calé sur la hauteur du title row (label + margin-bottom 14px) */
    margin-top: 30px;
}
.th-tmp-swap-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(32,240,180,.10);
    color: var(--tmp-green);
    font-size: 22px;
}
.th-tmp-swap-text {
    /* Texte "Transmutation rituelle" supprimé : redondant avec le titre de page */
    display: none;
}

/* ── Summary bar : minimaliste, juste les chips + bouton ──────────────────── */
.th-tmp-summary-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    padding-top: 22px;
    border-top: 1px solid var(--tmp-line);
}
.th-tmp-summary-info {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}
.th-tmp-summary-chip {
    color: var(--tmp-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    background: none;
    border: none;
    padding: 0;
}
.th-tmp-summary-chip strong {
    color: var(--tmp-text);
    margin-right: 4px;
    font-weight: 700;
}
.th-tmp-action-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ── Boutons ───────────────────────────────────────────────────────────────── */
.th-tmp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #ffffff;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.2;
    letter-spacing: 0.2px;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}
.th-tmp-btn:hover {
    background: transparent;
    color: #ffffff;
}
.th-tmp-btn:active { transform: translateY(1px); }
.th-tmp-btn:disabled,
.th-tmp-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}
.th-tmp-btn-primary {
    background: var(--tmp-green);
    border-color: var(--tmp-green);
    color: #03100c;
    font-size: 13px;
    font-weight: 800;
    padding: 12px 22px;
    border-radius: 12px;
    box-shadow: 0 0 24px rgba(32,240,180,.18);
}
.th-tmp-btn-primary:hover:not(:disabled) {
    background: #b5ffec;
    border-color: #b5ffec;
    color: #03100c;
    box-shadow: 0 0 32px rgba(32,240,180,.28);
}
.th-tmp-btn-primary:disabled {
    background: rgba(255,255,255,.05);
    color: var(--tmp-muted);
    border-color: var(--tmp-line);
    box-shadow: none;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1050px) {
    .th-tmp-shell { grid-template-columns: 1fr; gap: 28px; }
    .th-tmp-offers-panel {
        position: relative;
        top: 0;
        max-height: none;
    }
    .th-tmp-offers-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (max-width: 760px) {
    .th-tmp-wrap { padding: 14px 12px 60px; }
    .th-tmp-detail-header { flex-direction: column; }
    .th-tmp-timer-box { text-align: left; }
    .th-tmp-detail-title { font-size: 22px; }
    .th-tmp-exchange-layout { grid-template-columns: 1fr; gap: 12px; }
    .th-tmp-swap-column { flex-direction: row; align-self: stretch; height: auto; }
    .th-tmp-swap-circle { transform: rotate(90deg); }
    .th-tmp-summary-bar { grid-template-columns: 1fr; }
    .th-tmp-action-area { justify-content: flex-end; }
    .th-tmp-offers-list { grid-template-columns: 1fr; }
}
