/*
 * RPG Foundation and character identity cues
 *
 * Ownership: docs/architecture/css-ownership.md
 * Loaded after consultive surfaces and before History/Gallery CSS.
 */

.rpg-foundation-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px 0;
}

.rpg-foundation-card {
    min-width: 0;
    border: 1px solid rgba(120, 132, 220, 0.2);
    border-radius: 8px;
    background: rgba(10, 13, 28, 0.62);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.rpg-foundation-card[hidden] {
    display: none;
}

.rpg-foundation-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0;
}

.rpg-foundation-card__header span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.rpg-foundation-card__header i {
    color: var(--color-accent);
}

.rpg-foundation-card__header small {
    color: rgba(255, 255, 255, 0.58);
    text-transform: none;
    white-space: nowrap;
}

.rpg-foundation-card strong {
    color: var(--color-text-primary);
    font-size: 0.82rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rpg-foundation-card p {
    color: var(--color-text-muted);
    font-size: 0.68rem;
    line-height: 1.35;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rpg-foundation-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}

.rpg-scene-compass {
    border-bottom: 1px solid rgba(120, 132, 220, 0.12);
}

.rpg-scene-compass__identity {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0;
}

.rpg-scene-compass__hero-line {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.rpg-scene-compass__hero-line strong {
    color: var(--color-text-primary);
    font-size: 0.92rem;
    line-height: 1.2;
}

.rpg-scene-compass__hero-line small {
    color: rgba(56, 224, 168, 0.82);
    font-size: 0.72rem;
    line-height: 1.2;
}

.rpg-scene-compass__hero-meta {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.74rem;
    line-height: 1.3;
}

.rpg-scene-compass__context {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.rpg-scene-compass__location,
.rpg-scene-compass__objective {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(120, 132, 220, 0.16);
    background: rgba(10, 13, 28, 0.42);
}

.rpg-scene-compass__location i,
.rpg-scene-compass__objective i {
    color: var(--color-accent);
}

.rpg-scene-compass__location strong,
.rpg-scene-compass__objective strong {
    color: var(--color-text-primary);
    font-size: 0.76rem;
    line-height: 1.25;
}

.rpg-scene-compass__location small,
.rpg-scene-compass__objective small,
.rpg-scene-compass__objective em {
    color: var(--color-text-muted);
    font-size: 0.68rem;
    line-height: 1.2;
    font-style: normal;
}

.rpg-scene-compass__objective > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rpg-foundation-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(86, 198, 255, 0.12);
    border: 1px solid rgba(86, 198, 255, 0.22);
    color: rgba(232, 244, 255, 0.88);
    font-size: 0.66rem;
    line-height: 1.2;
}

.rpg-foundation-chip.is-muted {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
}

.rpg-foundation-chip--risk {
    background: rgba(255, 187, 84, 0.12);
    border-color: rgba(255, 187, 84, 0.25);
}

.rpg-foundation-card[data-tone="danger"],
.rpg-foundation-card[data-urgency="high"] {
    border-color: rgba(255, 81, 98, 0.32);
}

.rpg-foundation-card[data-tone="tense"],
.rpg-foundation-card[data-urgency="medium"] {
    border-color: rgba(255, 187, 84, 0.3);
}

.rpg-foundation-card--support {
    display: none;
}

.chat-character-card {
    width: min(100%, 960px);
    margin: 0 auto;
    color: #edf2ec;
}

.chat-character-card__header {
    display: grid;
    gap: 6px;
    padding: 4px 0 22px;
    border-bottom: 1px solid rgba(118, 174, 164, 0.18);
}

.chat-character-card__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: #63aaa0;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.chat-character-card__header p {
    margin: 0;
    color: #9eb0ad;
    font-size: 0.86rem;
}

.chat-character-card__identity {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 30px 0;
}

.chat-character-card__crest {
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(218, 146, 88, 0.38);
    border-radius: 6px;
    background: #0e1b1e;
    color: #da9258;
    font-size: 2rem;
    box-shadow: inset 0 0 0 6px rgba(218, 146, 88, 0.04);
}

.chat-character-card__copy {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.chat-character-card__copy h3 {
    margin: 0;
    color: #edf2ec;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.65rem, 3vw, 2.5rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.chat-character-card__copy p {
    max-width: 720px;
    margin: 0;
    color: #c5d0cd;
    font-size: 0.9rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.chat-character-card__status {
    display: grid;
    gap: 12px;
    padding: 18px 0 22px;
    border-top: 1px solid rgba(118, 174, 164, 0.14);
}

.chat-character-card__status[hidden] {
    display: none;
}

.chat-character-card__status > span {
    color: #63aaa0;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.chat-character-card__status dl {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.chat-character-status__item {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(118, 174, 164, 0.16);
    border-radius: 6px;
    background: rgba(14, 27, 30, 0.38);
}

.chat-character-status__item[data-tone="tense"],
.chat-character-card__status[data-tone="tense"] .chat-character-status__item:first-child {
    border-color: rgba(218, 146, 88, 0.42);
}

.chat-character-status__item[data-tone="danger"],
.chat-character-card__status[data-tone="danger"] .chat-character-status__item:first-child {
    border-color: rgba(255, 91, 105, 0.42);
}

.chat-character-status__item dt {
    margin: 0 0 5px;
    color: #9eb0ad;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
}

.chat-character-status__item dd {
    margin: 0;
    color: #edf2ec;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.chat-character-card__traits {
    display: grid;
    gap: 14px;
    padding-top: 22px;
    border-top: 1px solid rgba(118, 174, 164, 0.14);
}

.chat-character-card__traits > span {
    color: #63aaa0;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.chat-character-card__traits ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chat-character-card__traits li {
    min-width: 0;
    padding: 14px 16px;
    border-left: 2px solid rgba(218, 146, 88, 0.52);
    background: rgba(14, 27, 30, 0.46);
    color: #c5d0cd;
    font-size: 0.84rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .chat-character-card__identity {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 16px;
        padding: 22px 0;
    }

    .chat-character-card__crest {
        width: 76px;
        height: 76px;
        font-size: 1.45rem;
    }

    .chat-character-card__traits ul {
        grid-template-columns: minmax(0, 1fr);
    }

    .chat-character-card__status dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rpg-foundation-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 6px 10px 0;
        gap: 6px;
    }

    .rpg-foundation-card__chips {
        display: none;
    }

    .rpg-foundation-card--npc {
        display: none;
    }

    .rpg-scene-compass__identity,
    .rpg-scene-compass__context {
        width: 100%;
    }

    .rpg-scene-compass__context {
        justify-content: flex-start;
        gap: 8px;
    }

    .rpg-scene-compass__location,
    .rpg-scene-compass__objective {
        max-width: 100%;
    }
}

@media (max-width: 560px) {
    .rpg-foundation-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .rpg-scene-compass__hero-line strong {
        font-size: 0.8rem;
    }

    .rpg-scene-compass__hero-meta {
        font-size: 0.7rem;
    }

    .rpg-scene-compass__location,
    .rpg-scene-compass__objective {
        padding: 5px 9px;
    }

    .rpg-scene-compass__location strong,
    .rpg-scene-compass__objective strong {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .rpg-foundation-card__header {
        font-size: 0.58rem;
    }

    .rpg-foundation-card__header small {
        display: none;
    }

    .chat-character-card__status dl {
        grid-template-columns: minmax(0, 1fr);
    }
}
