/* RE-DS Keys & Gates page-specific styling. Keep overrides scoped. */

.nds-shell[data-re-ds-keys-gates] {
    width: min(1480px, calc(100vw - 1.5rem));
}

@media (min-width: 821px) {
    .nds-shell[data-re-ds-keys-gates] .nds-grid {
        grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
    }
}

.nds-shell[data-re-ds-keys-gates] .nds-rail {
    display: none;
}

[data-re-ds-keys-gates] .re-ds-keys-field--run {
    grid-column: span 2;
}

[data-re-ds-keys-gates] .re-ds-keys-meta {
    margin-top: 0.85rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
}

[data-re-ds-keys-gates] .re-ds-keys-count {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

[data-re-ds-keys-gates] .re-ds-keys-layout {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 1.1rem;
    align-items: start;
    min-width: 0;
}

[data-re-ds-keys-gates] .re-ds-keys-list {
    margin-top: 0.9rem;
    display: grid;
    gap: 0.7rem;
    min-width: 0;
}

[data-re-ds-keys-gates] .re-ds-keys-card__row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    min-width: 0;
}

[data-re-ds-keys-gates] .re-ds-keys-card__body {
    min-width: 0;
}

[data-re-ds-keys-gates] .re-ds-keys-thumb {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    border: 1px solid rgba(70, 55, 28, 0.18);
    background: rgba(12, 16, 19, 0.9);
    object-fit: cover;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 14px 24px rgba(0, 0, 0, 0.16);
}

[data-re-ds-keys-gates] .re-ds-keys-thumb--placeholder {
    display: block;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 55%),
        rgba(12, 16, 19, 0.92);
}

[data-re-ds-keys-gates] .re-ds-keys-card__head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.7rem;
    min-width: 0;
}

[data-re-ds-keys-gates] .re-ds-keys-card__meta {
    margin-top: 0.35rem;
    color: rgba(24, 18, 10, 0.72);
    overflow-wrap: anywhere;
}

[data-re-ds-keys-gates] .re-ds-keys-detail-placeholder {
    padding: 0.25rem 0.1rem;
    color: rgba(24, 18, 10, 0.74);
}

/* Kind pills */
[data-re-ds-keys-gates] .re-ds-pill--door-key {
    background: rgba(76, 118, 50, 0.18);
}

[data-re-ds-keys-gates] .re-ds-pill--tool {
    background: rgba(18, 74, 118, 0.18);
}

[data-re-ds-keys-gates] .re-ds-pill--crest {
    background: rgba(175, 146, 58, 0.22);
}

[data-re-ds-keys-gates] .re-ds-pill--medal {
    background: rgba(98, 64, 160, 0.18);
}

[data-re-ds-keys-gates] .re-ds-pill--unavailable {
    background: rgba(162, 37, 37, 0.16);
}

[data-re-ds-keys-gates] .re-ds-detail-card {
    box-shadow:
        inset 0 0 0 2px rgba(70, 55, 28, 0.1),
        0 18px 44px rgba(0, 0, 0, 0.12);
}

[data-re-ds-keys-gates] .re-ds-detail-card {
    overscroll-behavior: contain;
}

[data-re-ds-keys-gates] .re-ds-detail-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, 360px);
    align-items: start;
}

[data-re-ds-keys-gates] .re-ds-detail-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: start;
    padding-top: 0.95rem;
    border-top: 1px solid rgba(70, 55, 28, 0.12);
}

[data-re-ds-keys-gates] .re-ds-preview-card img {
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: radial-gradient(circle at 35% 35%, rgba(246, 241, 234, 0.86), rgba(246, 241, 234, 0.26));
}

[data-re-ds-keys-gates] .re-ds-preview-card {
    display: grid;
    place-items: center;
    border-color: rgba(70, 55, 28, 0.14);
    background: rgba(255, 252, 246, 0.58);
    box-shadow: inset 0 0 0 1px rgba(70, 55, 28, 0.1);
}

[data-re-ds-keys-gates] .re-ds-preview-card img {
    border: 0;
}

[data-re-ds-keys-gates] .re-ds-preview-card .re-ds-entity-thumb {
    width: 150px;
    height: 150px;
    border-radius: 18px;
}

[data-re-ds-keys-gates] .re-ds-preview-card .re-ds-entity-thumb img {
    border-radius: 14px;
}

