/* === Player identity, relic strips, settings, and the Players screen === */

/* Your portrait and name in the stats bar (click to open Players) */
.player-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0;
    padding: 0 10px 0 0;
    background: none;
    border: 1px solid transparent;
    border-radius: 24px;
    color: inherit;
    cursor: pointer;
}

.player-identity:hover {
    border-color: var(--accent);
    background: rgba(124, 58, 237, 0.12);
}

.portrait {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', serif;
    font-weight: 900;
    color: var(--will-glow);
    background: radial-gradient(circle, var(--bg-light), var(--bg-dark));
    border: 2px solid var(--body-color);
}

.portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Relics in play: a shelf of glowing medallions at the start of each side's board row */
.relic-shelf {
    display: flex;
    gap: 8px;
    align-self: stretch;
    align-items: center;
    padding-right: 10px;
    margin-right: 4px;
    border-right: 1px solid rgba(245, 158, 11, 0.35);
}

.relic-medallion {
    --relic-color: var(--essence-color);
    width: calc(var(--board-card-w) * 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    cursor: default;
}

.relic-medallion.domain-void { --relic-color: var(--void-glow); }
.relic-medallion.domain-blood { --relic-color: var(--blood-glow); }
.relic-medallion.domain-body { --relic-color: var(--body-glow); }
.relic-medallion.domain-will { --relic-color: var(--will-glow); }
.relic-medallion.domain-shadow { --relic-color: #9ca3af; }

.relic-medallion-art {
    width: calc(var(--board-card-w) * 0.72);
    aspect-ratio: 1;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-dark);
    border: 4px double var(--essence-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    position: relative;
    box-shadow: 0 0 10px color-mix(in srgb, var(--relic-color) 45%, transparent), inset 0 0 12px rgba(0, 0, 0, 0.6);
}

/* The breathing glow: a fixed shadow whose opacity changes, which the GPU handles
   without repainting (animating box-shadow itself repainted every frame) */
.relic-medallion-art::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 22px color-mix(in srgb, var(--relic-color) 75%, transparent);
    animation: glow-breathe 3s ease-in-out infinite;
}

@keyframes glow-breathe {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 1; }
}

.relic-medallion:hover .relic-medallion-art {
    border-color: #fde68a;
}

.relic-medallion-name {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--essence-color);
}

.relic-medallion-text {
    font-size: 0.62rem;
    line-height: 1.15;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* A relic's ability just triggered */
.relic-medallion.fx-relic-fire .relic-medallion-art {
    animation: relic-fire 0.9s ease-out;
}

/* Transform only (its ::after glow keeps breathing); animating box-shadow repainted every frame */
@keyframes relic-fire {
    0%, 100% { transform: scale(1); }
    35%      { transform: scale(1.18); }
}

/* Settings toggles at the bottom of the side panel */
#settings-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--text-secondary);
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid var(--border-subtle);
}

#settings-box label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

#settings-box input {
    accent-color: var(--accent);
    flex-shrink: 0;
}

/* === Players screen === */

.profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 104; /* just under the deck builder, which can open on top of it */
    display: grid;
    grid-template-rows: auto 1fr;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.1) 0%, transparent 60%),
        var(--bg-darkest);
}

.action-btn.profile-close {
    margin-left: auto;
}

.profile-body {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 0;
}

.profile-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border-right: 1px solid var(--border-subtle);
    background: var(--bg-dark);
    overflow-y: auto;
}

.profile-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.profile-item:hover {
    border-color: var(--border-subtle);
}

.profile-item.selected {
    border-color: var(--accent);
    background: rgba(124, 58, 237, 0.15);
}

.profile-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--essence-color);
    color: #1a1206;
}

.action-btn.profile-new {
    margin-top: 8px;
}

/* Save file info at the bottom of the player list */
.profile-save {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-editor {
    padding: 18px 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 820px;
}

.profile-label {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.profile-section {
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.portrait-section {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

.portrait.portrait-large {
    width: 160px;
    height: 160px;
    font-size: 4rem;
    border-width: 3px;
}

.portrait-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.profile-prompt {
    width: 100%;
    font: 0.85rem/1.35 'Crimson Text', Georgia, serif;
    padding: 6px 8px;
    resize: none;
    background: var(--bg-medium);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.portrait-side > .action-btn {
    align-self: flex-start;
}

.profile-deck {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.profile-deck input {
    accent-color: var(--accent);
}

.profile-deck-name {
    font-weight: 600;
}

.profile-deck-info {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.profile-actions .action-btn.db-save {
    flex-basis: auto;
    flex: 1;
}
