/* Phrases page, see static/js/phrases.js */

.ph-page {
    padding-inline: 1rem;
    box-sizing: border-box;
    max-width: 100%;
}

/* Era picker is a native select in the filter row (see collectibles.css .filters) */

.ph-btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.45rem;
    height: 2.75rem;
    padding: 0 1rem;
    background: #1f1f1f;
    color: var(--silver);
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    font: 16px "Alef", sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

/* Tabs: compact so 10-15 of them wrap into a few calm rows */
.ph-tab {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.4rem;
    height: 2.2rem;
    padding: 0 0.75rem;
    background: transparent;
    color: var(--silver);
    border: 1px solid #333;
    border-radius: 8px;
    font: 14px "Alef", sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.ph-tab img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.ph-tab:hover,
.ph-btn:hover {
    border-color: var(--primary);
    color: var(--white);
}

.ph-tab:focus-visible,
.ph-btn:focus-visible,
.ph-link:focus-visible,
.ph-login:focus-visible,
.ph-names input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.ph-tab[aria-pressed="true"] {
    border-color: var(--primary);
    background: rgba(223, 131, 25, 0.18);
    color: var(--white);
}

.ph-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    max-width: 60rem;
    margin: 0.75rem auto 0;
}

.ph-num {
    font-size: 0.75rem;
    opacity: 0.55;
}

.ph-tab[aria-pressed="true"] .ph-num {
    opacity: 0.8;
}

/* Subheading between the "using" and "finding" phrases of an item tab */
.ph-sub {
    margin: 1.4rem 0 0;
    padding: 0 0.25rem 0.4rem;
    border-bottom: 1px solid #3a3a3a;
    color: var(--gold);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
}

.ph-sub:first-child {
    margin-top: 0.5rem;
}

.ph-filters {
    margin-inline: 0;
    margin-bottom: 0.25rem;
}

.ph-filters input[type="search"] {
    flex: 1 1 14rem;
    max-width: 22rem;
}

.ph-filters select[hidden],
.ph-login[hidden] {
    display: none;
}

.ph-login {
    color: var(--silver);
    opacity: 0.75;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ph-login:hover {
    opacity: 1;
    color: var(--white);
}

/* Status line */
.ph-status {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    max-width: 52rem;
    margin: 1rem auto 0.25rem;
    padding: 0 0.25rem;
    color: var(--silver);
    font-size: 14px;
}

.ph-status-text {
    margin: 0;
    opacity: 0.85;
    min-height: 1.4em;
}

.ph-status-links {
    display: flex;
    gap: 1rem;
}

.ph-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--silver);
    font: 14px "Alef", sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.ph-link:hover {
    color: var(--white);
}

.ph-names {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: flex-end;
    max-width: 52rem;
    margin: 0.25rem auto 0;
    color: var(--silver);
    font-size: 14px;
}

.ph-names[hidden] {
    display: none;
}

.ph-names label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.ph-names input {
    height: 2.1rem;
    width: 10rem;
    max-width: 40vw;
    background: #1f1f1f;
    color: var(--silver);
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 0 0.6rem;
    font: 15px "Alef", sans-serif;
}

/* Phrase lines */
.ph-list {
    list-style: none;
    margin: 0.5rem auto 0;
    padding: 0;
    max-width: 52rem;
}

.ph-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem 1rem;
    padding: 0.8rem 0.25rem;
    border-bottom: 1px solid #2c2c2c;
    color: var(--silver);
    text-align: left;
    scroll-margin-top: 6rem;
    transition: background 0.3s;
}

.ph-line.ph-flash {
    background: rgba(223, 131, 25, 0.16);
}

.ph-text {
    flex: 1 1 22rem;
    min-width: 0;
    font-size: 17px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    color: var(--white);
}

.ph-meta {
    display: flex;
    flex: none;
    align-items: center;
    gap: 0.6rem;
}

.ph-mark {
    font-size: 13px;
    min-width: 3.2rem;
    text-align: right;
}

.ph-mark-own {
    color: #7fd6a2;
    font-size: 16px;
}

.ph-mark-miss {
    color: var(--silver);
    opacity: 0.6;
}

.ph-name {
    display: inline-block;
    padding: 0 0.35rem;
    border-radius: 5px;
    font-size: 0.85em;
    line-height: 1.4;
    background: rgba(223, 131, 25, 0.14);
    color: #ffc27a;
}

.ph-name.ph-p2 {
    background: rgba(88, 140, 220, 0.14);
    color: #a9c8ff;
}

.ph-u {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ph-text strong {
    color: var(--white);
}

.ph-item-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 13px;
    color: var(--gold);
}

.ph-item-label img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.ph-kind-default { border-color: #4a4a4a; }
.ph-kind-backpack { border-color: #8a6d1f; color: var(--gold); }
.ph-kind-limited { border-color: #a8503f; color: #ffab97; }

/* Ownership: dim the text, keep badges readable */
.ph-line.is-missing .ph-text,
.ph-line.is-missing .ph-item-label {
    opacity: 0.55;
    filter: grayscale(1);
}

.ph-line .src-tip {
    left: auto;
    right: 0;
    transform: none;
}

.ph-empty {
    text-align: center;
    margin: 1.5rem 0;
    color: var(--silver);
}

.ph-empty[hidden],
.ph-btn[hidden] {
    display: none;
}

.ph-more-wrap {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.ph-btn {
    justify-content: center;
}

@media (max-width: 600px) {
    .ph-meta {
        flex: 1 1 100%;
    }

    .ph-names input {
        width: 7.5rem;
    }

    .ph-line .src-tip {
        right: auto;
        left: 0;
        max-width: 70vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ph-line,
    .ph-tab {
        transition: none;
    }
}

/* The shared collection.css corner marker is replaced by .ph-mark in the line */
.ph-line.is-owned::after,
.ph-line.is-missing::after {
    content: none;
    display: none;
}

.ph-status-text {
    font-size: 14px;
}

@media (max-width: 600px) {
    .ph-mark {
        margin-left: auto;
    }
}
