/* Avatar Display */
.avatar-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-svg {
    display: block;
}

/* Avatar in player seats */
.seat-avatar {
    margin-bottom: 4px;
}

/* Avatar in player area (self) */
.player-avatar {
    margin-top: 4px;
}

/* Avatar in room lobby */
.lobby-avatar {
    margin-right: 10px;
    flex-shrink: 0;
}

/* ---- Avatar Editor ---- */
.avatar-editor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.avatar-preview {
    width: 96px;
    height: 116px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.editor-tabs {
    display: flex;
    gap: 4px;
    width: 100%;
    justify-content: center;
}

.editor-tab {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85em;
    transition: all 0.2s;
}

.editor-tab:hover {
    border-color: var(--accent-gold);
    color: var(--text-primary);
}

.editor-tab.active {
    background: var(--accent-gold);
    color: #1a1a1a;
    border-color: var(--accent-gold);
    font-weight: bold;
}

.editor-panels {
    width: 100%;
}

.editor-panel {
    display: none;
}

.editor-panel.active {
    display: block;
}

.option-group {
    margin-bottom: 10px;
}

.option-group label {
    display: block;
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-strip {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.outfit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* Outfit option cards */
.outfit-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: var(--text-secondary);
}

.outfit-option:hover {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.08);
    transform: scale(1.03);
}

.outfit-option.selected {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.outfit-thumb {
    width: 48px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.outfit-label {
    font-size: 0.7em;
    text-align: center;
    line-height: 1.1;
}

/* Color swatch buttons */
.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.15);
    border-color: var(--text-secondary);
}

.color-option.selected {
    border-color: var(--accent-gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
    transform: scale(1.1);
}

/* Text option buttons */
.text-option {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8em;
    transition: all 0.2s;
    white-space: nowrap;
}

.text-option:hover {
    border-color: var(--accent-gold);
    color: var(--text-primary);
}

.text-option.selected {
    background: var(--accent-gold);
    color: #1a1a1a;
    border-color: var(--accent-gold);
    font-weight: bold;
}

/* ---- Sena Panel ---- */
.sena-area {
    text-align: center;
    margin-top: 8px;
}

.btn-sena {
    background: #6a4aa0;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
}

.btn-sena:hover {
    background: #7a5ab0;
}

.sena-panel {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.sena-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.sena-option:hover {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.sena-option span {
    font-size: 0.7em;
    color: var(--text-secondary);
    text-align: center;
}

.sena-preview-svg {
    display: block;
}

/* Sena notification glow on avatar */
.avatar-sena-active {
    animation: senaGlow 1.5s ease-in-out;
}

@keyframes senaGlow {
    0% { filter: none; }
    15% { filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.8)); }
    85% { filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.8)); }
    100% { filter: none; }
}

/* Avatar edit button in room lobby */
.btn-edit-avatar {
    padding: 4px 10px;
    font-size: 0.75em;
    border-radius: 10px;
    background: var(--btn-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.btn-edit-avatar:hover {
    background: var(--btn-secondary-hover);
}

/* Avatar editor modal overlay */
.avatar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.avatar-modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.avatar-modal-content h3 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    text-align: center;
}

.avatar-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

/* Responsive */
@media (max-width: 600px) {
    .sena-panel {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .outfit-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .editor-tab {
        padding: 5px 10px;
        font-size: 0.75em;
    }

    .avatar-preview {
        width: 80px;
        height: 96px;
    }

    .color-option {
        width: 28px;
        height: 28px;
    }

    .text-option {
        padding: 4px 8px;
        font-size: 0.75em;
    }
}