[data-re-ds-keys-gates] .re-ds-entity-thumb {
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

[data-re-ds-keys-gates] .re-ds-entity-thumb:hover,
[data-re-ds-keys-gates] .re-ds-entity-thumb:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(22, 34, 24, 0.32);
    outline: none;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        0 10px 24px rgba(33, 24, 14, 0.12);
}

[data-re-ds-keys-gates] .re-ds-guide-card {
    background: rgba(255, 252, 246, 0.62);
    box-shadow: inset 0 0 0 1px rgba(70, 55, 28, 0.12);
}

[data-re-ds-keys-gates] .re-ds-guide-card + .re-ds-guide-card {
    margin-top: 0.85rem;
}

[data-re-ds-keys-gates] .re-ds-guide-list li {
    padding: 0.6rem 0.7rem;
    border: 1px solid rgba(70, 55, 28, 0.12);
    border-radius: 14px;
    background: rgba(255, 252, 246, 0.46);
}

[data-re-ds-keys-gates] .re-ds-detail-card::-webkit-scrollbar {
    width: 12px;
}

[data-re-ds-keys-gates] .re-ds-detail-card::-webkit-scrollbar-thumb {
    background: rgba(70, 55, 28, 0.22);
    border-radius: 999px;
    border: 3px solid rgba(255, 252, 246, 0.42);
}

[data-re-ds-keys-gates] .re-ds-detail-card::-webkit-scrollbar-track {
    background: rgba(15, 20, 25, 0.06);
    border-radius: 999px;
}

[data-re-ds-keys-gates] .re-ds-detail-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(70, 55, 28, 0.32) rgba(15, 20, 25, 0.08);
}

@media (min-width: 981px) {
    [data-re-ds-keys-gates] .re-ds-detail-card {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow: auto;
        scrollbar-gutter: stable;
    }
}

[data-re-ds-keys-gates] .re-ds-keys-block {
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(70, 55, 28, 0.12);
}

[data-re-ds-keys-gates] .re-ds-keys-block:first-child {
    margin-top: 0.75rem;
}

/* Find locations */
[data-re-ds-keys-gates] .re-ds-keys-locations {
    margin-top: 0.85rem;
    display: grid;
    gap: 0.55rem;
}

[data-re-ds-keys-gates] .re-ds-keys-location {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(70, 55, 28, 0.14);
    border-radius: 14px;
    background: rgba(255, 252, 246, 0.46);
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
    min-width: 0;
}

[data-re-ds-keys-gates] .re-ds-keys-location:hover,
[data-re-ds-keys-gates] .re-ds-keys-location:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(22, 34, 24, 0.28);
    outline: none;
    background: rgba(255, 252, 246, 0.7);
}

[data-re-ds-keys-gates] .re-ds-keys-location__thumb {
    width: 84px;
    height: 56px;
    border-radius: 12px;
    border: 1px solid rgba(70, 55, 28, 0.14);
    object-fit: cover;
    background: rgba(12, 16, 19, 0.92);
}

[data-re-ds-keys-gates] .re-ds-keys-location__body {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
}

[data-re-ds-keys-gates] .re-ds-keys-location__title {
    margin: 0;
    font-family: "Oswald", sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(24, 18, 10, 0.92);
    overflow-wrap: anywhere;
}

[data-re-ds-keys-gates] .re-ds-keys-location__meta {
    margin: 0;
    color: rgba(24, 18, 10, 0.7);
    overflow-wrap: anywhere;
}

[data-re-ds-keys-gates] .re-ds-room-detail.is-entering {
    animation: reDsKeysDetailIn 160ms ease-out;
}

@keyframes reDsKeysDetailIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-re-ds-keys-gates] .re-ds-room-detail.is-entering {
        animation: none;
    }
}

@media (max-width: 980px) {
    [data-re-ds-keys-gates] .re-ds-keys-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    [data-re-ds-keys-gates] .re-ds-detail-hero,
    [data-re-ds-keys-gates] .re-ds-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    [data-re-ds-keys-gates] .re-ds-keys-field--run {
        grid-column: span 3;
    }

    [data-re-ds-keys-gates] .re-ds-keys-field--wide {
        grid-column: 1 / -1;
    }
}
