/* ==========================================================================
   DITHER — boss-rush roguelike (easter egg). Noir & blanc strict.
   ========================================================================== */

body.dt-open {
    overflow: hidden;
}

body.dt-open .cursor,
body.dt-open .cursor-follower,
body.dt-open .ctx-menu {
    display: none !important;
}

/* Le site masque le curseur système (curseur custom, `body * { cursor: none !important }`).
   En jeu c'est voulu (le canvas n'a pas besoin de curseur), mais sur les écrans HTML
   (titre, pause, reliques, fin) et la barre système on rétablit un vrai curseur. */
body.dt-open .dt-screen,
body.dt-open .dt-screen *,
body.dt-open .dt-bar,
body.dt-open .dt-bar * {
    cursor: default !important;
}

body.dt-open .dt-screen button,
body.dt-open .dt-screen button *,
body.dt-open .dt-screen [data-act],
body.dt-open .dt-bar button,
body.dt-open .dt-bar button * {
    cursor: pointer !important;
}

body.dt-open .dt-screen button[disabled] {
    cursor: not-allowed !important;
}

.dt-overlay {
    position: fixed;
    inset: 0;
    z-index: 56000;
    background: #000;
    color: #fff;
    font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
    cursor: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    animation: dtIn 0.35s ease both;
}

@keyframes dtIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dt-canvas {
    /* la barre système (44px) est réservée hors du canvas : jamais de chevauchement avec le HUD */
    position: absolute;
    top: 44px;
    left: 0;
    width: 100%;
    height: calc(100% - 44px);
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Barre système -------------------------------------------------------- */
.dt-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px 0 16px;
    cursor: default;
    z-index: 3;
    pointer-events: none;
}

.dt-bar > * {
    pointer-events: auto;
}

.dt-bar-title {
    font-size: 10px;
    letter-spacing: 0.32em;
    opacity: 0.55;
}

.dt-bar-spacer {
    flex: 1;
    pointer-events: none;
}

.dt-bar-btn {
    appearance: none;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #000;
    color: #fff;
    font: inherit;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.dt-bar-btn:hover,
.dt-bar-btn:focus-visible {
    border-color: #fff;
    outline: none;
}

.dt-bar-btn[aria-pressed="false"] {
    opacity: 0.5;
}

/* Écrans HTML ---------------------------------------------------------- */
.dt-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.dt-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 56px 24px 32px;
    text-align: center;
    pointer-events: auto;
    cursor: default;
    animation: dtScreen 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes dtScreen {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.dt-screen-pause,
.dt-screen-relic,
.dt-screen-dead {
    background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.78) 60%, rgba(0, 0, 0, 0.9) 100%);
}

.dt-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.dt-logo-word {
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-weight: 500;
    font-size: clamp(56px, 9vw, 104px);
    line-height: 0.88;
    letter-spacing: 0.06em;
    color: #fff;
}

.dt-logo-sub {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    opacity: 0.7;
}

.dt-best {
    display: flex;
    gap: 14px;
    align-items: baseline;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* Victoire : fond inversé en trame, titre en négatif */
.dt-screen-win {
    background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.92) 70%);
}
.dt-screen-win .dt-h {
    background: #fff;
    color: #000;
    padding: 6px 22px;
    animation: dt-win-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.dt-screen-win .dt-stats dd { color: #fff; }
.dt-mail-ask {
    max-width: 32rem;
    margin: 2px auto 10px;
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.75;
    text-align: center;
}
.dt-mail-link {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}
@keyframes dt-win-in {
    from { transform: scaleX(0.2); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.dt-best span {
    opacity: 0.55;
}

.dt-best b {
    font-weight: 500;
}

.dt-btn {
    appearance: none;
    min-width: 200px;
    padding: 13px 26px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: #000;
    color: #fff;
    font: inherit;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.dt-btn:hover,
.dt-btn:focus-visible {
    border-color: #fff;
    outline: none;
    transform: translateY(-1px);
}

.dt-btn-primary {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.dt-btn-primary:hover {
    background: #000;
    color: #fff;
}

.dt-btn-primary:focus-visible {
    outline: 1px solid #fff;
    outline-offset: 4px;
}

/* le site arrondit les anneaux de focus (v3.css) : ici tout reste carré */
.dt-overlay :focus-visible {
    border-radius: 0;
}

.dt-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* volumes (pause) */
.dt-vol {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 10px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #fff;
    padding: 2px 6px;
}
.dt-vol span { flex: 0 0 76px; text-align: left; opacity: .7; }
.dt-vol input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 2px;
    background: #fff;
    outline: none;
    cursor: pointer;
}
.dt-vol input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px; height: 12px;
    background: #000;
    border: 2px solid #fff;
}
.dt-vol input[type="range"]::-moz-range-thumb {
    width: 10px; height: 10px; border-radius: 0;
    background: #000;
    border: 2px solid #fff;
}

.dt-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.dt-h {
    margin: 0;
    font-family: inherit;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    opacity: 0.85;
}

.dt-h-serif {
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-style: italic;
    font-size: clamp(30px, 5vw, 46px);
    letter-spacing: 0;
    text-transform: none;
    opacity: 1;
}

.dt-sub {
    margin: -8px 0 0;
    font-size: 12px;
    opacity: 0.6;
}

.dt-ctrl,
.dt-hint,
.dt-foot {
    margin: 0;
    max-width: 560px;
    font-size: 11px;
    line-height: 1.7;
    opacity: 0.55;
}

.dt-hint {
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-style: italic;
    font-size: 15px;
    opacity: 0.75;
}

.dt-foot {
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 10px;
}

/* Accueil --------------------------------------------------------------- */
.dt-overlay:has(.dt-screen-title) .dt-canvas {
    visibility: hidden;
}

.dt-screen-title {
    justify-content: center;
    gap: 0;
    background: #000;
}

/* Même grammaire que le site : noir, blanc, filets 1 px, serif d’affichage, mono en petites capitales */
.dt-title {
    --dt-line: rgba(255, 255, 255, 0.14);
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
    grid-template-areas:
        "main codex"
        "stats stats"
        "trophies trophies"
        "seals seals";
    gap: 44px 0;
    align-items: center;
    width: 100%;
    max-width: 980px;
    text-align: left;
}

.dt-title > * {
    animation: dtTitleIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.dt-title > .dt-codex { animation-delay: 0.12s; }
.dt-title > .dt-title-stats { animation-delay: 0.24s; }
.dt-title > .dt-trophy-bar {
    grid-area: trophies;
    justify-content: flex-start;
    margin: 12px 0 0;
    max-width: none;
}

/* Sceaux de victoire : chips cliquables, le sceau porté est inversé */
.dt-title > .dt-seal-bar { grid-area: seals; margin-top: -30px; align-items: center; }
.dt-seal-label {
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-right: 6px;
}
.dt-chip-seal {
    appearance: none;
    background: #000;
    color: #fff;
    font: inherit;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 4px 8px;
    border: 1px double rgba(255, 255, 255, 0.6);
    border-width: 3px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dt-chip-seal:hover, .dt-chip-seal:focus-visible { border-color: #fff; outline: none; }
.dt-chip-seal.is-worn { background: #fff; color: #000; border-color: #fff; }

/* Écran de victoire : le sceau choisi reste affiché, inversé ; les autres s'effacent */
.dt-seal-pick { width: 100%; max-width: 760px; margin: 4px auto 10px; }
.dt-seal-h {
    margin: 0 0 8px;
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.6;
    text-align: center;
}
.dt-seal-pick .dt-relic { min-height: 170px; padding-top: 20px; }
.dt-relic.is-picked-keep {
    animation: dtRelicKeep 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    pointer-events: none;
    background: #000;
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 0 3px #000, 0 0 0 4px #fff;
}
.dt-relic.is-picked-keep .dt-relic-glyph { background: #fff; color: #000; border-color: #fff; }
@keyframes dtRelicKeep {
    0% { transform: scale(1); filter: none; }
    25% { transform: scale(1.06); filter: invert(1); }
    45% { transform: scale(1.06); filter: none; }
    100% { transform: translateY(-4px) scale(1.03); filter: none; }
}

@keyframes dtTitleIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.dt-title-main {
    grid-area: main;
    display: grid;
    grid-template-columns: max-content;
    justify-items: stretch;
    justify-self: start;
    align-content: center;
    width: max-content;
    max-width: calc(100% - 56px);
    gap: 18px;
    margin-right: 56px;
}

.dt-title-main .dt-logo {
    align-items: flex-start;
    margin: 0;
    gap: 0;
}

.dt-title-main .dt-logo-word {
    display: block;
    white-space: nowrap;
    font-weight: 400;
    font-size: clamp(64px, 8.5vw, 112px);
    letter-spacing: 0.02em;
    line-height: 0.86;
}

.dt-logo-by {
    display: block;
    margin: 14px 0 6px;
    padding-left: 4px;
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-style: italic;
    font-size: 15px;
    letter-spacing: 0.04em;
    color: #fff;
    opacity: 0.72;
}

.dt-title-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: none;
}

.dt-title-actions .dt-btn,
.dt-title-actions .dt-btn-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: none;
    min-width: 0;
    width: 100%;
    height: 44px;
    padding: 0 18px;
    font-size: 11px;
    letter-spacing: 0.26em;
    text-align: left;
    transform: none;
}

.dt-title-actions .dt-btn:hover,
.dt-title-actions .dt-btn:focus-visible {
    transform: none;
}

.dt-title-actions .dt-btn-primary kbd {
    font: inherit;
    font-size: 13px;
    letter-spacing: 0;
    opacity: 0.55;
}

.dt-title-actions .dt-btn + .dt-btn { margin-top: 8px; }
.dt-title-actions .dt-btn small {
    display: inline;
    margin: 0;
    font-size: 9px;
    letter-spacing: 0.16em;
    opacity: 0.55;
    text-align: right;
    white-space: nowrap;
}

@media (hover: none) and (pointer: coarse) {
    .dt-title-actions .dt-btn-primary kbd {
        display: none;
    }
}

/* Focus initial (programmatique) : anneau discret, pas de double cadre */
.dt-title-actions .dt-btn-primary:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.35);
    outline-offset: 3px;
}

.dt-codex {
    grid-area: codex;
    display: flex;
    flex-direction: column;
    padding: 6px 0 0 56px;
    border-left: 1px solid var(--dt-line);
}

.dt-codex-h {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 0 26px;
    font-size: 9px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0.5;
    font-weight: 500;
}

.dt-codex-h span {
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-size: 15px;
    letter-spacing: 0;
    opacity: 1;
}

/* Grille 10 paliers × 3 boss (A/B/C) : icônes seules, légende au survol */
.dt-codex-tiers {
    display: grid;
    grid-template-columns: repeat(var(--dt-cols, 10), 1fr);
    gap: 0 4px;
    margin: 0 0 8px;
    font-size: 8px;
    letter-spacing: 0.2em;
    text-align: center;
    opacity: 0.45;
}

.dt-codex-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(var(--dt-cols, 10), 1fr);
    gap: 8px 4px;
}

.dt-codex-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
    opacity: 0.28;
    transition: opacity 0.2s, transform 0.2s;
    cursor: default;
    outline: none;
}

.dt-codex-item:hover,
.dt-codex-item:focus-visible {
    transform: translateY(-2px);
}

.dt-codex-item:focus-visible .dt-codex-icon {
    outline: 1px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.dt-codex-caption {
    margin: 12px 0 0;
    min-height: 1.5em;
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.55;
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.dt-codex-caption em {
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-style: italic;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
}

.dt-codex-caption small {
    font-size: 8px;
}

.dt-codex-item.is-met {
    opacity: 0.7;
}

.dt-codex-item.is-slain {
    opacity: 1;
}

.dt-codex-icon {
    width: 34px;
    height: 34px;
}

.dt-codex-num {
    font-size: 8px;
    letter-spacing: 0.24em;
    opacity: 0.5;
}

.dt-codex-name {
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-style: italic;
    font-size: 12px;
    line-height: 1.15;
    min-height: 2.3em;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.dt-codex-item:not(.is-met):not(.is-slain) .dt-codex-name {
    font-family: inherit;
    font-style: normal;
    font-size: 9px;
    letter-spacing: 0.24em;
    padding-top: 2px;
}

.dt-codex-sub {
    display: none;
}

/* Ligne de statistiques : filet + 5 colonnes, comme un cartouche */
.dt-title-stats {
    grid-area: stats;
    display: flex;
    justify-content: space-between;
    gap: 16px 28px;
    margin: 0;
    padding: 22px 0 0;
    border-top: 1px solid var(--dt-line);
}

.dt-stat {
    display: flex;
    flex-direction: column;
    gap: 7px;
    text-align: left;
    padding: 0;
    border: 0;
}

.dt-stat dt {
    font-size: 8px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    opacity: 0.45;
}

.dt-stat dd {
    margin: 0;
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-size: 19px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Reliques -------------------------------------------------------------- */
.dt-relics {
    --dt-n: 3;
    display: grid;
    grid-template-columns: repeat(var(--dt-n), minmax(0, 220px));
    gap: 14px;
    width: 100%;
    max-width: 1000px;
    justify-content: center;
}

.dt-relic {
    appearance: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 26px 16px 20px;
    min-height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: #000;
    color: #fff;
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.dt-relic::before {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.dt-relic:hover,
.dt-relic:focus-visible {
    border-color: #fff;
    outline: none;
    transform: translateY(-3px);
}

.dt-relic:hover .dt-relic-glyph,
.dt-relic:focus-visible .dt-relic-glyph {
    background: #fff;
    color: #000;
}

.dt-relic.is-curse {
    border-style: dashed;
}

/* Cérémonie de choix : la carte élue s'avance, s'inverse et flashe ; les autres s'effacent */
.dt-relic.is-picked {
    animation: dtRelicPick 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    z-index: 2;
    border-color: #fff;
    pointer-events: none;
}

.dt-relic.is-picked .dt-relic-glyph {
    background: #fff;
    color: #000;
    animation: dtRelicGlyph 0.62s ease-out both;
}

.dt-relic.is-passed {
    animation: dtRelicPass 0.4s ease-in both;
    pointer-events: none;
}

.is-picking .dt-relic-actions,
.is-picking .dt-hint,
.is-picking .dt-frag-line {
    opacity: 0;
    transition: opacity 0.25s;
}

@keyframes dtRelicPick {
    0% { transform: translateY(-3px) scale(1); filter: none; }
    18% { transform: translateY(-10px) scale(1.06); filter: invert(1); }
    30% { transform: translateY(-10px) scale(1.06); filter: none; }
    42% { filter: invert(1); }
    54% { filter: none; }
    100% { transform: translateY(-46px) scale(1.14); opacity: 0; filter: none; }
}

@keyframes dtRelicGlyph {
    0% { transform: scale(1); }
    35% { transform: scale(1.5) rotate(12deg); }
    100% { transform: scale(1.2); }
}

@keyframes dtRelicPass {
    to { opacity: 0; transform: translateY(14px) scale(0.94); }
}

/* Raretés : commune = fin, rare = double bord, épique = cadre tramé, légendaire = inversée */
.dt-relic-r {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 0 0 3px #000, inset 0 0 0 4px rgba(255, 255, 255, 0.5);
}

.dt-relic-r::before {
    display: none;
}

.dt-relic-e {
    border-color: #fff;
    background:
        linear-gradient(#000, #000) padding-box,
        repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 4px) border-box;
    border-width: 4px;
    border-style: solid;
    border-color: transparent;
    padding: 23px 13px 17px;
}

.dt-relic-e::before {
    inset: 3px;
    border-color: rgba(255, 255, 255, 0.35);
}

.dt-relic-l {
    background: #fff;
    color: #000;
    border-color: #fff;
    animation: dtScreen 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) both, dtLegend 1.6s ease-in-out infinite alternate;
}

.dt-relic-l::before {
    border-color: rgba(0, 0, 0, 0.25);
}

.dt-relic-l .dt-relic-glyph {
    border-color: #000;
}

.dt-relic-l:hover .dt-relic-glyph,
.dt-relic-l:focus-visible .dt-relic-glyph {
    background: #000;
    color: #fff;
}

.dt-relic-l:hover,
.dt-relic-l:focus-visible {
    border-color: #fff;
    box-shadow: 0 0 0 1px #000, 0 0 0 2px #fff;
}

@keyframes dtLegend {
    from { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); }
    to { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}

.dt-relic-rarity {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 8px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.6;
}

.dt-relic-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.dt-btn-small {
    min-width: 0;
    padding: 9px 16px;
    font-size: 10px;
    border-color: rgba(255, 255, 255, 0.25);
}

.dt-btn-small small {
    font-size: 9px;
    opacity: 0.55;
    margin-left: 6px;
}

.dt-btn[disabled] {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.dt-dead-relics,
.dt-trophy-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: -4px 0 4px;
    max-width: 640px;
}

.dt-trophy-got {
    margin: 0 0 12px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 1;
    max-width: 36rem;
    line-height: 1.45;
}
.dt-trophy-got span { display: block; font-size: 9px; letter-spacing: 0.22em; opacity: 0.55; margin-bottom: 4px; }
.dt-trophy-got em {
    display: block;
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-style: italic;
    font-size: 22px;
    letter-spacing: 0.02em;
    text-transform: none;
}
.dt-trophy-got small { display: block; margin-top: 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: none; opacity: 0.75; }

.dt-chip-trophy {
    font-style: italic;
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    letter-spacing: 0.08em;
    text-transform: none;
    border-style: dashed;
}

.dt-chip {
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dt-chip-r { border-color: rgba(255, 255, 255, 0.7); }
.dt-chip-e { border-style: double; border-width: 3px; padding: 2px 6px; border-color: #fff; }
.dt-chip-l { background: #fff; color: #000; border-color: #fff; }
.dt-chip-syn { border-style: dashed; border-color: #fff; }
.dt-chip-form { background: #fff; color: #000; font-weight: 700; }

/* ---------- méta : fragments, sceller, lineup ---------- */
.dt-btn-seal { border-style: double; border-width: 3px; padding: 7px 14px; }
.dt-frag-line {
    margin: 6px 0 0;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.75;
}
.dt-frag-line small, .dt-const-frag small { font-size: 9px; opacity: 0.6; letter-spacing: 0.2em; }
.dt-lost { font-style: normal; opacity: 0.6; margin-left: 6px; }

.dt-lineup {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px 14px;
    max-width: 640px;
    font-size: 10px;
    letter-spacing: 0.1em;
}
.dt-lineup li { display: flex; gap: 6px; align-items: baseline; opacity: 0.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-lineup li.is-done { opacity: 0.85; text-decoration: line-through; text-decoration-color: rgba(255,255,255,0.5); }
.dt-lineup li.is-current { opacity: 1; }
.dt-lineup-num { font-family: var(--font-display, 'Source Serif 4', Georgia, serif); font-style: italic; min-width: 20px; }
.dt-lineup-name { overflow: hidden; text-overflow: ellipsis; }

/* ---------- écran Constellation ---------- */
.dt-screen-constellation {
    justify-content: flex-start;
    overflow-y: auto;
    padding: 48px 24px 28px;
    background: #000;
}
.dt-const-head { text-align: center; max-width: 980px; width: min(100%, 980px); position: sticky; top: 0; z-index: 2; background: #000; padding: 4px 0 10px; }
.dt-const-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.dt-const-head-row .dt-h { margin: 0; }
.dt-const-head-row .dt-btn { flex: none; }
.dt-const-head .dt-sub { max-width: 560px; margin: 8px auto 0; }
.dt-const-frag { margin: 2px 0 8px; font-size: 16px; letter-spacing: 0.14em; }
.dt-frag-ico { display: inline-block; transform: translateY(-1px); }
.dt-const {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 22px;
    width: min(100%, 980px);
    margin: 14px 0 18px;
}
.dt-const-branch h3 {
    margin: 0 0 8px;
    font: italic 400 14px/1 var(--font-display, 'Source Serif 4', Georgia, serif);
    letter-spacing: 0.06em;
    opacity: 0.85;
}
.dt-const-nodes { position: relative; display: flex; flex-direction: column; gap: 6px; padding-left: 14px; }
/* fil de constellation reliant les nœuds d'une branche */
.dt-const-nodes::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: 12px; border-left: 1px dashed rgba(255, 255, 255, 0.35); }
.dt-node {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: 'dot name cost' 'dot desc cost';
    gap: 0 10px;
    align-items: center;
    text-align: left;
    padding: 7px 10px 7px 6px;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    font: inherit;
    cursor: pointer;
    transition: border-color .12s, background .12s, transform .12s;
}
.dt-node:hover, .dt-node:focus-visible { border-color: #fff; outline: none; transform: translateX(2px); }
.dt-node-dot { grid-area: dot; width: 9px; height: 9px; border: 1px solid #fff; transform: rotate(45deg); background: transparent; margin-left: -12px; }
.dt-node-name { grid-area: name; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.dt-node-desc { grid-area: desc; font-size: 10px; opacity: 0.65; letter-spacing: 0.03em; }
.dt-node-cost { grid-area: cost; font-size: 11px; letter-spacing: 0.1em; white-space: nowrap; }
.dt-node.is-owned { background: #fff; color: #000; border-color: #fff; cursor: default; }
.dt-node.is-owned .dt-node-dot { background: #000; border-color: #000; }
.dt-node.is-owned:hover { transform: none; }
.dt-node.is-buyable .dt-node-dot { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.18); }
.dt-node.is-poor { opacity: 0.7; }
/* ---------- Atelier : carte à nœuds (SVG) ---------- */
.dt-screen-constellation { padding: 44px 16px 16px; }
.dt-screen-constellation .dt-const-head { padding: 0 0 4px; }
.dt-at-wrap { width: min(100%, 1180px); flex: 1 1 auto; min-height: 0; display: grid; place-items: center; }
.dt-at { display: block; width: 100%; height: auto; max-height: calc(100vh - 192px); overflow: visible; }
.dt-at text { fill: #fff; font-family: var(--font-mono, ui-monospace, monospace); pointer-events: none; }
.dt-at-name { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.dt-at-cost { font-size: 11px; letter-spacing: 0.1em; opacity: 0.6; }
.dt-at-branch { font-size: 11px; letter-spacing: 0.3em; opacity: 0.35; font-style: italic; font-family: var(--font-display, 'Source Serif 4', Georgia, serif); }
.dt-at-link { stroke: rgba(255,255,255,0.28); stroke-width: 1; }
.dt-at-link.is-owned { stroke: #fff; stroke-width: 2; }
.dt-at-link.is-buyable { stroke: rgba(255,255,255,0.6); }
.dt-at-link.is-hidden { stroke: rgba(255,255,255,0.12); }
.dt-at-ring { fill: none; stroke: rgba(255,255,255,0.6); stroke-width: 1; stroke-dasharray: 2 6; animation: dtAtSpin 40s linear infinite; transform-origin: center; transform-box: fill-box; }
.dt-at-ship { fill: #fff; }
.dt-at-frag { font-size: 13px; letter-spacing: 0.14em; }
.dt-at-node { cursor: pointer; outline: none; }
.dt-at-node.is-hidden { cursor: default; }
.dt-at-hit { fill: transparent; }
.dt-at-dot { fill: #000; stroke: #fff; stroke-width: 1.4; transition: fill .12s, stroke-width .12s; }
/* acquis : plein, gros, cœur noir, lueur ; disponible : creux + halo ; trop cher : terne ; caché : point */
.dt-at-node.is-owned .dt-at-dot { fill: #fff; stroke: #fff; }
.dt-at-core { fill: #000; }
.dt-at-glow { fill: rgba(255,255,255,0.10); }
.dt-at-node.is-buyable .dt-at-dot { fill: #000; stroke: #fff; stroke-width: 1.8; }
.dt-at-node.is-poor .dt-at-dot { fill: #000; stroke: rgba(255,255,255,0.45); }
.dt-at-node.is-poor text { opacity: 0.45; }
.dt-at-node.is-hidden .dt-at-dot { stroke: rgba(255,255,255,0.35); fill: #000; }
.dt-at-halo { fill: none; stroke: #fff; stroke-width: 1; opacity: 0.6; animation: dtAtHalo 1.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.dt-at-node:hover .dt-at-dot, .dt-at-node:focus-visible .dt-at-dot, .dt-at-node.is-sel .dt-at-dot { stroke-width: 2.6; }
.dt-at-node.is-sel .dt-at-name { text-decoration: underline; text-underline-offset: 3px; }
.dt-at-node.is-sel.is-buyable .dt-at-dot { fill: #fff; }
.dt-at-node.is-sel.is-owned .dt-at-glow { fill: rgba(255,255,255,0.28); }
@keyframes dtAtHalo { 0%, 100% { opacity: 0.15; transform: rotate(45deg) scale(0.85); } 50% { opacity: 0.7; transform: rotate(45deg) scale(1.15); } }
@keyframes dtAtSpin { to { transform: rotate(360deg); } }
.dt-at-panel.is-owned { border-color: rgba(255,255,255,0.45); }
.dt-at-panel-txt em { font-style: italic; text-transform: none; letter-spacing: 0.04em; opacity: 0.55; margin-left: 8px; }
.dt-at-check { font-size: 20px; flex: none; }
.dt-at-panel {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    width: min(100%, 720px); min-height: 56px; margin-top: 6px; padding: 10px 14px;
    border: 1px solid #fff; background: #000; color: #fff;
}
.dt-at-panel.is-empty { justify-content: center; border-color: rgba(255,255,255,0.3); letter-spacing: 0.14em; font-size: 14px; }
.dt-at-panel.is-empty small { font-size: 10px; letter-spacing: 0.14em; opacity: 0.6; }
.dt-at-panel-txt { display: grid; gap: 3px; min-width: 0; }
.dt-at-panel-txt strong { font-weight: 400; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.dt-at-panel-txt span { font-size: 11px; opacity: 0.7; letter-spacing: 0.03em; }
.dt-at-panel .dt-btn { flex: none; }
.dt-at-panel .dt-btn[disabled] { opacity: 0.4; cursor: default; }
.dt-at-owned { font-size: 18px; flex: none; }
@media (max-width: 760px) {
    .dt-at-wrap { overflow-x: auto; place-items: start; -webkit-overflow-scrolling: touch; }
    .dt-at { min-width: 720px; max-height: none; }
    .dt-at-name { font-size: 14px; }
    .dt-at-cost { font-size: 13px; }
}

.dt-btn-shop {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border-color: #fff;
}
.dt-btn-shop small {
    font-size: 10px;
    letter-spacing: 0.14em;
    opacity: 0.7;
}
@media (max-width: 760px) {
    .dt-const { grid-template-columns: 1fr; gap: 14px; }
    .dt-lineup { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.dt-relic-key {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 10px;
    opacity: 0.5;
}

.dt-relic-glyph {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid #fff;
    font-size: 22px;
    line-height: 1;
    color: #fff;
    font-variant-emoji: text;
    font-family: var(--font-mono, ui-monospace, monospace), "Segoe UI Symbol", sans-serif;
    transition: background 0.15s, color 0.15s;
}

.dt-relic-glyph .dt-ico {
    width: 22px;
    height: 22px;
    display: block;
    fill: currentColor;
    stroke: currentColor;
}

.dt-relic-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dt-relic-name {
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-size: 20px;
    line-height: 1.1;
}

.dt-relic-name em {
    display: block;
    font-family: var(--font-mono, monospace);
    font-style: normal;
    font-size: 9px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 4px;
}

.dt-relic-desc {
    font-size: 11px;
    line-height: 1.6;
    opacity: 0.7;
}

/* Mort ------------------------------------------------------------------ */
.dt-stats {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 28px;
    margin: 6px 0 10px;
}

.dt-stats > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dt-stats dt {
    font-size: 9px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    opacity: 0.5;
}

.dt-stats dd {
    margin: 0;
    font-family: var(--font-display, 'Source Serif 4', Georgia, serif);
    font-size: 30px;
    line-height: 1;
}

.dt-stats dd em {
    display: block;
    margin-top: 6px;
    font-family: var(--font-mono, monospace);
    font-style: normal;
    font-size: 9px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

/* Mobile ---------------------------------------------------------------- */
@media (max-width: 768px) {
    .dt-screen {
        gap: 14px;
        padding: 52px 18px 28px;
    }

    .dt-logo-word {
        font-size: clamp(40px, 12vw, 60px);
    }

    .dt-logo-sub {
        font-size: 9.5px;
        letter-spacing: 0.18em;
    }

    .dt-screen-title {
        padding: 54px 20px 36px;
        justify-content: flex-start;
        overflow-y: auto;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }

    .dt-title {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "codex"
            "stats"
            "trophies"
            "seals";
        gap: 34px;
        max-width: 440px;
    }

    .dt-title-main {
        width: 100%;
        max-width: none;
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        margin-right: 0;
    }

    .dt-title-main .dt-logo-word {
        font-size: clamp(52px, 15vw, 72px);
    }

    .dt-title-actions .dt-btn,
    .dt-title-actions .dt-btn-primary {
        height: 48px;
    }

    .dt-codex {
        padding: 26px 0 0;
        border-left: 0;
        border-top: 1px solid var(--dt-line);
    }

    .dt-codex-h {
        margin-bottom: 18px;
    }

    .dt-codex-list {
        gap: 6px 2px;
    }

    .dt-codex-icon {
        width: 26px;
        height: 26px;
    }

    .dt-codex-name {
        font-size: 10.5px;
    }

    .dt-title-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 18px 14px;
        padding-top: 20px;
    }

    .dt-stat dd {
        font-size: 16px;
    }

    .dt-relic-rarity {
        position: static;
        order: -1;
        display: none;
    }

    .dt-relic-e {
        padding: 13px 13px 13px 33px;
    }

    .dt-dead-relics {
        display: none;
    }

    .dt-relics {
        grid-template-columns: 1fr;
        gap: 8px;
        max-width: 360px;
    }

    .dt-relic {
        flex-direction: row;
        text-align: left;
        align-items: center;
        min-height: 0;
        padding: 14px 14px 14px 34px;
        gap: 12px;
    }

    .dt-relic-glyph {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .dt-relic-name {
        font-size: 17px;
    }

    .dt-relic-desc {
        font-size: 10.5px;
    }

    .dt-relic-text {
        align-items: flex-start;
        gap: 3px;
    }

    .dt-stats {
        grid-template-columns: repeat(2, auto);
        gap: 18px 32px;
    }

    .dt-stats dd {
        font-size: 24px;
    }

    .dt-btn {
        min-width: 160px;
        padding: 12px 20px;
    }

    .dt-foot {
        bottom: 14px;
    }
}

/* Desktop peu haut (laptop 13") : même écran, plus compact */
@media (min-width: 769px) and (max-height: 720px) {
    .dt-title {
        gap: 30px 0;
    }

    .dt-title-main {
        gap: 14px;
    }

    .dt-title-main .dt-logo-word {
        font-size: clamp(56px, 7vw, 84px);
    }

    .dt-codex-list {
        gap: 6px 4px;
    }

    .dt-codex-icon {
        width: 30px;
        height: 30px;
    }

    .dt-title-stats {
        padding-top: 16px;
    }
}

@media (max-height: 460px) {
    .dt-screen {
        gap: 8px;
        padding-top: 48px;
    }

    .dt-logo-word {
        font-size: 44px;
    }

    .dt-hint {
        display: none;
    }

    .dt-relic {
        min-height: 0;
        padding: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dt-overlay,
    .dt-screen {
        animation: none;
    }
}
